diff --git a/pkg/arvo/app/chat-view.hoon b/pkg/arvo/app/chat-view.hoon index 000ee22db..8876dec41 100644 --- a/pkg/arvo/app/chat-view.hoon +++ b/pkg/arvo/app/chat-view.hoon @@ -207,7 +207,7 @@ ~ %- zing :~ (create-chat app-path.act security.act allow-history.act) - %- create-managed-group + %- create-group :* group-path.act security.act members.act @@ -215,8 +215,6 @@ description.act == (create-metadata title.act description.act group-path.act app-path.act) - (create-security group-path.act security.act) - ~[(permission-hook-poke [%add-owned group-path.act group-path.act])] == :: %delete @@ -229,9 +227,7 @@ == :: ?: (is-managed group-path) ~ - :~ (permission-hook-poke [%remove group-path]) - (permission-poke [%delete group-path]) - (group-poke [%unbundle group-path]) + :~ (group-poke [%unbundle group-path]) (metadata-hook-poke [%remove group-path]) == == @@ -253,18 +249,34 @@ (chat-hook-poke [%add-owned path security history]) == :: - ++ create-managed-group + ++ create-group |= [=path security=rw-security ships=(set ship) title=@t desc=@t] ^- (list card) ?^ (group-scry path) ~ :: do not create a managed group if this is a sig path or a blacklist :: ?: =(security %channel) - ~[(group-poke [%bundle path])] + :~ (group-poke [%bundle path]) + (create-security path security) + (permission-hook-poke [%add-owned path path]) + == ?: (is-managed path) ~[(contact-view-poke [%create path ships title desc])] :~ (group-poke [%bundle path]) (group-poke [%add ships path]) + (create-security path security) + (permission-hook-poke [%add-owned path path]) + == + :: + ++ create-security + |= [pax=path sec=rw-security] + ^- card + ?+ sec !! + %channel + (perm-group-hook-poke [%associate pax [[pax %black] ~ ~]]) + :: + %village + (perm-group-hook-poke [%associate pax [[pax %white] ~ ~]]) == :: ++ create-metadata @@ -284,17 +296,6 @@ (metadata-hook-poke [%add-owned group-path]) == :: - ++ create-security - |= [pax=path sec=rw-security] - ^- (list card) - ?+ sec ~ - %channel - ~[(perm-group-hook-poke [%associate pax [[pax %black] ~ ~]])] - :: - %village - ~[(perm-group-hook-poke [%associate pax [[pax %white] ~ ~]])] - == - :: ++ contact-view-poke |= act=[%create =path ships=(set ship) title=@t description=@t] ^- card diff --git a/pkg/arvo/app/contact-view.hoon b/pkg/arvo/app/contact-view.hoon index 5a8d3564a..294305218 100644 --- a/pkg/arvo/app/contact-view.hoon +++ b/pkg/arvo/app/contact-view.hoon @@ -6,7 +6,9 @@ *invite-store, *contact-hook, *metadata-store, - *metadata-hook + *metadata-hook, + *permission-group-hook, + *permission-hook /+ *server, *contact-json, base64, default-agent /= index /^ octs @@ -137,6 +139,8 @@ (contact-hook-poke [%add-owned path.act]) (group-hook-poke [%add our.bol path.act]) (group-poke [%add (~(put in ships.act) our.bol) path.act]) + (perm-group-hook-poke [%associate path.act [[path.act %white] ~ ~]]) + (permission-hook-poke [%add-owned path.act path.act]) == (create-metadata path.act title.act description.act) :: @@ -237,6 +241,20 @@ ^- card [%pass / %agent [our.bol %metadata-hook] %poke %metadata-hook-action !>(act)] :: +++ perm-group-hook-poke + |= act=permission-group-hook-action + ^- card + :* %pass / %agent [our.bol %permission-group-hook] + %poke %permission-group-hook-action !>(act) + == +:: +++ permission-hook-poke + |= act=permission-hook-action + ^- card + :* %pass / %agent [our.bol %permission-hook] + %poke %permission-hook-action !>(act) + == +:: ++ create-metadata |= [=path title=@t description=@t] ^- (list card) diff --git a/pkg/arvo/app/contacts/js/index.js b/pkg/arvo/app/contacts/js/index.js index 1271b7c17..3f54f9412 100644 --- a/pkg/arvo/app/contacts/js/index.js +++ b/pkg/arvo/app/contacts/js/index.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("buffer")):"function"==typeof define&&define.amd?define("index",["buffer"],t):t((e=e||self).buffer)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},n=t.performance||{},r=(n.now||n.mozNow||n.msNow||n.oNow||n.webkitNow,"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{});function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function a(e,t){return e(t={exports:{}},t.exports),t.exports}var l=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;var s=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,i=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),a=1;a2?n-2:0),i=2;i1?t-1:0),r=1;r2?n-2:0),i=2;i8)throw new Error("warningWithoutStack() currently supports at most 8 arguments.");if(!e){if("undefined"!=typeof console){var a=r.map(function(e){return""+e});a.unshift("Warning: "+t),Function.prototype.apply.call(console.error,console,a)}try{var l=0,o="Warning: "+t.replace(/%s/g,function(){return r[l++]});throw new Error(o)}catch(e){}}},T={};function N(e,t){var n=e.constructor,r=n&&(n.displayName||n.name)||"ReactClass",i=r+"."+t;T[i]||(S(!1,"Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,r),T[i]=!0)}var P={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,n){N(e,"forceUpdate")},enqueueReplaceState:function(e,t,n,r){N(e,"replaceState")},enqueueSetState:function(e,t,n,r){N(e,"setState")}},R={};function L(e,t,n){this.props=e,this.context=t,this.refs=R,this.updater=n||P}Object.freeze(R),L.prototype.isReactComponent={},L.prototype.setState=function(e,t){!function(){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw M(Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."))}(),this.updater.enqueueSetState(this,e,t,"setState")},L.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var O={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},A=function(e,t){Object.defineProperty(L.prototype,e,{get:function(){E(!1,"%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})};for(var I in O)O.hasOwnProperty(I)&&A(I,O[I]);function D(){}function U(e,t,n){this.props=e,this.context=t,this.refs=R,this.updater=n||P}D.prototype=L.prototype;var j=U.prototype=new D;j.constructor=U,t(j,L.prototype),j.isPureReactComponent=!0;var z={current:null},H={suspense:null},Z={current:null},F=/^(.*)[\\\/]/,V=1;function q(e){if(null==e)return null;if("number"==typeof e.tag&&S(!1,"Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case l:return"Fragment";case a:return"Portal";case u:return"Profiler";case o:return"StrictMode";case p:return"Suspense";case m:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case f:return"Context.Consumer";case c:return"Context.Provider";case h:return r=e,i=e.render,s="ForwardRef",d=i.displayName||i.name||"",r.displayName||(""!==d?s+"("+d+")":s);case v:return q(e.type);case b:var t=(n=e)._status===V?n._result:null;if(t)return q(t)}var n,r,i,s,d;return null}var W={},B=null;function $(e){B=e}W.getCurrentStack=null,W.getStackAddendum=function(){var e="";if(B){var t=q(B.type),n=B._owner;e+=function(e,t,n){var r="";if(t){var i=t.fileName,a=i.replace(F,"");if(/^index\./.test(a)){var l=i.match(F);if(l){var o=l[1];o&&(a=o.replace(F,"")+"/"+a)}}r=" (at "+a+":"+t.lineNumber+")"}else n&&(r=" (created by "+n+")");return"\n in "+(e||"Unknown")+r}(t,B._source,n&&q(n.type))}var r=W.getCurrentStack;return r&&(e+=r()||""),e};var Y={ReactCurrentDispatcher:z,ReactCurrentBatchConfig:H,ReactCurrentOwner:Z,IsSomeRendererActing:{current:!1},assign:t};t(Y,{ReactDebugCurrentFrame:W,ReactComponentTreeHook:{}});var Q,K,G=function(e,t){if(!e){for(var n=Y.ReactDebugCurrentFrame.getStackAddendum(),r=arguments.length,i=new Array(r>2?r-2:0),a=2;a1){for(var c=Array(s),f=0;f.")}return t}(t);if(!_e[n]){_e[n]=!0;var r="";e&&e._owner&&e._owner!==Z.current&&(r=" It was passed a child from "+q(e._owner.type)+"."),$(e),G(!1,'Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',n,r),$(null)}}}function Me(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n",u=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,G(!1,"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,u)}var f=re.apply(this,arguments);if(null==f)return f;if(o)for(var d=2;d is not supported and will be removed in a future major release. Did you mean to render instead?")),n.Provider},set:function(e){n.Provider=e}},_currentValue:{get:function(){return n._currentValue},set:function(e){n._currentValue=e}},_currentValue2:{get:function(){return n._currentValue2},set:function(e){n._currentValue2=e}},_threadCount:{get:function(){return n._threadCount},set:function(e){n._threadCount=e}},Consumer:{get:function(){return r||(r=!0,G(!1,"Rendering is not supported and will be removed in a future major release. Did you mean to render instead?")),n.Consumer}}}),n.Consumer=a,n._currentRenderer=null,n._currentRenderer2=null,n},forwardRef:function(e){return null!=e&&e.$$typeof===v?S(!1,"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?S(!1,"forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&S(!1,"forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null!=e.defaultProps||null!=e.propTypes)&&S(!1,"forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:h,render:e}},lazy:function(e){var t,n,r={$$typeof:b,_ctor:e,_status:-1,_result:null};return Object.defineProperties(r,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){G(!1,"React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(r,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return n},set:function(e){G(!1,"React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=e,Object.defineProperty(r,"propTypes",{enumerable:!0})}}}),r},memo:function(e,t){return ke(e)||S(!1,"memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:v,type:e,compare:void 0===t?null:t}},useCallback:function(e,t){return we().useCallback(e,t)},useContext:function(e,t){var n=we();if(void 0!==t&&G(!1,"useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",t,"number"==typeof t&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==e._context){var r=e._context;r.Consumer===e?G(!1,"Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&G(!1,"Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return n.useContext(e,t)},useEffect:function(e,t){return we().useEffect(e,t)},useImperativeHandle:function(e,t,n){return we().useImperativeHandle(e,t,n)},useDebugValue:function(e,t){return we().useDebugValue(e,t)},useLayoutEffect:function(e,t){return we().useLayoutEffect(e,t)},useMemo:function(e,t){return we().useMemo(e,t)},useReducer:function(e,t,n){return we().useReducer(e,t,n)},useRef:function(e){return we().useRef(e)},useState:function(e){return we().useState(e)},Fragment:l,Profiler:u,StrictMode:o,Suspense:p,unstable_SuspenseList:m,createElement:Se,cloneElement:function(e,n,r){for(var i=function(e,n,r){var i;!function(){if(null==e)throw M(Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+"."))}();var a,l=t({},e.props),o=e.key,u=e.ref,s=e._self,c=e._source,f=e._owner;if(null!=n)for(i in ee(n)&&(u=n.ref,f=Z.current),te(n)&&(o=""+n.key),e.type&&e.type.defaultProps&&(a=e.type.defaultProps),n)X.call(n,i)&&!J.hasOwnProperty(i)&&(void 0===n[i]&&void 0!==a?l[i]=a[i]:l[i]=n[i]);var d=arguments.length-2;if(1===d)l.children=r;else if(d>1){for(var h=Array(d),p=0;p=x},l=function(){},t.unstable_forceFrameRate=function(e){0>e||125T(l,n))void 0!==u&&0>T(u,l)?(e[r]=u,e[o]=n,r=o):(e[r]=l,e[a]=n,r=a);else{if(!(void 0!==u&&0>T(u,n)))break e;e[r]=u,e[o]=n,r=o}}}return t}return null}function T(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var N=[],P=[],R=1,L=null,O=3,A=!1,I=!1,D=!1;function U(e){for(var t=E(P);null!==t;){if(null===t.callback)S(P);else{if(!(t.startTime<=e))break;S(P),t.sortIndex=t.expirationTime,M(N,t)}t=E(P)}}function j(e){if(D=!1,U(e),!I)if(null!==E(N))I=!0,n(z);else{var t=E(P);null!==t&&r(j,t.startTime-e)}}function z(e,n){I=!1,D&&(D=!1,i()),A=!0;var l=O;try{for(U(n),L=E(N);null!==L&&(!(L.expirationTime>n)||e&&!a());){var o=L.callback;if(null!==o){L.callback=null,O=L.priorityLevel;var u=o(L.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?L.callback=u:L===E(N)&&S(N),U(n)}else S(N);L=E(N)}if(null!==L)var s=!0;else{var c=E(P);null!==c&&r(j,c.startTime-n),s=!1}return s}finally{L=null,O=l,A=!1}}function H(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var Z=l;t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=O;O=e;try{return t()}finally{O=n}},t.unstable_next=function(e){switch(O){case 1:case 2:case 3:var t=3;break;default:t=O}var n=O;O=t;try{return e()}finally{O=n}},t.unstable_scheduleCallback=function(e,a,l){var o=t.unstable_now();if("object"==typeof l&&null!==l){var u=l.delay;u="number"==typeof u&&0o?(e.sortIndex=u,M(P,e),null===E(N)&&e===E(P)&&(D?i():D=!0,r(j,u-o))):(e.sortIndex=l,M(N,e),I||A||(I=!0,n(z))),e},t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_wrapCallback=function(e){var t=O;return function(){var n=O;O=t;try{return e.apply(this,arguments)}finally{O=n}}},t.unstable_getCurrentPriorityLevel=function(){return O},t.unstable_shouldYield=function(){var e=t.unstable_now();U(e);var n=E(N);return n!==L&&null!==L&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime=_},a=function(){},t.unstable_forceFrameRate=function(e){e<0||e>125?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):x=e>0?Math.floor(1e3/e):33.33};var C=new MessageChannel,M=C.port2;C.port1.onmessage=function(){if(null!==k){var e=t.unstable_now();_=e+x;try{k(!0,e)?M.postMessage(null):(g=!1,k=null)}catch(e){throw M.postMessage(null),e}}else g=!1},e=function(e){k=e,g||(g=!0,M.postMessage(null))},n=function(e,n){w=p(function(){e(t.unstable_now())},n)},r=function(){m(w),w=-1}}function E(e,t){var n=e.length;e.push(t),function(e,t,n){var r=n;for(;;){var i=Math.floor((r-1)/2),a=e[i];if(!(void 0!==a&&N(a,t)>0))return;e[i]=t,e[r]=a,r=i}}(e,t,n)}function S(e){var t=e[0];return void 0===t?null:t}function T(e){var t=e[0];if(void 0!==t){var n=e.pop();return n!==t&&(e[0]=n,function(e,t,n){var r=n,i=e.length;for(;rB){if((B*=2)>W)return console.error("Scheduler Profiling: Event log exceeded maximum size. Don't forget to call `stopLoggingProfilingEvents()`."),void ae();var n=new Int32Array(4*B);n.set(Y),$=n.buffer,Y=n}Y.set(e,t)}}function ae(){var e=$;return B=0,$=null,Y=null,Q=0,e}function le(e,t){z[V]++,null!==Y&&ie([K,t,e.id,e.priorityLevel])}function oe(e,t){z[H]=P,z[Z]=0,z[V]--,null!==Y&&ie([G,t,e.id])}function ue(e,t){z[H]=P,z[Z]=0,z[F]=0,null!==Y&&ie([te,t,e.id,D])}var se=-1,ce=250,fe=5e3,de=1e4,he=1073741823,pe=[],me=[],ve=1,be=null,ye=O,ge=!1,ke=!1,we=!1;function xe(e){for(var t=S(me);null!==t;){if(null===t.callback)T(me);else{if(!(t.startTime<=e))return;T(me),t.sortIndex=t.expirationTime,E(pe,t),le(t,e),t.isQueued=!0}t=S(me)}}function _e(t){if(we=!1,xe(t),!ke)if(null!==S(pe))ke=!0,e(Ce);else{var r=S(me);null!==r&&n(_e,r.startTime-t)}}function Ce(e,n){var i;i=n,null!==Y&&ie([re,i,U]),ke=!1,we&&(we=!1,r()),ge=!0;var a=ye;try{if(!o)return Me(e,n);try{return Me(e,n)}catch(e){if(null!==be){var l=t.unstable_now();!function(e,t){z[H]=P,z[Z]=0,z[V]--,null!==Y&&ie([X,t,e.id])}(be,l),be.isQueued=!1}throw e}}finally{be=null,ye=a,ge=!1,function(e){U++,null!==Y&&ie([ne,e,U])}(t.unstable_now())}}function Me(e,r){var a,o,u=r;for(xe(u),be=S(pe);null!==be&&!l&&(!(be.expirationTime>u)||e&&!i());){var s=be.callback;if(null!==s){be.callback=null,ye=be.priorityLevel;var c=be.expirationTime<=u;a=be,o=u,D++,z[H]=a.priorityLevel,z[Z]=a.id,z[F]=D,null!==Y&&ie([ee,o,a.id,D]);var f=s(c);u=t.unstable_now(),"function"==typeof f?(be.callback=f,ue(be,u)):(oe(be,u),be.isQueued=!1,be===S(pe)&&T(pe)),xe(u)}else T(pe);be=S(pe)}if(null!==be)return!0;var d=S(me);return null!==d&&n(_e,d.startTime-u),!1}function Ee(e){switch(e){case R:return se;case L:return ce;case I:return he;case A:return de;case O:default:return fe}}var Se=a,Te={startLoggingProfilingEvents:function(){B=q,$=new ArrayBuffer(4*B),Y=new Int32Array($),Q=0},stopLoggingProfilingEvents:ae,sharedProfilingBuffer:j};t.unstable_ImmediatePriority=R,t.unstable_UserBlockingPriority=L,t.unstable_NormalPriority=O,t.unstable_IdlePriority=I,t.unstable_LowPriority=A,t.unstable_runWithPriority=function(e,t){switch(e){case R:case L:case O:case A:case I:break;default:e=O}var n=ye;ye=e;try{return t()}finally{ye=n}},t.unstable_next=function(e){var t;switch(ye){case R:case L:case O:t=O;break;default:t=ye}var n=ye;ye=t;try{return e()}finally{ye=n}},t.unstable_scheduleCallback=function(i,a,l){var o,u,s=t.unstable_now();if("object"==typeof l&&null!==l){var c=l.delay;o="number"==typeof c&&c>0?s+c:s,u="number"==typeof l.timeout?l.timeout:Ee(i)}else u=Ee(i),o=s;var f=o+u,d={id:ve++,callback:a,priorityLevel:i,startTime:o,expirationTime:f,sortIndex:-1,isQueued:!1};return o>s?(d.sortIndex=o,E(me,d),null===S(pe)&&d===S(me)&&(we?r():we=!0,n(_e,o-s))):(d.sortIndex=f,E(pe,d),le(d,s),d.isQueued=!0,ke||ge||(ke=!0,e(Ce))),d},t.unstable_cancelCallback=function(e){e.isQueued&&(function(e,t){z[V]--,null!==Y&&ie([J,t,e.id])}(e,t.unstable_now()),e.isQueued=!1),e.callback=null},t.unstable_wrapCallback=function(e){var t=ye;return function(){var n=ye;ye=t;try{return e.apply(this,arguments)}finally{ye=n}}},t.unstable_getCurrentPriorityLevel=function(){return ye},t.unstable_shouldYield=function(){var e=t.unstable_now();xe(e);var n=S(pe);return n!==be&&null!==be&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime