chore: build

This commit is contained in:
Ewout Stortenbeker 2023-05-21 13:30:24 +02:00
parent 3018817786
commit cb75ef14ba
18 changed files with 423 additions and 28 deletions

29
dist/browser.js vendored
View file

@ -401,8 +401,8 @@ class LocalApi extends acebase_core_1.Api {
}) {
return this.storage.importNode(path, read, options);
}
async setSchema(path, schema) {
return this.storage.setSchema(path, schema);
async setSchema(path, schema, warnOnly = false) {
return this.storage.setSchema(path, schema, warnOnly);
}
async getSchema(path) {
return this.storage.getSchema(path);
@ -6451,7 +6451,7 @@ class Storage extends acebase_core_1.SimpleEventEmitter {
* @param path target path to enforce the schema on, can include wildcards. Eg: 'users/*\/posts/*' or 'users/$uid/posts/$postid'
* @param schema schema type definitions. When null value is passed, a previously set schema is removed.
*/
setSchema(path, schema) {
setSchema(path, schema, warnOnly = false) {
if (typeof schema === 'undefined') {
throw new TypeError('schema argument must be given');
}
@ -6462,7 +6462,10 @@ class Storage extends acebase_core_1.SimpleEventEmitter {
return;
}
// Parse schema, add or update it
const definition = new acebase_core_1.SchemaDefinition(schema);
const definition = new acebase_core_1.SchemaDefinition(schema, {
warnOnly,
warnCallback: (message) => this.debug.warn(message),
});
const item = this._schemas.find(s => s.path === path);
if (item) {
item.schema = definition;
@ -6804,8 +6807,8 @@ class AceBaseBase extends simple_event_emitter_1.SimpleEventEmitter {
get: (path) => {
return this.api.getSchema(path);
},
set: (path, schema) => {
return this.api.setSchema(path, schema);
set: (path, schema, warnOnly = false) => {
return this.api.setSchema(path, schema, warnOnly);
},
all: () => {
return this.api.getSchemas();
@ -6859,7 +6862,7 @@ class Api extends simple_event_emitter_1.SimpleEventEmitter {
createIndex(path, key, options) { throw new NotImplementedError('createIndex'); }
getIndexes() { throw new NotImplementedError('getIndexes'); }
deleteIndex(filePath) { throw new NotImplementedError('deleteIndex'); }
setSchema(path, schema) { throw new NotImplementedError('setSchema'); }
setSchema(path, schema, warnOnly) { throw new NotImplementedError('setSchema'); }
getSchema(path) { throw new NotImplementedError('getSchema'); }
getSchemas() { throw new NotImplementedError('getSchemas'); }
validateSchema(path, value, isUpdate) { throw new NotImplementedError('validateSchema'); }
@ -10379,7 +10382,8 @@ function getConstructorType(val) {
}
}
class SchemaDefinition {
constructor(definition) {
constructor(definition, handling = { warnOnly: false }) {
this.handling = handling;
this.source = definition;
if (typeof definition === 'object') {
// Turn object into typescript definitions
@ -10427,7 +10431,14 @@ class SchemaDefinition {
this.type = parse(this.text);
}
check(path, value, partial, trailKeys) {
return checkType(path, this.type, value, partial, trailKeys);
const result = checkType(path, this.type, value, partial, trailKeys);
if (!result.ok && this.handling.warnOnly) {
// Only issue a warning, allows schema definitions to be added to a production db to monitor if they are accurate before enforcing them.
result.warning = `${partial ? 'Partial schema' : 'Schema'} check on path "${path}"${trailKeys ? ` for child "${trailKeys.join('/')}"` : ''} failed: ${result.reason}`;
result.ok = true;
this.handling.warnCallback(result.warning);
}
return result;
}
}
exports.SchemaDefinition = SchemaDefinition;

2
dist/browser.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -253,8 +253,8 @@ class LocalApi extends acebase_core_1.Api {
}) {
return this.storage.importNode(path, read, options);
}
async setSchema(path, schema) {
return this.storage.setSchema(path, schema);
async setSchema(path, schema, warnOnly = false) {
return this.storage.setSchema(path, schema, warnOnly);
}
async getSchema(path) {
return this.storage.getSchema(path);

File diff suppressed because one or more lines are too long

View file

@ -1967,7 +1967,7 @@ class Storage extends acebase_core_1.SimpleEventEmitter {
* @param path target path to enforce the schema on, can include wildcards. Eg: 'users/*\/posts/*' or 'users/$uid/posts/$postid'
* @param schema schema type definitions. When null value is passed, a previously set schema is removed.
*/
setSchema(path, schema) {
setSchema(path, schema, warnOnly = false) {
if (typeof schema === 'undefined') {
throw new TypeError('schema argument must be given');
}
@ -1978,7 +1978,10 @@ class Storage extends acebase_core_1.SimpleEventEmitter {
return;
}
// Parse schema, add or update it
const definition = new acebase_core_1.SchemaDefinition(schema);
const definition = new acebase_core_1.SchemaDefinition(schema, {
warnOnly,
warnCallback: (message) => this.debug.warn(message),
});
const item = this._schemas.find(s => s.path === path);
if (item) {
item.schema = definition;

File diff suppressed because one or more lines are too long

View file

@ -166,6 +166,195 @@ describe('schema', () => {
result = await db.schema.check('static', { float: 897.452 }, false);
expect(result.ok).toBeFalse();
});
it('issues warnings only', async () => {
// Try using string type definitions
const clientSchema1 = {
name: 'string',
url: 'string',
email: 'string',
'contacts?': {
'*': {
type: 'string',
name: 'string',
email: 'string',
telephone: 'string',
},
},
'addresses?': {
'*': {
type: '"postal"|"visit"',
street: 'string',
nr: 'number',
city: 'string',
'state?': 'string',
country: '"nl"|"be"|"de"|"fr"',
},
},
};
expect(() => db.schema.set('clients/*', clientSchema1, true)).not.toThrow();
// Test if we can add client without contacts and addresses
let result = await db.schema.check('clients/client1', { name: 'Ewout', url: '', email: '' }, false);
expect(result).toEqual({ ok: true });
// Test without email
result = await db.schema.check('clients/client1', { name: 'Ewout', url: '' }, false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test with wrong email data type
result = await db.schema.check('clients/client1', { name: 'Ewout', url: '', email: 35 }, false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test with invalid property
result = await db.schema.check('clients/client1', { name: 'Ewout', url: '', email: '', wrong: 'not allowed' }, false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test with wrong contact
result = await db.schema.check('clients/client1', { name: 'Ewout', url: '', email: '', contacts: 'none' }, false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test with empty contacts
result = await db.schema.check('clients/client1', { name: 'Ewout', url: '', email: '', contacts: {} }, false);
expect(result).toEqual({ ok: true });
// Test with wrong contact item data type
result = await db.schema.check('clients/client1', { name: 'Ewout', url: '', email: '', contacts: { contact1: 'wrong contact' } }, false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test with ok contact item
result = await db.schema.check('clients/client1', { name: 'Ewout', url: '', email: '', contacts: { contact1: { type: 'sales', name: 'John', email: '', telephone: '' } } }, false);
expect(result).toEqual({ ok: true });
// Test wrong contact item on target path
result = await db.schema.check('clients/client1/contacts/contact1', 'wrong contact', false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test with ok contact item on target path
result = await db.schema.check('clients/client1/contacts/contact1', { type: 'sales', name: 'John', email: '', telephone: '' }, false);
expect(result).toEqual({ ok: true });
// Test updating a single property
result = await db.schema.check('clients/client1', { name: 'John' }, true);
expect(result).toEqual({ ok: true });
// Test removing a mandatory property
result = await db.schema.check('clients/client1', { name: null }, true);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test removing an optional property
result = await db.schema.check('clients/client1', { addresses: null }, true);
expect(result).toEqual({ ok: true });
// Test removing an unknown property
result = await db.schema.check('clients/client1', { unknown: null }, true);
expect(result).toEqual({ ok: true });
// Test updating a higher path that does not have a schema set (#217)
result = await db.schema.check('', { test: 'Test' }, true);
expect(result).toEqual({ ok: true });
// Try using classnames & regular expressions
const emailRegex = /[a-z.\-_]+@(?:[a-z\-_]+\.){1,}[a-z]{2,}$/i;
const clientSchema2 = {
name: String,
url: /^https:\/\//,
email: emailRegex,
'contacts?': {
'*': {
type: String,
name: String,
email: emailRegex,
telephone: /^\+[0-9\-]{10,}$/,
},
},
'addresses?': {
'*': {
type: '"postal"|"visit"',
street: String,
nr: Number,
city: String,
'state?': String,
country: /^[A-Z]{2}$/,
},
},
};
// Overwrite previous schema
expect(() => db.schema.set('clients/*', clientSchema2, true)).not.toThrow();
// Test valid input
result = await db.schema.check('clients/client1', { name: 'My client', url: 'https://client.com', email: 'info@client.com' }, false);
expect(result).toEqual({ ok: true });
// Test with empty email
result = await db.schema.check('clients/client1/email', '', false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test with invalid email
result = await db.schema.check('clients/client1/email', 'not valid @address.com', false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test with valid email
result = await db.schema.check('clients/client1/email', 'test@address.com', false);
expect(result).toEqual({ ok: true });
// Test valid address
result = await db.schema.check('clients/client1/addresses/address1', { type: 'visit', street: 'Main', nr: 253, city: 'Capital', country: 'NL' }, false);
expect(result).toEqual({ ok: true });
// Test invalid address type
result = await db.schema.check('clients/client1/addresses/address1', { type: 'invalid', street: 'Main', nr: 253, city: 'Capital', country: 'NL' }, false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test invalid country (lowercase)
result = await db.schema.check('clients/client1/addresses/address1', { type: 'postal', street: 'Main', nr: 253, city: 'Capital', country: 'nl' }, false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test updating property to valid value
result = await db.schema.check('clients/client1/addresses/address1', { country: 'NL' }, true);
expect(result).toEqual({ ok: true });
// Test updating property to invalid value
result = await db.schema.check('clients/client1/addresses/address1', { country: 'nl' }, true);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test updating target to valid value
result = await db.schema.check('clients/client1/addresses/address1/country', 'NL', true);
expect(result).toEqual({ ok: true });
// Test updating target to invalid value
result = await db.schema.check('clients/client1/addresses/address1/country', 'nl', true);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Create new schema to test static values
const staticValuesSchema = {
'bool?': true,
'int?': 35,
'float?': 101.101,
};
expect(() => db.schema.set('static', staticValuesSchema, true)).not.toThrow();
// Test valid boolean value:
result = await db.schema.check('static', { bool: true }, false);
expect(result).toEqual({ ok: true });
// Test invalid boolean value:
result = await db.schema.check('static', { bool: false }, false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test valid int value:
result = await db.schema.check('static', { int: 35 }, false);
expect(result).toEqual({ ok: true });
// Test invalid int value:
result = await db.schema.check('static', { int: 2323 }, false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test valid float value:
result = await db.schema.check('static', { float: 101.101 }, false);
expect(result).toEqual({ ok: true });
// Test invalid float value:
result = await db.schema.check('static', { float: 897.452 }, false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
});
it('type Object must allow any property', async () => {
const schema = 'Object';
expect(() => db.schema.set('generic-object', schema)).not.toThrow();

File diff suppressed because one or more lines are too long

View file

@ -256,8 +256,8 @@ export class LocalApi extends Api {
}) {
return this.storage.importNode(path, read, options);
}
async setSchema(path, schema) {
return this.storage.setSchema(path, schema);
async setSchema(path, schema, warnOnly = false) {
return this.storage.setSchema(path, schema, warnOnly);
}
async getSchema(path) {
return this.storage.getSchema(path);

File diff suppressed because one or more lines are too long

View file

@ -1964,7 +1964,7 @@ export class Storage extends SimpleEventEmitter {
* @param path target path to enforce the schema on, can include wildcards. Eg: 'users/*\/posts/*' or 'users/$uid/posts/$postid'
* @param schema schema type definitions. When null value is passed, a previously set schema is removed.
*/
setSchema(path, schema) {
setSchema(path, schema, warnOnly = false) {
if (typeof schema === 'undefined') {
throw new TypeError('schema argument must be given');
}
@ -1975,7 +1975,10 @@ export class Storage extends SimpleEventEmitter {
return;
}
// Parse schema, add or update it
const definition = new SchemaDefinition(schema);
const definition = new SchemaDefinition(schema, {
warnOnly,
warnCallback: (message) => this.debug.warn(message),
});
const item = this._schemas.find(s => s.path === path);
if (item) {
item.schema = definition;

File diff suppressed because one or more lines are too long

View file

@ -164,6 +164,195 @@ describe('schema', () => {
result = await db.schema.check('static', { float: 897.452 }, false);
expect(result.ok).toBeFalse();
});
it('issues warnings only', async () => {
// Try using string type definitions
const clientSchema1 = {
name: 'string',
url: 'string',
email: 'string',
'contacts?': {
'*': {
type: 'string',
name: 'string',
email: 'string',
telephone: 'string',
},
},
'addresses?': {
'*': {
type: '"postal"|"visit"',
street: 'string',
nr: 'number',
city: 'string',
'state?': 'string',
country: '"nl"|"be"|"de"|"fr"',
},
},
};
expect(() => db.schema.set('clients/*', clientSchema1, true)).not.toThrow();
// Test if we can add client without contacts and addresses
let result = await db.schema.check('clients/client1', { name: 'Ewout', url: '', email: '' }, false);
expect(result).toEqual({ ok: true });
// Test without email
result = await db.schema.check('clients/client1', { name: 'Ewout', url: '' }, false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test with wrong email data type
result = await db.schema.check('clients/client1', { name: 'Ewout', url: '', email: 35 }, false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test with invalid property
result = await db.schema.check('clients/client1', { name: 'Ewout', url: '', email: '', wrong: 'not allowed' }, false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test with wrong contact
result = await db.schema.check('clients/client1', { name: 'Ewout', url: '', email: '', contacts: 'none' }, false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test with empty contacts
result = await db.schema.check('clients/client1', { name: 'Ewout', url: '', email: '', contacts: {} }, false);
expect(result).toEqual({ ok: true });
// Test with wrong contact item data type
result = await db.schema.check('clients/client1', { name: 'Ewout', url: '', email: '', contacts: { contact1: 'wrong contact' } }, false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test with ok contact item
result = await db.schema.check('clients/client1', { name: 'Ewout', url: '', email: '', contacts: { contact1: { type: 'sales', name: 'John', email: '', telephone: '' } } }, false);
expect(result).toEqual({ ok: true });
// Test wrong contact item on target path
result = await db.schema.check('clients/client1/contacts/contact1', 'wrong contact', false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test with ok contact item on target path
result = await db.schema.check('clients/client1/contacts/contact1', { type: 'sales', name: 'John', email: '', telephone: '' }, false);
expect(result).toEqual({ ok: true });
// Test updating a single property
result = await db.schema.check('clients/client1', { name: 'John' }, true);
expect(result).toEqual({ ok: true });
// Test removing a mandatory property
result = await db.schema.check('clients/client1', { name: null }, true);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test removing an optional property
result = await db.schema.check('clients/client1', { addresses: null }, true);
expect(result).toEqual({ ok: true });
// Test removing an unknown property
result = await db.schema.check('clients/client1', { unknown: null }, true);
expect(result).toEqual({ ok: true });
// Test updating a higher path that does not have a schema set (#217)
result = await db.schema.check('', { test: 'Test' }, true);
expect(result).toEqual({ ok: true });
// Try using classnames & regular expressions
const emailRegex = /[a-z.\-_]+@(?:[a-z\-_]+\.){1,}[a-z]{2,}$/i;
const clientSchema2 = {
name: String,
url: /^https:\/\//,
email: emailRegex,
'contacts?': {
'*': {
type: String,
name: String,
email: emailRegex,
telephone: /^\+[0-9\-]{10,}$/,
},
},
'addresses?': {
'*': {
type: '"postal"|"visit"',
street: String,
nr: Number,
city: String,
'state?': String,
country: /^[A-Z]{2}$/,
},
},
};
// Overwrite previous schema
expect(() => db.schema.set('clients/*', clientSchema2, true)).not.toThrow();
// Test valid input
result = await db.schema.check('clients/client1', { name: 'My client', url: 'https://client.com', email: 'info@client.com' }, false);
expect(result).toEqual({ ok: true });
// Test with empty email
result = await db.schema.check('clients/client1/email', '', false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test with invalid email
result = await db.schema.check('clients/client1/email', 'not valid @address.com', false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test with valid email
result = await db.schema.check('clients/client1/email', 'test@address.com', false);
expect(result).toEqual({ ok: true });
// Test valid address
result = await db.schema.check('clients/client1/addresses/address1', { type: 'visit', street: 'Main', nr: 253, city: 'Capital', country: 'NL' }, false);
expect(result).toEqual({ ok: true });
// Test invalid address type
result = await db.schema.check('clients/client1/addresses/address1', { type: 'invalid', street: 'Main', nr: 253, city: 'Capital', country: 'NL' }, false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test invalid country (lowercase)
result = await db.schema.check('clients/client1/addresses/address1', { type: 'postal', street: 'Main', nr: 253, city: 'Capital', country: 'nl' }, false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test updating property to valid value
result = await db.schema.check('clients/client1/addresses/address1', { country: 'NL' }, true);
expect(result).toEqual({ ok: true });
// Test updating property to invalid value
result = await db.schema.check('clients/client1/addresses/address1', { country: 'nl' }, true);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test updating target to valid value
result = await db.schema.check('clients/client1/addresses/address1/country', 'NL', true);
expect(result).toEqual({ ok: true });
// Test updating target to invalid value
result = await db.schema.check('clients/client1/addresses/address1/country', 'nl', true);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Create new schema to test static values
const staticValuesSchema = {
'bool?': true,
'int?': 35,
'float?': 101.101,
};
expect(() => db.schema.set('static', staticValuesSchema, true)).not.toThrow();
// Test valid boolean value:
result = await db.schema.check('static', { bool: true }, false);
expect(result).toEqual({ ok: true });
// Test invalid boolean value:
result = await db.schema.check('static', { bool: false }, false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test valid int value:
result = await db.schema.check('static', { int: 35 }, false);
expect(result).toEqual({ ok: true });
// Test invalid int value:
result = await db.schema.check('static', { int: 2323 }, false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
// Test valid float value:
result = await db.schema.check('static', { float: 101.101 }, false);
expect(result).toEqual({ ok: true });
// Test invalid float value:
result = await db.schema.check('static', { float: 897.452 }, false);
expect(result.ok).toBeTrue();
expect(result.reason).not.toBeUndefined();
expect(result.warning).not.toBeUndefined();
});
it('type Object must allow any property', async () => {
const schema = 'Object';
expect(() => db.schema.set('generic-object', schema)).not.toThrow();

File diff suppressed because one or more lines are too long

View file

@ -125,7 +125,7 @@ export declare class LocalApi extends Api {
suppress_events: boolean;
method: 'set' | 'update' | 'merge';
}): Promise<void>;
setSchema(path: string, schema: Record<string, any> | string): Promise<void>;
setSchema(path: string, schema: Record<string, any> | string, warnOnly?: boolean): Promise<void>;
getSchema(path: string): Promise<{
path: string;
schema: string | object;

View file

@ -1 +1 @@
{"version":3,"file":"api-local.d.ts","sourceRoot":"","sources":["../../src/api-local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,EAAE,yBAAyB,EAC7C,mBAAmB,EAAE,uBAAuB,EAC5D,kBAAkB,EAAE,mBAAmB,EAAE,oBAAoB,EAC7D,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAO5D,OAAO,EAAE,OAAO,EAAc,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,GAAG,CAAC;AAGzC,qBAAa,QAAS,SAAQ,GAAG;IAEtB,EAAE,EAAE,WAAW,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,YAAY,CAAC;gBAElB,MAAM,QAAY,EAAE,IAAI,EAAE;QAAE,EAAE,EAAE,WAAW,CAAC;QAAC,QAAQ,EAAE,oBAAoB,CAAA;KAAE,EAAE,a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I,EAAE,GAAG,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAyF5E,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,GAAG,WAAW,EAAE,OAAO,GAAE;QACrE,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,OAAO,CAAC;KAItB;IAID,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,GAAE;QACpD,MAAM,EAAE,MAAM,CAAC;QACf,eAAe,EAAE,OAAO,CAAC;QACzB,MAAM,EAAE,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;KAKtC;IAIK,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,EAAE,QAAQ,UAAQ;IAI9E,SAAS,CAAC,IAAI,EAAE,MAAM;;;;;IAItB,UAAU;;;;;IAIV,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO;IAIhE;;OAEG;IACG,YAAY,CAAC,MAAM,EAAE,oBAAoB;;;;;;;;;;;;;IAO/C;;OAEG;IACG,UAAU,CAAC,MAAM,EAAE,oBAAoB;;;;;;;;;;;CAMhD"}

View file

@ -457,7 +457,7 @@ export declare class Storage extends SimpleEventEmitter {
* @param path target path to enforce the schema on, can include wildcards. Eg: 'users/*\/posts/*' or 'users/$uid/posts/$postid'
* @param schema schema type definitions. When null value is passed, a previously set schema is removed.
*/
setSchema(path: string, schema: string | object): void;
setSchema(path: string, schema: string | object, warnOnly?: boolean): void;
/**
* Gets currently active schema definition for the specified path
*/

File diff suppressed because one or more lines are too long