1
0
Fork 0
mirror of synced 2024-06-01 18:39:57 +12:00

Merge remote-tracking branch 'origin/0.16.x' into refactor-permissions-inc-console-fix

# Conflicts:
#	tests/e2e/Services/Databases/DatabasesBase.php
#	tests/e2e/Services/Databases/DatabasesCustomServerTest.php
This commit is contained in:
Jake Barnby 2022-08-13 00:54:27 +12:00
commit d2b9102f84
21 changed files with 120 additions and 102 deletions

View file

@ -883,7 +883,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/string
->label('sdk.namespace', 'databases')
->label('sdk.method', 'createStringAttribute')
->label('sdk.description', '/docs/references/databases/create-string-attribute.md')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_ATTRIBUTE_STRING)
->param('databaseId', '', new UID(), 'Database ID.')
@ -916,6 +916,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/string
'array' => $array,
]), $response, $dbForProject, $database, $audits, $events, $usage);
$response->setStatusCode(Response::STATUS_CODE_ACCEPTED);
$response->dynamic($attribute, Response::MODEL_ATTRIBUTE_STRING);
});
@ -929,7 +930,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/email'
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.method', 'createEmailAttribute')
->label('sdk.description', '/docs/references/databases/create-email-attribute.md')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_ATTRIBUTE_EMAIL)
->param('databaseId', '', new UID(), 'Database ID.')
@ -956,6 +957,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/email'
'format' => APP_DATABASE_ATTRIBUTE_EMAIL,
]), $response, $dbForProject, $database, $audits, $events, $usage);
$response->setStatusCode(Response::STATUS_CODE_ACCEPTED);
$response->dynamic($attribute, Response::MODEL_ATTRIBUTE_EMAIL);
});
@ -969,7 +971,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/enum')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.method', 'createEnumAttribute')
->label('sdk.description', '/docs/references/databases/create-attribute-enum.md')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_ATTRIBUTE_ENUM)
->param('databaseId', '', new UID(), 'Database ID.')
@ -1012,6 +1014,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/enum')
'formatOptions' => ['elements' => $elements],
]), $response, $dbForProject, $database, $audits, $events, $usage);
$response->setStatusCode(Response::STATUS_CODE_ACCEPTED);
$response->dynamic($attribute, Response::MODEL_ATTRIBUTE_ENUM);
});
@ -1025,7 +1028,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/ip')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.method', 'createIpAttribute')
->label('sdk.description', '/docs/references/databases/create-ip-attribute.md')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_ATTRIBUTE_IP)
->param('databaseId', '', new UID(), 'Database ID.')
@ -1052,6 +1055,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/ip')
'format' => APP_DATABASE_ATTRIBUTE_IP,
]), $response, $dbForProject, $database, $audits, $events, $usage);
$response->setStatusCode(Response::STATUS_CODE_ACCEPTED);
$response->dynamic($attribute, Response::MODEL_ATTRIBUTE_IP);
});
@ -1065,7 +1069,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/url')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.method', 'createUrlAttribute')
->label('sdk.description', '/docs/references/databases/create-url-attribute.md')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_ATTRIBUTE_URL)
->param('databaseId', '', new UID(), 'Database ID.')
@ -1092,6 +1096,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/url')
'format' => APP_DATABASE_ATTRIBUTE_URL,
]), $response, $dbForProject, $database, $audits, $events, $usage);
$response->setStatusCode(Response::STATUS_CODE_ACCEPTED);
$response->dynamic($attribute, Response::MODEL_ATTRIBUTE_URL);
});
@ -1105,7 +1110,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/intege
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.method', 'createIntegerAttribute')
->label('sdk.description', '/docs/references/databases/create-integer-attribute.md')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_ATTRIBUTE_INTEGER)
->param('databaseId', '', new UID(), 'Database ID.')
@ -1161,6 +1166,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/intege
$attribute->setAttribute('max', \intval($formatOptions['max']));
}
$response->setStatusCode(Response::STATUS_CODE_ACCEPTED);
$response->dynamic($attribute, Response::MODEL_ATTRIBUTE_INTEGER);
});
@ -1174,7 +1180,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/float'
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.method', 'createFloatAttribute')
->label('sdk.description', '/docs/references/databases/create-float-attribute.md')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_ATTRIBUTE_FLOAT)
->param('databaseId', '', new UID(), 'Database ID.')
@ -1233,6 +1239,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/float'
$attribute->setAttribute('max', \floatval($formatOptions['max']));
}
$response->setStatusCode(Response::STATUS_CODE_ACCEPTED);
$response->dynamic($attribute, Response::MODEL_ATTRIBUTE_FLOAT);
});
@ -1246,7 +1253,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/boolea
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.method', 'createBooleanAttribute')
->label('sdk.description', '/docs/references/databases/create-boolean-attribute.md')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_ATTRIBUTE_BOOLEAN)
->param('databaseId', '', new UID(), 'Database ID.')
@ -1272,6 +1279,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/boolea
'array' => $array,
]), $response, $dbForProject, $database, $audits, $events, $usage);
$response->setStatusCode(Response::STATUS_CODE_ACCEPTED);
$response->dynamic($attribute, Response::MODEL_ATTRIBUTE_BOOLEAN);
});
@ -1492,7 +1500,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes')
->label('sdk.namespace', 'databases')
->label('sdk.method', 'createIndex')
->label('sdk.description', '/docs/references/databases/create-index.md')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_INDEX)
->param('databaseId', '', new UID(), 'Database ID.')
@ -1634,7 +1642,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes')
->setPayload($index->getArrayCopy())
;
$response->setStatusCode(Response::STATUS_CODE_CREATED);
$response->setStatusCode(Response::STATUS_CODE_ACCEPTED);
$response->dynamic($index, Response::MODEL_INDEX);
});

