Skip to content

feat: SDK update for version 15.1.0 - #101

Merged
ChiragAgg5k merged 1 commit into
mainfrom
dev
Jun 23, 2026
Merged

feat: SDK update for version 15.1.0#101
ChiragAgg5k merged 1 commit into
mainfrom
dev

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Jun 23, 2026

Copy link
Copy Markdown
Member

This PR contains updates to the SDK for version 15.1.0.

What's Changed

  • Breaking: listEvents and listGauges on Usage now take metrics (string array, 1-10) instead of a single metric
  • Breaking: UsageEventList and UsageGaugeList now expose interval and a metrics array; UsageGroup is replaced by UsageMetric and UsageDataPoint
  • Breaking: createDatabaseExecution on Compute now posts to the /executions endpoint
  • Added: resource parameter on Oauth2 authorize, createDeviceAuthorization, and createToken for RFC 8707 resource indicators
  • Added: resources field on the Oauth2Authorize model
  • Added: service and resource break-down dimensions on Usage listGauges
  • Updated: Databases transaction and text attribute methods are now marked deprecated in favor of TablesDB
  • Updated: OAuth2 server fields on the project model are now optional

@ChiragAgg5k ChiragAgg5k changed the title feat: Console SDK update for version 15.1.0 feat: SDK update for version 15.1.0 Jun 23, 2026
@greptile-apps

greptile-apps Bot commented Jun 23, 2026

Copy link
Copy Markdown

Greptile Summary

This PR updates the console SDK to version 15.1.0, delivering several breaking changes and additive features aligned with the Appwrite backend 15.1.0 release.

  • Usage service: listEvents and listGauges now accept metrics: string[] (1–10) instead of a single metric string; response models are restructured from UsageGroup[] into a UsageMetric[]/UsageDataPoint hierarchy, and UsageGaugeList gains service/resource breakdown dimensions.
  • OAuth2 service: optional resource parameter (RFC 8707 resource indicators) added to authorize, createDeviceAuthorization, and createToken; Oauth2Authorize model gains a resources field; all OAuth2 server fields on the project model are now optional.
  • Compute service: createDatabaseExecution endpoint corrected from /execution to /executions; Databases transaction and text-attribute methods gain @deprecated annotations pointing to TablesDB.

Confidence Score: 4/5

The changes are clean auto-generated SDK updates with one gap: the metrics array is not validated for minimum length, so callers passing [] receive a server error instead of a clear SDK-level exception.

The listEvents and listGauges required-parameter check does not catch an empty array, which the API rejects as invalid. Every other part of the PR — endpoint rename, OAuth2 resource indicators, model restructuring, deprecation annotations — is straightforward and consistent.

src/services/usage.ts — the metrics array length guard is missing in both listEvents and listGauges.

Important Files Changed

Filename Overview
src/services/usage.ts Renames metric: string to metrics: string[] across both listEvents and listGauges; overload dispatch logic handles the array vs. object distinction correctly, but the required-parameter check does not reject an empty array, which would silently propagate to the server.
src/models.ts Renames UsageGroup to UsageDataPoint, introduces UsageMetric, restructures UsageEventList/UsageGaugeList to use metrics: UsageMetric[], adds resources to Oauth2Authorize, and makes all OAuth2 server fields on the project model optional.
src/services/oauth-2.ts Adds optional resource parameter (RFC 8707) to authorize, createDeviceAuthorization, and createToken; both overload styles updated correctly including the rest-args tuple types.
src/services/compute.ts API path updated from /execution to /executions for createDatabaseExecution; JSDoc updated to match.
src/services/databases.ts Adds @deprecated JSDoc annotations to transaction and text-attribute methods pointing to TablesDB equivalents; no functional change.
docs/examples/usage/list-events.md Updates metric to metrics: []; empty array placeholder will fail the API's 1–10 constraint on copy-paste, should be metrics: ['<METRIC>'].
docs/examples/usage/list-gauges.md Same empty-array issue as list-events.mdmetrics: [] should be metrics: ['<METRIC>'].
docs/examples/oauth2/authorize.md Adds resource: '' placeholder; style is inconsistent with other '<PLACEHOLDER>' values used throughout the OAuth2 docs examples.
src/client.ts SDK version header bumped from 15.0.0 to 15.1.0.

Reviews (1): Last reviewed commit: "chore: update Console SDK to 15.1.0" | Re-trigger Greptile

Comment thread src/services/usage.ts
Comment on lines +98 to 100
if (typeof metrics === 'undefined') {
throw new AppwriteException('Missing required parameter: "metrics"');
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 metrics empty-array passes validation silently

The guard only checks for undefined, so metrics: [] passes the client-side check, gets serialized into the request body, and the server returns an error. The API explicitly documents 1–10 entries as the valid range — a zero-length array should be caught here just like undefined. The same pattern applies in listGauges (line 861–863).

Comment on lines 8 to 10
const usage = new Usage(client);

const result = await usage.listEvents({

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Example uses empty metrics array

metrics: [] would fail the 1–10 constraint enforced by the API, so this example would error on every copy-paste run. It should show a real placeholder such as metrics: ['<METRIC>'], consistent with the single-metric placeholder style used in the previous version. The same applies to docs/examples/usage/list-gauges.md.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines 19 to 20
prompt: '<PROMPT>', // optional
maxAge: 0, // optional

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 resource placeholder uses empty string instead of a URI sentinel

Every other optional string parameter in the OAuth2 examples uses '<PLACEHOLDER>' style, but resource: '' uses a bare empty string. An empty string is not a valid RFC 8707 URI and would likely be rejected or silently ignored by the server, whereas '<RESOURCE_URI>' makes the intent clear. The same occurs in create-device-authorization.md and create-token.md.

@ChiragAgg5k
ChiragAgg5k merged commit d71bf1f into main Jun 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants