@beiguancyc/parse-server 9.9.0-ruixiang.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +176 -0
- package/NOTICE +10 -0
- package/README.md +1311 -0
- package/bin/parse-live-query-server +3 -0
- package/bin/parse-server +3 -0
- package/lib/AccountLockout.js +149 -0
- package/lib/Adapters/AdapterLoader.js +60 -0
- package/lib/Adapters/Analytics/AnalyticsAdapter.js +32 -0
- package/lib/Adapters/Auth/AuthAdapter.js +132 -0
- package/lib/Adapters/Auth/BaseCodeAuthAdapter.js +119 -0
- package/lib/Adapters/Auth/OAuth1Client.js +204 -0
- package/lib/Adapters/Auth/apple.js +125 -0
- package/lib/Adapters/Auth/facebook.js +187 -0
- package/lib/Adapters/Auth/gcenter.js +217 -0
- package/lib/Adapters/Auth/github.js +125 -0
- package/lib/Adapters/Auth/google.js +122 -0
- package/lib/Adapters/Auth/gpgames.js +125 -0
- package/lib/Adapters/Auth/httpsRequest.js +41 -0
- package/lib/Adapters/Auth/index.js +248 -0
- package/lib/Adapters/Auth/instagram.js +118 -0
- package/lib/Adapters/Auth/janraincapture.js +85 -0
- package/lib/Adapters/Auth/janrainengage.js +57 -0
- package/lib/Adapters/Auth/keycloak.js +168 -0
- package/lib/Adapters/Auth/ldap.js +193 -0
- package/lib/Adapters/Auth/line.js +125 -0
- package/lib/Adapters/Auth/linkedin.js +117 -0
- package/lib/Adapters/Auth/meetup.js +44 -0
- package/lib/Adapters/Auth/mfa.js +334 -0
- package/lib/Adapters/Auth/microsoft.js +111 -0
- package/lib/Adapters/Auth/oauth2.js +115 -0
- package/lib/Adapters/Auth/phantauth.js +53 -0
- package/lib/Adapters/Auth/qq.js +113 -0
- package/lib/Adapters/Auth/spotify.js +115 -0
- package/lib/Adapters/Auth/twitter.js +197 -0
- package/lib/Adapters/Auth/utils.js +28 -0
- package/lib/Adapters/Auth/vkontakte.js +55 -0
- package/lib/Adapters/Auth/wechat.js +110 -0
- package/lib/Adapters/Auth/weibo.js +141 -0
- package/lib/Adapters/Cache/CacheAdapter.js +40 -0
- package/lib/Adapters/Cache/InMemoryCache.js +61 -0
- package/lib/Adapters/Cache/InMemoryCacheAdapter.js +34 -0
- package/lib/Adapters/Cache/LRUCache.js +35 -0
- package/lib/Adapters/Cache/NullCacheAdapter.js +26 -0
- package/lib/Adapters/Cache/RedisCacheAdapter.js +109 -0
- package/lib/Adapters/Cache/SchemaCache.js +25 -0
- package/lib/Adapters/Email/MailAdapter.js +32 -0
- package/lib/Adapters/Files/FilesAdapter.js +129 -0
- package/lib/Adapters/Files/GridFSBucketAdapter.js +280 -0
- package/lib/Adapters/Files/GridStoreAdapter.js +5 -0
- package/lib/Adapters/Logger/LoggerAdapter.js +27 -0
- package/lib/Adapters/Logger/WinstonLogger.js +107 -0
- package/lib/Adapters/Logger/WinstonLoggerAdapter.js +63 -0
- package/lib/Adapters/MessageQueue/EventEmitterMQ.js +55 -0
- package/lib/Adapters/PubSub/EventEmitterPubSub.js +53 -0
- package/lib/Adapters/PubSub/PubSubAdapter.js +34 -0
- package/lib/Adapters/PubSub/RedisPubSub.js +49 -0
- package/lib/Adapters/Push/PushAdapter.js +40 -0
- package/lib/Adapters/Storage/Mongo/MongoCollection.js +212 -0
- package/lib/Adapters/Storage/Mongo/MongoSchemaCollection.js +334 -0
- package/lib/Adapters/Storage/Mongo/MongoStorageAdapter.js +1047 -0
- package/lib/Adapters/Storage/Mongo/MongoTransform.js +1397 -0
- package/lib/Adapters/Storage/Postgres/PostgresClient.js +38 -0
- package/lib/Adapters/Storage/Postgres/PostgresConfigParser.js +73 -0
- package/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js +2409 -0
- package/lib/Adapters/Storage/Postgres/sql/array/add-unique.sql +11 -0
- package/lib/Adapters/Storage/Postgres/sql/array/add.sql +11 -0
- package/lib/Adapters/Storage/Postgres/sql/array/contains-all-regex.sql +14 -0
- package/lib/Adapters/Storage/Postgres/sql/array/contains-all.sql +14 -0
- package/lib/Adapters/Storage/Postgres/sql/array/contains.sql +11 -0
- package/lib/Adapters/Storage/Postgres/sql/array/remove.sql +11 -0
- package/lib/Adapters/Storage/Postgres/sql/index.js +32 -0
- package/lib/Adapters/Storage/Postgres/sql/misc/json-object-set-keys.sql +19 -0
- package/lib/Adapters/Storage/StorageAdapter.js +2 -0
- package/lib/Adapters/WebSocketServer/WSAdapter.js +35 -0
- package/lib/Adapters/WebSocketServer/WSSAdapter.js +66 -0
- package/lib/Auth.js +687 -0
- package/lib/AuthDataLock.js +53 -0
- package/lib/ClientSDK.js +39 -0
- package/lib/Config.js +879 -0
- package/lib/Controllers/AdaptableController.js +72 -0
- package/lib/Controllers/AnalyticsController.js +43 -0
- package/lib/Controllers/CacheController.js +71 -0
- package/lib/Controllers/DatabaseController.js +1685 -0
- package/lib/Controllers/FilesController.js +122 -0
- package/lib/Controllers/HooksController.js +254 -0
- package/lib/Controllers/LiveQueryController.js +72 -0
- package/lib/Controllers/LoggerController.js +222 -0
- package/lib/Controllers/ParseGraphQLController.js +294 -0
- package/lib/Controllers/PushController.js +224 -0
- package/lib/Controllers/SchemaController.js +1563 -0
- package/lib/Controllers/UserController.js +364 -0
- package/lib/Controllers/index.js +251 -0
- package/lib/Controllers/types.js +2 -0
- package/lib/Deprecator/Deprecations.js +100 -0
- package/lib/Deprecator/Deprecator.js +140 -0
- package/lib/Error.js +50 -0
- package/lib/FileUrlValidator.js +69 -0
- package/lib/GraphQL/ParseGraphQLSchema.js +375 -0
- package/lib/GraphQL/ParseGraphQLServer.js +241 -0
- package/lib/GraphQL/helpers/objectsMutations.js +30 -0
- package/lib/GraphQL/helpers/objectsQueries.js +246 -0
- package/lib/GraphQL/helpers/queryComplexity.js +138 -0
- package/lib/GraphQL/loaders/configMutations.js +87 -0
- package/lib/GraphQL/loaders/configQueries.js +79 -0
- package/lib/GraphQL/loaders/defaultGraphQLMutations.js +21 -0
- package/lib/GraphQL/loaders/defaultGraphQLQueries.js +23 -0
- package/lib/GraphQL/loaders/defaultGraphQLTypes.js +1099 -0
- package/lib/GraphQL/loaders/defaultRelaySchema.js +53 -0
- package/lib/GraphQL/loaders/filesMutations.js +107 -0
- package/lib/GraphQL/loaders/functionsMutations.js +77 -0
- package/lib/GraphQL/loaders/parseClassMutations.js +267 -0
- package/lib/GraphQL/loaders/parseClassQueries.js +126 -0
- package/lib/GraphQL/loaders/parseClassTypes.js +493 -0
- package/lib/GraphQL/loaders/schemaDirectives.js +62 -0
- package/lib/GraphQL/loaders/schemaMutations.js +161 -0
- package/lib/GraphQL/loaders/schemaQueries.js +80 -0
- package/lib/GraphQL/loaders/schemaTypes.js +341 -0
- package/lib/GraphQL/loaders/usersMutations.js +433 -0
- package/lib/GraphQL/loaders/usersQueries.js +90 -0
- package/lib/GraphQL/parseGraphQLUtils.js +71 -0
- package/lib/GraphQL/transformers/className.js +14 -0
- package/lib/GraphQL/transformers/constraintType.js +53 -0
- package/lib/GraphQL/transformers/inputType.js +51 -0
- package/lib/GraphQL/transformers/mutation.js +280 -0
- package/lib/GraphQL/transformers/outputType.js +51 -0
- package/lib/GraphQL/transformers/query.js +237 -0
- package/lib/GraphQL/transformers/schemaFields.js +99 -0
- package/lib/InstallationDedup.js +178 -0
- package/lib/KeyPromiseQueue.js +48 -0
- package/lib/LiveQuery/Client.js +90 -0
- package/lib/LiveQuery/Id.js +20 -0
- package/lib/LiveQuery/ParseCloudCodePublisher.js +54 -0
- package/lib/LiveQuery/ParseLiveQueryServer.js +1071 -0
- package/lib/LiveQuery/ParsePubSub.js +37 -0
- package/lib/LiveQuery/ParseWebSocketServer.js +66 -0
- package/lib/LiveQuery/QueryTools.js +443 -0
- package/lib/LiveQuery/RequestSchema.js +161 -0
- package/lib/LiveQuery/SessionTokenCache.js +51 -0
- package/lib/LiveQuery/Subscription.js +47 -0
- package/lib/LiveQuery/equalObjects.js +50 -0
- package/lib/Options/Definitions.js +1599 -0
- package/lib/Options/docs.js +389 -0
- package/lib/Options/index.js +12 -0
- package/lib/Options/parsers.js +89 -0
- package/lib/Page.js +44 -0
- package/lib/ParseMessageQueue.js +24 -0
- package/lib/ParseServer.js +632 -0
- package/lib/ParseServerRESTController.js +173 -0
- package/lib/PromiseRouter.js +208 -0
- package/lib/Push/PushQueue.js +67 -0
- package/lib/Push/PushWorker.js +101 -0
- package/lib/Push/utils.js +129 -0
- package/lib/RestQuery.js +1208 -0
- package/lib/RestWrite.js +1671 -0
- package/lib/Routers/AggregateRouter.js +150 -0
- package/lib/Routers/AnalyticsRouter.js +26 -0
- package/lib/Routers/AudiencesRouter.js +54 -0
- package/lib/Routers/ClassesRouter.js +191 -0
- package/lib/Routers/CloudCodeRouter.js +87 -0
- package/lib/Routers/FeaturesRouter.js +72 -0
- package/lib/Routers/FilesRouter.js +772 -0
- package/lib/Routers/FunctionsRouter.js +341 -0
- package/lib/Routers/GlobalConfigRouter.js +123 -0
- package/lib/Routers/GraphQLRouter.js +41 -0
- package/lib/Routers/HooksRouter.js +121 -0
- package/lib/Routers/IAPValidationRouter.js +113 -0
- package/lib/Routers/InstallationsRouter.js +46 -0
- package/lib/Routers/LogsRouter.js +57 -0
- package/lib/Routers/PagesRouter.js +676 -0
- package/lib/Routers/PurgeRouter.js +45 -0
- package/lib/Routers/PushRouter.js +75 -0
- package/lib/Routers/RolesRouter.js +33 -0
- package/lib/Routers/SchemasRouter.js +118 -0
- package/lib/Routers/SecurityRouter.js +34 -0
- package/lib/Routers/SessionsRouter.js +126 -0
- package/lib/Routers/UsersRouter.js +733 -0
- package/lib/SchemaMigrations/DefinedSchemas.js +379 -0
- package/lib/SchemaMigrations/Migrations.js +30 -0
- package/lib/Security/Check.js +109 -0
- package/lib/Security/CheckGroup.js +44 -0
- package/lib/Security/CheckGroups/CheckGroupDatabase.js +44 -0
- package/lib/Security/CheckGroups/CheckGroupServerConfig.js +160 -0
- package/lib/Security/CheckGroups/CheckGroups.js +21 -0
- package/lib/Security/CheckRunner.js +213 -0
- package/lib/SharedRest.js +34 -0
- package/lib/StatusHandler.js +329 -0
- package/lib/TestUtils.js +87 -0
- package/lib/Utils.js +577 -0
- package/lib/batch.js +185 -0
- package/lib/cache.js +12 -0
- package/lib/cli/definitions/parse-live-query-server.js +9 -0
- package/lib/cli/definitions/parse-server.js +9 -0
- package/lib/cli/parse-live-query-server.js +14 -0
- package/lib/cli/parse-server.js +101 -0
- package/lib/cli/utils/commander.js +132 -0
- package/lib/cli/utils/runner.js +53 -0
- package/lib/cloud-code/Parse.Cloud.js +797 -0
- package/lib/cloud-code/Parse.Server.js +21 -0
- package/lib/cryptoUtils.js +54 -0
- package/lib/defaults.js +58 -0
- package/lib/deprecated.js +12 -0
- package/lib/index.js +89 -0
- package/lib/logger.js +40 -0
- package/lib/middlewares.js +810 -0
- package/lib/password.js +40 -0
- package/lib/request.js +175 -0
- package/lib/requiredParameter.js +11 -0
- package/lib/rest.js +264 -0
- package/lib/triggers.js +949 -0
- package/lib/vendor/README.md +8 -0
- package/lib/vendor/mongodbUrl.js +1012 -0
- package/package.json +172 -0
- package/postinstall.js +38 -0
- package/public/custom_json.html +17 -0
- package/public/custom_json.json +23 -0
- package/public/custom_page.html +15 -0
- package/public/de/email_verification_link_expired.html +24 -0
- package/public/de/email_verification_link_invalid.html +21 -0
- package/public/de/email_verification_send_fail.html +21 -0
- package/public/de/email_verification_send_success.html +19 -0
- package/public/de/email_verification_success.html +18 -0
- package/public/de/password_reset.html +65 -0
- package/public/de/password_reset_link_invalid.html +19 -0
- package/public/de/password_reset_success.html +18 -0
- package/public/de-AT/email_verification_link_expired.html +24 -0
- package/public/de-AT/email_verification_link_invalid.html +21 -0
- package/public/de-AT/email_verification_send_fail.html +21 -0
- package/public/de-AT/email_verification_send_success.html +19 -0
- package/public/de-AT/email_verification_success.html +18 -0
- package/public/de-AT/password_reset.html +65 -0
- package/public/de-AT/password_reset_link_invalid.html +19 -0
- package/public/de-AT/password_reset_success.html +18 -0
- package/public/email_verification_link_expired.html +24 -0
- package/public/email_verification_link_invalid.html +21 -0
- package/public/email_verification_send_fail.html +21 -0
- package/public/email_verification_send_success.html +19 -0
- package/public/email_verification_success.html +18 -0
- package/public/password_reset.html +65 -0
- package/public/password_reset_link_invalid.html +19 -0
- package/public/password_reset_success.html +18 -0
- package/types/@types/@parse/fs-files-adapter/index.d.ts +5 -0
- package/types/@types/deepcopy/index.d.ts +5 -0
- package/types/LiveQuery/ParseLiveQueryServer.d.ts +40 -0
- package/types/Options/index.d.ts +320 -0
- package/types/ParseServer.d.ts +65 -0
- package/types/eslint.config.mjs +30 -0
- package/types/index.d.ts +21 -0
- package/types/logger.d.ts +2 -0
- package/types/tests.ts +44 -0
- package/types/tsconfig.json +24 -0
- package/views/choose_password +215 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ParseServerOptions, LiveQueryServerOptions } from './Options';
|
|
2
|
+
import { ParseLiveQueryServer } from './LiveQuery/ParseLiveQueryServer';
|
|
3
|
+
declare class ParseServer {
|
|
4
|
+
_app: any;
|
|
5
|
+
config: any;
|
|
6
|
+
server: any;
|
|
7
|
+
expressApp: any;
|
|
8
|
+
liveQueryServer: any;
|
|
9
|
+
/**
|
|
10
|
+
* @constructor
|
|
11
|
+
* @param {ParseServerOptions} options the parse server initialization options
|
|
12
|
+
*/
|
|
13
|
+
constructor(options: ParseServerOptions);
|
|
14
|
+
/**
|
|
15
|
+
* Starts Parse Server as an express app; this promise resolves when Parse Server is ready to accept requests.
|
|
16
|
+
*/
|
|
17
|
+
start(): Promise<this>;
|
|
18
|
+
get app(): any;
|
|
19
|
+
/**
|
|
20
|
+
* Stops the parse server, cancels any ongoing requests and closes all connections.
|
|
21
|
+
*
|
|
22
|
+
* Currently, express doesn't shut down immediately after receiving SIGINT/SIGTERM
|
|
23
|
+
* if it has client connections that haven't timed out.
|
|
24
|
+
* (This is a known issue with node - https://github.com/nodejs/node/issues/2642)
|
|
25
|
+
*
|
|
26
|
+
* @returns {Promise<void>} a promise that resolves when the server is stopped
|
|
27
|
+
*/
|
|
28
|
+
handleShutdown(): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* @static
|
|
31
|
+
* Allow developers to customize each request with inversion of control/dependency injection
|
|
32
|
+
*/
|
|
33
|
+
static applyRequestContextMiddleware(api: any, options: any): void;
|
|
34
|
+
/**
|
|
35
|
+
* @static
|
|
36
|
+
* Create an express app for the parse server
|
|
37
|
+
* @param {Object} options let you specify the maxUploadSize when creating the express app */
|
|
38
|
+
static app(options: any): any;
|
|
39
|
+
static promiseRouter({ appId }: {
|
|
40
|
+
appId: any;
|
|
41
|
+
}): any;
|
|
42
|
+
/**
|
|
43
|
+
* starts the parse server's express app
|
|
44
|
+
* @param {ParseServerOptions} options to use to start the server
|
|
45
|
+
* @returns {ParseServer} the parse server instance
|
|
46
|
+
*/
|
|
47
|
+
startApp(options: ParseServerOptions): Promise<this>;
|
|
48
|
+
/**
|
|
49
|
+
* Creates a new ParseServer and starts it.
|
|
50
|
+
* @param {ParseServerOptions} options used to start the server
|
|
51
|
+
* @returns {ParseServer} the parse server instance
|
|
52
|
+
*/
|
|
53
|
+
static startApp(options: ParseServerOptions): Promise<ParseServer>;
|
|
54
|
+
/**
|
|
55
|
+
* Helper method to create a liveQuery server
|
|
56
|
+
* @static
|
|
57
|
+
* @param {Server} httpServer an optional http server to pass
|
|
58
|
+
* @param {LiveQueryServerOptions} config options for the liveQueryServer
|
|
59
|
+
* @param {ParseServerOptions} options options for the ParseServer
|
|
60
|
+
* @returns {Promise<ParseLiveQueryServer>} the live query server instance
|
|
61
|
+
*/
|
|
62
|
+
static createLiveQueryServer(httpServer: any, config: LiveQueryServerOptions, options: ParseServerOptions): Promise<ParseLiveQueryServer>;
|
|
63
|
+
static verifyServerUrl(): any;
|
|
64
|
+
}
|
|
65
|
+
export default ParseServer;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import eslint from '@eslint/js';
|
|
2
|
+
import tseslint from 'typescript-eslint';
|
|
3
|
+
import expectType from 'eslint-plugin-expect-type/configs/recommended';
|
|
4
|
+
|
|
5
|
+
export default tseslint.config({
|
|
6
|
+
files: ['**/*.js', '**/*.ts'],
|
|
7
|
+
extends: [
|
|
8
|
+
expectType,
|
|
9
|
+
eslint.configs.recommended,
|
|
10
|
+
...tseslint.configs.recommended,
|
|
11
|
+
...tseslint.configs.recommendedTypeChecked,
|
|
12
|
+
],
|
|
13
|
+
plugins: {
|
|
14
|
+
'@typescript-eslint': tseslint.plugin,
|
|
15
|
+
},
|
|
16
|
+
rules: {
|
|
17
|
+
'@typescript-eslint/no-unused-vars': 'off',
|
|
18
|
+
'@typescript-eslint/no-unused-expressions': 'off',
|
|
19
|
+
'@typescript-eslint/no-unsafe-call': 'off',
|
|
20
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
21
|
+
"@typescript-eslint/no-unsafe-return": "off",
|
|
22
|
+
},
|
|
23
|
+
languageOptions: {
|
|
24
|
+
parser: tseslint.parser,
|
|
25
|
+
parserOptions: {
|
|
26
|
+
projectService: true,
|
|
27
|
+
tsconfigRootDir: import.meta.dirname,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
});
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import ParseServer from './ParseServer';
|
|
2
|
+
import FileSystemAdapter from '@parse/fs-files-adapter';
|
|
3
|
+
import InMemoryCacheAdapter from './Adapters/Cache/InMemoryCacheAdapter';
|
|
4
|
+
import NullCacheAdapter from './Adapters/Cache/NullCacheAdapter';
|
|
5
|
+
import RedisCacheAdapter from './Adapters/Cache/RedisCacheAdapter';
|
|
6
|
+
import LRUCacheAdapter from './Adapters/Cache/LRUCache.js';
|
|
7
|
+
import * as TestUtils from './TestUtils';
|
|
8
|
+
import * as SchemaMigrations from './SchemaMigrations/Migrations';
|
|
9
|
+
import AuthAdapter from './Adapters/Auth/AuthAdapter';
|
|
10
|
+
import { PushWorker } from './Push/PushWorker';
|
|
11
|
+
import { ParseServerOptions } from './Options';
|
|
12
|
+
import { ParseGraphQLServer } from './GraphQL/ParseGraphQLServer';
|
|
13
|
+
declare const _ParseServer: {
|
|
14
|
+
(options: ParseServerOptions): ParseServer;
|
|
15
|
+
createLiveQueryServer: typeof ParseServer.createLiveQueryServer;
|
|
16
|
+
startApp: typeof ParseServer.startApp;
|
|
17
|
+
};
|
|
18
|
+
declare const S3Adapter: any;
|
|
19
|
+
declare const GCSAdapter: any;
|
|
20
|
+
export default ParseServer;
|
|
21
|
+
export { S3Adapter, GCSAdapter, FileSystemAdapter, InMemoryCacheAdapter, NullCacheAdapter, RedisCacheAdapter, LRUCacheAdapter, TestUtils, PushWorker, ParseGraphQLServer, _ParseServer as ParseServer, SchemaMigrations, AuthAdapter, };
|
package/types/tests.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import ParseServer, { FileSystemAdapter } from 'parse-server';
|
|
2
|
+
|
|
3
|
+
async function server() {
|
|
4
|
+
// $ExpectType ParseServer
|
|
5
|
+
const parseServer = await ParseServer.startApp({});
|
|
6
|
+
|
|
7
|
+
// $ExpectType void
|
|
8
|
+
await parseServer.handleShutdown();
|
|
9
|
+
|
|
10
|
+
// $ExpectType any
|
|
11
|
+
parseServer.app;
|
|
12
|
+
|
|
13
|
+
// $ExpectType any
|
|
14
|
+
ParseServer.app({});
|
|
15
|
+
|
|
16
|
+
// $ExpectType any
|
|
17
|
+
ParseServer.promiseRouter({ appId: 'appId' });
|
|
18
|
+
|
|
19
|
+
// $ExpectType ParseLiveQueryServer
|
|
20
|
+
await ParseServer.createLiveQueryServer({}, {}, {});
|
|
21
|
+
|
|
22
|
+
// $ExpectType any
|
|
23
|
+
ParseServer.verifyServerUrl();
|
|
24
|
+
|
|
25
|
+
// $ExpectError
|
|
26
|
+
await ParseServer.startApp();
|
|
27
|
+
|
|
28
|
+
// $ExpectError
|
|
29
|
+
ParseServer.promiseRouter();
|
|
30
|
+
|
|
31
|
+
// $ExpectError
|
|
32
|
+
await ParseServer.createLiveQueryServer();
|
|
33
|
+
|
|
34
|
+
// $ExpectType ParseServer
|
|
35
|
+
const parseServer2 = new ParseServer({});
|
|
36
|
+
|
|
37
|
+
// $ExpectType ParseServer
|
|
38
|
+
await parseServer2.start();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function exports() {
|
|
42
|
+
// $ExpectType any
|
|
43
|
+
FileSystemAdapter;
|
|
44
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"lib": ["es6"],
|
|
5
|
+
"noImplicitAny": true,
|
|
6
|
+
"noImplicitThis": true,
|
|
7
|
+
"strictFunctionTypes": true,
|
|
8
|
+
"strictNullChecks": true,
|
|
9
|
+
"types": [],
|
|
10
|
+
"noEmit": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
|
|
13
|
+
// If the library is an external module (uses `export`), this allows your test file to import "mylib" instead of "./index".
|
|
14
|
+
// If the library is global (cannot be imported via `import` or `require`), leave this out.
|
|
15
|
+
"baseUrl": ".",
|
|
16
|
+
"paths": {
|
|
17
|
+
"parse-server": ["."],
|
|
18
|
+
"@parse/fs-files-adapter": ["./@types/@parse/fs-files-adapter"],
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"include": [
|
|
22
|
+
"tests.ts"
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<!-- This page is displayed when someone clicks a valid 'reset password' link.
|
|
4
|
+
Users should feel free to add to this page (i.e. branding or security widgets)
|
|
5
|
+
but should be sure not to delete any of the form inputs or the javascript from the
|
|
6
|
+
template file. This javascript is what adds the necessary values to authenticate
|
|
7
|
+
this session with Parse.
|
|
8
|
+
The query params 'username' and 'app' hold the friendly names for your current user and
|
|
9
|
+
your app. You should feel free to incorporate their values to make the page more personal.
|
|
10
|
+
If you are missing form parameters in your POST, Parse will navigate back to this page and
|
|
11
|
+
add an 'error' query parameter.
|
|
12
|
+
-->
|
|
13
|
+
<head>
|
|
14
|
+
<title>Password Reset</title>
|
|
15
|
+
<style type='text/css'>
|
|
16
|
+
h1 {
|
|
17
|
+
display: block;
|
|
18
|
+
font: inherit;
|
|
19
|
+
font-size: 30px;
|
|
20
|
+
font-weight: 600;
|
|
21
|
+
height: 30px;
|
|
22
|
+
line-height: 30px;
|
|
23
|
+
margin: 45px 0px 45px 0px;
|
|
24
|
+
padding: 0px 8px 0px 8px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.error {
|
|
28
|
+
color: red;
|
|
29
|
+
padding: 0px 8px 0px 8px;
|
|
30
|
+
margin: -25px 0px -20px 0px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
body {
|
|
34
|
+
font-family: 'Open Sans', 'Helvetica Neue', Helvetica;
|
|
35
|
+
color: #0067AB;
|
|
36
|
+
margin: 15px 99px 0px 98px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
label {
|
|
40
|
+
color: #666666;
|
|
41
|
+
}
|
|
42
|
+
form {
|
|
43
|
+
margin: 0px 0px 45px 0px;
|
|
44
|
+
padding: 0px 8px 0px 8px;
|
|
45
|
+
}
|
|
46
|
+
form > * {
|
|
47
|
+
display: block;
|
|
48
|
+
margin-top: 25px;
|
|
49
|
+
margin-bottom: 7px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
button {
|
|
53
|
+
font-size: 22px;
|
|
54
|
+
color: white;
|
|
55
|
+
background: #0067AB;
|
|
56
|
+
-moz-border-radius: 5px;
|
|
57
|
+
-webkit-border-radius: 5px;
|
|
58
|
+
-o-border-radius: 5px;
|
|
59
|
+
-ms-border-radius: 5px;
|
|
60
|
+
-khtml-border-radius: 5px;
|
|
61
|
+
border-radius: 5px;
|
|
62
|
+
background-image: -webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#0070BA),color-stop(100%,#00558C));
|
|
63
|
+
background-image: -webkit-linear-gradient(#0070BA,#00558C);
|
|
64
|
+
background-image: -moz-linear-gradient(#0070BA,#00558C);
|
|
65
|
+
background-image: -o-linear-gradient(#0070BA,#00558C);
|
|
66
|
+
background-image: -ms-linear-gradient(#0070BA,#00558C);
|
|
67
|
+
background-image: linear-gradient(#0070BA,#00558C);
|
|
68
|
+
-moz-box-shadow: inset 0 1px 0 0 #0076c4;
|
|
69
|
+
-webkit-box-shadow: inset 0 1px 0 0 #0076c4;
|
|
70
|
+
-o-box-shadow: inset 0 1px 0 0 #0076c4;
|
|
71
|
+
box-shadow: inset 0 1px 0 0 #0076c4;
|
|
72
|
+
border: 1px solid #005E9C;
|
|
73
|
+
padding: 10px 14px;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
outline: none;
|
|
76
|
+
display: block;
|
|
77
|
+
font-family: "Helvetica Neue",Helvetica;
|
|
78
|
+
|
|
79
|
+
-webkit-box-align: center;
|
|
80
|
+
text-align: center;
|
|
81
|
+
box-sizing: border-box;
|
|
82
|
+
letter-spacing: normal;
|
|
83
|
+
word-spacing: normal;
|
|
84
|
+
line-height: normal;
|
|
85
|
+
text-transform: none;
|
|
86
|
+
text-indent: 0px;
|
|
87
|
+
text-shadow: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
button:hover {
|
|
91
|
+
background-image: -webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#0079CA),color-stop(100%,#005E9C));
|
|
92
|
+
background-image: -webkit-linear-gradient(#0079CA,#005E9C);
|
|
93
|
+
background-image: -moz-linear-gradient(#0079CA,#005E9C);
|
|
94
|
+
background-image: -o-linear-gradient(#0079CA,#005E9C);
|
|
95
|
+
background-image: -ms-linear-gradient(#0079CA,#005E9C);
|
|
96
|
+
background-image: linear-gradient(#0079CA,#005E9C);
|
|
97
|
+
-moz-box-shadow: inset 0 0 0 0 #0076c4;
|
|
98
|
+
-webkit-box-shadow: inset 0 0 0 0 #0076c4;
|
|
99
|
+
-o-box-shadow: inset 0 0 0 0 #0076c4;
|
|
100
|
+
box-shadow: inset 0 0 0 0 #0076c4;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
button:active {
|
|
104
|
+
background-image: -webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#00395E),color-stop(100%,#005891));
|
|
105
|
+
background-image: -webkit-linear-gradient(#00395E,#005891);
|
|
106
|
+
background-image: -moz-linear-gradient(#00395E,#005891);
|
|
107
|
+
background-image: -o-linear-gradient(#00395E,#005891);
|
|
108
|
+
background-image: -ms-linear-gradient(#00395E,#005891);
|
|
109
|
+
background-image: linear-gradient(#00395E,#005891);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
button:disabled,
|
|
113
|
+
button[disabled] {
|
|
114
|
+
opacity: 0.5;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
input {
|
|
118
|
+
color: black;
|
|
119
|
+
cursor: auto;
|
|
120
|
+
display: inline-block;
|
|
121
|
+
font-family: 'Helvetica Neue', Helvetica;
|
|
122
|
+
font-size: 25px;
|
|
123
|
+
height: 30px;
|
|
124
|
+
letter-spacing: normal;
|
|
125
|
+
line-height: normal;
|
|
126
|
+
margin: 2px 0px 2px 0px;
|
|
127
|
+
padding: 5px;
|
|
128
|
+
text-transform: none;
|
|
129
|
+
vertical-align: baseline;
|
|
130
|
+
width: 500px;
|
|
131
|
+
word-spacing: 0px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
#password_match_info {
|
|
135
|
+
margin-top: 0px;
|
|
136
|
+
font-size: 13px;
|
|
137
|
+
color: red;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
</style>
|
|
141
|
+
</head>
|
|
142
|
+
<body>
|
|
143
|
+
<h1>Reset Your Password<span id='app'></span></h1>
|
|
144
|
+
<noscript>We apologize, but resetting your password requires javascript</noscript>
|
|
145
|
+
<div class='error' id='error'></div>
|
|
146
|
+
<form id='form' action='#' method='POST'>
|
|
147
|
+
<label>New Password for <span id='username_label'></span></label>
|
|
148
|
+
|
|
149
|
+
<span>New Password</span>
|
|
150
|
+
<input name="new_password" type="password" id="password"/> <br>
|
|
151
|
+
|
|
152
|
+
<span>Confirm New Password</span>
|
|
153
|
+
<input name="confirm_new_password" type="password" id="password_confirm"/>
|
|
154
|
+
<span id="password_match_info"></span>
|
|
155
|
+
|
|
156
|
+
<input name='utf-8' type='hidden' value='✓' />
|
|
157
|
+
<input name="username" id="username" type="hidden" />
|
|
158
|
+
<input name="token" id="token" type="hidden" />
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
<button id="change_password">Change Password</button>
|
|
162
|
+
</form>
|
|
163
|
+
|
|
164
|
+
<script language='javascript' type='text/javascript'>
|
|
165
|
+
<!--
|
|
166
|
+
window.onload = function() {
|
|
167
|
+
var urlParams = {};
|
|
168
|
+
(function () {
|
|
169
|
+
var pair, // Really a match. Index 0 is the full match; 1 & 2 are the key & val.
|
|
170
|
+
tokenize = /([^&=]+)=?([^&]*)/g,
|
|
171
|
+
// decodeURIComponents escapes everything but will leave +s that should be ' '
|
|
172
|
+
re_space = function (s) { return decodeURIComponent(s.replace(/\+/g, " ")); },
|
|
173
|
+
// Substring to cut off the leading '?'
|
|
174
|
+
querystring = window.location.search.substring(1);
|
|
175
|
+
|
|
176
|
+
while (pair = tokenize.exec(querystring))
|
|
177
|
+
urlParams[re_space(pair[1])] = re_space(pair[2]);
|
|
178
|
+
})();
|
|
179
|
+
|
|
180
|
+
var id = urlParams['id'];
|
|
181
|
+
var base = PARSE_SERVER_URL;
|
|
182
|
+
document.getElementById('form').setAttribute('action', base + '/apps/' + id + '/request_password_reset');
|
|
183
|
+
document.getElementById('username').value = urlParams['username'];
|
|
184
|
+
document.getElementById('username_label').appendChild(document.createTextNode(urlParams['username']));
|
|
185
|
+
document.getElementById("password").oninput = validatePassword;
|
|
186
|
+
document.getElementById("password_confirm").oninput = validatePassword;
|
|
187
|
+
document.getElementById("change_password").disabled = true;
|
|
188
|
+
|
|
189
|
+
document.getElementById('token').value = urlParams['token'];
|
|
190
|
+
if (urlParams['error']) {
|
|
191
|
+
document.getElementById('error').appendChild(document.createTextNode(urlParams['error']));
|
|
192
|
+
}
|
|
193
|
+
if (urlParams['app']) {
|
|
194
|
+
document.getElementById('app').appendChild(document.createTextNode(' for ' + urlParams['app']));
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function validatePassword() {
|
|
198
|
+
var pass2 = document.getElementById("password").value;
|
|
199
|
+
var pass1 = document.getElementById("password_confirm").value;
|
|
200
|
+
if(pass1 !== pass2) {
|
|
201
|
+
if(document.getElementById("password_confirm").value) {
|
|
202
|
+
document.getElementById("change_password").disabled = true;
|
|
203
|
+
document.getElementById("password_match_info").innerHTML = "Must match the previous entry";
|
|
204
|
+
}
|
|
205
|
+
} else {
|
|
206
|
+
document.getElementById("change_password").disabled = false;
|
|
207
|
+
document.getElementById("password_match_info").innerHTML = "";
|
|
208
|
+
}
|
|
209
|
+
//empty string means no validation error
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
}
|
|
213
|
+
//-->
|
|
214
|
+
</script>
|
|
215
|
+
</body>
|