View file

@ -453,7 +453,7 @@ App::post('/v1/functions/:functionId/deployments')
->label('sdk.description', '/docs/references/functions/create-deployment.md')
->label('sdk.packaging', true)
->label('sdk.request.type', 'multipart/form-data')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_DEPLOYMENT)
->param('functionId', '', new UID(), 'Function ID.')
@ -628,7 +628,7 @@ App::post('/v1/functions/:functionId/deployments')
->setParam('functionId', $function->getId())
->setParam('deploymentId', $deployment->getId());
$response->setStatusCode(Response::STATUS_CODE_CREATED);
$response->setStatusCode(Response::STATUS_CODE_ACCEPTED);
$response->dynamic($deployment, Response::MODEL_DEPLOYMENT);
});
@ -911,7 +911,7 @@ App::post('/v1/functions/:functionId/executions')
$event->trigger();
$response->setStatusCode(Response::STATUS_CODE_CREATED);
$response->setStatusCode(Response::STATUS_CODE_ACCEPTED);
return $response->dynamic($execution, Response::MODEL_EXECUTION);
}

View file

@ -123,7 +123,7 @@
data-analytics-category="console/navigation"
data-analytics-label="Users Link">
<i class="icon-users"></i>
Users
Authentication
</a>
</li>
<li>

View file

@ -648,6 +648,11 @@ $logs = $this->getParam('logs', null);
<input id="id" type="text" autocomplete="off" placeholder="" data-ls-bind="{{project-collection.$id}}" disabled data-forms-copy class="margin-bottom-no" />
</div>
<label>Database ID</label>
<div class="input-copy margin-bottom">
<input type="text" autocomplete="off" placeholder="" data-ls-bind="{{router.params.databaseId}}" disabled data-forms-copy class="margin-bottom-no" />
</div>
<ul class="margin-bottom-large text-fade text-size-small">
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i>
<button data-ls-ui-trigger="open-json"

View file

@ -348,6 +348,11 @@ $logs = $this->getParam('logs', null);
<input type="text" autocomplete="off" placeholder="" data-ls-bind="{{router.params.collection}}" disabled data-forms-copy class="margin-bottom-no" />
</div>
<label>Database ID</label>
<div class="input-copy margin-bottom">
<input type="text" autocomplete="off" placeholder="" data-ls-bind="{{router.params.databaseId}}" disabled data-forms-copy class="margin-bottom-no" />
</div>
<ul class="margin-bottom-large text-fade text-size-small" data-ls-if="({{project-document.$id}})">
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i>
<button data-ls-ui-trigger="open-json"

View file

@ -11,7 +11,7 @@ $smtpEnabled = $this->getParam('smtpEnabled', false);
<a data-ls-attrs="href=/console/home?project={{router.params.project}}" class="back text-size-small link-return-animation--start"><i class="icon-left-open"></i> Home</a>
<br />
<span>Users</span>
<span>Authentication</span>
</h1>
</div>

View file

@ -18,8 +18,8 @@
data-scope="console"
data-event="submit"
data-success="alert,redirect"
data-success-param-alert="Password Reset Completed"
data-success-param-url="/auth/signin"
data-success-param-alert-text="Password Reset Completed"
data-success-param-redirect-url="/auth/signin"
data-failure="alert"
data-failure-param-alert-text="Password Reset Failed"
data-failure-param-alert-classname="error">

