updated db pool limits, added logs VACUUM, updated api docs

This commit is contained in:
Gani Georgiev
2022-11-13 00:38:18 +02:00
parent 39dc1d2795
commit 521df149a2
64 changed files with 650 additions and 751 deletions
+9 -23
View File
@@ -20,13 +20,15 @@
$: if (active) {
clearTimeout(expandTimeoutId);
expandTimeoutId = setTimeout(() => {
if (accordionElem?.scrollIntoView) {
accordionElem.scrollIntoView({
if (accordionElem?.scrollIntoViewIfNeeded) {
accordionElem?.scrollIntoViewIfNeeded();
} else if (accordionElem?.scrollIntoView) {
accordionElem?.scrollIntoView({
behavior: "smooth",
block: "nearest",
});
}
}, 250);
}, 200);
}
export function expand() {
@@ -62,30 +64,14 @@
}
}
function keyToggle(e) {
if (!interactive) {
return;
}
if (e.code === "Enter" || e.code === "Space") {
e.preventDefault();
toggle();
}
}
onMount(() => {
return () => clearTimeout(expandTimeoutId);
});
</script>
<div
bind:this={accordionElem}
tabindex={interactive ? 0 : -1}
class="accordion {isDragOver ? 'drag-over' : ''} {classes}"
class:active
on:keydown|self={keyToggle}
>
<header
<div bind:this={accordionElem} class="accordion {isDragOver ? 'drag-over' : ''} {classes}" class:active>
<button
type="button"
class="accordion-header"
{draggable}
class:interactive
@@ -113,7 +99,7 @@
on:dragover|preventDefault
>
<slot name="header" {active} />
</header>
</button>
{#if active}
<div class="accordion-content" transition:slide|local={{ duration: 150 }}>
@@ -24,21 +24,6 @@
2
),
},
{
code: 400,
body: `
{
"code": 400,
"message": "Failed to authenticate.",
"data": {
"identity": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`,
},
{
code: 401,
body: `
@@ -59,13 +44,23 @@
}
`,
},
{
code: 404,
body: `
{
"code": 404,
"message": "Missing auth record context.",
"data": {}
}
`,
},
];
</script>
<h3 class="m-b-sm">Auth refresh ({collection.name})</h3>
<div class="content txt-lg m-b-sm">
<p>
Returns a new auth response (token and account data) for an
Returns a new auth response (token and record data) for an
<strong>already authenticated record</strong>.
</p>
<p>
@@ -140,7 +135,7 @@
The expanded relations will be appended to the record under the
<code>expand</code> property (eg. <code>{`"expand": {"relField1": {...}, ...}`}</code>).
<br />
Only the relations to which the account has permissions to <strong>view</strong> will be expanded.
Only the relations to which the request user has permissions to <strong>view</strong> will be expanded.
</td>
</tr>
</tbody>
@@ -51,7 +51,7 @@
<h3 class="m-b-sm">Auth with OAuth2 ({collection.name})</h3>
<div class="content txt-lg m-b-sm">
<p>Authenticate with an OAuth2 provider and returns a new auth token and account data.</p>
<p>Authenticate with an OAuth2 provider and returns a new auth token and record data.</p>
<p>This action usually should be called right after the provider login page redirect.</p>
<p>
You could also check the
@@ -232,7 +232,7 @@
The expanded relations will be appended to the record under the
<code>expand</code> property (eg. <code>{`"expand": {"relField1": {...}, ...}`}</code>).
<br />
Only the relations to which the account has permissions to <strong>view</strong> will be expanded.
Only the relations to which the request user has permissions to <strong>view</strong> will be expanded.
</td>
</tr>
</tbody>
@@ -194,7 +194,7 @@
The expanded relations will be appended to the record under the
<code>expand</code> property (eg. <code>{`"expand": {"relField1": {...}, ...}`}</code>).
<br />
Only the relations to which the account has permissions to <strong>view</strong> will be expanded.
Only the relations to which the request user has permissions to <strong>view</strong> will be expanded.
</td>
</tr>
</tbody>
@@ -114,34 +114,6 @@
</tbody>
</table>
<div class="section-title">Query parameters</div>
<table class="table-compact table-border m-b-base">
<thead>
<tr>
<th>Param</th>
<th>Type</th>
<th width="60%">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>expand</td>
<td>
<span class="label">String</span>
</td>
<td>
Auto expand record relations. Ex.:
<CodeBlock content={`?expand=relField1,relField2.subRelField`} />
Supports up to 6-levels depth nested relations expansion. <br />
The expanded relations will be appended to the record under the
<code>expand</code> property (eg. <code>{`"expand": {"relField1": {...}, ...}`}</code>).
<br />
Only the relations to which the account has permissions to <strong>view</strong> will be expanded.
</td>
</tr>
</tbody>
</table>
<div class="section-title">Responses</div>
<div class="tabs">
<div class="tabs-header compact left">
@@ -37,7 +37,7 @@
<h3 class="m-b-sm">Confirm password reset ({collection.name})</h3>
<div class="content txt-lg m-b-sm">
<p>Confirms <strong>{collection.name}</strong> password reset request.</p>
<p>Confirms <strong>{collection.name}</strong> password reset request and sets a new password.</p>
</div>
<SdkTabs
@@ -128,34 +128,6 @@
</tbody>
</table>
<div class="section-title">Query parameters</div>
<table class="table-compact table-border m-b-base">
<thead>
<tr>
<th>Param</th>
<th>Type</th>
<th width="60%">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>expand</td>
<td>
<span class="label">String</span>
</td>
<td>
Auto expand record relations. Ex.:
<CodeBlock content={`?expand=relField1,relField2.subRelField`} />
Supports up to 6-levels depth nested relations expansion. <br />
The expanded relations will be appended to the record under the
<code>expand</code> property (eg. <code>{`"expand": {"relField1": {...}, ...}`}</code>).
<br />
Only the relations to which the account has permissions to <strong>view</strong> will be expanded.
</td>
</tr>
</tbody>
</table>
<div class="section-title">Responses</div>
<div class="tabs">
<div class="tabs-header compact left">
@@ -96,34 +96,6 @@
</tbody>
</table>
<div class="section-title">Query parameters</div>
<table class="table-compact table-border m-b-base">
<thead>
<tr>
<th>Param</th>
<th>Type</th>
<th width="60%">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>expand</td>
<td>
<span class="label">String</span>
</td>
<td>
Auto expand record relations. Ex.:
<CodeBlock content={`?expand=relField1,relField2.subRelField`} />
Supports up to 6-levels depth nested relations expansion. <br />
The expanded relations will be appended to the record under the
<code>expand</code> property (eg. <code>{`"expand": {"relField1": {...}, ...}`}</code>).
<br />
Only the relations to which the account has permissions to <strong>view</strong> will be expanded.
</td>
</tr>
</tbody>
</table>
<div class="section-title">Responses</div>
<div class="tabs">
<div class="tabs-header compact left">
@@ -308,7 +308,7 @@ await pb.collection('${collection?.name}').requestVerification('test@example.com
The expanded relations will be appended to the record under the
<code>expand</code> property (eg. <code>{`"expand": {"relField1": {...}, ...}`}</code>).
<br />
Only the relations to which the account has permissions to <strong>view</strong> will be expanded.
Only the relations to which the request user has permissions to <strong>view</strong> will be expanded.
</td>
</tr>
</tbody>
@@ -57,17 +57,6 @@
`,
});
}
responses.push({
code: 404,
body: `
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`,
});
}
</script>
@@ -109,13 +98,13 @@
...
// fetch a paginated records list
final result = await pb.collection('${collection?.name}').getList(
final resultList = await pb.collection('${collection?.name}').getList(
page: 1,
perPage: 50,
filter: 'created >= "2022-01-01 00:00:00" && someFiled1 != someField2',
);
// alternatively you can also fetch all records at once via getFullList:
// you can also fetch all records at once via getFullList
final records = await pb.collection('${collection?.name}').getFullList(
batch: 200,
sort: '-created',
@@ -210,7 +199,7 @@
The expanded relations will be appended to each individual record under the
<code>expand</code> property (eg. <code>{`"expand": {"relField1": {...}, ...}`}</code>).
<br />
Only the relations to which the account has permissions to <strong>view</strong> will be expanded.
Only the relations to which the request user has permissions to <strong>view</strong> will be expanded.
</td>
</tr>
</tbody>
@@ -87,7 +87,7 @@
...
await pb.collection('${collection?.name}').authViaEmail('test@example.com', '123456');
await pb.collection('${collection?.name}').authWithPassword('test@example.com', '123456');
const result = await pb.collection('${collection?.name}').listExternalAuths(
pb.authStore.model.id
@@ -100,7 +100,7 @@
...
await pb.collection('${collection?.name}').authViaEmail('test@example.com', '123456');
await pb.collection('${collection?.name}').authWithPassword('test@example.com', '123456');
final result = await pb.collection('${collection?.name}').listExternalAuths(
pb.authStore.model.id,
@@ -56,7 +56,7 @@
});
// Subscribe to changes only in the specified record
pb.collection('${collection?.name}').subscribeOne('RECORD_ID', function (e) {
pb.collection('${collection?.name}').subscribe('RECORD_ID', function (e) {
console.log(e.record);
});
@@ -81,7 +81,7 @@
});
// Subscribe to changes only in the specified record
pb.collection('${collection?.name}').subscribeOne('RECORD_ID', (e) {
pb.collection('${collection?.name}').subscribe('RECORD_ID', (e) {
console.log(e.record);
});
@@ -68,7 +68,7 @@
...
await pb.collection('${collection?.name}').authViaEmail('test@example.com', '123456');
await pb.collection('${collection?.name}').authWithPassword('test@example.com', '1234567890');
await pb.collection('${collection?.name}').requestEmailChange('new@example.com');
`}
@@ -79,7 +79,7 @@
...
await pb.collection('${collection?.name}').authViaEmail('test@example.com', '123456');
await pb.collection('${collection?.name}').authWithPassword('test@example.com', '1234567890');
await pb.collection('${collection?.name}').requestEmailChange('new@example.com');
`}
@@ -90,7 +90,7 @@
<strong class="label label-primary">POST</strong>
<div class="content">
<p>
/api/collections/<strong>{collection.name}</strong>/confirm-email-change
/api/collections/<strong>{collection.name}</strong>/request-email-change
</p>
</div>
<p class="txt-hint txt-sm txt-right">Requires record <code>Authorization:TOKEN</code> header</p>
@@ -3,6 +3,9 @@
const SDK_PREFERENCE_KEY = "pb_sdk_preference";
let classes = "m-b-base";
export { classes as class }; // export reserved keyword
export let js = "";
export let dart = "";
@@ -29,7 +32,7 @@
];
</script>
<div class="tabs sdk-tabs m-b-base">
<div class="tabs sdk-tabs {classes}">
<div class="tabs-header compact left">
{#each sdkExamples as example (example.language)}
<button
@@ -66,7 +66,7 @@
...
await pb.collection('${collection?.name}').authViaEmail('test@example.com', '123456');
await pb.collection('${collection?.name}').authWithPassword('test@example.com', '123456');
await pb.collection('${collection?.name}').unlinkExternalAuth(
pb.authStore.model.id,
@@ -80,7 +80,7 @@
...
await pb.collection('${collection?.name}').authViaEmail('test@example.com', '123456');
await pb.collection('${collection?.name}').authWithPassword('test@example.com', '123456');
await pb.collection('${collection?.name}').unlinkExternalAuth(
pb.authStore.model.id,
@@ -59,7 +59,7 @@
...
const record1 = await pb.collection('${collection?.name}').getOne('RECORD_ID', {
const record = await pb.collection('${collection?.name}').getOne('RECORD_ID', {
expand: 'relField1,relField2.subRelField',
});
`}
@@ -70,7 +70,7 @@
...
final record1 = await pb.collection('${collection?.name}').getOne('RECORD_ID',
final record = await pb.collection('${collection?.name}').getOne('RECORD_ID',
'expand': 'relField1,relField2.subRelField',
);
`}
@@ -131,7 +131,7 @@
The expanded relations will be appended to the record under the
<code>expand</code> property (eg. <code>{`"expand": {"relField1": {...}, ...}`}</code>).
<br />
Only the relations to which the account has permissions to <strong>view</strong> will be expanded.
Only the relations to which the request user has permissions to <strong>view</strong> will be expanded.
</td>
</tr>
</tbody>
+3
View File
@@ -90,6 +90,9 @@
&.active {
@include shadowize();
.accordion-header {
position: sticky;
top: 0;
z-index: 9;
box-shadow: 0px 0px 0px 1px var(--baseAlt2Color);
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
+1
View File
@@ -113,6 +113,7 @@
overflow-x: hidden;
overflow-y: auto; /* fallback */
overflow-y: overlay;
scroll-behavior: smooth;
}
.panel-header ~ .panel-content {
padding-top: 5px;