Skip to content

feat: Console SDK update for version 5.0.0#69

Merged
premtsd-code merged 4 commits intomainfrom
dev
Mar 12, 2026
Merged

feat: Console SDK update for version 5.0.0#69
premtsd-code merged 4 commits intomainfrom
dev

Conversation

@premtsd-code
Copy link
Copy Markdown
Contributor

@premtsd-code premtsd-code commented Mar 11, 2026

This PR contains updates to the Console SDK for version 5.0.0.

Summary by CodeRabbit

  • New Features

    • Domain purchase and transfer confirmation endpoints added
    • New Deno runtimes available: 1.21, 1.24, 1.35
    • Functions and Sites support separate build/runtime specifications and deployment retention
    • Sites can specify custom start commands
    • Messaging migration resource types added (provider, topic, subscriber, message)
    • Domain purchase payment status tracked with new status values
  • Updates

    • SDK/package version bumped to 5.0.0
  • Documentation

    • Examples and changelog updated to reflect new APIs and usage samples

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 11, 2026

Walkthrough

Updates documentation and changelog; bumps package and client x-sdk-version and adds a JSONbig-backed toString on object responses. Adds Domain purchase/transfer confirmation methods to Domains. Replaces specification with buildSpecification, runtimeSpecification, and deploymentRetention across Functions and Sites APIs and adds startCommand for Sites. Extends models with new fields (deploymentRetention, buildSpecification, runtimeSpecification, startCommand, DomainPurchasePaymentStatus, clientSecret, attempts, new usage/realtime metrics). Adds new runtime enum members (Deno versions) and new migration resource enum entries.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The PR title 'feat: Console SDK update for version 5.0.0' directly aligns with the primary change: updating the SDK to version 5.0.0 across package.json, src/client.ts, README.md, and CHANGELOG.md.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/models.ts (1)

8731-8771: ⚠️ Potential issue | 🟠 Major

Make clientSecret optional in Models.Domain.

The JSDoc correctly states this field is only present when paymentStatus is pending_confirmation, but the required string type is incorrect. Since confirmPurchase and confirmTransferIn return the raw API payload without transformation, the type definition should match the actual response structure.

         /**
          * Client secret for payment confirmation. Present only when paymentStatus is pending_confirmation.
          */
-        clientSecret: string;
+        clientSecret?: string;

