@univerjs-pro/collaboration-cluster-redis 1.6.2 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object['defineProperty'](exports,Symbol['toStringTag'],{'value':'Module'});let e=require('node:crypto');function t(
|
|
1
|
+
Object['defineProperty'](exports,Symbol['toStringTag'],{'value':'Module'});let e=require('node:crypto');function t(_0xae2a6d){return typeof _0xae2a6d['pSubscribe']=='function';}function n(_0x2e112d,_0x193125,..._0x241a27){return _0x2e112d[_0x193125]['apply'](_0x2e112d,_0x241a27);}function r(_0x45f161,_0x4ddd8a,_0x4befaa){let _0x92f879=_0x4ddd8a['filter'](_0x344475=>typeof _0x45f161[_0x344475]!='function');if(_0x92f879['length']>0x0)throw TypeError(_0x4befaa+'\x20is\x20missing\x20Redis\x20methods:\x20'+_0x92f879['join'](',\x20'));}var i=class{['_client'];['_nodeRedis'];constructor(_0x1c25cd,_0x38d292,_0x12e838){if(this['_client']=_0x1c25cd,!_0x1c25cd||typeof _0x1c25cd!='object')throw TypeError(_0x38d292+'\x20must\x20be\x20a\x20Redis\x20client');this['_nodeRedis']=t(_0x1c25cd);let _0x38f008=[];_0x12e838['publish']&&_0x38f008['push'](_0x12e838['sharded']?this['_nodeRedis']?'sPublish':'spublish':'publish'),_0x12e838['tickets']&&_0x38f008['push']('set',this['_nodeRedis']?'getDel':'getdel'),r(_0x1c25cd,_0x38f008,_0x38d292);}['publish'](_0x3ed96c,_0x562e6a,_0x3c2d94){let _0x5ab6ff=_0x3c2d94?this['_nodeRedis']?'sPublish':'spublish':'publish';return n(this['_client'],_0x5ab6ff,_0x3ed96c,_0x562e6a);}async['setIfAbsent'](_0x4184e7,_0x291c14,_0x485135){return(this['_nodeRedis']?await n(this['_client'],'set',_0x4184e7,_0x291c14,{'PX':_0x485135,'NX':!0x0}):await n(this['_client'],'set',_0x4184e7,_0x291c14,'PX',_0x485135,'NX'))==='OK';}['getDel'](_0x5044b4){return n(this['_client'],this['_nodeRedis']?'getDel':'getdel',_0x5044b4);}},a=class{['_client'];['_sharded'];['_onMessage'];['_nodeRedis'];['_event'];['_listeners']=new Map();['_onIoRedisMessage'];constructor(_0x3c67d1,_0x3a2d7a,_0x1121bc){if(this['_client']=_0x3c67d1,this['_sharded']=_0x3a2d7a,this['_onMessage']=_0x1121bc,!_0x3c67d1||typeof _0x3c67d1!='object')throw TypeError('subClient\x20must\x20be\x20a\x20Redis\x20client');this['_nodeRedis']=t(_0x3c67d1),this['_event']=_0x3a2d7a?'smessage':'message',r(_0x3c67d1,this['_nodeRedis']?_0x3a2d7a?['sSubscribe','sUnsubscribe']:['subscribe','unsubscribe']:_0x3a2d7a?['ssubscribe','sunsubscribe','on','off']:['subscribe','unsubscribe','on','off'],'subClient');let _0x5e1995=_0x3c67d1;if(!this['_nodeRedis']&&_0x3a2d7a&&_0x5e1995['isCluster']===!0x0&&_0x5e1995['options']?.['shardedSubscribers']!==!0x0)throw TypeError('subClient\x20is\x20an\x20ioredis\x20Cluster\x20without\x20{\x20shardedSubscribers:\x20true\x20},\x20required\x20for\x20sharded\x20pub/sub');this['_onIoRedisMessage']=(_0x26092d,_0x4607a5)=>this['_onMessage'](_0x26092d,_0x4607a5),this['_nodeRedis']||this['_client']['on'](this['_event'],this['_onIoRedisMessage']);}async['subscribe'](_0x4a993d){if(!this['_nodeRedis']){await n(this['_client'],this['_sharded']?'ssubscribe':'subscribe',_0x4a993d);return;}let _0x86f3f5=(_0x2a5402,_0x10400b)=>this['_onMessage'](_0x10400b,_0x2a5402);this['_listeners']['set'](_0x4a993d,_0x86f3f5);try{await n(this['_client'],this['_sharded']?'sSubscribe':'subscribe',_0x4a993d,_0x86f3f5);}catch(_0x5c6011){throw this['_listeners']['get'](_0x4a993d)===_0x86f3f5&&this['_listeners']['delete'](_0x4a993d),_0x5c6011;}}async['unsubscribe'](_0x1b58f6){if(!this['_nodeRedis']){if(this['_sharded']){let _0x25c97e=(await Promise['allSettled'](_0x1b58f6['map'](_0x5d4631=>n(this['_client'],'sunsubscribe',_0x5d4631))))['find'](_0x22c584=>_0x22c584['status']==='rejected');if(_0x25c97e)throw _0x25c97e['reason'];}else await n(this['_client'],'unsubscribe',..._0x1b58f6);return;}let _0x110f7c=(await Promise['allSettled'](_0x1b58f6['map'](_0x5279ac=>{let _0x57fa94=this['_listeners']['get'](_0x5279ac);return this['_listeners']['delete'](_0x5279ac),n(this['_client'],this['_sharded']?'sUnsubscribe':'unsubscribe',_0x5279ac,_0x57fa94);})))['find'](_0xd0a60d=>_0xd0a60d['status']==='rejected');if(_0x110f7c)throw _0x110f7c['reason'];}['detach'](){this['_nodeRedis']||this['_client']['off'](this['_event'],this['_onIoRedisMessage']);}},o='univer-collab:',s=class{['_commands'];['_subscription'];['_prefix'];['_sharded'];['_handlers']=new Map();['_subscribing']=new Map();['_onMessage']=(_0x974173,_0x2264d9)=>{for(let _0x2079c6 of[...this['_handlers']['get'](_0x974173)??[]])try{_0x2079c6(_0x2264d9);}catch{}};['_disposed']=!0x1;constructor(_0x1494e1){if(!_0x1494e1?.['pubClient']||!_0x1494e1['subClient'])throw TypeError('RedisPubSubAdapter\x20requires\x20pubClient\x20and\x20subClient');this['_prefix']=_0x1494e1['keyPrefix']??o,this['_sharded']=_0x1494e1['sharded']??!0x1,this['_commands']=new i(_0x1494e1['pubClient'],'pubClient',{'publish':!0x0,'sharded':this['_sharded']}),this['_subscription']=new a(_0x1494e1['subClient'],this['_sharded'],this['_onMessage']);}async['publish'](_0x30a8e2,_0x21d85c){this['_assertRunning']();let _0x2a3867=this['_channel'](_0x30a8e2);await this['_commands']['publish'](_0x2a3867,_0x21d85c,this['_sharded']);}async['subscribe'](_0x3b9390,_0x2ef44d){this['_assertRunning']();let _0x567ccd=this['_channel'](_0x3b9390),_0x1205d8=_0x28ad57=>_0x2ef44d(_0x28ad57),_0x344c09=this['_handlers']['get'](_0x567ccd);if(!_0x344c09){_0x344c09=new Set(),this['_handlers']['set'](_0x567ccd,_0x344c09);let _0x5e9989=this['_subscribeChannel'](_0x567ccd);this['_subscribing']['set'](_0x567ccd,_0x5e9989),_0x5e9989['finally'](()=>{this['_subscribing']['get'](_0x567ccd)===_0x5e9989&&this['_subscribing']['delete'](_0x567ccd);})['catch'](()=>void 0x0);}_0x344c09['add'](_0x1205d8);try{await this['_subscribing']['get'](_0x567ccd);}catch(_0x2fe557){throw this['_removeHandler'](_0x567ccd,_0x344c09,_0x1205d8,!0x1),_0x2fe557;}let _0xfa887c=!0x1;return{'dispose':()=>{_0xfa887c||(_0xfa887c=!0x0,this['_removeHandler'](_0x567ccd,_0x344c09,_0x1205d8,!0x0));}};}async['dispose'](){if(this['_disposed'])return;this['_disposed']=!0x0,this['_subscription']['detach']();let _0x36989e=[...this['_handlers']['keys']()];this['_handlers']['clear'](),_0x36989e['length']>0x0&&await this['_subscription']['unsubscribe'](_0x36989e);}['_channel'](_0x4c0d31){return''+this['_prefix']+_0x4c0d31;}['_subscribeChannel'](_0x1dd4f7){return this['_subscription']['subscribe'](_0x1dd4f7);}['_removeHandler'](_0x33d07b,_0x3c122b,_0x363277,_0x522ade){_0x3c122b['delete'](_0x363277),_0x3c122b['size']>0x0||this['_handlers']['get'](_0x33d07b)!==_0x3c122b||(this['_handlers']['delete'](_0x33d07b),_0x522ade&&!this['_disposed']&&this['_subscription']['unsubscribe']([_0x33d07b])['catch'](()=>void 0x0));}['_assertRunning'](){if(this['_disposed'])throw Error('RedisPubSubAdapter\x20is\x20disposed');}},c='univer-collab:',l=class{['_commands'];['_prefix'];['_disposed']=!0x1;constructor(_0x421a62){this['_commands']=new i(_0x421a62?.['client'],'client',{'tickets':!0x0}),this['_prefix']=_0x421a62['keyPrefix']??c;}async['issue'](_0x16fc35,_0x2298a3){if(this['_assertRunning'](),!Number['isSafeInteger'](_0x2298a3)||_0x2298a3<=0x0)throw TypeError('Session\x20ticket\x20TTL\x20must\x20be\x20a\x20positive\x20safe\x20integer');if(typeof _0x16fc35?.['userID']!='string'||!_0x16fc35['userID'])throw TypeError('Session\x20ticket\x20userID\x20must\x20be\x20a\x20non-empty\x20string');let _0x402106=JSON['stringify']({'userID':_0x16fc35['userID'],'customData':_0x16fc35['customData']}),_0x20378b=(0x0,e['randomBytes'])(0x20)['toString']('base64url');if(!await this['_commands']['setIfAbsent'](this['_key'](_0x20378b),_0x402106,_0x2298a3))throw Error('Session\x20ticket\x20collision');return _0x20378b;}async['consume'](_0x664a54){if(this['_disposed']||typeof _0x664a54!='string'||!_0x664a54)return null;let _0x3240ae=await this['_commands']['getDel'](this['_key'](_0x664a54));if(_0x3240ae===null)return null;let _0x30224b=JSON['parse'](_0x3240ae),_0x335438=Object['assign'](Object['create'](null),_0x30224b['customData']);return{'userID':_0x30224b['userID'],'customData':_0x335438};}async['dispose'](){this['_disposed']=!0x0;}['_key'](_0x3f5509){return this['_prefix']+'session-ticket:'+_0x3f5509;}['_assertRunning'](){if(this['_disposed'])throw Error('RedisSessionTicketStore\x20is\x20disposed');}};exports['RedisPubSubAdapter']=s,exports['RedisSessionTicketStore']=l;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x1099(_0x24a821,_0x283ed1){_0x24a821=_0x24a821-0x141;const _0x19dbd5=_0x19db();let _0x10999d=_0x19dbd5[_0x24a821];return _0x10999d;}const _0x553cdc=_0x1099;(function(_0x10370f,_0x3dd1b3){const _0x250351=_0x1099,_0x524560=_0x10370f();while(!![]){try{const _0x2510b4=parseInt(_0x250351(0x146))/0x1+-parseInt(_0x250351(0x142))/0x2+-parseInt(_0x250351(0x145))/0x3+-parseInt(_0x250351(0x141))/0x4+-parseInt(_0x250351(0x147))/0x5+parseInt(_0x250351(0x143))/0x6+parseInt(_0x250351(0x144))/0x7;if(_0x2510b4===_0x3dd1b3)break;else _0x524560['push'](_0x524560['shift']());}catch(_0x599cb4){_0x524560['push'](_0x524560['shift']());}}}(_0x19db,0xb0c29));import _0x1ff46d from'./index.cjs';const facadeExport0=_0x1ff46d[_0x553cdc(0x148)],facadeExport1=_0x1ff46d['RedisSessionTicketStore'];export{facadeExport0 as RedisPubSubAdapter,facadeExport1 as RedisSessionTicketStore};function _0x19db(){const _0x35f83a=['RedisPubSubAdapter','2685476UqONSE','633380sjhhyl','7741554GfPwXg','9822421zsbQcw','1268232lpoMSZ','234747mfCfgf','3966985iFoCBh'];_0x19db=function(){return _0x35f83a;};return _0x19db();}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=22"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.6.
|
|
7
|
+
"version": "1.6.3",
|
|
8
8
|
"main": "./dist/index.cjs",
|
|
9
9
|
"module": "./dist/index.mjs",
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"dist"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@univerjs-pro/collaboration-endpoint": "1.6.
|
|
23
|
-
"@univerjs-pro/collaboration-service": "1.6.
|
|
22
|
+
"@univerjs-pro/collaboration-endpoint": "1.6.3",
|
|
23
|
+
"@univerjs-pro/collaboration-service": "1.6.3"
|
|
24
24
|
}
|
|
25
25
|
}
|