Skip to content

Commit 9d5ba2a

Browse files
committed
Merge remote-tracking branch 'upstream/alpha' into alpha
2 parents 19bc669 + 9697a70 commit 9d5ba2a

19 files changed

Lines changed: 674 additions & 376 deletions

changelogs/CHANGELOG_alpha.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
## [8.1.1-alpha.6](https://github.com/parse-community/Parse-SDK-JS/compare/8.1.1-alpha.5...8.1.1-alpha.6) (2026-02-11)
2+
3+
4+
### Bug Fixes
5+
6+
* `Parse.serverURL` not accessible via global `Parse` scope ([#2917](https://github.com/parse-community/Parse-SDK-JS/issues/2917)) ([4e78681](https://github.com/parse-community/Parse-SDK-JS/commit/4e78681881320a0b8ec383955b47d693cb8add9c))
7+
8+
## [8.1.1-alpha.5](https://github.com/parse-community/Parse-SDK-JS/compare/8.1.1-alpha.4...8.1.1-alpha.5) (2026-02-11)
9+
10+
11+
### Bug Fixes
12+
13+
* Type error in `Parse.Query.equalTo` when matching optional array ([#2901](https://github.com/parse-community/Parse-SDK-JS/issues/2901)) ([8c96da9](https://github.com/parse-community/Parse-SDK-JS/commit/8c96da9d507dfd61c907f88861e5233807e7ba36))
14+
15+
## [8.1.1-alpha.4](https://github.com/parse-community/Parse-SDK-JS/compare/8.1.1-alpha.3...8.1.1-alpha.4) (2026-02-09)
16+
17+
18+
### Bug Fixes
19+
20+
* Missing or incorrect type exports ([#2909](https://github.com/parse-community/Parse-SDK-JS/issues/2909)) ([3caa4ec](https://github.com/parse-community/Parse-SDK-JS/commit/3caa4ec995e0cc02082e55e9873e12b3bc10393f))
21+
122
## [8.1.1-alpha.3](https://github.com/parse-community/Parse-SDK-JS/compare/8.1.1-alpha.2...8.1.1-alpha.3) (2026-02-07)
223

324

package-lock.json

Lines changed: 219 additions & 242 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parse",
3-
"version": "8.1.1-alpha.3",
3+
"version": "8.1.1-alpha.6",
44
"description": "Parse JavaScript SDK",
55
"homepage": "https://parseplatform.org",
66
"keywords": [
@@ -88,7 +88,7 @@
8888
"@semantic-release/commit-analyzer": "13.0.1",
8989
"@semantic-release/git": "10.0.1",
9090
"@semantic-release/github": "12.0.5",
91-
"@semantic-release/npm": "13.1.3",
91+
"@semantic-release/npm": "13.1.4",
9292
"@semantic-release/release-notes-generator": "14.1.0",
9393
"@types/facebook-js-sdk": "3.3.11",
9494
"babel-jest": "30.2.0",
@@ -114,12 +114,12 @@
114114
"lint-staged": "16.2.7",
115115
"madge": "8.0.0",
116116
"metro-react-native-babel-preset": "0.77.0",
117-
"mongodb-runner": "6.6.0",
117+
"mongodb-runner": "6.6.1",
118118
"parse-server": "9.2.0",
119119
"puppeteer": "24.37.2",
120120
"regenerator-runtime": "0.14.1",
121121
"semantic-release": "25.0.3",
122-
"typescript-eslint": "8.54.0",
122+
"typescript-eslint": "8.55.0",
123123
"vite": "7.3.1",
124124
"vite-plugin-commonjs": "0.10.4",
125125
"vite-plugin-node-polyfills": "0.25.0"

src/Cloud.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import encode from './encode';
44
import ParseError from './ParseError';
55
import ParseQuery from './ParseQuery';
66
import ParseObject from './ParseObject';
7-
import type { RequestOptions } from './RESTController';
7+
import type { RequestOptions, BaseRequestOptions } from './RESTController';
8+
9+
export type RunOptions = BaseRequestOptions;
810

911
/**
1012
* Contains functions for calling and declaring
@@ -40,12 +42,12 @@ import type { RequestOptions } from './RESTController';
4042
export function run<T extends () => any>(
4143
name: string,
4244
data?: null,
43-
options?: RequestOptions
45+
options?: RunOptions
4446
): Promise<ReturnType<T>>;
4547
export function run<
4648
T extends (param: { [P in keyof Parameters<T>[0]]: Parameters<T>[0][P] }) => any,
47-
>(name: string, data: Parameters<T>[0], options?: RequestOptions): Promise<ReturnType<T>>;
48-
export function run(name: string, data?: any, options?: RequestOptions): Promise<any> {
49+
>(name: string, data: Parameters<T>[0], options?: RunOptions): Promise<ReturnType<T>>;
50+
export function run(name: string, data?: any, options?: RunOptions): Promise<any> {
4951
if (typeof name !== 'string' || name.length === 0) {
5052
throw new TypeError('Cloud function name must be a string.');
5153
}

src/ParseObject.ts

Lines changed: 85 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import * as UniqueInstanceStateController from './UniqueInstanceStateController'
2828
import unsavedChildren from './unsavedChildren';
2929

3030
import type { AttributeMap, OpsMap } from './ObjectStateMutations';
31-
import type { RequestOptions, FullOptions } from './RESTController';
31+
import type { RequestOptions, FullOptions, BaseRequestOptions } from './RESTController';
3232
import type ParseGeoPoint from './ParseGeoPoint';
3333
import type ParsePolygon from './ParsePolygon';
3434

@@ -45,35 +45,63 @@ interface SaveParams {
4545
body: AttributeMap;
4646
}
4747

48-
export type SaveOptions = FullOptions & {
48+
export interface SaveOptions extends BaseRequestOptions {
49+
/** If `false`, nested objects will not be saved (default is `true`). */
4950
cascadeSave?: boolean;
50-
context?: AttributeMap;
5151
batchSize?: number;
5252
transaction?: boolean;
53-
};
53+
}
5454

55-
interface FetchOptions {
56-
useMasterKey?: boolean;
57-
sessionToken?: string;
55+
export interface FetchOptions extends BaseRequestOptions {
5856
include?: string | string[];
59-
context?: AttributeMap;
6057
}
6158

6259
export interface SetOptions {
6360
ignoreValidation?: boolean;
6461
unset?: boolean;
6562
}
6663

64+
export type DestroyOptions = BaseRequestOptions;
65+
66+
/** Options for destroyAll batch operation */
67+
export interface DestroyAllOptions extends BaseRequestOptions {
68+
/** batchSize: How many objects to yield in each batch (default: 20) */
69+
batchSize?: number;
70+
/** Set to true to enable transactions */
71+
transaction?: boolean;
72+
}
73+
74+
/** Options for saveAll batch operation */
75+
export interface SaveAllOptions extends BaseRequestOptions {
76+
/** batchSize: How many objects to yield in each batch (default: 20) */
77+
batchSize?: number;
78+
/** If `false`, nested objects will not be saved (default is `true`). */
79+
cascadeSave?: boolean;
80+
/** Set to true to enable transactions */
81+
transaction?: boolean;
82+
}
83+
84+
/** Options for fetchAll batch operation */
85+
export interface FetchAllOptions extends BaseRequestOptions {
86+
include?: string | string[];
87+
}
88+
6789
export type AttributeKey<T> = Extract<keyof T, string>;
6890

6991
export type Attributes = Record<string, any>;
7092

71-
interface JSONBaseAttributes {
93+
export interface JSONBaseAttributes {
7294
objectId: string;
7395
createdAt: string;
7496
updatedAt: string;
7597
}
7698

99+
export interface BaseAttributes {
100+
objectId: string;
101+
createdAt: Date;
102+
updatedAt: Date;
103+
}
104+
77105
interface CommonAttributes {
78106
ACL: ParseACL;
79107
}
@@ -82,7 +110,7 @@ type AtomicKey<T> = {
82110
[K in keyof T]: NonNullable<T[K]> extends any[] ? K : never;
83111
};
84112

85-
type Encode<T> = T extends ParseObject
113+
export type Encode<T> = T extends ParseObject
86114
? ReturnType<T['toJSON']> | Pointer
87115
: T extends ParseACL | ParseGeoPoint | ParsePolygon | ParseRelation | ParseFile
88116
? ReturnType<T['toJSON']>
@@ -96,7 +124,7 @@ type Encode<T> = T extends ParseObject
96124
? ToJSON<T>
97125
: T;
98126

99-
type ToJSON<T> = {
127+
export type ToJSON<T> = {
100128
[K in keyof T]: Encode<T[K]>;
101129
};
102130

@@ -1481,7 +1509,7 @@ class ParseObject<T extends Attributes = Attributes> {
14811509
* @returns {Promise} A promise that is fulfilled when the destroy
14821510
* completes.
14831511
*/
1484-
destroy(options?: RequestOptions): Promise<ParseObject | undefined> {
1512+
destroy(options?: DestroyOptions): Promise<ParseObject | undefined> {
14851513
if (!this.id) {
14861514
return Promise.resolve(undefined);
14871515
}
@@ -1637,7 +1665,7 @@ class ParseObject<T extends Attributes = Attributes> {
16371665
* @static
16381666
* @returns {Parse.Object[]}
16391667
*/
1640-
static fetchAll<T extends ParseObject>(list: T[], options?: RequestOptions): Promise<T[]> {
1668+
static fetchAll<T extends ParseObject>(list: T[], options?: FetchAllOptions): Promise<T[]> {
16411669
const fetchOptions = ParseObject._getRequestOptions(options);
16421670
return CoreManager.getObjectController().fetch(list, true, fetchOptions) as Promise<T[]>;
16431671
}
@@ -1748,7 +1776,10 @@ class ParseObject<T extends Attributes = Attributes> {
17481776
* @static
17491777
* @returns {Parse.Object[]}
17501778
*/
1751-
static fetchAllIfNeeded<T extends ParseObject>(list: T[], options?: FetchOptions): Promise<T[]> {
1779+
static fetchAllIfNeeded<T extends ParseObject>(
1780+
list: T[],
1781+
options?: FetchAllOptions
1782+
): Promise<T[]> {
17521783
const fetchOptions = ParseObject._getRequestOptions(options);
17531784
return CoreManager.getObjectController().fetch(list, false, fetchOptions) as Promise<T[]>;
17541785
}
@@ -1824,9 +1855,9 @@ class ParseObject<T extends Attributes = Attributes> {
18241855
* @returns {Promise} A promise that is fulfilled when the destroyAll
18251856
* completes.
18261857
*/
1827-
static destroyAll(list: ParseObject[], options?: SaveOptions) {
1858+
static destroyAll<T extends ParseObject>(list: T[], options?: DestroyAllOptions): Promise<T[]> {
18281859
const destroyOptions = ParseObject._getRequestOptions(options);
1829-
return CoreManager.getObjectController().destroy(list, destroyOptions);
1860+
return CoreManager.getObjectController().destroy(list, destroyOptions) as Promise<T[]>;
18301861
}
18311862

18321863
/**
@@ -1858,7 +1889,7 @@ class ParseObject<T extends Attributes = Attributes> {
18581889
* @static
18591890
* @returns {Parse.Object[]}
18601891
*/
1861-
static saveAll<T extends ParseObject[]>(list: T, options?: SaveOptions): Promise<T> {
1892+
static saveAll<T extends ParseObject[]>(list: T, options?: SaveAllOptions): Promise<T> {
18621893
const saveOptions = ParseObject._getRequestOptions(options);
18631894
return CoreManager.getObjectController().save(list, saveOptions) as any;
18641895
}
@@ -2657,4 +2688,41 @@ const DefaultController = {
26572688
CoreManager.setParseObject(ParseObject);
26582689
CoreManager.setObjectController(DefaultController);
26592690

2691+
export interface ObjectStatic<T extends ParseObject = ParseObject> {
2692+
new (...args: any[]): T;
2693+
createWithoutData(id: string): T;
2694+
destroyAll<U extends ParseObject>(list: U[], options?: DestroyAllOptions): Promise<U[]>;
2695+
extend(className: string | { className: string }, protoProps?: any, classProps?: any): any;
2696+
fetchAll<U extends ParseObject>(list: U[], options?: FetchAllOptions): Promise<U[]>;
2697+
fetchAllIfNeeded<U extends ParseObject>(list: U[], options?: FetchAllOptions): Promise<U[]>;
2698+
fetchAllIfNeededWithInclude<U extends ParseObject>(
2699+
list: U[],
2700+
keys: keyof U['attributes'] | (keyof U['attributes'])[],
2701+
options?: RequestOptions
2702+
): Promise<U[]>;
2703+
fetchAllWithInclude<U extends ParseObject>(
2704+
list: U[],
2705+
keys: keyof U['attributes'] | (keyof U['attributes'])[],
2706+
options?: RequestOptions
2707+
): Promise<U[]>;
2708+
fromJSON(json: any, override?: boolean, dirty?: boolean): T;
2709+
pinAll(objects: ParseObject[]): Promise<void>;
2710+
pinAllWithName(name: string, objects: ParseObject[]): Promise<void>;
2711+
registerSubclass(className: string, clazz: new (options?: any) => T): void;
2712+
saveAll<U extends ParseObject[]>(list: U, options?: SaveAllOptions): Promise<U>;
2713+
unPinAll(objects: ParseObject[]): Promise<void>;
2714+
unPinAllObjects(): Promise<void>;
2715+
unPinAllObjectsWithName(name: string): Promise<void>;
2716+
unPinAllWithName(name: string, objects: ParseObject[]): Promise<void>;
2717+
}
2718+
2719+
export interface ObjectConstructor extends ObjectStatic {
2720+
new <T extends Attributes>(className: string, attributes: T, options?: any): ParseObject<T>;
2721+
new (
2722+
className?: string | { className: string; [attr: string]: any },
2723+
attributes?: Attributes,
2724+
options?: any
2725+
): ParseObject;
2726+
}
2727+
26602728
export default ParseObject;

0 commit comments

Comments
 (0)