feat: SDK update for version 12.0.0#88
Conversation
Greptile SummaryThis PR delivers the SDK update for version 12.0.0, introducing the new
Confidence Score: 4/5Safe to merge after resolving the missing One P1 finding: the src/services/organizations.ts — missing Important Files Changed
Reviews (2): Last reviewed commit: "fix: blacklist BillingPlan enum, reword ..." | Re-trigger Greptile |
| getOAuth2Provider(params: { provider: string }): Promise<Models.OAuth2Github | Models.OAuth2Discord | Models.OAuth2Figma | Models.OAuth2Dropbox | Models.OAuth2Dailymotion | Models.OAuth2Bitbucket | Models.OAuth2Bitly | Models.OAuth2Box | Models.OAuth2Autodesk | Models.OAuth2Google | Models.OAuth2Zoom | Models.OAuth2Zoho | Models.OAuth2Yandex | Models.OAuth2X | Models.OAuth2WordPress | Models.OAuth2Twitch | Models.OAuth2Stripe | Models.OAuth2Spotify | Models.OAuth2Slack | Models.OAuth2Podio | Models.OAuth2Notion | Models.OAuth2Salesforce | Models.OAuth2Yahoo | Models.OAuth2Linkedin | Models.OAuth2Disqus | Models.OAuth2Amazon | Models.OAuth2Etsy | Models.OAuth2Facebook | Models.OAuth2Tradeshift | Models.OAuth2Paypal | Models.OAuth2Gitlab | Models.OAuth2Authentik | Models.OAuth2Auth0 | Models.OAuth2FusionAuth | Models.OAuth2Keycloak | Models.OAuth2Oidc | Models.OAuth2Apple | Models.OAuth2Okta | Models.OAuth2Kick | Models.OAuth2Microsoft>; | ||
| /** | ||
| * Update the project labels. Labels can be used to easily filter projects in an organization. | ||
| * Get a single OAuth2 provider configuration. Credential fields (client secret, p8 file, key/team IDs) are write-only and always returned empty. | ||
| * | ||
| * @param {string[]} labels - Array of project labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. | ||
| * @param {string} provider - OAuth2 provider key. For example: github, google, apple. | ||
| * @throws {AppwriteException} | ||
| * @returns {Promise<Models.Project>} | ||
| * @returns {Promise<Models.OAuth2Github | Models.OAuth2Discord | Models.OAuth2Figma | Models.OAuth2Dropbox | Models.OAuth2Dailymotion | Models.OAuth2Bitbucket | Models.OAuth2Bitly | Models.OAuth2Box | Models.OAuth2Autodesk | Models.OAuth2Google | Models.OAuth2Zoom | Models.OAuth2Zoho | Models.OAuth2Yandex | Models.OAuth2X | Models.OAuth2WordPress | Models.OAuth2Twitch | Models.OAuth2Stripe | Models.OAuth2Spotify | Models.OAuth2Slack | Models.OAuth2Podio | Models.OAuth2Notion | Models.OAuth2Salesforce | Models.OAuth2Yahoo | Models.OAuth2Linkedin | Models.OAuth2Disqus | Models.OAuth2Amazon | Models.OAuth2Etsy | Models.OAuth2Facebook | Models.OAuth2Tradeshift | Models.OAuth2Paypal | Models.OAuth2Gitlab | Models.OAuth2Authentik | Models.OAuth2Auth0 | Models.OAuth2FusionAuth | Models.OAuth2Keycloak | Models.OAuth2Oidc | Models.OAuth2Apple | Models.OAuth2Okta | Models.OAuth2Kick | Models.OAuth2Microsoft>} | ||
| * @deprecated Use the object parameter style method for a better developer experience. | ||
| */ | ||
| updateLabels(labels: string[]): Promise<Models.Project>; | ||
| updateLabels( | ||
| paramsOrFirst: { labels: string[] } | string[] | ||
| ): Promise<Models.Project> { | ||
| let params: { labels: string[] }; | ||
| getOAuth2Provider(provider: string): Promise<Models.OAuth2Github | Models.OAuth2Discord | Models.OAuth2Figma | Models.OAuth2Dropbox | Models.OAuth2Dailymotion | Models.OAuth2Bitbucket | Models.OAuth2Bitly | Models.OAuth2Box | Models.OAuth2Autodesk | Models.OAuth2Google | Models.OAuth2Zoom | Models.OAuth2Zoho | Models.OAuth2Yandex | Models.OAuth2X | Models.OAuth2WordPress | Models.OAuth2Twitch | Models.OAuth2Stripe | Models.OAuth2Spotify | Models.OAuth2Slack | Models.OAuth2Podio | Models.OAuth2Notion | Models.OAuth2Salesforce | Models.OAuth2Yahoo | Models.OAuth2Linkedin | Models.OAuth2Disqus | Models.OAuth2Amazon | Models.OAuth2Etsy | Models.OAuth2Facebook | Models.OAuth2Tradeshift | Models.OAuth2Paypal | Models.OAuth2Gitlab | Models.OAuth2Authentik | Models.OAuth2Auth0 | Models.OAuth2FusionAuth | Models.OAuth2Keycloak | Models.OAuth2Oidc | Models.OAuth2Apple | Models.OAuth2Okta | Models.OAuth2Kick | Models.OAuth2Microsoft>; | ||
| getOAuth2Provider( | ||
| paramsOrFirst: { provider: string } | string | ||
| ): Promise<Models.OAuth2Github | Models.OAuth2Discord | Models.OAuth2Figma | Models.OAuth2Dropbox | Models.OAuth2Dailymotion | Models.OAuth2Bitbucket | Models.OAuth2Bitly | Models.OAuth2Box | Models.OAuth2Autodesk | Models.OAuth2Google | Models.OAuth2Zoom | Models.OAuth2Zoho | Models.OAuth2Yandex | Models.OAuth2X | Models.OAuth2WordPress | Models.OAuth2Twitch | Models.OAuth2Stripe | Models.OAuth2Spotify | Models.OAuth2Slack | Models.OAuth2Podio | Models.OAuth2Notion | Models.OAuth2Salesforce | Models.OAuth2Yahoo | Models.OAuth2Linkedin | Models.OAuth2Disqus | Models.OAuth2Amazon | Models.OAuth2Etsy | Models.OAuth2Facebook | Models.OAuth2Tradeshift | Models.OAuth2Paypal | Models.OAuth2Gitlab | Models.OAuth2Authentik | Models.OAuth2Auth0 | Models.OAuth2FusionAuth | Models.OAuth2Keycloak | Models.OAuth2Oidc | Models.OAuth2Apple | Models.OAuth2Okta | Models.OAuth2Kick | Models.OAuth2Microsoft> { | ||
| let params: { provider: string }; | ||
|
|
||
| if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { | ||
| params = (paramsOrFirst || {}) as { labels: string[] }; | ||
| params = (paramsOrFirst || {}) as { provider: string }; |
There was a problem hiding this comment.
getOAuth2Provider accepts any string instead of OAuthProvider enum
The provider parameter is typed as string rather than OAuthProvider, which loses compile-time validation. Callers can silently pass an invalid provider name (e.g. a typo like 'githb') and only receive a runtime API error rather than a TypeScript error. The old Projects.updateOAuth2 used OAuthProvider for the same purpose.
This PR contains updates to the SDK for version 12.0.0.
What's Changed
AuthMethodenum toMethodIdProjects.updateAuthStatuswithProject.updateAuthMethodProjects.updateOAuth2with per-provider methods onProjectservice (e.g.updateOAuth2Google,updateOAuth2GitHub)Projects.updateMockNumberswithlistMockPhones,createMockPhone,getMockPhone,updateMockPhone,deleteMockPhoneonProjectserviceProjects.createJWTwithProject.createEphemeralKeydeletefromProjectstoProjectserviceexecution.read/execution.writescopes toexecutions.read/executions.writedomainIdparameter toinvoiceIdindomains.updatePurchaseanddomains.updateTransferInManagerservice withcreateBlock,deleteBlock,listBlocksmethodslistEmailTemplates,listOAuth2Providers,getOAuth2Provider,listPolicies,getPolicymethods onProjectservicecreatePlanEstimationmethod onOrganizationsservicelistOAuth2ProvidersandlistProjectScopesmethods onConsoleservicefusionauth,keycloak,kicktoOAuthProviderenumMethodId,PolicyIdenumsmocks.read,mocks.write,sessions.readscopesrust-1.83runtimebackup-policytoAppwriteMigrationResourceenumResourceTypevalues (projects,functions,sites,databases,buckets,providers,topics,subscribers,messages)X-Appwrite-Response-Formatheader to1.9.3