View file

@ -27,8 +27,8 @@ class AttributeEmail extends Attribute
->addRule('format', [
'type' => self::TYPE_STRING,
'description' => 'String format.',
'default' => APP_DATABASE_ATTRIBUTE_EMAIL,
'example' => APP_DATABASE_ATTRIBUTE_EMAIL,
'default' => 'email',
'example' => 'email',
'array' => false,
'require' => true,
])

View file

@ -35,8 +35,8 @@ class AttributeEnum extends Attribute
->addRule('format', [
'type' => self::TYPE_STRING,
'description' => 'String format.',
'default' => APP_DATABASE_ATTRIBUTE_ENUM,
'example' => APP_DATABASE_ATTRIBUTE_ENUM,
'default' => 'enum',
'example' => 'enum',
'array' => false,
'require' => true,
])

View file

@ -27,8 +27,8 @@ class AttributeIP extends Attribute
->addRule('format', [
'type' => self::TYPE_STRING,
'description' => 'String format.',
'default' => APP_DATABASE_ATTRIBUTE_IP,
'example' => APP_DATABASE_ATTRIBUTE_IP,
'default' => 'ip',
'example' => 'ip',
'array' => false,
'require' => true,
])

View file

@ -27,8 +27,8 @@ class AttributeURL extends Attribute
->addRule('format', [
'type' => self::TYPE_STRING,
'description' => 'String format.',
'default' => APP_DATABASE_ATTRIBUTE_URL,
'example' => APP_DATABASE_ATTRIBUTE_URL,
'default' => 'url',
'example' => 'url',
'array' => false,
'required' => true,
])

View file

