How to use the parse/node.applicationId function in parse

To help you get started, we’ve selected a few parse examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github parse-community / parse-server / spec / ParseCloudCodePublisher.spec.js View on Github external
it('can handle cloud code afterSave request', function() {
    const publisher = new ParseCloudCodePublisher({});
    publisher._onCloudCodeMessage = jasmine.createSpy('onCloudCodeMessage');
    const request = {};
    publisher.onCloudCodeAfterSave(request);

    expect(publisher._onCloudCodeMessage).toHaveBeenCalledWith(
      Parse.applicationId + 'afterSave',
      request
    );
  });
github parse-community / parse-server / spec / ReadPreferenceOption.spec.js View on Github external
it('should find in primary by default', done => {
    const databaseAdapter = Config.get(Parse.applicationId).database.adapter;

    const obj0 = new Parse.Object('MyObject');
    obj0.set('boolKey', false);
    const obj1 = new Parse.Object('MyObject');
    obj1.set('boolKey', true);

    Parse.Object.saveAll([obj0, obj1])
      .then(() => {
        spyOn(
          databaseAdapter.database.serverConfig,
          'cursor'
        ).and.callThrough();

        const query = new Parse.Query('MyObject');
        query.equalTo('boolKey', false);
github parse-community / parse-server / spec / ParseLiveQueryServer.spec.js View on Github external
return new Promise((resolve, reject) => {
        op(
          {
            url: Parse.serverURL + '/schemas/' + className,
            headers: {
              'X-Parse-Application-Id': Parse.applicationId,
              'X-Parse-Master-Key': Parse.masterKey,
            },
            json: true,
            body: {
              classLevelPermissions: permissions,
            },
          },
          (error, response, body) => {
            if (error) {
              return reject(error);
            }
            if (body.error) {
              return reject(body);
            }
            return resolve(body);
          }
github parse-community / parse-server / src / triggers.js View on Github external
export function runLiveQueryEventHandlers(
  data,
  applicationId = Parse.applicationId
) {
  if (
    !_triggerStore ||
    !_triggerStore[applicationId] ||
    !_triggerStore[applicationId].LiveQuery
  ) {
    return;
  }
  _triggerStore[applicationId].LiveQuery.forEach(handler => handler(data));
}
github parse-community / parse-server / spec / ParseQuery.spec.js View on Github external
Parse.Object.saveAll(objectList).then((results) => {
      equal(objectList.length, results.length);

      return require('request-promise').get({
        url: Parse.serverURL + "/classes/Object",
        json: {
          where: {
            strings: {
              $all: [ {$regex: '\^\\Qlazy\\E'} ]
            }
          }
        },
        headers: {
          'X-Parse-Application-Id': Parse.applicationId,
          'X-Parse-Javascript-Key': Parse.javaScriptKey
        }
      });
    })
      .then(function (results) {
github parse-community / parse-server / src / Push / PushQueue.js View on Github external
static defaultPushChannel() {
    return `${Parse.applicationId}-${PUSH_CHANNEL}`;
  }
github parse-community / parse-server / src / LiveQuery / ParseLiveQueryServer.js View on Github external
_onAfterSave(message: any): void {
    logger.verbose(Parse.applicationId + 'afterSave is triggered');

    let originalParseObject = null;
    if (message.originalParseObject) {
      originalParseObject = message.originalParseObject.toJSON();
    }
    const classLevelPermissions = message.classLevelPermissions;
    const currentParseObject = message.currentParseObject.toJSON();
    const className = currentParseObject.className;
    logger.verbose(
      'ClassName: %s | ObjectId: %s',
      className,
      currentParseObject.id
    );
    logger.verbose('Current client number : %d', this.clients.size);

    const classSubscriptions = this.subscriptions.get(className);
github parse-community / parse-server / spec / ParseQuery.spec.js View on Github external
return require('request-promise').get({
        url: Parse.serverURL + "/classes/Object",
        json: {
          where: {
            strings: {
              $all: [
                {$regex: '\^\\Qthe\\E'},
                {$regex: '\^\\Qfox\\E'},
                {$regex: '\^\\Qlazy\\E'}
              ]
            }
          }
        },
        headers: {
          'X-Parse-Application-Id': Parse.applicationId,
          'X-Parse-Javascript-Key': Parse.javaScriptKey
        }
      })
        .then(function (results) {
          equal(results.results.length, 1);
          arrayContains(results.results, object);

          return require('request-promise').get({
            url: Parse.serverURL + "/classes/Object",
            json: {
              where: {
                strings: {
                  $all: [
                    {$regex: '\^\\Qthe\\E'},
                    {$regex: '\^\\Qlazy\\E'}
                  ]
github parse-community / parse-server / src / LiveQuery / ParseCloudCodePublisher.js View on Github external
onCloudCodeAfterSave(request: any): void {
    this._onCloudCodeMessage(Parse.applicationId + 'afterSave', request);
  }
github parse-community / parse-server / spec / ProtectedFields.spec.js View on Github external
beforeEach(async () => {
      Config.get(Parse.applicationId).database.schemaCache.clear();
      user1 = await Parse.User.signUp('user1', 'password');
      user2 = await Parse.User.signUp('user2', 'password');
      await Parse.User.logOut();
    });