Repository navigation
fix: Missing or incorrect type exports - #2909
Conversation
|
I will reformat the title to use the proper commit message syntax. |
|
🚀 Thanks for opening this pull request! |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
📝 WalkthroughWalkthroughExported a shared BaseRequestOptions and several previously-internal option/type interfaces across Cloud, ParseObject, ParseQuery, ParseSchema, ParseUser, Push, and RESTController; updated public signatures and type re-exports to use these new exported option/type aliases. (30 words) Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## alpha #2909 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 64 64
Lines 6235 6235
Branches 1493 1493
=========================================
Hits 6235 6235 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In `@src/ParseObject.ts`:
- Around line 64-65: The empty interface DestroyOptions that extends
BaseRequestOptions in ParseObject.ts is triggering the
`@typescript-eslint/no-empty-interface` lint rule; suppress it by adding an inline
eslint-disable comment (e.g., // eslint-disable-next-line
`@typescript-eslint/no-empty-interface`) immediately above the DestroyOptions
declaration so the interface can remain empty for API consistency and future use
without lint errors.
- Around line 2689-2697: Replace the Array<T> syntax with T[] in the
ObjectStatic method signatures: update the parameters in
fetchAllIfNeededWithInclude and fetchAllWithInclude so their second parameter
becomes "keys: keyof U['attributes'] | (keyof U['attributes'])[]" instead of
"Array<keyof U['attributes']>", preserving the generic U, RequestOptions
parameter, and return types exactly as-is.
- Around line 214-215: The template string in the ParseObject method (use
this.className, this.id, this.attributes) is split across two lines causing lint
indentation failures; collapse the multi-line template into a single-line
template string (e.g., return `ParseObject: className: ${this.className}, id:
${this.id} Attributes: ${JSON.stringify(this.attributes, null, 2)}`) inside the
same method so the returned string is identical but satisfies the 2-space
indentation rule.
🧹 Nitpick comments (3)
src/Cloud.ts (1)
42-50: Consider whetherFullOptions.success/FullOptions.errorshould leak intoRunOptions.Since
RunOptionsextendsFullOptions, it now accepts legacysuccessanderrorcallback fields. The PR description mentions uncertainty about whether these are still used. If they're dead code, consumers could pass them expecting callback behavior that no longer works.This isn't blocking, but worth a follow-up to confirm whether
success/errorare honored anywhere in the cloud run path, and if not, consider definingRunOptionswithout inheriting those fields.types/ParseUser.d.ts (1)
201-203: InstancesignUpusesSignUpOptionsbut staticsignUp(line 307) still acceptsFullOptions.The static method delegates to the instance method, so extra fields from
FullOptions(e.g.,sessionToken,usePost) would be silently passed through_getRequestOptionsbut likely ignored during sign-up. Consider aligning the static method's options type toSignUpOptionsas well for a consistent public API.src/ParseQuery.ts (1)
25-32: Consider usingtypealiases instead of emptyinterfacedeclarations to silence lint warnings.The linter flags these four empty interfaces. Since they add no members over their supertypes,
typealiases are equivalent and lint-clean:-export interface FindOptions extends QueryOptions { } - -/** CountOptions - no json since count() returns a number, not objects */ -export interface CountOptions extends BaseRequestOptions { } - -export interface GetOptions extends QueryOptions { } - -export interface FirstOptions extends QueryOptions { } +export type FindOptions = QueryOptions; + +/** CountOptions - no json since count() returns a number, not objects */ +export type CountOptions = BaseRequestOptions; + +export type GetOptions = QueryOptions; + +export type FirstOptions = QueryOptions;If you intentionally chose
interfaceto allow consumers to use declaration merging (augmenting these types from outside), you can suppress the lint rule instead — just worth documenting that intent.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@types/ParseObject.d.ts`:
- Around line 1096-1099: The instance method signatures
fetchAllIfNeededWithInclude and fetchAllWithInclude incorrectly bind the array
operator before keyof; update their parameter types to mirror the static
signatures by wrapping the attribute lookup in parentheses so the union reads
(keyof U["attributes"]) | (keyof U["attributes"])[] — i.e., use (keyof
U["attributes"])[] when you intend an array of attribute keys for the keys
parameter in both fetchAllIfNeededWithInclude and fetchAllWithInclude to ensure
keyof applies to the attribute type rather than the array.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@src/ParseObject.ts`:
- Around line 48-82: DestroyAllOptions interface is missing the transaction flag
so callers cannot pass options.transaction; update the DestroyAllOptions
declaration (the interface named DestroyAllOptions in ParseObject.ts) to include
transaction?: boolean, mirroring SaveAllOptions, and apply the same addition to
the duplicate declaration in types/ParseObject.d.ts so destroyAll and
DefaultController.destroy can accept options.transaction without a TypeScript
error.
In `@types/ParseObject.d.ts`:
- Around line 34-49: The declaration for DestroyAllOptions is missing the
transaction flag that the implementation (ParseObject.saveAll/related batch
logic) expects; update the DestroyAllOptions interface to include transaction?:
boolean so the types match the implementation (add transaction?: boolean to the
DestroyAllOptions interface alongside batchSize and other BaseRequestOptions
fields).
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@types/ParseObject.d.ts`:
- Around line 1093-1113: The ObjectStatic interface's fromJSON signature omits
the third boolean parameter `dirty` that the class static defines; update
ObjectStatic.fromJSON to include the same optional `dirty?: boolean` parameter
so its signature matches the class static declaration (reference symbols:
ObjectStatic.fromJSON and the class static method static fromJSON<T>(json: any,
override?: boolean, dirty?: boolean): T).
- Around line 1114-1117: The constructor overloads on ObjectConstructor do not
accept the object-form first argument that ParseObject's constructor supports;
update both overload signatures for ObjectConstructor (the two new declarations)
so their first parameter type is string | { className: string; [attr: string]:
any } (or an equivalent union/type alias) instead of just string so callers can
do new ParseObject({ className: 'Foo', ... }) as well as new ParseObject('Foo',
...).
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/ParseObject.ts`:
- Around line 2687-2713: The ObjectStatic interface's fromJSON signature is
missing the third parameter "dirty" which the class static defines as static
fromJSON<T>(json: any, override?: boolean, dirty?: boolean): T; update the
ObjectStatic.fromJSON declaration to include the optional dirty?: boolean
parameter (matching the class static) so callers using the ObjectStatic type can
pass the dirty flag; look for the ObjectStatic interface and change its
fromJSON(json: any, override?: boolean) to fromJSON(json: any, override?:
boolean, dirty?: boolean).
|
btw just of note; since there seems to be no |
|
Interesting, prettier isn't even used in this repo. |
## [8.1.1-alpha.4](8.1.1-alpha.3...8.1.1-alpha.4) (2026-02-09) ### Bug Fixes * Missing or incorrect type exports ([#2909](#2909)) ([3caa4ec](3caa4ec))
|
🎉 This change has been released in version 8.1.1-alpha.4 |
# [8.2.0](8.1.0...8.2.0) (2026-02-20) ### Bug Fixes * `Parse.Object.createWithoutData` doesn't preserve object subclass ([#2907](#2907)) ([01dc94d](01dc94d)) * `Parse.Query.and/or/nor` loosing custom class types ([#2903](#2903)) ([89fdb07](89fdb07)) * `Parse.serverURL` not accessible via global `Parse` scope ([#2917](#2917)) ([4e78681](4e78681)) * Cloud trigger type errors for void returns and subclass constructors ([#2904](#2904)) ([de9f56d](de9f56d)) * Missing or incorrect type exports ([#2909](#2909)) ([3caa4ec](3caa4ec)) * Type error in `Parse.Query.equalTo` when matching optional array ([#2901](#2901)) ([8c96da9](8c96da9)) ### Features * Add request header `X-Parse-Upload-Mode` to identify file upload as binary data via `Buffer`, `Readable`, `ReadableStream` ([#2927](#2927)) ([a66bb06](a66bb06)) * Add support for file upload as binary data via `Buffer`, `Readable`, `ReadableStream` ([#2925](#2925)) ([e42caf6](e42caf6))
|
🎉 This change has been released in version 8.2.0 |
Pull Request
Issue
Closes: #2908
Approach
Added types + exported via original type namespaces (e.g.
Parse.Object.X,Parse.Query.X) as expected by consumers of previous DefinitelyTyped typings. Some typings that already existed were not exported, and are now exported with this PR at the original locations that users might expect.Request options are also restored to be more specific (and these specific types exported under their original expected names) instead of the catch-all
FullOptions. (one thing of note is I'm not sure if thesuccesanderrorparams ofFullOptionsare still in use anywhere; to me it appears as if it's likely a remnant from the pre-promises version? Not sure).Tasks
Summary by CodeRabbit
New Features
Improvements
Tests