@ -168,23 +168,23 @@ trait DatabasesBase
'array' => true,
]);
$this->assertEquals(201, $title['headers']['status-code']);
$this->assertEquals(202, $title['headers']['status-code']);
$this->assertEquals($title['body']['key'], 'title');
$this->assertEquals($title['body']['type'], 'string');
$this->assertEquals($title['body']['size'], 256);
$this->assertEquals($title['body']['required'], true);
$this->assertEquals(201, $releaseYear['headers']['status-code']);
$this->assertEquals(202, $releaseYear['headers']['status-code']);
$this->assertEquals($releaseYear['body']['key'], 'releaseYear');
$this->assertEquals($releaseYear['body']['type'], 'integer');
$this->assertEquals($releaseYear['body']['required'], true);
$this->assertEquals(201, $duration['headers']['status-code']);
$this->assertEquals(202, $duration['headers']['status-code']);
$this->assertEquals($duration['body']['key'], 'duration');
$this->assertEquals($duration['body']['type'], 'integer');
$this->assertEquals($duration['body']['required'], false);
$this->assertEquals(201, $actors['headers']['status-code']);
$this->assertEquals(202, $actors['headers']['status-code']);
$this->assertEquals($actors['body']['key'], 'actors');
$this->assertEquals($actors['body']['type'], 'string');
$this->assertEquals($actors['body']['size'], 256);
@ -320,7 +320,7 @@ trait DatabasesBase
'default' => true,
]);
$this->assertEquals(201, $string['headers']['status-code']);
$this->assertEquals(202, $string['headers']['status-code']);
$this->assertEquals('string', $string['body']['key']);
$this->assertEquals('string', $string['body']['type']);
$this->assertEquals(false, $string['body']['required']);
@ -328,7 +328,7 @@ trait DatabasesBase
$this->assertEquals(16, $string['body']['size']);
$this->assertEquals('default', $string['body']['default']);
$this->assertEquals(201, $email['headers']['status-code']);
$this->assertEquals(202, $email['headers']['status-code']);
$this->assertEquals('email', $email['body']['key']);
$this->assertEquals('string', $email['body']['type']);
$this->assertEquals(false, $email['body']['required']);
@ -336,7 +336,7 @@ trait DatabasesBase
$this->assertEquals('email', $email['body']['format']);
$this->assertEquals('default@example.com', $email['body']['default']);
$this->assertEquals(201, $enum['headers']['status-code']);
$this->assertEquals(202, $enum['headers']['status-code']);
$this->assertEquals('enum', $enum['body']['key']);
$this->assertEquals('string', $enum['body']['type']);
$this->assertEquals(false, $enum['body']['required']);
@ -346,7 +346,7 @@ trait DatabasesBase
$this->assertIsArray($enum['body']['elements']);
$this->assertEquals(['yes', 'no', 'maybe'], $enum['body']['elements']);
$this->assertEquals(201, $ip['headers']['status-code']);
$this->assertEquals(202, $ip['headers']['status-code']);
$this->assertEquals('ip', $ip['body']['key']);
$this->assertEquals('string', $ip['body']['type']);
$this->assertEquals(false, $ip['body']['required']);
@ -354,7 +354,7 @@ trait DatabasesBase
$this->assertEquals('ip', $ip['body']['format']);
$this->assertEquals('192.0.2.0', $ip['body']['default']);
$this->assertEquals(201, $url['headers']['status-code']);
$this->assertEquals(202, $url['headers']['status-code']);
$this->assertEquals('url', $url['body']['key']);
$this->assertEquals('string', $url['body']['type']);
$this->assertEquals(false, $url['body']['required']);
@ -362,7 +362,7 @@ trait DatabasesBase
$this->assertEquals('url', $url['body']['format']);
$this->assertEquals('http://example.com', $url['body']['default']);
$this->assertEquals(201, $integer['headers']['status-code']);
$this->assertEquals(202, $integer['headers']['status-code']);
$this->assertEquals('integer', $integer['body']['key']);
$this->assertEquals('integer', $integer['body']['type']);
$this->assertEquals(false, $integer['body']['required']);
@ -371,7 +371,7 @@ trait DatabasesBase
$this->assertEquals(5, $integer['body']['max']);
$this->assertEquals(3, $integer['body']['default']);
$this->assertEquals(201, $float['headers']['status-code']);
$this->assertEquals(202, $float['headers']['status-code']);
$this->assertEquals('float', $float['body']['key']);
$this->assertEquals('double', $float['body']['type']);
$this->assertEquals(false, $float['body']['required']);
@ -380,7 +380,7 @@ trait DatabasesBase
$this->assertEquals(5.5, $float['body']['max']);
$this->assertEquals(3.5, $float['body']['default']);
$this->assertEquals(201, $boolean['headers']['status-code']);
$this->assertEquals(202, $boolean['headers']['status-code']);
$this->assertEquals('boolean', $boolean['body']['key']);
$this->assertEquals('boolean', $boolean['body']['type']);
$this->assertEquals(false, $boolean['body']['required']);
@ -707,7 +707,7 @@ trait DatabasesBase
'attributes' => ['title'],
]);
$this->assertEquals(201, $titleIndex['headers']['status-code']);
$this->assertEquals(202, $titleIndex['headers']['status-code']);
$this->assertEquals('titleIndex', $titleIndex['body']['key']);
$this->assertEquals('fulltext', $titleIndex['body']['type']);
$this->assertCount(1, $titleIndex['body']['attributes']);
@ -723,7 +723,7 @@ trait DatabasesBase
'attributes' => ['releaseYear'],
]);
$this->assertEquals(201, $releaseYearIndex['headers']['status-code']);
$this->assertEquals(202, $releaseYearIndex['headers']['status-code']);
$this->assertEquals('releaseYear', $releaseYearIndex['body']['key']);
$this->assertEquals('key', $releaseYearIndex['body']['type']);
$this->assertCount(1, $releaseYearIndex['body']['attributes']);
@ -739,7 +739,7 @@ trait DatabasesBase
'attributes' => ['releaseYear', '$createdAt', '$updatedAt'],
]);
$this->assertEquals(201, $releaseWithDate['headers']['status-code']);
$this->assertEquals(202, $releaseWithDate['headers']['status-code']);
$this->assertEquals('releaseYearDated', $releaseWithDate['body']['key']);
$this->assertEquals('key', $releaseWithDate['body']['type']);
$this->assertCount(3, $releaseWithDate['body']['attributes']);
@ -1714,15 +1714,15 @@ trait DatabasesBase
'default' => 'NORTH'
]);
$this->assertEquals(201, $email['headers']['status-code']);
$this->assertEquals(201, $ip['headers']['status-code']);
$this->assertEquals(201, $url['headers']['status-code']);
$this->assertEquals(201, $range['headers']['status-code']);
$this->assertEquals(201, $floatRange['headers']['status-code']);
$this->assertEquals(201, $probability['headers']['status-code']);
$this->assertEquals(201, $upperBound['headers']['status-code']);
$this->assertEquals(201, $lowerBound['headers']['status-code']);
$this->assertEquals(201, $enum['headers']['status-code']);
$this->assertEquals(202, $email['headers']['status-code']);
$this->assertEquals(202, $ip['headers']['status-code']);
$this->assertEquals(202, $url['headers']['status-code']);
$this->assertEquals(202, $range['headers']['status-code']);
$this->assertEquals(202, $floatRange['headers']['status-code']);
$this->assertEquals(202, $probability['headers']['status-code']);
$this->assertEquals(202, $upperBound['headers']['status-code']);
$this->assertEquals(202, $lowerBound['headers']['status-code']);
$this->assertEquals(202, $enum['headers']['status-code']);
$this->assertEquals(400, $invalidRange['headers']['status-code']);
$this->assertEquals(400, $defaultArray['headers']['status-code']);
$this->assertEquals(400, $defaultRequired['headers']['status-code']);
@ -2225,7 +2225,7 @@ trait DatabasesBase
'required' => true,
]);
$this->assertEquals(201, $attribute['headers']['status-code'], 201);
$this->assertEquals(202, $attribute['headers']['status-code'], 202);
$this->assertEquals('attribute', $attribute['body']['key']);
// wait for db to add attribute
@ -2241,7 +2241,7 @@ trait DatabasesBase
'attributes' => [$attribute['body']['key']],
]);
$this->assertEquals(201, $index['headers']['status-code']);
$this->assertEquals(202, $index['headers']['status-code']);
$this->assertEquals('key_attribute', $index['body']['key']);
// wait for db to add attribute
@ -2391,7 +2391,7 @@ trait DatabasesBase
'attributes' => ['title'],
]);
$this->assertEquals(201, $uniqueIndex['headers']['status-code']);
$this->assertEquals(202, $uniqueIndex['headers']['status-code']);
sleep(2);
@ -2574,7 +2574,7 @@ trait DatabasesBase
'required' => true,
]);
$this->assertEquals(201, $title['headers']['status-code']);
$this->assertEquals(202, $title['headers']['status-code']);
// wait for database worker to create attributes
sleep(2);

