1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489 |
- "use strict";
- var _node = require("parse/node");
- var _lodash = _interopRequireDefault(require("lodash"));
- var _intersect = _interopRequireDefault(require("intersect"));
- var _deepcopy = _interopRequireDefault(require("deepcopy"));
- var _logger = _interopRequireDefault(require("../logger"));
- var _Utils = _interopRequireDefault(require("../Utils"));
- var SchemaController = _interopRequireWildcard(require("./SchemaController"));
- var _StorageAdapter = require("../Adapters/Storage/StorageAdapter");
- var _MongoStorageAdapter = _interopRequireDefault(require("../Adapters/Storage/Mongo/MongoStorageAdapter"));
- var _PostgresStorageAdapter = _interopRequireDefault(require("../Adapters/Storage/Postgres/PostgresStorageAdapter"));
- var _SchemaCache = _interopRequireDefault(require("../Adapters/Cache/SchemaCache"));
- const _excluded = ["ACL"],
- _excluded2 = ["_rperm", "_wperm"]; // A database adapter that works with data exported from the hosted
- // Parse database.
- // -disable-next
- // -disable-next
- // -disable-next
- // -disable-next
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
- function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
- function addWriteACL(query, acl) {
- const newQuery = _lodash.default.cloneDeep(query);
- //Can't be any existing '_wperm' query, we don't allow client queries on that, no need to $and
- newQuery._wperm = {
- $in: [null, ...acl]
- };
- return newQuery;
- }
- function addReadACL(query, acl) {
- const newQuery = _lodash.default.cloneDeep(query);
- //Can't be any existing '_rperm' query, we don't allow client queries on that, no need to $and
- newQuery._rperm = {
- $in: [null, '*', ...acl]
- };
- return newQuery;
- }
- // Transforms a REST API formatted ACL object to our two-field mongo format.
- const transformObjectACL = _ref => {
- let {
- ACL
- } = _ref,
- result = _objectWithoutProperties(_ref, _excluded);
- if (!ACL) {
- return result;
- }
- result._wperm = [];
- result._rperm = [];
- for (const entry in ACL) {
- if (ACL[entry].read) {
- result._rperm.push(entry);
- }
- if (ACL[entry].write) {
- result._wperm.push(entry);
- }
- }
- return result;
- };
- const specialQueryKeys = ['$and', '$or', '$nor', '_rperm', '_wperm'];
- const specialMasterQueryKeys = [...specialQueryKeys, '_email_verify_token', '_perishable_token', '_tombstone', '_email_verify_token_expires_at', '_failed_login_count', '_account_lockout_expires_at', '_password_changed_at', '_password_history'];
- const validateQuery = (query, isMaster, isMaintenance, update) => {
- if (isMaintenance) {
- isMaster = true;
- }
- if (query.ACL) {
- throw new _node.Parse.Error(_node.Parse.Error.INVALID_QUERY, 'Cannot query on ACL.');
- }
- if (query.$or) {
- if (query.$or instanceof Array) {
- query.$or.forEach(value => validateQuery(value, isMaster, isMaintenance, update));
- } else {
- throw new _node.Parse.Error(_node.Parse.Error.INVALID_QUERY, 'Bad $or format - use an array value.');
- }
- }
- if (query.$and) {
- if (query.$and instanceof Array) {
- query.$and.forEach(value => validateQuery(value, isMaster, isMaintenance, update));
- } else {
- throw new _node.Parse.Error(_node.Parse.Error.INVALID_QUERY, 'Bad $and format - use an array value.');
- }
- }
- if (query.$nor) {
- if (query.$nor instanceof Array && query.$nor.length > 0) {
- query.$nor.forEach(value => validateQuery(value, isMaster, isMaintenance, update));
- } else {
- throw new _node.Parse.Error(_node.Parse.Error.INVALID_QUERY, 'Bad $nor format - use an array of at least 1 value.');
- }
- }
- Object.keys(query).forEach(key => {
- if (query && query[key] && query[key].$regex) {
- if (typeof query[key].$options === 'string') {
- if (!query[key].$options.match(/^[imxs]+$/)) {
- throw new _node.Parse.Error(_node.Parse.Error.INVALID_QUERY, `Bad $options value for query: ${query[key].$options}`);
- }
- }
- }
- if (!key.match(/^[a-zA-Z][a-zA-Z0-9_\.]*$/) && (!specialQueryKeys.includes(key) && !isMaster && !update || update && isMaster && !specialMasterQueryKeys.includes(key))) {
- throw new _node.Parse.Error(_node.Parse.Error.INVALID_KEY_NAME, `Invalid key name: ${key}`);
- }
- });
- };
- // Filters out any data that shouldn't be on this REST-formatted object.
- const filterSensitiveData = (isMaster, isMaintenance, aclGroup, auth, operation, schema, className, protectedFields, object) => {
- let userId = null;
- if (auth && auth.user) userId = auth.user.id;
- // replace protectedFields when using pointer-permissions
- const perms = schema && schema.getClassLevelPermissions ? schema.getClassLevelPermissions(className) : {};
- if (perms) {
- const isReadOperation = ['get', 'find'].indexOf(operation) > -1;
- if (isReadOperation && perms.protectedFields) {
- // extract protectedFields added with the pointer-permission prefix
- const protectedFieldsPointerPerm = Object.keys(perms.protectedFields).filter(key => key.startsWith('userField:')).map(key => {
- return {
- key: key.substring(10),
- value: perms.protectedFields[key]
- };
- });
- const newProtectedFields = [];
- let overrideProtectedFields = false;
- // check if the object grants the current user access based on the extracted fields
- protectedFieldsPointerPerm.forEach(pointerPerm => {
- let pointerPermIncludesUser = false;
- const readUserFieldValue = object[pointerPerm.key];
- if (readUserFieldValue) {
- if (Array.isArray(readUserFieldValue)) {
- pointerPermIncludesUser = readUserFieldValue.some(user => user.objectId && user.objectId === userId);
- } else {
- pointerPermIncludesUser = readUserFieldValue.objectId && readUserFieldValue.objectId === userId;
- }
- }
- if (pointerPermIncludesUser) {
- overrideProtectedFields = true;
- newProtectedFields.push(pointerPerm.value);
- }
- });
- // if at least one pointer-permission affected the current user
- // intersect vs protectedFields from previous stage (@see addProtectedFields)
- // Sets theory (intersections): A x (B x C) == (A x B) x C
- if (overrideProtectedFields && protectedFields) {
- newProtectedFields.push(protectedFields);
- }
- // intersect all sets of protectedFields
- newProtectedFields.forEach(fields => {
- if (fields) {
- // if there're no protctedFields by other criteria ( id / role / auth)
- // then we must intersect each set (per userField)
- if (!protectedFields) {
- protectedFields = fields;
- } else {
- protectedFields = protectedFields.filter(v => fields.includes(v));
- }
- }
- });
- }
- }
- const isUserClass = className === '_User';
- if (isUserClass) {
- object.password = object._hashed_password;
- delete object._hashed_password;
- delete object.sessionToken;
- }
- if (isMaintenance) {
- return object;
- }
- /* special treat for the user class: don't filter protectedFields if currently loggedin user is
- the retrieved user */
- if (!(isUserClass && userId && object.objectId === userId)) {
- var _perms$protectedField;
- protectedFields && protectedFields.forEach(k => delete object[k]);
- // fields not requested by client (excluded),
- // but were needed to apply protectedFields
- perms === null || perms === void 0 || (_perms$protectedField = perms.protectedFields) === null || _perms$protectedField === void 0 || (_perms$protectedField = _perms$protectedField.temporaryKeys) === null || _perms$protectedField === void 0 || _perms$protectedField.forEach(k => delete object[k]);
- }
- for (const key in object) {
- if (key.charAt(0) === '_') {
- delete object[key];
- }
- }
- if (!isUserClass || isMaster) {
- return object;
- }
- if (aclGroup.indexOf(object.objectId) > -1) {
- return object;
- }
- delete object.authData;
- return object;
- };
- // Runs an update on the database.
- // Returns a promise for an object with the new values for field
- // modifications that don't know their results ahead of time, like
- // 'increment'.
- // Options:
- // acl: a list of strings. If the object to be updated has an ACL,
- // one of the provided strings must provide the caller with
- // write permissions.
- const specialKeysForUpdate = ['_hashed_password', '_perishable_token', '_email_verify_token', '_email_verify_token_expires_at', '_account_lockout_expires_at', '_failed_login_count', '_perishable_token_expires_at', '_password_changed_at', '_password_history'];
- const isSpecialUpdateKey = key => {
- return specialKeysForUpdate.indexOf(key) >= 0;
- };
- function joinTableName(className, key) {
- return `_Join:${key}:${className}`;
- }
- const flattenUpdateOperatorsForCreate = object => {
- for (const key in object) {
- if (object[key] && object[key].__op) {
- switch (object[key].__op) {
- case 'Increment':
- if (typeof object[key].amount !== 'number') {
- throw new _node.Parse.Error(_node.Parse.Error.INVALID_JSON, 'objects to add must be an array');
- }
- object[key] = object[key].amount;
- break;
- case 'SetOnInsert':
- object[key] = object[key].amount;
- break;
- case 'Add':
- if (!(object[key].objects instanceof Array)) {
- throw new _node.Parse.Error(_node.Parse.Error.INVALID_JSON, 'objects to add must be an array');
- }
- object[key] = object[key].objects;
- break;
- case 'AddUnique':
- if (!(object[key].objects instanceof Array)) {
- throw new _node.Parse.Error(_node.Parse.Error.INVALID_JSON, 'objects to add must be an array');
- }
- object[key] = object[key].objects;
- break;
- case 'Remove':
- if (!(object[key].objects instanceof Array)) {
- throw new _node.Parse.Error(_node.Parse.Error.INVALID_JSON, 'objects to add must be an array');
- }
- object[key] = [];
- break;
- case 'Delete':
- delete object[key];
- break;
- default:
- throw new _node.Parse.Error(_node.Parse.Error.COMMAND_UNAVAILABLE, `The ${object[key].__op} operator is not supported yet.`);
- }
- }
- }
- };
- const transformAuthData = (className, object, schema) => {
- if (object.authData && className === '_User') {
- Object.keys(object.authData).forEach(provider => {
- const providerData = object.authData[provider];
- const fieldName = `_auth_data_${provider}`;
- if (providerData == null) {
- object[fieldName] = {
- __op: 'Delete'
- };
- } else {
- object[fieldName] = providerData;
- schema.fields[fieldName] = {
- type: 'Object'
- };
- }
- });
- delete object.authData;
- }
- };
- // Transforms a Database format ACL to a REST API format ACL
- const untransformObjectACL = _ref2 => {
- let {
- _rperm,
- _wperm
- } = _ref2,
- output = _objectWithoutProperties(_ref2, _excluded2);
- if (_rperm || _wperm) {
- output.ACL = {};
- (_rperm || []).forEach(entry => {
- if (!output.ACL[entry]) {
- output.ACL[entry] = {
- read: true
- };
- } else {
- output.ACL[entry]['read'] = true;
- }
- });
- (_wperm || []).forEach(entry => {
- if (!output.ACL[entry]) {
- output.ACL[entry] = {
- write: true
- };
- } else {
- output.ACL[entry]['write'] = true;
- }
- });
- }
- return output;
- };
- /**
- * When querying, the fieldName may be compound, extract the root fieldName
- * `temperature.celsius` becomes `temperature`
- * @param {string} fieldName that may be a compound field name
- * @returns {string} the root name of the field
- */
- const getRootFieldName = fieldName => {
- return fieldName.split('.')[0];
- };
- const relationSchema = {
- fields: {
- relatedId: {
- type: 'String'
- },
- owningId: {
- type: 'String'
- }
- }
- };
- const convertEmailToLowercase = (object, className, options) => {
- if (className === '_User' && options.convertEmailToLowercase) {
- if (typeof object['email'] === 'string') {
- object['email'] = object['email'].toLowerCase();
- }
- }
- };
- const convertUsernameToLowercase = (object, className, options) => {
- if (className === '_User' && options.convertUsernameToLowercase) {
- if (typeof object['username'] === 'string') {
- object['username'] = object['username'].toLowerCase();
- }
- }
- };
- class DatabaseController {
- constructor(adapter, options) {
- this.adapter = adapter;
- this.options = options || {};
- this.idempotencyOptions = this.options.idempotencyOptions || {};
- // Prevent mutable this.schema, otherwise one request could use
- // multiple schemas, so instead use loadSchema to get a schema.
- this.schemaPromise = null;
- this._transactionalSession = null;
- this.options = options;
- }
- collectionExists(className) {
- return this.adapter.classExists(className);
- }
- purgeCollection(className) {
- return this.loadSchema().then(schemaController => schemaController.getOneSchema(className)).then(schema => this.adapter.deleteObjectsByQuery(className, schema, {}));
- }
- validateClassName(className) {
- if (!SchemaController.classNameIsValid(className)) {
- return Promise.reject(new _node.Parse.Error(_node.Parse.Error.INVALID_CLASS_NAME, 'invalid className: ' + className));
- }
- return Promise.resolve();
- }
- // Returns a promise for a schemaController.
- loadSchema(options = {
- clearCache: false
- }) {
- if (this.schemaPromise != null) {
- return this.schemaPromise;
- }
- this.schemaPromise = SchemaController.load(this.adapter, options);
- this.schemaPromise.then(() => delete this.schemaPromise, () => delete this.schemaPromise);
- return this.loadSchema(options);
- }
- loadSchemaIfNeeded(schemaController, options = {
- clearCache: false
- }) {
- return schemaController ? Promise.resolve(schemaController) : this.loadSchema(options);
- }
- // Returns a promise for the classname that is related to the given
- // classname through the key.
- // TODO: make this not in the DatabaseController interface
- redirectClassNameForKey(className, key) {
- return this.loadSchema().then(schema => {
- var t = schema.getExpectedType(className, key);
- if (t != null && typeof t !== 'string' && t.type === 'Relation') {
- return t.targetClass;
- }
- return className;
- });
- }
- // Uses the schema to validate the object (REST API format).
- // Returns a promise that resolves to the new schema.
- // This does not update this.schema, because in a situation like a
- // batch request, that could confuse other users of the schema.
- validateObject(className, object, query, runOptions, maintenance) {
- let schema;
- const acl = runOptions.acl;
- const isMaster = acl === undefined;
- var aclGroup = acl || [];
- return this.loadSchema().then(s => {
- schema = s;
- if (isMaster) {
- return Promise.resolve();
- }
- return this.canAddField(schema, className, object, aclGroup, runOptions);
- }).then(() => {
- return schema.validateObject(className, object, query, maintenance);
- });
- }
- update(className, query, update, {
- acl,
- many,
- upsert,
- addsField
- } = {}, skipSanitization = false, validateOnly = false, validSchemaController) {
- try {
- _Utils.default.checkProhibitedKeywords(this.options, update);
- } catch (error) {
- return Promise.reject(new _node.Parse.Error(_node.Parse.Error.INVALID_KEY_NAME, error));
- }
- const originalQuery = query;
- const originalUpdate = update;
- // Make a copy of the object, so we don't mutate the incoming data.
- update = (0, _deepcopy.default)(update);
- var relationUpdates = [];
- var isMaster = acl === undefined;
- var aclGroup = acl || [];
- return this.loadSchemaIfNeeded(validSchemaController).then(schemaController => {
- return (isMaster ? Promise.resolve() : schemaController.validatePermission(className, aclGroup, 'update')).then(() => {
- relationUpdates = this.collectRelationUpdates(className, originalQuery.objectId, update);
- if (!isMaster) {
- query = this.addPointerPermissions(schemaController, className, 'update', query, aclGroup);
- if (addsField) {
- query = {
- $and: [query, this.addPointerPermissions(schemaController, className, 'addField', query, aclGroup)]
- };
- }
- }
- if (!query) {
- return Promise.resolve();
- }
- if (acl) {
- query = addWriteACL(query, acl);
- }
- validateQuery(query, isMaster, false, true);
- return schemaController.getOneSchema(className, true).catch(error => {
- // If the schema doesn't exist, pretend it exists with no fields. This behavior
- // will likely need revisiting.
- if (error === undefined) {
- return {
- fields: {}
- };
- }
- throw error;
- }).then(schema => {
- Object.keys(update).forEach(fieldName => {
- if (fieldName.match(/^authData\.([a-zA-Z0-9_]+)\.id$/)) {
- throw new _node.Parse.Error(_node.Parse.Error.INVALID_KEY_NAME, `Invalid field name for update: ${fieldName}`);
- }
- const rootFieldName = getRootFieldName(fieldName);
- if (!SchemaController.fieldNameIsValid(rootFieldName, className) && !isSpecialUpdateKey(rootFieldName)) {
- throw new _node.Parse.Error(_node.Parse.Error.INVALID_KEY_NAME, `Invalid field name for update: ${fieldName}`);
- }
- });
- for (const updateOperation in update) {
- if (update[updateOperation] && typeof update[updateOperation] === 'object' && Object.keys(update[updateOperation]).some(innerKey => innerKey.includes('$') || innerKey.includes('.'))) {
- throw new _node.Parse.Error(_node.Parse.Error.INVALID_NESTED_KEY, "Nested keys should not contain the '$' or '.' characters");
- }
- }
- update = transformObjectACL(update);
- convertEmailToLowercase(update, className, this.options);
- convertUsernameToLowercase(update, className, this.options);
- transformAuthData(className, update, schema);
- if (validateOnly) {
- return this.adapter.find(className, schema, query, {}).then(result => {
- if (!result || !result.length) {
- throw new _node.Parse.Error(_node.Parse.Error.OBJECT_NOT_FOUND, 'Object not found.');
- }
- return {};
- });
- }
- if (many) {
- return this.adapter.updateObjectsByQuery(className, schema, query, update, this._transactionalSession);
- } else if (upsert) {
- return this.adapter.upsertOneObject(className, schema, query, update, this._transactionalSession);
- } else {
- return this.adapter.findOneAndUpdate(className, schema, query, update, this._transactionalSession);
- }
- });
- }).then(result => {
- if (!result) {
- throw new _node.Parse.Error(_node.Parse.Error.OBJECT_NOT_FOUND, 'Object not found.');
- }
- if (validateOnly) {
- return result;
- }
- return this.handleRelationUpdates(className, originalQuery.objectId, update, relationUpdates).then(() => {
- return result;
- });
- }).then(result => {
- if (skipSanitization) {
- return Promise.resolve(result);
- }
- return this._sanitizeDatabaseResult(originalUpdate, result);
- });
- });
- }
- // Collect all relation-updating operations from a REST-format update.
- // Returns a list of all relation updates to perform
- // This mutates update.
- collectRelationUpdates(className, objectId, update) {
- var ops = [];
- var deleteMe = [];
- objectId = update.objectId || objectId;
- var process = (op, key) => {
- if (!op) {
- return;
- }
- if (op.__op == 'AddRelation') {
- ops.push({
- key,
- op
- });
- deleteMe.push(key);
- }
- if (op.__op == 'RemoveRelation') {
- ops.push({
- key,
- op
- });
- deleteMe.push(key);
- }
- if (op.__op == 'Batch') {
- for (var x of op.ops) {
- process(x, key);
- }
- }
- };
- for (const key in update) {
- process(update[key], key);
- }
- for (const key of deleteMe) {
- delete update[key];
- }
- return ops;
- }
- // Processes relation-updating operations from a REST-format update.
- // Returns a promise that resolves when all updates have been performed
- handleRelationUpdates(className, objectId, update, ops) {
- var pending = [];
- objectId = update.objectId || objectId;
- ops.forEach(({
- key,
- op
- }) => {
- if (!op) {
- return;
- }
- if (op.__op == 'AddRelation') {
- for (const object of op.objects) {
- pending.push(this.addRelation(key, className, objectId, object.objectId));
- }
- }
- if (op.__op == 'RemoveRelation') {
- for (const object of op.objects) {
- pending.push(this.removeRelation(key, className, objectId, object.objectId));
- }
- }
- });
- return Promise.all(pending);
- }
- // Adds a relation.
- // Returns a promise that resolves successfully iff the add was successful.
- addRelation(key, fromClassName, fromId, toId) {
- const doc = {
- relatedId: toId,
- owningId: fromId
- };
- return this.adapter.upsertOneObject(`_Join:${key}:${fromClassName}`, relationSchema, doc, doc, this._transactionalSession);
- }
- // Removes a relation.
- // Returns a promise that resolves successfully iff the remove was
- // successful.
- removeRelation(key, fromClassName, fromId, toId) {
- var doc = {
- relatedId: toId,
- owningId: fromId
- };
- return this.adapter.deleteObjectsByQuery(`_Join:${key}:${fromClassName}`, relationSchema, doc, this._transactionalSession).catch(error => {
- // We don't care if they try to delete a non-existent relation.
- if (error.code == _node.Parse.Error.OBJECT_NOT_FOUND) {
- return;
- }
- throw error;
- });
- }
- // Removes objects matches this query from the database.
- // Returns a promise that resolves successfully iff the object was
- // deleted.
- // Options:
- // acl: a list of strings. If the object to be updated has an ACL,
- // one of the provided strings must provide the caller with
- // write permissions.
- destroy(className, query, {
- acl
- } = {}, validSchemaController) {
- const isMaster = acl === undefined;
- const aclGroup = acl || [];
- return this.loadSchemaIfNeeded(validSchemaController).then(schemaController => {
- return (isMaster ? Promise.resolve() : schemaController.validatePermission(className, aclGroup, 'delete')).then(() => {
- if (!isMaster) {
- query = this.addPointerPermissions(schemaController, className, 'delete', query, aclGroup);
- if (!query) {
- throw new _node.Parse.Error(_node.Parse.Error.OBJECT_NOT_FOUND, 'Object not found.');
- }
- }
- // delete by query
- if (acl) {
- query = addWriteACL(query, acl);
- }
- validateQuery(query, isMaster, false, false);
- return schemaController.getOneSchema(className).catch(error => {
- // If the schema doesn't exist, pretend it exists with no fields. This behavior
- // will likely need revisiting.
- if (error === undefined) {
- return {
- fields: {}
- };
- }
- throw error;
- }).then(parseFormatSchema => this.adapter.deleteObjectsByQuery(className, parseFormatSchema, query, this._transactionalSession)).catch(error => {
- // When deleting sessions while changing passwords, don't throw an error if they don't have any sessions.
- if (className === '_Session' && error.code === _node.Parse.Error.OBJECT_NOT_FOUND) {
- return Promise.resolve({});
- }
- throw error;
- });
- });
- });
- }
- // Inserts an object into the database.
- // Returns a promise that resolves successfully iff the object saved.
- create(className, object, {
- acl
- } = {}, validateOnly = false, validSchemaController) {
- try {
- _Utils.default.checkProhibitedKeywords(this.options, object);
- } catch (error) {
- return Promise.reject(new _node.Parse.Error(_node.Parse.Error.INVALID_KEY_NAME, error));
- }
- // Make a copy of the object, so we don't mutate the incoming data.
- const originalObject = object;
- object = transformObjectACL(object);
- convertEmailToLowercase(object, className, this.options);
- convertUsernameToLowercase(object, className, this.options);
- object.createdAt = {
- iso: object.createdAt,
- __type: 'Date'
- };
- object.updatedAt = {
- iso: object.updatedAt,
- __type: 'Date'
- };
- var isMaster = acl === undefined;
- var aclGroup = acl || [];
- const relationUpdates = this.collectRelationUpdates(className, null, object);
- return this.validateClassName(className).then(() => this.loadSchemaIfNeeded(validSchemaController)).then(schemaController => {
- return (isMaster ? Promise.resolve() : schemaController.validatePermission(className, aclGroup, 'create')).then(() => schemaController.enforceClassExists(className)).then(() => schemaController.getOneSchema(className, true)).then(schema => {
- transformAuthData(className, object, schema);
- flattenUpdateOperatorsForCreate(object);
- if (validateOnly) {
- return {};
- }
- return this.adapter.createObject(className, SchemaController.convertSchemaToAdapterSchema(schema), object, this._transactionalSession);
- }).then(result => {
- if (validateOnly) {
- return originalObject;
- }
- return this.handleRelationUpdates(className, object.objectId, object, relationUpdates).then(() => {
- return this._sanitizeDatabaseResult(originalObject, result.ops[0]);
- });
- });
- });
- }
- canAddField(schema, className, object, aclGroup, runOptions) {
- const classSchema = schema.schemaData[className];
- if (!classSchema) {
- return Promise.resolve();
- }
- const fields = Object.keys(object);
- const schemaFields = Object.keys(classSchema.fields);
- const newKeys = fields.filter(field => {
- // Skip fields that are unset
- if (object[field] && object[field].__op && object[field].__op === 'Delete') {
- return false;
- }
- return schemaFields.indexOf(getRootFieldName(field)) < 0;
- });
- if (newKeys.length > 0) {
- // adds a marker that new field is being adding during update
- runOptions.addsField = true;
- const action = runOptions.action;
- return schema.validatePermission(className, aclGroup, 'addField', action);
- }
- return Promise.resolve();
- }
- // Won't delete collections in the system namespace
- /**
- * Delete all classes and clears the schema cache
- *
- * @param {boolean} fast set to true if it's ok to just delete rows and not indexes
- * @returns {Promise<void>} when the deletions completes
- */
- deleteEverything(fast = false) {
- this.schemaPromise = null;
- _SchemaCache.default.clear();
- return this.adapter.deleteAllClasses(fast);
- }
- // Returns a promise for a list of related ids given an owning id.
- // className here is the owning className.
- relatedIds(className, key, owningId, queryOptions) {
- const {
- skip,
- limit,
- sort
- } = queryOptions;
- const findOptions = {};
- if (sort && sort.createdAt && this.adapter.canSortOnJoinTables) {
- findOptions.sort = {
- _id: sort.createdAt
- };
- findOptions.limit = limit;
- findOptions.skip = skip;
- queryOptions.skip = 0;
- }
- return this.adapter.find(joinTableName(className, key), relationSchema, {
- owningId
- }, findOptions).then(results => results.map(result => result.relatedId));
- }
- // Returns a promise for a list of owning ids given some related ids.
- // className here is the owning className.
- owningIds(className, key, relatedIds) {
- return this.adapter.find(joinTableName(className, key), relationSchema, {
- relatedId: {
- $in: relatedIds
- }
- }, {
- keys: ['owningId']
- }).then(results => results.map(result => result.owningId));
- }
- // Modifies query so that it no longer has $in on relation fields, or
- // equal-to-pointer constraints on relation fields.
- // Returns a promise that resolves when query is mutated
- reduceInRelation(className, query, schema) {
- // Search for an in-relation or equal-to-relation
- // Make it sequential for now, not sure of paralleization side effects
- const promises = [];
- if (query['$or']) {
- const ors = query['$or'];
- promises.push(...ors.map((aQuery, index) => {
- return this.reduceInRelation(className, aQuery, schema).then(aQuery => {
- query['$or'][index] = aQuery;
- });
- }));
- }
- if (query['$and']) {
- const ands = query['$and'];
- promises.push(...ands.map((aQuery, index) => {
- return this.reduceInRelation(className, aQuery, schema).then(aQuery => {
- query['$and'][index] = aQuery;
- });
- }));
- }
- const otherKeys = Object.keys(query).map(key => {
- if (key === '$and' || key === '$or') {
- return;
- }
- const t = schema.getExpectedType(className, key);
- if (!t || t.type !== 'Relation') {
- return Promise.resolve(query);
- }
- let queries = null;
- if (query[key] && (query[key]['$in'] || query[key]['$ne'] || query[key]['$nin'] || query[key].__type == 'Pointer')) {
- // Build the list of queries
- queries = Object.keys(query[key]).map(constraintKey => {
- let relatedIds;
- let isNegation = false;
- if (constraintKey === 'objectId') {
- relatedIds = [query[key].objectId];
- } else if (constraintKey == '$in') {
- relatedIds = query[key]['$in'].map(r => r.objectId);
- } else if (constraintKey == '$nin') {
- isNegation = true;
- relatedIds = query[key]['$nin'].map(r => r.objectId);
- } else if (constraintKey == '$ne') {
- isNegation = true;
- relatedIds = [query[key]['$ne'].objectId];
- } else {
- return;
- }
- return {
- isNegation,
- relatedIds
- };
- });
- } else {
- queries = [{
- isNegation: false,
- relatedIds: []
- }];
- }
- // remove the current queryKey as we don,t need it anymore
- delete query[key];
- // execute each query independently to build the list of
- // $in / $nin
- const promises = queries.map(q => {
- if (!q) {
- return Promise.resolve();
- }
- return this.owningIds(className, key, q.relatedIds).then(ids => {
- if (q.isNegation) {
- this.addNotInObjectIdsIds(ids, query);
- } else {
- this.addInObjectIdsIds(ids, query);
- }
- return Promise.resolve();
- });
- });
- return Promise.all(promises).then(() => {
- return Promise.resolve();
- });
- });
- return Promise.all([...promises, ...otherKeys]).then(() => {
- return Promise.resolve(query);
- });
- }
- // Modifies query so that it no longer has $relatedTo
- // Returns a promise that resolves when query is mutated
- reduceRelationKeys(className, query, queryOptions) {
- if (query['$or']) {
- return Promise.all(query['$or'].map(aQuery => {
- return this.reduceRelationKeys(className, aQuery, queryOptions);
- }));
- }
- if (query['$and']) {
- return Promise.all(query['$and'].map(aQuery => {
- return this.reduceRelationKeys(className, aQuery, queryOptions);
- }));
- }
- var relatedTo = query['$relatedTo'];
- if (relatedTo) {
- return this.relatedIds(relatedTo.object.className, relatedTo.key, relatedTo.object.objectId, queryOptions).then(ids => {
- delete query['$relatedTo'];
- this.addInObjectIdsIds(ids, query);
- return this.reduceRelationKeys(className, query, queryOptions);
- }).then(() => {});
- }
- }
- addInObjectIdsIds(ids = null, query) {
- const idsFromString = typeof query.objectId === 'string' ? [query.objectId] : null;
- const idsFromEq = query.objectId && query.objectId['$eq'] ? [query.objectId['$eq']] : null;
- const idsFromIn = query.objectId && query.objectId['$in'] ? query.objectId['$in'] : null;
- // -disable-next
- const allIds = [idsFromString, idsFromEq, idsFromIn, ids].filter(list => list !== null);
- const totalLength = allIds.reduce((memo, list) => memo + list.length, 0);
- let idsIntersection = [];
- if (totalLength > 125) {
- idsIntersection = _intersect.default.big(allIds);
- } else {
- idsIntersection = (0, _intersect.default)(allIds);
- }
- // Need to make sure we don't clobber existing shorthand $eq constraints on objectId.
- if (!('objectId' in query)) {
- query.objectId = {
- $in: undefined
- };
- } else if (typeof query.objectId === 'string') {
- query.objectId = {
- $in: undefined,
- $eq: query.objectId
- };
- }
- query.objectId['$in'] = idsIntersection;
- return query;
- }
- addNotInObjectIdsIds(ids = [], query) {
- const idsFromNin = query.objectId && query.objectId['$nin'] ? query.objectId['$nin'] : [];
- let allIds = [...idsFromNin, ...ids].filter(list => list !== null);
- // make a set and spread to remove duplicates
- allIds = [...new Set(allIds)];
- // Need to make sure we don't clobber existing shorthand $eq constraints on objectId.
- if (!('objectId' in query)) {
- query.objectId = {
- $nin: undefined
- };
- } else if (typeof query.objectId === 'string') {
- query.objectId = {
- $nin: undefined,
- $eq: query.objectId
- };
- }
- query.objectId['$nin'] = allIds;
- return query;
- }
- // Runs a query on the database.
- // Returns a promise that resolves to a list of items.
- // Options:
- // skip number of results to skip.
- // limit limit to this number of results.
- // sort an object where keys are the fields to sort by.
- // the value is +1 for ascending, -1 for descending.
- // count run a count instead of returning results.
- // acl restrict this operation with an ACL for the provided array
- // of user objectIds and roles. acl: null means no user.
- // when this field is not present, don't do anything regarding ACLs.
- // caseInsensitive make string comparisons case insensitive
- // TODO: make userIds not needed here. The db adapter shouldn't know
- // anything about users, ideally. Then, improve the format of the ACL
- // arg to work like the others.
- find(className, query, {
- skip,
- limit,
- acl,
- sort = {},
- count,
- keys,
- op,
- distinct,
- pipeline,
- readPreference,
- hint,
- caseInsensitive = false,
- explain,
- comment
- } = {}, auth = {}, validSchemaController) {
- const isMaintenance = auth.isMaintenance;
- const isMaster = acl === undefined || isMaintenance;
- const aclGroup = acl || [];
- op = op || (typeof query.objectId == 'string' && Object.keys(query).length === 1 ? 'get' : 'find');
- // Count operation if counting
- op = count === true ? 'count' : op;
- let classExists = true;
- return this.loadSchemaIfNeeded(validSchemaController).then(schemaController => {
- //Allow volatile classes if querying with Master (for _PushStatus)
- //TODO: Move volatile classes concept into mongo adapter, postgres adapter shouldn't care
- //that api.parse.com breaks when _PushStatus exists in mongo.
- return schemaController.getOneSchema(className, isMaster).catch(error => {
- // Behavior for non-existent classes is kinda weird on Parse.com. Probably doesn't matter too much.
- // For now, pretend the class exists but has no objects,
- if (error === undefined) {
- classExists = false;
- return {
- fields: {}
- };
- }
- throw error;
- }).then(schema => {
- // Parse.com treats queries on _created_at and _updated_at as if they were queries on createdAt and updatedAt,
- // so duplicate that behavior here. If both are specified, the correct behavior to match Parse.com is to
- // use the one that appears first in the sort list.
- if (sort._created_at) {
- sort.createdAt = sort._created_at;
- delete sort._created_at;
- }
- if (sort._updated_at) {
- sort.updatedAt = sort._updated_at;
- delete sort._updated_at;
- }
- const queryOptions = {
- skip,
- limit,
- sort,
- keys,
- readPreference,
- hint,
- caseInsensitive: this.options.enableCollationCaseComparison ? false : caseInsensitive,
- explain,
- comment
- };
- Object.keys(sort).forEach(fieldName => {
- if (fieldName.match(/^authData\.([a-zA-Z0-9_]+)\.id$/)) {
- throw new _node.Parse.Error(_node.Parse.Error.INVALID_KEY_NAME, `Cannot sort by ${fieldName}`);
- }
- const rootFieldName = getRootFieldName(fieldName);
- if (!SchemaController.fieldNameIsValid(rootFieldName, className)) {
- throw new _node.Parse.Error(_node.Parse.Error.INVALID_KEY_NAME, `Invalid field name: ${fieldName}.`);
- }
- if (!schema.fields[fieldName.split('.')[0]] && fieldName !== 'score') {
- delete sort[fieldName];
- }
- });
- return (isMaster ? Promise.resolve() : schemaController.validatePermission(className, aclGroup, op)).then(() => this.reduceRelationKeys(className, query, queryOptions)).then(() => this.reduceInRelation(className, query, schemaController)).then(() => {
- let protectedFields;
- if (!isMaster) {
- query = this.addPointerPermissions(schemaController, className, op, query, aclGroup);
- /* Don't use projections to optimize the protectedFields since the protectedFields
- based on pointer-permissions are determined after querying. The filtering can
- overwrite the protected fields. */
- protectedFields = this.addProtectedFields(schemaController, className, query, aclGroup, auth, queryOptions);
- }
- if (!query) {
- if (op === 'get') {
- throw new _node.Parse.Error(_node.Parse.Error.OBJECT_NOT_FOUND, 'Object not found.');
- } else {
- return [];
- }
- }
- if (!isMaster) {
- if (op === 'update' || op === 'delete') {
- query = addWriteACL(query, aclGroup);
- } else {
- query = addReadACL(query, aclGroup);
- }
- }
- validateQuery(query, isMaster, isMaintenance, false);
- if (count) {
- if (!classExists) {
- return 0;
- } else {
- return this.adapter.count(className, schema, query, readPreference, undefined, hint, comment);
- }
- } else if (distinct) {
- if (!classExists) {
- return [];
- } else {
- return this.adapter.distinct(className, schema, query, distinct);
- }
- } else if (pipeline) {
- if (!classExists) {
- return [];
- } else {
- return this.adapter.aggregate(className, schema, pipeline, readPreference, hint, explain, comment);
- }
- } else if (explain) {
- return this.adapter.find(className, schema, query, queryOptions);
- } else {
- return this.adapter.find(className, schema, query, queryOptions).then(objects => objects.map(object => {
- object = untransformObjectACL(object);
- return filterSensitiveData(isMaster, isMaintenance, aclGroup, auth, op, schemaController, className, protectedFields, object);
- })).catch(error => {
- throw new _node.Parse.Error(_node.Parse.Error.INTERNAL_SERVER_ERROR, error);
- });
- }
- });
- });
- });
- }
- deleteSchema(className) {
- let schemaController;
- return this.loadSchema({
- clearCache: true
- }).then(s => {
- schemaController = s;
- return schemaController.getOneSchema(className, true);
- }).catch(error => {
- if (error === undefined) {
- return {
- fields: {}
- };
- } else {
- throw error;
- }
- }).then(schema => {
- return this.collectionExists(className).then(() => this.adapter.count(className, {
- fields: {}
- }, null, '', false)).then(count => {
- if (count > 0) {
- throw new _node.Parse.Error(255, `Class ${className} is not empty, contains ${count} objects, cannot drop schema.`);
- }
- return this.adapter.deleteClass(className);
- }).then(wasParseCollection => {
- if (wasParseCollection) {
- const relationFieldNames = Object.keys(schema.fields).filter(fieldName => schema.fields[fieldName].type === 'Relation');
- return Promise.all(relationFieldNames.map(name => this.adapter.deleteClass(joinTableName(className, name)))).then(() => {
- _SchemaCache.default.del(className);
- return schemaController.reloadData();
- });
- } else {
- return Promise.resolve();
- }
- });
- });
- }
- // This helps to create intermediate objects for simpler comparison of
- // key value pairs used in query objects. Each key value pair will represented
- // in a similar way to json
- objectToEntriesStrings(query) {
- return Object.entries(query).map(a => a.map(s => JSON.stringify(s)).join(':'));
- }
- // Naive logic reducer for OR operations meant to be used only for pointer permissions.
- reduceOrOperation(query) {
- if (!query.$or) {
- return query;
- }
- const queries = query.$or.map(q => this.objectToEntriesStrings(q));
- let repeat = false;
- do {
- repeat = false;
- for (let i = 0; i < queries.length - 1; i++) {
- for (let j = i + 1; j < queries.length; j++) {
- const [shorter, longer] = queries[i].length > queries[j].length ? [j, i] : [i, j];
- const foundEntries = queries[shorter].reduce((acc, entry) => acc + (queries[longer].includes(entry) ? 1 : 0), 0);
- const shorterEntries = queries[shorter].length;
- if (foundEntries === shorterEntries) {
- // If the shorter query is completely contained in the longer one, we can strike
- // out the longer query.
- query.$or.splice(longer, 1);
- queries.splice(longer, 1);
- repeat = true;
- break;
- }
- }
- }
- } while (repeat);
- if (query.$or.length === 1) {
- query = _objectSpread(_objectSpread({}, query), query.$or[0]);
- delete query.$or;
- }
- return query;
- }
- // Naive logic reducer for AND operations meant to be used only for pointer permissions.
- reduceAndOperation(query) {
- if (!query.$and) {
- return query;
- }
- const queries = query.$and.map(q => this.objectToEntriesStrings(q));
- let repeat = false;
- do {
- repeat = false;
- for (let i = 0; i < queries.length - 1; i++) {
- for (let j = i + 1; j < queries.length; j++) {
- const [shorter, longer] = queries[i].length > queries[j].length ? [j, i] : [i, j];
- const foundEntries = queries[shorter].reduce((acc, entry) => acc + (queries[longer].includes(entry) ? 1 : 0), 0);
- const shorterEntries = queries[shorter].length;
- if (foundEntries === shorterEntries) {
- // If the shorter query is completely contained in the longer one, we can strike
- // out the shorter query.
- query.$and.splice(shorter, 1);
- queries.splice(shorter, 1);
- repeat = true;
- break;
- }
- }
- }
- } while (repeat);
- if (query.$and.length === 1) {
- query = _objectSpread(_objectSpread({}, query), query.$and[0]);
- delete query.$and;
- }
- return query;
- }
- // Constraints query using CLP's pointer permissions (PP) if any.
- // 1. Etract the user id from caller's ACLgroup;
- // 2. Exctract a list of field names that are PP for target collection and operation;
- // 3. Constraint the original query so that each PP field must
- // point to caller's id (or contain it in case of PP field being an array)
- addPointerPermissions(schema, className, operation, query, aclGroup = []) {
- // Check if class has public permission for operation
- // If the BaseCLP pass, let go through
- if (schema.testPermissionsForClassName(className, aclGroup, operation)) {
- return query;
- }
- const perms = schema.getClassLevelPermissions(className);
- const userACL = aclGroup.filter(acl => {
- return acl.indexOf('role:') != 0 && acl != '*';
- });
- const groupKey = ['get', 'find', 'count'].indexOf(operation) > -1 ? 'readUserFields' : 'writeUserFields';
- const permFields = [];
- if (perms[operation] && perms[operation].pointerFields) {
- permFields.push(...perms[operation].pointerFields);
- }
- if (perms[groupKey]) {
- for (const field of perms[groupKey]) {
- if (!permFields.includes(field)) {
- permFields.push(field);
- }
- }
- }
- // the ACL should have exactly 1 user
- if (permFields.length > 0) {
- // the ACL should have exactly 1 user
- // No user set return undefined
- // If the length is > 1, that means we didn't de-dupe users correctly
- if (userACL.length != 1) {
- return;
- }
- const userId = userACL[0];
- const userPointer = {
- __type: 'Pointer',
- className: '_User',
- objectId: userId
- };
- const queries = permFields.map(key => {
- const fieldDescriptor = schema.getExpectedType(className, key);
- const fieldType = fieldDescriptor && typeof fieldDescriptor === 'object' && Object.prototype.hasOwnProperty.call(fieldDescriptor, 'type') ? fieldDescriptor.type : null;
- let queryClause;
- if (fieldType === 'Pointer') {
- // constraint for single pointer setup
- queryClause = {
- [key]: userPointer
- };
- } else if (fieldType === 'Array') {
- // constraint for users-array setup
- queryClause = {
- [key]: {
- $all: [userPointer]
- }
- };
- } else if (fieldType === 'Object') {
- // constraint for object setup
- queryClause = {
- [key]: userPointer
- };
- } else {
- // This means that there is a CLP field of an unexpected type. This condition should not happen, which is
- // why is being treated as an error.
- throw Error(`An unexpected condition occurred when resolving pointer permissions: ${className} ${key}`);
- }
- // if we already have a constraint on the key, use the $and
- if (Object.prototype.hasOwnProperty.call(query, key)) {
- return this.reduceAndOperation({
- $and: [queryClause, query]
- });
- }
- // otherwise just add the constaint
- return Object.assign({}, query, queryClause);
- });
- return queries.length === 1 ? queries[0] : this.reduceOrOperation({
- $or: queries
- });
- } else {
- return query;
- }
- }
- addProtectedFields(schema, className, query = {}, aclGroup = [], auth = {}, queryOptions = {}) {
- const perms = schema && schema.getClassLevelPermissions ? schema.getClassLevelPermissions(className) : schema;
- if (!perms) return null;
- const protectedFields = perms.protectedFields;
- if (!protectedFields) return null;
- if (aclGroup.indexOf(query.objectId) > -1) return null;
- // for queries where "keys" are set and do not include all 'userField':{field},
- // we have to transparently include it, and then remove before returning to client
- // Because if such key not projected the permission won't be enforced properly
- // PS this is called when 'excludeKeys' already reduced to 'keys'
- const preserveKeys = queryOptions.keys;
- // these are keys that need to be included only
- // to be able to apply protectedFields by pointer
- // and then unset before returning to client (later in filterSensitiveFields)
- const serverOnlyKeys = [];
- const authenticated = auth.user;
- // map to allow check without array search
- const roles = (auth.userRoles || []).reduce((acc, r) => {
- acc[r] = protectedFields[r];
- return acc;
- }, {});
- // array of sets of protected fields. separate item for each applicable criteria
- const protectedKeysSets = [];
- for (const key in protectedFields) {
- // skip userFields
- if (key.startsWith('userField:')) {
- if (preserveKeys) {
- const fieldName = key.substring(10);
- if (!preserveKeys.includes(fieldName)) {
- // 1. put it there temporarily
- queryOptions.keys && queryOptions.keys.push(fieldName);
- // 2. preserve it delete later
- serverOnlyKeys.push(fieldName);
- }
- }
- continue;
- }
- // add public tier
- if (key === '*') {
- protectedKeysSets.push(protectedFields[key]);
- continue;
- }
- if (authenticated) {
- if (key === 'authenticated') {
- // for logged in users
- protectedKeysSets.push(protectedFields[key]);
- continue;
- }
- if (roles[key] && key.startsWith('role:')) {
- // add applicable roles
- protectedKeysSets.push(roles[key]);
- }
- }
- }
- // check if there's a rule for current user's id
- if (authenticated) {
- const userId = auth.user.id;
- if (perms.protectedFields[userId]) {
- protectedKeysSets.push(perms.protectedFields[userId]);
- }
- }
- // preserve fields to be removed before sending response to client
- if (serverOnlyKeys.length > 0) {
- perms.protectedFields.temporaryKeys = serverOnlyKeys;
- }
- let protectedKeys = protectedKeysSets.reduce((acc, next) => {
- if (next) {
- acc.push(...next);
- }
- return acc;
- }, []);
- // intersect all sets of protectedFields
- protectedKeysSets.forEach(fields => {
- if (fields) {
- protectedKeys = protectedKeys.filter(v => fields.includes(v));
- }
- });
- return protectedKeys;
- }
- createTransactionalSession() {
- return this.adapter.createTransactionalSession().then(transactionalSession => {
- this._transactionalSession = transactionalSession;
- });
- }
- commitTransactionalSession() {
- if (!this._transactionalSession) {
- throw new Error('There is no transactional session to commit');
- }
- return this.adapter.commitTransactionalSession(this._transactionalSession).then(() => {
- this._transactionalSession = null;
- });
- }
- abortTransactionalSession() {
- if (!this._transactionalSession) {
- throw new Error('There is no transactional session to abort');
- }
- return this.adapter.abortTransactionalSession(this._transactionalSession).then(() => {
- this._transactionalSession = null;
- });
- }
- // TODO: create indexes on first creation of a _User object. Otherwise it's impossible to
- // have a Parse app without it having a _User collection.
- async performInitialization() {
- await this.adapter.performInitialization({
- VolatileClassesSchemas: SchemaController.VolatileClassesSchemas
- });
- const requiredUserFields = {
- fields: _objectSpread(_objectSpread({}, SchemaController.defaultColumns._Default), SchemaController.defaultColumns._User)
- };
- const requiredRoleFields = {
- fields: _objectSpread(_objectSpread({}, SchemaController.defaultColumns._Default), SchemaController.defaultColumns._Role)
- };
- const requiredIdempotencyFields = {
- fields: _objectSpread(_objectSpread({}, SchemaController.defaultColumns._Default), SchemaController.defaultColumns._Idempotency)
- };
- await this.loadSchema().then(schema => schema.enforceClassExists('_User'));
- await this.loadSchema().then(schema => schema.enforceClassExists('_Role'));
- await this.loadSchema().then(schema => schema.enforceClassExists('_Idempotency'));
- await this.adapter.ensureUniqueness('_User', requiredUserFields, ['username']).catch(error => {
- _logger.default.warn('Unable to ensure uniqueness for usernames: ', error);
- throw error;
- });
- if (!this.options.enableCollationCaseComparison) {
- await this.adapter.ensureIndex('_User', requiredUserFields, ['username'], 'case_insensitive_username', true).catch(error => {
- _logger.default.warn('Unable to create case insensitive username index: ', error);
- throw error;
- });
- await this.adapter.ensureIndex('_User', requiredUserFields, ['email'], 'case_insensitive_email', true).catch(error => {
- _logger.default.warn('Unable to create case insensitive email index: ', error);
- throw error;
- });
- }
- await this.adapter.ensureUniqueness('_User', requiredUserFields, ['email']).catch(error => {
- _logger.default.warn('Unable to ensure uniqueness for user email addresses: ', error);
- throw error;
- });
- await this.adapter.ensureUniqueness('_Role', requiredRoleFields, ['name']).catch(error => {
- _logger.default.warn('Unable to ensure uniqueness for role name: ', error);
- throw error;
- });
- await this.adapter.ensureUniqueness('_Idempotency', requiredIdempotencyFields, ['reqId']).catch(error => {
- _logger.default.warn('Unable to ensure uniqueness for idempotency request ID: ', error);
- throw error;
- });
- const isMongoAdapter = this.adapter instanceof _MongoStorageAdapter.default;
- const isPostgresAdapter = this.adapter instanceof _PostgresStorageAdapter.default;
- if (isMongoAdapter || isPostgresAdapter) {
- let options = {};
- if (isMongoAdapter) {
- options = {
- ttl: 0
- };
- } else if (isPostgresAdapter) {
- options = this.idempotencyOptions;
- options.setIdempotencyFunction = true;
- }
- await this.adapter.ensureIndex('_Idempotency', requiredIdempotencyFields, ['expire'], 'ttl', false, options).catch(error => {
- _logger.default.warn('Unable to create TTL index for idempotency expire date: ', error);
- throw error;
- });
- }
- await this.adapter.updateSchemaWithIndexes();
- }
- _expandResultOnKeyPath(object, key, value) {
- if (key.indexOf('.') < 0) {
- object[key] = value[key];
- return object;
- }
- const path = key.split('.');
- const firstKey = path[0];
- const nextPath = path.slice(1).join('.');
- // Scan request data for denied keywords
- if (this.options && this.options.requestKeywordDenylist) {
- // Scan request data for denied keywords
- for (const keyword of this.options.requestKeywordDenylist) {
- const match = _Utils.default.objectContainsKeyValue({
- [firstKey]: true,
- [nextPath]: true
- }, keyword.key, true);
- if (match) {
- throw new _node.Parse.Error(_node.Parse.Error.INVALID_KEY_NAME, `Prohibited keyword in request data: ${JSON.stringify(keyword)}.`);
- }
- }
- }
- object[firstKey] = this._expandResultOnKeyPath(object[firstKey] || {}, nextPath, value[firstKey]);
- delete object[key];
- return object;
- }
- _sanitizeDatabaseResult(originalObject, result) {
- const response = {};
- if (!result) {
- return Promise.resolve(response);
- }
- Object.keys(originalObject).forEach(key => {
- const keyUpdate = originalObject[key];
- // determine if that was an op
- if (keyUpdate && typeof keyUpdate === 'object' && keyUpdate.__op && ['Add', 'AddUnique', 'Remove', 'Increment', 'SetOnInsert'].indexOf(keyUpdate.__op) > -1) {
- // only valid ops that produce an actionable result
- // the op may have happened on a keypath
- this._expandResultOnKeyPath(response, key, result);
- // Revert array to object conversion on dot notation for arrays (e.g. "field.0.key")
- if (key.includes('.')) {
- const [field, index] = key.split('.');
- const isArrayIndex = Array.from(index).every(c => c >= '0' && c <= '9');
- if (isArrayIndex && Array.isArray(result[field]) && !Array.isArray(response[field])) {
- response[field] = result[field];
- }
- }
- }
- });
- return Promise.resolve(response);
- }
- }
- module.exports = DatabaseController;
- // Expose validateQuery for tests
- module.exports._validateQuery = validateQuery;
- module.exports.filterSensitiveData = filterSensitiveData;
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfbm9kZSIsInJlcXVpcmUiLCJfbG9kYXNoIiwiX2ludGVyb3BSZXF1aXJlRGVmYXVsdCIsIl9pbnRlcnNlY3QiLCJfZGVlcGNvcHkiLCJfbG9nZ2VyIiwiX1V0aWxzIiwiU2NoZW1hQ29udHJvbGxlciIsIl9pbnRlcm9wUmVxdWlyZVdpbGRjYXJkIiwiX1N0b3JhZ2VBZGFwdGVyIiwiX01vbmdvU3RvcmFnZUFkYXB0ZXIiLCJfUG9z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uICAgICAgICAgIGlmICghKG9iamVjdFtrZXldLm9iamVjdHMgaW5zdGFuY2VvZiBBcnJheSkpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBQYXJzZS5FcnJvcihQYXJzZS5FcnJvci5JTlZBTElEX0pTT04sICdvYmplY3RzIHRvIGFkZCBtdXN0IGJlIGFuIGFycmF5Jyk7XG4gICAgICAgICAgfVxuICAgICAgICAgIG9iamVjdFtrZXldID0gb2JqZWN0W2tleV0ub2JqZWN0cztcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAnQWRkVW5pcXVlJzpcbiAgICAgICAgICBpZiAoIShvYmplY3Rba2V5XS5vYmplY3RzIGluc3RhbmNlb2YgQXJyYXkpKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgUGFyc2UuRXJyb3IoUGFyc2UuRXJyb3IuSU5WQUxJRF9KU09OLCAnb2JqZWN0cyB0byBhZGQgbXVzdCBiZSBhbiBhcnJheScpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBvYmplY3Rba2V5XSA9IG9iamVjdFtrZXldLm9iamVjdHM7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgJ1JlbW92ZSc6XG4gICAgICAgICAgaWYgKCEob2JqZWN0W2tleV0ub2JqZWN0cyBpbnN0YW5jZW9mIEFycmF5KSkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IFBhcnNlLkVycm9yKFBhcnNlLkVycm9yLklOVkFMSURfSlNPTiwgJ29iamVjdHMgdG8gYWRkIG11c3QgYmUgYW4gYXJyYXknKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgb2JqZWN0W2tleV0gPSBbXTtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAnRGVsZXRlJzpcbiAgICAgICAgICBkZWxldGUgb2JqZWN0W2tleV07XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgdGhyb3cgbmV3IFBhcnNlLkVycm9y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RlciA9IGFjbCA9PT0gdW5kZWZpbmVkO1xuICAgIHZhciBhY2xHcm91cCA9IGFjbCB8fCBbXTtcblxuICAgIHJldHVybiB0aGlzLmxvYWRTY2hlbWFJZk5lZWRlZCh2YWxpZFNjaGVtYUNvbnRyb2xsZXIpLnRoZW4oc2NoZW1hQ29udHJvbGxlciA9PiB7XG4gICAgICByZXR1cm4gKGlzTWFzdGVyXG4gICAgICAgID8gUHJvbWlzZS5yZXNvbHZlKClcbiAgICAgICAgOiBzY2hlbWFDb250cm9sbGVyLnZhbGlkYXRlUGVybWlzc2lvbihjbGFzc05hbWUsIGFjbEdyb3VwLCAndXBkYXRlJylcbiAgICAgIClcbiAgICAgICAgLnRoZW4oKCkgPT4ge1xuICAgICAgICAgIHJlbGF0aW9uVXBkYXRlcyA9IHRoaXMuY29sbGVjdFJlbGF0aW9uVXBkYXRlcyhjbGFzc05hbWUsIG9yaWdpbmFsUXVlcnkub2JqZWN0SWQsIHVwZGF0ZSk7XG4gICAgICAgICAgaWYgKCFpc01hc3Rlcikge1xuICAgICAgICAgICAgcXVlcnkgPSB0aGlzLmFkZFBvaW50ZXJQZXJtaXNzaW9ucyhcbiAgICAgICAgICAgICAgc2NoZW1hQ29udHJvbGxlcixcbiAgICAgICAgICAgICAgY2xhc3NOYW1lLFxuICAgICAgICAgICAgICAndXBkYXRlJyxcbiAgICAgICAgICAgICAgcXVlcnksXG4gICAgICAgICAgICAgIGFjbEdyb3VwXG4gICAgICAgICAgICApO1xuXG4gICAgICAgICAgICBpZiAoYWRkc0ZpZWxkKSB7XG4gICAgICAgICAgICAgIHF1ZXJ5ID0ge1xuICAgICAgICAgICAgICAgICRhbmQ6IFtcbiAgICAgICAgICAgICAgICAgIHF1ZXJ5LFxuICAgICAgICAgICAgICAgICAgdGhpcy5hZGRQb2ludGVyUGVybWlzc2lvbnMoXG4gICAgICAgICAgICAgICAgICAgIHNjaGVtYUNvbnRyb2xsZXIsXG4gICAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgJ2FkZEZpZWxkJyxcbiAgICAgICAgICAgICAgICAgICAgcXVlcnksXG4gICAgICAgICAgICAgICAgICAgIGFjbEdyb3VwXG4gICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICghcXVlcnkpIHtcbiAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUoKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGFjbCkge1xuICAgICAgICAgICAgcXVlcnkgPSBhZGRXcml0ZUFDTChxdWVyeSwgYWNsKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgdmFsaWRhdGVRdWVyeShxdWVyeSwgaXNNYXN0ZXIsIGZhbHNlLCB0cnVlKTtcbiAgICAgICAgICByZXR1cm4gc2NoZW1hQ29udHJvbGxlclxuICAgICAgICAgICAgLmdldE9uZVNjaGVtYShjbGFzc05hbWUsIHRydWUpXG4gICAgICAgICAgICAuY2F0Y2goZXJyb3IgPT4ge1xuICAgICAgICAgICAgICAvLyBJZiB0aGUgc2NoZW1hIGRvZXNuJ3QgZXhpc3QsIHByZXRlbmQgaXQgZXhpc3RzIHdpdGggbm8gZmllbGRzLiBUaGlzIGJlaGF2aW9yXG4gICAgICAgICAgICAgIC8vIHdpbGwgbGlrZWx5IG5lZWQgcmV2aXNpdGluZy5cbiAgICAgICAgICAgICAgaWYgKGVycm9yID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4geyBmaWVsZHM6IHt9IH07XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgdGhyb3cgZXJyb3I7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLnRoZW4oc2NoZW1hID0+IHtcbiAgICAgICAgICAgICAgT2JqZWN0LmtleXModXBkYXRlKS5mb3JFYWNoKGZpZWxkTmFtZSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKGZpZWxkTmFtZS5tYXRjaCgvXmF1dGhEYXRhXFwuKFthLXpBLVowLTlfXSspXFwuaWQkLykpIHtcbiAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBQYXJzZS5FcnJvcihcbiAgICAgICAgICAgICAgICAgICAgUGFyc2UuRXJyb3IuSU5WQUxJRF9LRVlfTkFNRSxcbiAgICAgICAgICAgICAgICAgICAgYEludmFsaWQgZmllbGQgbmFtZSBmb3IgdXBkYXRlOiAke2ZpZWxkTmFtZX1gXG4gICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb25zdCByb290RmllbGROYW1lID0gZ2V0Um9vdEZpZWxkTmFtZShmaWVsZE5hbWUpO1xuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICFTY2hlbWFDb250cm9sbGVyLmZpZWxkTmFtZUlzVmFsaWQocm9vdEZpZWxkTmFtZSwgY2xhc3NOYW1lKSAmJlxuICAgICAgICAgICAgICAgICAgIWlzU3BlY2lhbFVwZGF0ZUtleShyb290RmllbGROYW1lKVxuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFBhcnNlLkVycm9yKFxuICAgICAgICAgICAgICAgICAgICBQYXJzZS5FcnJvci5JTlZBTElEX0tFWV9OQU1FLFxuICAgICAgICAgICAgICAgICAgICBgSW52YWxpZCBmaWVsZCBuYW1lIGZvciB1cGRhdGU6ICR7ZmllbGROYW1lfWBcbiAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgZm9yIChjb25zdCB1cGRhdGVPcGVyYXRpb24gaW4gdXBkYXRlKSB7XG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgdXBkYXRlW3VwZGF0ZU9wZXJhdGlvbl0gJiZcbiAgICAgICAgICAgICAgICAgIHR5cGVvZiB1cGRhdGVbdXBkYXRlT3BlcmF0aW9uXSA9PT0gJ29iamVjdCcgJiZcbiAgICAgICAgICAgICAgICAgIE9iamVjdC5rZXlzKHVwZGF0ZVt1cGRhdGVPcGVyYXRpb25dKS5zb21lKFxuICAgICAgICAgICAgICAgICAgICBpbm5lcktleSA9PiBpbm5lcktleS5pbmNsdWRlcygnJCcpIHx8IGlubmVyS2V5LmluY2x1ZGVzKCcuJylcbiAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBQYXJzZS5FcnJvcihcbiAgICAgICAgICAgICAgICAgICAgUGFyc2UuRXJyb3IuSU5WQUxJRF9ORVNURURfS0VZLFxuICAgICAgICAgICAgICAgICAgICBcIk5lc3RlZCBrZXlzIHNob3VsZCBub3QgY29udGFpbiB0aGUgJyQnIG9yICcuJyBjaGFyYWN0ZXJzXCJcbiAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHVwZGF0ZSA9IHRyYW5zZm9ybU9iamVjdEFDTCh1cGRhdGUpO1xuICAgICAgICAgICAgICBjb252ZXJ0RW1haWxUb0xvd2VyY2FzZSh1cGRhdGUsIGNsYXNzTmFtZSwgdGhpcy5vcHRpb25zKTtcbiAgICAgICAgICAgICAgY29udmVydFVzZXJuYW1lVG9Mb3dlcmNhc2UodXBkYXRlLCBjbGFzc05hbWUsIHRoaXMub3B0aW9ucyk7XG4gICAgICAgICAgICAgIHRyYW5zZm9ybUF1dGhEYXRhKGNsYXNzTmFtZSwgdXBkYXRlLCBzY2hlbWEpO1xuICAgICAgICAgICAgICBpZiAodmFsaWRhdGVPbmx5KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuYWRhcHRlci5maW5kKGNsYXNzTmFtZSwgc2NoZW1hLCBxdWVyeSwge30pLnRoZW4ocmVzdWx0ID0+IHtcbiAgICAgICAgICAgICAgICAgIGlmICghcmVzdWx0IHx8ICFyZXN1bHQubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBQYXJzZS5FcnJvcihQYXJzZS5FcnJvci5PQkpFQ1RfTk9UX0ZPVU5ELCAnT2JqZWN0IG5vdCBmb3VuZC4nKTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIHJldHVybiB7fTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAobWFueSkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmFkYXB0ZXIudXBkYXRlT2JqZWN0c0J5UXVlcnkoXG4gICAgICAgICAgICAgICAgICBjbGFzc05hbWUsXG4gICAgICAgICAgICAgICAgICBzY2hlbWEsXG4gICAgICAgICAgICAgICAgICBxdWVyeSxcbiAgICAgICAgICAgICAgICAgIHVwZGF0ZSxcbiAgICAgICAgICAgICAgICAgIHRoaXMuX3RyYW5zYWN0aW9uYWxTZXNzaW9uXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgfSBlbHNlIGlmICh1cHNlcnQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5hZGFwdGVyLnVwc2VydE9uZU9iamVjdChcbiAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZSxcbiAgICAgICAgICAgICAgICAgIHNjaGVtYSxcbiAgICAgICAgICAgICAgICAgIHF1ZXJ5LFxuICAgICAgICAgICAgICAgICAgdXBkYXRlLFxuICAgICAgICAgICAgICAgICAgdGhpcy5fdHJhbnNhY3Rpb25hbFNlc3Npb25cbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmFkYXB0ZXIuZmluZE9uZUFuZFVwZGF0ZShcbiAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZSxcbiAgICAgICAgICAgICAgICAgIHNjaGVtYSxcbiAgICAgICAgICAgICAgICAgIHF1ZXJ5LFxuICAgICAgICAgICAgICAgICAgdXBkYXRlLFxuICAgICAgICAgICAgICAgICAgdGhpcy5fdHJhbnNhY3Rpb25hbFNlc3Npb25cbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSlcbiAgICAgICAgLnRoZW4oKHJlc3VsdDogYW55KSA9PiB7XG4gICAgICAgICAgaWYgKCFyZXN1bHQpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBQYXJzZS5FcnJvcihQYXJzZS5FcnJvci5PQkpFQ1RfTk9UX0ZPVU5ELCAnT2JqZWN0IG5vdCBmb3VuZC4nKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHZhbGlkYXRlT25seSkge1xuICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIHRoaXMuaGFuZGxlUmVsYXRpb25VcGRhdGVzKFxuICAgICAgICAgICAgY2xhc3NOYW1lLFxuICAgICAgICAgICAgb3JpZ2luYWxRdWVyeS5vYmplY3RJZCxcbiAgICAgICAgICAgIHVwZGF0ZSxcbiAgICAgICAgICAgIHJlbGF0aW9uVXBkYXRlc1xuICAgICAgICAgICkudGhlbigoKSA9PiB7XG4gICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICAgIH0pO1xuICAgICAgICB9KVxuICAgICAgICAudGhlbihyZXN1bHQgPT4ge1xuICAgICAgICAgIGlmIChza2lwU2FuaXRpemF0aW9uKSB7XG4gICAgICAgICAgICByZXR1cm4gUHJvbWlzZS5yZXNvbHZlKHJlc3VsdCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiB0aGlzLl9zYW5pdGl6ZURhdGFiYXNlUmVzdWx0KG9yaWdpbmFsVXBkYXRlLCByZXN1bHQpO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hc3NFeGlzdHMoY2xhc3NOYW1lKSlcbiAgICAgICAgICAudGhlbigoKSA9PiBzY2hlbWFDb250cm9sbGVyLmdldE9uZVNjaGVtYShjbGFzc05hbWUsIHRydWUpKVxuICAgICAgICAgIC50aGVuKHNjaGVtYSA9PiB7XG4gICAgICAgICAgICB0cmFuc2Zvcm1BdXRoRGF0YShjbGFzc05hbWUsIG9iamVjdCwgc2NoZW1hKTtcbiAgICAgICAgICAgIGZsYXR0ZW5VcGRhdGVPcGVyYXRvcnNGb3JDcmVhdGUob2JqZWN0KTtcbiAgICAgICAgICAgIGlmICh2YWxpZGF0ZU9ubHkpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHt9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuYWRhcHRlci5jcmVhdGVPYmplY3QoXG4gICAgICAgICAgICAgIGNsYXNzTmFtZSxcbiAgICAgICAgICAgICAgU2NoZW1hQ29udHJvbGxlci5jb252ZXJ0U2NoZW1hVG9BZGFwdGVyU2NoZW1hKHNjaGVtYSksXG4gICAgICAgICAgICAgIG9iamVjdCxcbiAgICAgICAgICAgICAgdGhpcy5fdHJhbnNhY3Rpb25hbFNlc3Npb25cbiAgICAgICAgICAgICk7XG4gICAgICAgICAgfSlcbiAgICAgICAgICAudGhlbihyZXN1bHQgPT4ge1xuICAgICAgICAgICAgaWYgKHZhbGlkYXRlT25seSkge1xuICAgICAgICAgICAgICByZXR1cm4gb3JpZ2luYWxPYmplY3Q7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5oYW5kbGVSZWxhdGlvblVwZGF0ZXMoXG4gICAgICAgICAgICAgIGNsYXNzTmFtZSxcbiAgICAgICAgICAgICAgb2JqZWN0Lm9iamVjdElkLFxuICAgICAgICAgICAgICBvYmplY3QsXG4gICAgICAgICAgICAgIHJlbGF0aW9uVXBkYXRlc1xuICAgICAgICAgICAgKS50aGVuKCgpID0+IHtcbiAgICAgICAgICA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Gw7XG4gICAgICBpZiAoXG4gICAgICAgIHF1ZXJ5W2tleV0gJiZcbiAgICAgICAgKHF1ZXJ5W2tleV1bJyRpbiddIHx8XG4gICAgICAgICAgcXVlcnlba2V5XVsnJG5lJ10gfHxcbiAgICAgICAgICBxdWVyeVtrZXldWyckbmluJ10gfHxcbiAgICAgICAgICBxdWVyeVtrZXldLl9fdHlwZSA9PSAnUG9pbnRlcicpXG4gICAgICApIHtcbiAgICAgICAgLy8gQnVpbGQgdGhlIGxpc3Qgb2YgcXVlcmllc1xuICAgICAgICBxdWVyaWVzID0gT2JqZWN0LmtleXMocXVlcnlba2V5XSkubWFwKGNvbnN0cmFpbnRLZXkgPT4ge1xuICAgICAgICAgIGxldCByZWxhdGVkSWRzO1xuICAgICAgICAgIGxldCBpc05lZ2F0aW9uID0gZmFsc2U7XG4gICAgICAgICAgaWYgKGNvbnN0cmFpbnRLZXkgPT09ICdvYmplY3RJZCcpIHtcbiAgICAgICAgICAgIHJlbGF0ZWRJZHMgPSBbcXVlcnlba2V5XS5vYmplY3RJZF07XG4gICAgICAgICAgfSBlbHNlIGlmIChjb25zdHJhaW50S2V5ID09ICckaW4nKSB7XG4gICAgICAgICAgICByZWxhdGVkSWRzID0gcXVlcnlba2V5XVsnJGluJ10ubWFwKHIgPT4gci5vYmplY3RJZCk7XG4gICAgICAgICAgfSBlbHNlIGlmIChjb25zdHJhaW50S2V5ID09ICckbmluJykge1xuICAgICAgICAgICAgaXNOZWdhdGlvbiA9IHRydWU7XG4gICAgICAgICAgICByZWxhdGVkSWRzID0gcXVlcnlba2V5XVsnJG5pbiddLm1hcChyID0+IHIub2JqZWN0SWQpO1xuICAgICAgICAgIH0gZWxzZSBpZiAoY29uc3RyYWludEtleSA9PSAnJG5lJykge1xuICAgICAgICAgICAgaXNOZWdhdGlvbiA9IHRydWU7XG4gICAgICAgICAgICByZWxhdGVkSWRzID0gW3F1ZXJ5W2tleV1bJyRuZSddLm9iamVjdElkXTtcbiAgICAgICAgICB9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XG4gICAgICAgICAgICBpZiAoZmllbGROYW1lLm1hdGNoKC9eYXV0aERhdGFcXC4oW2EtekEtWjAtOV9dKylcXC5pZCQvKSkge1xuICAgICAgICAgICAgICB0aHJvdyBuZXcgUGFyc2UuRXJyb3IoUGFyc2UuRXJyb3IuSU5WQUxJRF9LRVlfTkFNRSwgYENhbm5vdCBzb3J0IGJ5ICR7ZmllbGROYW1lfWApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY29uc3Qgcm9vdEZpZWxkTmFtZSA9IGdldFJvb3RGaWVsZE5hbWUoZmllbGROYW1lKTtcbiAgICAgICAgICAgIGlmICghU2NoZW1hQ29udHJvbGxlci5maWVsZE5hbWVJc1ZhbGlkKHJvb3RGaWVsZE5hbWUsIGNsYXNzTmFtZSkpIHtcbiAgICAgICAgICAgICAgdGhyb3cgbmV3IFBhcnNlLkVycm9yKFxuICAgICAgICAgICAgICAgIFBhcnNlLkVycm9yLklOVkFMSURfS0VZX05BTUUsXG4gICAgICAgICAgICAgICAgYEludmFsaWQgZmllbGQgbmFtZTogJHtmaWVsZE5hbWV9LmBcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghc2NoZW1hLmZpZWxkc1tmaWVsZE5hbWUuc3BsaXQoJy4nKVswXV0gJiYgZmllbGROYW1lICE9PSAnc2NvcmUnKSB7XG4gICAgICAgICAgICAgIGRlbGV0ZSBzb3J0W2ZpZWxkTmFtZV07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG4gICAgICAgICAgcmV0dXJuIChpc01hc3RlclxuICAgICAgICAgICAgPyBQcm9taXNlLnJlc29sdmUoKVxuICAgICAgICAgICAgOiBzY2hlbWFDb250cm9sbGVyLnZhbGlkYXRlUGVybWlzc2lvbihjbGFzc05hbWUsIGFjbEdyb3VwLCBvcClcbiAgICAgICAgICApXG4gICAgICAgICAgICAudGhlbigoKSA9PiB0aGlzLnJlZHVjZVJlbGF0aW9uS2V5cyhjbGFzc05hbWUsIHF1ZXJ5LCBxdWVyeU9wdGlvbnMpKVxuICAgICAgICAgICAgLnRoZW4oKCkgPT4gdGhpcy5yZWR1Y2VJblJlbGF0aW9uKGNsYXNzTmFtZSwgcXVlcnksIHNjaGVtYUNvbnRyb2xsZXIpKVxuICAgICAgICAgICAgLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgICBsZXQgcHJvdGVjdGVkRmllbGRzO1xuICAgICAgICAgICAgICBpZiAoIWlzTWFzdGVyKSB7XG4gICAgICAgICAgICAgICAgcXVlcnkgPSB0aGlzLmFkZFBvaW50ZXJQZXJtaXNzaW9ucyhcbiAgICAgICAgICAgICAgICAgIHNjaGVtYUNvbnRyb2xsZXIsXG4gICAgICAgICAgICAgICAgICBjbGFzc05hbWUsXG4gICAgICAgICAgICAgICAgICBvcCxcbiAgICAgICAgICAgICAgICAgIHF1ZXJ5LFxuICAgICAgICAgICAgICAgICAgYWNsR3JvdXBcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIC8qIERvbid0IHVzZSBwcm9qZWN0aW9ucyB0byBvcHRpbWl6ZSB0aGUgcHJvdGVjdGVkRmllbGRzIHNpbmNlIHRoZSBwcm90ZWN0ZWRGaWVsZHNcbiAgICAgICAgICAgICAgICAgIGJhc2VkIG9uIHBvaW50ZXItcGVybWlzc2lvbnMgYXJlIGRldGVybWluZWQgYWZ0ZXIgcXVlcnlpbmcuIFRoZSBmaWx0ZXJpbmcgY2FuXG4gICAgICAgICAgICAgICAgICBvdmVyd3JpdGUgdGhlIHByb3RlY3RlZCBmaWVsZHMuICovXG4gICAgICAgICAgICAgICAgcHJvdGVjdGVkRmllbGRzID0gdGhpcy5hZGRQcm90ZWN0ZWRGaWVsZHMoXG4gICAgICAgICAgICAgICAgICBzY2hlbWFDb250cm9sbGVyLFxuICAgICAgICAgICAgICAgICAgY2xhc3NOYW1lLFxuICAgICAgICAgICAgICAgICAgcXVlcnksXG4gICAgICAgICAgICAgICAgICBhY2xHcm91cCxcbiAgICAgICAgICAgICAgICAgIGF1dGgsXG4gICAgICAgICAgICAgICAgICBxdWVyeU9wdGlvbnNcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmICghcXVlcnkpIHtcbiAgICAgICAgICAgICAgICBpZiAob3AgPT09ICdnZXQnKSB7XG4gICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUGFyc2UuRXJyb3IoUGFyc2UuRXJyb3IuT0JKRUNUX05PVF9GT1VORCwgJ09iamVjdCBub3QgZm91bmQuJyk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiBbXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKCFpc01hc3Rlcikge1xuICAgICAgICAgICAgICAgIGlmIChvcCA9PT0gJ3VwZGF0ZScgfHwgb3AgPT09ICdkZWxldGUnKSB7XG4gICAgICAgICAgICAgICAgICBxdWVyeSA9IGFkZFdyaXRlQUNMKHF1ZXJ5LCBhY2xHcm91cCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIHF1ZXJ5ID0gYWRkUmVhZEFDTChxdWVyeSwgYWNsR3JvdXApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB2YWxpZGF0ZVF1ZXJ5KHF1ZXJ5LCBpc01hc3RlciwgaXNNYWludGVuYW5jZSwgZmFsc2UpO1xuICAgICAgICAgICAgICBpZiAoY291bnQpIHtcbiAgICAgICAgICAgICAgICBpZiAoIWNsYXNzRXhpc3RzKSB7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuYWRhcHRlci5jb3VudChcbiAgICAgICAgICAgICAgICAgICAgY2xhc3NOYW1lLFxuICAgICAgICAgICAgICAgICAgICBzY2hlbWEsXG4gICAgICAgICAgICAgICAgICAgIHF1ZXJ5LFxuICAgICAgICAgICAgICAgICAgICByZWFkUHJlZmVyZW5jZSxcbiAgICAgICAgICAgICAgICAgICAgdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICBoaW50LFxuICAgICAgICAgICAgICAgICAgICBjb21tZW50XG4gICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBlbHNlIGlmIChkaXN0aW5jdCkge1xuICAgICAgICAgICAgICAgIGlmICghY2xhc3NFeGlzdHMpIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiBbXTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuYWRhcHRlci5kaXN0aW5jdChjbGFzc05hbWUsIHNjaGVtYSwgcXVlcnksIGRpc3RpbmN0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAocGlwZWxpbmUpIHtcbiAgICAgICAgICAgICAgICBpZiAoIWNsYXNzRXhpc3RzKSB7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gW107XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmFkYXB0ZXIuYWdncmVnYXRlKFxuICAgICAgICAgICAgICAgICAgICBjbGFzc05hbWUsXG4gICAgICAgICAgICAgICAgICAgIHNjaGVtYSxcbiAgICAgICAgICAgICAgICAgICAgcGlwZWxpbmUsXG4gICAgICAgICAgICAgICAgICAgIHJlYWRQcmVmZXJlbmNlLFxuICAgICAgICAgICAgICAgICAgICBoaW50LFxuICAgICAgICAgICAgICAgICAgICBleHBsYWluLFxuICAgICAgICAgICAgICAgICAgICBjb21tZW50XG4gICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBlbHNlIGlmIChleHBsYWluKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuYWRhcHRlci5maW5kKGNsYXNzTmFtZSwgc2NoZW1hLCBxdWVyeSwgcXVlcnlPcHRpb25zKTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5hZGFwdGVyXG4gICAgICAgICAgICAgICAgICAuZmluZChjbGFzc05hbWUsIHNjaGVtYSwgcXVlcnksIHF1ZXJ5T3B0aW9ucylcbiAgICAgICAgICAgICAgICAgIC50aGVuKG9iamVjdHMgPT5cbiAgICAgICAgICAgICAgICAgICAgb2JqZWN0cy5tYXAob2JqZWN0ID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICBvYmplY3QgPSB1bnRyYW5zZm9ybU9iamVjdEFDTChvYmplY3QpO1xuICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmaWx0ZXJTZW5zaXRpdmVEYXRhKFxuICAgICAgICAgICAgICAgICAgICAgICAgaXNNYXN0ZXIsXG4gICAgICAgICAgICAgICAgICAgICAgICBpc01haW50ZW5hbmNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgYWNsR3JvdXAsXG4gICAgICAgICAgICAgICAgICAgICAgICBhdXRoLFxuICAgICAgICAgICAgICAgICAgICAgICAgb3AsXG4gICAgICAgICAgICAgICAgICAgICAgICBzY2hlbWFDb250cm9sbGVyLFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3NOYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgcHJvdGVjdGVkRmllbGRzLFxuICAgICAgICAgICAgICAgICAgICAgICAgb2JqZWN0XG4gICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgIC5jYXRjaChlcnJvciA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBQYXJzZS5FcnJvcihQYXJzZS5FcnJvci5JTlRFUk5BTF9TRVJWRVJfRVJST1IsIGVycm9yKTtcbiAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgfSk7XG4gIH1cblxuICBkZWxldGVTY2hlbWEoY2xhc3NOYW1lOiBzdHJpbmcpOiBQcm9taXNlPHZvaWQ+IHtcbiAgICBsZXQgc2NoZW1hQ29udHJvbGxlcjtcbiAgICByZXR1cm4gdGhpcy5sb2FkU2NoZW1hKHsgY2xlYXJDYWNoZTogdHJ1ZSB9KVxuICAgICAgLnRoZW4ocyA9PiB7XG4gICAgICAgIHNjaGVtYUNvbnRyb2xsZXIgPSBzO1xuICAgICAgICByZXR1cm4gc2NoZW1hQ29udHJvbGxlci5nZXRPbmVTY2hlbWEoY2xhc3NOYW1lLCB0cnVlKTtcbiAgICAgIH0pXG4gICAgICAuY2F0Y2goZXJyb3IgPT4ge1xuICAgICAgICBpZiAoZXJyb3IgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIHJldHVybiB7IGZpZWxkczoge30gfTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB0aHJvdyBlcnJvcjtcbiAgICAgICAgfVxuICAgICAgfSlcbiAgICAgIC50aGVuKChzY2hlbWE6IGFueSkgPT4ge1xuICAgICAgICByZXR1cm4gdGhpcy5jb2xsZWN0aW9uRXhpc3RzKGNsYXNzTmFtZSlcbiAgICAgICAgICAudGhlbigoKSA9PiB0aGlzLmFkYXB0ZXIuY291bnQoY2xhc3NOYW1lLCB7IGZpZWxkczoge30gfSwgbnVsbCwgJycsIGZhbHNlKSlcbiAgICAgICAgICAudGhlbihjb3VudCA9PiB7XG4gICAgICAgICAgICBpZiAoY291bnQgPiAwKSB7XG4gICAgICAgICAgICAgIHRocm93IG5ldyBQYXJzZS5FcnJvcihcbiAgICAgICAgICAgICAgICAyNTUsXG4gICAgICAgICAgICAgICAgYENsYXNzICR7Y2xhc3NOYW1lfSBpcyBub3QgZW1wdHksIGNvbnRhaW5zICR7Y291bnR9IG9iamVjdHMsIGNhbm5vdCBkcm9wIHNjaGVtYS5gXG4gICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5hZGFwdGVyLmRlbGV0ZUNsYXNzKGNsYXNzTmFtZSk7XG4gICAgICAgICAgfSlcbiAgICAgICAgICAudGhlbih3YXNQYXJzZUNvbGxlY3Rpb24gPT4ge1xuICAgICAgICAgICAgaWYgKHdhc1BhcnNlQ29sbGVjdGlvbikge1xuICAgICAgICAgICAgICBjb25zdCByZWxhdGlvbkZpZWxkTmFtZXMgPSBPYmplY3Qua2V5cyhzY2hlbWEuZmllbGRzKS5maWx0ZXIoXG4gICAgICAgICAgICAgICAgZmllbGROYW1lID0+IHNjaGVtYS5maWVsZHNbZmllbGROYW1lXS50eXBlID09PSAnUmVsYXRpb24nXG4gICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLmFsbChcbiAgICAgICAgICAgICAgICByZWxhdGlvbkZpZWxkTmFtZXMubWFwKG5hbWUgPT5cbiAgICAgICAgICAgICAgICAgIHRoaXMuYWRhcHRlci5kZWxldGVDbGFzcyhqb2luVGFibGVOYW1lKGNsYXNzTmFtZSwgbmFtZSkpXG4gICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICApLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgICAgIFNjaGVtYUNhY2hlLmRlbChjbGFzc05hbWUpO1xuICAgICAgICAgICAgICAgIHJldHVybiBzY2hlbWFDb250cm9sbGVyLnJlbG9hZERhdGEoKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZXR1cm4gUHJvbWlzZS5yZXNvbHZlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG4gICAgICB9KTtcb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