Consider applying the same optional treatment to attempts, which is marked "Development only" and likely has conditional presence.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/models.ts` around lines 8731 - 8771, Update the Models.Domain type so
clientSecret is optional to match the API payload (change the required
clientSecret: string to an optional field), and optionally make attempts
optional as well; ensure this aligns with the conditional presence driven by
paymentStatus (e.g., pending_confirmation) and with how confirmPurchase and
confirmTransferIn return raw API responses so the type reflects possible absence
of these fields.
src/services/sites.ts (1)

144-175: ⚠️ Potential issue | 🟠 Major

Don’t shift the deprecated positional overload.

Adding startCommand before outputDirectory silently reinterprets existing positional calls. An older create(..., buildCommand, outputDirectory) or update(..., buildCommand, outputDirectory) call now posts that value as startCommand, and every later argument slides one slot. Keep the old tail ordering for the deprecated overload, add a legacy-shape compatibility branch, or remove the overload entirely if this break is intentional.

Also applies to: 621-652

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/services/sites.ts` around lines 144 - 175, The positional overload for
create was changed and now places startCommand before outputDirectory which
breaks older callers; restore the original deprecated positional tail ordering
(keep outputDirectory where it used to be, with startCommand after it) and/or
add a legacy-shape compatibility branch in create (and mirror the same fix in
update) that detects the old positional call shape and remaps rest[] to the
intended names (map buildCommand -> buildCommand, outputDirectory ->
outputDirectory, startCommand -> startCommand) so existing positional callers
continue to work; update the parameter unpacking logic around the create
function (and the update function) that assigns rest[6]..rest[...] to ensure
buildCommand, outputDirectory, startCommand, adapter, etc. remain in their
original order.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/examples/functions/update.md`:
- Around line 28-30: The example uses concrete destructive literals for update
fields (buildSpecification, runtimeSpecification, deploymentRetention) which can
overwrite existing values; change the example so these optional fields are
omitted when not updating (or set to undefined/null as appropriate for your API)
instead of using empty string '' or 0—remove or comment out the lines for
buildSpecification, runtimeSpecification, and deploymentRetention in the update
example so callers don't accidentally wipe existing specifications/retention.

In `@docs/examples/sites/create.md`:
- Around line 29-31: The example currently sets optional fields to concrete
values (buildSpecification: '', runtimeSpecification: '', deploymentRetention:
0) which will be interpreted as real settings; update the snippet to either
remove those keys entirely or replace them with clear placeholders (e.g.,
"<optional>" or omit) so copy-pasting does not submit actual empty-string or
zero values—look for the buildSpecification, runtimeSpecification, and
deploymentRetention entries in the create.md example and adjust them
accordingly.

In `@docs/examples/sites/update.md`:
- Around line 29-31: The example uses literal empty strings and 0 for optional
update fields (buildSpecification, runtimeSpecification, deploymentRetention)
which can accidentally overwrite existing values; change the example to either
omit these keys or set them to undefined (or clearly comment them as "omit to
keep existing") so copy-pasting the example won't reset specs or
retention—update the snippet around buildSpecification, runtimeSpecification,
and deploymentRetention to reflect that behavior.

In `@src/client.ts`:
- Around line 998-1000: The current assignment mutates all objects by directly
setting data.toString, which can overwrite legitimate properties and makes the
property enumerable; change the logic around the data variable so you only
modify plain JSON objects (e.g., check via Object.prototype.toString.call(data)
=== '[object Object]' or an isPlainObject helper) and set the toString as a
non-enumerable property using Object.defineProperty(data, 'toString', { value:
() => JSONbig.stringify(data), writable: true, configurable: true, enumerable:
false }); also ensure you skip this for binary/ArrayBuffer response paths
(responseType === 'arrayBuffer') and for cases where data already has an own
non-configurable toString to avoid throwing.

In `@src/models.ts`:
- Around line 6160-6175: The docs currently expose both
executions/executionsTotal and the new
functionsExecutions/functionsExecutionsTotal which look like duplicates; update
the TypeDoc comments to clarify intent by either marking the legacy
executions/executionsTotal pair as deprecated (add a deprecation note) or
explicitly documenting that executions/executionsTotal are legacy/aggregate
across both functions and sites while
functionsExecutions/functionsExecutionsTotal are function-only metrics; apply
the change in the comment blocks that document executions, executionsTotal,
functionsExecutions, and functionsExecutionsTotal so consumers know which pair
to read and prefer the new functions* pair for function-specific counts.

---

Outside diff comments:
In `@src/models.ts`:
- Around line 8731-8771: Update the Models.Domain type so clientSecret is
optional to match the API payload (change the required clientSecret: string to
an optional field), and optionally make attempts optional as well; ensure this
aligns with the conditional presence driven by paymentStatus (e.g.,
pending_confirmation) and with how confirmPurchase and confirmTransferIn return
raw API responses so the type reflects possible absence of these fields.

In `@src/services/sites.ts`:
- Around line 144-175: The positional overload for create was changed and now
places startCommand before outputDirectory which breaks older callers; restore
the original deprecated positional tail ordering (keep outputDirectory where it
used to be, with startCommand after it) and/or add a legacy-shape compatibility
branch in create (and mirror the same fix in update) that detects the old
positional call shape and remaps rest[] to the intended names (map buildCommand
-> buildCommand, outputDirectory -> outputDirectory, startCommand ->
startCommand) so existing positional callers continue to work; update the
parameter unpacking logic around the create function (and the update function)
that assigns rest[6]..rest[...] to ensure buildCommand, outputDirectory,
startCommand, adapter, etc. remain in their original order.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f82c8c3b-33ad-4fb7-8038-807f5acef4ae

📥 Commits

Reviewing files that changed from the base of the PR and between 0c2cf0a and 8b7d608.

📒 Files selected for processing (22)
  • CHANGELOG.md
  • README.md
  • docs/examples/domains/confirm-purchase.md
  • docs/examples/domains/confirm-transfer-in.md
  • docs/examples/functions/create.md
  • docs/examples/functions/update.md
  • docs/examples/sites/create.md
  • docs/examples/sites/update.md
  • package.json
  • src/client.ts
  • src/enums/appwrite-migration-resource.ts
  • src/enums/build-runtime.ts
  • src/enums/domain-purchase-payment-status.ts
  • src/enums/runtime.ts
  • src/enums/runtimes.ts
  • src/index.ts
  • src/models.ts
  • src/services/account.ts
  • src/services/domains.ts
  • src/services/functions.ts
  • src/services/organizations.ts
  • src/services/sites.ts
💤 Files with no reviewable changes (1)
  • CHANGELOG.md

Comment on lines +28 to +30
buildSpecification: '', // optional
runtimeSpecification: '', // optional
deploymentRetention: 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.

⚠️ Potential issue | 🟡 Minor

Avoid destructive literal values in the update example.

For update, '' and 0 are concrete mutations. A copied example can wipe the current specifications/retention instead of leaving them unchanged.

Suggested doc fix
-    buildSpecification: '', // optional
-    runtimeSpecification: '', // optional
-    deploymentRetention: 0 // optional
+    // buildSpecification: '<BUILD_SPECIFICATION>', // optional
+    // runtimeSpecification: '<RUNTIME_SPECIFICATION>', // optional
+    // deploymentRetention: <DEPLOYMENT_RETENTION> // optional
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
buildSpecification: '', // optional
runtimeSpecification: '', // optional
deploymentRetention: 0 // optional
// buildSpecification: '<BUILD_SPECIFICATION>', // optional
// runtimeSpecification: '<RUNTIME_SPECIFICATION>', // optional
// deploymentRetention: <DEPLOYMENT_RETENTION> // optional
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/functions/update.md` around lines 28 - 30, The example uses
concrete destructive literals for update fields (buildSpecification,
runtimeSpecification, deploymentRetention) which can overwrite existing values;
change the example so these optional fields are omitted when not updating (or
set to undefined/null as appropriate for your API) instead of using empty string
'' or 0—remove or comment out the lines for buildSpecification,
runtimeSpecification, and deploymentRetention in the update example so callers
don't accidentally wipe existing specifications/retention.