View file

@ -62,7 +62,7 @@ class DatabasesCustomClientTest extends Scope
'size' => 255,
'required' => true,
]);
$this->assertEquals(201, $response['headers']['status-code']);
$this->assertEquals(202, $response['headers']['status-code']);
// Wait for database worker to finish creating attributes
sleep(2);

View file

@ -638,8 +638,8 @@ class DatabasesCustomServerTest extends Scope
'required' => true,
]);
$this->assertEquals(201, $attribute1['headers']['status-code']);
$this->assertEquals(201, $attribute2['headers']['status-code']);
$this->assertEquals(202, $attribute1['headers']['status-code']);
$this->assertEquals(202, $attribute2['headers']['status-code']);
$this->assertEquals('attribute1', $attribute1['body']['key']);
$this->assertEquals('attribute2', $attribute2['body']['key']);
@ -666,8 +666,8 @@ class DatabasesCustomServerTest extends Scope
'attributes' => ['attribute2'],
]);
$this->assertEquals(201, $index1['headers']['status-code']);
$this->assertEquals(201, $index2['headers']['status-code']);
$this->assertEquals(202, $index1['headers']['status-code']);
$this->assertEquals(202, $index2['headers']['status-code']);
$this->assertEquals('index1', $index1['body']['key']);
$this->assertEquals('index2', $index2['body']['key']);
@ -766,8 +766,8 @@ class DatabasesCustomServerTest extends Scope
'required' => true,
]);
$this->assertEquals(201, $attribute1['headers']['status-code']);
$this->assertEquals(201, $attribute2['headers']['status-code']);
$this->assertEquals(202, $attribute1['headers']['status-code']);
$this->assertEquals(202, $attribute2['headers']['status-code']);
$this->assertEquals('attribute1', $attribute1['body']['key']);
$this->assertEquals('attribute2', $attribute2['body']['key']);
@ -794,8 +794,8 @@ class DatabasesCustomServerTest extends Scope
'attributes' => ['attribute2'],
]);
$this->assertEquals(201, $index1['headers']['status-code']);
$this->assertEquals(201, $index2['headers']['status-code']);
$this->assertEquals(202, $index1['headers']['status-code']);
$this->assertEquals(202, $index2['headers']['status-code']);
$this->assertEquals('index1', $index1['body']['key']);
$this->assertEquals('index2', $index2['body']['key']);
@ -1012,7 +1012,7 @@ class DatabasesCustomServerTest extends Scope
'required' => true,
]);
$this->assertEquals(201, $attribute['headers']['status-code']);
$this->assertEquals(202, $attribute['headers']['status-code']);
}
sleep(5);
@ -1079,7 +1079,7 @@ class DatabasesCustomServerTest extends Scope
'required' => true,
]);
$this->assertEquals(201, $attribute['headers']['status-code']);
$this->assertEquals(202, $attribute['headers']['status-code']);
}
sleep(20);
@ -1116,7 +1116,7 @@ class DatabasesCustomServerTest extends Scope
'attributes' => ["attribute{$i}"],
]);
$this->assertEquals(201, $index['headers']['status-code']);
$this->assertEquals(202, $index['headers']['status-code']);
$this->assertEquals("key_attribute{$i}", $index['body']['key']);
}

