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

Typescript #2044

Open
wants to merge 36 commits into
base: alpha
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c33579c
Fixes pinning of objects that are not ParseObjects into LocalDataStore
swittk Jan 23, 2023
f02589c
added failing test for nested Parse.File (need to shim a more realist…
swittk Jan 23, 2023
94ca52d
eslint unusedvars
swittk Jan 24, 2023
8ad9d51
Merge branch 'alpha' into alpha
mtrezza Jan 24, 2023
42d3944
wrap with jest.fn
swittk Jan 24, 2023
f27d043
Merge branch 'alpha' into alpha
mtrezza Jan 27, 2023
4ea18e6
isEnabled checks
swittk Jan 28, 2023
fce7f31
removed error message
swittk Jan 28, 2023
934e5dc
Merge branch 'parse-community:alpha' into alpha
swittk Feb 1, 2023
7003c94
changed according to suggestions
swittk Feb 1, 2023
ec57dab
Merge branch 'parse-community:alpha' into alpha
swittk Feb 1, 2023
8211212
Merge branch 'alpha' into alpha
swittk Feb 2, 2023
ee0d595
Merge branch 'alpha' into alpha
mtrezza Feb 3, 2023
d50b896
Merge branch 'alpha' into alpha
mtrezza Feb 4, 2023
dc9e705
merge
swittk Oct 29, 2023
352c0ac
bunch of ts
swittk Oct 29, 2023
1ab6249
more
swittk Oct 29, 2023
7188bff
moar types
swittk Oct 29, 2023
1b3ba9d
even more typings
swittk Oct 29, 2023
9839439
more simple files
swittk Oct 29, 2023
b2c27dd
comments
swittk Oct 29, 2023
ee8adf3
added ts files to checks and fixed fixable strict compiler warnings
swittk Oct 29, 2023
a0d2683
more, localdatastore
swittk Oct 29, 2023
3ca292c
added facebook types
swittk Oct 30, 2023
0334a07
added facebook types
swittk Oct 30, 2023
d1b2dde
ok but failing tests
swittk Oct 30, 2023
4604451
reverted changes to tests, try another approach
swittk Oct 30, 2023
606061f
slightly better typings and test correction
swittk Oct 30, 2023
b7a6b27
almost all passes now just need those ParseObject definitions loaded …
swittk Oct 30, 2023
4273ade
fixed more failing tests.. almost there.
swittk Nov 1, 2023
5d55147
all tests passing now
swittk Nov 2, 2023
7edbce7
Merge remote-tracking branch 'upstream/alpha' into typescript
dplewis Nov 10, 2023
7fef8b7
revert unit tests
dplewis Nov 10, 2023
1fb6900
clean up
dplewis Nov 10, 2023
823935d
pin package
dplewis Nov 10, 2023
3b8e4dd
convert all files to ts
dplewis Nov 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"@semantic-release/github": "8.0.7",
"@semantic-release/npm": "9.0.2",
"@semantic-release/release-notes-generator": "10.0.3",
"@types/facebook-js-sdk": "^3.3.9",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of this dep?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's the file FacebookUtils.ts where the FB global is used.

"babel-jest": "29.5.0",
"babel-plugin-inline-package-json": "2.0.0",
"babel-plugin-minify-dead-code-elimination": "0.5.2",
Expand Down
4 changes: 2 additions & 2 deletions src/Analytics.js → src/Analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import CoreManager from './CoreManager';
* @returns {Promise} A promise that is resolved when the round-trip
* to the server completes.
*/
export function track(name: string, dimensions: { [key: string]: string }): Promise {
export function track(name: string, dimensions: { [key: string]: string }): Promise<void> {
name = name || '';
name = name.replace(/^\s*/, '');
name = name.replace(/\s*$/, '');
Expand All @@ -62,7 +62,7 @@ export function track(name: string, dimensions: { [key: string]: string }): Prom
}

const DefaultController = {
track(name, dimensions) {
track(name: string, dimensions: { [key: string]: string }) {
const path = 'events/' + name;
const RESTController = CoreManager.getRESTController();
return RESTController.request('POST', path, { dimensions: dimensions });
Expand Down
2 changes: 1 addition & 1 deletion src/AnonymousUtils.js → src/AnonymousUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import ParseUser from './ParseUser';
import type { RequestOptions } from './RESTController';
const uuidv4 = require('./uuid');
import uuidv4 from './uuid';

let registered = false;

Expand Down
10 changes: 5 additions & 5 deletions src/Cloud.js → src/Cloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ import type { RequestOptions } from './RESTController';
* @returns {Promise} A promise that will be resolved with the result
* of the function.
*/
export function run(name: string, data: mixed, options: RequestOptions): Promise<mixed> {
export function run(name: string, data: any, options: RequestOptions): Promise<any> {
options = options || {};

if (typeof name !== 'string' || name.length === 0) {
throw new TypeError('Cloud function name must be a string.');
}

const requestOptions = {};
const requestOptions: RequestOptions = {};
if (options.useMasterKey) {
requestOptions.useMasterKey = options.useMasterKey;
}
Expand Down Expand Up @@ -82,7 +82,7 @@ export function getJobsData(): Promise<Object> {
* @returns {Promise} A promise that will be resolved with the jobStatusId
* of the job.
*/
export function startJob(name: string, data: mixed): Promise<string> {
export function startJob(name: string, data: any): Promise<string> {
if (typeof name !== 'string' || name.length === 0) {
throw new TypeError('Cloud job name must be a string.');
}
Expand All @@ -106,7 +106,7 @@ export function getJobStatus(jobStatusId: string): Promise<ParseObject> {
}

const DefaultController = {
run(name, data, options: RequestOptions) {
run(name: string, data: any, options: RequestOptions) {
const RESTController = CoreManager.getRESTController();

const payload = encode(data, true);
Expand All @@ -131,7 +131,7 @@ const DefaultController = {
return RESTController.request('GET', 'cloud_code/jobs/data', null, options);
},

async startJob(name, data, options: RequestOptions) {
async startJob(name: string, data: any, options: RequestOptions): Promise<string> {
const RESTController = CoreManager.getRESTController();

const payload = encode(data, true);
Expand Down