Merge pull request #6991 from appwrite/providers-from-attribute
Providers from attribute
This commit is contained in:
commit
ea76bc6680
6 changed files with 113 additions and 39 deletions
|
@ -106,12 +106,13 @@ App::post('/v1/messaging/providers/sendgrid')
|
|||
->label('sdk.response.model', Response::MODEL_PROVIDER)
|
||||
->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
||||
->param('name', '', new Text(128), 'Provider name.')
|
||||
->param('from', '', new Text(256), 'Sender Email Address.')
|
||||
->param('apiKey', '', new Text(0), 'Sendgrid API key.')
|
||||
->param('default', false, new Boolean(), 'Set as default provider.', true)
|
||||
->param('enabled', true, new Boolean(), 'Set as enabled.', true)
|
||||
->param('apiKey', '', new Text(0), 'Sendgrid API key.')
|
||||
->inject('dbForProject')
|
||||
->inject('response')
|
||||
->action(function (string $providerId, string $name, bool $default, bool $enabled, string $apiKey, Database $dbForProject, Response $response) {
|
||||
->action(function (string $providerId, string $name, string $from, string $apiKey, bool $default, bool $enabled, Database $dbForProject, Response $response) {
|
||||
$providerId = $providerId == 'unique()' ? ID::unique() : $providerId;
|
||||
$provider = new Document([
|
||||
'$id' => $providerId,
|
||||
|
@ -120,11 +121,13 @@ App::post('/v1/messaging/providers/sendgrid')
|
|||
'type' => 'email',
|
||||
'default' => $default,
|
||||
'enabled' => $enabled,
|
||||
'options' => [],
|
||||
'search' => $providerId . ' ' . $name . ' ' . 'sendgrid' . ' ' . 'email',
|
||||
'credentials' => [
|
||||
'apiKey' => $apiKey,
|
||||
],
|
||||
'options' => [
|
||||
'from' => $from,
|
||||
]
|
||||
]);
|
||||
|
||||
// Check if a default provider exists, if not, set this one as default
|
||||
|
@ -225,13 +228,14 @@ App::post('/v1/messaging/providers/telesign')
|
|||
->label('sdk.response.model', Response::MODEL_PROVIDER)
|
||||
->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
||||
->param('name', '', new Text(128), 'Provider name.')
|
||||
->param('default', false, new Boolean(), 'Set as default provider.', true)
|
||||
->param('enabled', true, new Boolean(), 'Set as enabled.', true)
|
||||
->param('from', '', new Text(256), 'Sender Number.')
|
||||
->param('username', '', new Text(0), 'Telesign username.')
|
||||
->param('password', '', new Text(0), 'Telesign password.')
|
||||
->param('default', false, new Boolean(), 'Set as default provider.', true)
|
||||
->param('enabled', true, new Boolean(), 'Set as enabled.', true)
|
||||
->inject('dbForProject')
|
||||
->inject('response')
|
||||
->action(function (string $providerId, string $name, bool $default, bool $enabled, string $username, string $password, Database $dbForProject, Response $response) {
|
||||
->action(function (string $providerId, string $name, string $from, string $username, string $password, bool $default, bool $enabled, Database $dbForProject, Response $response) {
|
||||
$providerId = $providerId == 'unique()' ? ID::unique() : $providerId;
|
||||
$provider = new Document([
|
||||
'$id' => $providerId,
|
||||
|
@ -245,6 +249,9 @@ App::post('/v1/messaging/providers/telesign')
|
|||
'username' => $username,
|
||||
'password' => $password,
|
||||
],
|
||||
'options' => [
|
||||
'from' => $from,
|
||||
]
|
||||
]);
|
||||
|
||||
// Check if a default provider exists, if not, set this one as default
|
||||
|
@ -283,13 +290,14 @@ App::post('/v1/messaging/providers/textmagic')
|
|||
->label('sdk.response.model', Response::MODEL_PROVIDER)
|
||||
->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
||||
->param('name', '', new Text(128), 'Provider name.')
|
||||
->param('default', false, new Boolean(), 'Set as default provider.', true)
|
||||
->param('enabled', true, new Boolean(), 'Set as enabled.', true)
|
||||
->param('from', '', new Text(256), 'Sender Number.')
|
||||
->param('username', '', new Text(0), 'Textmagic username.')
|
||||
->param('apiKey', '', new Text(0), 'Textmagic apiKey.')
|
||||
->param('default', false, new Boolean(), 'Set as default provider.', true)
|
||||
->param('enabled', true, new Boolean(), 'Set as enabled.', true)
|
||||
->inject('dbForProject')
|
||||
->inject('response')
|
||||
->action(function (string $providerId, string $name, bool $default, bool $enabled, string $username, string $apiKey, Database $dbForProject, Response $response) {
|
||||
->action(function (string $providerId, string $name, string $from, string $username, string $apiKey, bool $default, bool $enabled, Database $dbForProject, Response $response) {
|
||||
$providerId = $providerId == 'unique()' ? ID::unique() : $providerId;
|
||||
$provider = new Document([
|
||||
'$id' => $providerId,
|
||||
|
@ -303,6 +311,9 @@ App::post('/v1/messaging/providers/textmagic')
|
|||
'username' => $username,
|
||||
'apiKey' => $apiKey,
|
||||
],
|
||||
'options' => [
|
||||
'from' => $from,
|
||||
]
|
||||
]);
|
||||
|
||||
// Check if a default provider exists, if not, set this one as default
|
||||
|
@ -341,13 +352,14 @@ App::post('/v1/messaging/providers/twilio')
|
|||
->label('sdk.response.model', Response::MODEL_PROVIDER)
|
||||
->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
||||
->param('name', '', new Text(128), 'Provider name.')
|
||||
->param('default', false, new Boolean(), 'Set as default provider.', true)
|
||||
->param('enabled', true, new Boolean(), 'Set as enabled.', true)
|
||||
->param('from', '', new Text(256), 'Sender number.')
|
||||
->param('accountSid', '', new Text(0), 'Twilio account secret ID.')
|
||||
->param('authToken', '', new Text(0), 'Twilio authentication token.')
|
||||
->param('default', false, new Boolean(), 'Set as default provider.', true)
|
||||
->param('enabled', true, new Boolean(), 'Set as enabled.', true)
|
||||
->inject('dbForProject')
|
||||
->inject('response')
|
||||
->action(function (string $providerId, string $name, bool $default, bool $enabled, string $accountSid, string $authToken, Database $dbForProject, Response $response) {
|
||||
->action(function (string $providerId, string $name, string $from, string $accountSid, string $authToken, bool $default, bool $enabled, Database $dbForProject, Response $response) {
|
||||
$providerId = $providerId == 'unique()' ? ID::unique() : $providerId;
|
||||
$provider = new Document([
|
||||
'$id' => $providerId,
|
||||
|
@ -361,6 +373,9 @@ App::post('/v1/messaging/providers/twilio')
|
|||
'accountSid' => $accountSid,
|
||||
'authToken' => $authToken,
|
||||
],
|
||||
'options' => [
|
||||
'from' => $from,
|
||||
]
|
||||
]);
|
||||
|
||||
// Check if a default provider exists, if not, set this one as default
|
||||
|
@ -399,13 +414,14 @@ App::post('/v1/messaging/providers/vonage')
|
|||
->label('sdk.response.model', Response::MODEL_PROVIDER)
|
||||
->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
||||
->param('name', '', new Text(128), 'Provider name.')
|
||||
->param('default', false, new Boolean(), 'Set as default provider.', true)
|
||||
->param('enabled', true, new Boolean(), 'Set as enabled.', true)
|
||||
->param('from', '', new Text(256), 'Sender number.')
|
||||
->param('apiKey', '', new Text(0), 'Vonage API key.')
|
||||
->param('apiSecret', '', new Text(0), 'Vonage API secret.')
|
||||
->param('default', false, new Boolean(), 'Set as default provider.', true)
|
||||
->param('enabled', true, new Boolean(), 'Set as enabled.', true)
|
||||
->inject('dbForProject')
|
||||
->inject('response')
|
||||
->action(function (string $providerId, string $name, bool $default, bool $enabled, string $apiKey, string $apiSecret, Database $dbForProject, Response $response) {
|
||||
->action(function (string $providerId, string $name, string $from, string $apiKey, string $apiSecret, bool $default, bool $enabled, Database $dbForProject, Response $response) {
|
||||
$providerId = $providerId == 'unique()' ? ID::unique() : $providerId;
|
||||
$provider = new Document([
|
||||
'$id' => $providerId,
|
||||
|
@ -419,6 +435,9 @@ App::post('/v1/messaging/providers/vonage')
|
|||
'apiKey' => $apiKey,
|
||||
'apiSecret' => $apiSecret,
|
||||
],
|
||||
'options' => [
|
||||
'from' => $from,
|
||||
]
|
||||
]);
|
||||
|
||||
// Check if a default provider exists, if not, set this one as default
|
||||
|
@ -713,9 +732,10 @@ App::patch('/v1/messaging/providers/sendgrid/:providerId')
|
|||
->param('name', '', new Text(128), 'Provider name.', true)
|
||||
->param('enabled', null, new Boolean(), 'Set as enabled.', true)
|
||||
->param('apiKey', '', new Text(0), 'Sendgrid API key.', true)
|
||||
->param('from', '', new Text(256), 'Sender Email Address.', true)
|
||||
->inject('dbForProject')
|
||||
->inject('response')
|
||||
->action(function (string $providerId, string $name, ?bool $enabled, string $apiKey, Database $dbForProject, Response $response) {
|
||||
->action(function (string $providerId, string $name, ?bool $enabled, string $apiKey, string $from, Database $dbForProject, Response $response) {
|
||||
$provider = $dbForProject->getDocument('providers', $providerId);
|
||||
|
||||
if ($provider->isEmpty()) {
|
||||
|
@ -732,6 +752,12 @@ App::patch('/v1/messaging/providers/sendgrid/:providerId')
|
|||
$provider->setAttribute('search', $provider->getId() . ' ' . $name . ' ' . 'sendgrid' . ' ' . 'email');
|
||||
}
|
||||
|
||||
if (!empty($from)) {
|
||||
$provider->setAttribute('options', [
|
||||
'from' => $from,
|
||||
]);
|
||||
}
|
||||
|
||||
if ($enabled === true || $enabled === false) {
|
||||
$provider->setAttribute('enabled', $enabled);
|
||||
}
|
||||
|
@ -766,9 +792,10 @@ App::patch('/v1/messaging/providers/msg91/:providerId')
|
|||
->param('enabled', null, new Boolean(), 'Set as enabled.', true)
|
||||
->param('senderId', '', new Text(0), 'Msg91 Sender ID.', true)
|
||||
->param('authKey', '', new Text(0), 'Msg91 Auth Key.', true)
|
||||
->param('from', '', new Text(256), 'Sender Number.', true)
|
||||
->inject('dbForProject')
|
||||
->inject('response')
|
||||
->action(function (string $providerId, string $name, ?bool $enabled, string $senderId, string $authKey, Database $dbForProject, Response $response) {
|
||||
->action(function (string $providerId, string $name, ?bool $enabled, string $senderId, string $authKey, string $from, Database $dbForProject, Response $response) {
|
||||
$provider = $dbForProject->getDocument('providers', $providerId);
|
||||
|
||||
if ($provider->isEmpty()) {
|
||||
|
@ -785,6 +812,12 @@ App::patch('/v1/messaging/providers/msg91/:providerId')
|
|||
$provider->setAttribute('search', $provider->getId() . ' ' . $name . ' ' . 'msg91' . ' ' . 'sms');
|
||||
}
|
||||
|
||||
if (!empty($from)) {
|
||||
$provider->setAttribute('options', [
|
||||
'from' => $from,
|
||||
]);
|
||||
}
|
||||
|
||||
if ($enabled === true || $enabled === false) {
|
||||
$provider->setAttribute('enabled', $enabled);
|
||||
}
|
||||
|
@ -825,9 +858,10 @@ App::patch('/v1/messaging/providers/telesign/:providerId')
|
|||
->param('enabled', null, new Boolean(), 'Set as enabled.', true)
|
||||
->param('username', '', new Text(0), 'Telesign username.', true)
|
||||
->param('password', '', new Text(0), 'Telesign password.', true)
|
||||
->param('from', '', new Text(256), 'Sender Number.', true)
|
||||
->inject('dbForProject')
|
||||
->inject('response')
|
||||
->action(function (string $providerId, string $name, ?bool $enabled, string $username, string $password, Database $dbForProject, Response $response) {
|
||||
->action(function (string $providerId, string $name, ?bool $enabled, string $username, string $password, string $from, Database $dbForProject, Response $response) {
|
||||
$provider = $dbForProject->getDocument('providers', $providerId);
|
||||
|
||||
if ($provider->isEmpty()) {
|
||||
|
@ -844,6 +878,12 @@ App::patch('/v1/messaging/providers/telesign/:providerId')
|
|||
$provider->setAttribute('search', $provider->getId() . ' ' . $name . ' ' . 'telesign' . ' ' . 'sms');
|
||||
}
|
||||
|
||||
if (!empty($from)) {
|
||||
$provider->setAttribute('options', [
|
||||
'from' => $from,
|
||||
]);
|
||||
}
|
||||
|
||||
if ($enabled === true || $enabled === false) {
|
||||
$provider->setAttribute('enabled', $enabled);
|
||||
}
|
||||
|
@ -884,9 +924,10 @@ App::patch('/v1/messaging/providers/textmagic/:providerId')
|
|||
->param('enabled', null, new Boolean(), 'Set as enabled.', true)
|
||||
->param('username', '', new Text(0), 'Textmagic username.', true)
|
||||
->param('apiKey', '', new Text(0), 'Textmagic apiKey.', true)
|
||||
->param('from', '', new Text(256), 'Sender Number.', true)
|
||||
->inject('dbForProject')
|
||||
->inject('response')
|
||||
->action(function (string $providerId, string $name, ?bool $enabled, string $username, string $apiKey, Database $dbForProject, Response $response) {
|
||||
->action(function (string $providerId, string $name, ?bool $enabled, string $username, string $apiKey, string $from, Database $dbForProject, Response $response) {
|
||||
$provider = $dbForProject->getDocument('providers', $providerId);
|
||||
|
||||
if ($provider->isEmpty()) {
|
||||
|
@ -903,6 +944,12 @@ App::patch('/v1/messaging/providers/textmagic/:providerId')
|
|||
$provider->setAttribute('search', $provider->getId() . ' ' . $name . ' ' . 'textmagic' . ' ' . 'sms');
|
||||
}
|
||||
|
||||
if (!empty($from)) {
|
||||
$provider->setAttribute('options', [
|
||||
'from' => $from,
|
||||
]);
|
||||
}
|
||||
|
||||
if ($enabled === true || $enabled === false) {
|
||||
$provider->setAttribute('enabled', $enabled);
|
||||
}
|
||||
|
@ -943,9 +990,10 @@ App::patch('/v1/messaging/providers/twilio/:providerId')
|
|||
->param('enabled', null, new Boolean(), 'Set as enabled.', true)
|
||||
->param('accountSid', null, new Text(0), 'Twilio account secret ID.', true)
|
||||
->param('authToken', null, new Text(0), 'Twilio authentication token.', true)
|
||||
->param('from', '', new Text(256), 'Sender Number.', true)
|
||||
->inject('dbForProject')
|
||||
->inject('response')
|
||||
->action(function (string $providerId, string $name, ?bool $enabled, string $accountSid, string $authToken, Database $dbForProject, Response $response) {
|
||||
->action(function (string $providerId, string $name, ?bool $enabled, string $accountSid, string $authToken, string $from, Database $dbForProject, Response $response) {
|
||||
$provider = $dbForProject->getDocument('providers', $providerId);
|
||||
|
||||
if ($provider->isEmpty()) {
|
||||
|
@ -962,6 +1010,12 @@ App::patch('/v1/messaging/providers/twilio/:providerId')
|
|||
$provider->setAttribute('search', $provider->getId() . ' ' . $name . ' ' . 'twilio' . ' ' . 'sms');
|
||||
}
|
||||
|
||||
if (!empty($from)) {
|
||||
$provider->setAttribute('options', [
|
||||
'from' => $from,
|
||||
]);
|
||||
}
|
||||
|
||||
if ($enabled === true || $enabled === false) {
|
||||
$provider->setAttribute('enabled', $enabled);
|
||||
}
|
||||
|
@ -1002,9 +1056,10 @@ App::patch('/v1/messaging/providers/vonage/:providerId')
|
|||
->param('enabled', null, new Boolean(), 'Set as enabled.', true)
|
||||
->param('apiKey', '', new Text(0), 'Vonage API key.', true)
|
||||
->param('apiSecret', '', new Text(0), 'Vonage API secret.', true)
|
||||
->param('from', '', new Text(256), 'Sender Number.', true)
|
||||
->inject('dbForProject')
|
||||
->inject('response')
|
||||
->action(function (string $providerId, string $name, ?bool $enabled, string $apiKey, string $apiSecret, Database $dbForProject, Response $response) {
|
||||
->action(function (string $providerId, string $name, ?bool $enabled, string $apiKey, string $apiSecret, string $from, Database $dbForProject, Response $response) {
|
||||
$provider = $dbForProject->getDocument('providers', $providerId);
|
||||
|
||||
if ($provider->isEmpty()) {
|
||||
|
@ -1021,6 +1076,12 @@ App::patch('/v1/messaging/providers/vonage/:providerId')
|
|||
$provider->setAttribute('search', $provider->getId() . ' ' . $name . ' ' . 'vonage' . ' ' . 'sms');
|
||||
}
|
||||
|
||||
if (!empty($from)) {
|
||||
$provider->setAttribute('options', [
|
||||
'from' => $from,
|
||||
]);
|
||||
}
|
||||
|
||||
if ($enabled === true || $enabled === false) {
|
||||
$provider->setAttribute('enabled', $enabled);
|
||||
}
|
||||
|
|
14
composer.lock
generated
14
composer.lock
generated
|
@ -1906,16 +1906,16 @@
|
|||
},
|
||||
{
|
||||
"name": "utopia-php/database",
|
||||
"version": "0.44.2",
|
||||
"version": "0.44.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/utopia-php/database.git",
|
||||
"reference": "591cadbc2c622a3304aae9a16ebfdbe75ef33a06"
|
||||
"reference": "b2d403c25a77506e03db5736335b0cae52bcc18a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/utopia-php/database/zipball/591cadbc2c622a3304aae9a16ebfdbe75ef33a06",
|
||||
"reference": "591cadbc2c622a3304aae9a16ebfdbe75ef33a06",
|
||||
"url": "https://api.github.com/repos/utopia-php/database/zipball/b2d403c25a77506e03db5736335b0cae52bcc18a",
|
||||
"reference": "b2d403c25a77506e03db5736335b0cae52bcc18a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -1928,7 +1928,7 @@
|
|||
},
|
||||
"require-dev": {
|
||||
"fakerphp/faker": "^1.14",
|
||||
"laravel/pint": "1.4.*",
|
||||
"laravel/pint": "1.13.*",
|
||||
"pcov/clobber": "^2.0",
|
||||
"phpstan/phpstan": "1.10.*",
|
||||
"phpunit/phpunit": "^9.4",
|
||||
|
@ -1956,9 +1956,9 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/utopia-php/database/issues",
|
||||
"source": "https://github.com/utopia-php/database/tree/0.44.2"
|
||||
"source": "https://github.com/utopia-php/database/tree/0.44.3"
|
||||
},
|
||||
"time": "2023-10-19T07:39:00+00:00"
|
||||
"time": "2023-10-24T10:13:48+00:00"
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/domains",
|
||||
|
|
|
@ -1795,8 +1795,8 @@ trait Base
|
|||
}
|
||||
}';
|
||||
case self::$CREATE_SENDGRID_PROVIDER:
|
||||
return 'mutation createSendgridProvider($providerId: String!, $name: String!, $apiKey: String!) {
|
||||
messagingCreateSendgridProvider(providerId: $providerId, name: $name, apiKey: $apiKey) {
|
||||
return 'mutation createSendgridProvider($providerId: String!, $name: String!, $from: String!, $apiKey: String!) {
|
||||
messagingCreateSendgridProvider(providerId: $providerId, name: $name, from: $from, apiKey: $apiKey) {
|
||||
_id
|
||||
name
|
||||
provider
|
||||
|
@ -1806,8 +1806,8 @@ trait Base
|
|||
}
|
||||
}';
|
||||
case self::$CREATE_TWILIO_PROVIDER:
|
||||
return 'mutation createTwilioProvider($providerId: String!, $name: String!, $accountSid: String!, $authToken: String!) {
|
||||
messagingCreateTwilioProvider(providerId: $providerId, name: $name, accountSid: $accountSid, authToken: $authToken) {
|
||||
return 'mutation createTwilioProvider($providerId: String!, $name: String!, $from: String!, $accountSid: String!, $authToken: String!) {
|
||||
messagingCreateTwilioProvider(providerId: $providerId, name: $name, from: $from, accountSid: $accountSid, authToken: $authToken) {
|
||||
_id
|
||||
name
|
||||
provider
|
||||
|
@ -1817,8 +1817,8 @@ trait Base
|
|||
}
|
||||
}';
|
||||
case self::$CREATE_TELESIGN_PROVIDER:
|
||||
return 'mutation createTelesignProvider($providerId: String!, $name: String!, $username: String!, $password: String!) {
|
||||
messagingCreateTelesignProvider(providerId: $providerId, name: $name, username: $username, password: $password) {
|
||||
return 'mutation createTelesignProvider($providerId: String!, $name: String!, $from: String!, $username: String!, $password: String!) {
|
||||
messagingCreateTelesignProvider(providerId: $providerId, name: $name, from: $from, username: $username, password: $password) {
|
||||
_id
|
||||
name
|
||||
provider
|
||||
|
@ -1828,8 +1828,8 @@ trait Base
|
|||
}
|
||||
}';
|
||||
case self::$CREATE_TEXTMAGIC_PROVIDER:
|
||||
return 'mutation createTextmagicProvider($providerId: String!, $name: String!, $username: String!, $apiKey: String!) {
|
||||
messagingCreateTextmagicProvider(providerId: $providerId, name: $name, username: $username, apiKey: $apiKey) {
|
||||
return 'mutation createTextmagicProvider($providerId: String!, $name: String!, $from: String!, $username: String!, $apiKey: String!) {
|
||||
messagingCreateTextmagicProvider(providerId: $providerId, name: $name, from: $from, username: $username, apiKey: $apiKey) {
|
||||
_id
|
||||
name
|
||||
provider
|
||||
|
@ -1850,8 +1850,8 @@ trait Base
|
|||
}
|
||||
}';
|
||||
case self::$CREATE_VONAGE_PROVIDER:
|
||||
return 'mutation createVonageProvider($providerId: String!, $name: String!, $apiKey: String!, $apiSecret: String!) {
|
||||
messagingCreateVonageProvider(providerId: $providerId, name: $name, apiKey: $apiKey, apiSecret: $apiSecret) {
|
||||
return 'mutation createVonageProvider($providerId: String!, $name: String!, $from: String!, $apiKey: String!, $apiSecret: String!) {
|
||||
messagingCreateVonageProvider(providerId: $providerId, name: $name, from: $from, apiKey: $apiKey, apiSecret: $apiSecret) {
|
||||
_id
|
||||
name
|
||||
provider
|
||||
|
|
|
@ -22,6 +22,7 @@ class MessagingTest extends Scope
|
|||
'providerId' => ID::unique(),
|
||||
'name' => 'Sengrid1',
|
||||
'apiKey' => 'my-apikey',
|
||||
'from' => 'sender-email@my-domain',
|
||||
],
|
||||
'Mailgun' => [
|
||||
'providerId' => ID::unique(),
|
||||
|
@ -35,18 +36,21 @@ class MessagingTest extends Scope
|
|||
'name' => 'Twilio1',
|
||||
'accountSid' => 'my-accountSid',
|
||||
'authToken' => 'my-authToken',
|
||||
'from' => '+123456789',
|
||||
],
|
||||
'Telesign' => [
|
||||
'providerId' => ID::unique(),
|
||||
'name' => 'Telesign1',
|
||||
'username' => 'my-username',
|
||||
'password' => 'my-password',
|
||||
'from' => '+123456789',
|
||||
],
|
||||
'Textmagic' => [
|
||||
'providerId' => ID::unique(),
|
||||
'name' => 'Textmagic1',
|
||||
'username' => 'my-username',
|
||||
'apiKey' => 'my-apikey',
|
||||
'from' => '+123456789',
|
||||
],
|
||||
'Msg91' => [
|
||||
'providerId' => ID::unique(),
|
||||
|
@ -60,6 +64,7 @@ class MessagingTest extends Scope
|
|||
'name' => 'Vonage1',
|
||||
'apiKey' => 'my-apikey',
|
||||
'apiSecret' => 'my-apisecret',
|
||||
'from' => '+123456789',
|
||||
],
|
||||
'Fcm' => [
|
||||
'providerId' => ID::unique(),
|
||||
|
@ -266,6 +271,7 @@ class MessagingTest extends Scope
|
|||
'providerId' => ID::unique(),
|
||||
'name' => 'Sengrid1',
|
||||
'apiKey' => 'my-apikey',
|
||||
'from' => 'sender-email@my-domain',
|
||||
]
|
||||
];
|
||||
$query = $this->getQuery(self::$CREATE_SENDGRID_PROVIDER);
|
||||
|
|
|
@ -15,6 +15,7 @@ trait MessagingBase
|
|||
'providerId' => ID::unique(),
|
||||
'name' => 'Sengrid1',
|
||||
'apiKey' => 'my-apikey',
|
||||
'from' => 'sender-email@my-domain',
|
||||
],
|
||||
'mailgun' => [
|
||||
'providerId' => ID::unique(),
|
||||
|
@ -28,18 +29,21 @@ trait MessagingBase
|
|||
'name' => 'Twilio1',
|
||||
'accountSid' => 'my-accountSid',
|
||||
'authToken' => 'my-authToken',
|
||||
'from' => '+123456789',
|
||||
],
|
||||
'telesign' => [
|
||||
'providerId' => ID::unique(),
|
||||
'name' => 'Telesign1',
|
||||
'username' => 'my-username',
|
||||
'password' => 'my-password',
|
||||
'from' => '+123456789',
|
||||
],
|
||||
'textmagic' => [
|
||||
'providerId' => ID::unique(),
|
||||
'name' => 'Textmagic1',
|
||||
'username' => 'my-username',
|
||||
'apiKey' => 'my-apikey',
|
||||
'from' => '+123456789',
|
||||
],
|
||||
'msg91' => [
|
||||
'providerId' => ID::unique(),
|
||||
|
@ -53,6 +57,7 @@ trait MessagingBase
|
|||
'name' => 'Vonage1',
|
||||
'apiKey' => 'my-apikey',
|
||||
'apiSecret' => 'my-apisecret',
|
||||
'from' => '+123456789',
|
||||
],
|
||||
'fcm' => [
|
||||
'providerId' => ID::unique(),
|
||||
|
@ -220,6 +225,7 @@ trait MessagingBase
|
|||
'providerId' => 'unique()',
|
||||
'name' => 'Sendgrid1',
|
||||
'apiKey' => 'my-apikey',
|
||||
'from' => 'sender-email@my-domain',
|
||||
]);
|
||||
$this->assertEquals(201, $provider['headers']['status-code']);
|
||||
$response = $this->client->call(Client::METHOD_POST, '/messaging/topics', [
|
||||
|
|
|
@ -1234,7 +1234,8 @@ trait UsersBase
|
|||
], $this->getHeaders()), [
|
||||
'providerId' => 'unique()',
|
||||
'name' => 'Sengrid1',
|
||||
'apiKey' => 'my-apikey'
|
||||
'apiKey' => 'my-apikey',
|
||||
'from' => 'from@domain.com',
|
||||
]);
|
||||
$this->assertEquals(201, $provider['headers']['status-code']);
|
||||
$response = $this->client->call(Client::METHOD_POST, '/users/' . $data['userId'] . '/targets', array_merge([
|
||||
|
|
Loading…
Reference in a new issue