View file

@ -79,7 +79,7 @@ class DatabasesPermissionsMemberTest extends Scope
'size' => 256,
'required' => true,
]);
$this->assertEquals(201, $response['headers']['status-code']);
$this->assertEquals(202, $response['headers']['status-code']);
$private = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', $this->getServerHeader(), [
'collectionId' => 'unique()',
@ -101,7 +101,7 @@ class DatabasesPermissionsMemberTest extends Scope
'size' => 256,
'required' => true,
]);
$this->assertEquals(201, $response['headers']['status-code']);
$this->assertEquals(202, $response['headers']['status-code']);
sleep(2);

View file

@ -89,7 +89,7 @@ class FunctionsCustomClientTest extends Scope
$deploymentId = $deployment['body']['$id'] ?? '';
$this->assertEquals(201, $deployment['headers']['status-code']);
$this->assertEquals(202, $deployment['headers']['status-code']);
// Wait for deployment to be built.
sleep(10);
@ -118,7 +118,7 @@ class FunctionsCustomClientTest extends Scope
'async' => true,
]);
$this->assertEquals(201, $execution['headers']['status-code']);
$this->assertEquals(202, $execution['headers']['status-code']);
// Cleanup : Delete function
$response = $this->client->call(Client::METHOD_DELETE, '/functions/' . $function['body']['$id'], [
@ -179,7 +179,7 @@ class FunctionsCustomClientTest extends Scope
// Wait for deployment to be built.
sleep(5);
$this->assertEquals(201, $deployment['headers']['status-code']);
$this->assertEquals(202, $deployment['headers']['status-code']);
$function = $this->client->call(Client::METHOD_PATCH, '/functions/' . $functionId . '/deployments/' . $deploymentId, [
'content-type' => 'application/json',
@ -196,7 +196,7 @@ class FunctionsCustomClientTest extends Scope
'data' => 'foobar',
]);
$this->assertEquals(201, $execution['headers']['status-code']);
$this->assertEquals(202, $execution['headers']['status-code']);
$executionId = $execution['body']['$id'] ?? '';
@ -271,7 +271,7 @@ class FunctionsCustomClientTest extends Scope
'data' => 'foobar',
]);
$this->assertEquals(201, $execution['headers']['status-code']);
$this->assertEquals(202, $execution['headers']['status-code']);
sleep(10);
@ -361,7 +361,7 @@ class FunctionsCustomClientTest extends Scope
$deploymentId = $deployment['body']['$id'] ?? '';
$this->assertEquals(201, $deployment['headers']['status-code']);
$this->assertEquals(202, $deployment['headers']['status-code']);
// Wait for deployment to be built.
sleep(10);

View file

