- Added `RealtimeConnectRequestEvent.MaxTimeout` field to specify the absolute max duration a realtime connection can remain open (default to 30mins).
_This is in addition to the `IdeTimeout` of 5mins in order to prevent misuse and to allow the GC to run more regularly._
- Added extra checks for the connected user IP in the realtime APIs to prevent bruteforce guest subscription update attempts and to serve as an extra protection for the "all-in-one" OAuth2 realtime handler.
- Don't reset the records list pagination on record update ([#7694](https://github.com/pocketbase/pocketbase/issues/7694)).
- Updated all `golang.org/x/` packages to cover the recent [security fixes](https://groups.google.com/g/golang-announce/c/PdiGK3xulk4) _(none of them should be a critical issue in PocketBase but nonetheless it is advised to update)_.
## v0.38.1
- Silenced the superuser IPs confirmation if there is no change.
- Updated the _experimental_ UI extensions APIs to allow top-level `await` in the initialization script.
- Force unset the auth state of existing realtime connections on user password, collection secret, etc. changes.
_This is not strictly necessary because the realtime connections have short-lived idle timeout by design but nonetheless it was implemented to minimize the attack vectors._
- Added error marker for each collection tab and fixed the styles of the raw errors tooltip.
_⚠️ The fix comes with a system migration that resaves all collections with indexes to ensure that all indexes are normalized and available in the `Collection.Indexes` field (it will also include indexes created manually via the sqlite3 cli or other external tool)._
_If you are using a test `pb_data` for your Go automation tests you may want to apply the migration to it too so that it runs only once and not for each execution of your tests, aka. you could run once `go run main.go migrate up --dir="/path/to/test_pb_data"`._
- Updated `modernc.org/sqlite` to v1.50.1 (SQLite 3.53.1).
- Other minor fixes (_updated API preview examples, fixed code comment typos, etc._).
## v0.38.0
- Fixed UI logs pagination when no custom range is specified.
> For the most recent versions, please refer to [CHANGELOG.md](./CHANGELOG.md)
---
## v0.22.45
- (_Backported from v0.38.2_) Updated all `golang.org/x/` packages to cover the recent [security fixes](https://groups.google.com/g/golang-announce/c/PdiGK3xulk4) _(none of them should be a critical issue in PocketBase but nonetheless it is advised to update)_.
## v0.22.44
- (_Backported from v0.38.1_) Force unset the auth state of existing realtime connections on user tokenKey change.
## v0.22.43
- (_Backported from v0.38.0_) Bumped min Go GitHub action version to 1.26.3 because it comes with some [minor bug and security fixes](https://github.com/golang/go/issues?q=milestone%3AGo1.26.3).
import{tase}from"./expandInfo-DGS0CLSa.js";import{tasn}from"./fieldsInfo-Bz62125-.js";functionr(e){letn=app.utils.getApiExampleURL(),r=[{title:`OTP request`,content:i},{title:`OTP auth`,content:a}],o=store({activeActionIndex:0});returnt.div({pbEvent:`apiPreviewAuthWithOTP`,className:`content`},t.p(null,`Authenticate with an one-time/short-lived password (OTP).`),t.p(null,`Note that when requesting an OTP we return an `,t.code(null,`otpId`),` even if a user with the provided email doesn't exist as a very basic enumeration protection.`),app.components.codeBlockTabs({className:`sdk-examples m-t-sm`,historyKey:`pbLastSDK`,tabs:[{title:`JS SDK`,language:`js`,value:`
import{tase}from"./expandInfo-DGS0CLSa.js";import{tasn}from"./fieldsInfo-Bz62125-.js";functionr(e){letn=app.utils.getApiExampleURL(),r=[{title:`OTP request`,content:i},{title:`OTP auth`,content:a}],o=store({activeActionIndex:0});returnt.div({pbEvent:`apiPreviewAuthWithOTP`,className:`content`},t.p(null,`Authenticate with an one-time/short-lived password (OTP).`),t.p(null,`On successful authentication the user will be also marked as verified (if the OTP source is email and the user is not verified already).`),t.p(null,`Note that when requesting an OTP we return an `,t.code(null,`otpId`),` even if a user with the provided email doesn't exist as a very basic enumeration protection.`),app.components.codeBlockTabs({className:`sdk-examples m-t-sm`,historyKey:`pbLastSDK`,tabs:[{title:`JS SDK`,language:`js`,value:`
functione(e){leti=app.utils.getApiExampleURL(),a=[{title:`Request email change`,content:n},{title:`Confirm email change`,content:r}],o=store({activeActionIndex:0});returnt.div({pbEvent:`apiPreviewEmailChange`,className:`content`},t.p(null,`Sends ${e.name} email change request.`),t.p(null,`On successful email change all previously issued auth tokens for the specific record will be automatically invalidated.`),app.components.codeBlockTabs({className:`sdk-examples m-t-sm`,historyKey:`pbLastSDK`,tabs:[{title:`JS SDK`,language:`js`,value:`
functione(e){leti=app.utils.getApiExampleURL(),a=[{title:`Request email change`,content:n},{title:`Confirm email change`,content:r}],o=store({activeActionIndex:0});returnt.div({pbEvent:`apiPreviewEmailChange`,className:`content`},t.p(null,`Sends ${e.name} email change request.`),t.p(null,`On successful email change all previously issued auth tokens for the specific record will be invalidated (and the user will be marked as verified if not already).`),app.components.codeBlockTabs({className:`sdk-examples m-t-sm`,historyKey:`pbLastSDK`,tabs:[{title:`JS SDK`,language:`js`,value:`
importPocketBasefrom'pocketbase';
constpb=newPocketBase('${i}');
@@ -16,7 +16,8 @@ function e(e){let i=app.utils.getApiExampleURL(),a=[{title:`Request email change
// (optional) in your custom confirmation page:
// ---
// note: after this call all previously issued auth tokens are invalidated
// note: all previous user auth tokens will be invalidated
// (and the user will be marked as verified if not already)
functione(e){leti=app.utils.getApiExampleURL(),a=[{title:`Request password reset`,content:n},{title:`Confirm password reset`,content:r}],o=store({activeActionIndex:0});returnt.div({pbEvent:`apiPreviewPasswordReset`,className:`content`},t.p(null,`Sends ${e.name} password reset email request.`),t.p(null,`On successful password reset all previously issued auth tokens for the specific record will be automatically invalidated.`),app.components.codeBlockTabs({className:`sdk-examples m-t-sm`,historyKey:`pbLastSDK`,tabs:[{title:`JS SDK`,language:`js`,value:`
functione(e){leti=app.utils.getApiExampleURL(),a=[{title:`Request password reset`,content:n},{title:`Confirm password reset`,content:r}],o=store({activeActionIndex:0});returnt.div({pbEvent:`apiPreviewPasswordReset`,className:`content`},t.p(null,`Sends ${e.name} password reset email request.`),t.p(null,`On successful password reset all previously issued auth tokens for the specific record will be invalidated (and the user will be marked as verified if not already).`),app.components.codeBlockTabs({className:`sdk-examples m-t-sm`,historyKey:`pbLastSDK`,tabs:[{title:`JS SDK`,language:`js`,value:`
importPocketBasefrom'pocketbase';
constpb=newPocketBase('${i}');
@@ -11,7 +11,8 @@ function e(e){let i=app.utils.getApiExampleURL(),a=[{title:`Request password res
// (optional) in your custom confirmation page:
// ---
// note: after this call all previously issued auth tokens are invalidated
// note: all previous user auth tokens will be invalidated
// (and the user will be marked as verified if not already)
import{aase,n,r,tasi}from"./pocketbase.es-B_4DUNUU.js";vara=Object.create,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,l=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,d=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),f=(e,n,r,i)=>{if(n&&typeofn==`object`||typeofn==`function`)for(vara=c(n),l=0,d=a.length,f;l<d;l++)f=a[l],!u.call(e,f)&&f!==r&&o(e,f,{get:(e=>n[e]).bind(null,f),enumerable:!(i=s(n,f))||i.enumerable});returne},p=(e,n,r)=>(r=e==null?{}:a(l(e)),f(n||!e||!e.__esModule?o(r,`default`,{value:e,enumerable:!0}):r,e));(function(){lete=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(leteofdocument.querySelectorAll(`link[rel="modulepreload"]`))r(e);newMutationObserver(e=>{for(letnofe)if(n.type===`childList`)for(leteofn.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&r(e)}).observe(document,{childList:!0,subtree:!0});functionn(e){letn={};returne.integrity&&(n.integrity=e.integrity),e.referrerPolicy&&(n.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?n.credentials=`include`:e.crossOrigin===`anonymous`?n.credentials=`omit`:n.credentials=`same-origin`,n}functionr(e){if(e.ep)return;e.ep=!0;letr=n(e);fetch(e.href,r)}})();varm=`abcdefghijklmnopqrstuvwxyz0123456789`,h=`pb_redirect`,g=store({hash:window.location.hash});window.addEventListener(`hashchange`,()=>{g.hash=window.location.hash}),Prism.languages.pbrule={string:Prism.languages.js.string,number:Prism.languages.js.number,function:Prism.languages.js.function,boolean:/\b(?:true|false)\b/i,constant:/\b(?:null)\b/i,comment:{pattern:/\/\/.*/,greedy:!0},italic:/_via_|\:\w+/,keyword:/&&|\|\||\??(?:!~|!=|>=|<=|=|~|>|>|<)(?=[@\w\s]|$)/};var_={isObject(e){returntypeofe==`object`&&!!e&&e.constructor===Object},isEmpty(e){returne==null||e===``||Array.isArray(e)&&e.length===0||typeofe==`object`&&app.utils.isEmptyObject(e)},isEmptyObject(e){for(letnine)return!1;return!0},toArray(e,n=!1){returnArray.isArray(e)?e.slice():(n||!_.isEmpty(e))&&e!==void0?[e]:[]},removeByValue(e,n){if(!Array.isArray(e)){console.warn(`[removeByValue] not an array:`,e);return}for(letr=e.length-1;r>=0;r--)if(e[r]==n){e.splice(r,1);break}},removeByKey(e,n,r){if(!Array.isArray(e)){console.warn(`[removeByKey] not an array:`,e);return}for(letiine)if(e[i][n]==r){e.splice(i,1);break}},pushUnique(e,n){if(!Array.isArray(e)){console.warn(`[pushUnique] not an array:`,e);return}e.includes(n)||e.push(n)},mergeUnique(e,n){for(letrofn)app.utils.pushUnique(e,r);returne},pushOrReplaceObject(e,n,r=`id`){for(leti=e.length-1;i>=0;i--)if(e[i][r]==n[r]){e[i]=n;return}e.push(n)},filterDuplicatesByKey(e,n=`id`){e=Array.isArray(e)?e:[];letr={};for(letiofe)r[i[n]]=i;returnObject.values(r)},filterRedactedProps(e,n=`******`){letr=JSON.parse(JSON.stringify(e||{}));for(leteinr)typeofr[e]==`object`&&r[e]!==null?r[e]=_.filterRedactedProps(r[e],n):r[e]===n&&deleter[e];returnr},getByPath(e,n,r=null,i=`.`){leta=e||{},o=(n||``).split(i);for(leteofo){if(!_.isObject(a)&&!Array.isArray(a)||a[e]===void0)returnr;a=a[e]}returna},setByPath(e,n,r,i=`.`){if(typeofe!=`object`||!e){console.warn(`setByPath: data not an object or array.`);return}leta=e,o=n.split(i),s=o.pop();for(leteofo)(!_.isObject(a)&&!Array.isArray(a)||!_.isObject(a[e])&&!Array.isArray(a[e]))&&(a[e]={}),a=a[e];a[s]=r},deleteByPath(e,n,r=`.`){leti=e||{},a=(n||``).split(r),o=a.pop();for(leteofa)(!_.isObject(i)&&!Array.isArray(i)||!_.isObject(i[e])&&!Array.isArray(i[e]))&&(i[e]={}),i=i[e];Array.isArray(i)?i.splice(o,1):_.isObject(i)&&deletei[o],a.length>0&&(Array.isArray(i)&&!i.length||_.isObject(i)&&!Object.keys(i).length)&&(Array.isArray(e)&&e.length>0||_.isObject(e)&&Object.keys(e).length>0)&&_.deleteByPath(e,a.join(r),r)},emptyClone(e,n=[]){letr=JSON.parse(JSON.stringify(e));for(leteinr)n.includes(e)||(typeofr[e]==`string`?r[e]=``:typeofr[e]==`number`?r[e]=0:typeofr[e]==`boolean`?r[e]=!1:Array.isArray(r[e])?r[e]=[]:app.utils.isObject(r[e])&&(r[e]={}));returnr},randomString(e=8,n=m){letr=``;for(leti=0;i<e;i++)r+=n.charAt(Math.floor(Math.random()*n.length));returnr},randomSecret(e=30){if(typeofcrypto>`u`)returnapp.utils.randomString(e);letn=newUint8Array(e);crypto.getRandomValues(n);letr=``;for(leti=0;i<e;i++)r+=`-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`.charAt(n[i]%64);returnr},sentenize(e,n=!0){if(typeofe!=`string`)return``;if(e=e.trim().split(`_`).join(``),e===``)returne;if(e=e[0].toUpperCase()+e.substring(1),n){letn=e[e.length-1];n!==`.`&&n!==`?`&&n!==`!`&&(e+=`.`)}returne},trimQuotedValue(e){returntypeofe==`string`&&(e[0]==`"`||e[0]==`'`||e[0]=="`")&&e[0]==e[e.length-1]?e.slice(1,-1):e},slugify(e,n=`_`,r=[]){if(e===``)return``;leti={a:/а|à|á|å|â/gi,b:/б/gi,c:/ц|ç/gi,d:/д/gi,e:/е|è|é|ê|ẽ|ë/gi,f:/ф/gi,g:/г/gi,h:/х/gi,i:/й|и|ì|í|î/gi,j:/ж/gi,k:/к/gi,l:/л/gi,m:/м/gi,n:/н|ñ/gi,o:/о|ò|ó|ô|øLine truncated
`);for(let e of i)e!=``&&r.add(e);e.field.values=Array.from(r)},onblur:e=>{(!e.relatedTarget||!i.contains(e.relatedTarget))&&i.hidePopover()}}))),a=[watch(()=>{e.field.values?.length&&e.field.maxSelect>e.field.values.length&&(e.field.maxSelect=e.field.values.length)})];return app.components.fieldSettings(e,{header:[t.div({className:`fieldheader-selectfield-select-choices-input`,onunmount:()=>{a.forEach(e=>e?.unwatch())}},t.input({type:`text`,placeholder:`Addchoices*`,className:`txt-leftinline-error`,value:()=>e.field.values?.join(`•`)||``,name:()=>`fields.${e.fieldIndex}.values`,onfocus:e=>(i?.showPopover({source:e.target}),i.querySelector(`textarea`)?.focus(),!1)}),i),t.div({className:`fieldheader-selectsingle-multiple-select`},app.components.select({required:!0,options:r,value:()=>e.field.maxSelect>1,onchange:n=>{n?.[0]?.value?e.field.maxSelect=e.field.values.length||2:e.field.maxSelect=1}}))],content:()=>t.div({className:`gridsm`},()=>{if(e.field.maxSelect>1)return t.div({className:`col-sm-12`},t.div({className:`field`},t.label({htmlFor:n+`.maxSelect`},`Maxselect`),t.input({type:`number`,id:n+`.maxSelect`,placeholder:`Defaulttosingle`,step:1,min:2,max:()=>e.field.values?.length||2,name:()=>`fields.${e.fieldIndex}.maxSelect`,value:()=>e.field.maxSelect||``,onchange:n=>{let r=parseInt(n.target.value,10);r>1?e.field.maxSelect=r:e.field.maxSelect=1}})))},t.div({className:`col-sm-12`},t.div({className:`field`},t.label({htmlFor:n+`.help`},`Helptext`),t.input({type:`text`,id:n+`.help`,name:()=>`fields.${e.fieldIndex}.help`,value:()=>e.field.help||``,oninput:n=>e.field.help=n.target.value})))),footer:()=>[t.div({className:`field`},t.input({className:`sm`,type:`checkbox`,id:n+`.required`,name:()=>`fields.${e.fieldIndex}.required`,checked:()=>!!e.field.required,onchange:n=>e.field.required=n.target.checked}),t.label({htmlFor:n+`.required`},t.span({className:`txt`},`Required`),t.small({className:`txt-hint`,textContent:()=>e.field.maxSelect>1?`(!=[])`:`(!='')`}),t.i({className:`ri-information-linelink-hint`,ariaDescription:app.attrs.tooltip(()=>`Requiresthefieldvaluetobenonempty${e.field.maxSelect>1?`array`:`string`}.`)})))]})}function En(e){return t.div({className:`record-field-viewfield-type-select`},t.div({className:`inline-flexgap-5`},()=>{let n=app.utils.toArray(e.record[e.field.name],!1);return n.length?n.map(e=>t.span({className:`label`,title:e,textContent:app.utils.truncate(e,100)})):t.span({className:`missing-value`})}))}window.app=window.app||{},window.app.fieldTypes=window.app.fieldTypes||{},window.app.fieldTypes.select={icon:`ri-list-check`,label:`Select`,settings:Tn,input:wn,view:En,filterModifiers:e=>e.maxSelect>1?[`each`,`length`]:[],dummyData:(e,n=!1)=>e.maxSelect>1?e.values?.slice(0,2)||[]:e.values?.[0]||``};function Dn(e){let n=`json_`+app.utils.randomString(),r=store({value:``}),i=[watch(()=>e.record[e.field.name],(n,i)=>{if(!(n!==``&&n===r.value)){if(typeof n==`string`&&!n.startsWith(`"`)&&!n.endsWith(`"`)){r.value=JSON.stringify(n===void 0?null:n),e.record[e.field.name]=r.value;return}typeof n==`string`&&n.startsWith(`"`)&&n.endsWith(`"`)?r.value=n:n===null?r.value=`null`:r.value=JSON.stringify(n===void 0?null:n,null,2)}})];function a(){let n=r.value.trim();if(n===``){e.record[e.field.name]=null;return}try{let r=JSON.parse(n);typeof r==`string`?e.record[e.field.name]=JSON.stringify(r):e.record[e.field.name]=r}catch{e.record[e.field.name]=n}}return t.div({className:`record-field-inputfield-type-json`},t.div({className:`field`,onunmount:()=>{clearTimeout(void 0),i.forEach(e=>e?.unwatch())}},t.label({htmlFor:n},t.i({className:app.fieldTypes.json.icon,ariaHidden:!0}),t.span({className:`txt`},()=>e.field.name),t.span({hidden:()=>On(r.value.trim()),className:`json-state`,ariaDescription:app.attrs.tooltip(`InvalidJSON`,`left`)},t.i({className:`ri-error-warning-filltxt-danger`,ariaHidden:!0})),t.span({hidden:()=>!On(r.value.trim()),className:`json-state`,ariaDescription:app.attrs.tooltip(`ValidJSON`,`left`)},t.i({className:`ri-checkbox-circle-filltxt-success`,ariaHidden:!0}))),app.components.codeEditor({language:`js`,id:n,name:()=>e.field.name,required:()=>e.field.required,value:()=>r.value,oninput:e=>r.value=e,onblur:()=>a()})),()=>{if(e.field.help)return t.div({className:`field-help`},e.field.help)})}function On(e){if(e===``)return!0;try{return JSON.parse(e),!0}catch{return!1}}function kn(e){try{let n=e.record[e.field.name];typeof n==`string`&&JSON.parse(n)}catch(r){throw new n({status:400,response:{message:`InvalidJSONdata`,data:{[e.field.name]:{code:`invalid_json`,message:r.toString()}}}})}}function An(e){let n=`f_`+app.utils.randomString(),r=store({showInfo:!1});return app.components.fieldSettings(e,{content:()=>t.div({className:`gridsm`},t.div({className:`col-sm-12`},t.div({className:`field`},t.label({htmlFor:n+`.maxSize`},t.span(null,`Maxsize`),t.small(null,`(bytes)`)),t.input({type:`number`,id:n+`.maxSize`,name:()=>`fields.${e.fieldIndex}.maxSize`,min:0,step:1
Line truncated
Totargetthenewlysubmittedonesyoucanuse@request.body.*.`)})],name:`updateRule`,autocomplete:i,disabled:()=>e.originalCollection?.system,value:()=>e.collection.updateRule,oninput:n=>e.collection.updateRule=n})),t.div({className:`col-12`,ariaDescription:r()},app.components.ruleField({label:`Deleterule`,name:`deleteRule`,autocomplete:i,disabled:()=>e.originalCollection?.system,value:()=>e.collection.deleteRule,oninput:n=>e.collection.deleteRule=n}))]}),()=>{if(e.collection.type==`auth`)return[t.hr({className:`m-t-basem-b-base`}),t.button({type:`button`,onmount:()=>{n.showAuthRules=e.collection.manageRule!==null||e.collection.authRule!==``},className:()=>`btnsecondarysm${n.showAuthRules?``:`transparent`}`,onclick:()=>{n.showAuthRules=!n.showAuthRules}},t.span({className:`txt`},`Additionalauthcollectionrules`),t.i({ariaHidden:!0,className:()=>n.showAuthRules?`ri-arrow-drop-up-line`:`ri-arrow-drop-down-line`})),app.components.slide(()=>n.showAuthRules,t.div({className:`gridsmm-t-sm`},t.div({className:`col-12`,ariaDescription:r()},app.components.ruleField({label:`Authenticationrule`,name:`authRule`,placeholder:``,autocomplete:i,disabled:()=>e.originalCollection?.system,value:()=>e.collection.authRule,oninput:n=>e.collection.authRule=n}),t.div({className:`field-help`},t.p(null,`Thisruleisexecutedeverytime`,t.strong(null,`beforeauthentication`),`allowingyoutorestrictwhocanauthenticate.`),t.p(null,`Forexample,toallowonlyverifiedusersyoucansetitto`,t.code(null,`verified=true`),`.`),t.p(null,`Leaveitemptytoallowanyonewithanaccounttoauthenticate.`),t.p(null,`Todisableauthenticationentirelyyoucanchangeitto"Set superusers only".`))),t.div({className:`col-12`,ariaDescription:r()},app.components.ruleField({label:`Managerule`,name:`manageRule`,autocomplete:i,disabled:()=>e.originalCollection?.system,value:()=>e.collection.manageRule,oninput:n=>e.collection.manageRule=n}),t.div({className:`field-help`},t.p(null,`Thisruleisexecutedinadditiontothe`,t.strong(null,`create`),`and`,t.strong(null,`update`),`APIrules.`),t.p(null,`Itenablessuperuser-likepermissionstoallowfullymanagingtheauthrecord(s),eg.changingthepasswordwithoutrequiringtoentertheoldone,directlyupdatingtheverifiedstateoremail,etc.`)))))]})}var qn=`test_view_query`;function Z(e){let n=`query_`+app.utils.randomString(),r=`SELECT.FROM.WHERE.LEFTJOIN.INNERJOIN.ON.AS.GROUPBY.HAVING.ORDERBY.ASC.DESC.LIMIT.OFFSET.WITH.NOT.IN.AND.OR.EXISTS.LIKE.CAST.REAL.DECIMAL.NUMERIC.INT.TEXT.BOOL`.split(`.`),i=store({testRecords:[],testError:``,isTesting:!1});async function a(n){if(i.isTesting=!0,i.testRecords=[],(app.store.errors?.viewQuery||app.store.errors?.fields)&&(delete app.store.errors.viewQuery,delete app.store.errors.fields),!n){i.testError=``,i.isTesting=!1;return}try{let r=await app.pb.send(`/api/collections/meta/dry-run-view`,{method:`POST`,body:{query:n},requestKey:qn});e.collection?.id?i.testRecords=r.sample.map(n=>(n.collectionId=e.collection?.id,n.collectionName=e.collection?.name,n)):i.testRecords=r.sample,i.testError=``,i.isTesting=!1}catch(e){e.isAbort||(i.testError=e.message||`Invalidquery.`,i.isTesting=!1)}}let o,s=[watch(()=>e.collection?.viewQuery,e=>{clearTimeout(o),o=setTimeout(()=>a(e),200)})];return t.div({pbEvent:`collectionViewQueryTabContent`,className:`collection-tab-contentcollection-view-query-tab-content`,onunmount:()=>{clearTimeout(o),app.pb.cancelRequest(qn),s.forEach(e=>e?.unwatch())}},t.div({className:`grid`},t.div({className:`col-12`},t.div({className:`txt-righttxt-smm-b-10`},t.button({type:`button`,className:`txt-boldlink-hint`,"html-popovertarget":n+`caveats_dropdown`},()=>`Querycaveats`)),t.div({id:n+`caveats_dropdown`,className:`dropdownsmquery-caveats-dropdown`,popover:`auto`},t.ul(null,t.li(null,`Wildcardcolumns(*)arenotsupported.`),t.li(null,`Thequerymusthaveaunique`,t.code(null,`id`),`column.`,t.br(),`Ifyourquerydoesn'thaveasuitableone,youcanusetheuniversal`,t.code(null,`(ROW_NUMBER()OVER())asid`),`.`),t.li(null,`Expressionsmustbealiasedwithavalidformattedfieldname,e.g.`,t.code(null,`MAX(balance)asmaxBalance`),`.`),t.li(null,`Combined/multi-spacedexpressionsmustbewrappedinparenthesis,e.g.`,t.code(null,`(MAX(balance)+1)asmaxBalance`),`.`),t.li(null,`UNIONexpressionsaresupportedbuttheentirequerymustbewrappedinparenthesis.`))),t.div({className:`field`},t.label({htmlFor:n+`.viewQuery`},t.span({className:`txt`},`Selectquery`),t.span({hidden:()=>!i.testError,className:`query-state`,ariaDescription:app.attrs.tooltip(`Invalidquery`,`left`)},t.i({className:`ri-error-warning-filltxt-danger`,ariaHidden:!0})),t.span({hidden:()=>!!i.testError,className:`query-state`,ariaDescription:app.attrs.tooltip(`Validquery`,`left`)},t.i({className:`ri-checkbox-circle-filltxt-success`,ariaHidden:!0}))),app.components.codeEditor({id:n+`.viewQuery`,name:`viewQuery`,language:`sql`,
Line truncated
`+e)})},t.div({className:`btns`},t.button({type:`button`,className:()=>`btnexpanded-lg${a.isSaving?`loading`:``}`,disabled:()=>!a.canSave,onclick:()=>s(!0)},t.span({className:`txt`},()=>a.isNew?`Create`:`Savechanges`)),t.button({type:`button`,title:`Saveoptions`,className:()=>`btnp-5`,disabled:()=>!a.canSave,"html-popovertarget":i+`save_options`},t.i({className:`ri-arrow-up-s-line`,ariaHidden:!0})),t.div({id:i+`save_options`,className:`dropdownnowrap`,popover:`auto`},t.button({type:`button`,className:`dropdown-item`,onclick:e=>{e.target.closest(`.dropdown`).hidePopover(),s(!1)}},t.span({className:`txt`},`Saveandcontinue`),t.small({className:`txt-hint`},`(Ctrl+S)`)),t.hr(),t.button({type:`button`,className:`dropdown-item`,onclick:e=>{e.target.closest(`.dropdown`).hidePopover(),u()}},t.span({className:`txt`},`Resetform`)))))),r}function Yn(e){let n=JSON.parse(JSON.stringify(app.store.collectionScaffolds[e.type])),r=JSON.parse(JSON.stringify(e.fields))||[],i=r.filter(e=>!e.system);e.fields=n.fields||[];for(let n of r){if(!n.system)continue;let r=e.fields.find(e=>e.name==n.name);r&&Object.assign(r,n)}for(let n of i)e.fields.push(n);if(e.indexes=e.indexes||[],e.indexes.length){let r=n?.indexes||[];indexesLoop:for(let n=e.indexes.length-1;n>=0;n--){let i=app.utils.parseIndex(e.indexes[n]),a=i.indexName.toLowerCase();for(let i of r)if(a==app.utils.parseIndex(i).indexName.toLowerCase()){e.indexes.splice(n,1);continue indexesLoop}for(let r of i.columns)if(!e.fields.find(e=>e.name.toLowerCase()==r.name.toLowerCase())){e.indexes.splice(n,1);continue indexesLoop}}}app.utils.mergeUnique(e.indexes,n.indexes)}function Xn(e,n){let r=`truncate_`+app.utils.randomString(),i=store({isSubmitting:!1,nameConfirm:``});async function a(){if(i.isSubmitting||!e.originalCollection?.name||e.originalCollection.name!=i.nameConfirm)return!1;i.isSubmitting=!0;try{return await app.pb.collections.truncate(e.originalCollection.name),n.ontruncate?.(JSON.parse(JSON.stringify(e.originalCollection))),app.toasts.success(`Successfullytruncatedcollection"${e.originalCollection.name}".`),i.isSubmitting=!1,!0}catch(e){i.isSubmitting=!1,app.checkApiError(e)}return!1}return t.button({type:`button`,className:`dropdown-itemtxt-danger`,disabled:()=>i.isSubmitting,onclick:n=>{n.target.closest(`.dropdown`).hidePopover(),app.modals.confirm(t.div(null,t.h6({className:`blocktxt-center`},`Doyoureallywanttodeleteallrecordsofthecollection?`),t.div({className:`confirm-collection-labeltxt-boldm-t-smm-b-sm`},`Typethecollectionname`,t.div({className:`label`},()=>e.originalCollection.name,app.components.copyButton(()=>e.originalCollection?.name)),`toconfirm:`),t.div({className:`field`},t.label({htmlFor:r+`.confirm_name`},`Collectionname`),t.input({id:r+`.confirm_name`,type:`text`,required:!0,pattern:()=>RegExp.escape(e.originalCollection.name),value:()=>i.nameConfirm,oninput:e=>i.nameConfirm=e.target.value}))),async()=>{if(document.getElementById(r+`.confirm_name`)?.reportValidity(),!await a())return!1;app.modals.close(n.target.closest(`.modal`))},()=>{i.nameConfirm=``})}},t.i({className:`ri-eraser-line`,ariaHidden:!0}),t.span({className:`txt`},`Truncate`))}function Zn(e,n){let r=`delete_`+app.utils.randomString(),i=store({isSubmitting:!1,nameConfirm:``});async function a(){if(i.isSubmitting||!e.originalCollection?.name||e.originalCollection.name!=i.nameConfirm)return!1;i.isSubmitting=!0;try{return await app.pb.collections.delete(e.originalCollection.name),n?.ondelete?.(JSON.parse(JSON.stringify(e.originalCollection))),app.utils.removeByKey(app.store.collections,`id`,e.originalCollection.id),app.toasts.success(`Successfullydeletedcollection"${e.originalCollection.name}".`),i.isSubmitting=!1,!0}catch(e){i.isSubmitting=!1,app.checkApiError(e)}return!1}return t.button({type:`button`,className:`dropdown-itemtxt-danger`,disabled:()=>i.isSubmitting,onclick:n=>{n.target.closest(`.dropdown`).hidePopover();let o=n.target.closest(`.modal`);app.modals.confirm(t.div({className:`block`},t.h6({className:`blocktxt-center`},()=>e.originalCollection.type==`view`?`Doyoureallywanttodeletetheselectedcollection?`:`Doyoureallywanttodeletetheselectedcollectionandallitsrecords`),t.div({className:`confirm-collection-labeltxt-boldm-t-smm-b-sm`},`Typethecollectionname`,t.div({className:`label`},()=>e.originalCollection.name,app.components.copyButton(()=>e.originalCollection?.name)),`toconfirm:`),t.div({className:`field`},t.label({htmlFor:r+`.confirm_name`},`Collectionname`),t.input({id:r+`.confirm_name`,type:`text`,required:!0,pattern:()=>RegExp.escape(e.originalCollection.name),value:()=>i.nameConfirm,oninput:e=>i.nameConfirm=e.target.value}))),async()=>{if(document.getElementById(r+`.confirm_name`)?.reportValidity(),!await a())return!1;app.modals.close(o)},()=>{i.nameConfirm=``})}},t.i({className:`ri-delete-bin-7-line`,ariaHidden:!0}),t.span({className:`txt`},`Delete`))}window.app=window.app||{},window.app.components=window.
Line truncated
Totargetthenewlysubmittedonesyoucanuse@request.body.*.`)})],name:`updateRule`,autocomplete:i,disabled:()=>e.originalCollection?.system,value:()=>e.collection.updateRule,oninput:n=>e.collection.updateRule=n})),t.div({className:`col-12`,ariaDescription:r()},app.components.ruleField({label:`Deleterule`,name:`deleteRule`,autocomplete:i,disabled:()=>e.originalCollection?.system,value:()=>e.collection.deleteRule,oninput:n=>e.collection.deleteRule=n}))]}),()=>{if(e.collection.type==`auth`)return[t.hr({className:`m-t-basem-b-base`}),t.button({type:`button`,onmount:()=>{n.showAuthRules=e.collection.manageRule!==null||e.collection.authRule!==``},className:()=>`btnsecondarysm${n.showAuthRules?``:`transparent`}`,onclick:()=>{n.showAuthRules=!n.showAuthRules}},t.span({className:`txt`},`Additionalauthcollectionrules`),t.i({ariaHidden:!0,className:()=>n.showAuthRules?`ri-arrow-drop-up-line`:`ri-arrow-drop-down-line`})),app.components.slide(()=>n.showAuthRules,t.div({className:`gridsmm-t-sm`},t.div({className:`col-12`,ariaDescription:r()},app.components.ruleField({label:`Authenticationrule`,name:`authRule`,placeholder:``,autocomplete:i,disabled:()=>e.originalCollection?.system,value:()=>e.collection.authRule,oninput:n=>e.collection.authRule=n}),t.div({className:`field-help`},t.p(null,`Thisruleisexecutedeverytime`,t.strong(null,`beforeauthentication`),`allowingyoutorestrictwhocanauthenticate.`),t.p(null,`Forexample,toallowonlyverifiedusersyoucansetitto`,t.code(null,`verified=true`),`.`),t.p(null,`Leaveitemptytoallowanyonewithanaccounttoauthenticate.`),t.p(null,`Todisableauthenticationentirelyyoucanchangeitto"Set superusers only".`))),t.div({className:`col-12`,ariaDescription:r()},app.components.ruleField({label:`Managerule`,name:`manageRule`,autocomplete:i,disabled:()=>e.originalCollection?.system,value:()=>e.collection.manageRule,oninput:n=>e.collection.manageRule=n}),t.div({className:`field-help`},t.p(null,`Thisruleisexecutedinadditiontothe`,t.strong(null,`create`),`and`,t.strong(null,`update`),`APIrules.`),t.p(null,`Itenablessuperuser-likepermissionstoallowfullymanagingtheauthrecord(s),eg.changingthepasswordwithoutrequiringtoentertheoldone,directlyupdatingtheverifiedstateoremail,etc.`)))))]})}var qn=`test_view_query`;function Z(e){let n=`query_`+app.utils.randomString(),r=`SELECT.FROM.WHERE.LEFTJOIN.INNERJOIN.ON.AS.GROUPBY.HAVING.ORDERBY.ASC.DESC.LIMIT.OFFSET.WITH.NOT.IN.AND.OR.EXISTS.LIKE.CAST.REAL.DECIMAL.NUMERIC.INT.TEXT.BOOL`.split(`.`),i=store({testRecords:[],testError:``,isTesting:!1});async function a(n){if(i.isTesting=!0,i.testRecords=[],(app.store.errors?.viewQuery||app.store.errors?.fields)&&(delete app.store.errors.viewQuery,delete app.store.errors.fields),!n){i.testError=``,i.isTesting=!1;return}try{let r=await app.pb.send(`/api/collections/meta/dry-run-view`,{method:`POST`,body:{query:n},requestKey:qn});e.collection?.id?i.testRecords=r.sample.map(n=>(n.collectionId=e.collection?.id,n.collectionName=e.collection?.name,n)):i.testRecords=r.sample,i.testError=``,i.isTesting=!1}catch(e){e.isAbort||(i.testError=e.message||`Invalidquery.`,i.isTesting=!1)}}let o,s=[watch(()=>e.collection?.viewQuery,e=>{clearTimeout(o),o=setTimeout(()=>a(e),200)})];return t.div({pbEvent:`collectionViewQueryTabContent`,className:`collection-tab-contentcollection-view-query-tab-content`,onunmount:()=>{clearTimeout(o),app.pb.cancelRequest(qn),s.forEach(e=>e?.unwatch())}},t.div({className:`grid`},t.div({className:`col-12`},t.div({className:`txt-righttxt-smm-b-10`},t.button({type:`button`,className:`txt-boldlink-hint`,"html-popovertarget":n+`caveats_dropdown`},()=>`Querycaveats`)),t.div({id:n+`caveats_dropdown`,className:`dropdownsmquery-caveats-dropdown`,popover:`auto`},t.ul(null,t.li(null,`Wildcardcolumns(*)arenotsupported.`),t.li(null,`Thequerymusthaveaunique`,t.code(null,`id`),`column.`,t.br(),`Ifyourquerydoesn'thaveasuitableone,youcanusetheuniversal`,t.code(null,`(ROW_NUMBER()OVER())asid`),`.`),t.li(null,`Expressionsmustbealiasedwithavalidformattedfieldname,e.g.`,t.code(null,`MAX(balance)asmaxBalance`),`.`),t.li(null,`Combined/multi-spacedexpressionsmustbewrappedinparenthesis,e.g.`,t.code(null,`(MAX(balance)+1)asmaxBalance`),`.`),t.li(null,`UNIONexpressionsaresupportedbuttheentirequerymustbewrappedinparenthesis.`))),t.div({className:`field`},t.label({htmlFor:n+`.viewQuery`},t.span({className:`txt`},`Selectquery`),t.span({hidden:()=>!i.testError,className:`query-state`,ariaDescription:app.attrs.tooltip(`Invalidquery`,`left`)},t.i({className:`ri-error-warning-filltxt-danger`,ariaHidden:!0})),t.span({hidden:()=>!!i.testError,className:`query-state`,ariaDescription:app.attrs.tooltip(`Validquery`,`left`)},t.i({className:`ri-checkbox-circle-filltxt-success`,ariaHidden:!0}))),app.components.codeEditor({id:n+`.viewQuery`,name:`viewQuery`,language:`sql`,
Line truncated
`+e,`top`,`code`)})},t.div({className:`btns`},t.button({type:`button`,className:()=>`btnexpanded-lg${a.isSaving?`loading`:``}`,disabled:()=>!a.canSave,onclick:()=>s(!0)},t.span({className:`txt`},()=>a.isNew?`Create`:`Savechanges`)),t.button({type:`button`,title:`Saveoptions`,className:()=>`btnp-5`,disabled:()=>!a.canSave,"html-popovertarget":i+`save_options`},t.i({className:`ri-arrow-up-s-line`,ariaHidden:!0})),t.div({id:i+`save_options`,className:`dropdownnowrap`,popover:`auto`},t.button({type:`button`,className:`dropdown-item`,onclick:e=>{e.target.closest(`.dropdown`).hidePopover(),s(!1)}},t.span({className:`txt`},`Saveandcontinue`),t.small({className:`txt-hint`},`(Ctrl+S)`)),t.hr(),t.button({type:`button`,className:`dropdown-item`,onclick:e=>{e.target.closest(`.dropdown`).hidePopover(),u()}},t.span({className:`txt`},`Resetform`)))))),r}function Yn(e){let n=JSON.parse(JSON.stringify(app.store.collectionScaffolds[e.type])),r=JSON.parse(JSON.stringify(e.fields))||[],i=r.filter(e=>!e.system);e.fields=n.fields||[];for(let n of r){if(!n.system)continue;let r=e.fields.find(e=>e.name==n.name);r&&Object.assign(r,n)}for(let n of i)e.fields.push(n);if(e.indexes=e.indexes||[],e.indexes.length){let r=n?.indexes||[];indexesLoop:for(let n=e.indexes.length-1;n>=0;n--){let i=app.utils.parseIndex(e.indexes[n]),a=i.indexName.toLowerCase();for(let i of r)if(a==app.utils.parseIndex(i).indexName.toLowerCase()){e.indexes.splice(n,1);continue indexesLoop}for(let r of i.columns)if(!e.fields.find(e=>e.name.toLowerCase()==r.name.toLowerCase())){e.indexes.splice(n,1);continue indexesLoop}}}app.utils.mergeUnique(e.indexes,n.indexes),e.indexes=e.indexes?.map(n=>app.utils.replaceIndexFields(n,{tableName:e.name||``}))}function Xn(e,n){let r=`truncate_`+app.utils.randomString(),i=store({isSubmitting:!1,nameConfirm:``});async function a(){if(i.isSubmitting||!e.originalCollection?.name||e.originalCollection.name!=i.nameConfirm)return!1;i.isSubmitting=!0;try{return await app.pb.collections.truncate(e.originalCollection.name),n.ontruncate?.(JSON.parse(JSON.stringify(e.originalCollection))),app.toasts.success(`Successfullytruncatedcollection"${e.originalCollection.name}".`),i.isSubmitting=!1,!0}catch(e){i.isSubmitting=!1,app.checkApiError(e)}return!1}return t.button({type:`button`,className:`dropdown-itemtxt-danger`,disabled:()=>i.isSubmitting,onclick:n=>{n.target.closest(`.dropdown`).hidePopover(),app.modals.confirm(t.div(null,t.h6({className:`blocktxt-center`},`Doyoureallywanttodeleteallrecordsofthecollection?`),t.div({className:`confirm-collection-labeltxt-boldm-t-smm-b-sm`},`Typethecollectionname`,t.div({className:`label`},()=>e.originalCollection.name,app.components.copyButton(()=>e.originalCollection?.name)),`toconfirm:`),t.div({className:`field`},t.label({htmlFor:r+`.confirm_name`},`Collectionname`),t.input({id:r+`.confirm_name`,type:`text`,required:!0,pattern:()=>RegExp.escape(e.originalCollection.name),value:()=>i.nameConfirm,oninput:e=>i.nameConfirm=e.target.value}))),async()=>{if(document.getElementById(r+`.confirm_name`)?.reportValidity(),!await a())return!1;app.modals.close(n.target.closest(`.modal`))},()=>{i.nameConfirm=``})}},t.i({className:`ri-eraser-line`,ariaHidden:!0}),t.span({className:`txt`},`Truncate`))}function Zn(e,n){let r=`delete_`+app.utils.randomString(),i=store({isSubmitting:!1,nameConfirm:``});async function a(){if(i.isSubmitting||!e.originalCollection?.name||e.originalCollection.name!=i.nameConfirm)return!1;i.isSubmitting=!0;try{return await app.pb.collections.delete(e.originalCollection.name),n?.ondelete?.(JSON.parse(JSON.stringify(e.originalCollection))),app.utils.removeByKey(app.store.collections,`id`,e.originalCollection.id),app.toasts.success(`Successfullydeletedcollection"${e.originalCollection.name}".`),i.isSubmitting=!1,!0}catch(e){i.isSubmitting=!1,app.checkApiError(e)}return!1}return t.button({type:`button`,className:`dropdown-itemtxt-danger`,disabled:()=>i.isSubmitting,onclick:n=>{n.target.closest(`.dropdown`).hidePopover();let o=n.target.closest(`.modal`);app.modals.confirm(t.div({className:`block`},t.h6({className:`blocktxt-center`},()=>e.originalCollection.type==`view`?`Doyoureallywanttodeletetheselectedcollection?`:`Doyoureallywanttodeletetheselectedcollectionandallitsrecords`),t.div({className:`confirm-collection-labeltxt-boldm-t-smm-b-sm`},`Typethecollectionname`,t.div({className:`label`},()=>e.originalCollection.name,app.components.copyButton(()=>e.originalCollection?.name)),`toconfirm:`),t.div({className:`field`},t.label({htmlFor:r+`.confirm_name`},`Collectionname`),t.input({id:r+`.confirm_name`,type:`text`,required:!0,pattern:()=>RegExp.escape(e.originalCollection.name),value:()=>i.nameConfirm,oninput:e=>i.nameConfirm=e.target.value}))),async()=>{if(document.getElementById(r+`.confirm_name`)?.reportValidity(),!await a())return!1;app.modals.close(o)},()=>{i.nameConfirm=``})}},t.i({className:`ri-delete-bin-7-line`,ariaHidden
Line truncated
...
-----ENDPRIVATEKEY-----`,value:()=>a.privateKey||``,oninput:e=>a.privateKey=e.target.value})),t.div({className:`field-help`},`ThekeyisnotstoredontheserveranditisusedonlyforgeneratingthesignedJWT.`)))),t.footer({className:`modal-footer`},t.button({type:`button`,className:`btntransparentm-r-auto`,onclick:()=>app.modals.close(n)},t.span({className:`txt`},`Close`)),t.button({"html-form":r+`_form`,type:`submit`,className:`btnexpanded`},t.i({className:`ri-key-line`,ariaHidden:!0}),t.span({className:`txt`},`Generatesecret`)))),n}function lr(){return t.div({className:`inline-flexgap-5`},t.span(null,`Defaultloglevels:`),()=>{let e=[];for(let n in app.utils.logLevels)e.push(t.code(null,`${n}:${app.utils.logLevels[n].label}`));return e})}window.app=window.app||{},window.app.modals=window.app.modals||{},window.app.modals.openLogsSettings=function(e={onbeforeopen:null,onafteropen:null,onbeforeclose:null,onafterclose:null,onsave:null}){let n=ur(e);n&&(document.body.appendChild(n),app.modals.open(n))};function ur(e){let n,r=store({isLoading:!1,isSaving:!1,formSettings:{},initFormSettingsHash:``,get hasChanges(){return r.initFormSettingsHash!=JSON.stringify(r.formSettings)}});function i(e={}){r.formSettings={logs:e?.logs||{}},r.initFormSettingsHash=JSON.stringify(r.formSettings)}async function a(){r.isLoading=!0;try{i(await app.pb.settings.getAll({requestKey:`logsSettings`})),r.isLoading=!1}catch(e){e.isAbort||(r.isLoading=!1,app.checkApiError(e))}}async function o(){if(r.hasChanges){r.isSaving=!0;try{let a=await app.pb.settings.update(app.utils.filterRedactedProps(r.formSettings));e.onsave?.(a),i(a),app.toasts.success(`Successfullysavedlogssettings.`),r.isSaving=!1,app.modals.close(n)}catch(e){e.isAbort||(r.isSaving=!1,app.checkApiError(e))}}}return n=t.div({pbEvent:`logsSettingsModal`,className:`modalpopupsmlogs-settings-modal`,onbeforeopen:n=>(a(),e.onbeforeopen?.(n)),onafteropen:n=>{e.onafteropen?.(n)},onbeforeclose:n=>e.onbeforeclose?.(n),onafterclose:n=>{e.onafterclose?.(n),n?.remove()}},t.header({className:`modal-header`},t.h5({className:`m-auto`},`Logssettings`)),()=>r.isLoading?t.div({className:`modal-contentflex`,style:`min-height:200px`},t.span({className:`loaderm-auto`})):[t.form({pbEvent:`logsSettingsForm`,id:`logsSettingsForm`,className:`modal-contentlogs-settings-form`,onsubmit:e=>{e.preventDefault(),o()}},t.div({className:`grid`},t.div({className:`col-lg-12`},t.field({className:`field`},t.label({htmlFor:`logs.maxDays`},`Maxdaysretention`),t.input({type:`number`,id:`logs.maxDays`,name:`logs.maxDays`,min:0,required:!0,value:()=>r.formSettings.logs.maxDays,oninput:e=>r.formSettings.logs.maxDays=e.target.value<<0})),t.div({className:`field-help`},`Setto`,t.code(null,0),`todisablelogspersistence.`)),t.div({className:`col-lg-12`},t.field({className:`field`},t.label({htmlFor:`logs.minLevel`},`Minloglevel`),t.input({type:`number`,id:`logs.minLevel`,name:`logs.minLevel`,min:-100,max:100,required:!0,value:()=>r.formSettings.logs.minLevel,oninput:e=>r.formSettings.logs.minLevel=e.target.value<<0})),t.div({className:`field-help`},t.div(null,`Logswithlevelbelowtheminimumwillbeignored.`),lr())),t.div({className:`col-lg-12`},t.field({className:`field`},t.input({type:`checkbox`,id:`logs.logIP`,name:`logs.logIP`,className:`switch`,checked:()=>r.formSettings.logs.logIP,onchange:e=>r.formSettings.logs.logIP=e.target.checked}),t.label({htmlFor:`logs.logIP`},`EnableIPlogging`))),t.div({className:`col-lg-12`},t.field({className:`field`},t.input({type:`checkbox`,id:`logs.logAuthId`,name:`logs.logAuthId`,className:`switch`,checked:()=>r.formSettings.logs.logAuthId,onchange:e=>r.formSettings.logs.logAuthId=e.target.checked}),t.label({htmlFor:`logs.logAuthId`},`EnableAuthIdlogging`))))),t.footer({className:`modal-footer`},t.button({type:`button`,className:`btntransparentm-r-auto`,onclick:()=>app.modals.close(n),disabled:()=>r.isSaving},t.span({className:`txt`},`Close`)),t.button({type:`submit`,"html-form":`logsSettingsForm`,className:()=>`btn${r.isSaving?`loading`:``}`,disabled:()=>!r.hasChanges||r.isSaving},t.span({className:`txt`},`Savechanges`)))]),n}function dr(e){return t.div({className:()=>`labellog-level-labellevel-${e.level}`},t.span({className:`txt`},()=>`${app.utils.logLevels[e.level]?.label||`UNKN`}(${e.level})`))}window.app=window.app||{},window.app.modals=window.app.modals||{},window.app.modals.openLogPreview=function(e,n={onbeforeopen:null,onafteropen:null,onbeforeclose:null,onafterclose:null}){let r=hr(e,n);r&&(document.body.appendChild(r),app.modals.open(r))};var fr=[`execTime`,`type`,`auth`,`authId`,`status`,`method`,`url`,`referer`,`remoteIP`,`userIP`,`userAgent`,`error`,`details`];function pr(e){app.utils.downloadJSON(e,`log_`+e.created.replaceAll(/[-:\. ]/gi,``)+`.json`)}function mr(e){app.utils.copyToClipboard(JSON.stringify(e,null,2)),app.toasts.success(`Logcopiedtoclipboard!`)}function hr(e,n){let r,i=store({isLoading:!1,log:null,get isRequ
Line truncated
-----ENDPRIVATEKEY-----`,value:()=>a.privateKey||``,oninput:e=>a.privateKey=e.target.value})),t.div({className:`field-help`},`ThekeyisnotstoredontheserveranditisusedonlyforgeneratingthesignedJWT.`)))),t.footer({className:`modal-footer`},t.button({type:`button`,className:`btntransparentm-r-auto`,onclick:()=>app.modals.close(n)},t.span({className:`txt`},`Close`)),t.button({"html-form":r+`_form`,type:`submit`,className:`btnexpanded`},t.i({className:`ri-key-line`,ariaHidden:!0}),t.span({className:`txt`},`Generatesecret`)))),n}function lr(){return t.div({className:`inline-flexgap-5`},t.span(null,`Defaultloglevels:`),()=>{let e=[];for(let n in app.utils.logLevels)e.push(t.code(null,`${n}:${app.utils.logLevels[n].label}`));return e})}window.app=window.app||{},window.app.modals=window.app.modals||{},window.app.modals.openLogsSettings=function(e={onbeforeopen:null,onafteropen:null,onbeforeclose:null,onafterclose:null,onsave:null}){let n=ur(e);n&&(document.body.appendChild(n),app.modals.open(n))};function ur(e){let n,r=store({isLoading:!1,isSaving:!1,formSettings:{},initFormSettingsHash:``,get hasChanges(){return r.initFormSettingsHash!=JSON.stringify(r.formSettings)}});function i(e={}){r.formSettings={logs:e?.logs||{}},r.initFormSettingsHash=JSON.stringify(r.formSettings)}async function a(){r.isLoading=!0;try{i(await app.pb.settings.getAll({requestKey:`logsSettings`})),r.isLoading=!1}catch(e){e.isAbort||(r.isLoading=!1,app.checkApiError(e))}}async function o(){if(r.hasChanges){r.isSaving=!0;try{let a=await app.pb.settings.update(app.utils.filterRedactedProps(r.formSettings));e.onsave?.(a),i(a),app.toasts.success(`Successfullysavedlogssettings.`),r.isSaving=!1,app.modals.close(n)}catch(e){e.isAbort||(r.isSaving=!1,app.checkApiError(e))}}}return n=t.div({pbEvent:`logsSettingsModal`,className:`modalpopupsmlogs-settings-modal`,onbeforeopen:n=>(a(),e.onbeforeopen?.(n)),onafteropen:n=>{e.onafteropen?.(n)},onbeforeclose:n=>e.onbeforeclose?.(n),onafterclose:n=>{e.onafterclose?.(n),n?.remove()}},t.header({className:`modal-header`},t.h5({className:`m-auto`},`Logssettings`)),()=>r.isLoading?t.div({className:`modal-contentflex`,style:`min-height:200px`},t.span({className:`loaderm-auto`})):[t.form({pbEvent:`logsSettingsForm`,id:`logsSettingsForm`,className:`modal-contentlogs-settings-form`,onsubmit:e=>{e.preventDefault(),o()}},t.div({className:`grid`},t.div({className:`col-lg-12`},t.field({className:`field`},t.label({htmlFor:`logs.maxDays`},`Maxdaysretention`),t.input({type:`number`,id:`logs.maxDays`,name:`logs.maxDays`,min:0,required:!0,value:()=>r.formSettings.logs.maxDays,oninput:e=>r.formSettings.logs.maxDays=e.target.value<<0})),t.div({className:`field-help`},`Setto`,t.code(null,0),`todisablelogspersistence.`)),t.div({className:`col-lg-12`},t.field({className:`field`},t.label({htmlFor:`logs.minLevel`},`Minloglevel`),t.input({type:`number`,id:`logs.minLevel`,name:`logs.minLevel`,min:-100,max:100,required:!0,value:()=>r.formSettings.logs.minLevel,oninput:e=>r.formSettings.logs.minLevel=e.target.value<<0})),t.div({className:`field-help`},t.div(null,`Logswithlevelbelowtheminimumwillbeignored.`),lr())),t.div({className:`col-lg-12`},t.field({className:`field`},t.input({type:`checkbox`,id:`logs.logIP`,name:`logs.logIP`,className:`switch`,checked:()=>r.formSettings.logs.logIP,onchange:e=>r.formSettings.logs.logIP=e.target.checked}),t.label({htmlFor:`logs.logIP`},`EnableIPlogging`))),t.div({className:`col-lg-12`},t.field({className:`field`},t.input({type:`checkbox`,id:`logs.logAuthId`,name:`logs.logAuthId`,className:`switch`,checked:()=>r.formSettings.logs.logAuthId,onchange:e=>r.formSettings.logs.logAuthId=e.target.checked}),t.label({htmlFor:`logs.logAuthId`},`EnableAuthIdlogging`))))),t.footer({className:`modal-footer`},t.button({type:`button`,className:`btntransparentm-r-auto`,onclick:()=>app.modals.close(n),disabled:()=>r.isSaving},t.span({className:`txt`},`Close`)),t.button({type:`submit`,"html-form":`logsSettingsForm`,className:()=>`btn${r.isSaving?`loading`:``}`,disabled:()=>!r.hasChanges||r.isSaving},t.span({className:`txt`},`Savechanges`)))]),n}function dr(e){return t.div({className:()=>`labellog-level-labellevel-${e.level}`},t.span({className:`txt`},()=>`${app.utils.logLevels[e.level]?.label||`UNKN`}(${e.level})`))}window.app=window.app||{},window.app.modals=window.app.modals||{},window.app.modals.openLogPreview=function(e,n={onbeforeopen:null,onafteropen:null,onbeforeclose:null,onafterclose:null}){let r=hr(e,n);r&&(document.body.appendChild(r),app.modals.open(r))};var fr=[`execTime`,`type`,`auth`,`authId`,`status`,`method`,`url`,`referer`,`remoteIP`,`userIP`,`userAgent`,`error`,`details`];function pr(e){app.utils.downloadJSON(e,`log_`+e.created.replaceAll(/[-:\. ]/gi,``)+`.json`)}function mr(e){app.utils.copyToClipboard(JSON.stringify(e,null,2)),app.toasts.success(`Logcopiedtoclipboard!`)}function hr(e,n){let r,i=store({isLoading:!1,log:null,get isRequ
Line truncated
(listchanged)`:``}`})),t.div({hidden:()=>!app.store.activeCollection?.id,pbEvent:`pageHeaderPrimaryBtns`,className:`page-header-primary-btns`},t.button({type:`button`,className:`btn outline api-preview-btn`,onclick:()=>app.modals.openApiPreview(app.store.activeCollection)},t.i({className:`ri-code-s-slash-line`,ariaHidden:!0}),t.span({className:`txt`,textContent:`API preview`})),()=>{if(app.store.activeCollection?.type!=`view`)returnt.button({type:`button`,className:`btn new-record-btn`,onclick:()=>app.modals.openRecordUpsert(app.store.activeCollection)},t.i({className:`ri-add-line`,ariaHidden:!0}),t.span({className:`txt`,textContent:`New record`}))})),t.div({hidden:()=>!app.store.isLoadingCollections||app.store.activeCollection?.id,className:`block txt-center p-base`},t.span({className:`loader lg`})),t.div({hidden:()=>app.store.isLoadingCollections||app.store.activeCollection?.id,className:`block txt-center p-base`},t.h6({className:`txt`},()=>app.store.collections?.length?`Select collection from the sidebar.`:`No collections found.`)),app.components.recordsSearchbar({hidden:()=>!app.store.activeCollection?.id,collection:()=>app.store.activeCollection,value:()=>r.filter,onsubmit:e=>r.filter=e}),app.components.recordsList({className:`m-t-sm`,reset:()=>r.reset,hidden:()=>!app.store.activeCollection?.id,collection:()=>app.store.activeCollection,filter:()=>r.filter,sort:()=>r.sort,onselect:e=>{r.activeRecordIdOrModel=e},onchange:(e,n)=>{r.filter=e,r.sort=n},suggestReset:()=>r.suggestReset,onSuggestResetChange:e=>{r.suggestReset=!!e}}),t.footer({className:`page-footer`},t.span({className:()=>`total-count ${r.isTotalCountLoading?`faded`:``}`},`Total: `,()=>r.totalCount),app.components.credits())))}functionMr(){returndocument.body.clientWidth>600&&document.body.clientHeight>=720?150:100}functionNr(e){letn=store({stats:[]});asyncfunctionr(r){if(r){e.isChartLoading=!0;try{leti=(e.presets||[]).concat(app.utils.normalizeSearchFilter(e.filter,[`level`,`message`,`data`])),a=awaitapp.pb.logs.getStats({filter:i.filter(Boolean).map(e=>`(`+e+`)`).join(`&&`)}),o=a.length,s=[],c=[];e.totalFound=0;for(letn=0;n<o;n++){letr=newDate(a[n].date.replace(``,`T`)).getTime()/1e3;s.push(r),c.push(a[n].total),e.totalFound+=a[n].total,a[n+1]?.date?newDate(a[n+1].date.replace(``,`T`)).getTime()/1e3-r>3600&&(s.push(r+3600),c.push(0)):n+1==o&&(s.push(r+3600),c.push(0))}n.stats=a,e.isChartLoading=!1,Fr(r,[s,c],e)}catch(n){n?.isAbort||(e.isChartLoading=!1,console.warn(`failed to load logs chart:`,n))}}}leti=[];returnt.div({pbEvent:`logsChart`,className:()=>[`logs-chart`,e.isChartLoading?`loading`:null,e.zoom?.min&&e.zoom?.max?`zoomed`:``,!n.stats.length||!e.isFirstLoadReady?`nodata`:null].filter(Boolean).join(``),onmount:n=>{i.push(watch(()=>[e.reset,e.filter,e.presets?.length],()=>r(n))),n._resizeChartFunc=()=>{clearTimeout(n._resizeTimeoutId),n._resizeTimeoutId=setTimeout(()=>{n?._uplot&&n._uplot.setSize({width:n.clientWidth,height:Mr()})},100)},window.addEventListener(`resize`,n._resizeChartFunc)},onunmount:e=>{i.forEach(e=>e?.unwatch()),e._uplot?.destroy(),e._resizeChartFunc&&(clearTimeout(e._resizeTimeoutId),window.removeEventListener(`resize`,e._resizeChartFunc),e._resizeChartFunc=null,e._resizeTimeoutId=null)}},t.button({type:`button`,className:()=>`logs-reset-zoom-ctrl ${e.zoom?.min&&e.zoom?.max?``:`hidden`}`,onclick(){e.zoom={}}},t.div({className:`content-primary`},`Reset zoom`),t.div({className:`content-secondary`},`(drag the timeline to pan)`)),t.span({hidden:()=>!e.isChartLoading,className:()=>`loader logs-chart-loader`}))}functionPr(e){letn=e?.data?.[0];n&&e.setScale(`x`,{min:n[0],max:n[n.length-1]})}functionFr(e,n,r){leti=window.getComputedStyle(e),a=i.getPropertyValue(`--surfaceTxtHintColor`),o=i.getPropertyValue(`--surfaceAlt1Color`),s=i.getPropertyValue(`--surfaceAlt4Color`),c=i.getPropertyValue(`--surfaceAlt2Color`),l={width:e.clientWidth,height:Mr(),legend:{show:!1},cursor:{x:!1,y:!1},scales:{x:{range:(e,r,i)=>r<n[0][0]||i>n[0][n[0].length-1]?[e.scales.x.min,e.scales.x.max]:[r,i]},y:{range:{min:{pad:.2,soft:0,mode:1},max:{pad:.2,soft:0,mode:2}}}},series:[{},{paths:uPlot.paths.stepped({align:1}),points:{show:!1,size:1},width:2,fill:c,stroke:s}],axes:[{show:!0,size:35,lineGap:1,space:60,stroke:a,incrs:[300,600,900,1800,3600,3600*2,3600*3,3600*4,3600*6,3600*12,86400,86400*2],values:[[3600,`{h}{aa}`,`
{MMM}{DD}`,null,`
{MMM}{DD}`,null,null,null,1],[60,`{h}:{mm}{aa}`,`
{MMM}{DD}`,null,`
@@ -72,11 +73,11 @@ It is recommend to list it as trusted.`,`right`)});if(i.isEnabled&&i.possiblePro
(function(e){lett,n=newSet,r=newMap,i=[],a,o=Symbol(),s=Symbol(),c=Symbol(),l=Symbol(),u=Symbol(),d=Symbol(),f=Symbol(),p=Symbol(),m=Symbol(),h=Symbol();functiong(e,n){letd={[o]:`_`+Math.random(),[p]:e,[m]:n};returnr.set(d[o],d),d.run=()=>{lete;t&&(e=t,d[s]=t[o],t[c]=t[c]||[],t[c].push(d[o])),d[l]?.forEach(e=>{e.delete(d[o])}),t=d;letn=d[p](d[h],d);d[m]&&(t=null,d[m](n,d[h],d)),d[h]=n,t=e},d.unwatch=function(){d[u]=1,i.push(d[o]),a&&clearTimeout(a),a=setTimeout(()=>{for(leteofi)_(e);i=[],a=null},50)},d.run(),d}function_(e){lett=r.get(e);if(t?.[d]?.(),t?.[c]){for(leteoft[c])_(e);t[s]=null,t[c]=null}if(t?.[l]){for(letnoft[l])n.delete(e);t[l]=null}r.delete(e)}functionv(e){returny(e,newMap)}functiony(e,n){letr=typeofe==`object`&&!Array.isArray(e)?Object.getOwnPropertyDescriptors(e):{};returnnewProxy(e,{get(e,i,a){if(typeofi==`symbol`)returne[i];if(i==`__raw`)returne;if(r[i]?.get&&!e[s]){letn=i;if(i=`@@`+i,!t){lett=r[n].get.call(e);returnr[n]._watcher&&(a[i]=t),t}lets=t[o];if(r[n]._refs=r[n]._refs||newSet,!r[n]._refs.has(s)){r[n]._refs.add(s);lete=t[d];t[d]=()=>{e?.(),r[n]._refs.delete(s),!r[n]._refs.size&&r[n]._watcher&&_(r[n]._watcher[o])}}if(!r[n]._watcher){leto=t;t=null;lets=g(r[n].get.bind(e),t=>{e.hasOwnProperty(i)?a[i]=t:Object.defineProperty(e,i,{writable:!0,enumerable:!1,value:t})});r[n]._watcher=s,s[d]=()=>{r[n]._watcher=null},t=o}}letc=e?.[i];if(typeofc==`function`)returnc;if(typeofc==`object`&&c&&!c[s]&&(c.constructor?.name==`Object`||c.constructor?.name==`Array`||c.constructor?.name==null)&&(c[s]=[a,i],c=y(c,n),e[i]=c),t){letr=b(e,i),a=t[o],s=[r];t[l]=t[l]||newSet;for(leteofs){letr=n.get(e);r||(r=newSet,n.set(e,r)),r.add(a),t[l].add(r)}}returnc},set(e,t,r){if(typeoft==`symbol`)returne[t]=r,!0;leti=e[t];i?.[s]&&(i[f]=!0),r?.[s]&&Array.isArray(e)&&!isNaN(t)&&(r[s][1]=t);leta=!1;returni===void0&&!e.hasOwnProperty(t)&&(a=!0),e[t]=r,a&&x(e,`toJSON`,n),(r!==i||t===`length`)&&x(e,t,n),!0},deleteProperty(e,t){if(typeoft!=`symbol`){x(e,t,n);letr=b(e,t);for(leteofn)(e[0]==r||e[0].startsWith(r+`/`))&&n.delete(e[0])}returndeletee[t]}})}functionb(e,t){letn=t,r=e?.[s];for(;r;)n=r[1]+`/`+n,r=r[0][s];returnn}functionx(e,t,i){leta=b(e,t),o=i.get(a);if(o)for(leteofo)n.delete(e),n.add(e),n.size==1&&queueMicrotask(()=>{lete={},t;for(letiofn)if(t=r.get(i),!(!t||t[u])&&!(t[s]&&n.has(t[s]))){if(e[i]=(e[i]||0)+1,e[i]>250){console.warn(`Possible infinite loop for watcher `+i+`:`,`
watch(`+t[p]?.toString()+(t[m]?`, `+t[m].toString():``)+`)`);continue}t.run()}n.clear()})}letS=newProxy({},{get(e,t){returnfunction(){returnw(),O.call(void0,t,...arguments)}}}),C=!1;functionw(){if(C)return;C=!0;functione(t,n){for(letrofn)r[t]&&r[t](r),r.childNodes&&e(t,r.childNodes)}newMutationObserver(t=>{for(letnoft)e(`onmount`,n.addedNodes),e(`onunmount`,n.removedNodes)}).observe(document,{childList:!0,subtree:!0})}letT=Symbol(),E=Symbol(),D=Symbol();functionO(e,t={},...n){letr=document.createElement(e);if(t)for(leteint){letn=t[e],i=!1;e.length>5&&e.startsWith(`html-`)&&(i=!0,e=e.substring(5)),n===void0?r.removeAttribute(e):typeofn!=`function`||e.length>2&&e.startsWith(`on`)?i?r.setAttribute(e,n):r[e]=n:(e==`rid`&&console.warn(`rid is provided as reactive function and will not have effect for `+r+`.
Consider using a plain number, string or object/array reference instead.`),r[T]=r[T]||[],r[T].push(()=>{if(!r)return;lett=n(r,e);t===void0?(r[e]!==void0&&(r[e]=void0),r.removeAttribute(e)):i?r.setAttribute(e,t):r[e]=t}))}leti=r.onmount;r.onmount=()=>{if(!r[D]){if(r[D]=!0,r[T]){r[E]=r[E]||[];for(leteofr[T])r[E].push(g(e))}i?.(r)}};leta=r.onunmount;returnr.onunmount=()=>{if(r[D]){if(r[D]=!1,r[E])for(leteofr[E])e.unwatch();r[E]=null,a?.(r)}},k(r,n),r}functionk(e,t){t=N(t);for(letnoft)if(typeofn==`function`)A(e,n);else{lett=P(n);Array.isArray(t)?k(e,t):t&&e.appendChild(t)}}functionA(e,t){letn=document.createComment(``);e.appendChild(n);letr=[],i=newMap,a=e.moveBefore||e.insertBefore;e[T]=e[T]||[],e[T].push(()=>{if(!e)return;leto=N(t(e)),s=o.length,c=newMap;if(!r?.length){lett=document.createDocumentFragment();for(lete=0;e<s;e++){o[e]=P(o[e]),t.appendChild(o[e]);letn=o[e].rid;n!==void0&&(c.has(n)?console.warn(`Duplicated rid:`,n,o[e]):c.set(n,e))}e.insertBefore(t,n),t=null,r=o,i=c;return}letl=[],u=[],d=newSet,f=[];for(lete=0;e<s;e++){o[e]=P(o[e]);lett=o[e].rid;if(t!==void0){c.has(t)?console.warn(`Duplicated rid:`,t,o[e]):c.set(t,e);letn=i.get(t);if(n>=0){d.add(r[n]),o[e]=r[n],f.push(n);continue}}u.push({child:o[e],prev:o[e-1]})}letp=j(f);f.length!=p.length&&f.forEach((e,t)=>{p.has(e)||l.push({child:r[e],targetPos:t})});letm,h,g;for(lettofl)m=r.findIndex(e=>e===t.child),h=t.targetPos,m<t.targetPos&&(h=t.targetPos+1),g=r[h]||n,M(r,m,t.targetPos),a.call(e,t.child,g);for(leteofu)e.prev?e.prev.after(e.child):(r[0]||n).before(e.child);for(lete=0;e<r.length;e++)d.has(r[e])||r[e].remove?.();r=o,i=c,o=null,c=null,d=null,l=null,u=null})}functionj(e){lett=[],n=[];for(letr=0;r<e.length;r++){leti=e[r],a=0,o=0,s=t.length;for(;a<s;)o=Math.floor((a+s)/2),e[t[o]]>=i?s=o:a=o+1;a>0&&(n[r]=t[a-1]),t[a]=r}letr=newSet,i=t[t.length-1];for(;i!==void0;)r.add(e[i]),i=n[i];returnr}functionM(e,t,n){if(t==n)returne;letr=t>n?-1:1,i=e[t];for(leti=t;i!=n;i+=r)e[i]=e[i+r];e[n]=i}functionN(e){returne==null?[]:Array.isArray(e)?e:[e]}functionP(e){returntypeofe==`string`||typeofe==`number`||typeofe==`boolean`?document.createTextNode(e):e?.__raw===void0?e:e.__raw}functionF(e,t={fallbackPath:`#/`,transition:!0}){letn=L(e),r,i=()=>{lete=window.location.hash,i=I(n,e);if(!i){if(t.fallbackPath!=e){window.location.hash=t.fallbackPath;return}console.warn(`missing route:`,e);return}leta=async()=>{try{awaitr?.(),r=awaiti.handler(i)}catch(e){console.warn(`route navigation failed:`,e)}};t.transition&&document.startViewTransition?document.startViewTransition(a):a()};returnwindow.addEventListener(`hashchange`,i),i(),()=>{window.removeEventListener(`hashchange`,i)}}functionI(e,t){for(letnofe){lete=t.match(n.regex);if(!e)continue;letr={},i=t.split(`?`)?.[1];if(i){lete=newURLSearchParams(i);for(let[t,n]ofe.entries())Array.isArray(r[t])||(r[t]=r[t]?[r[t]]:[]),r[t].push(n)}returnObject.assign({path:t,query:r,params:e.groups||{}},n)}}functionL(e){lett=[];for(letnine){letr=n.split(`/`);for(leteinr)r[e].length>2&&r[e].startsWith(`{`)&&r[e].endsWith(`}`)?r[e]=`(?<`+r[e].substring(1,r[e].length-1)+`>[^\\/#?]+)`:r[e]=RegExp.escape(r[e]);t.push({regex:RegExp(`^`+r.join(`\\/`)+`(?:[?#].*)?$`),pattern:n,handler:e[n]})}returnt}e.router=F,e.store=v,e.t=S,e.watch=g})(this.window=this.window||{});
Consider using a plain number, string or object/array reference instead.`),r[T]=r[T]||[],r[T].push(()=>{if(!r)return;lett=n(r,e);t===void0?(r[e]!==void0&&(r[e]=void0),r.removeAttribute(e)):i?r.setAttribute(e,t):r[e]=t}))}leti=r.onmount;r.onmount=()=>{if(!r[D]){if(r[D]=!0,r[T]){r[E]=r[E]||[];for(leteofr[T])r[E].push(g(e))}i?.(r)}};leta=r.onunmount;returnr.onunmount=()=>{if(r[D]){if(r[D]=!1,r[E])for(leteofr[E])e.unwatch();r[E]=null,a?.(r)}},k(r,n),r}functionk(e,t){t=N(t);for(letnoft)if(typeofn==`function`)A(e,n);else{lett=P(n);Array.isArray(t)?k(e,t):t&&e.appendChild(t)}}functionA(e,t){letn=document.createComment(``);e.appendChild(n);letr=[],i=newMap,a=e.moveBefore||e.insertBefore;e[T]=e[T]||[],e[T].push(()=>{if(!e)return;leto=N(t(e)),s=o.length,c=newMap;if(!r?.length){lett=document.createDocumentFragment();for(lete=0;e<s;e++){o[e]=P(o[e],!0),t.appendChild(o[e]);letn=o[e].rid;n!==void0&&(c.has(n)?console.warn(`Duplicated rid:`,n,o[e]):c.set(n,e))}e.insertBefore(t,n),t=null,r=o,i=c;return}letl=[],u=[],d=newSet,f=[];for(lete=0;e<s;e++){o[e]=P(o[e],!0);lett=o[e].rid;if(t!==void0){c.has(t)?console.warn(`Duplicated rid:`,t,o[e]):c.set(t,e);letn=i.get(t);if(n>=0){d.add(r[n]),o[e]=r[n],f.push(n);continue}}u.push({child:o[e],prev:o[e-1]})}letp=j(f);f.length!=p.length&&f.forEach((e,t)=>{p.has(e)||l.push({child:r[e],targetPos:t})});letm,h,g;for(lettofl)m=r.findIndex(e=>e===t.child),h=t.targetPos,m<t.targetPos&&(h=t.targetPos+1),g=r[h]||n,M(r,m,t.targetPos),a.call(e,t.child,g);for(leteofu)e.prev?e.prev.after(e.child):(r[0]||n).before(e.child);for(lete=0;e<r.length;e++)d.has(r[e])||r[e].remove?.();r=o,i=c,o=null,c=null,d=null,l=null,u=null})}functionj(e){lett=[],n=[];for(letr=0;r<e.length;r++){leti=e[r],a=0,o=0,s=t.length;for(;a<s;)o=Math.floor((a+s)/2),e[t[o]]>=i?s=o:a=o+1;a>0&&(n[r]=t[a-1]),t[a]=r}letr=newSet,i=t[t.length-1];for(;i!==void0;)r.add(e[i]),i=n[i];returnr}functionM(e,t,n){if(t==n)returne;letr=t>n?-1:1,i=e[t];for(leti=t;i!=n;i+=r)e[i]=e[i+r];e[n]=i}functionN(e){returne==null?[]:Array.isArray(e)?e:[e]}functionP(e,t=!1){returnt&&e==null&&(e=``),typeofe==`string`||typeofe==`number`||typeofe==`boolean`?document.createTextNode(e):e?.__raw===void0?e:e.__raw}functionF(e,t={fallbackPath:`#/`,transition:!0}){letn=L(e),r,i=()=>{lete=window.location.hash,i=I(n,e);if(!i){if(t.fallbackPath!=e){window.location.hash=t.fallbackPath;return}console.warn(`missing route:`,e);return}leta=async()=>{try{awaitr?.(),r=awaiti.handler(i)}catch(e){console.warn(`route navigation failed:`,e)}};t.transition&&document.startViewTransition?document.startViewTransition(a):a()};returnwindow.addEventListener(`hashchange`,i),i(),()=>{window.removeEventListener(`hashchange`,i)}}functionI(e,t){for(letnofe){lete=t.match(n.regex);if(!e)continue;letr={},i=t.split(`?`)?.[1];if(i){lete=newURLSearchParams(i);for(let[t,n]ofe.entries())Array.isArray(r[t])||(r[t]=r[t]?[r[t]]:[]),r[t].push(n)}returnObject.assign({path:t,query:r,params:e.groups||{}},n)}}functionL(e){lett=[];for(letnine){letr=n.split(`/`);for(leteinr)r[e].length>2&&r[e].startsWith(`{`)&&r[e].endsWith(`}`)?r[e]=`(?<`+r[e].substring(1,r[e].length-1)+`>[^\\/#?]+)`:r[e]=RegExp.escape(r[e]);t.push({regex:RegExp(`^`+r.join(`\\/`)+`(?:[?#].*)?$`),pattern:n,handler:e[n]})}returnt}e.router=F,e.store=v,e.t=S,e.watch=g})(this.window=this.window||{});
(function(e){lett,n=newSet,r=newMap,i=[],a,o=Symbol(),s=Symbol(),c=Symbol(),l=Symbol(),u=Symbol(),d=Symbol(),f=Symbol(),p=Symbol(),m=Symbol(),h=Symbol();functiong(e,n){letd={[o]:`_`+Math.random(),[p]:e,[m]:n};returnr.set(d[o],d),d.run=()=>{lete;t&&(e=t,d[s]=t[o],t[c]=t[c]||[],t[c].push(d[o])),d[l]?.forEach(e=>{e.delete(d[o])}),t=d;letn=d[p](d[h],d);d[m]&&(t=null,d[m](n,d[h],d)),d[h]=n,t=e},d.unwatch=function(){d[u]=1,i.push(d[o]),a&&clearTimeout(a),a=setTimeout(()=>{for(leteofi)_(e);i=[],a=null},50)},d.run(),d}function_(e){lett=r.get(e);if(t?.[d]?.(),t?.[c]){for(leteoft[c])_(e);t[s]=null,t[c]=null}if(t?.[l]){for(letnoft[l])n.delete(e);t[l]=null}r.delete(e)}functionv(e){returny(e,newMap)}functiony(e,n){letr=typeofe==`object`&&!Array.isArray(e)?Object.getOwnPropertyDescriptors(e):{};returnnewProxy(e,{get(e,i,a){if(typeofi==`symbol`)returne[i];if(i==`__raw`)returne;if(r[i]?.get&&!e[s]){letn=i;if(i=`@@`+i,!t){lett=r[n].get.call(e);returnr[n]._watcher&&(a[i]=t),t}lets=t[o];if(r[n]._refs=r[n]._refs||newSet,!r[n]._refs.has(s)){r[n]._refs.add(s);lete=t[d];t[d]=()=>{e?.(),r[n]._refs.delete(s),!r[n]._refs.size&&r[n]._watcher&&_(r[n]._watcher[o])}}if(!r[n]._watcher){leto=t;t=null;lets=g(r[n].get.bind(e),t=>{e.hasOwnProperty(i)?a[i]=t:Object.defineProperty(e,i,{writable:!0,enumerable:!1,value:t})});r[n]._watcher=s,s[d]=()=>{r[n]._watcher=null},t=o}}letc=e?.[i];if(typeofc==`function`)returnc;if(typeofc==`object`&&c&&!c[s]&&(c.constructor?.name==`Object`||c.constructor?.name==`Array`||c.constructor?.name==null)&&(c[s]=[a,i],c=y(c,n),e[i]=c),t){letr=b(e,i),a=t[o],s=[r];t[l]=t[l]||newSet;for(leteofs){letr=n.get(e);r||(r=newSet,n.set(e,r)),r.add(a),t[l].add(r)}}returnc},set(e,t,r){if(typeoft==`symbol`)returne[t]=r,!0;leti=e[t];i?.[s]&&(i[f]=!0),r?.[s]&&Array.isArray(e)&&!isNaN(t)&&(r[s][1]=t);leta=!1;returni===void0&&!e.hasOwnProperty(t)&&(a=!0),e[t]=r,a&&x(e,`toJSON`,n),(r!==i||t===`length`)&&x(e,t,n),!0},deleteProperty(e,t){if(typeoft!=`symbol`){x(e,t,n);letr=b(e,t);for(leteofn)(e[0]==r||e[0].startsWith(r+`/`))&&n.delete(e[0])}returndeletee[t]}})}functionb(e,t){letn=t,r=e?.[s];for(;r;)n=r[1]+`/`+n,r=r[0][s];returnn}functionx(e,t,i){leta=b(e,t),o=i.get(a);if(o)for(leteofo)n.delete(e),n.add(e),n.size==1&&queueMicrotask(()=>{lete={},t;for(letiofn)if(t=r.get(i),!(!t||t[u])&&!(t[s]&&n.has(t[s]))){if(e[i]=(e[i]||0)+1,e[i]>250){console.warn(`Possible infinite loop for watcher `+i+`:`,`
watch(`+t[p]?.toString()+(t[m]?`, `+t[m].toString():``)+`)`);continue}t.run()}n.clear()})}letS=newProxy({},{get(e,t){returnfunction(){returnw(),O.call(void0,t,...arguments)}}}),C=!1;functionw(){if(C)return;C=!0;functione(t,n){for(letrofn)r[t]&&r[t](r),r.childNodes&&e(t,r.childNodes)}newMutationObserver(t=>{for(letnoft)e(`onmount`,n.addedNodes),e(`onunmount`,n.removedNodes)}).observe(document,{childList:!0,subtree:!0})}letT=Symbol(),E=Symbol(),D=Symbol();functionO(e,t={},...n){letr=document.createElement(e);if(t)for(leteint){letn=t[e],i=!1;e.length>5&&e.startsWith(`html-`)&&(i=!0,e=e.substring(5)),n===void0?r.removeAttribute(e):typeofn!=`function`||e.length>2&&e.startsWith(`on`)?i?r.setAttribute(e,n):r[e]=n:(e==`rid`&&console.warn(`rid is provided as reactive function and will not have effect for `+r+`.
Consider using a plain number, string or object/array reference instead.`),r[T]=r[T]||[],r[T].push(()=>{if(!r)return;lett=n(r,e);t===void0?(r[e]!==void0&&(r[e]=void0),r.removeAttribute(e)):i?r.setAttribute(e,t):r[e]=t}))}leti=r.onmount;r.onmount=()=>{if(!r[D]){if(r[D]=!0,r[T]){r[E]=r[E]||[];for(leteofr[T])r[E].push(g(e))}i?.(r)}};leta=r.onunmount;returnr.onunmount=()=>{if(r[D]){if(r[D]=!1,r[E])for(leteofr[E])e.unwatch();r[E]=null,a?.(r)}},k(r,n),r}functionk(e,t){t=N(t);for(letnoft)if(typeofn==`function`)A(e,n);else{lett=P(n);Array.isArray(t)?k(e,t):t&&e.appendChild(t)}}functionA(e,t){letn=document.createComment(``);e.appendChild(n);letr=[],i=newMap,a=e.moveBefore||e.insertBefore;e[T]=e[T]||[],e[T].push(()=>{if(!e)return;leto=N(t(e)),s=o.length,c=newMap;if(!r?.length){lett=document.createDocumentFragment();for(lete=0;e<s;e++){o[e]=P(o[e]),t.appendChild(o[e]);letn=o[e].rid;n!==void0&&(c.has(n)?console.warn(`Duplicated rid:`,n,o[e]):c.set(n,e))}e.insertBefore(t,n),t=null,r=o,i=c;return}letl=[],u=[],d=newSet,f=[];for(lete=0;e<s;e++){o[e]=P(o[e]);lett=o[e].rid;if(t!==void0){c.has(t)?console.warn(`Duplicated rid:`,t,o[e]):c.set(t,e);letn=i.get(t);if(n>=0){d.add(r[n]),o[e]=r[n],f.push(n);continue}}u.push({child:o[e],prev:o[e-1]})}letp=j(f);f.length!=p.length&&f.forEach((e,t)=>{p.has(e)||l.push({child:r[e],targetPos:t})});letm,h,g;for(lettofl)m=r.findIndex(e=>e===t.child),h=t.targetPos,m<t.targetPos&&(h=t.targetPos+1),g=r[h]||n,M(r,m,t.targetPos),a.call(e,t.child,g);for(leteofu)e.prev?e.prev.after(e.child):(r[0]||n).before(e.child);for(lete=0;e<r.length;e++)d.has(r[e])||r[e].remove?.();r=o,i=c,o=null,c=null,d=null,l=null,u=null})}functionj(e){lett=[],n=[];for(letr=0;r<e.length;r++){leti=e[r],a=0,o=0,s=t.length;for(;a<s;)o=Math.floor((a+s)/2),e[t[o]]>=i?s=o:a=o+1;a>0&&(n[r]=t[a-1]),t[a]=r}letr=newSet,i=t[t.length-1];for(;i!==void0;)r.add(e[i]),i=n[i];returnr}functionM(e,t,n){if(t==n)returne;letr=t>n?-1:1,i=e[t];for(leti=t;i!=n;i+=r)e[i]=e[i+r];e[n]=i}functionN(e){returne==null?[]:Array.isArray(e)?e:[e]}functionP(e){returntypeofe==`string`||typeofe==`number`||typeofe==`boolean`?document.createTextNode(e):e?.__raw===void0?e:e.__raw}functionF(e,t={fallbackPath:`#/`,transition:!0}){letn=L(e),r,i=()=>{lete=window.location.hash,i=I(n,e);if(!i){if(t.fallbackPath!=e){window.location.hash=t.fallbackPath;return}console.warn(`missing route:`,e);return}leta=async()=>{try{awaitr?.(),r=awaiti.handler(i)}catch(e){console.warn(`route navigation failed:`,e)}};t.transition&&document.startViewTransition?document.startViewTransition(a):a()};returnwindow.addEventListener(`hashchange`,i),i(),()=>{window.removeEventListener(`hashchange`,i)}}functionI(e,t){for(letnofe){lete=t.match(n.regex);if(!e)continue;letr={},i=t.split(`?`)?.[1];if(i){lete=newURLSearchParams(i);for(let[t,n]ofe.entries())Array.isArray(r[t])||(r[t]=r[t]?[r[t]]:[]),r[t].push(n)}returnObject.assign({path:t,query:r,params:e.groups||{}},n)}}functionL(e){lett=[];for(letnine){letr=n.split(`/`);for(leteinr)r[e].length>2&&r[e].startsWith(`{`)&&r[e].endsWith(`}`)?r[e]=`(?<`+r[e].substring(1,r[e].length-1)+`>[^\\/#?]+)`:r[e]=RegExp.escape(r[e]);t.push({regex:RegExp(`^`+r.join(`\\/`)+`(?:[?#].*)?$`),pattern:n,handler:e[n]})}returnt}e.router=F,e.store=v,e.t=S,e.watch=g})(this.window=this.window||{});
Consider using a plain number, string or object/array reference instead.`),r[T]=r[T]||[],r[T].push(()=>{if(!r)return;lett=n(r,e);t===void0?(r[e]!==void0&&(r[e]=void0),r.removeAttribute(e)):i?r.setAttribute(e,t):r[e]=t}))}leti=r.onmount;r.onmount=()=>{if(!r[D]){if(r[D]=!0,r[T]){r[E]=r[E]||[];for(leteofr[T])r[E].push(g(e))}i?.(r)}};leta=r.onunmount;returnr.onunmount=()=>{if(r[D]){if(r[D]=!1,r[E])for(leteofr[E])e.unwatch();r[E]=null,a?.(r)}},k(r,n),r}functionk(e,t){t=N(t);for(letnoft)if(typeofn==`function`)A(e,n);else{lett=P(n);Array.isArray(t)?k(e,t):t&&e.appendChild(t)}}functionA(e,t){letn=document.createComment(``);e.appendChild(n);letr=[],i=newMap,a=e.moveBefore||e.insertBefore;e[T]=e[T]||[],e[T].push(()=>{if(!e)return;leto=N(t(e)),s=o.length,c=newMap;if(!r?.length){lett=document.createDocumentFragment();for(lete=0;e<s;e++){o[e]=P(o[e],!0),t.appendChild(o[e]);letn=o[e].rid;n!==void0&&(c.has(n)?console.warn(`Duplicated rid:`,n,o[e]):c.set(n,e))}e.insertBefore(t,n),t=null,r=o,i=c;return}letl=[],u=[],d=newSet,f=[];for(lete=0;e<s;e++){o[e]=P(o[e],!0);lett=o[e].rid;if(t!==void0){c.has(t)?console.warn(`Duplicated rid:`,t,o[e]):c.set(t,e);letn=i.get(t);if(n>=0){d.add(r[n]),o[e]=r[n],f.push(n);continue}}u.push({child:o[e],prev:o[e-1]})}letp=j(f);f.length!=p.length&&f.forEach((e,t)=>{p.has(e)||l.push({child:r[e],targetPos:t})});letm,h,g;for(lettofl)m=r.findIndex(e=>e===t.child),h=t.targetPos,m<t.targetPos&&(h=t.targetPos+1),g=r[h]||n,M(r,m,t.targetPos),a.call(e,t.child,g);for(leteofu)e.prev?e.prev.after(e.child):(r[0]||n).before(e.child);for(lete=0;e<r.length;e++)d.has(r[e])||r[e].remove?.();r=o,i=c,o=null,c=null,d=null,l=null,u=null})}functionj(e){lett=[],n=[];for(letr=0;r<e.length;r++){leti=e[r],a=0,o=0,s=t.length;for(;a<s;)o=Math.floor((a+s)/2),e[t[o]]>=i?s=o:a=o+1;a>0&&(n[r]=t[a-1]),t[a]=r}letr=newSet,i=t[t.length-1];for(;i!==void0;)r.add(e[i]),i=n[i];returnr}functionM(e,t,n){if(t==n)returne;letr=t>n?-1:1,i=e[t];for(leti=t;i!=n;i+=r)e[i]=e[i+r];e[n]=i}functionN(e){returne==null?[]:Array.isArray(e)?e:[e]}functionP(e,t=!1){returnt&&e==null&&(e=``),typeofe==`string`||typeofe==`number`||typeofe==`boolean`?document.createTextNode(e):e?.__raw===void0?e:e.__raw}functionF(e,t={fallbackPath:`#/`,transition:!0}){letn=L(e),r,i=()=>{lete=window.location.hash,i=I(n,e);if(!i){if(t.fallbackPath!=e){window.location.hash=t.fallbackPath;return}console.warn(`missing route:`,e);return}leta=async()=>{try{awaitr?.(),r=awaiti.handler(i)}catch(e){console.warn(`route navigation failed:`,e)}};t.transition&&document.startViewTransition?document.startViewTransition(a):a()};returnwindow.addEventListener(`hashchange`,i),i(),()=>{window.removeEventListener(`hashchange`,i)}}functionI(e,t){for(letnofe){lete=t.match(n.regex);if(!e)continue;letr={},i=t.split(`?`)?.[1];if(i){lete=newURLSearchParams(i);for(let[t,n]ofe.entries())Array.isArray(r[t])||(r[t]=r[t]?[r[t]]:[]),r[t].push(n)}returnObject.assign({path:t,query:r,params:e.groups||{}},n)}}functionL(e){lett=[];for(letnine){letr=n.split(`/`);for(leteinr)r[e].length>2&&r[e].startsWith(`{`)&&r[e].endsWith(`}`)?r[e]=`(?<`+r[e].substring(1,r[e].length-1)+`>[^\\/#?]+)`:r[e]=RegExp.escape(r[e]);t.push({regex:RegExp(`^`+r.join(`\\/`)+`(?:[?#].*)?$`),pattern:n,handler:e[n]})}returnt}e.router=F,e.store=v,e.t=S,e.watch=g})(this.window=this.window||{});
"On successful email change all previously issued auth tokens for the specific record will be automatically invalidated.",
"On successful email change all previously issued auth tokens for the specific record will be invalidated (and the user will be marked as verified if not already).",
),
app.components.codeBlockTabs({
className:"sdk-examples m-t-sm",
@@ -46,7 +46,8 @@ export function docsEmailChange(collection) {
// (optional) in your custom confirmation page:
// ---
// note: after this call all previously issued auth tokens are invalidated
// note: all previous user auth tokens will be invalidated
// (and the user will be marked as verified if not already)
"On successful password reset all previously issued auth tokens for the specific record will be automatically invalidated.",
"On successful password reset all previously issued auth tokens for the specific record will be invalidated (and the user will be marked as verified if not already).",
),
app.components.codeBlockTabs({
className:"sdk-examples m-t-sm",
@@ -41,7 +41,8 @@ export function docsPasswordReset(collection) {
// (optional) in your custom confirmation page:
// ---
// note: after this call all previously issued auth tokens are invalidated
// note: all previous user auth tokens will be invalidated
// (and the user will be marked as verified if not already)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.