-
Notifications
You must be signed in to change notification settings - Fork 44
Add time between queries #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Warning Rate limit exceeded@abnegate has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 26 minutes and 56 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (21)
WalkthroughThis release updates SDK versioning to 18.1.0 and adds geometry support. New Databases APIs create/update Line attributes; TablesDB gains create/update APIs for Point, Line, and Polygon columns with overloads. Models introduce corresponding Attribute/Column types and mark certain identifiers as readonly. Query adds createdBetween and updatedBetween. Enums change: CreditCard renames UnionChinaPay to UnionPay; ExecutionMethod adds HEAD; IndexType adds Spatial. Databases document mutations stop stripping $sequence, $collectionId/$tableId, and $databaseId. Documentation examples are added for the new APIs. JSDoc text updates appear in Account, Functions, and Avatars. ✨ Finishing Touches
🧪 Generate unit tests
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 18
🧹 Nitpick comments (24)
src/client.ts (1)
36-36
: Deduplicate SDK version to avoid driftDefine a single SDK_VERSION constant and reuse it for UA and x-sdk-version.
Apply within the shown lines:
- let ua = 'AppwriteNodeJSSDK/18.1.0'; + let ua = `AppwriteNodeJSSDK/${SDK_VERSION}`;- 'x-sdk-version': '18.1.0', + 'x-sdk-version': SDK_VERSION,Add this near the top of the file (outside the shown ranges):
const SDK_VERSION = '18.1.0';Also applies to: 85-85
src/services/functions.ts (1)
1378-1379
: JSDoc default changed to POST — verify server default and consider setting explicitlyDocs say default is POST, but the SDK only forwards
method
when provided. If the server still defaults to GET, this would diverge.Optional explicit default (if server default is POST):
- if (typeof method !== 'undefined') { - payload['method'] = method; - } + payload['method'] = method ?? ExecutionMethod.POST;Please confirm the backend default before merging.
Also applies to: 1392-1393
src/services/account.ts (2)
1753-1755
: Good deprecation note; also update positional overload JSDoc for clarity.Positional overload below still only mentions “object parameter style” deprecation. Mirror the stronger note (“deprecated since 1.6.0… use Account.createSession”) to avoid mixed signals.
- * @deprecated Use the object parameter style method for a better developer experience. + * @deprecated This API has been deprecated since 1.6.0. Please use `Account.createSession` instead.
1820-1822
: Same here for updatePhoneSession positional overload.Replicate the stronger deprecation text on the positional overload’s JSDoc.
- * @deprecated Use the object parameter style method for a better developer experience. + * @deprecated This API has been deprecated since 1.6.0. Please use `Account.createSession` instead.src/query.ts (2)
314-323
: Add inclusivity and format to JSDoc.Clarify that the range is inclusive and expects ISO 8601 strings, matching
between(...)
semantics.- /** - * Filter resources where document was created between dates. + /** + * Filter resources where document was created between dates (inclusive). + * Expects ISO 8601 date-time strings.
342-351
: Mirror JSDoc clarity for updatedBetween.Keep docs consistent with
createdBetween
.- /** - * Filter resources where document was updated between dates. + /** + * Filter resources where document was updated between dates (inclusive). + * Expects ISO 8601 date-time strings.src/models.ts (6)
1076-1116
: Document expected GeoJSON shape for geometry defaults.Type is
object
; add brief JSDoc to guide users on expected GeoJSON fordefault
./** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Default value for attribute when not provided. Cannot be set when attribute is required. + * GeoJSON Point, for example: { type: "Point", coordinates: [longitude, latitude] } */ default?: object;
1120-1159
: Same guidance for AttributeLine./** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Default value for attribute when not provided. Cannot be set when attribute is required. + * GeoJSON LineString, e.g.: { type: "LineString", coordinates: [[lon,lat],[lon,lat], ...] } */ default?: object;
1161-1200
: Same guidance for AttributePolygon./** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Default value for attribute when not provided. Cannot be set when attribute is required. + * GeoJSON Polygon, e.g.: { type: "Polygon", coordinates: [[[lon,lat], ... , [lon,lat]]] } */ default?: object;
1750-1790
: Columns: add GeoJSON hints for default Point./** - * Default value for column when not provided. Cannot be set when column is required. + * Default value for column when not provided. Cannot be set when column is required. + * GeoJSON Point. */ default?: object;
1792-1833
: Columns: add GeoJSON hints for default LineString./** - * Default value for column when not provided. Cannot be set when column is required. + * Default value for column when not provided. Cannot be set when column is required. + * GeoJSON LineString. */ default?: object;
1834-1875
: Columns: add GeoJSON hints for default Polygon./** - * Default value for column when not provided. Cannot be set when column is required. + * Default value for column when not provided. Cannot be set when column is required. + * GeoJSON Polygon. */ default?: object;src/services/databases.ts (1)
2197-2735
: Reduce duplication across geometry attribute methods.
create{Point|Line|Polygon}Attribute
andupdate{Point|Line|Polygon}Attribute
are nearly identical except for the resource segment. Consider a small private helper to assemble path/payload to DRY this area. Keep the public surface unchanged.src/services/tables-db.ts (7)
2177-2179
: Clarify xdefault type in JSDoc (allow object or JSON string).The model’s default is an object; JSDoc currently implies string only.
- * @param {string} params.xdefault - Default value for column when not provided, as JSON string. Cannot be set when column is required. + * @param {object|string} params.xdefault - Default value for the column when not provided (GeoJSON object or JSON string). Cannot be set when column is required.
2181-2211
: Broaden xdefault type to accept object or string.Current type enforces string, which is too restrictive vs Models.ColumnLine.default (object). Accept object|string and pass through unchanged.
- createLineColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string }): Promise<Models.ColumnLine>; + createLineColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: Record<string, any> | string }): Promise<Models.ColumnLine>; - createLineColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string): Promise<Models.ColumnLine>; + createLineColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: Record<string, any> | string): Promise<Models.ColumnLine>; - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: Record<string, any> | string };
2269-2301
: Broaden xdefault type to accept object or string.Align with model and creation method.
- updateLineColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, newKey?: string }): Promise<Models.ColumnLine>; + updateLineColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: Record<string, any> | string, newKey?: string }): Promise<Models.ColumnLine>; - updateLineColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.ColumnLine>; + updateLineColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: Record<string, any> | string, newKey?: string): Promise<Models.ColumnLine>; - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, newKey?: string }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: Record<string, any> | string, newKey?: string };
2355-2357
: Broaden Point xdefault type; update JSDoc.- * @param {string} params.xdefault - Default value for column when not provided, as JSON string. Cannot be set when column is required. + * @param {object|string} params.xdefault - Default value (GeoJSON object or JSON string). Cannot be set when column is required.- createPointColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string }): Promise<Models.ColumnPoint>; + createPointColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: Record<string, any> | string }): Promise<Models.ColumnPoint>; - createPointColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string): Promise<Models.ColumnPoint>; + createPointColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: Record<string, any> | string): Promise<Models.ColumnPoint>; - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: Record<string, any> | string };Also applies to: 2374-2381
2463-2470
: Broaden Point xdefault type.- updatePointColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, newKey?: string }): Promise<Models.ColumnPoint>; + updatePointColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: Record<string, any> | string, newKey?: string }): Promise<Models.ColumnPoint>; - updatePointColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.ColumnPoint>; + updatePointColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: Record<string, any> | string, newKey?: string): Promise<Models.ColumnPoint>; - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, newKey?: string }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: Record<string, any> | string, newKey?: string };Also applies to: 2466-2479
2533-2535
: Broaden Polygon xdefault type; update JSDoc.- * @param {string} params.xdefault - Default value for column when not provided, as JSON string. Cannot be set when column is required. + * @param {object|string} params.xdefault - Default value (GeoJSON object or JSON string). Cannot be set when column is required.- createPolygonColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string }): Promise<Models.ColumnPolygon>; + createPolygonColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: Record<string, any> | string }): Promise<Models.ColumnPolygon>; - createPolygonColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string): Promise<Models.ColumnPolygon>; + createPolygonColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: Record<string, any> | string): Promise<Models.ColumnPolygon>; - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: Record<string, any> | string };Also applies to: 2550-2556
2641-2648
: Broaden Polygon xdefault type.- updatePolygonColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, newKey?: string }): Promise<Models.ColumnPolygon>; + updatePolygonColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: Record<string, any> | string, newKey?: string }): Promise<Models.ColumnPolygon>; - updatePolygonColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.ColumnPolygon>; + updatePolygonColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: Record<string, any> | string, newKey?: string): Promise<Models.ColumnPolygon>; - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, newKey?: string }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: Record<string, any> | string, newKey?: string };Also applies to: 2644-2656
docs/examples/tablesdb/update-line-column.md (1)
1-17
: Optional: show ESM variant for users on import syntax.Consider adding an import example if the docs elsewhere default to ESM.
I can draft an ESM snippet mirroring this one if helpful.
docs/examples/tablesdb/update-point-column.md (1)
10-17
: Clarify placeholders and validatedefault
type for Point.- key: '', + key: '<COLUMN_KEY>', required: false, - default: '', // optional - newKey: '' // optional + default: '<DEFAULT_POINT>', // optional; confirm expected format + newKey: '<NEW_COLUMN_KEY>' // optionaldocs/examples/tablesdb/create-point-column.md (1)
10-16
: Improve placeholders and consider logging result for copy‑paste usability.- key: '', + key: '<COLUMN_KEY>', required: false, - default: '' // optional + default: '<DEFAULT_POINT>' // optional; confirm expected format }); +console.log(result);docs/examples/tablesdb/create-line-column.md (1)
10-16
: Placeholders and default value type.Ensure the
default
for a Line column is documented with the expected format; avoid empty-string placeholders.- key: '', + key: '<COLUMN_KEY>', required: false, - default: '' // optional + default: '<DEFAULT_LINE>' // optional; confirm expected format });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (24)
docs/examples/databases/create-line-attribute.md
(1 hunks)docs/examples/databases/create-point-attribute.md
(1 hunks)docs/examples/databases/create-polygon-attribute.md
(1 hunks)docs/examples/databases/update-line-attribute.md
(1 hunks)docs/examples/databases/update-point-attribute.md
(1 hunks)docs/examples/databases/update-polygon-attribute.md
(1 hunks)docs/examples/tablesdb/create-line-column.md
(1 hunks)docs/examples/tablesdb/create-point-column.md
(1 hunks)docs/examples/tablesdb/create-polygon-column.md
(1 hunks)docs/examples/tablesdb/update-line-column.md
(1 hunks)docs/examples/tablesdb/update-point-column.md
(1 hunks)docs/examples/tablesdb/update-polygon-column.md
(1 hunks)package.json
(1 hunks)src/client.ts
(2 hunks)src/enums/credit-card.ts
(1 hunks)src/enums/execution-method.ts
(1 hunks)src/enums/index-type.ts
(1 hunks)src/models.ts
(8 hunks)src/query.ts
(2 hunks)src/services/account.ts
(2 hunks)src/services/avatars.ts
(2 hunks)src/services/databases.ts
(2 hunks)src/services/functions.ts
(2 hunks)src/services/tables-db.ts
(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
src/query.ts (2)
src/client.ts (2)
Query
(387-387)QueryTypesList
(389-389)src/index.ts (2)
Query
(1-1)QueryTypesList
(17-17)
src/services/databases.ts (1)
src/models.ts (3)
AttributeLine
(1121-1158)AttributePoint
(1079-1116)AttributePolygon
(1163-1200)
src/models.ts (2)
src/client.ts (1)
Models
(388-388)src/index.ts (1)
Models
(16-16)
src/services/tables-db.ts (3)
src/client.ts (3)
Models
(388-388)AppwriteException
(386-386)Payload
(388-388)src/index.ts (3)
Models
(16-16)AppwriteException
(1-1)Payload
(16-16)src/models.ts (3)
ColumnLine
(1795-1832)ColumnPoint
(1753-1790)ColumnPolygon
(1837-1874)
🪛 LanguageTool
docs/examples/tablesdb/update-polygon-column.md
[grammar] ~3-~3: There might be a mistake here.
Context: ...rite'); const client = new sdk.Client() .setEndpoint('https://.cloud.app...
(QB_NEW_EN)
[grammar] ~4-~4: There might be a mistake here.
Context: ...ud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your...
(QB_NEW_EN)
[grammar] ~5-~5: There might be a mistake here.
Context: ...('<YOUR_PROJECT_ID>') // Your project ID .setKey('<YOUR_API_KEY>'); // Your secre...
(QB_NEW_EN)
docs/examples/tablesdb/update-point-column.md
[grammar] ~3-~3: There might be a mistake here.
Context: ...rite'); const client = new sdk.Client() .setEndpoint('https://.cloud.app...
(QB_NEW_EN)
[grammar] ~4-~4: There might be a mistake here.
Context: ...ud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your...
(QB_NEW_EN)
[grammar] ~5-~5: There might be a mistake here.
Context: ...('<YOUR_PROJECT_ID>') // Your project ID .setKey('<YOUR_API_KEY>'); // Your secre...
(QB_NEW_EN)
docs/examples/databases/create-line-attribute.md
[grammar] ~3-~3: There might be a mistake here.
Context: ...rite'); const client = new sdk.Client() .setEndpoint('https://.cloud.app...
(QB_NEW_EN)
[grammar] ~4-~4: There might be a mistake here.
Context: ...ud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your...
(QB_NEW_EN)
[grammar] ~5-~5: There might be a mistake here.
Context: ...('<YOUR_PROJECT_ID>') // Your project ID .setKey('<YOUR_API_KEY>'); // Your secre...
(QB_NEW_EN)
docs/examples/databases/update-polygon-attribute.md
[grammar] ~3-~3: There might be a mistake here.
Context: ...rite'); const client = new sdk.Client() .setEndpoint('https://.cloud.app...
(QB_NEW_EN)
[grammar] ~4-~4: There might be a mistake here.
Context: ...ud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your...
(QB_NEW_EN)
[grammar] ~5-~5: There might be a mistake here.
Context: ...('<YOUR_PROJECT_ID>') // Your project ID .setKey('<YOUR_API_KEY>'); // Your secre...
(QB_NEW_EN)
docs/examples/tablesdb/create-point-column.md
[grammar] ~3-~3: There might be a mistake here.
Context: ...rite'); const client = new sdk.Client() .setEndpoint('https://.cloud.app...
(QB_NEW_EN)
[grammar] ~4-~4: There might be a mistake here.
Context: ...ud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your...
(QB_NEW_EN)
[grammar] ~5-~5: There might be a mistake here.
Context: ...('<YOUR_PROJECT_ID>') // Your project ID .setKey('<YOUR_API_KEY>'); // Your secre...
(QB_NEW_EN)
docs/examples/tablesdb/create-line-column.md
[grammar] ~3-~3: There might be a mistake here.
Context: ...rite'); const client = new sdk.Client() .setEndpoint('https://.cloud.app...
(QB_NEW_EN)
[grammar] ~4-~4: There might be a mistake here.
Context: ...ud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your...
(QB_NEW_EN)
[grammar] ~5-~5: There might be a mistake here.
Context: ...('<YOUR_PROJECT_ID>') // Your project ID .setKey('<YOUR_API_KEY>'); // Your secre...
(QB_NEW_EN)
docs/examples/tablesdb/create-polygon-column.md
[grammar] ~3-~3: There might be a mistake here.
Context: ...rite'); const client = new sdk.Client() .setEndpoint('https://.cloud.app...
(QB_NEW_EN)
[grammar] ~4-~4: There might be a mistake here.
Context: ...ud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your...
(QB_NEW_EN)
[grammar] ~5-~5: There might be a mistake here.
Context: ...('<YOUR_PROJECT_ID>') // Your project ID .setKey('<YOUR_API_KEY>'); // Your secre...
(QB_NEW_EN)
docs/examples/databases/update-line-attribute.md
[grammar] ~3-~3: There might be a mistake here.
Context: ...rite'); const client = new sdk.Client() .setEndpoint('https://.cloud.app...
(QB_NEW_EN)
[grammar] ~4-~4: There might be a mistake here.
Context: ...ud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your...
(QB_NEW_EN)
[grammar] ~5-~5: There might be a mistake here.
Context: ...('<YOUR_PROJECT_ID>') // Your project ID .setKey('<YOUR_API_KEY>'); // Your secre...
(QB_NEW_EN)
docs/examples/databases/create-point-attribute.md
[grammar] ~3-~3: There might be a mistake here.
Context: ...rite'); const client = new sdk.Client() .setEndpoint('https://.cloud.app...
(QB_NEW_EN)
[grammar] ~4-~4: There might be a mistake here.
Context: ...ud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your...
(QB_NEW_EN)
[grammar] ~5-~5: There might be a mistake here.
Context: ...('<YOUR_PROJECT_ID>') // Your project ID .setKey('<YOUR_API_KEY>'); // Your secre...
(QB_NEW_EN)
docs/examples/databases/create-polygon-attribute.md
[grammar] ~3-~3: There might be a mistake here.
Context: ...rite'); const client = new sdk.Client() .setEndpoint('https://.cloud.app...
(QB_NEW_EN)
[grammar] ~4-~4: There might be a mistake here.
Context: ...ud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your...
(QB_NEW_EN)
[grammar] ~5-~5: There might be a mistake here.
Context: ...('<YOUR_PROJECT_ID>') // Your project ID .setKey('<YOUR_API_KEY>'); // Your secre...
(QB_NEW_EN)
docs/examples/databases/update-point-attribute.md
[grammar] ~3-~3: There might be a mistake here.
Context: ...rite'); const client = new sdk.Client() .setEndpoint('https://.cloud.app...
(QB_NEW_EN)
[grammar] ~4-~4: There might be a mistake here.
Context: ...ud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your...
(QB_NEW_EN)
[grammar] ~5-~5: There might be a mistake here.
Context: ...('<YOUR_PROJECT_ID>') // Your project ID .setKey('<YOUR_API_KEY>'); // Your secre...
(QB_NEW_EN)
docs/examples/tablesdb/update-line-column.md
[grammar] ~3-~3: There might be a mistake here.
Context: ...rite'); const client = new sdk.Client() .setEndpoint('https://.cloud.app...
(QB_NEW_EN)
[grammar] ~4-~4: There might be a mistake here.
Context: ...ud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your...
(QB_NEW_EN)
[grammar] ~5-~5: There might be a mistake here.
Context: ...('<YOUR_PROJECT_ID>') // Your project ID .setKey('<YOUR_API_KEY>'); // Your secre...
(QB_NEW_EN)
🔇 Additional comments (24)
src/enums/index-type.ts (1)
5-5
: Add Spatial index type — looks goodAdditive enum member; no breaking change anticipated.
src/enums/execution-method.ts (1)
8-8
: HEAD method addition — OKConsistent casing and aligns with typical HTTP verbs.
package.json (1)
5-5
: Version bump to 18.1.0 — alignedMatches client header/UA changes in src/client.ts.
src/enums/credit-card.ts (1)
14-19
: Confirm backward-compatibility requirement forUnionChinaPay
alias
Search found no internal usages ofUnionChinaPay
or"union-china-pay"
. If this alias was ever part of a released public API, reintroduce it (marked deprecated) to avoid breaking consumers; otherwise it can be safely omitted.src/services/avatars.ts (2)
99-105
: Docs updated to unionpay — LGTM.Matches enum change; no runtime impact.
113-121
: LGTM — no remaining references to old enum value
Search returned no matches forunionChinaPay
/union-china-pay
.docs/examples/databases/create-polygon-attribute.md (1)
10-16
: databases.createPolygonAttribute supports the object‐style overload as shown; no change needed.docs/examples/databases/update-point-attribute.md (1)
10-17
: Object-parameter overload forupdatePointAttribute
confirmed; docs snippet is correct.src/models.ts (5)
567-567
: Union updated to include geometry attribute types — LGTM.
585-585
: AttributesList union expanded with geometry types — LGTM.
1241-1241
: Tables: columns union includes geometry — LGTM.
1259-1259
: ColumnList union includes geometry — LGTM.
1979-1987
: Readonly on system fields is a potential TS breaking change — call out in release notes.Marking
$sequence
,$tableId
,$databaseId
, and$collectionId
asreadonly
is correct but may break user code that mutated these fields. Flag in CHANGELOG and PR notes.Also applies to: 2018-2026
src/services/databases.ts (7)
84-84
: Deprecation note updated correctly.Reference to
TablesDB.create
is accurate and consistent with the new TablesDB surface.
2197-2283
: New API: createLineAttribute looks correct.Validates required params, maps
xdefault
→ payloaddefault
, correct path, headers, and return type (Models.AttributeLine
).
2285-2375
: New API: updateLineAttribute looks correct.Accepts optional
xdefault
/newKey
, uses PATCH, and builds payload as expected.
2377-2463
: New API: createPointAttribute looks correct.Same pattern as other attribute creators; payload mapping and validation are sound.
2465-2555
: New API: updatePointAttribute looks correct.Parameter handling and payload fields are consistent with the SDK conventions.
2557-2643
: New API: createPolygonAttribute looks correct.Parameter validation and payload generation are in line with other attribute creators.
2645-2735
: New API: updatePolygonAttribute looks correct.PATCH path and optional
xdefault
/newKey
handling are consistent.docs/examples/databases/create-point-attribute.md (1)
10-16
: Fix: top‑level await with CommonJS and wrong param name (default
).
- Wrap in async IIFE.
- Use
xdefault
with a JSON string for Point.- Provide a non-empty attribute key.
Apply:
-const result = await databases.createPointAttribute({ - databaseId: '<DATABASE_ID>', - collectionId: '<COLLECTION_ID>', - key: '', - required: false, - default: '' // optional -}); +(async () => { + const result = await databases.createPointAttribute({ + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + key: '<ATTRIBUTE_KEY>', + required: false, + xdefault: JSON.stringify({ type: 'Point', coordinates: [12.34, 56.78] }) // optional + }); + console.log(result); +})().catch(console.error);Likely an incorrect or invalid review comment.
docs/examples/databases/update-line-attribute.md (1)
3-6
: Wrap top-level await in an async IIFE and confirmxdefault
name
- CommonJS modules can’t use top-level
await
; wrap your snippet in anasync
IIFE so it runs in Node without extra config.- Verify that the parameter for the default value is actually
xdefault
in the Databases API (it may be nameddefault
); update the example if it diverges.src/services/tables-db.ts (1)
2171-2702
: Consistency note: geometry methods don’t accept array while model types include array?.If arrays are unsupported for geometry, consider calling that out in JSDoc. If supported, add array?: boolean like other column creators.
I can open a follow-up PR once you confirm the intended behavior.
docs/examples/tablesdb/create-point-column.md (1)
1-6
: Top‑level await with CommonJS require.Wrap in an async IIFE or convert to ESM. Example IIFE:
-const sdk = require('node-appwrite'); +(async () => { + const sdk = require('node-appwrite'); @@ - .setKey('<YOUR_API_KEY>'); // Your secret API key + .setKey('<YOUR_API_KEY>'); // Your secret API keyClose at end:
-}); +}); +})().catch(console.error);Likely an incorrect or invalid review comment.
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
Changes
Documentation
Chores