Comment on lines +29 to +31
buildSpecification: '', // optional
runtimeSpecification: '', // optional
deploymentRetention: 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.

⚠️ Potential issue | 🟡 Minor

Use placeholders or omit these optional fields in the example.

'' and 0 are real values, not placeholders. Copy-pasting this snippet will send concrete settings instead of leaving the optional fields unset.

Suggested doc fix
-    buildSpecification: '', // optional
-    runtimeSpecification: '', // optional
-    deploymentRetention: 0 // optional
+    // buildSpecification: '<BUILD_SPECIFICATION>', // optional
+    // runtimeSpecification: '<RUNTIME_SPECIFICATION>', // optional
+    // deploymentRetention: <DEPLOYMENT_RETENTION> // optional
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
buildSpecification: '', // optional
runtimeSpecification: '', // optional
deploymentRetention: 0 // optional
// buildSpecification: '<BUILD_SPECIFICATION>', // optional
// runtimeSpecification: '<RUNTIME_SPECIFICATION>', // optional
// deploymentRetention: <DEPLOYMENT_RETENTION> // optional
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/sites/create.md` around lines 29 - 31, The example currently
sets optional fields to concrete values (buildSpecification: '',
runtimeSpecification: '', deploymentRetention: 0) which will be interpreted as
real settings; update the snippet to either remove those keys entirely or
replace them with clear placeholders (e.g., "<optional>" or omit) so
copy-pasting does not submit actual empty-string or zero values—look for the
buildSpecification, runtimeSpecification, and deploymentRetention entries in the
create.md example and adjust them accordingly.

Comment on lines +29 to +31
buildSpecification: '', // optional
runtimeSpecification: '', // optional
deploymentRetention: 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.

⚠️ Potential issue | 🟡 Minor

Make the optional update fields copy-paste safe.

These literals send actual values. In an update example, that can unintentionally reset spec fields or retention instead of preserving the existing configuration.

Suggested doc fix
-    buildSpecification: '', // optional
-    runtimeSpecification: '', // optional
-    deploymentRetention: 0 // optional
+    // buildSpecification: '<BUILD_SPECIFICATION>', // optional
+    // runtimeSpecification: '<RUNTIME_SPECIFICATION>', // optional
+    // deploymentRetention: <DEPLOYMENT_RETENTION> // optional
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
buildSpecification: '', // optional
runtimeSpecification: '', // optional
deploymentRetention: 0 // optional
// buildSpecification: '<BUILD_SPECIFICATION>', // optional
// runtimeSpecification: '<RUNTIME_SPECIFICATION>', // optional
// deploymentRetention: <DEPLOYMENT_RETENTION> // optional
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/sites/update.md` around lines 29 - 31, The example uses literal
empty strings and 0 for optional update fields (buildSpecification,
runtimeSpecification, deploymentRetention) which can accidentally overwrite
existing values; change the example to either omit these keys or set them to
undefined (or clearly comment them as "omit to keep existing") so copy-pasting
the example won't reset specs or retention—update the snippet around
buildSpecification, runtimeSpecification, and deploymentRetention to reflect
that behavior.

