Skip to content

feat: add all missing SDK methods for full API coverage#33

Open
Divyansha23 wants to merge 3 commits intomasterfrom
feat/add-missing-sdk-methods
Open

feat: add all missing SDK methods for full API coverage#33
Divyansha23 wants to merge 3 commits intomasterfrom
feat/add-missing-sdk-methods

Conversation

@Divyansha23
Copy link
Contributor

@Divyansha23 Divyansha23 commented Mar 11, 2026

  • Modernized all API calls to use latest object-based parameter syntax

Databases:

  • Added all attribute types: boolean, float, datetime, email, enum, IP, URL, point, line, polygon
  • Added getAttribute, update/delete for all attribute types (including geo/spatial)
  • Added getIndex, deleteIndex
  • Added bulk operations: createDocuments, upsertDocument, upsertDocuments, updateDocuments, deleteDocuments
  • Added atomic operations: incrementDocumentAttribute, decrementDocumentAttribute
  • Added relationship attributes: createRelationshipAttribute, updateRelationshipAttribute

TablesDB:

  • Added full CRUD: create/list/get/update databases, tables, columns, indexes, rows
  • Added all column types: string, integer, float, boolean, datetime, email, enum, IP, URL, point, line, polygon
  • Added update methods for all column types
  • Added bulk row operations: createRows, upsertRow, upsertRows, updateRows, deleteRows
  • Added atomic row operations: incrementRowColumn, decrementRowColumn
  • Added TablesDB transactions: createTransaction, getTransaction, listTransactions, createOperations, updateTransaction (commit/rollback), deleteTransaction
  • Added deleteColumn, deleteIndex, deleteTable, deleteDatabase

Storage:

  • Added getFileDownload, getFilePreview, getFileView

Functions:

  • Added listRuntimes, listSpecifications
  • Added deleteDeployment, deleteExecution, getDeploymentDownload
  • Added updateFunctionDeployment, updateDeploymentStatus
  • Added createDuplicateDeployment, createTemplateDeployment, createVcsDeployment

Users:

  • Added updateEmail, updatePassword, updatePhone, updateStatus, updateLabels
  • Added listLogs, listMemberships, listSessions, createSession, deleteSessions
  • Added updateEmailVerification, updatePhoneVerification
  • Added listIdentities, deleteIdentity
  • Added MFA methods: updateMFA, listMFAFactors, createMFARecoveryCodes, getMFARecoveryCodes, updateMFARecoveryCodes, deleteMFAAuthenticator
  • Added legacy MFA aliases (lowercase variants)
  • Added targets: createTarget, getTarget, listTargets, updateTarget, deleteTarget
  • Added createJWT, createToken
  • Added hash-based user creation: createArgon2User, createBcryptUser, createMD5User, createSHAUser, createPHPassUser, createScryptUser, createScryptModifiedUser

Bug fixes:

  • Fixed updateDatetimeAttribute/Column requiring xdefault parameter
  • Fixed bulk document structure (fields at top level, not nested in data)
  • Fixed createOperations using documentId instead of $id
  • Fixed user labels to use alphanumeric-only values
  • Wrapped scope-restricted APIs (listRuntimes, listSpecifications, account.get) in try/catch

What does this PR do?

(Provide a description of what this PR does.)

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

Summary by CodeRabbit

  • New Features
    • Expanded database toolkit: richer attribute/index types, bulk document operations and full transaction support
    • Enhanced TablesDB: column/row operations, relationship demos and multi-step transactional flows
    • Storage lifecycle: bucket and file management plus preview/download flows
    • User management: extensive lifecycle, identity/MFA, and token/JWT creation flows
    • Functions: runtime/spec and deployment management, extended execution flows
    • Orchestration: unified sequencing of end-to-end playground flows across services

- Modernized all API calls to use latest object-based parameter syntax
- Refactored config to use environment variables (APPWRITE_ENDPOINT, APPWRITE_PROJECT_ID, APPWRITE_API_KEY)

Databases:
- Added all attribute types: boolean, float, datetime, email, enum, IP, URL, point, line, polygon
- Added getAttribute, update/delete for all attribute types (including geo/spatial)
- Added getIndex, deleteIndex
- Added bulk operations: createDocuments, upsertDocument, upsertDocuments, updateDocuments, deleteDocuments
- Added atomic operations: incrementDocumentAttribute, decrementDocumentAttribute
- Added relationship attributes: createRelationshipAttribute, updateRelationshipAttribute
- Added transactions API: createTransaction, getTransaction, listTransactions, createOperations, updateTransaction (commit/rollback), deleteTransaction

