commit
50600d6f2a
|
@ -50,7 +50,7 @@ $oauthDefaultSuccess = '/auth/oauth2/success';
|
|||
$oauthDefaultFailure = '/auth/oauth2/failure';
|
||||
|
||||
App::post('/v1/account')
|
||||
->desc('Create Account')
|
||||
->desc('Create account')
|
||||
->groups(['api', 'account', 'auth'])
|
||||
->label('event', 'users.[userId].create')
|
||||
->label('scope', 'public')
|
||||
|
@ -165,7 +165,7 @@ App::post('/v1/account')
|
|||
|
||||
App::post('/v1/account/sessions/email')
|
||||
->alias('/v1/account/sessions')
|
||||
->desc('Create Email Session')
|
||||
->desc('Create email session')
|
||||
->groups(['api', 'account', 'auth', 'session'])
|
||||
->label('event', 'users.[userId].sessions.[sessionId].create')
|
||||
->label('scope', 'public')
|
||||
|
@ -285,7 +285,7 @@ App::post('/v1/account/sessions/email')
|
|||
});
|
||||
|
||||
App::get('/v1/account/sessions/oauth2/:provider')
|
||||
->desc('Create OAuth2 Session')
|
||||
->desc('Create OAuth2 session')
|
||||
->groups(['api', 'account'])
|
||||
->label('error', __DIR__ . '/../../views/general/error.phtml')
|
||||
->label('scope', 'public')
|
||||
|
@ -351,7 +351,7 @@ App::get('/v1/account/sessions/oauth2/:provider')
|
|||
});
|
||||
|
||||
App::get('/v1/account/sessions/oauth2/callback/:provider/:projectId')
|
||||
->desc('OAuth2 Callback')
|
||||
->desc('OAuth2 callback')
|
||||
->groups(['account'])
|
||||
->label('error', __DIR__ . '/../../views/general/error.phtml')
|
||||
->label('scope', 'public')
|
||||
|
@ -383,7 +383,7 @@ App::get('/v1/account/sessions/oauth2/callback/:provider/:projectId')
|
|||
});
|
||||
|
||||
App::post('/v1/account/sessions/oauth2/callback/:provider/:projectId')
|
||||
->desc('OAuth2 Callback')
|
||||
->desc('OAuth2 callback')
|
||||
->groups(['account'])
|
||||
->label('error', __DIR__ . '/../../views/general/error.phtml')
|
||||
->label('scope', 'public')
|
||||
|
@ -416,7 +416,7 @@ App::post('/v1/account/sessions/oauth2/callback/:provider/:projectId')
|
|||
});
|
||||
|
||||
App::get('/v1/account/sessions/oauth2/:provider/redirect')
|
||||
->desc('OAuth2 Redirect')
|
||||
->desc('OAuth2 redirect')
|
||||
->groups(['api', 'account', 'session'])
|
||||
->label('error', __DIR__ . '/../../views/general/error.phtml')
|
||||
->label('event', 'users.[userId].sessions.[sessionId].create')
|
||||
|
@ -872,7 +872,7 @@ App::delete('/v1/account/identities/:identityId')
|
|||
});
|
||||
|
||||
App::post('/v1/account/sessions/magic-url')
|
||||
->desc('Create Magic URL session')
|
||||
->desc('Create magic URL session')
|
||||
->groups(['api', 'account'])
|
||||
->label('scope', 'public')
|
||||
->label('auth.type', 'magic-url')
|
||||
|
@ -1090,7 +1090,7 @@ App::post('/v1/account/sessions/magic-url')
|
|||
});
|
||||
|
||||
App::put('/v1/account/sessions/magic-url')
|
||||
->desc('Create Magic URL session (confirmation)')
|
||||
->desc('Create magic URL session (confirmation)')
|
||||
->groups(['api', 'account', 'session'])
|
||||
->label('scope', 'public')
|
||||
->label('event', 'users.[userId].sessions.[sessionId].create')
|
||||
|
@ -1212,7 +1212,7 @@ App::put('/v1/account/sessions/magic-url')
|
|||
});
|
||||
|
||||
App::post('/v1/account/sessions/phone')
|
||||
->desc('Create Phone session')
|
||||
->desc('Create phone session')
|
||||
->groups(['api', 'account'])
|
||||
->label('scope', 'public')
|
||||
->label('auth.type', 'phone')
|
||||
|
@ -1348,7 +1348,7 @@ App::post('/v1/account/sessions/phone')
|
|||
});
|
||||
|
||||
App::put('/v1/account/sessions/phone')
|
||||
->desc('Create Phone Session (confirmation)')
|
||||
->desc('Create phone session (confirmation)')
|
||||
->groups(['api', 'account', 'session'])
|
||||
->label('scope', 'public')
|
||||
->label('event', 'users.[userId].sessions.[sessionId].create')
|
||||
|
@ -1464,7 +1464,7 @@ App::put('/v1/account/sessions/phone')
|
|||
});
|
||||
|
||||
App::post('/v1/account/sessions/anonymous')
|
||||
->desc('Create Anonymous Session')
|
||||
->desc('Create anonymous session')
|
||||
->groups(['api', 'account', 'auth', 'session'])
|
||||
->label('event', 'users.[userId].sessions.[sessionId].create')
|
||||
->label('scope', 'public')
|
||||
|
@ -1648,7 +1648,7 @@ App::post('/v1/account/jwt')
|
|||
});
|
||||
|
||||
App::get('/v1/account')
|
||||
->desc('Get Account')
|
||||
->desc('Get account')
|
||||
->groups(['api', 'account'])
|
||||
->label('scope', 'account')
|
||||
->label('usage.metric', 'users.{scope}.requests.read')
|
||||
|
@ -1669,7 +1669,7 @@ App::get('/v1/account')
|
|||
});
|
||||
|
||||
App::get('/v1/account/prefs')
|
||||
->desc('Get Account Preferences')
|
||||
->desc('Get account preferences')
|
||||
->groups(['api', 'account'])
|
||||
->label('scope', 'account')
|
||||
->label('usage.metric', 'users.{scope}.requests.read')
|
||||
|
@ -1692,7 +1692,7 @@ App::get('/v1/account/prefs')
|
|||
});
|
||||
|
||||
App::get('/v1/account/sessions')
|
||||
->desc('List Sessions')
|
||||
->desc('List sessions')
|
||||
->groups(['api', 'account'])
|
||||
->label('scope', 'account')
|
||||
->label('usage.metric', 'users.{scope}.requests.read')
|
||||
|
@ -1731,7 +1731,7 @@ App::get('/v1/account/sessions')
|
|||
});
|
||||
|
||||
App::get('/v1/account/logs')
|
||||
->desc('List Logs')
|
||||
->desc('List logs')
|
||||
->groups(['api', 'account'])
|
||||
->label('scope', 'account')
|
||||
->label('usage.metric', 'users.{scope}.requests.read')
|
||||
|
@ -1792,7 +1792,7 @@ App::get('/v1/account/logs')
|
|||
});
|
||||
|
||||
App::get('/v1/account/sessions/:sessionId')
|
||||
->desc('Get Session')
|
||||
->desc('Get session')
|
||||
->groups(['api', 'account'])
|
||||
->label('scope', 'account')
|
||||
->label('usage.metric', 'users.{scope}.requests.read')
|
||||
|
@ -1837,7 +1837,7 @@ App::get('/v1/account/sessions/:sessionId')
|
|||
});
|
||||
|
||||
App::patch('/v1/account/name')
|
||||
->desc('Update Name')
|
||||
->desc('Update name')
|
||||
->groups(['api', 'account'])
|
||||
->label('event', 'users.[userId].update.name')
|
||||
->label('scope', 'account')
|
||||
|
@ -1871,7 +1871,7 @@ App::patch('/v1/account/name')
|
|||
});
|
||||
|
||||
App::patch('/v1/account/password')
|
||||
->desc('Update Password')
|
||||
->desc('Update password')
|
||||
->groups(['api', 'account'])
|
||||
->label('event', 'users.[userId].update.password')
|
||||
->label('scope', 'account')
|
||||
|
@ -1938,7 +1938,7 @@ App::patch('/v1/account/password')
|
|||
});
|
||||
|
||||
App::patch('/v1/account/email')
|
||||
->desc('Update Email')
|
||||
->desc('Update email')
|
||||
->groups(['api', 'account'])
|
||||
->label('event', 'users.[userId].update.email')
|
||||
->label('scope', 'account')
|
||||
|
@ -2008,7 +2008,7 @@ App::patch('/v1/account/email')
|
|||
});
|
||||
|
||||
App::patch('/v1/account/phone')
|
||||
->desc('Update Phone')
|
||||
->desc('Update phone')
|
||||
->groups(['api', 'account'])
|
||||
->label('event', 'users.[userId].update.phone')
|
||||
->label('scope', 'account')
|
||||
|
@ -2067,7 +2067,7 @@ App::patch('/v1/account/phone')
|
|||
});
|
||||
|
||||
App::patch('/v1/account/prefs')
|
||||
->desc('Update Preferences')
|
||||
->desc('Update preferences')
|
||||
->groups(['api', 'account'])
|
||||
->label('event', 'users.[userId].update.prefs')
|
||||
->label('scope', 'account')
|
||||
|
@ -2101,7 +2101,7 @@ App::patch('/v1/account/prefs')
|
|||
});
|
||||
|
||||
App::patch('/v1/account/status')
|
||||
->desc('Update Status')
|
||||
->desc('Update status')
|
||||
->groups(['api', 'account'])
|
||||
->label('event', 'users.[userId].update.status')
|
||||
->label('scope', 'account')
|
||||
|
@ -2145,7 +2145,7 @@ App::patch('/v1/account/status')
|
|||
});
|
||||
|
||||
App::delete('/v1/account/sessions/:sessionId')
|
||||
->desc('Delete Session')
|
||||
->desc('Delete session')
|
||||
->groups(['api', 'account'])
|
||||
->label('scope', 'account')
|
||||
->label('event', 'users.[userId].sessions.[sessionId].delete')
|
||||
|
@ -2221,7 +2221,7 @@ App::delete('/v1/account/sessions/:sessionId')
|
|||
});
|
||||
|
||||
App::patch('/v1/account/sessions/:sessionId')
|
||||
->desc('Update OAuth Session (Refresh Tokens)')
|
||||
->desc('Update OAuth session (refresh tokens)')
|
||||
->groups(['api', 'account'])
|
||||
->label('scope', 'account')
|
||||
->label('event', 'users.[userId].sessions.[sessionId].update')
|
||||
|
@ -2307,7 +2307,7 @@ App::patch('/v1/account/sessions/:sessionId')
|
|||
});
|
||||
|
||||
App::delete('/v1/account/sessions')
|
||||
->desc('Delete Sessions')
|
||||
->desc('Delete sessions')
|
||||
->groups(['api', 'account'])
|
||||
->label('scope', 'account')
|
||||
->label('event', 'users.[userId].sessions.[sessionId].delete')
|
||||
|
@ -2368,7 +2368,7 @@ App::delete('/v1/account/sessions')
|
|||
});
|
||||
|
||||
App::post('/v1/account/recovery')
|
||||
->desc('Create Password Recovery')
|
||||
->desc('Create password recovery')
|
||||
->groups(['api', 'account'])
|
||||
->label('scope', 'public')
|
||||
->label('event', 'users.[userId].recovery.[tokenId].create')
|
||||
|
@ -2551,7 +2551,7 @@ App::post('/v1/account/recovery')
|
|||
});
|
||||
|
||||
App::put('/v1/account/recovery')
|
||||
->desc('Create Password Recovery (confirmation)')
|
||||
->desc('Create password recovery (confirmation)')
|
||||
->groups(['api', 'account'])
|
||||
->label('scope', 'public')
|
||||
->label('event', 'users.[userId].recovery.[tokenId].update')
|
||||
|
@ -2639,7 +2639,7 @@ App::put('/v1/account/recovery')
|
|||
});
|
||||
|
||||
App::post('/v1/account/verification')
|
||||
->desc('Create Email Verification')
|
||||
->desc('Create email verification')
|
||||
->groups(['api', 'account'])
|
||||
->label('scope', 'account')
|
||||
->label('event', 'users.[userId].verification.[tokenId].create')
|
||||
|
@ -2800,7 +2800,7 @@ App::post('/v1/account/verification')
|
|||
});
|
||||
|
||||
App::put('/v1/account/verification')
|
||||
->desc('Create Email Verification (confirmation)')
|
||||
->desc('Create email verification (confirmation)')
|
||||
->groups(['api', 'account'])
|
||||
->label('scope', 'public')
|
||||
->label('event', 'users.[userId].verification.[tokenId].update')
|
||||
|
@ -2861,7 +2861,7 @@ App::put('/v1/account/verification')
|
|||
});
|
||||
|
||||
App::post('/v1/account/verification/phone')
|
||||
->desc('Create Phone Verification')
|
||||
->desc('Create phone verification')
|
||||
->groups(['api', 'account'])
|
||||
->label('scope', 'account')
|
||||
->label('event', 'users.[userId].verification.[tokenId].create')
|
||||
|
@ -2957,7 +2957,7 @@ App::post('/v1/account/verification/phone')
|
|||
});
|
||||
|
||||
App::put('/v1/account/verification/phone')
|
||||
->desc('Create Phone Verification (confirmation)')
|
||||
->desc('Create phone verification (confirmation)')
|
||||
->groups(['api', 'account'])
|
||||
->label('scope', 'public')
|
||||
->label('event', 'users.[userId].verification.[tokenId].update')
|
||||
|
|
|
@ -191,7 +191,7 @@ $getUserGitHub = function (string $userId, Document $project, Database $dbForPro
|
|||
};
|
||||
|
||||
App::get('/v1/avatars/credit-cards/:code')
|
||||
->desc('Get Credit Card Icon')
|
||||
->desc('Get credit card icon')
|
||||
->groups(['api', 'avatars'])
|
||||
->label('scope', 'avatars.read')
|
||||
->label('cache', true)
|
||||
|
@ -211,7 +211,7 @@ App::get('/v1/avatars/credit-cards/:code')
|
|||
->action(fn (string $code, int $width, int $height, int $quality, Response $response) => $avatarCallback('credit-cards', $code, $width, $height, $quality, $response));
|
||||
|
||||
App::get('/v1/avatars/browsers/:code')
|
||||
->desc('Get Browser Icon')
|
||||
->desc('Get browser icon')
|
||||
->groups(['api', 'avatars'])
|
||||
->label('scope', 'avatars.read')
|
||||
->label('cache', true)
|
||||
|
@ -231,7 +231,7 @@ App::get('/v1/avatars/browsers/:code')
|
|||
->action(fn (string $code, int $width, int $height, int $quality, Response $response) => $avatarCallback('browsers', $code, $width, $height, $quality, $response));
|
||||
|
||||
App::get('/v1/avatars/flags/:code')
|
||||
->desc('Get Country Flag')
|
||||
->desc('Get country flag')
|
||||
->groups(['api', 'avatars'])
|
||||
->label('scope', 'avatars.read')
|
||||
->label('cache', true)
|
||||
|
@ -251,7 +251,7 @@ App::get('/v1/avatars/flags/:code')
|
|||
->action(fn (string $code, int $width, int $height, int $quality, Response $response) => $avatarCallback('flags', $code, $width, $height, $quality, $response));
|
||||
|
||||
App::get('/v1/avatars/image')
|
||||
->desc('Get Image from URL')
|
||||
->desc('Get image from URL')
|
||||
->groups(['api', 'avatars'])
|
||||
->label('scope', 'avatars.read')
|
||||
->label('cache', true)
|
||||
|
@ -307,7 +307,7 @@ App::get('/v1/avatars/image')
|
|||
});
|
||||
|
||||
App::get('/v1/avatars/favicon')
|
||||
->desc('Get Favicon')
|
||||
->desc('Get favicon')
|
||||
->groups(['api', 'avatars'])
|
||||
->label('scope', 'avatars.read')
|
||||
->label('cache', true)
|
||||
|
@ -449,7 +449,7 @@ App::get('/v1/avatars/favicon')
|
|||
});
|
||||
|
||||
App::get('/v1/avatars/qr')
|
||||
->desc('Get QR Code')
|
||||
->desc('Get QR code')
|
||||
->groups(['api', 'avatars'])
|
||||
->label('scope', 'avatars.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
|
@ -489,7 +489,7 @@ App::get('/v1/avatars/qr')
|
|||
});
|
||||
|
||||
App::get('/v1/avatars/initials')
|
||||
->desc('Get User Initials')
|
||||
->desc('Get user initials')
|
||||
->groups(['api', 'avatars'])
|
||||
->label('scope', 'avatars.read')
|
||||
->label('cache.resource', 'avatar/initials')
|
||||
|
|
|
@ -17,7 +17,7 @@ App::init()
|
|||
|
||||
|
||||
App::get('/v1/console/variables')
|
||||
->desc('Get Variables')
|
||||
->desc('Get variables')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
|
|
@ -371,7 +371,7 @@ function updateAttribute(
|
|||
}
|
||||
|
||||
App::post('/v1/databases')
|
||||
->desc('Create Database')
|
||||
->desc('Create database')
|
||||
->groups(['api', 'database'])
|
||||
->label('event', 'databases.[databaseId].create')
|
||||
->label('scope', 'databases.write')
|
||||
|
@ -448,7 +448,7 @@ App::post('/v1/databases')
|
|||
});
|
||||
|
||||
App::get('/v1/databases')
|
||||
->desc('List Databases')
|
||||
->desc('List databases')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'databases.read')
|
||||
->label('usage.metric', 'databases.{scope}.requests.read')
|
||||
|
@ -496,7 +496,7 @@ App::get('/v1/databases')
|
|||
});
|
||||
|
||||
App::get('/v1/databases/:databaseId')
|
||||
->desc('Get Database')
|
||||
->desc('Get database')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'databases.read')
|
||||
->label('usage.metric', 'databases.{scope}.requests.read')
|
||||
|
@ -522,7 +522,7 @@ App::get('/v1/databases/:databaseId')
|
|||
});
|
||||
|
||||
App::get('/v1/databases/:databaseId/logs')
|
||||
->desc('List Database Logs')
|
||||
->desc('List database logs')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'databases.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -608,7 +608,7 @@ App::get('/v1/databases/:databaseId/logs')
|
|||
|
||||
|
||||
App::put('/v1/databases/:databaseId')
|
||||
->desc('Update Database')
|
||||
->desc('Update database')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('scope', 'databases.write')
|
||||
->label('event', 'databases.[databaseId].update')
|
||||
|
@ -653,7 +653,7 @@ App::put('/v1/databases/:databaseId')
|
|||
});
|
||||
|
||||
App::delete('/v1/databases/:databaseId')
|
||||
->desc('Delete Database')
|
||||
->desc('Delete database')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('scope', 'databases.write')
|
||||
->label('event', 'databases.[databaseId].delete')
|
||||
|
@ -698,7 +698,7 @@ App::delete('/v1/databases/:databaseId')
|
|||
});
|
||||
|
||||
App::post('/v1/databases/:databaseId/collections')
|
||||
->desc('Create Collection')
|
||||
->desc('Create collection')
|
||||
->groups(['api', 'database'])
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].create')
|
||||
->label('scope', 'collections.write')
|
||||
|
@ -768,7 +768,7 @@ App::post('/v1/databases/:databaseId/collections')
|
|||
|
||||
App::get('/v1/databases/:databaseId/collections')
|
||||
->alias('/v1/database/collections', ['databaseId' => 'default'])
|
||||
->desc('List Collections')
|
||||
->desc('List collections')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'collections.read')
|
||||
->label('usage.metric', 'collections.{scope}.requests.read')
|
||||
|
@ -827,7 +827,7 @@ App::get('/v1/databases/:databaseId/collections')
|
|||
|
||||
App::get('/v1/databases/:databaseId/collections/:collectionId')
|
||||
->alias('/v1/database/collections/:collectionId', ['databaseId' => 'default'])
|
||||
->desc('Get Collection')
|
||||
->desc('Get collection')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'collections.read')
|
||||
->label('usage.metric', 'collections.{scope}.requests.read')
|
||||
|
@ -863,7 +863,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId')
|
|||
|
||||
App::get('/v1/databases/:databaseId/collections/:collectionId/logs')
|
||||
->alias('/v1/database/collections/:collectionId/logs', ['databaseId' => 'default'])
|
||||
->desc('List Collection Logs')
|
||||
->desc('List collection logs')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'collections.read')
|
||||
->label('usage.metric', 'collections.{scope}.requests.read')
|
||||
|
@ -959,7 +959,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/logs')
|
|||
|
||||
App::put('/v1/databases/:databaseId/collections/:collectionId')
|
||||
->alias('/v1/database/collections/:collectionId', ['databaseId' => 'default'])
|
||||
->desc('Update Collection')
|
||||
->desc('Update collection')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('scope', 'collections.write')
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].update')
|
||||
|
@ -1029,7 +1029,7 @@ App::put('/v1/databases/:databaseId/collections/:collectionId')
|
|||
|
||||
App::delete('/v1/databases/:databaseId/collections/:collectionId')
|
||||
->alias('/v1/database/collections/:collectionId', ['databaseId' => 'default'])
|
||||
->desc('Delete Collection')
|
||||
->desc('Delete collection')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('scope', 'collections.write')
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].delete')
|
||||
|
@ -1085,7 +1085,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId')
|
|||
|
||||
App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/string')
|
||||
->alias('/v1/database/collections/:collectionId/attributes/string', ['databaseId' => 'default'])
|
||||
->desc('Create String Attribute')
|
||||
->desc('Create string attribute')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create')
|
||||
->label('scope', 'collections.write')
|
||||
|
@ -1143,7 +1143,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/string
|
|||
|
||||
App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/email')
|
||||
->alias('/v1/database/collections/:collectionId/attributes/email', ['databaseId' => 'default'])
|
||||
->desc('Create Email Attribute')
|
||||
->desc('Create email attribute')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create')
|
||||
->label('scope', 'collections.write')
|
||||
|
@ -1187,7 +1187,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/email'
|
|||
|
||||
App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/enum')
|
||||
->alias('/v1/database/collections/:collectionId/attributes/enum', ['databaseId' => 'default'])
|
||||
->desc('Create Enum Attribute')
|
||||
->desc('Create enum attribute')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create')
|
||||
->label('scope', 'collections.write')
|
||||
|
@ -1247,7 +1247,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/enum')
|
|||
|
||||
App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/ip')
|
||||
->alias('/v1/database/collections/:collectionId/attributes/ip', ['databaseId' => 'default'])
|
||||
->desc('Create IP Address Attribute')
|
||||
->desc('Create IP address attribute')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create')
|
||||
->label('scope', 'collections.write')
|
||||
|
@ -1291,7 +1291,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/ip')
|
|||
|
||||
App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/url')
|
||||
->alias('/v1/database/collections/:collectionId/attributes/url', ['databaseId' => 'default'])
|
||||
->desc('Create URL Attribute')
|
||||
->desc('Create URL attribute')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create')
|
||||
->label('scope', 'collections.write')
|
||||
|
@ -1335,7 +1335,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/url')
|
|||
|
||||
App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/integer')
|
||||
->alias('/v1/database/collections/:collectionId/attributes/integer', ['databaseId' => 'default'])
|
||||
->desc('Create Integer Attribute')
|
||||
->desc('Create integer attribute')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create')
|
||||
->label('scope', 'collections.write')
|
||||
|
@ -1408,7 +1408,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/intege
|
|||
|
||||
App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/float')
|
||||
->alias('/v1/database/collections/:collectionId/attributes/float', ['databaseId' => 'default'])
|
||||
->desc('Create Float Attribute')
|
||||
->desc('Create float attribute')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create')
|
||||
->label('scope', 'collections.write')
|
||||
|
@ -1484,7 +1484,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/float'
|
|||
|
||||
App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/boolean')
|
||||
->alias('/v1/database/collections/:collectionId/attributes/boolean', ['databaseId' => 'default'])
|
||||
->desc('Create Boolean Attribute')
|
||||
->desc('Create boolean attribute')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create')
|
||||
->label('scope', 'collections.write')
|
||||
|
@ -1527,7 +1527,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/boolea
|
|||
|
||||
App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/datetime')
|
||||
->alias('/v1/database/collections/:collectionId/attributes/datetime', ['databaseId' => 'default'])
|
||||
->desc('Create DateTime Attribute')
|
||||
->desc('Create datetime attribute')
|
||||
->groups(['api', 'database'])
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create')
|
||||
->label('scope', 'collections.write')
|
||||
|
@ -1573,7 +1573,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/dateti
|
|||
|
||||
App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/relationship')
|
||||
->alias('/v1/database/collections/:collectionId/attributes/relationship', ['databaseId' => 'default'])
|
||||
->desc('Create Relationship Attribute')
|
||||
->desc('Create relationship attribute')
|
||||
->groups(['api', 'database'])
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create')
|
||||
->label('scope', 'collections.write')
|
||||
|
@ -1655,7 +1655,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/relati
|
|||
|
||||
App::get('/v1/databases/:databaseId/collections/:collectionId/attributes')
|
||||
->alias('/v1/database/collections/:collectionId/attributes', ['databaseId' => 'default'])
|
||||
->desc('List Attributes')
|
||||
->desc('List attributes')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'collections.read')
|
||||
->label('usage.metric', 'collections.{scope}.requests.read')
|
||||
|
@ -1730,7 +1730,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes')
|
|||
|
||||
App::get('/v1/databases/:databaseId/collections/:collectionId/attributes/:key')
|
||||
->alias('/v1/database/collections/:collectionId/attributes/:key', ['databaseId' => 'default'])
|
||||
->desc('Get Attribute')
|
||||
->desc('Get attribute')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'collections.read')
|
||||
->label('usage.metric', 'collections.{scope}.requests.read')
|
||||
|
@ -1806,7 +1806,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes/:key')
|
|||
});
|
||||
|
||||
App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/string/:key')
|
||||
->desc('Update String Attribute')
|
||||
->desc('Update string attribute')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('scope', 'collections.write')
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update')
|
||||
|
@ -1847,7 +1847,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/strin
|
|||
});
|
||||
|
||||
App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/email/:key')
|
||||
->desc('Update Email Attribute')
|
||||
->desc('Update email attribute')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('scope', 'collections.write')
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update')
|
||||
|
@ -1888,7 +1888,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/email
|
|||
});
|
||||
|
||||
App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/enum/:key')
|
||||
->desc('Update Enum Attribute')
|
||||
->desc('Update enum attribute')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('scope', 'collections.write')
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update')
|
||||
|
@ -1931,7 +1931,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/enum/
|
|||
});
|
||||
|
||||
App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/ip/:key')
|
||||
->desc('Update IP Address Attribute')
|
||||
->desc('Update IP address attribute')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('scope', 'collections.write')
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update')
|
||||
|
@ -1972,7 +1972,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/ip/:k
|
|||
});
|
||||
|
||||
App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/url/:key')
|
||||
->desc('Update URL Attribute')
|
||||
->desc('Update URL attribute')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('scope', 'collections.write')
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update')
|
||||
|
@ -2013,7 +2013,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/url/:
|
|||
});
|
||||
|
||||
App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/integer/:key')
|
||||
->desc('Update Integer Attribute')
|
||||
->desc('Update integer attribute')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('scope', 'collections.write')
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update')
|
||||
|
@ -2064,7 +2064,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/integ
|
|||
});
|
||||
|
||||
App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/float/:key')
|
||||
->desc('Update Float Attribute')
|
||||
->desc('Update float attribute')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('scope', 'collections.write')
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update')
|
||||
|
@ -2115,7 +2115,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/float
|
|||
});
|
||||
|
||||
App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/boolean/:key')
|
||||
->desc('Update Boolean Attribute')
|
||||
->desc('Update boolean attribute')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('scope', 'collections.write')
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update')
|
||||
|
@ -2155,7 +2155,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/boole
|
|||
});
|
||||
|
||||
App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/datetime/:key')
|
||||
->desc('Update DateTime Attribute')
|
||||
->desc('Update dateTime attribute')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('scope', 'collections.write')
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update')
|
||||
|
@ -2195,7 +2195,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/datet
|
|||
});
|
||||
|
||||
App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/:key/relationship')
|
||||
->desc('Update Relationship Attribute')
|
||||
->desc('Update relationship attribute')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('scope', 'collections.write')
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update')
|
||||
|
@ -2251,7 +2251,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/:key/
|
|||
|
||||
App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key')
|
||||
->alias('/v1/database/collections/:collectionId/attributes/:key', ['databaseId' => 'default'])
|
||||
->desc('Delete Attribute')
|
||||
->desc('Delete attribute')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('scope', 'collections.write')
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].delete')
|
||||
|
@ -2362,7 +2362,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key
|
|||
|
||||
App::post('/v1/databases/:databaseId/collections/:collectionId/indexes')
|
||||
->alias('/v1/database/collections/:collectionId/indexes', ['databaseId' => 'default'])
|
||||
->desc('Create Index')
|
||||
->desc('Create index')
|
||||
->groups(['api', 'database'])
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].indexes.[indexId].create')
|
||||
->label('scope', 'collections.write')
|
||||
|
@ -2522,7 +2522,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes')
|
|||
|
||||
App::get('/v1/databases/:databaseId/collections/:collectionId/indexes')
|
||||
->alias('/v1/database/collections/:collectionId/indexes', ['databaseId' => 'default'])
|
||||
->desc('List Indexes')
|
||||
->desc('List indexes')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'collections.read')
|
||||
->label('usage.metric', 'collections.{scope}.requests.read')
|
||||
|
@ -2587,7 +2587,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes')
|
|||
|
||||
App::get('/v1/databases/:databaseId/collections/:collectionId/indexes/:key')
|
||||
->alias('/v1/database/collections/:collectionId/indexes/:key', ['databaseId' => 'default'])
|
||||
->desc('Get Index')
|
||||
->desc('Get index')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'collections.read')
|
||||
->label('usage.metric', 'collections.{scope}.requests.read')
|
||||
|
@ -2628,7 +2628,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes/:key')
|
|||
|
||||
App::delete('/v1/databases/:databaseId/collections/:collectionId/indexes/:key')
|
||||
->alias('/v1/database/collections/:collectionId/indexes/:key', ['databaseId' => 'default'])
|
||||
->desc('Delete Index')
|
||||
->desc('Delete index')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'collections.write')
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].indexes.[indexId].delete')
|
||||
|
@ -2694,7 +2694,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/indexes/:key')
|
|||
|
||||
App::post('/v1/databases/:databaseId/collections/:collectionId/documents')
|
||||
->alias('/v1/database/collections/:collectionId/documents', ['databaseId' => 'default'])
|
||||
->desc('Create Document')
|
||||
->desc('Create document')
|
||||
->groups(['api', 'database'])
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].create')
|
||||
->label('scope', 'documents.write')
|
||||
|
@ -2934,7 +2934,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents')
|
|||
|
||||
App::get('/v1/databases/:databaseId/collections/:collectionId/documents')
|
||||
->alias('/v1/database/collections/:collectionId/documents', ['databaseId' => 'default'])
|
||||
->desc('List Documents')
|
||||
->desc('List documents')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'documents.read')
|
||||
->label('usage.metric', 'documents.{scope}.requests.read')
|
||||
|
@ -3061,7 +3061,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents')
|
|||
|
||||
App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId')
|
||||
->alias('/v1/database/collections/:collectionId/documents/:documentId', ['databaseId' => 'default'])
|
||||
->desc('Get Document')
|
||||
->desc('Get document')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'documents.read')
|
||||
->label('usage.metric', 'documents.{scope}.requests.read')
|
||||
|
@ -3156,7 +3156,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen
|
|||
|
||||
App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId/logs')
|
||||
->alias('/v1/database/collections/:collectionId/documents/:documentId/logs', ['databaseId' => 'default'])
|
||||
->desc('List Document Logs')
|
||||
->desc('List document logs')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'documents.read')
|
||||
->label('usage.metric', 'documents.{scope}.requests.read')
|
||||
|
@ -3257,7 +3257,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen
|
|||
|
||||
App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId')
|
||||
->alias('/v1/database/collections/:collectionId/documents/:documentId', ['databaseId' => 'default'])
|
||||
->desc('Update Document')
|
||||
->desc('Update document')
|
||||
->groups(['api', 'database'])
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].update')
|
||||
->label('scope', 'documents.write')
|
||||
|
@ -3486,7 +3486,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum
|
|||
|
||||
App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId')
|
||||
->alias('/v1/database/collections/:collectionId/documents/:documentId', ['databaseId' => 'default'])
|
||||
->desc('Delete Document')
|
||||
->desc('Delete document')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'documents.write')
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].delete')
|
||||
|
|
|
@ -121,7 +121,7 @@ $redeployVcs = function (Request $request, Document $function, Document $project
|
|||
|
||||
App::post('/v1/functions')
|
||||
->groups(['api', 'functions'])
|
||||
->desc('Create Function')
|
||||
->desc('Create function')
|
||||
->label('scope', 'functions.write')
|
||||
->label('event', 'functions.[functionId].create')
|
||||
->label('audits.event', 'function.create')
|
||||
|
@ -335,7 +335,7 @@ App::post('/v1/functions')
|
|||
|
||||
App::get('/v1/functions')
|
||||
->groups(['api', 'functions'])
|
||||
->desc('List Functions')
|
||||
->desc('List functions')
|
||||
->label('scope', 'functions.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
|
@ -410,7 +410,7 @@ App::get('/v1/functions/runtimes')
|
|||
|
||||
App::get('/v1/functions/:functionId')
|
||||
->groups(['api', 'functions'])
|
||||
->desc('Get Function')
|
||||
->desc('Get function')
|
||||
->label('scope', 'functions.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
|
@ -433,7 +433,7 @@ App::get('/v1/functions/:functionId')
|
|||
});
|
||||
|
||||
App::get('/v1/functions/:functionId/usage')
|
||||
->desc('Get Function Usage')
|
||||
->desc('Get function usage')
|
||||
->groups(['api', 'functions', 'usage'])
|
||||
->label('scope', 'functions.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -543,7 +543,7 @@ App::get('/v1/functions/:functionId/usage')
|
|||
});
|
||||
|
||||
App::get('/v1/functions/usage')
|
||||
->desc('Get Functions Usage')
|
||||
->desc('Get functions usage')
|
||||
->groups(['api', 'functions', 'usage'])
|
||||
->label('scope', 'functions.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -647,7 +647,7 @@ App::get('/v1/functions/usage')
|
|||
|
||||
App::put('/v1/functions/:functionId')
|
||||
->groups(['api', 'functions'])
|
||||
->desc('Update Function')
|
||||
->desc('Update function')
|
||||
->label('scope', 'functions.write')
|
||||
->label('event', 'functions.[functionId].update')
|
||||
->label('audits.event', 'function.update')
|
||||
|
@ -912,7 +912,7 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId/download')
|
|||
|
||||
App::patch('/v1/functions/:functionId/deployments/:deploymentId')
|
||||
->groups(['api', 'functions'])
|
||||
->desc('Update Function Deployment')
|
||||
->desc('Update function deployment')
|
||||
->label('scope', 'functions.write')
|
||||
->label('event', 'functions.[functionId].deployments.[deploymentId].update')
|
||||
->label('audits.event', 'deployment.update')
|
||||
|
@ -974,7 +974,7 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId')
|
|||
|
||||
App::delete('/v1/functions/:functionId')
|
||||
->groups(['api', 'functions'])
|
||||
->desc('Delete Function')
|
||||
->desc('Delete function')
|
||||
->label('scope', 'functions.write')
|
||||
->label('event', 'functions.[functionId].delete')
|
||||
->label('audits.event', 'function.delete')
|
||||
|
@ -1021,7 +1021,7 @@ App::delete('/v1/functions/:functionId')
|
|||
|
||||
App::post('/v1/functions/:functionId/deployments')
|
||||
->groups(['api', 'functions'])
|
||||
->desc('Create Deployment')
|
||||
->desc('Create deployment')
|
||||
->label('scope', 'functions.write')
|
||||
->label('event', 'functions.[functionId].deployments.[deploymentId].create')
|
||||
->label('audits.event', 'deployment.create')
|
||||
|
@ -1240,7 +1240,7 @@ App::post('/v1/functions/:functionId/deployments')
|
|||
|
||||
App::get('/v1/functions/:functionId/deployments')
|
||||
->groups(['api', 'functions'])
|
||||
->desc('List Deployments')
|
||||
->desc('List deployments')
|
||||
->label('scope', 'functions.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
|
@ -1310,7 +1310,7 @@ App::get('/v1/functions/:functionId/deployments')
|
|||
|
||||
App::get('/v1/functions/:functionId/deployments/:deploymentId')
|
||||
->groups(['api', 'functions'])
|
||||
->desc('Get Deployment')
|
||||
->desc('Get deployment')
|
||||
->label('scope', 'functions.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
|
@ -1352,7 +1352,7 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId')
|
|||
|
||||
App::delete('/v1/functions/:functionId/deployments/:deploymentId')
|
||||
->groups(['api', 'functions'])
|
||||
->desc('Delete Deployment')
|
||||
->desc('Delete deployment')
|
||||
->label('scope', 'functions.write')
|
||||
->label('event', 'functions.[functionId].deployments.[deploymentId].delete')
|
||||
->label('audits.event', 'deployment.delete')
|
||||
|
@ -1416,7 +1416,7 @@ App::delete('/v1/functions/:functionId/deployments/:deploymentId')
|
|||
|
||||
App::post('/v1/functions/:functionId/deployments/:deploymentId/builds/:buildId')
|
||||
->groups(['api', 'functions'])
|
||||
->desc('Create Build')
|
||||
->desc('Create build')
|
||||
->label('scope', 'functions.write')
|
||||
->label('event', 'functions.[functionId].deployments.[deploymentId].update')
|
||||
->label('audits.event', 'deployment.update')
|
||||
|
@ -1485,7 +1485,7 @@ App::post('/v1/functions/:functionId/deployments/:deploymentId/builds/:buildId')
|
|||
|
||||
App::post('/v1/functions/:functionId/executions')
|
||||
->groups(['api', 'functions'])
|
||||
->desc('Create Execution')
|
||||
->desc('Create execution')
|
||||
->label('scope', 'execution.write')
|
||||
->label('event', 'functions.[functionId].executions.[executionId].create')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
|
@ -1774,7 +1774,7 @@ App::post('/v1/functions/:functionId/executions')
|
|||
|
||||
App::get('/v1/functions/:functionId/executions')
|
||||
->groups(['api', 'functions'])
|
||||
->desc('List Executions')
|
||||
->desc('List executions')
|
||||
->label('scope', 'execution.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'functions')
|
||||
|
@ -1849,7 +1849,7 @@ App::get('/v1/functions/:functionId/executions')
|
|||
|
||||
App::get('/v1/functions/:functionId/executions/:executionId')
|
||||
->groups(['api', 'functions'])
|
||||
->desc('Get Execution')
|
||||
->desc('Get execution')
|
||||
->label('scope', 'execution.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'functions')
|
||||
|
@ -1897,7 +1897,7 @@ App::get('/v1/functions/:functionId/executions/:executionId')
|
|||
// Variables
|
||||
|
||||
App::post('/v1/functions/:functionId/variables')
|
||||
->desc('Create Variable')
|
||||
->desc('Create variable')
|
||||
->groups(['api', 'functions'])
|
||||
->label('scope', 'functions.write')
|
||||
->label('audits.event', 'variable.create')
|
||||
|
@ -1961,7 +1961,7 @@ App::post('/v1/functions/:functionId/variables')
|
|||
});
|
||||
|
||||
App::get('/v1/functions/:functionId/variables')
|
||||
->desc('List Variables')
|
||||
->desc('List variables')
|
||||
->groups(['api', 'functions'])
|
||||
->label('scope', 'functions.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
|
@ -1988,7 +1988,7 @@ App::get('/v1/functions/:functionId/variables')
|
|||
});
|
||||
|
||||
App::get('/v1/functions/:functionId/variables/:variableId')
|
||||
->desc('Get Variable')
|
||||
->desc('Get variable')
|
||||
->groups(['api', 'functions'])
|
||||
->label('scope', 'functions.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
|
@ -2027,7 +2027,7 @@ App::get('/v1/functions/:functionId/variables/:variableId')
|
|||
});
|
||||
|
||||
App::put('/v1/functions/:functionId/variables/:variableId')
|
||||
->desc('Update Variable')
|
||||
->desc('Update variable')
|
||||
->groups(['api', 'functions'])
|
||||
->label('scope', 'functions.write')
|
||||
->label('audits.event', 'variable.update')
|
||||
|
@ -2088,7 +2088,7 @@ App::put('/v1/functions/:functionId/variables/:variableId')
|
|||
});
|
||||
|
||||
App::delete('/v1/functions/:functionId/variables/:variableId')
|
||||
->desc('Delete Variable')
|
||||
->desc('Delete variable')
|
||||
->groups(['api', 'functions'])
|
||||
->label('scope', 'functions.write')
|
||||
->label('audits.event', 'variable.delete')
|
||||
|
|
|
@ -18,7 +18,7 @@ use Utopia\Validator\JSON;
|
|||
use Utopia\Validator\Text;
|
||||
|
||||
App::get('/v1/graphql')
|
||||
->desc('GraphQL Endpoint')
|
||||
->desc('GraphQL endpoint')
|
||||
->groups(['graphql'])
|
||||
->label('scope', 'graphql')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
|
||||
|
@ -58,7 +58,7 @@ App::get('/v1/graphql')
|
|||
});
|
||||
|
||||
App::post('/v1/graphql/mutation')
|
||||
->desc('GraphQL Endpoint')
|
||||
->desc('GraphQL endpoint')
|
||||
->groups(['graphql'])
|
||||
->label('scope', 'graphql')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
|
||||
|
@ -103,7 +103,7 @@ App::post('/v1/graphql/mutation')
|
|||
});
|
||||
|
||||
App::post('/v1/graphql')
|
||||
->desc('GraphQL Endpoint')
|
||||
->desc('GraphQL endpoint')
|
||||
->groups(['graphql'])
|
||||
->label('scope', 'graphql')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
|
||||
|
|
|
@ -39,7 +39,7 @@ App::get('/v1/health')
|
|||
});
|
||||
|
||||
App::get('/v1/health/version')
|
||||
->desc('Get Version')
|
||||
->desc('Get version')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'public')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
|
@ -109,7 +109,7 @@ App::get('/v1/health/db')
|
|||
});
|
||||
|
||||
App::get('/v1/health/cache')
|
||||
->desc('Get Cache')
|
||||
->desc('Get cache')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
|
@ -280,7 +280,7 @@ App::get('/v1/health/pubsub')
|
|||
});
|
||||
|
||||
App::get('/v1/health/time')
|
||||
->desc('Get Time')
|
||||
->desc('Get time')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
|
@ -337,7 +337,7 @@ App::get('/v1/health/time')
|
|||
});
|
||||
|
||||
App::get('/v1/health/queue/webhooks')
|
||||
->desc('Get Webhooks Queue')
|
||||
->desc('Get webhooks queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
|
@ -354,7 +354,7 @@ App::get('/v1/health/queue/webhooks')
|
|||
}, ['response']);
|
||||
|
||||
App::get('/v1/health/queue/logs')
|
||||
->desc('Get Logs Queue')
|
||||
->desc('Get logs queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
|
@ -371,7 +371,7 @@ App::get('/v1/health/queue/logs')
|
|||
}, ['response']);
|
||||
|
||||
App::get('/v1/health/queue/certificates')
|
||||
->desc('Get Certificates Queue')
|
||||
->desc('Get certificates queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
|
@ -388,7 +388,7 @@ App::get('/v1/health/queue/certificates')
|
|||
}, ['response']);
|
||||
|
||||
App::get('/v1/health/queue/functions')
|
||||
->desc('Get Functions Queue')
|
||||
->desc('Get functions queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
|
@ -406,7 +406,7 @@ App::get('/v1/health/queue/functions')
|
|||
}, ['response']);
|
||||
|
||||
App::get('/v1/health/storage/local')
|
||||
->desc('Get Local Storage')
|
||||
->desc('Get local storage')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
|
@ -449,7 +449,7 @@ App::get('/v1/health/storage/local')
|
|||
});
|
||||
|
||||
App::get('/v1/health/anti-virus')
|
||||
->desc('Get Antivirus')
|
||||
->desc('Get antivirus')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
|
@ -488,7 +488,7 @@ App::get('/v1/health/anti-virus')
|
|||
});
|
||||
|
||||
App::get('/v1/health/stats') // Currently only used internally
|
||||
->desc('Get System Stats')
|
||||
->desc('Get system stats')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'root')
|
||||
// ->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
|
|
|
@ -9,7 +9,7 @@ use Utopia\Database\Document;
|
|||
use Utopia\Locale\Locale;
|
||||
|
||||
App::get('/v1/locale')
|
||||
->desc('Get User Locale')
|
||||
->desc('Get user locale')
|
||||
->groups(['api', 'locale'])
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
|
@ -91,7 +91,7 @@ App::get('/v1/locale/codes')
|
|||
});
|
||||
|
||||
App::get('/v1/locale/countries')
|
||||
->desc('List Countries')
|
||||
->desc('List countries')
|
||||
->groups(['api', 'locale'])
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
|
@ -124,7 +124,7 @@ App::get('/v1/locale/countries')
|
|||
});
|
||||
|
||||
App::get('/v1/locale/countries/eu')
|
||||
->desc('List EU Countries')
|
||||
->desc('List EU countries')
|
||||
->groups(['api', 'locale'])
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
|
@ -159,7 +159,7 @@ App::get('/v1/locale/countries/eu')
|
|||
});
|
||||
|
||||
App::get('/v1/locale/countries/phones')
|
||||
->desc('List Countries Phone Codes')
|
||||
->desc('List countries phone codes')
|
||||
->groups(['api', 'locale'])
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
|
@ -193,7 +193,7 @@ App::get('/v1/locale/countries/phones')
|
|||
});
|
||||
|
||||
App::get('/v1/locale/continents')
|
||||
->desc('List Continents')
|
||||
->desc('List continents')
|
||||
->groups(['api', 'locale'])
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
|
@ -225,7 +225,7 @@ App::get('/v1/locale/continents')
|
|||
});
|
||||
|
||||
App::get('/v1/locale/currencies')
|
||||
->desc('List Currencies')
|
||||
->desc('List currencies')
|
||||
->groups(['api', 'locale'])
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
|
@ -248,7 +248,7 @@ App::get('/v1/locale/currencies')
|
|||
|
||||
|
||||
App::get('/v1/locale/languages')
|
||||
->desc('List Languages')
|
||||
->desc('List languages')
|
||||
->groups(['api', 'locale'])
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
|
|
|
@ -49,7 +49,7 @@ App::init()
|
|||
});
|
||||
|
||||
App::post('/v1/projects')
|
||||
->desc('Create Project')
|
||||
->desc('Create project')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -220,7 +220,7 @@ App::post('/v1/projects')
|
|||
});
|
||||
|
||||
App::get('/v1/projects')
|
||||
->desc('List Projects')
|
||||
->desc('List projects')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -267,7 +267,7 @@ App::get('/v1/projects')
|
|||
});
|
||||
|
||||
App::get('/v1/projects/:projectId')
|
||||
->desc('Get Project')
|
||||
->desc('Get project')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -405,7 +405,7 @@ App::get('/v1/projects/:projectId/usage')
|
|||
});
|
||||
|
||||
App::patch('/v1/projects/:projectId')
|
||||
->desc('Update Project')
|
||||
->desc('Update project')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -557,7 +557,7 @@ App::patch('/v1/projects/:projectId/service/all')
|
|||
});
|
||||
|
||||
App::patch('/v1/projects/:projectId/oauth2')
|
||||
->desc('Update Project OAuth2')
|
||||
->desc('Update project OAuth2')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -601,7 +601,7 @@ App::patch('/v1/projects/:projectId/oauth2')
|
|||
});
|
||||
|
||||
App::patch('/v1/projects/:projectId/auth/limit')
|
||||
->desc('Update Project users limit')
|
||||
->desc('Update project users limit')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -632,7 +632,7 @@ App::patch('/v1/projects/:projectId/auth/limit')
|
|||
});
|
||||
|
||||
App::patch('/v1/projects/:projectId/auth/duration')
|
||||
->desc('Update Project Authentication Duration')
|
||||
->desc('Update project authentication duration')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -663,7 +663,7 @@ App::patch('/v1/projects/:projectId/auth/duration')
|
|||
});
|
||||
|
||||
App::patch('/v1/projects/:projectId/auth/:method')
|
||||
->desc('Update Project auth method status. Use this endpoint to enable or disable a given auth method for this project.')
|
||||
->desc('Update project auth method status. Use this endpoint to enable or disable a given auth method for this project.')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -790,7 +790,7 @@ App::patch('/v1/projects/:projectId/auth/personal-data')
|
|||
});
|
||||
|
||||
App::patch('/v1/projects/:projectId/auth/max-sessions')
|
||||
->desc('Update Project user sessions limit')
|
||||
->desc('Update project user sessions limit')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -821,7 +821,7 @@ App::patch('/v1/projects/:projectId/auth/max-sessions')
|
|||
});
|
||||
|
||||
App::delete('/v1/projects/:projectId')
|
||||
->desc('Delete Project')
|
||||
->desc('Delete project')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -855,7 +855,7 @@ App::delete('/v1/projects/:projectId')
|
|||
// Webhooks
|
||||
|
||||
App::post('/v1/projects/:projectId/webhooks')
|
||||
->desc('Create Webhook')
|
||||
->desc('Create webhook')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -911,7 +911,7 @@ App::post('/v1/projects/:projectId/webhooks')
|
|||
});
|
||||
|
||||
App::get('/v1/projects/:projectId/webhooks')
|
||||
->desc('List Webhooks')
|
||||
->desc('List webhooks')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -943,7 +943,7 @@ App::get('/v1/projects/:projectId/webhooks')
|
|||
});
|
||||
|
||||
App::get('/v1/projects/:projectId/webhooks/:webhookId')
|
||||
->desc('Get Webhook')
|
||||
->desc('Get webhook')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -977,7 +977,7 @@ App::get('/v1/projects/:projectId/webhooks/:webhookId')
|
|||
});
|
||||
|
||||
App::put('/v1/projects/:projectId/webhooks/:webhookId')
|
||||
->desc('Update Webhook')
|
||||
->desc('Update webhook')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -1030,7 +1030,7 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId')
|
|||
});
|
||||
|
||||
App::patch('/v1/projects/:projectId/webhooks/:webhookId/signature')
|
||||
->desc('Update Webhook Signature Key')
|
||||
->desc('Update webhook signature key')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -1069,7 +1069,7 @@ App::patch('/v1/projects/:projectId/webhooks/:webhookId/signature')
|
|||
});
|
||||
|
||||
App::delete('/v1/projects/:projectId/webhooks/:webhookId')
|
||||
->desc('Delete Webhook')
|
||||
->desc('Delete webhook')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -1108,7 +1108,7 @@ App::delete('/v1/projects/:projectId/webhooks/:webhookId')
|
|||
// Keys
|
||||
|
||||
App::post('/v1/projects/:projectId/keys')
|
||||
->desc('Create Key')
|
||||
->desc('Create key')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -1158,7 +1158,7 @@ App::post('/v1/projects/:projectId/keys')
|
|||
});
|
||||
|
||||
App::get('/v1/projects/:projectId/keys')
|
||||
->desc('List Keys')
|
||||
->desc('List keys')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -1190,7 +1190,7 @@ App::get('/v1/projects/:projectId/keys')
|
|||
});
|
||||
|
||||
App::get('/v1/projects/:projectId/keys/:keyId')
|
||||
->desc('Get Key')
|
||||
->desc('Get key')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -1224,7 +1224,7 @@ App::get('/v1/projects/:projectId/keys/:keyId')
|
|||
});
|
||||
|
||||
App::put('/v1/projects/:projectId/keys/:keyId')
|
||||
->desc('Update Key')
|
||||
->desc('Update key')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -1270,7 +1270,7 @@ App::put('/v1/projects/:projectId/keys/:keyId')
|
|||
});
|
||||
|
||||
App::delete('/v1/projects/:projectId/keys/:keyId')
|
||||
->desc('Delete Key')
|
||||
->desc('Delete key')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -1309,7 +1309,7 @@ App::delete('/v1/projects/:projectId/keys/:keyId')
|
|||
// Platforms
|
||||
|
||||
App::post('/v1/projects/:projectId/platforms')
|
||||
->desc('Create Platform')
|
||||
->desc('Create platform')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -1359,7 +1359,7 @@ App::post('/v1/projects/:projectId/platforms')
|
|||
});
|
||||
|
||||
App::get('/v1/projects/:projectId/platforms')
|
||||
->desc('List Platforms')
|
||||
->desc('List platforms')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -1391,7 +1391,7 @@ App::get('/v1/projects/:projectId/platforms')
|
|||
});
|
||||
|
||||
App::get('/v1/projects/:projectId/platforms/:platformId')
|
||||
->desc('Get Platform')
|
||||
->desc('Get platform')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -1425,7 +1425,7 @@ App::get('/v1/projects/:projectId/platforms/:platformId')
|
|||
});
|
||||
|
||||
App::put('/v1/projects/:projectId/platforms/:platformId')
|
||||
->desc('Update Platform')
|
||||
->desc('Update platform')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -1472,7 +1472,7 @@ App::put('/v1/projects/:projectId/platforms/:platformId')
|
|||
});
|
||||
|
||||
App::delete('/v1/projects/:projectId/platforms/:platformId')
|
||||
->desc('Delete Platform')
|
||||
->desc('Delete platform')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
@ -1508,6 +1508,7 @@ App::delete('/v1/projects/:projectId/platforms/:platformId')
|
|||
$response->noContent();
|
||||
});
|
||||
|
||||
|
||||
// CUSTOM SMTP and Templates
|
||||
App::patch('/v1/projects/:projectId/smtp')
|
||||
->desc('Update SMTP configuration')
|
||||
|
@ -1639,6 +1640,7 @@ App::get('/v1/projects/:projectId/templates/sms/:type/:locale')
|
|||
$response->dynamic(new Document($template), Response::MODEL_SMS_TEMPLATE);
|
||||
});
|
||||
|
||||
|
||||
App::get('/v1/projects/:projectId/templates/email/:type/:locale')
|
||||
->desc('Get custom email template')
|
||||
->groups(['api', 'projects'])
|
||||
|
|
|
@ -194,7 +194,7 @@ App::get('/v1/storage/buckets')
|
|||
});
|
||||
|
||||
App::get('/v1/storage/buckets/:bucketId')
|
||||
->desc('Get Bucket')
|
||||
->desc('Get bucket')
|
||||
->groups(['api', 'storage'])
|
||||
->label('scope', 'buckets.read')
|
||||
->label('usage.metric', 'buckets.{scope}.requests.read')
|
||||
|
@ -220,7 +220,7 @@ App::get('/v1/storage/buckets/:bucketId')
|
|||
});
|
||||
|
||||
App::put('/v1/storage/buckets/:bucketId')
|
||||
->desc('Update Bucket')
|
||||
->desc('Update bucket')
|
||||
->groups(['api', 'storage'])
|
||||
->label('scope', 'buckets.write')
|
||||
->label('event', 'buckets.[bucketId].update')
|
||||
|
@ -288,7 +288,7 @@ App::put('/v1/storage/buckets/:bucketId')
|
|||
});
|
||||
|
||||
App::delete('/v1/storage/buckets/:bucketId')
|
||||
->desc('Delete Bucket')
|
||||
->desc('Delete bucket')
|
||||
->groups(['api', 'storage'])
|
||||
->label('scope', 'buckets.write')
|
||||
->label('audits.event', 'bucket.delete')
|
||||
|
@ -331,7 +331,7 @@ App::delete('/v1/storage/buckets/:bucketId')
|
|||
|
||||
App::post('/v1/storage/buckets/:bucketId/files')
|
||||
->alias('/v1/storage/files', ['bucketId' => 'default'])
|
||||
->desc('Create File')
|
||||
->desc('Create file')
|
||||
->groups(['api', 'storage'])
|
||||
->label('scope', 'files.write')
|
||||
->label('audits.event', 'file.create')
|
||||
|
@ -684,7 +684,7 @@ App::post('/v1/storage/buckets/:bucketId/files')
|
|||
|
||||
App::get('/v1/storage/buckets/:bucketId/files')
|
||||
->alias('/v1/storage/files', ['bucketId' => 'default'])
|
||||
->desc('List Files')
|
||||
->desc('List files')
|
||||
->groups(['api', 'storage'])
|
||||
->label('scope', 'files.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
|
@ -765,7 +765,7 @@ App::get('/v1/storage/buckets/:bucketId/files')
|
|||
|
||||
App::get('/v1/storage/buckets/:bucketId/files/:fileId')
|
||||
->alias('/v1/storage/files/:fileId', ['bucketId' => 'default'])
|
||||
->desc('Get File')
|
||||
->desc('Get file')
|
||||
->groups(['api', 'storage'])
|
||||
->label('scope', 'files.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
|
@ -814,7 +814,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId')
|
|||
|
||||
App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
|
||||
->alias('/v1/storage/files/:fileId/preview', ['bucketId' => 'default'])
|
||||
->desc('Get File Preview')
|
||||
->desc('Get file preview')
|
||||
->groups(['api', 'storage'])
|
||||
->label('scope', 'files.read')
|
||||
->label('cache', true)
|
||||
|
@ -983,7 +983,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
|
|||
|
||||
App::get('/v1/storage/buckets/:bucketId/files/:fileId/download')
|
||||
->alias('/v1/storage/files/:fileId/download', ['bucketId' => 'default'])
|
||||
->desc('Get File for Download')
|
||||
->desc('Get file for download')
|
||||
->groups(['api', 'storage'])
|
||||
->label('scope', 'files.read')
|
||||
->label('usage.metric', 'files.{scope}.requests.read')
|
||||
|
@ -1126,7 +1126,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download')
|
|||
|
||||
App::get('/v1/storage/buckets/:bucketId/files/:fileId/view')
|
||||
->alias('/v1/storage/files/:fileId/view', ['bucketId' => 'default'])
|
||||
->desc('Get File for View')
|
||||
->desc('Get file for view')
|
||||
->groups(['api', 'storage'])
|
||||
->label('scope', 'files.read')
|
||||
->label('usage.metric', 'files.{scope}.requests.read')
|
||||
|
@ -1279,7 +1279,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view')
|
|||
|
||||
App::put('/v1/storage/buckets/:bucketId/files/:fileId')
|
||||
->alias('/v1/storage/files/:fileId', ['bucketId' => 'default'])
|
||||
->desc('Update File')
|
||||
->desc('Update file')
|
||||
->groups(['api', 'storage'])
|
||||
->label('scope', 'files.write')
|
||||
->label('event', 'buckets.[bucketId].files.[fileId].update')
|
||||
|
|
|
@ -41,7 +41,7 @@ use Utopia\Validator\Assoc;
|
|||
use Utopia\Validator\Text;
|
||||
|
||||
App::post('/v1/teams')
|
||||
->desc('Create Team')
|
||||
->desc('Create team')
|
||||
->groups(['api', 'teams'])
|
||||
->label('event', 'teams.[teamId].create')
|
||||
->label('scope', 'teams.write')
|
||||
|
@ -129,7 +129,7 @@ App::post('/v1/teams')
|
|||
});
|
||||
|
||||
App::get('/v1/teams')
|
||||
->desc('List Teams')
|
||||
->desc('List teams')
|
||||
->groups(['api', 'teams'])
|
||||
->label('scope', 'teams.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
|
@ -181,7 +181,7 @@ App::get('/v1/teams')
|
|||
});
|
||||
|
||||
App::get('/v1/teams/:teamId')
|
||||
->desc('Get Team')
|
||||
->desc('Get team')
|
||||
->groups(['api', 'teams'])
|
||||
->label('scope', 'teams.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
|
@ -208,7 +208,7 @@ App::get('/v1/teams/:teamId')
|
|||
});
|
||||
|
||||
App::get('/v1/teams/:teamId/prefs')
|
||||
->desc('Get Team Preferences')
|
||||
->desc('Get team preferences')
|
||||
->groups(['api', 'teams'])
|
||||
->label('scope', 'teams.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
|
||||
|
@ -236,7 +236,7 @@ App::get('/v1/teams/:teamId/prefs')
|
|||
});
|
||||
|
||||
App::put('/v1/teams/:teamId')
|
||||
->desc('Update Name')
|
||||
->desc('Update name')
|
||||
->groups(['api', 'teams'])
|
||||
->label('event', 'teams.[teamId].update')
|
||||
->label('scope', 'teams.write')
|
||||
|
@ -279,7 +279,7 @@ App::put('/v1/teams/:teamId')
|
|||
});
|
||||
|
||||
App::put('/v1/teams/:teamId/prefs')
|
||||
->desc('Update Preferences')
|
||||
->desc('Update preferences')
|
||||
->groups(['api', 'teams'])
|
||||
->label('event', 'teams.[teamId].update.prefs')
|
||||
->label('scope', 'teams.write')
|
||||
|
@ -315,7 +315,7 @@ App::put('/v1/teams/:teamId/prefs')
|
|||
});
|
||||
|
||||
App::delete('/v1/teams/:teamId')
|
||||
->desc('Delete Team')
|
||||
->desc('Delete team')
|
||||
->groups(['api', 'teams'])
|
||||
->label('event', 'teams.[teamId].delete')
|
||||
->label('scope', 'teams.write')
|
||||
|
@ -357,7 +357,7 @@ App::delete('/v1/teams/:teamId')
|
|||
});
|
||||
|
||||
App::post('/v1/teams/:teamId/memberships')
|
||||
->desc('Create Team Membership')
|
||||
->desc('Create team membership')
|
||||
->groups(['api', 'teams', 'auth'])
|
||||
->label('event', 'teams.[teamId].memberships.[membershipId].create')
|
||||
->label('scope', 'teams.write')
|
||||
|
@ -666,7 +666,7 @@ App::post('/v1/teams/:teamId/memberships')
|
|||
});
|
||||
|
||||
App::get('/v1/teams/:teamId/memberships')
|
||||
->desc('List Team Memberships')
|
||||
->desc('List team memberships')
|
||||
->groups(['api', 'teams'])
|
||||
->label('scope', 'teams.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
|
@ -750,7 +750,7 @@ App::get('/v1/teams/:teamId/memberships')
|
|||
});
|
||||
|
||||
App::get('/v1/teams/:teamId/memberships/:membershipId')
|
||||
->desc('Get Team Membership')
|
||||
->desc('Get team membership')
|
||||
->groups(['api', 'teams'])
|
||||
->label('scope', 'teams.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
|
@ -792,7 +792,7 @@ App::get('/v1/teams/:teamId/memberships/:membershipId')
|
|||
});
|
||||
|
||||
App::patch('/v1/teams/:teamId/memberships/:membershipId')
|
||||
->desc('Update Membership')
|
||||
->desc('Update membership')
|
||||
->groups(['api', 'teams'])
|
||||
->label('event', 'teams.[teamId].memberships.[membershipId].update')
|
||||
->label('scope', 'teams.write')
|
||||
|
@ -863,7 +863,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId')
|
|||
});
|
||||
|
||||
App::patch('/v1/teams/:teamId/memberships/:membershipId/status')
|
||||
->desc('Update Team Membership Status')
|
||||
->desc('Update team membership status')
|
||||
->groups(['api', 'teams'])
|
||||
->label('event', 'teams.[teamId].memberships.[membershipId].update.status')
|
||||
->label('scope', 'public')
|
||||
|
@ -998,7 +998,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status')
|
|||
});
|
||||
|
||||
App::delete('/v1/teams/:teamId/memberships/:membershipId')
|
||||
->desc('Delete Team Membership')
|
||||
->desc('Delete team membership')
|
||||
->groups(['api', 'teams'])
|
||||
->label('event', 'teams.[teamId].memberships.[membershipId].delete')
|
||||
->label('scope', 'teams.write')
|
||||
|
@ -1064,7 +1064,7 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId')
|
|||
});
|
||||
|
||||
App::get('/v1/teams/:teamId/logs')
|
||||
->desc('List Team Logs')
|
||||
->desc('List team logs')
|
||||
->groups(['api', 'teams'])
|
||||
->label('scope', 'teams.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
|
||||
|
|
|
@ -108,7 +108,7 @@ function createUser(string $hash, mixed $hashOptions, string $userId, ?string $e
|
|||
}
|
||||
|
||||
App::post('/v1/users')
|
||||
->desc('Create User')
|
||||
->desc('Create user')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].create')
|
||||
->label('scope', 'users.write')
|
||||
|
@ -141,7 +141,7 @@ App::post('/v1/users')
|
|||
});
|
||||
|
||||
App::post('/v1/users/bcrypt')
|
||||
->desc('Create User with Bcrypt Password')
|
||||
->desc('Create user with bcrypt password')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].create')
|
||||
->label('scope', 'users.write')
|
||||
|
@ -172,7 +172,7 @@ App::post('/v1/users/bcrypt')
|
|||
});
|
||||
|
||||
App::post('/v1/users/md5')
|
||||
->desc('Create User with MD5 Password')
|
||||
->desc('Create user with MD5 password')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].create')
|
||||
->label('scope', 'users.write')
|
||||
|
@ -203,7 +203,7 @@ App::post('/v1/users/md5')
|
|||
});
|
||||
|
||||
App::post('/v1/users/argon2')
|
||||
->desc('Create User with Argon2 Password')
|
||||
->desc('Create user with Argon2 password')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].create')
|
||||
->label('scope', 'users.write')
|
||||
|
@ -234,7 +234,7 @@ App::post('/v1/users/argon2')
|
|||
});
|
||||
|
||||
App::post('/v1/users/sha')
|
||||
->desc('Create User with SHA Password')
|
||||
->desc('Create user with SHA password')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].create')
|
||||
->label('scope', 'users.write')
|
||||
|
@ -272,7 +272,7 @@ App::post('/v1/users/sha')
|
|||
});
|
||||
|
||||
App::post('/v1/users/phpass')
|
||||
->desc('Create User with PHPass Password')
|
||||
->desc('Create user with PHPass password')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].create')
|
||||
->label('scope', 'users.write')
|
||||
|
@ -303,7 +303,7 @@ App::post('/v1/users/phpass')
|
|||
});
|
||||
|
||||
App::post('/v1/users/scrypt')
|
||||
->desc('Create User with Scrypt Password')
|
||||
->desc('Create user with Scrypt password')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].create')
|
||||
->label('scope', 'users.write')
|
||||
|
@ -347,7 +347,7 @@ App::post('/v1/users/scrypt')
|
|||
});
|
||||
|
||||
App::post('/v1/users/scrypt-modified')
|
||||
->desc('Create User with Scrypt Modified Password')
|
||||
->desc('Create user with Scrypt modified password')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].create')
|
||||
->label('scope', 'users.write')
|
||||
|
@ -381,7 +381,7 @@ App::post('/v1/users/scrypt-modified')
|
|||
});
|
||||
|
||||
App::get('/v1/users')
|
||||
->desc('List Users')
|
||||
->desc('List users')
|
||||
->groups(['api', 'users'])
|
||||
->label('scope', 'users.read')
|
||||
->label('usage.metric', 'users.{scope}.requests.read')
|
||||
|
@ -430,7 +430,7 @@ App::get('/v1/users')
|
|||
});
|
||||
|
||||
App::get('/v1/users/:userId')
|
||||
->desc('Get User')
|
||||
->desc('Get user')
|
||||
->groups(['api', 'users'])
|
||||
->label('scope', 'users.read')
|
||||
->label('usage.metric', 'users.{scope}.requests.read')
|
||||
|
@ -456,7 +456,7 @@ App::get('/v1/users/:userId')
|
|||
});
|
||||
|
||||
App::get('/v1/users/:userId/prefs')
|
||||
->desc('Get User Preferences')
|
||||
->desc('Get user preferences')
|
||||
->groups(['api', 'users'])
|
||||
->label('scope', 'users.read')
|
||||
->label('usage.metric', 'users.{scope}.requests.read')
|
||||
|
@ -484,7 +484,7 @@ App::get('/v1/users/:userId/prefs')
|
|||
});
|
||||
|
||||
App::get('/v1/users/:userId/sessions')
|
||||
->desc('List User Sessions')
|
||||
->desc('List user sessions')
|
||||
->groups(['api', 'users'])
|
||||
->label('scope', 'users.read')
|
||||
->label('usage.metric', 'users.{scope}.requests.read')
|
||||
|
@ -526,7 +526,7 @@ App::get('/v1/users/:userId/sessions')
|
|||
});
|
||||
|
||||
App::get('/v1/users/:userId/memberships')
|
||||
->desc('List User Memberships')
|
||||
->desc('List user memberships')
|
||||
->groups(['api', 'users'])
|
||||
->label('scope', 'users.read')
|
||||
->label('usage.metric', 'users.{scope}.requests.read')
|
||||
|
@ -566,7 +566,7 @@ App::get('/v1/users/:userId/memberships')
|
|||
});
|
||||
|
||||
App::get('/v1/users/:userId/logs')
|
||||
->desc('List User Logs')
|
||||
->desc('List user logs')
|
||||
->groups(['api', 'users'])
|
||||
->label('scope', 'users.read')
|
||||
->label('usage.metric', 'users.{scope}.requests.read')
|
||||
|
@ -697,7 +697,7 @@ App::get('/v1/users/identities')
|
|||
});
|
||||
|
||||
App::patch('/v1/users/:userId/status')
|
||||
->desc('Update User Status')
|
||||
->desc('Update user status')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].update.status')
|
||||
->label('scope', 'users.write')
|
||||
|
@ -734,7 +734,7 @@ App::patch('/v1/users/:userId/status')
|
|||
});
|
||||
|
||||
App::put('/v1/users/:userId/labels')
|
||||
->desc('Update User Labels')
|
||||
->desc('Update user labels')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].update.labels')
|
||||
->label('scope', 'users.write')
|
||||
|
@ -772,7 +772,7 @@ App::put('/v1/users/:userId/labels')
|
|||
});
|
||||
|
||||
App::patch('/v1/users/:userId/verification/phone')
|
||||
->desc('Update Phone Verification')
|
||||
->desc('Update phone verification')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].update.verification')
|
||||
->label('scope', 'users.write')
|
||||
|
@ -808,7 +808,7 @@ App::patch('/v1/users/:userId/verification/phone')
|
|||
});
|
||||
|
||||
App::patch('/v1/users/:userId/name')
|
||||
->desc('Update Name')
|
||||
->desc('Update name')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].update.name')
|
||||
->label('scope', 'users.write')
|
||||
|
@ -846,7 +846,7 @@ App::patch('/v1/users/:userId/name')
|
|||
});
|
||||
|
||||
App::patch('/v1/users/:userId/password')
|
||||
->desc('Update Password')
|
||||
->desc('Update password')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].update.password')
|
||||
->label('scope', 'users.write')
|
||||
|
@ -911,7 +911,7 @@ App::patch('/v1/users/:userId/password')
|
|||
});
|
||||
|
||||
App::patch('/v1/users/:userId/email')
|
||||
->desc('Update Email')
|
||||
->desc('Update email')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].update.email')
|
||||
->label('scope', 'users.write')
|
||||
|
@ -968,7 +968,7 @@ App::patch('/v1/users/:userId/email')
|
|||
});
|
||||
|
||||
App::patch('/v1/users/:userId/phone')
|
||||
->desc('Update Phone')
|
||||
->desc('Update phone')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].update.phone')
|
||||
->label('scope', 'users.write')
|
||||
|
@ -1012,7 +1012,7 @@ App::patch('/v1/users/:userId/phone')
|
|||
});
|
||||
|
||||
App::patch('/v1/users/:userId/verification')
|
||||
->desc('Update Email Verification')
|
||||
->desc('Update email verification')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].update.verification')
|
||||
->label('scope', 'users.write')
|
||||
|
@ -1048,7 +1048,7 @@ App::patch('/v1/users/:userId/verification')
|
|||
});
|
||||
|
||||
App::patch('/v1/users/:userId/prefs')
|
||||
->desc('Update User Preferences')
|
||||
->desc('Update user preferences')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].update.prefs')
|
||||
->label('scope', 'users.write')
|
||||
|
@ -1082,7 +1082,7 @@ App::patch('/v1/users/:userId/prefs')
|
|||
});
|
||||
|
||||
App::delete('/v1/users/:userId/sessions/:sessionId')
|
||||
->desc('Delete User Session')
|
||||
->desc('Delete user session')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].sessions.[sessionId].delete')
|
||||
->label('scope', 'users.write')
|
||||
|
@ -1126,7 +1126,7 @@ App::delete('/v1/users/:userId/sessions/:sessionId')
|
|||
});
|
||||
|
||||
App::delete('/v1/users/:userId/sessions')
|
||||
->desc('Delete User Sessions')
|
||||
->desc('Delete user sessions')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].sessions.[sessionId].delete')
|
||||
->label('scope', 'users.write')
|
||||
|
@ -1169,7 +1169,7 @@ App::delete('/v1/users/:userId/sessions')
|
|||
});
|
||||
|
||||
App::delete('/v1/users/:userId')
|
||||
->desc('Delete User')
|
||||
->desc('Delete user')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].delete')
|
||||
->label('scope', 'users.write')
|
||||
|
|
|
@ -20,8 +20,9 @@ class Linkedin extends OAuth2
|
|||
* @var array
|
||||
*/
|
||||
protected array $scopes = [
|
||||
'r_liteprofile',
|
||||
'r_emailaddress',
|
||||
'openid',
|
||||
'profile',
|
||||
'email'
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -117,8 +118,7 @@ class Linkedin extends OAuth2
|
|||
public function getUserID(string $accessToken): string
|
||||
{
|
||||
$user = $this->getUser($accessToken);
|
||||
|
||||
return $user['id'] ?? '';
|
||||
return $user['sub'] ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -128,9 +128,8 @@ class Linkedin extends OAuth2
|
|||
*/
|
||||
public function getUserEmail(string $accessToken): string
|
||||
{
|
||||
$email = \json_decode($this->request('GET', 'https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~))', ['Authorization: Bearer ' . \urlencode($accessToken)]), true);
|
||||
|
||||
return $email['elements'][0]['handle~']['emailAddress'] ?? '';
|
||||
$user = $this->getUser($accessToken);
|
||||
return $user['email'] ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -144,9 +143,8 @@ class Linkedin extends OAuth2
|
|||
*/
|
||||
public function isEmailVerified(string $accessToken): bool
|
||||
{
|
||||
$email = $this->getUserEmail($accessToken);
|
||||
|
||||
return !empty($email);
|
||||
$user = $this->getUser($accessToken);
|
||||
return $user['email_verified'] ?? false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -159,12 +157,16 @@ class Linkedin extends OAuth2
|
|||
$user = $this->getUser($accessToken);
|
||||
$name = '';
|
||||
|
||||
if (isset($user['localizedFirstName'])) {
|
||||
$name = $user['localizedFirstName'];
|
||||
if (isset($user['name'])) {
|
||||
return $user['name'];
|
||||
}
|
||||
|
||||
if (isset($user['localizedLastName'])) {
|
||||
$name = (empty($name)) ? $user['localizedLastName'] : $name . ' ' . $user['localizedLastName'];
|
||||
if (isset($user['given_name'])) {
|
||||
$name = $user['given_name'];
|
||||
}
|
||||
|
||||
if (isset($user['family_name'])) {
|
||||
$name = (empty($name)) ? $user['family_name'] : $name . ' ' . $user['family_name'];
|
||||
}
|
||||
|
||||
return $name;
|
||||
|
@ -178,7 +180,7 @@ class Linkedin extends OAuth2
|
|||
protected function getUser(string $accessToken)
|
||||
{
|
||||
if (empty($this->user)) {
|
||||
$this->user = \json_decode($this->request('GET', 'https://api.linkedin.com/v2/me', ['Authorization: Bearer ' . \urlencode($accessToken)]), true);
|
||||
$this->user = \json_decode($this->request('GET', 'https://api.linkedin.com/v2/userinfo', ['Authorization: Bearer ' . \urlencode($accessToken)]), true);
|
||||
}
|
||||
|
||||
return $this->user;
|
||||
|
|
Loading…
Reference in a new issue