Comment on lines +998 to +1000
if (data && typeof data === 'object') {
data.toString = () => JSONbig.stringify(data);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n -C3 "responseType\s*=\s*'arrayBuffer'|arrayBuffer\(" src
rg -n -C3 "\[key:\s*string\]\s*:\s*any|DocumentList|Document<|type Payload" src

Repository: appwrite/sdk-for-console

Length of output: 33400


Limit toString assignment to plain JSON objects and define it non-enumerably.

The current code mutates all object responses—including ArrayBuffers from responseType === 'arrayBuffer' paths (line 974)—and overwrites any legitimate toString fields returned by the API or stored in user-controlled document data. Direct property assignment also creates an enumerable own property that leaks into Object.keys() and spread operations. Restrict this to plain objects and use Object.defineProperty with enumerable: false to prevent shape mutations.

Suggested fix
-        if (data && typeof data === 'object') {
-            data.toString = () => JSONbig.stringify(data);
+        if (
+            data &&
+            Object.prototype.toString.call(data) === '[object Object]' &&
+            !Object.prototype.hasOwnProperty.call(data, 'toString')
+        ) {
+            Object.defineProperty(data, 'toString', {
+                value() {
+                    return JSONbig.stringify(this);
+                },
+                enumerable: false,
+            });
+        }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/client.ts` around lines 998 - 1000, The current assignment mutates all
objects by directly setting data.toString, which can overwrite legitimate
properties and makes the property enumerable; change the logic around the data
variable so you only modify plain JSON objects (e.g., check via
Object.prototype.toString.call(data) === '[object Object]' or an isPlainObject
helper) and set the toString as a non-enumerable property using
Object.defineProperty(data, 'toString', { value: () => JSONbig.stringify(data),
writable: true, configurable: true, enumerable: false }); also ensure you skip
this for binary/ArrayBuffer response paths (responseType === 'arrayBuffer') and
for cases where data already has an own non-configurable toString to avoid
throwing.

Comment on lines +6160 to +6175
/**
* Aggregated number of function executions per period.
*/
functionsExecutions: Metric[];
/**
* Total aggregated number of function executions.
*/
functionsExecutionsTotal: number;
/**
* Aggregated number of site executions per period.
*/
sitesExecutions: Metric[];
/**
* Total aggregated number of site executions.
*/
sitesExecutionsTotal: number;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Clarify how functionsExecutions* differs from the existing executions* pair.

Line 6033 still documents executionsTotal as function executions, so after adding functionsExecutionsTotal this type now exposes two totals that appear to mean the same thing. Please either mark the legacy pair as aggregate/deprecated or update the docs so consumers know which pair to read.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/models.ts` around lines 6160 - 6175, The docs currently expose both
executions/executionsTotal and the new
functionsExecutions/functionsExecutionsTotal which look like duplicates; update
the TypeDoc comments to clarify intent by either marking the legacy
executions/executionsTotal pair as deprecated (add a deprecation note) or
explicitly documenting that executions/executionsTotal are legacy/aggregate
across both functions and sites while
functionsExecutions/functionsExecutionsTotal are function-only metrics; apply
the change in the comment blocks that document executions, executionsTotal,
functionsExecutions, and functionsExecutionsTotal so consumers know which pair
to read and prefer the new functions* pair for function-specific counts.

@premtsd-code premtsd-code changed the title feat: Console SDK update for version 4.0.0 feat: Console SDK update for version 4.0.1 Mar 11, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
src/client.ts (1)

998-1000: ⚠️ Potential issue | 🟠 Major

Limit toString assignment to plain JSON objects and define it non-enumerably.

The issues flagged in the previous review remain unaddressed:

  1. ArrayBuffer responses (from line 974's responseType === 'arrayBuffer' path) will have their toString overwritten since typeof ArrayBuffer === 'object'
  2. Any legitimate toString property in API response data gets silently overwritten
  3. Direct property assignment creates an enumerable property that leaks into Object.keys() and spread operations
Suggested fix
-        if (data && typeof data === 'object') {
-            data.toString = () => JSONbig.stringify(data);
+        if (
+            data &&
+            Object.prototype.toString.call(data) === '[object Object]' &&
+            !Object.prototype.hasOwnProperty.call(data, 'toString')
+        ) {
+            Object.defineProperty(data, 'toString', {
+                value() {
+                    return JSONbig.stringify(this);
+                },
+                enumerable: false,
+                configurable: true,
+            });
         }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/client.ts` around lines 998 - 1000, Limit the custom toString only to
plain JSON objects and make it non-enumerable: inside the block handling `data`
(where you currently check `if (data && typeof data === 'object')`) additionally
verify the value is a plain object (e.g., via
Object.prototype.toString.call(data) === '[object Object]' or similar) and that
it does not already have its own `toString` (use
Object.prototype.hasOwnProperty.call). Then create the `toString` using
Object.defineProperty on `data` with a non-enumerable descriptor (enumerable:
false, configurable: true, writable: true) and have it return
JSONbig.stringify(data) so arrays, ArrayBuffers and existing toString
implementations are not overwritten and the property does not leak into
Object.keys()/spreads.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@src/client.ts`:
- Around line 998-1000: Limit the custom toString only to plain JSON objects and
make it non-enumerable: inside the block handling `data` (where you currently
check `if (data && typeof data === 'object')`) additionally verify the value is
a plain object (e.g., via Object.prototype.toString.call(data) === '[object
Object]' or similar) and that it does not already have its own `toString` (use
Object.prototype.hasOwnProperty.call). Then create the `toString` using
Object.defineProperty on `data` with a non-enumerable descriptor (enumerable:
false, configurable: true, writable: true) and have it return
JSONbig.stringify(data) so arrays, ArrayBuffers and existing toString
implementations are not overwritten and the property does not leak into
Object.keys()/spreads.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6ff3f098-8427-47c8-822e-3f39e657510a

📥 Commits

Reviewing files that changed from the base of the PR and between 8b7d608 and 8c9220e.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • package.json
  • src/client.ts
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md

@premtsd-code premtsd-code changed the title feat: Console SDK update for version 4.0.1 feat: Console SDK update for version 5.0.0 Mar 12, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
src/client.ts (1)

998-1000: ⚠️ Potential issue | 🟠 Major

Limit the toString patch to plain JSON objects.

This still mutates every object response, including ArrayBuffer payloads from Line 973, and it can overwrite a real toString field coming back from the API. Direct assignment also makes the helper enumerable, so it leaks into Object.keys() and spread operations.

Suggested fix
-        if (data && typeof data === 'object') {
-            data.toString = () => JSONbig.stringify(data);
-        }
+        if (data && Object.prototype.toString.call(data) === '[object Object]') {
+            const ownToString = Object.getOwnPropertyDescriptor(data, 'toString');
+            if (!ownToString || ownToString.configurable) {
+                Object.defineProperty(data, 'toString', {
+                    value() {
+                        return JSONbig.stringify(this);
+                    },
+                    configurable: true,
+                    writable: true,
+                    enumerable: false,
+                });
+            }
+        }
#!/bin/bash
# Verify affected binary-response paths and existing explicit toString() implementations.
rg -n -C2 "responseType === 'arrayBuffer'|responseType\s*=\s*'arrayBuffer'|arrayBuffer\(" src
rg -n -C2 "toString\(\): string" src
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/client.ts` around lines 998 - 1000, Limit the toString patch to plain
POJOs and add it as a non-enumerable property: check that data is a plain object
(e.g., Object.prototype.toString.call(data) === '[object Object]') and that it
does not already own a toString property (use
Object.prototype.hasOwnProperty.call(data, 'toString')), then use
Object.defineProperty(data, 'toString', { value: () => JSONbig.stringify(data),
enumerable: false, writable: false, configurable: true }) so you don't mutate
ArrayBuffer/binary responses, overwrite an existing toString implementation, or
leak the helper into Object.keys()/spreads.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@CHANGELOG.md`:
- Around line 5-6: Update the CHANGELOG entry to correct the breaking-change
note: replace the incorrect reference to `specification` with the new request
shape `buildSpecification` and `runtimeSpecification`, and clarify that
Functions and Sites now require those two parameters and support
`deploymentRetention`; update the first bullet so it reads that Functions and
Sites require `buildSpecification`/`runtimeSpecification` (not `specification`)
and mention `deploymentRetention` support.

---

Duplicate comments:
In `@src/client.ts`:
- Around line 998-1000: Limit the toString patch to plain POJOs and add it as a
non-enumerable property: check that data is a plain object (e.g.,
Object.prototype.toString.call(data) === '[object Object]') and that it does not
already own a toString property (use Object.prototype.hasOwnProperty.call(data,
'toString')), then use Object.defineProperty(data, 'toString', { value: () =>
JSONbig.stringify(data), enumerable: false, writable: false, configurable: true
}) so you don't mutate ArrayBuffer/binary responses, overwrite an existing
toString implementation, or leak the helper into Object.keys()/spreads.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 77da7c35-a9fe-4e4a-938e-5c633f1ecd6d

📥 Commits

Reviewing files that changed from the base of the PR and between 8c9220e and 001713a.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • package.json
  • src/client.ts
✅ Files skipped from review due to trivial changes (1)
  • package.json

Comment on lines +5 to +6
* Breaking: Functions and Sites now require `specification` parameter and support `deploymentRetention`
* Breaking: New `buildSpecification` and `runtimeSpecification` parameters for functions
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix the breaking-change note for specification.

The first bullet says Functions and Sites now require specification, but this PR's API changes replace that surface with buildSpecification / runtimeSpecification. Leaving specification in the 5.0.0 notes will send upgraders to the wrong request shape.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHANGELOG.md` around lines 5 - 6, Update the CHANGELOG entry to correct the
breaking-change note: replace the incorrect reference to `specification` with
the new request shape `buildSpecification` and `runtimeSpecification`, and
clarify that Functions and Sites now require those two parameters and support
`deploymentRetention`; update the first bullet so it reads that Functions and
Sites require `buildSpecification`/`runtimeSpecification` (not `specification`)
and mention `deploymentRetention` support.

@premtsd-code premtsd-code merged commit 7e26de1 into main Mar 12, 2026
1 check passed
@premtsd-code premtsd-code deleted the dev branch March 12, 2026 06:53
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