@ -292,7 +292,7 @@ class FunctionsCustomServerTest extends Scope
$deploymentId = $deployment['body']['$id'] ?? '';
$this->assertEquals(201, $deployment['headers']['status-code']);
$this->assertEquals(202, $deployment['headers']['status-code']);
$this->assertNotEmpty($deployment['body']['$id']);
$this->assertIsString($deployment['body']['$createdAt']);
$this->assertEquals('index.php', $deployment['body']['entrypoint']);
@ -341,7 +341,7 @@ class FunctionsCustomServerTest extends Scope
}
@fclose($handle);
$this->assertEquals(201, $largeTag['headers']['status-code']);
$this->assertEquals(202, $largeTag['headers']['status-code']);
$this->assertNotEmpty($largeTag['body']['$id']);
$this->assertIsString($largeTag['body']['$createdAt']);
$this->assertEquals('index.php', $largeTag['body']['entrypoint']);
@ -484,7 +484,7 @@ class FunctionsCustomServerTest extends Scope
$executionId = $execution['body']['$id'] ?? '';
$this->assertEquals(201, $execution['headers']['status-code']);
$this->assertEquals(202, $execution['headers']['status-code']);
$this->assertNotEmpty($execution['body']['$id']);
$this->assertNotEmpty($execution['body']['functionId']);
$this->assertIsString($execution['body']['$createdAt']);
@ -733,7 +733,7 @@ class FunctionsCustomServerTest extends Scope
'activate' => true,
]);
$this->assertEquals(201, $deployment['headers']['status-code']);
$this->assertEquals(202, $deployment['headers']['status-code']);
// Allow build step to run
sleep(20);
@ -747,7 +747,7 @@ class FunctionsCustomServerTest extends Scope
$executionId = $execution['body']['$id'] ?? '';
$this->assertEquals(201, $execution['headers']['status-code']);
$this->assertEquals(202, $execution['headers']['status-code']);
sleep(10);
@ -818,7 +818,7 @@ class FunctionsCustomServerTest extends Scope
]);
$deploymentId = $deployment['body']['$id'] ?? '';
$this->assertEquals(201, $deployment['headers']['status-code']);
$this->assertEquals(202, $deployment['headers']['status-code']);
// Allow build step to run
sleep(10);
@ -839,7 +839,7 @@ class FunctionsCustomServerTest extends Scope
$executionId = $execution['body']['$id'] ?? '';
$this->assertEquals(201, $execution['headers']['status-code']);
$this->assertEquals(202, $execution['headers']['status-code']);
$executionId = $execution['body']['$id'] ?? '';
@ -930,7 +930,7 @@ class FunctionsCustomServerTest extends Scope
]);
$deploymentId = $deployment['body']['$id'] ?? '';
$this->assertEquals(201, $deployment['headers']['status-code']);
$this->assertEquals(202, $deployment['headers']['status-code']);
// Allow build step to run
sleep(10);
@ -944,7 +944,7 @@ class FunctionsCustomServerTest extends Scope
$executionId = $execution['body']['$id'] ?? '';
$this->assertEquals(201, $execution['headers']['status-code']);
$this->assertEquals(202, $execution['headers']['status-code']);
$executionId = $execution['body']['$id'] ?? '';
@ -1035,7 +1035,7 @@ class FunctionsCustomServerTest extends Scope
]);
$deploymentId = $deployment['body']['$id'] ?? '';
$this->assertEquals(201, $deployment['headers']['status-code']);
$this->assertEquals(202, $deployment['headers']['status-code']);
// Allow build step to run
sleep(30);
@ -1049,7 +1049,7 @@ class FunctionsCustomServerTest extends Scope
$executionId = $execution['body']['$id'] ?? '';
$this->assertEquals(201, $execution['headers']['status-code']);
$this->assertEquals(202, $execution['headers']['status-code']);
$executionId = $execution['body']['$id'] ?? '';
@ -1140,7 +1140,7 @@ class FunctionsCustomServerTest extends Scope
]);
$deploymentId = $deployment['body']['$id'] ?? '';
$this->assertEquals(201, $deployment['headers']['status-code']);
$this->assertEquals(202, $deployment['headers']['status-code']);
// Allow build step to run
sleep(40);
@ -1154,7 +1154,7 @@ class FunctionsCustomServerTest extends Scope
$executionId = $execution['body']['$id'] ?? '';
$this->assertEquals(201, $execution['headers']['status-code']);
$this->assertEquals(202, $execution['headers']['status-code']);
$executionId = $execution['body']['$id'] ?? '';
@ -1245,7 +1245,7 @@ class FunctionsCustomServerTest extends Scope
]);
$deploymentId = $deployment['body']['$id'] ?? '';
$this->assertEquals(201, $deployment['headers']['status-code']);
$this->assertEquals(202, $deployment['headers']['status-code']);
// Allow build step to run
sleep(30);
@ -1259,7 +1259,7 @@ class FunctionsCustomServerTest extends Scope
$executionId = $execution['body']['$id'] ?? '';
$this->assertEquals(201, $execution['headers']['status-code']);
$this->assertEquals(202, $execution['headers']['status-code']);
$executionId = $execution['body']['$id'] ?? '';
@ -1350,7 +1350,7 @@ class FunctionsCustomServerTest extends Scope
// ]);
// $deploymentId = $deployment['body']['$id'] ?? '';
// $this->assertEquals(201, $deployment['headers']['status-code']);
// $this->assertEquals(202, $deployment['headers']['status-code']);
// // Allow (slow) build step to run
// sleep(300);
@ -1364,7 +1364,7 @@ class FunctionsCustomServerTest extends Scope
// $executionId = $execution['body']['$id'] ?? '';
// $this->assertEquals(201, $execution['headers']['status-code']);
// $this->assertEquals(202, $execution['headers']['status-code']);
// $executionId = $execution['body']['$id'] ?? '';

