Skip to content
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

build: Release #2131

Merged
merged 33 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b0adf7e
feat: Add password validation for user with unverified email via `Par…
mtrezza Mar 23, 2024
492d84c
chore(release): 5.0.0-alpha.4 [skip ci]
semantic-release-bot Mar 23, 2024
3c2303c
Merge branch 'release' into alpha
mtrezza Mar 23, 2024
72bc9ac
feat: Add support for setting `Parse.ACL` from json (#2097)
dplewis Mar 31, 2024
ab237a2
chore(release): 5.1.0-alpha.1 [skip ci]
semantic-release-bot Mar 31, 2024
c591895
ci: Fix Codecov upload (#2105)
mtrezza Apr 13, 2024
a7b2fa0
refactor: Copy `ignoreEmailVerification` from option to data (#2107)
mtrezza Apr 13, 2024
fe29e6e
test: Fix EventuallyQueue flaky tests (#2108)
dplewis Apr 13, 2024
6afd32a
fix: Local datastore throws error when `Parse.Query.notEqualTo` is se…
dplewis Apr 13, 2024
c58fdda
chore(release): 5.1.0-alpha.2 [skip ci]
semantic-release-bot Apr 13, 2024
fbd0ab1
feat: Lazy load `Parse.CoreManager` controllers to add support for sw…
dplewis Apr 14, 2024
a821777
chore(release): 5.1.0-alpha.3 [skip ci]
semantic-release-bot Apr 14, 2024
7a89665
fix: Live Query not working on Expo React Native (#2109)
dplewis Apr 15, 2024
c435272
chore(release): 5.1.0-alpha.4 [skip ci]
semantic-release-bot Apr 15, 2024
0576f56
ci: Create Lint CI job (#2110)
mtrezza Apr 15, 2024
7b73c03
fix: Chrome browser console warning about unsafe header `access-contr…
mortenmo Apr 22, 2024
94e9948
chore(release): 5.1.0-alpha.5 [skip ci]
semantic-release-bot Apr 22, 2024
f92e4d4
feat: Allow setting custom queue for handling offline operations via …
mortenmo Apr 25, 2024
8f30edf
chore(release): 5.1.0-alpha.6 [skip ci]
semantic-release-bot Apr 25, 2024
fa4341a
fix: Multiple object updates of nested keys overwrite each other (#1451)
mstniy May 1, 2024
8b7fd1b
chore(release): 5.1.0-alpha.7 [skip ci]
semantic-release-bot May 1, 2024
23cc573
fix: Pending updates to nested field causes `ParseObject.toJSON()` to…
mstniy May 2, 2024
6b927a3
chore(release): 5.1.0-alpha.8 [skip ci]
semantic-release-bot May 2, 2024
8717ed6
docs: Generate documentation for TypeScript files (#2121)
dplewis May 3, 2024
1c50c37
refactor: Convert `CoreManager` to TypeScript (#2118)
dplewis May 3, 2024
4fc62ce
feat: Improve installation object `Parse.Installation.currentInstalla…
dplewis May 4, 2024
aff0a00
chore(release): 5.1.0-alpha.9 [skip ci]
semantic-release-bot May 4, 2024
01faf7b
test: Do not mock ParseObject and ParseOp for ParseQuery tests (#2123)
mstniy May 14, 2024
b415165
fix: Remove circular dependencies (#2125)
dplewis May 15, 2024
d366dff
chore(release): 5.1.0-alpha.10 [skip ci]
semantic-release-bot May 15, 2024
3860535
fix: `Parse.GeoPoint.current` returns `undefined` (#2127)
dplewis May 16, 2024
3cc0aed
chore(release): 5.1.0-alpha.11 [skip ci]
semantic-release-bot May 16, 2024
81b6944
refactor: Convert ParseObject to TypeScript (#2128)
dplewis May 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 34 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ jobs:
with:
version: 2
check-types:
name: Check types
name: Check Types
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm ci
- name: Check types
- name: Build Types
run: npm run build:types
- name: Lint Types
run: npm run lint:types
- name: Test Types
run: npm run test:types
check-docs:
name: Check Docs
Expand All @@ -34,6 +38,29 @@ jobs:
- run: npm ci
- name: Check Docs
run: npm run docs
check-circular:
name: Check Circular Dependencies
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm ci
- name: Circular Dependencies
run: npm run madge:circular
check-lint:
name: Lint
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
build:
runs-on: ubuntu-latest
timeout-minutes: 30
Expand All @@ -55,12 +82,15 @@ jobs:
node-version: ${{ matrix.NODE_VERSION }}
cache: npm
- run: npm ci
- run: npm run lint
- run: npm test -- --maxWorkers=4
- run: npm run test:mongodb
env:
CI: true
- run: bash <(curl -s https://codecov.io/bash)
- name: Upload code coverage
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
10 changes: 10 additions & 0 deletions .madgerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"detectiveOptions": {
"ts": {
"skipTypeImports": true
},
"es6": {
"skipTypeImports": true
}
}
}
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ A library that gives you access to the powerful Parse Server backend from your J

- [Getting Started](#getting-started)
- [Using Parse on Different Platforms](#using-parse-on-different-platforms)
- [Core Manager](#core-manager)
- [Compatibility](#compatibility)
- [Parse Server](#parse-server)
- [Node.js](#nodejs)
Expand Down Expand Up @@ -89,6 +90,18 @@ $ npm install @types/parse

Types are updated manually after every release. If a definition doesn't exist, please submit a pull request to [@types/parse][types-parse]

#### Core Manager

The SDK has a [Core Manager](src/CoreManager.ts) that handles all configurations and controllers. These modules can be swapped out for customization before you initialize the SDK. For full list of all available modules take a look at the [Core Manager Documentation](src/CoreManager.ts).

```js
// Configuration example
Parse.CoreManager.set('REQUEST_ATTEMPT_LIMIT', 1)

// Controller example
Parse.CoreManager.setRESTController(MyRESTController);
```

## Compatibility

### Parse Server
Expand Down
85 changes: 85 additions & 0 deletions changelogs/CHANGELOG_alpha.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,88 @@
# [5.1.0-alpha.11](https://github.com/parse-community/Parse-SDK-JS/compare/5.1.0-alpha.10...5.1.0-alpha.11) (2024-05-16)


### Bug Fixes

* `Parse.GeoPoint.current` returns `undefined` ([#2127](https://github.com/parse-community/Parse-SDK-JS/issues/2127)) ([3860535](https://github.com/parse-community/Parse-SDK-JS/commit/3860535f5257b7b5edbf7ebfd286e2a4a7fd2769))

# [5.1.0-alpha.10](https://github.com/parse-community/Parse-SDK-JS/compare/5.1.0-alpha.9...5.1.0-alpha.10) (2024-05-15)


### Bug Fixes

* Remove circular dependencies ([#2125](https://github.com/parse-community/Parse-SDK-JS/issues/2125)) ([b415165](https://github.com/parse-community/Parse-SDK-JS/commit/b415165486f0328e0f9fb2d949d7b11abf363435))

# [5.1.0-alpha.9](https://github.com/parse-community/Parse-SDK-JS/compare/5.1.0-alpha.8...5.1.0-alpha.9) (2024-05-04)


### Features

* Improve installation object `Parse.Installation.currentInstallation` to support web push notifications ([#2119](https://github.com/parse-community/Parse-SDK-JS/issues/2119)) ([4fc62ce](https://github.com/parse-community/Parse-SDK-JS/commit/4fc62cec0c4ea704f48ec501a5f0182836de45d1))

# [5.1.0-alpha.8](https://github.com/parse-community/Parse-SDK-JS/compare/5.1.0-alpha.7...5.1.0-alpha.8) (2024-05-02)


### Bug Fixes

* Pending updates to nested field causes `ParseObject.toJSON()` to return incorrect object ([#1453](https://github.com/parse-community/Parse-SDK-JS/issues/1453)) ([23cc573](https://github.com/parse-community/Parse-SDK-JS/commit/23cc573ccae9e11288aaeff61f478e59bf9bae0c))

# [5.1.0-alpha.7](https://github.com/parse-community/Parse-SDK-JS/compare/5.1.0-alpha.6...5.1.0-alpha.7) (2024-05-01)


### Bug Fixes

* Multiple object updates of nested keys overwrite each other ([#1451](https://github.com/parse-community/Parse-SDK-JS/issues/1451)) ([fa4341a](https://github.com/parse-community/Parse-SDK-JS/commit/fa4341a8c0ce5a9c478435250b4af6ea020a45bd))

# [5.1.0-alpha.6](https://github.com/parse-community/Parse-SDK-JS/compare/5.1.0-alpha.5...5.1.0-alpha.6) (2024-04-25)


### Features

* Allow setting custom queue for handling offline operations via `Parse.EventuallyQueue` ([#2106](https://github.com/parse-community/Parse-SDK-JS/issues/2106)) ([f92e4d4](https://github.com/parse-community/Parse-SDK-JS/commit/f92e4d42afdc1e55bcfff1ba9d0658d39943f3f0))

# [5.1.0-alpha.5](https://github.com/parse-community/Parse-SDK-JS/compare/5.1.0-alpha.4...5.1.0-alpha.5) (2024-04-22)


### Bug Fixes

* Chrome browser console warning about unsafe header `access-control-expose-headers` when calling Cloud Function ([#2095](https://github.com/parse-community/Parse-SDK-JS/issues/2095)) ([7b73c03](https://github.com/parse-community/Parse-SDK-JS/commit/7b73c033eef8977c3e6c7e4af7146ffa74deed0c))

# [5.1.0-alpha.4](https://github.com/parse-community/Parse-SDK-JS/compare/5.1.0-alpha.3...5.1.0-alpha.4) (2024-04-15)


### Bug Fixes

* Live Query not working on Expo React Native ([#2109](https://github.com/parse-community/Parse-SDK-JS/issues/2109)) ([7a89665](https://github.com/parse-community/Parse-SDK-JS/commit/7a8966522f06efb3f0303b2a3c6fd08f41d8aff9))

# [5.1.0-alpha.3](https://github.com/parse-community/Parse-SDK-JS/compare/5.1.0-alpha.2...5.1.0-alpha.3) (2024-04-14)


### Features

* Lazy load `Parse.CoreManager` controllers to add support for swappable `CryptoController`, `LocalDatastoreController`, `StorageController`, `WebSocketController`, `ParseLiveQuery` ([#2100](https://github.com/parse-community/Parse-SDK-JS/issues/2100)) ([fbd0ab1](https://github.com/parse-community/Parse-SDK-JS/commit/fbd0ab1402792e241c4d9d6496b451e4cc268b8b))

# [5.1.0-alpha.2](https://github.com/parse-community/Parse-SDK-JS/compare/5.1.0-alpha.1...5.1.0-alpha.2) (2024-04-13)


### Bug Fixes

* Local datastore throws error when `Parse.Query.notEqualTo` is set to `null` ([#2102](https://github.com/parse-community/Parse-SDK-JS/issues/2102)) ([6afd32a](https://github.com/parse-community/Parse-SDK-JS/commit/6afd32af3517c88b570505d5cb25bd5ab449f039))

# [5.1.0-alpha.1](https://github.com/parse-community/Parse-SDK-JS/compare/5.0.0...5.1.0-alpha.1) (2024-03-31)


### Features

* Add password validation for user with unverified email via `Parse.User.verifyPassword` using master key and option `ignoreEmailVerification: true` ([#2076](https://github.com/parse-community/Parse-SDK-JS/issues/2076)) ([b0adf7e](https://github.com/parse-community/Parse-SDK-JS/commit/b0adf7e02ab0beea2cd9b759d0f788c69d291491))
* Add support for setting `Parse.ACL` from json ([#2097](https://github.com/parse-community/Parse-SDK-JS/issues/2097)) ([72bc9ac](https://github.com/parse-community/Parse-SDK-JS/commit/72bc9ac3bfb23443a03742fe47a3b1b2713f8c96))

# [5.0.0-alpha.4](https://github.com/parse-community/Parse-SDK-JS/compare/5.0.0-alpha.3...5.0.0-alpha.4) (2024-03-23)


### Features

* Add password validation for user with unverified email via `Parse.User.verifyPassword` using master key and option `ignoreEmailVerification: true` ([#2076](https://github.com/parse-community/Parse-SDK-JS/issues/2076)) ([b0adf7e](https://github.com/parse-community/Parse-SDK-JS/commit/b0adf7e02ab0beea2cd9b759d0f788c69d291491))

# [5.0.0-alpha.3](https://github.com/parse-community/Parse-SDK-JS/compare/5.0.0-alpha.2...5.0.0-alpha.3) (2024-03-11)


Expand Down
14 changes: 14 additions & 0 deletions integration/test/ParseACLTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,20 @@ describe('Parse.ACL', () => {
assert(o);
});

it('can set ACL from json', async () => {
Parse.User.enableUnsafeCurrentUser();
const user = new Parse.User();
const object = new TestObject();
user.set('username', 'torn');
user.set('password', 'acl');
await user.signUp();
const acl = new Parse.ACL(user);
object.setACL(acl);
const json = object.toJSON();
await object.save(json);
assert.equal(acl.equals(object.getACL()), true);
});

it('disables public get access', async () => {
const user = new Parse.User();
const object = new TestObject();
Expand Down
50 changes: 35 additions & 15 deletions integration/test/ParseEventuallyQueueTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,23 +195,49 @@ describe('Parse EventuallyQueue', () => {
const object = new TestObject({ hash: 'saveSecret' });
await new Promise((resolve) => parseServer.server.close(resolve));
await object.saveEventually();
let length = await Parse.EventuallyQueue.length();

const length = await Parse.EventuallyQueue.length();
assert(Parse.EventuallyQueue.isPolling());
assert.strictEqual(length, 1);

await reconfigureServer({});
while (Parse.EventuallyQueue.isPolling()) {
await sleep(100);
}
assert.strictEqual(Parse.EventuallyQueue.isPolling(), false);
const query = new Parse.Query(TestObject);
query.equalTo('hash', 'saveSecret');
let results = await query.find();
while (results.length === 0) {
results = await query.find();
}
assert.strictEqual(results.length, 1);
});

it('can saveEventually on object with ACL', async () => {
Parse.User.enableUnsafeCurrentUser();
const parseServer = await reconfigureServer();
const user = new Parse.User();
user.set('username', 'torn');
user.set('password', 'acl');
await user.signUp();

const acl = new Parse.ACL(user);
const object = new TestObject({ hash: 'saveSecret' });
object.setACL(acl);

while (await Parse.EventuallyQueue.length()) {
await new Promise((resolve) => parseServer.server.close(resolve));
await object.saveEventually();

const length = await Parse.EventuallyQueue.length();
assert(Parse.EventuallyQueue.isPolling());
assert.strictEqual(length, 1);

await reconfigureServer({});

while (Parse.EventuallyQueue.isPolling()) {
await sleep(100);
}
length = await Parse.EventuallyQueue.length();
assert.strictEqual(length, 0);

const query = new Parse.Query(TestObject);
const query = new Parse.Query('TestObject');
query.equalTo('hash', 'saveSecret');
let results = await query.find();
while (results.length === 0) {
Expand All @@ -226,21 +252,15 @@ describe('Parse EventuallyQueue', () => {
await object.save();
await new Promise((resolve) => parseServer.server.close(resolve));
await object.destroyEventually();
let length = await Parse.EventuallyQueue.length();
const length = await Parse.EventuallyQueue.length();

assert(Parse.EventuallyQueue.isPolling());
assert.strictEqual(length, 1);

await reconfigureServer({});
while (Parse.EventuallyQueue.isPolling()) {
await sleep(100);
}
assert.strictEqual(Parse.EventuallyQueue.isPolling(), false);
while (await Parse.EventuallyQueue.length()) {
await sleep(100);
}
length = await Parse.EventuallyQueue.length();
assert.strictEqual(length, 0);

const query = new Parse.Query(TestObject);
query.equalTo('hash', 'deleteSecret');
let results = await query.find();
Expand Down
38 changes: 38 additions & 0 deletions integration/test/ParseLiveQueryTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const assert = require('assert');
const Parse = require('../../node');
const sleep = require('./sleep');
const { resolvingPromise } = require('../../lib/node/promiseUtils');
const { EventEmitter } = require('events');

describe('Parse LiveQuery', () => {
beforeEach(() => {
Expand Down Expand Up @@ -367,4 +368,41 @@ describe('Parse LiveQuery', () => {
client.state = 'closed';
await client.close();
});

it('can subscribe to query with EventEmitter private fields', async () => {
class CustomEmitter {
#privateEmitter;

constructor() {
this.#privateEmitter = new EventEmitter();
}
on(event, listener) {
this.#privateEmitter.on(event, listener);
}
emit(event, ...args) {
this.#privateEmitter.emit(event, ...args);
}
}

const EV = Parse.CoreManager.getEventEmitter();

Parse.CoreManager.setEventEmitter(CustomEmitter);
const object = new TestObject();
await object.save();
const installationId = await Parse.CoreManager.getInstallationController().currentInstallationId();

const query = new Parse.Query(TestObject);
query.equalTo('objectId', object.id);
const subscription = await query.subscribe();
const promise = resolvingPromise();
subscription.on('update', (object, original, response) => {
assert.equal(object.get('foo'), 'bar');
assert.equal(response.installationId, installationId);
promise.resolve();
});
object.set({ foo: 'bar' });
await object.save();
await promise;
Parse.CoreManager.setEventEmitter(EV);
});
});
10 changes: 10 additions & 0 deletions integration/test/ParseLocalDatastoreTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,16 @@ function runTest(controller) {
assert.equal(results.length, 9);
});

it(`${controller.name} can perform notEqualTo null queries`, async () => {
const nullObject = new Parse.Object({ className: 'BoxedNumber', number: null });
await nullObject.save();
const query = new Parse.Query('BoxedNumber');
query.notEqualTo('number', null);
query.fromLocalDatastore();
const results = await query.find();
assert.equal(results.length, 10);
});

it(`${controller.name} can perform containedIn queries`, async () => {
const query = new Parse.Query('BoxedNumber');
query.containedIn('number', [3, 5, 7, 9, 11]);
Expand Down
12 changes: 12 additions & 0 deletions integration/test/ParseObjectTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,18 @@ describe('Parse Object', () => {
assert.strictEqual(result.get('a').b.c.d, 2);
});

it('can set nested fields without repeating pending operations on toJSON (regression test for #1452)', async () => {
const a = new Parse.Object('MyObject');
a.set('obj', {});
await a.save();
a.set('obj.a', 0);
const json = a.toJSON();
expect(json.obj).toEqual({ a: 0 });
expect(new Set(Object.keys(json))).toEqual(
new Set(['objectId', 'createdAt', 'updatedAt', 'obj'])
);
});

it('can increment nested field and retain full object', async () => {
const obj = new Parse.Object('TestIncrementObject');
obj.set('objectField', { number: 5, letter: 'a' });
Expand Down
Loading
Loading