8971-8971.js 8.7 KB

12
  1. "use strict";(self.webpackChunknextcloud=self.webpackChunknextcloud||[]).push([[8971],{62405:(e,t,r)=>{r.d(t,{A:()=>a});var i=r(96763);class a{constructor(e){var t,r,a,s;if(r=this,s=void 0,(a=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(a="_share"))in r?Object.defineProperty(r,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[a]=s,e.ocs&&e.ocs.data&&e.ocs.data[0]&&(e=e.ocs.data[0]),e.hide_download=!!e.hide_download,e.mail_send=!!e.mail_send,e.attributes&&"string"==typeof e.attributes)try{e.attributes=JSON.parse(e.attributes)}catch(r){i.warn("Could not parse share attributes returned by server",e.attributes)}e.attributes=null!==(t=e.attributes)&&void 0!==t?t:[],this._share=e}get state(){return this._share}get id(){return this._share.id}get type(){return this._share.share_type}get permissions(){return this._share.permissions}get attributes(){return this._share.attributes}set permissions(e){this._share.permissions=e}get owner(){return this._share.uid_owner}get ownerDisplayName(){return this._share.displayname_owner}get shareWith(){return this._share.share_with}get shareWithDisplayName(){return this._share.share_with_displayname||this._share.share_with}get shareWithDisplayNameUnique(){return this._share.share_with_displayname_unique||this._share.share_with}get shareWithLink(){return this._share.share_with_link}get shareWithAvatar(){return this._share.share_with_avatar}get uidFileOwner(){return this._share.uid_file_owner}get displaynameFileOwner(){return this._share.displayname_file_owner||this._share.uid_file_owner}get createdTime(){return this._share.stime}get expireDate(){return this._share.expiration}set expireDate(e){this._share.expiration=e}get token(){return this._share.token}get note(){return this._share.note}set note(e){this._share.note=e}get label(){var e;return null!==(e=this._share.label)&&void 0!==e?e:""}set label(e){this._share.label=e}get mailSend(){return!0===this._share.mail_send}get hideDownload(){return!0===this._share.hide_download}set hideDownload(e){this._share.hide_download=!0===e}get password(){return this._share.password}set password(e){this._share.password=e}get passwordExpirationTime(){return this._share.password_expiration_time}set passwordExpirationTime(e){this._share.password_expiration_time=e}get sendPasswordByTalk(){return this._share.send_password_by_talk}set sendPasswordByTalk(e){this._share.send_password_by_talk=e}get path(){return this._share.path}get itemType(){return this._share.item_type}get mimetype(){return this._share.mimetype}get fileSource(){return this._share.file_source}get fileTarget(){return this._share.file_target}get fileParent(){return this._share.file_parent}get hasReadPermission(){return!!(this.permissions&OC.PERMISSION_READ)}get hasCreatePermission(){return!!(this.permissions&OC.PERMISSION_CREATE)}get hasDeletePermission(){return!!(this.permissions&OC.PERMISSION_DELETE)}get hasUpdatePermission(){return!!(this.permissions&OC.PERMISSION_UPDATE)}get hasSharePermission(){return!!(this.permissions&OC.PERMISSION_SHARE)}get hasDownloadPermission(){return this.attributes.some((e=>"permissions"===e.scope&&"download"===e.key&&!1===e.value))}get isFileRequest(){return this.attributes.some((e=>"fileRequest"===e.scope&&"enabled"===e.key&&!0===e.value))}set hasDownloadPermission(e){this.setAttribute("permissions","download",!!e)}setAttribute(e,t,r){const i={scope:e,key:t,value:r};for(const e in this._share.attributes){const t=this._share.attributes[e];if(t.scope===i.scope&&t.key===i.key)return void this._share.attributes.splice(e,1,i)}this._share.attributes.push(i)}get canEdit(){return!0===this._share.can_edit}get canDelete(){return!0===this._share.can_delete}get viaFileid(){return this._share.via_fileid}get viaPath(){return this._share.via_path}get parent(){return this._share.parent}get storageId(){return this._share.storage_id}get storage(){return this._share.storage}get itemSource(){return this._share.item_source}get status(){return this._share.status}}},7145:(e,t,r)=>{r.d(t,{A:()=>a});var i=r(87485);class a{constructor(){var e,t,r;e=this,r=void 0,(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t="_capabilities"))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,this._capabilities=(0,i.F)()}get defaultPermissions(){var e;return null===(e=this._capabilities.files_sharing)||void 0===e?void 0:e.default_permissions}get isPublicUploadEnabled(){var e;return!0===(null===(e=this._capabilities.files_sharing)||void 0===e||null===(e=e.public)||void 0===e?void 0:e.upload)}get federatedShareDocLink(){return window.OC.appConfig.core.federatedCloudShareDoc}get defaultExpirationDate(){return this.isDefaultExpireDateEnabled&&null!==this.defaultExpireDate?new Date((new Date).setDate((new Date).getDate()+this.defaultExpireDate)):null}get defaultInternalExpirationDate(){return this.isDefaultInternalExpireDateEnabled&&null!==this.defaultInternalExpireDate?new Date((new Date).setDate((new Date).getDate()+this.defaultInternalExpireDate)):null}get defaultRemoteExpirationDateString(){return this.isDefaultRemoteExpireDateEnabled&&null!==this.defaultRemoteExpireDate?new Date((new Date).setDate((new Date).getDate()+this.defaultRemoteExpireDate)):null}get enforcePasswordForPublicLink(){return!0===window.OC.appConfig.core.enforcePasswordForPublicLink}get enableLinkPasswordByDefault(){return!0===window.OC.appConfig.core.enableLinkPasswordByDefault}get isDefaultExpireDateEnforced(){return!0===window.OC.appConfig.core.defaultExpireDateEnforced}get isDefaultExpireDateEnabled(){return!0===window.OC.appConfig.core.defaultExpireDateEnabled}get isDefaultInternalExpireDateEnforced(){return!0===window.OC.appConfig.core.defaultInternalExpireDateEnforced}get isDefaultInternalExpireDateEnabled(){return!0===window.OC.appConfig.core.defaultInternalExpireDateEnabled}get isDefaultRemoteExpireDateEnforced(){return!0===window.OC.appConfig.core.defaultRemoteExpireDateEnforced}get isDefaultRemoteExpireDateEnabled(){return!0===window.OC.appConfig.core.defaultRemoteExpireDateEnabled}get isRemoteShareAllowed(){return!0===window.OC.appConfig.core.remoteShareAllowed}get isMailShareAllowed(){var e,t;return!0===(null===(e=this._capabilities)||void 0===e||null===(e=e.files_sharing)||void 0===e||null===(e=e.sharebymail)||void 0===e?void 0:e.enabled)&&!0===(null===(t=this._capabilities)||void 0===t||null===(t=t.files_sharing)||void 0===t||null===(t=t.public)||void 0===t?void 0:t.enabled)}get defaultExpireDate(){return window.OC.appConfig.core.defaultExpireDate}get defaultInternalExpireDate(){return window.OC.appConfig.core.defaultInternalExpireDate}get defaultRemoteExpireDate(){return window.OC.appConfig.core.defaultRemoteExpireDate}get isResharingAllowed(){return!0===window.OC.appConfig.core.resharingAllowed}get isPasswordForMailSharesRequired(){var e;return!0===(null===(e=this._capabilities.files_sharing)||void 0===e||null===(e=e.sharebymail)||void 0===e||null===(e=e.password)||void 0===e?void 0:e.enforced)}get shouldAlwaysShowUnique(){var e;return!0===(null===(e=this._capabilities.files_sharing)||void 0===e||null===(e=e.sharee)||void 0===e?void 0:e.always_show_unique)}get allowGroupSharing(){return!0===window.OC.appConfig.core.allowGroupSharing}get maxAutocompleteResults(){return parseInt(window.OC.config["sharing.maxAutocompleteResults"],10)||25}get minSearchStringLength(){return parseInt(window.OC.config["sharing.minSearchStringLength"],10)||0}get passwordPolicy(){var e;return(null===(e=this._capabilities)||void 0===e?void 0:e.password_policy)||{}}}},98215:(e,t,r)=>{r.d(t,{A:()=>h});var i=r(65043),a=r(7145),s=r(85168),n=r(53334),o=r(96763);const l=new a.A,u="abcdefgijkmnopqrstwxyzABCDEFGHJKLMNPQRSTWXYZ23456789";async function h(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(l.passwordPolicy.api&&l.passwordPolicy.api.generate)try{const t=await i.Ay.get(l.passwordPolicy.api.generate);if(t.data.ocs.data.password)return e&&(0,s.Te)((0,n.Tl)("files_sharing","Password created successfully")),t.data.ocs.data.password}catch(t){o.info("Error generating password from password_policy",t),e&&(0,s.Qg)((0,n.Tl)("files_sharing","Error generating password from password policy"))}const t=new Uint8Array(10),r=u.length/255;self.crypto.getRandomValues(t);let a="";for(let e=0;e<t.length;e++)a+=u.charAt(t[e]*r);return a}}}]);
  2. //# sourceMappingURL=8971-8971.js.map?v=e7682f1aba5a910b4b7d