View file

@ -180,7 +180,7 @@ class RealtimeConsoleClientTest extends Scope
$attributeKey = $name['body']['key'];
$this->assertEquals($name['headers']['status-code'], 201);
$this->assertEquals($name['headers']['status-code'], 202);
$this->assertEquals($name['body']['key'], 'name');
$this->assertEquals($name['body']['type'], 'string');
$this->assertEquals($name['body']['size'], 256);
@ -269,7 +269,7 @@ class RealtimeConsoleClientTest extends Scope
],
]);
$this->assertEquals($index['headers']['status-code'], 201);
$this->assertEquals($index['headers']['status-code'], 202);
$indexKey = $index['body']['key'];
$response = json_decode($client->receive(), true);

View file

@ -660,7 +660,7 @@ class RealtimeCustomClientTest extends Scope
'required' => true,
]);
$this->assertEquals($name['headers']['status-code'], 201);
$this->assertEquals($name['headers']['status-code'], 202);
$this->assertEquals($name['body']['key'], 'name');
$this->assertEquals($name['body']['type'], 'string');
$this->assertEquals($name['body']['size'], 256);
@ -885,7 +885,7 @@ class RealtimeCustomClientTest extends Scope
'required' => true,
]);
$this->assertEquals($name['headers']['status-code'], 201);
$this->assertEquals($name['headers']['status-code'], 202);
$this->assertEquals($name['body']['key'], 'name');
$this->assertEquals($name['body']['type'], 'string');
$this->assertEquals($name['body']['size'], 256);
@ -1244,7 +1244,7 @@ class RealtimeCustomClientTest extends Scope
$deploymentId = $deployment['body']['$id'] ?? '';
$this->assertEquals($deployment['headers']['status-code'], 201);
$this->assertEquals($deployment['headers']['status-code'], 202);
$this->assertNotEmpty($deployment['body']['$id']);
// Wait for deployment to be built.
@ -1264,7 +1264,7 @@ class RealtimeCustomClientTest extends Scope
'x-appwrite-project' => $this->getProject()['$id']
], $this->getHeaders()), []);
$this->assertEquals($execution['headers']['status-code'], 201);
$this->assertEquals($execution['headers']['status-code'], 202);
$this->assertNotEmpty($execution['body']['$id']);
$response = json_decode($client->receive(), true);

View file

@ -117,11 +117,11 @@ trait WebhooksBase
$attributeId = $extra['body']['key'];
$this->assertEquals($firstName['headers']['status-code'], 201);
$this->assertEquals($firstName['headers']['status-code'], 202);
$this->assertEquals($firstName['body']['key'], 'firstName');
$this->assertEquals($lastName['headers']['status-code'], 201);
$this->assertEquals($lastName['headers']['status-code'], 202);
$this->assertEquals($lastName['body']['key'], 'lastName');
$this->assertEquals($extra['headers']['status-code'], 201);
$this->assertEquals($extra['headers']['status-code'], 202);
$this->assertEquals($extra['body']['key'], 'extra');
// wait for database worker to kick in

View file

@ -80,7 +80,7 @@ class WebhooksCustomServerTest extends Scope
]);
$indexKey = $index['body']['key'];
$this->assertEquals($index['headers']['status-code'], 201);
$this->assertEquals($index['headers']['status-code'], 202);
$this->assertEquals($index['body']['key'], 'fullname');
// wait for database worker to create index
@ -505,7 +505,7 @@ class WebhooksCustomServerTest extends Scope
$id = $data['functionId'] ?? '';
$deploymentId = $deployment['body']['$id'] ?? '';
$this->assertEquals($deployment['headers']['status-code'], 201);
$this->assertEquals($deployment['headers']['status-code'], 202);
$this->assertNotEmpty($deployment['body']['$id']);
$webhook = $this->getLastRequest();
@ -595,7 +595,7 @@ class WebhooksCustomServerTest extends Scope
$executionId = $execution['body']['$id'] ?? '';
$this->assertEquals($execution['headers']['status-code'], 201);
$this->assertEquals($execution['headers']['status-code'], 202);
$this->assertNotEmpty($execution['body']['$id']);
$webhook = $this->getLastRequest();