You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nextcloud/dist/files_sharing-init.js

3 lines
54 KiB
JavaScript

/*! For license information please see files_sharing-init.js.LICENSE.txt */
(()=>{"use strict";var e,t={5924:(e,t,i)=>{var n=i(92457),r=i(53529),s=i(53334),o=i(43627),a=i(71089),l=i(63814);i(44719),i(36117);const u=null===(d=(0,n.HW)())?(0,r.YK)().setApp("files").build():(0,r.YK)().setApp("files").setUid(d.uid).build();var d,h=(e=>(e.DEFAULT="default",e.HIDDEN="hidden",e))(h||{});class c{_action;constructor(e){this.validateAction(e),this._action=e}get id(){return this._action.id}get displayName(){return this._action.displayName}get title(){return this._action.title}get iconSvgInline(){return this._action.iconSvgInline}get enabled(){return this._action.enabled}get exec(){return this._action.exec}get execBatch(){return this._action.execBatch}get order(){return this._action.order}get parent(){return this._action.parent}get default(){return this._action.default}get inline(){return this._action.inline}get renderInline(){return this._action.renderInline}validateAction(e){if(!e.id||"string"!=typeof e.id)throw new Error("Invalid id");if(!e.displayName||"function"!=typeof e.displayName)throw new Error("Invalid displayName function");if("title"in e&&"function"!=typeof e.title)throw new Error("Invalid title function");if(!e.iconSvgInline||"function"!=typeof e.iconSvgInline)throw new Error("Invalid iconSvgInline function");if(!e.exec||"function"!=typeof e.exec)throw new Error("Invalid exec function");if("enabled"in e&&"function"!=typeof e.enabled)throw new Error("Invalid enabled function");if("execBatch"in e&&"function"!=typeof e.execBatch)throw new Error("Invalid execBatch function");if("order"in e&&"number"!=typeof e.order)throw new Error("Invalid order");if("parent"in e&&"string"!=typeof e.parent)throw new Error("Invalid parent");if(e.default&&!Object.values(h).includes(e.default))throw new Error("Invalid default");if("inline"in e&&"function"!=typeof e.inline)throw new Error("Invalid inline function");if("renderInline"in e&&"function"!=typeof e.renderInline)throw new Error("Invalid renderInline function")}}const p=function(e){typeof window._nc_fileactions>"u"&&(window._nc_fileactions=[],u.debug("FileActions initialized")),window._nc_fileactions.find((t=>t.id===e.id))?u.error(`FileAction ${e.id} already registered`,{action:e}):window._nc_fileactions.push(e)};var f=(e=>(e[e.NONE=0]="NONE",e[e.CREATE=4]="CREATE",e[e.READ=1]="READ",e[e.UPDATE=2]="UPDATE",e[e.DELETE=8]="DELETE",e[e.SHARE=16]="SHARE",e[e.ALL=31]="ALL",e))(f||{});const g=["d:getcontentlength","d:getcontenttype","d:getetag","d:getlastmodified","d:quota-available-bytes","d:resourcetype","nc:has-preview","nc:is-encrypted","nc:mount-type","oc:comments-unread","oc:favorite","oc:fileid","oc:owner-display-name","oc:owner-id","oc:permissions","oc:size"],m={d:"DAV:",nc:"http://nextcloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"},w=function(e,t={nc:"http://nextcloud.org/ns"}){typeof window._nc_dav_properties>"u"&&(window._nc_dav_properties=[...g],window._nc_dav_namespaces={...m});const i={...window._nc_dav_namespaces,...t};return window._nc_dav_properties.find((t=>t===e))?(u.warn(`${e} already registered`,{prop:e}),!1):e.startsWith("<")||2!==e.split(":").length?(u.error(`${e} is not valid. See example: 'oc:fileid'`,{prop:e}),!1):i[e.split(":")[0]]?(window._nc_dav_properties.push(e),window._nc_dav_namespaces=i,!0):(u.error(`${e} namespace unknown`,{prop:e,namespaces:i}),!1)};var v=(e=>(e.Folder="folder",e.File="file",e))(v||{});const b=function(e,t){return null!==e.match(t)},y=(e,t)=>{if(e.id&&"number"!=typeof e.id)throw new Error("Invalid id type of value");if(!e.source)throw new Error("Missing mandatory source");try{new URL(e.source)}catch{throw new Error("Invalid source format, source must be a valid URL")}if(!e.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(e.mtime&&!(e.mtime instanceof Date))throw new Error("Invalid mtime type");if(e.crtime&&!(e.crtime instanceof Date))throw new Error("Invalid crtime type");if(!e.mime||"string"!=typeof e.mime||!e.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in e&&"number"!=
//# sourceMappingURL=files_sharing-init.js.map?v=800dc5665fb35c487133