Merge remote-tracking branch 'origin/1.5.x' into feat-message-scheduling
# Conflicts: # tests/e2e/Services/GraphQL/Base.php
This commit is contained in:
commit
2f786c03a2
5 changed files with 6 additions and 23 deletions
|
@ -672,12 +672,11 @@ App::post('/v1/messaging/providers/apns')
|
|||
->param('authKeyId', '', new Text(0), 'APNS authentication key ID.', true)
|
||||
->param('teamId', '', new Text(0), 'APNS team ID.', true)
|
||||
->param('bundleId', '', new Text(0), 'APNS bundle ID.', true)
|
||||
->param('endpoint', '', new Text(0), 'APNS endpoint.', true)
|
||||
->param('enabled', null, new Boolean(), 'Set as enabled.', true)
|
||||
->inject('queueForEvents')
|
||||
->inject('dbForProject')
|
||||
->inject('response')
|
||||
->action(function (string $providerId, string $name, string $authKey, string $authKeyId, string $teamId, string $bundleId, string $endpoint, ?bool $enabled, Event $queueForEvents, Database $dbForProject, Response $response) {
|
||||
->action(function (string $providerId, string $name, string $authKey, string $authKeyId, string $teamId, string $bundleId, ?bool $enabled, Event $queueForEvents, Database $dbForProject, Response $response) {
|
||||
$providerId = $providerId == 'unique()' ? ID::unique() : $providerId;
|
||||
|
||||
$credentials = [];
|
||||
|
@ -698,17 +697,12 @@ App::post('/v1/messaging/providers/apns')
|
|||
$credentials['bundleId'] = $bundleId;
|
||||
}
|
||||
|
||||
if (!empty($endpoint)) {
|
||||
$credentials['endpoint'] = $endpoint;
|
||||
}
|
||||
|
||||
if (
|
||||
$enabled === true
|
||||
&& \array_key_exists('authKey', $credentials)
|
||||
&& \array_key_exists('authKeyId', $credentials)
|
||||
&& \array_key_exists('teamId', $credentials)
|
||||
&& \array_key_exists('bundleId', $credentials)
|
||||
&& \array_key_exists('endpoint', $credentials)
|
||||
) {
|
||||
$enabled = true;
|
||||
} else {
|
||||
|
@ -1566,11 +1560,10 @@ App::patch('/v1/messaging/providers/apns/:providerId')
|
|||
->param('authKeyId', '', new Text(0), 'APNS authentication key ID.', true)
|
||||
->param('teamId', '', new Text(0), 'APNS team ID.', true)
|
||||
->param('bundleId', '', new Text(0), 'APNS bundle ID.', true)
|
||||
->param('endpoint', '', new Text(0), 'APNS endpoint.', true)
|
||||
->inject('queueForEvents')
|
||||
->inject('dbForProject')
|
||||
->inject('response')
|
||||
->action(function (string $providerId, string $name, ?bool $enabled, string $authKey, string $authKeyId, string $teamId, string $bundleId, string $endpoint, Event $queueForEvents, Database $dbForProject, Response $response) {
|
||||
->action(function (string $providerId, string $name, ?bool $enabled, string $authKey, string $authKeyId, string $teamId, string $bundleId, Event $queueForEvents, Database $dbForProject, Response $response) {
|
||||
$provider = $dbForProject->getDocument('providers', $providerId);
|
||||
|
||||
if ($provider->isEmpty()) {
|
||||
|
@ -1604,10 +1597,6 @@ App::patch('/v1/messaging/providers/apns/:providerId')
|
|||
$credentials['bundle'] = $bundleId;
|
||||
}
|
||||
|
||||
if (!empty($endpoint)) {
|
||||
$credentials['endpoint'] = $endpoint;
|
||||
}
|
||||
|
||||
$provider->setAttribute('credentials', $credentials);
|
||||
|
||||
if ($enabled === true || $enabled === false) {
|
||||
|
@ -1617,7 +1606,6 @@ App::patch('/v1/messaging/providers/apns/:providerId')
|
|||
&& \array_key_exists('authKeyId', $credentials)
|
||||
&& \array_key_exists('teamId', $credentials)
|
||||
&& \array_key_exists('bundleId', $credentials)
|
||||
&& \array_key_exists('endpoint', $credentials)
|
||||
) {
|
||||
$enabled = true;
|
||||
} else {
|
||||
|
|
|
@ -392,7 +392,6 @@ class Messaging extends Action
|
|||
$credentials['authKeyId'],
|
||||
$credentials['teamId'],
|
||||
$credentials['bundleId'],
|
||||
$credentials['endpoint']
|
||||
),
|
||||
'fcm' => new FCM($credentials['serviceAccountJSON']),
|
||||
default => null
|
||||
|
|
|
@ -1870,8 +1870,8 @@ trait Base
|
|||
}
|
||||
}';
|
||||
case self::$CREATE_APNS_PROVIDER:
|
||||
return 'mutation createAPNSProvider($providerId: String!, $name: String!, $authKey: String!, $authKeyId: String!, $teamId: String!, $bundleId: String!, $endpoint: String!) {
|
||||
messagingCreateAPNSProvider(providerId: $providerId, name: $name, authKey: $authKey, authKeyId: $authKeyId, teamId: $teamId, bundleId: $bundleId, endpoint: $endpoint) {
|
||||
return 'mutation createAPNSProvider($providerId: String!, $name: String!, $authKey: String!, $authKeyId: String!, $teamId: String!, $bundleId: String!) {
|
||||
messagingCreateAPNSProvider(providerId: $providerId, name: $name, authKey: $authKey, authKeyId: $authKeyId, teamId: $teamId, bundleId: $bundleId) {
|
||||
_id
|
||||
name
|
||||
provider
|
||||
|
@ -1984,8 +1984,8 @@ trait Base
|
|||
}
|
||||
}';
|
||||
case self::$UPDATE_APNS_PROVIDER:
|
||||
return 'mutation updateAPNSProvider($providerId: String!, $name: String!, $authKey: String!, $authKeyId: String!, $teamId: String!, $bundleId: String!, $endpoint: String!) {
|
||||
messagingUpdateAPNSProvider(providerId: $providerId, name: $name, authKey: $authKey, authKeyId: $authKeyId, teamId: $teamId, bundleId: $bundleId, endpoint: $endpoint) {
|
||||
return 'mutation updateAPNSProvider($providerId: String!, $name: String!, $authKey: String!, $authKeyId: String!, $teamId: String!, $bundleId: String!) {
|
||||
messagingUpdateAPNSProvider(providerId: $providerId, name: $name, authKey: $authKey, authKeyId: $authKeyId, teamId: $teamId, bundleId: $bundleId) {
|
||||
_id
|
||||
name
|
||||
provider
|
||||
|
|
|
@ -87,7 +87,6 @@ class MessagingTest extends Scope
|
|||
'authKeyId' => 'my-authkeyid',
|
||||
'teamId' => 'my-teamid',
|
||||
'bundleId' => 'my-bundleid',
|
||||
'endpoint' => 'my-endpoint',
|
||||
],
|
||||
];
|
||||
|
||||
|
@ -177,7 +176,6 @@ class MessagingTest extends Scope
|
|||
'authKeyId' => 'my-authkeyid',
|
||||
'teamId' => 'my-teamid',
|
||||
'bundleId' => 'my-bundleid',
|
||||
'endpoint' => 'my-endpoint',
|
||||
],
|
||||
];
|
||||
foreach (\array_keys($providersParams) as $index => $key) {
|
||||
|
|
|
@ -80,7 +80,6 @@ trait MessagingBase
|
|||
'authKeyId' => 'my-authkeyid',
|
||||
'teamId' => 'my-teamid',
|
||||
'bundleId' => 'my-bundleid',
|
||||
'endpoint' => 'my-endpoint',
|
||||
],
|
||||
];
|
||||
$providers = [];
|
||||
|
@ -155,7 +154,6 @@ trait MessagingBase
|
|||
'authKeyId' => 'my-authkeyid',
|
||||
'teamId' => 'my-teamid',
|
||||
'bundleId' => 'my-bundleid',
|
||||
'endpoint' => 'my-endpoint',
|
||||
],
|
||||
];
|
||||
foreach (\array_keys($providersParams) as $index => $key) {
|
||||
|
|
Loading…
Reference in a new issue