New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

veplayer-mp-wechat

Package Overview
Dependencies
Maintainers
0
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

veplayer-mp-wechat - npm Package Compare versions

Comparing version

to
1.2.9-rc.7

5

dist/behaviors/videoEventsBehavior.js
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -11,3 +8,3 @@ /* eslint-disable object-shorthand */

const index_1 = require("../enums/index");
const index_2 = __importDefault(require("../tool/index"));
const index_2 = require("../tool/index");
exports.default = Behavior({

@@ -14,0 +11,0 @@ properties: {

6

dist/collector-constructor/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.initCollector = void 0;
var veplayer_mp_logger_1 = require("veplayer-mp-logger");
Object.defineProperty(exports, "initCollector", { enumerable: true, get: function () { return veplayer_mp_logger_1.initCollector; } });
exports.DefaultCollector = void 0;
const veplayer_mp_logger_1 = require("veplayer-mp-logger");
exports.DefaultCollector = veplayer_mp_logger_1.default;

@@ -27,3 +27,3 @@ "use strict";

exports.PKG = 'wechat';
exports.VERSION = '1.2.9-rc.6';
exports.VERSION = '1.2.9-rc.7';
/**

@@ -30,0 +30,0 @@ * 控制栏状态枚举

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -12,5 +9,5 @@ /* eslint-disable no-magic-numbers */

const eventemitter3_1 = require("eventemitter3");
const videoBehavior_1 = __importDefault(require("./behaviors/videoBehavior"));
const collectorBehavior_1 = __importDefault(require("./behaviors/collectorBehavior"));
const interact_behavior_1 = __importDefault(require("./behaviors/interact_behavior"));
const videoBehavior_1 = require("./behaviors/videoBehavior");
const collectorBehavior_1 = require("./behaviors/collectorBehavior");
const interact_behavior_1 = require("./behaviors/interact_behavior");
const index_1 = require("./enums/index");

@@ -20,3 +17,3 @@ const index_2 = require("./xgerror/index");

const index_4 = require("./request/index");
const index_5 = __importDefault(require("./tool/index"));
const index_5 = require("./tool/index");
(0, index_3.XgComponent)({

@@ -23,0 +20,0 @@ behaviors: ['wx://component-export', videoBehavior_1.default, collectorBehavior_1.default, interact_behavior_1.default],

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const index_1 = require("../../utils/index");
const plugin_useraction_behavior_1 = __importDefault(require("../../behaviors/plugin_useraction_behavior"));
const plugin_useraction_behavior_1 = require("../../behaviors/plugin_useraction_behavior");
(0, index_1.XgComponent)({

@@ -9,0 +6,0 @@ behaviors: [plugin_useraction_behavior_1.default],

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -9,4 +6,4 @@ /* eslint-disable no-magic-numbers */

/* eslint-disable @typescript-eslint/naming-convention */
const videoEventsBehavior_1 = __importDefault(require("../../behaviors/videoEventsBehavior"));
const index_1 = __importDefault(require("../../tool/index"));
const videoEventsBehavior_1 = require("../../behaviors/videoEventsBehavior");
const index_1 = require("../../tool/index");
const index_2 = require("../../utils/index");

@@ -13,0 +10,0 @@ const index_3 = require("../../enums/index");

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const index_1 = require("../../utils/index");
const videoEventsBehavior_1 = __importDefault(require("../../behaviors/videoEventsBehavior"));
const plugin_useraction_behavior_1 = __importDefault(require("../../behaviors/plugin_useraction_behavior"));
const index_2 = __importDefault(require("../../tool/index"));
const videoEventsBehavior_1 = require("../../behaviors/videoEventsBehavior");
const plugin_useraction_behavior_1 = require("../../behaviors/plugin_useraction_behavior");
const index_2 = require("../../tool/index");
(0, index_1.XgComponent)({

@@ -11,0 +8,0 @@ behaviors: [videoEventsBehavior_1.default, plugin_useraction_behavior_1.default],

@@ -30,22 +30,33 @@ "use strict";

*/
setCollector: function (Collector, config = { appVersion: '1.0.0', appName: '视频云微信小程序', appId: 0, userId: 0, needET: false, log: false }) {
setCollector(Collector, config) {
const { appId = 0, userId = '', } = config || {};
wx.__COLLECTOR__ = Collector;
wx.__COLLECTOR_INFO__ = {
lineAppId: config.appId,
lineUserId: config.userId || 0
lineAppId: appId,
lineUserId: userId,
};
if (wx.__COLLECTOR__ && wx.__COLLECTOR__.uploader) {
this.initUploader(wx.__COLLECTOR__, config);
},
/**
* @description 初始化日志的tea的实例
* @param collector 日志构造函数
* @param config 日志配置
*/
initUploader(collector, config) {
var _a;
const { appVersion = '1.0.0', appName = '视频云小程序', userId = '', needET = false, log = false, channelDomain, verifyUrl, } = config || {};
if (collector && collector.uploader && !((_a = collector.uploader) === null || _a === void 0 ? void 0 : _a.TEA)) {
const _data = {
log: config.log,
app_name: config.appName || '视频云微信小程序',
app_version: config.appVersion || '1.0.0',
user_unique_id: config.userId || '',
channel_domain: config.channelDomain
log: log,
app_name: appName,
app_version: appVersion,
user_unique_id: userId || '',
channel_domain: channelDomain,
};
if (config.channelDomain) {
_data.channel_domain = config.channelDomain;
if (channelDomain) {
_data.channel_domain = channelDomain;
}
config.needET && (_data['event_verify_url'] = 'https://xxx.xx.xx');
config.log && (_data.log = config.log);
wx.__COLLECTOR__.uploader.init(_data);
needET && (_data.event_verify_url = verifyUrl || 'hwxps://xxx.xx.xx');
log && (_data.log = log);
collector.uploader.init(_data);
}

@@ -55,3 +66,4 @@ },

* @description 初始化埋点上报对象
* @param config
* @param config 日志配置
* @param videoInfo 视频信息
* @returns

@@ -61,21 +73,30 @@ */

try {
if (!wx.__COLLECTOR__) {
// 如果没有__COLLECTOR__说明没有初始化日志,则在内部初始化
if (index_1.initCollector && typeof index_1.initCollector === 'function' && config.appId) {
index_2.VE_DEBUGGER.log('init logger by logInfo');
// @ts-ignore
(0, index_1.initCollector)(config);
}
else {
index_2.VE_DEBUGGER.warn('the appId of logger config has not set');
}
const { appId = 0, userId } = config || {};
if (index_1.DefaultCollector && typeof index_1.DefaultCollector === 'function' && config.appId) {
// 优先使用logInfo的本地初始化
this.initUploader(index_1.DefaultCollector, config);
const _c = Object.assign({ lineAppId: appId, lineUserId: userId }, config);
index_2.VE_DEBUGGER.log('init logger by logInfo');
return new index_1.DefaultCollector({
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
config: _c,
videoInfo: videoInfo
});
}
const _c = Object.assign({ lineAppId: wx.__COLLECTOR_INFO__.lineAppId | 0, lineUserId: wx.__COLLECTOR_INFO__.lineUserId }, config);
return new wx.__COLLECTOR__({
config: _c,
videoInfo: videoInfo || {}
});
else if (wx.__COLLECTOR__) {
// 如果logInfo没有,则使用wx.__COLLECTOR__ 实例化
const _c = Object.assign({ lineAppId: wx.__COLLECTOR_INFO__.lineAppId | 0, lineUserId: wx.__COLLECTOR_INFO__.lineUserId }, config);
index_2.VE_DEBUGGER.warn('init logger by initCollector has deprecated,please pass the appid and userId in the component\'s logInfo property');
return new wx.__COLLECTOR__({
config: _c,
videoInfo: videoInfo
});
}
else {
index_2.VE_DEBUGGER.warn('logger config has not set');
return null;
}
}
catch (e) {
// console.error('initCollector error', e)
return null;

@@ -82,0 +103,0 @@ }

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CollectorManager = exports.default = void 0;
const mediaManager_1 = __importDefault(require("./mediaManager"));
const mediaManager_1 = require("./mediaManager");
exports.default = mediaManager_1.default;
const collector_1 = __importDefault(require("./collector"));
const collector_1 = require("./collector");
exports.CollectorManager = collector_1.default;
{
"name": "veplayer-mp-wechat",
"version": "1.2.9-rc.6",
"version": "1.2.9-rc.7",
"dependencies": {

@@ -5,0 +5,0 @@ "eventemitter3": "^5.0.1",