mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Merge remote-tracking branch 'origin/1.7.x' into 1.8.x
This commit is contained in:
@@ -1,9 +1,24 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@500;600&display=swap">
|
||||
<link rel="preconnect" href="https://assets.appwrite.io/" crossorigin>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
src: url('https://assets.appwrite.io/fonts/inter/Inter-Regular.woff2') format('woff2');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'DM Sans';
|
||||
src: url('https://assets.appwrite.io/fonts/dm-sans/dm-sans-v16-latin-600.woff2') format('woff2');
|
||||
font-weight: 600;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
@media (max-width:500px) {
|
||||
.mobile-full-width {
|
||||
|
||||
@@ -1,9 +1,32 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@500;600&display=swap">
|
||||
<link rel="preconnect" href="https://assets.appwrite.io/" crossorigin>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
src: url('https://assets.appwrite.io/fonts/inter/Inter-Regular.woff2') format('woff2');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'DM Sans';
|
||||
src: url('https://assets.appwrite.io/fonts/dm-sans/dm-sans-v16-latin-600.woff2') format('woff2');
|
||||
font-weight: 600;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Poppins';
|
||||
src: url('https://assets.appwrite.io/fonts/poppins/poppins-v23-latin-regular.woff2') format('woff2');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
body {
|
||||
padding: 32px;
|
||||
@@ -15,6 +38,7 @@
|
||||
background-color: #ffffff;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
line-height: 150%;
|
||||
}
|
||||
a {
|
||||
color: currentColor;
|
||||
@@ -67,58 +91,16 @@
|
||||
border: none;
|
||||
border-top: 1px solid #e8e9f0;
|
||||
}
|
||||
h* {
|
||||
font-family: 'Poppins', sans-serif;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<head>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@500;600&display=swap"
|
||||
rel="stylesheet">
|
||||
<style>
|
||||
a { color:currentColor; word-break: break-all; }
|
||||
body {
|
||||
background-color: #ffffff;
|
||||
padding: 32px;
|
||||
color: #616B7C;
|
||||
font-size: 15px;
|
||||
font-family: 'Inter', sans-serif;
|
||||
line-height: 150%;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-spacing: 0 !important;
|
||||
}
|
||||
|
||||
table,
|
||||
tr,
|
||||
th,
|
||||
td {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
td {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
h* {
|
||||
font-family: 'Poppins', sans-serif;
|
||||
}
|
||||
|
||||
hr {
|
||||
border: none;
|
||||
border-top: 1px solid #E8E9F0;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body style="direction: {{direction}}">
|
||||
|
||||
<div style="display: none; overflow: hidden; max-height: 0; max-width: 0; opacity: 0; line-height: 1px;">
|
||||
|
||||
@@ -1006,7 +1006,7 @@ return [
|
||||
getFramework('NEXTJS', [
|
||||
'providerRootDirectory' => './',
|
||||
'installCommand' => 'pnpm install',
|
||||
'buildCommand' => 'npm run build',
|
||||
'buildCommand' => 'pnpm build',
|
||||
]),
|
||||
],
|
||||
'vcsProvider' => 'github',
|
||||
@@ -1015,7 +1015,7 @@ return [
|
||||
'providerVersion' => '0.1.*',
|
||||
'variables' => [
|
||||
[
|
||||
'name' => 'NEXT_PUBLIC_APPWRITE_FUNCTION_PROJECT_ID',
|
||||
'name' => 'NEXT_PUBLIC_APPWRITE_FUNCTION_API_ENDPOINT',
|
||||
'description' => 'Endpoint of Appwrite server',
|
||||
'value' => '{apiEndpoint}',
|
||||
'placeholder' => '{apiEndpoint}',
|
||||
@@ -1023,7 +1023,7 @@ return [
|
||||
'type' => 'text'
|
||||
],
|
||||
[
|
||||
'name' => 'NEXT_PUBLIC_APPWRITE_FUNCTION_API_ENDPOINT',
|
||||
'name' => 'NEXT_PUBLIC_APPWRITE_FUNCTION_PROJECT_ID',
|
||||
'description' => 'Your Appwrite project ID',
|
||||
'value' => '{projectId}',
|
||||
'placeholder' => '{projectId}',
|
||||
|
||||
@@ -6,26 +6,29 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>404 Not Found</title>
|
||||
|
||||
<link rel="preconnect" href="https://fonts.appwrite.io/">
|
||||
<link rel="preconnect" href="https://assets.appwrite.io/" crossorigin>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
src: url('https://fonts.appwrite.io/inter/Inter-Regular.woff2') format('woff2');
|
||||
src: url('https://assets.appwrite.io/fonts/inter/Inter-Regular.woff2') format('woff2');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
src: url('https://fonts.appwrite.io/inter/Inter-Medium.woff2') format('woff2');
|
||||
src: url('https://assets.appwrite.io/fonts/inter/Inter-Medium.woff2') format('woff2');
|
||||
font-weight: 500;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Fira Code';
|
||||
src: url('https://fonts.appwrite.io/fira-code/FiraCode-Regular.woff2') format('woff2');
|
||||
src: url('https://assets.appwrite.io/fonts/fira-code/FiraCode-Regular.woff2') format('woff2');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
|
||||
@@ -107,18 +107,18 @@ switch ($type) {
|
||||
<link rel="icon" type="image/svg+xml" href="<?php echo $url; ?>/images/logos/appwrite-icon.svg" />
|
||||
<link rel="mask-icon" type="image/png" href="<?php echo $url; ?>/images/logos/appwrite-icon.png" />
|
||||
|
||||
<link rel="preconnect" href="https://fonts.appwrite.io/" crossorigin>
|
||||
<link rel="preconnect" href="https://assets.appwrite.io/" crossorigin>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
src: url('https://fonts.appwrite.io/inter/Inter-Regular.woff2') format('woff2');
|
||||
src: url('https://assets.appwrite.io/fonts/inter/Inter-Regular.woff2') format('woff2');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
src: url('https://fonts.appwrite.io/inter/Inter-Medium.woff2') format('woff2');
|
||||
src: url('https://assets.appwrite.io/fonts/inter/Inter-Medium.woff2') format('woff2');
|
||||
font-weight: 500;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
@@ -126,7 +126,7 @@ switch ($type) {
|
||||
|
||||
@font-face {
|
||||
font-family: 'Fira Code';
|
||||
src: url('https://fonts.appwrite.io/fira-code/FiraCode-Regular.woff2') format('woff2');
|
||||
src: url('https://assets.appwrite.io/fonts/fira-code/FiraCode-Regular.woff2') format('woff2');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
|
||||
@@ -32,9 +32,24 @@ class Preview extends Adapter
|
||||
$this->output = $this->input;
|
||||
|
||||
$banner = <<<EOT
|
||||
<link rel="preconnect" href="https://assets.appwrite.io/" crossorigin>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
src: url('https://assets.appwrite.io/fonts/inter/Inter-Regular.woff2') format('woff2');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
src: url('https://assets.appwrite.io/fonts/inter/Inter-Medium.woff2') format('woff2');
|
||||
font-weight: 500;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
@import url(https://fonts.bunny.net/css?family=fira-code:400|inter:400);
|
||||
|
||||
#appwrite-preview {
|
||||
min-width: auto;
|
||||
min-height: auto;
|
||||
|
||||
@@ -38,12 +38,19 @@ class Execution extends Model
|
||||
'example' => [Role::any()->toString()],
|
||||
'array' => true,
|
||||
])
|
||||
// TODO: Sites listLogs will not have this, and will need siteId instead
|
||||
->addRule('functionId', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Function ID.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea6g16897e',
|
||||
])
|
||||
->addRule('deploymentId', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Function\'s deployment ID used to create the execution.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('trigger', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.',
|
||||
|
||||
@@ -945,6 +945,29 @@ class FunctionsCustomServerTest extends Scope
|
||||
$this->assertEquals(1, $executions['body']['total']);
|
||||
$this->assertIsArray($executions['body']['executions']);
|
||||
$this->assertCount(1, $executions['body']['executions']);
|
||||
$this->assertEquals($data['deploymentId'], $executions['body']['executions'][0]['deploymentId']);
|
||||
|
||||
$executions = $this->listExecutions($data['functionId'], [
|
||||
'queries' => [
|
||||
Query::equal('deploymentId', [$data['deploymentId']])->toString(),
|
||||
],
|
||||
]);
|
||||
|
||||
$this->assertEquals(200, $executions['headers']['status-code']);
|
||||
$this->assertEquals(1, $executions['body']['total']);
|
||||
$this->assertIsArray($executions['body']['executions']);
|
||||
$this->assertCount(1, $executions['body']['executions']);
|
||||
|
||||
$executions = $this->listExecutions($data['functionId'], [
|
||||
'queries' => [
|
||||
Query::equal('deploymentId', ['some-random-id'])->toString(),
|
||||
],
|
||||
]);
|
||||
|
||||
$this->assertEquals(200, $executions['headers']['status-code']);
|
||||
$this->assertEquals(0, $executions['body']['total']);
|
||||
$this->assertIsArray($executions['body']['executions']);
|
||||
$this->assertCount(0, $executions['body']['executions']);
|
||||
|
||||
$executions = $this->listExecutions($data['functionId'], [
|
||||
'queries' => [
|
||||
@@ -1034,8 +1057,9 @@ class FunctionsCustomServerTest extends Scope
|
||||
*/
|
||||
$execution = $this->getExecution($data['functionId'], $data['executionId']);
|
||||
|
||||
$this->assertEquals($execution['headers']['status-code'], 200);
|
||||
$this->assertEquals($execution['body']['$id'], $data['executionId']);
|
||||
$this->assertEquals(200, $execution['headers']['status-code']);
|
||||
$this->assertEquals($data['executionId'], $execution['body']['$id']);
|
||||
$this->assertEquals($data['deploymentId'], $execution['body']['deploymentId']);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
|
||||
@@ -1887,6 +1887,7 @@ class SitesCustomServerTest extends Scope
|
||||
Query::limit(1)->toString(),
|
||||
]);
|
||||
$this->assertEquals(200, $logs['headers']['status-code']);
|
||||
$this->assertStringContainsString($deploymentId, $logs['body']['executions'][0]['deploymentId']);
|
||||
$this->assertStringContainsString("GET", $logs['body']['executions'][0]['requestMethod']);
|
||||
$this->assertStringContainsString("/logs-inline", $logs['body']['executions'][0]['requestPath']);
|
||||
$this->assertStringContainsString("Log1", $logs['body']['executions'][0]['logs']);
|
||||
@@ -1896,6 +1897,24 @@ class SitesCustomServerTest extends Scope
|
||||
$log1Id = $logs['body']['executions'][0]['$id'];
|
||||
$this->assertNotEmpty($log1Id);
|
||||
|
||||
$logs = $this->listLogs($siteId, [
|
||||
Query::orderDesc('$createdAt')->toString(),
|
||||
Query::limit(1)->toString(),
|
||||
Query::equal('deploymentId', [$deploymentId])->toString()
|
||||
]);
|
||||
$this->assertEquals(200, $logs['headers']['status-code']);
|
||||
$this->assertGreaterThanOrEqual(1, $logs['body']['total']);
|
||||
$this->assertCount(1, $logs['body']['executions']);
|
||||
|
||||
$logs = $this->listLogs($siteId, [
|
||||
Query::orderDesc('$createdAt')->toString(),
|
||||
Query::limit(1)->toString(),
|
||||
Query::equal('deploymentId', ['some-random-id'])->toString()
|
||||
]);
|
||||
$this->assertEquals(200, $logs['headers']['status-code']);
|
||||
$this->assertEquals(0, $logs['body']['total']);
|
||||
$this->assertCount(0, $logs['body']['executions']);
|
||||
|
||||
$response = $proxyClient->call(Client::METHOD_GET, '/logs-action');
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertStringContainsString("Action logs printed.", $response['body']);
|
||||
@@ -1905,6 +1924,7 @@ class SitesCustomServerTest extends Scope
|
||||
Query::limit(1)->toString(),
|
||||
]);
|
||||
$this->assertEquals(200, $logs['headers']['status-code']);
|
||||
$this->assertStringContainsString($deploymentId, $logs['body']['executions'][0]['deploymentId']);
|
||||
$this->assertStringContainsString("GET", $logs['body']['executions'][0]['requestMethod']);
|
||||
$this->assertStringContainsString("/logs-action", $logs['body']['executions'][0]['requestPath']);
|
||||
$this->assertStringContainsString("Log1", $logs['body']['executions'][0]['logs']);
|
||||
|
||||
Reference in New Issue
Block a user