TablesDB:
- Added full CRUD: create/list/get/update databases, tables, columns, indexes, rows
- Added all column types: string, integer, float, boolean, datetime, email, enum, IP, URL, point, line, polygon
- Added update methods for all column types
- Added bulk row operations: createRows, upsertRow, upsertRows, updateRows, deleteRows
- Added atomic row operations: incrementRowColumn, decrementRowColumn
- Added TablesDB transactions: createTransaction, getTransaction, listTransactions, createOperations, updateTransaction (commit/rollback), deleteTransaction
- Added deleteColumn, deleteIndex, deleteTable, deleteDatabase

Storage:
- Added getFileDownload, getFilePreview, getFileView

Functions:
- Added listRuntimes, listSpecifications
- Added deleteDeployment, deleteExecution, getDeploymentDownload
- Added updateFunctionDeployment, updateDeploymentStatus
- Added createDuplicateDeployment, createTemplateDeployment, createVcsDeployment

Users:
- Added updateEmail, updatePassword, updatePhone, updateStatus, updateLabels
- Added listLogs, listMemberships, listSessions, createSession, deleteSessions
- Added updateEmailVerification, updatePhoneVerification
- Added listIdentities, deleteIdentity
- Added MFA methods: updateMFA, listMFAFactors, createMFARecoveryCodes, getMFARecoveryCodes, updateMFARecoveryCodes, deleteMFAAuthenticator
- Added legacy MFA aliases (lowercase variants)
- Added targets: createTarget, getTarget, listTargets, updateTarget, deleteTarget
- Added createJWT, createToken
- Added hash-based user creation: createArgon2User, createBcryptUser, createMD5User, createSHAUser, createPHPassUser, createScryptUser, createScryptModifiedUser

Bug fixes:
- Fixed updateDatetimeAttribute/Column requiring xdefault parameter
- Fixed bulk document structure (fields at top level, not nested in data)
- Fixed createOperations using documentId instead of $id
- Fixed user labels to use alphanumeric-only values
- Wrapped scope-restricted APIs (listRuntimes, listSpecifications, account.get) in try/catch
@Divyansha23 Divyansha23 requested a review from stnguyen90 March 11, 2026 04:46
@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

Walkthrough

The PR significantly expands the Playground: it adds three imports (RelationshipType, RelationMutate, MessagingProviderType), introduces four new globals (secondCollectionId, secondDocumentId, identityId, targetId), and injects a large suite of API handlers across Databases, TablesDB, Storage, Users, and Functions (CRUD, bulk operations, transactions, relationships, targets/JWTs, bucket/file lifecycle, runtimes/specs/deployments). The runAllTasks orchestration is updated to sequence these new calls into comprehensive end-to-end flows.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 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.
Title check ✅ Passed The title 'feat: add all missing SDK methods for full API coverage' directly and accurately summarizes the main change: the PR adds comprehensive SDK method coverage across multiple API domains (Databases, TablesDB, Storage, Functions, Users/Auth).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 feat/add-missing-sdk-methods

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

@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

🧹 Nitpick comments (1)
src/app.js (1)

37-37: Unused variable identityId.

This variable is declared but never assigned or used anywhere in the file. Consider removing it to avoid confusion.

🧹 Proposed fix
 let secondCollectionId;
 let secondDocumentId;
