Add public visibility control for deprecated methods

- Add 'public' parameter to SDK Method class to control documentation visibility
- Mark deprecated methods as non-public (public: false) to hide them from docs
- Update OpenAPI and Swagger specs to reflect visibility changes
- Affected endpoints: account verification, messaging providers, and MFA authenticators
This commit is contained in:
Chirag Aggarwal 2025-12-11 13:53:34 +05:30
parent 5912a4c4a0
commit aa12ef6569
27 changed files with 5016 additions and 323 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -3754,6 +3754,7 @@ App::post('/v1/account/verifications/email')
since: '1.8.0',
replaceWith: 'account.createEmailVerification'
),
public: false,
)
])
->label('abuse-limit', 10)
@ -3970,6 +3971,7 @@ App::put('/v1/account/verifications/email')
since: '1.8.0',
replaceWith: 'account.updateEmailVerification'
),
public: false,
)
])
->label('abuse-limit', 10)

View file

@ -339,6 +339,7 @@ App::post('/v1/messaging/providers/smtp')
since: '1.8.0',
replaceWith: 'messaging.createSMTPProvider',
),
public: false,
),
new Method(
namespace: 'messaging',
@ -872,6 +873,7 @@ App::post('/v1/messaging/providers/fcm')
since: '1.8.0',
replaceWith: 'messaging.createFCMProvider',
),
public: false,
),
new Method(
namespace: 'messaging',
@ -961,6 +963,7 @@ App::post('/v1/messaging/providers/apns')
since: '1.8.0',
replaceWith: 'messaging.createAPNSProvider',
),
public: false,
),
new Method(
namespace: 'messaging',
@ -1574,6 +1577,7 @@ App::patch('/v1/messaging/providers/smtp/:providerId')
since: '1.8.0',
replaceWith: 'messaging.updateSMTPProvider',
),
public: false,
),
new Method(
namespace: 'messaging',
@ -2165,6 +2169,7 @@ App::patch('/v1/messaging/providers/fcm/:providerId')
since: '1.8.0',
replaceWith: 'messaging.updateFCMProvider',
),
public: false,
),
new Method(
namespace: 'messaging',
@ -2260,6 +2265,7 @@ App::patch('/v1/messaging/providers/apns/:providerId')
since: '1.8.0',
replaceWith: 'messaging.updateAPNSProvider',
),
public: false,
),
new Method(
namespace: 'messaging',
@ -3325,6 +3331,7 @@ App::post('/v1/messaging/messages/sms')
since: '1.8.0',
replaceWith: 'messaging.createSMS',
),
public: false,
),
new Method(
namespace: 'messaging',
@ -4168,6 +4175,7 @@ App::patch('/v1/messaging/messages/sms/:messageId')
since: '1.8.0',
replaceWith: 'messaging.updateSMS',
),
public: false,
),
new Method(
namespace: 'messaging',

View file

@ -563,6 +563,7 @@ App::patch('/v1/projects/:projectId/api')
since: '1.8.0',
replaceWith: 'projects.updateAPIStatus',
),
public: false,
),
new Method(
namespace: 'projects',
@ -620,6 +621,7 @@ App::patch('/v1/projects/:projectId/api/all')
since: '1.8.0',
replaceWith: 'projects.updateAPIStatusAll',
),
public: false,
),
new Method(
namespace: 'projects',
@ -2024,6 +2026,7 @@ App::patch('/v1/projects/:projectId/smtp')
since: '1.8.0',
replaceWith: 'projects.updateSMTP',
),
public: false,
),
new Method(
namespace: 'projects',
@ -2140,6 +2143,7 @@ App::post('/v1/projects/:projectId/smtp/tests')
since: '1.8.0',
replaceWith: 'projects.createSMTPTest',
),
public: false,
),
new Method(
namespace: 'projects',
@ -2234,6 +2238,7 @@ App::get('/v1/projects/:projectId/templates/sms/:type/:locale')
since: '1.8.0',
replaceWith: 'projects.getSMSTemplate',
),
public: false,
),
new Method(
namespace: 'projects',
@ -2400,6 +2405,7 @@ App::patch('/v1/projects/:projectId/templates/sms/:type/:locale')
since: '1.8.0',
replaceWith: 'projects.updateSMSTemplate',
),
public: false,
),
new Method(
namespace: 'projects',
@ -2524,6 +2530,7 @@ App::delete('/v1/projects/:projectId/templates/sms/:type/:locale')
since: '1.8.0',
replaceWith: 'projects.deleteSMSTemplate',
),
public: false,
),
new Method(
namespace: 'projects',

View file

@ -1813,6 +1813,7 @@ App::patch('/v1/users/:userId/mfa')
since: '1.8.0',
replaceWith: 'users.updateMFA',
),
public: false,
),
new Method(
namespace: 'users',
@ -1872,6 +1873,7 @@ App::get('/v1/users/:userId/mfa/factors')
since: '1.8.0',
replaceWith: 'users.listMFAFactors',
),
public: false,
),
new Method(
namespace: 'users',
@ -1930,6 +1932,7 @@ App::get('/v1/users/:userId/mfa/recovery-codes')
since: '1.8.0',
replaceWith: 'users.getMFARecoveryCodes',
),
public: false,
),
new Method(
namespace: 'users',
@ -1994,6 +1997,7 @@ App::patch('/v1/users/:userId/mfa/recovery-codes')
since: '1.8.0',
replaceWith: 'users.createMFARecoveryCodes',
),
public: false,
),
new Method(
namespace: 'users',
@ -2065,6 +2069,7 @@ App::put('/v1/users/:userId/mfa/recovery-codes')
since: '1.8.0',
replaceWith: 'users.updateMFARecoveryCodes',
),
public: false,
),
new Method(
namespace: 'users',
@ -2077,7 +2082,8 @@ App::put('/v1/users/:userId/mfa/recovery-codes')
code: Response::STATUS_CODE_OK,
model: Response::MODEL_MFA_RECOVERY_CODES,
)
]
],
public: false,
)
])
->param('userId', '', new UID(), 'User ID.')
@ -2136,6 +2142,7 @@ App::delete('/v1/users/:userId/mfa/authenticators/:type')
since: '1.8.0',
replaceWith: 'users.deleteMFAAuthenticator',
),
public: false,
),
new Method(
namespace: 'users',

View file

@ -60,6 +60,7 @@ class Create extends Action
since: '1.8.0',
replaceWith: 'account.createMFAAuthenticator',
),
public: false,
),
new Method(
namespace: 'account',

View file

@ -57,6 +57,7 @@ class Delete extends Action
since: '1.8.0',
replaceWith: 'account.deleteMFAAuthenticator',
),
public: false,
),
new Method(
namespace: 'account',

View file

@ -59,6 +59,7 @@ class Update extends Action
since: '1.8.0',
replaceWith: 'account.updateMFAAuthenticator',
),
public: false,
),
new Method(
namespace: 'account',

View file

@ -72,6 +72,7 @@ class Create extends Action
since: '1.8.0',
replaceWith: 'account.createMFAChallenge',
),
public: false,
),
new Method(
namespace: 'account',

View file

@ -59,6 +59,7 @@ class Update extends Action
since: '1.8.0',
replaceWith: 'account.updateMFAChallenge',
),
public: false,
),
new Method(
namespace: 'account',

View file

@ -49,6 +49,7 @@ class XList extends Action
since: '1.8.0',
replaceWith: 'account.listMFAFactors',
),
public: false,
),
new Method(
namespace: 'account',

View file

@ -55,6 +55,7 @@ class Create extends Action
since: '1.8.0',
replaceWith: 'account.createMFARecoveryCodes',
),
public: false,
),
new Method(
namespace: 'account',

View file

@ -48,6 +48,7 @@ class Get extends Action
since: '1.8.0',
replaceWith: 'account.getMFARecoveryCodes',
),
public: false,
),
new Method(
namespace: 'account',

View file

@ -31,6 +31,7 @@ class Method
* @param array<Parameter> $parameters
* @param array $additionalParameters
* @param string $desc
* @param bool $public Whether this method should be rendered on the website/documentation
*/
public function __construct(
protected string $namespace,
@ -47,7 +48,8 @@ class Method
protected ContentType $requestType = ContentType::JSON,
protected array $parameters = [],
protected array $additionalParameters = [],
protected string $desc = ''
protected string $desc = '',
protected bool $public = true
) {
$this->validateMethod($name, $namespace);
$this->validateAuthTypes($auth);
@ -307,6 +309,17 @@ class Method
return $this;
}
public function isPublic(): bool
{
return $this->public;
}
public function setPublic(bool $public): self
{
$this->public = $public;
return $this;
}
public static function getErrors(): array
{
return self::$errors;

View file

@ -165,7 +165,8 @@ class OpenAPI3 extends Format
'rate-key' => $route->getLabel('abuse-key', 'url:{url},ip:{ip}'),
'scope' => $route->getLabel('scope', ''),
'platforms' => $sdkPlatforms,
'packaging' => $sdk->isPackaging()
'packaging' => $sdk->isPackaging(),
'public' => $sdk->isPublic(),
],
];
@ -225,6 +226,7 @@ class OpenAPI3 extends Format
'responses' => [],
'description' => ($desc) ? \file_get_contents($desc) : '',
'demo' => \strtolower($namespace) . '/' . Template::fromCamelCaseToDash($methodObj->getMethodName()) . '.md',
'public' => $methodObj->isPublic(),
];
// add deprecation only if method has it!

View file

@ -170,6 +170,7 @@ class Swagger2 extends Format
'scope' => $route->getLabel('scope', ''),
'platforms' => $sdkPlatforms,
'packaging' => $sdk->isPackaging(),
'public' => $sdk->isPublic(),
],
];
@ -234,6 +235,7 @@ class Swagger2 extends Format
'responses' => [],
'description' => ($desc) ? \file_get_contents($desc) : '',
'demo' => \strtolower($namespace) . '/' . Template::fromCamelCaseToDash($methodObj->getMethodName()) . '.md',
'public' => $methodObj->isPublic(),
];
// add deprecation only if method has it!