Skip to content

Commit 0172b6f

Browse files
authored
build: release beta (#1584)
2 parents 0712abd + bc96cf8 commit 0172b6f

24 files changed

+18443
-18370
lines changed

.github/dependabot.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Dependabot dependency updates
2+
# Docs: https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3+
4+
version: 2
5+
updates:
6+
- package-ecosystem: "npm"
7+
# Location of package-lock.json
8+
directory: "/"
9+
# Check daily for updates
10+
schedule:
11+
interval: "daily"
12+
commit-message:
13+
# Set commit message prefix
14+
prefix: "refactor"
15+
# Define dependencies to update
16+
allow:
17+
- dependency-name: "parse-server"

changelogs/CHANGELOG_alpha.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,61 @@
1+
# [3.5.0-alpha.6](https://github.com/parse-community/Parse-SDK-JS/compare/3.5.0-alpha.5...3.5.0-alpha.6) (2022-10-13)
2+
3+
4+
### Bug Fixes
5+
6+
* initialization fails in non-browser environment that doesn't support `indexedDB` ([#1569](https://github.com/parse-community/Parse-SDK-JS/issues/1569)) ([3560a5e](https://github.com/parse-community/Parse-SDK-JS/commit/3560a5e422f8e97aa55c1c238d333248bac7f7d6))
7+
8+
# [3.5.0-alpha.5](https://github.com/parse-community/Parse-SDK-JS/compare/3.5.0-alpha.4...3.5.0-alpha.5) (2022-10-11)
9+
10+
11+
### Features
12+
13+
* localDatastore support for unsorted distance queries ([#1570](https://github.com/parse-community/Parse-SDK-JS/issues/1570)) ([ea3e75f](https://github.com/parse-community/Parse-SDK-JS/commit/ea3e75f1bdeb6e8c3b3e46c909f827daef1978f0))
14+
15+
# [3.5.0-alpha.4](https://github.com/parse-community/Parse-SDK-JS/compare/3.5.0-alpha.3...3.5.0-alpha.4) (2022-09-21)
16+
17+
18+
### Features
19+
20+
* generate `Parse.Object.objectId` automatically when `allowCustomObjectId` is enabled and no `objectId` is passed ([#1540](https://github.com/parse-community/Parse-SDK-JS/issues/1540)) ([68f3ff5](https://github.com/parse-community/Parse-SDK-JS/commit/68f3ff5b9a471648dcd07d35c706004eaaa173ec))
21+
22+
# [3.5.0-alpha.3](https://github.com/parse-community/Parse-SDK-JS/compare/3.5.0-alpha.2...3.5.0-alpha.3) (2022-09-14)
23+
24+
25+
### Bug Fixes
26+
27+
* `Schema.addField` does not correctly add value of type `Date` ([#1544](https://github.com/parse-community/Parse-SDK-JS/issues/1544)) ([15111f7](https://github.com/parse-community/Parse-SDK-JS/commit/15111f74a658eefc71a50b6bfb3d25c7997d26a2))
28+
29+
# [3.5.0-alpha.2](https://github.com/parse-community/Parse-SDK-JS/compare/3.5.0-alpha.1...3.5.0-alpha.2) (2022-09-12)
30+
31+
32+
### Bug Fixes
33+
34+
* remove base64 validation due to validation inefficiency ([#1543](https://github.com/parse-community/Parse-SDK-JS/issues/1543)) ([473949d](https://github.com/parse-community/Parse-SDK-JS/commit/473949d514a395cf3656b03e083e30fff6e2f22c))
35+
36+
# [3.5.0-alpha.1](https://github.com/parse-community/Parse-SDK-JS/compare/3.4.4-alpha.2...3.5.0-alpha.1) (2022-09-08)
37+
38+
39+
### Features
40+
41+
* add `json` option to `Parse.Query.each()` ([#1539](https://github.com/parse-community/Parse-SDK-JS/issues/1539)) ([89fd5ec](https://github.com/parse-community/Parse-SDK-JS/commit/89fd5ec6a8e210de3946434c6c88d6de87b6635c))
42+
* add json option to query.each ([299fb0d](https://github.com/parse-community/Parse-SDK-JS/commit/299fb0d49cbbd3c95c2e8a61744bd03e93c33d36))
43+
44+
## [3.4.4-alpha.2](https://github.com/parse-community/Parse-SDK-JS/compare/3.4.4-alpha.1...3.4.4-alpha.2) (2022-08-16)
45+
46+
47+
### Bug Fixes
48+
49+
* `Parse.User.signUp()` does not pass context to Cloud Code ([#1527](https://github.com/parse-community/Parse-SDK-JS/issues/1527)) ([53edcfd](https://github.com/parse-community/Parse-SDK-JS/commit/53edcfd7ad1bd075a6097ba3c129c5f0998ffbfa))
50+
51+
## [3.4.4-alpha.1](https://github.com/parse-community/Parse-SDK-JS/compare/3.4.3...3.4.4-alpha.1) (2022-07-28)
52+
53+
54+
### Bug Fixes
55+
56+
* creating a Parse.File with base64 string fails for some encodings ([#1517](https://github.com/parse-community/Parse-SDK-JS/issues/1517)) ([0439862](https://github.com/parse-community/Parse-SDK-JS/commit/0439862cd83dc37f8f3571b68fdaccb6b11b540d))
57+
* subscription to a LiveQuery containing `ParseQuery.select` overrides properties ([#1488](https://github.com/parse-community/Parse-SDK-JS/issues/1488)) ([b80eee4](https://github.com/parse-community/Parse-SDK-JS/commit/b80eee4b010b60d37b34b566880ed19f05d4c801))
58+
159
## [3.4.3-alpha.3](https://github.com/parse-community/Parse-SDK-JS/compare/3.4.3-alpha.2...3.4.3-alpha.3) (2022-07-02)
260

361

integration/test/ParseLocalDatastoreTest.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2735,6 +2735,26 @@ function runTest(controller) {
27352735
assert.equal(objects.length, 1);
27362736
});
27372737

2738+
it(`${controller.name} supports withinKilometers`, async () => {
2739+
const object = new TestObject();
2740+
const firstPoint = new Parse.GeoPoint({ latitude: 40.0, longitude: -30.0 });
2741+
object.set({ location: firstPoint });
2742+
await object.save();
2743+
await object.pin();
2744+
2745+
const sorted = false;
2746+
const query = new Parse.Query(TestObject);
2747+
query.withinKilometers(
2748+
'location',
2749+
new Parse.GeoPoint({ latitude: 40.0, longitude: -30.0 }),
2750+
2,
2751+
sorted
2752+
);
2753+
query.fromLocalDatastore();
2754+
const results = await query.find();
2755+
assert.equal(results.length, 1);
2756+
});
2757+
27382758
it(`${controller.name} supports withinPolygon`, async () => {
27392759
const sacramento = new TestObject();
27402760
sacramento.set('location', new Parse.GeoPoint(38.52, -121.5));

integration/test/ParseObjectTest.js

Lines changed: 121 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2060,59 +2060,135 @@ describe('Parse Object', () => {
20602060
expect(obj.get('string')).toBeInstanceOf(String);
20612061
});
20622062

2063-
it('allowCustomObjectId', async () => {
2064-
await reconfigureServer({ allowCustomObjectId: true });
2065-
Parse.allowCustomObjectId = true;
2066-
const customId = `${Date.now()}`;
2067-
const object = new Parse.Object('TestObject');
2068-
try {
2063+
describe('allowCustomObjectId', () => {
2064+
it('can save without setting an objectId', async () => {
2065+
await reconfigureServer({ allowCustomObjectId: true });
2066+
Parse.allowCustomObjectId = true;
2067+
2068+
const object = new Parse.Object('TestObject');
20692069
await object.save();
2070-
fail();
2071-
} catch (error) {
2072-
expect(error.message).toBe('objectId must not be empty, null or undefined');
2073-
}
2074-
object.id = customId;
2075-
object.set('foo', 'bar');
2076-
await object.save();
2077-
expect(object.id).toBe(customId);
2070+
expect(object.id).toBeDefined();
2071+
2072+
Parse.allowCustomObjectId = false;
2073+
});
2074+
2075+
it('fails to save when objectId is empty', async () => {
2076+
await reconfigureServer({ allowCustomObjectId: true });
2077+
Parse.allowCustomObjectId = true;
2078+
2079+
const object = new Parse.Object('TestObject');
2080+
object.id = '';
2081+
await expectAsync(object.save()).toBeRejectedWith(
2082+
new Parse.Error(Parse.Error.MISSING_OBJECT_ID, 'objectId must not be empty or null')
2083+
);
2084+
2085+
Parse.allowCustomObjectId = false;
2086+
});
2087+
2088+
it('fails to save when objectId is null', async () => {
2089+
await reconfigureServer({ allowCustomObjectId: true });
2090+
Parse.allowCustomObjectId = true;
2091+
2092+
const object = new Parse.Object('TestObject');
2093+
object.id = null;
2094+
await expectAsync(object.save()).toBeRejectedWith(
2095+
new Parse.Error(Parse.Error.MISSING_OBJECT_ID, 'objectId must not be empty or null')
2096+
);
2097+
2098+
Parse.allowCustomObjectId = false;
2099+
});
2100+
2101+
it('can save with custom objectId', async () => {
2102+
await reconfigureServer({ allowCustomObjectId: true });
2103+
Parse.allowCustomObjectId = true;
2104+
2105+
const customId = `${Date.now()}`;
2106+
const object = new Parse.Object('TestObject');
2107+
object.id = customId;
2108+
object.set('foo', 'bar');
2109+
await object.save();
2110+
expect(object.id).toBe(customId);
2111+
2112+
const query = new Parse.Query('TestObject');
2113+
const result = await query.get(customId);
2114+
expect(result.get('foo')).toBe('bar');
2115+
expect(result.id).toBe(customId);
20782116

2079-
const query = new Parse.Query('TestObject');
2080-
const result = await query.get(customId);
2081-
expect(result.get('foo')).toBe('bar');
2082-
expect(result.id).toBe(customId);
2117+
result.set('foo', 'baz');
2118+
await result.save();
20832119

2084-
result.set('foo', 'baz');
2085-
await result.save();
2120+
const afterSave = await query.get(customId);
2121+
expect(afterSave.get('foo')).toBe('baz');
20862122

2087-
const afterSave = await query.get(customId);
2088-
expect(afterSave.get('foo')).toBe('baz');
2089-
Parse.allowCustomObjectId = false;
2123+
Parse.allowCustomObjectId = false;
2124+
});
20902125
});
20912126

2092-
it('allowCustomObjectId saveAll', async () => {
2093-
await reconfigureServer({ allowCustomObjectId: true });
2094-
Parse.allowCustomObjectId = true;
2095-
const customId1 = `${Date.now()}`;
2096-
const customId2 = `${Date.now()}`;
2097-
const obj1 = new TestObject({ foo: 'bar' });
2098-
const obj2 = new TestObject({ foo: 'baz' });
2099-
try {
2127+
describe('allowCustomObjectId saveAll', () => {
2128+
it('can save without setting an objectId', async () => {
2129+
await reconfigureServer({ allowCustomObjectId: true });
2130+
Parse.allowCustomObjectId = true;
2131+
2132+
const obj1 = new TestObject({ foo: 'bar' });
2133+
const obj2 = new TestObject({ foo: 'baz' });
21002134
await Parse.Object.saveAll([obj1, obj2]);
2101-
fail();
2102-
} catch (error) {
2103-
expect(error.message).toBe('objectId must not be empty, null or undefined');
2104-
}
2105-
obj1.id = customId1;
2106-
obj2.id = customId2;
2107-
await Parse.Object.saveAll([obj1, obj2]);
2108-
expect(obj1.id).toBe(customId1);
2109-
expect(obj2.id).toBe(customId2);
2135+
expect(obj1.id).toBeDefined();
2136+
expect(obj2.id).toBeDefined();
21102137

2111-
const query = new Parse.Query(TestObject);
2112-
const results = await query.find();
2113-
results.forEach(result => {
2114-
expect([customId1, customId2].includes(result.id));
2138+
Parse.allowCustomObjectId = false;
2139+
});
2140+
2141+
it('fails to save when objectId is empty', async () => {
2142+
await reconfigureServer({ allowCustomObjectId: true });
2143+
Parse.allowCustomObjectId = true;
2144+
2145+
const obj1 = new TestObject({ foo: 'bar' });
2146+
obj1.id = '';
2147+
const obj2 = new TestObject({ foo: 'baz' });
2148+
obj2.id = '';
2149+
await expectAsync(Parse.Object.saveAll([obj1, obj2])).toBeRejectedWith(
2150+
new Parse.Error(Parse.Error.MISSING_OBJECT_ID, 'objectId must not be empty or null')
2151+
);
2152+
2153+
Parse.allowCustomObjectId = false;
2154+
});
2155+
2156+
it('fails to save when objectId is null', async () => {
2157+
await reconfigureServer({ allowCustomObjectId: true });
2158+
Parse.allowCustomObjectId = true;
2159+
2160+
const obj1 = new TestObject({ foo: 'bar' });
2161+
obj1.id = null;
2162+
const obj2 = new TestObject({ foo: 'baz' });
2163+
obj2.id = null;
2164+
await expectAsync(Parse.Object.saveAll([obj1, obj2])).toBeRejectedWith(
2165+
new Parse.Error(Parse.Error.MISSING_OBJECT_ID, 'objectId must not be empty or null')
2166+
);
2167+
2168+
Parse.allowCustomObjectId = false;
2169+
});
2170+
2171+
it('can save with custom objectId', async () => {
2172+
await reconfigureServer({ allowCustomObjectId: true });
2173+
Parse.allowCustomObjectId = true;
2174+
2175+
const obj1 = new TestObject({ foo: 'bar' });
2176+
const customId1 = `${Date.now()}`;
2177+
obj1.id = customId1;
2178+
const obj2 = new TestObject({ foo: 'baz' });
2179+
const customId2 = `${Date.now()}`;
2180+
obj1.id = customId2;
2181+
await Parse.Object.saveAll([obj1, obj2]);
2182+
expect(obj1.id).toBeDefined();
2183+
expect(obj2.id).toBeDefined();
2184+
2185+
const query = new Parse.Query(TestObject);
2186+
const results = await query.find();
2187+
results.forEach(result => {
2188+
expect([customId1, customId2].includes(result.id));
2189+
});
2190+
2191+
Parse.allowCustomObjectId = false;
21152192
});
2116-
Parse.allowCustomObjectId = false;
21172193
});
21182194
});

integration/test/ParseQueryTest.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ describe('Parse Query', () => {
7070
assert.strictEqual(result.foo, 'bar');
7171
assert.strictEqual(result.className, 'TestObject');
7272
assert.strictEqual(result.objectId, object.id);
73+
74+
await query.each((obj) => {
75+
assert.strictEqual(obj instanceof Parse.Object, false);
76+
assert.strictEqual(obj.foo, 'bar');
77+
assert.strictEqual(obj.className, 'TestObject');
78+
assert.strictEqual(obj.objectId, object.id);
79+
}, { json: true });
7380
});
7481

7582
it('can do query with count', async () => {

integration/test/helper.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ const defaultConfiguration = {
7272
enableForAuthenticatedUser: true,
7373
},
7474
revokeSessionOnPasswordReset: false,
75+
allowCustomObjectId: false,
7576
};
7677

7778
const openConnections = {};

0 commit comments

Comments
 (0)