-let identityId;
 let targetId;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/app.js` at line 37, Remove the unused variable declaration identityId
from the top-level of src/app.js; locate the standalone declaration "let
identityId;" (no other references) and delete it so there is no unused variable
left declared but never assigned or used.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/app.js`:
- Around line 1102-1108: The log message inside getAccount() is incorrect (it
says "Running List Users API")—update the console.log to a correct, descriptive
message for this function (e.g., "Running Get Account API" or "Running
account.get()") so it matches the operation performed by account.get(); locate
the getAccount function and replace the incorrect string in the console.log
call.

---

Nitpick comments:
In `@src/app.js`:
- Line 37: Remove the unused variable declaration identityId from the top-level
of src/app.js; locate the standalone declaration "let identityId;" (no other
references) and delete it so there is no unused variable left declared but never
assigned or used.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d2679de1-1c1d-48a2-ab55-46270293a41b

📥 Commits

Reviewing files that changed from the base of the PR and between 457da5e and 6b49bd3.

📒 Files selected for processing (1)
  • src/app.js

changed log message

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link

@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

🧹 Nitpick comments (1)
src/app.js (1)

35-38: identityId is declared but never assigned.

The global variable identityId is declared on line 37 but is never assigned a value anywhere in the code. The listUserIdentities and deleteUserIdentity functions (lines 1297-1326) don't use this global variable - they fetch identities directly within the function scope.

Consider either:

  1. Removing the unused declaration
  2. Using it in listUserIdentities to store an identity ID for later use
♻️ Proposed fix to remove unused variable
 let secondCollectionId;
 let secondDocumentId;
-let identityId;
 let targetId;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/app.js` around lines 35 - 38, Remove the unused top-level variable
identityId (declared alongside secondCollectionId/secondDocumentId) or, if it
was intended to persist a selected identity, assign it inside listUserIdentities
by setting identityId = <the chosen identity id> after fetching identities and
then use that global in deleteUserIdentity; update references in
listUserIdentities and deleteUserIdentity accordingly so the variable is either
removed or actually assigned and consumed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/app.js`:
- Line 593: The assignment to documentId from response.documents[0].$id is
unsafe if the bulk create returns an empty or undefined documents array; update
the code that sets documentId to first verify response &&
Array.isArray(response.documents) && response.documents.length > 0 before
accessing [0].$id, and in the empty/invalid case handle it explicitly (e.g., log
an error via your logger, throw a descriptive error, or return an early failure
response) so downstream code doesn't hit a null reference; look for the
documentId assignment and surrounding response handling to implement this guard.

---

Nitpick comments:
In `@src/app.js`:
- Around line 35-38: Remove the unused top-level variable identityId (declared
alongside secondCollectionId/secondDocumentId) or, if it was intended to persist
a selected identity, assign it inside listUserIdentities by setting identityId =
<the chosen identity id> after fetching identities and then use that global in
deleteUserIdentity; update references in listUserIdentities and
deleteUserIdentity accordingly so the variable is either removed or actually
assigned and consumed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e5e08659-94c5-407b-8bd5-056809906194

📥 Commits

Reviewing files that changed from the base of the PR and between 6b49bd3 and 9e275d8.

📒 Files selected for processing (1)
  • src/app.js

Copy link

@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.

🧹 Nitpick comments (1)
src/app.js (1)

1637-1711: Static analysis false positives - example password hashes, not secrets.

Gitleaks flagged lines 1644, 1678, 1700, and 1703 as "Generic API Key" detections. These are actually well-known example password hashes used to demonstrate hash-based user creation APIs:

  • Line 1644: SHA1 hash of "hello"
  • Line 1678: Example Scrypt hash
  • Lines 1700, 1703: Example Scrypt Modified parameters

Since this is a playground/demo repository, these hardcoded examples are intentional for illustrating the SDK's hash import capabilities. Consider adding a brief comment to clarify these are demo values, which may help suppress future static analysis warnings.

📝 Optional: Add clarifying comment
+// Note: The password hashes below are well-known example hashes used for demonstration purposes only.
+// They are NOT real secrets - e.g., the SHA1 hash is the hash of "hello".
 const createSHAUser = async () => {
     console.log(chalk.greenBright('Running Create SHA User API'));
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/app.js` around lines 1637 - 1711, These hardcoded password/hash strings
in createSHAUser, createPHPassUser, createScryptUser, and
createScryptModifiedUser are intentional demo/example values causing static
analysis false positives; add a short clarifying comment immediately above each
password/passwordSalt/passwordSignerKey property (or above the call in each
function) stating these are non-sensitive example hashes used for
playground/demo purposes (optionally include a gitleaks suppression tag if your
linter supports it) so future reviewers and automated scanners understand they
are safe.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/app.js`:
- Around line 1637-1711: These hardcoded password/hash strings in createSHAUser,
createPHPassUser, createScryptUser, and createScryptModifiedUser are intentional
demo/example values causing static analysis false positives; add a short
clarifying comment immediately above each
password/passwordSalt/passwordSignerKey property (or above the call in each
function) stating these are non-sensitive example hashes used for
playground/demo purposes (optionally include a gitleaks suppression tag if your
linter supports it) so future reviewers and automated scanners understand they
are safe.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 57f55be1-8ff4-45e9-ba43-ab103bf7af27

📥 Commits

Reviewing files that changed from the base of the PR and between 9e275d8 and 625e1a5.

📒 Files selected for processing (1)
  • src/app.js

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