diff --git a/.gitignore b/.gitignore index f888bf3..d4c3d81 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .clasp.json .vs +.idea gapps.config.json node_modules \ No newline at end of file diff --git a/Firestore.ts b/Firestore.ts index 7fcae10..10f4c47 100644 --- a/Firestore.ts +++ b/Firestore.ts @@ -131,6 +131,23 @@ class Firestore implements FirestoreRead, FirestoreWrite, FirestoreDelete { return this.query_(path, request); } query_ = FirestoreRead.prototype.query_; + + /** + * Create a batch update + */ + batch(): WriteBatch { + return new WriteBatch(this); + } + + /** + * Generates a new unique id + * Useful for WriteBatch create document + * + * @return {string} unique doc id + */ + newId(): string { + return Util_.newId(); + } } type Version = 'v1' | 'v1beta1' | 'v1beta2'; diff --git a/Util.ts b/Util.ts index 0db3d58..5fb75a1 100644 --- a/Util.ts +++ b/Util.ts @@ -148,4 +148,36 @@ class Util_ { .map(([k, v]) => `${process(k)}=${process(v)}`) .join('&'); } + + /** + * Create a new unique document id + * + * @return {string} a new unique document id + * @link https://github.com/firebase/firebase-js-sdk/blob/34ad43cc2a9863f7ac326c314d9539fcbc1f0913/packages/firestore/src/util/misc.ts#L28 + */ + static newId(): string { + // Alphanumeric characters + const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + // The largest byte value that is a multiple of `char.length`. + const maxMultiple = Math.floor(256 / chars.length) * chars.length; + + let autoId = ''; + const targetLength = 20; + while (autoId.length < targetLength) { + const nBytes = 40; + const bytes = new Uint8Array(nBytes); + for (let i = 0; i < nBytes; i++) { + bytes[i] = Math.floor(Math.random() * 256); + } + for (let i = 0; i < bytes.length; ++i) { + // Only accept values that are [0, maxMultiple), this ensures they can + // be evenly mapped to indices of `chars` via a modulo operation. + if (autoId.length < targetLength && bytes[i] < maxMultiple) { + autoId += chars.charAt(bytes[i] % chars.length); + } + } + } + + return autoId; + } } diff --git a/WriteBatch.ts b/WriteBatch.ts new file mode 100644 index 0000000..cb4f730 --- /dev/null +++ b/WriteBatch.ts @@ -0,0 +1,162 @@ +/** + * Write multiple documents in one request. + * Can be atomic or not. + */ +class WriteBatch { + private mutations_: FirestoreAPI.Write[] = []; + private committed_ = false; + + /** + * A container for multiple writes + * @param {Firestore} _firestore the parent instance + * @param {Boolean} _atomic the REST api supports batch writes in a non-atomic way + */ + constructor(private readonly _firestore: Firestore) {} + + /** + * Writes to the document referred to by the provided path. + * If the document does not exist yet, it will be created. + * + * @param {string} path - A path to the document to be set. + * @param data - An object of the fields and values for the document. + * @returns This `WriteBatch` instance. Used for chaining method calls. + */ + set(path: string, fields: Record): WriteBatch; + /** + * Writes to the document referred to by the provided path. + * If the document does not exist yet, it will be created. + * If you provide `merge` or `mergeFields`, the provided data can be merged + * into an existing document. + * + * @param {string} path - A path to the document to be set. + * @param data - An object of the fields and values for the document. + * @param options - An object to configure the set behavior. + * @throws Error - If the provided input is not a valid Firestore document. + * @returns This `WriteBatch` instance. Used for chaining method calls. + */ + set(path: string, fields: Record, options: Record): WriteBatch; + set( + path: string, + fields: Record, + options?: Record // FirestoreAPI.SetOptions + ): WriteBatch { + this.verifyNotCommitted_(); + + const isMerge = options && (options.merge || options.mergeFields); + const updateMask: FirestoreAPI.DocumentMask | undefined = isMerge + ? { fieldPaths: options.merge ? Object.keys(fields) : options.mergeFields } + : undefined; + const update: FirestoreAPI.Document = new Document(fields, `${this._firestore.basePath}${path}`); + + const mutation: FirestoreAPI.Write = { + updateMask: updateMask, + update: update, + }; + this.mutations_.push(mutation); + return this; + } + + /** + * Updates fields in the document referred to by the provided {@link + * DocumentReference}. The update will fail if applied to a document that does + * not exist. + * + * @param {string} path - A path to the document to be updated. + * @param data - An object containing the fields and values with which to + * update the document. Fields can contain dots to reference nested fields + * within the document. + * @throws Error - If the provided input is not valid Firestore data. + * @returns This `WriteBatch` instance. Used for chaining method calls. + */ + update(path: string, data: Record): WriteBatch; + /** + * Updates fields in the document referred to by the provided path. + * The update will fail if applied to a document that does + * not exist. + * + * Nested fields can be update by providing dot-separated field path strings. + * + * @param {string} path - A path to the document to be updated. + * @param field - The first field to update. + * @param value - The first value. + * @param moreFieldsAndValues - Additional key value pairs. + * @throws Error - If the provided input is not valid Firestore data. + * @returns This `WriteBatch` instance. Used for chaining method calls. + */ + update(path: string, field: string, value: unknown, ...moreFieldsAndValues: unknown[]): WriteBatch; + update( + path: string, + fieldOrUpdateData: string | Record, + value?: unknown, + ...moreFieldsAndValues: unknown[] + ): WriteBatch { + this.verifyNotCommitted_(); + + let fields; + if (typeof fieldOrUpdateData === 'string') { + fields = { + [fieldOrUpdateData]: value, + }; + for (let i = 0; i < moreFieldsAndValues.length; i += 2) { + fields[moreFieldsAndValues[i] as string] = moreFieldsAndValues[i + 1]; + } + } else fields = fieldOrUpdateData; + const updateMask: FirestoreAPI.DocumentMask = { fieldPaths: Object.keys(fields) }; + const update: FirestoreAPI.Document = new Document(fields, `${this._firestore.basePath}${path}`); + + const mutation: FirestoreAPI.Write = { + updateMask: updateMask, + update: update, + currentDocument: { + exists: true, + }, + }; + this.mutations_.push(mutation); + return this; + } + + /** + * Deletes the document referred to by the provided path. + * + * @param {string} path - A path to the document to be deleted. + * @returns This `WriteBatch` instance. Used for chaining method calls. + */ + delete(path: string): WriteBatch { + this.verifyNotCommitted_(); + // const ref = validateReference(documentRef, this._firestore); + // new DeleteMutation(ref._key, Precondition.none()) + const mutation: FirestoreAPI.Write = { + delete: `${this._firestore.basePath}${path}`, + }; + this.mutations_.push(mutation); + return this; + } + + /** + * Issue the write request. + * If atomic, a true value is returned on success or throws an error on failure. + * If not atomic, an array of either true or error message is returned. + */ + commit(atomic = false): boolean | Array { + this.verifyNotCommitted_(); + this.committed_ = true; + if (!this.mutations_.length) { + throw new Error('A write batch cannot commit with no changes requested.'); + } + + const request = new Request(this._firestore.baseUrl, this._firestore.authToken); + request.route(atomic ? 'commit' : 'batchWrite'); + + const payload: FirestoreAPI.CommitRequest | FirestoreAPI.BatchWriteRequest = { writes: this.mutations_ }; + const responseObj = request.post(undefined, payload); + + if (atomic) return true; + else return ((responseObj as FirestoreAPI.BatchWriteResponse).status || []).map((s) => !s.code || s.message); + } + + private verifyNotCommitted_(): void { + if (this.committed_) { + throw new Error('A write batch can no longer be used after commit() ' + 'has been called.'); + } + } +} diff --git a/package-lock.json b/package-lock.json index 5e3042c..2d07dc6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,8 +1,1583 @@ { "name": "firestore_google-apps-script", "version": "1.0.34", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "firestore_google-apps-script", + "version": "1.0.34", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@types/gapi.client.firestore-v1": "^0.0.0", + "@types/google-apps-script": "^1.0.14", + "@types/jsonwebtoken": "^8.5.0", + "@typescript-eslint/eslint-plugin": "^3.6.0", + "@typescript-eslint/parser": "^3.6.0", + "eslint": "^7.4.0", + "eslint-config-prettier": "^6.11.0", + "eslint-plugin-prettier": "^3.1.4", + "prettier": "^2.0.5", + "replace-in-file": "^6.1.0", + "typescript": "^3.9.6" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dependencies": { + "@babel/highlight": "^7.10.4" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==" + }, + "node_modules/@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@maxim_mazurok/gapi.client.discovery-v1": { + "version": "0.0.20200806", + "resolved": "https://registry.npmjs.org/@maxim_mazurok/gapi.client.discovery-v1/-/gapi.client.discovery-v1-0.0.20200806.tgz", + "integrity": "sha512-0pZtrElj8bc0YROIo7nH8VVvks/iww/L68l7r74oC9+ksSVO3Lum1zUR8dXTvJ7TqLGaNYiiNaUZianK6doh/w==", + "dependencies": { + "@types/gapi.client": "*", + "@types/gapi.client.discovery": "*" + } + }, + "node_modules/@maxim_mazurok/gapi.client.firestore-v1": { + "version": "0.0.20220915", + "resolved": "https://registry.npmjs.org/@maxim_mazurok/gapi.client.firestore-v1/-/gapi.client.firestore-v1-0.0.20220915.tgz", + "integrity": "sha512-NEkqDI3lWUPoILFjLy8zEs4CFmI71LBA+Ji5fwYpLzAK7vTfqGMti0OLDlcoxLy+MEibfs1ZPnJg8JNG6Fp/rQ==", + "dependencies": { + "@types/gapi.client": "*", + "@types/gapi.client.discovery": "*" + } + }, + "node_modules/@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==" + }, + "node_modules/@types/eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==" + }, + "node_modules/@types/gapi.client": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/gapi.client/-/gapi.client-1.0.3.tgz", + "integrity": "sha512-XhJ45zhedkqXln75Y0XZAFmHFHNu6zCGe9EyPiu5a20Q7XnsEENR3dnUqbYvp7w9e6vjXW+uKGqb3z/ezZijDg==" + }, + "node_modules/@types/gapi.client.discovery": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/gapi.client.discovery/-/gapi.client.discovery-1.0.8.tgz", + "integrity": "sha512-cYVp7ISY2oqH/cHIfLVjppJo7xmMiY/RhMVN0O/6Z+X3grwojmuDIHcUw/C1F31/zFpFWDSjaPkwNP0aKIbbcw==", + "dependencies": { + "@maxim_mazurok/gapi.client.discovery-v1": "latest" + } + }, + "node_modules/@types/gapi.client.firestore-v1": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/@types/gapi.client.firestore-v1/-/gapi.client.firestore-v1-0.0.0.tgz", + "integrity": "sha512-6iMYLh6KOjm3Kz0t28CZdOqdwIk6U+lRypz8AAXw0C0NnPrE6ATRJn2MBYsQvFOYlDwKjdz16HH//iiGZyJF/g==", + "dependencies": { + "@maxim_mazurok/gapi.client.firestore-v1": "latest" + } + }, + "node_modules/@types/google-apps-script": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/@types/google-apps-script/-/google-apps-script-1.0.14.tgz", + "integrity": "sha512-dxYrClArM39GGlANFbCJiBg+wBmmK5VuBW2/JBaqg6Bo/OpAcXJoQ69zml6HmuHoKJDw1WR+BRxeJ/U9L9dk8A==" + }, + "node_modules/@types/json-schema": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.5.tgz", + "integrity": "sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ==" + }, + "node_modules/@types/jsonwebtoken": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.0.tgz", + "integrity": "sha512-9bVao7LvyorRGZCw0VmH/dr7Og+NdjYSsKAxB43OQoComFbBgsEpoR9JW6+qSq/ogwVBg8GI2MfAlk4SYI4OLg==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/node": { + "version": "14.0.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.9.tgz", + "integrity": "sha512-0sCTiXKXELOBxvZLN4krQ0FPOAA7ij+6WwvD0k/PHd9/KAkr4dXel5J9fh6F4x1FwAQILqAWkmpeuS6mjf1iKA==" + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.6.0.tgz", + "integrity": "sha512-ubHlHVt1lsPQB/CZdEov9XuOFhNG9YRC//kuiS1cMQI6Bs1SsqKrEmZnpgRwthGR09/kEDtr9MywlqXyyYd8GA==", + "dependencies": { + "@typescript-eslint/experimental-utils": "3.6.0", + "debug": "^4.1.1", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^3.0.0", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^3.0.0", + "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/experimental-utils": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.6.0.tgz", + "integrity": "sha512-4Vdf2hvYMUnTdkCNZu+yYlFtL2v+N2R7JOynIOkFbPjf9o9wQvRwRkzUdWlFd2YiiUwJLbuuLnl5civNg5ykOQ==", + "dependencies": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/types": "3.6.0", + "@typescript-eslint/typescript-estree": "3.6.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.6.0.tgz", + "integrity": "sha512-taghDxuLhbDAD1U5Fk8vF+MnR0yiFE9Z3v2/bYScFb0N1I9SK8eKHkdJl1DAD48OGFDMFTeOTX0z7g0W6SYUXw==", + "dependencies": { + "@types/eslint-visitor-keys": "^1.0.0", + "@typescript-eslint/experimental-utils": "3.6.0", + "@typescript-eslint/types": "3.6.0", + "@typescript-eslint/typescript-estree": "3.6.0", + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.6.0.tgz", + "integrity": "sha512-JwVj74ohUSt0ZPG+LZ7hb95fW8DFOqBuR6gE7qzq55KDI3BepqsCtHfBIoa0+Xi1AI7fq5nCu2VQL8z4eYftqg==", + "engines": { + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.6.0.tgz", + "integrity": "sha512-G57NDSABHjvob7zVV09ehWyD1K6/YUKjz5+AufObFyjNO4DVmKejj47MHjVHHlZZKgmpJD2yyH9lfCXHrPITFg==", + "dependencies": { + "@typescript-eslint/types": "3.6.0", + "@typescript-eslint/visitor-keys": "3.6.0", + "debug": "^4.1.1", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.6.0.tgz", + "integrity": "sha512-p1izllL2Ubwunite0ITjubuMQRBGgjdVYwyG7lXPX8GbrA6qF0uwSRz9MnXZaHMxID4948gX0Ez8v9tUDi/KfQ==", + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/acorn": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.3.1.tgz", + "integrity": "sha512-tLc0wSnatxAQHVHUapaHdz72pi9KUyHjq5KyHjGg9Y8Ifdc79pTh2XvI6I1/chZbnM7QtNKzh66ooDogPZSleA==", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz", + "integrity": "sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "engines": { + "node": ">=4" + } + }, + "node_modules/balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dependencies": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/chalk/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/chalk/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/chalk/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dependencies": { + "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eslint": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.4.0.tgz", + "integrity": "sha512-gU+lxhlPHu45H3JkEGgYhWhkR9wLHHEXC9FbWFnTlEkbKyZKWgWRLgf61E8zWmBuI6g5xKBph9ltg3NtZMVF8g==", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.0", + "eslint-utils": "^2.0.0", + "eslint-visitor-keys": "^1.2.0", + "espree": "^7.1.0", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-prettier": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz", + "integrity": "sha512-oB8cpLWSAjOVFEJhhyMZh6NOEOtBVziaqdDQ86+qhDHFbZXoRTM7pNSvFRfW/W/L/LrQ38C99J5CGuRBBzBsdA==", + "dependencies": { + "get-stdin": "^6.0.0" + }, + "bin": { + "eslint-config-prettier-check": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=3.14.1" + } + }, + "node_modules/eslint-plugin-prettier": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.4.tgz", + "integrity": "sha512-jZDa8z76klRqo+TdGDTFJSavwbnWK2ZpqGKNZ+VvweMW516pDUMmQ2koXvxEE4JhzNvTv+radye/bWGBmA6jmg==", + "dependencies": { + "prettier-linter-helpers": "^1.0.0" + }, + "engines": { + "node": ">=6.0.0" + }, + "peerDependencies": { + "eslint": ">=5.0.0", + "prettier": ">=1.13.0" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz", + "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==", + "dependencies": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "engines": { + "node": ">=4" + } + }, + "node_modules/espree": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.1.0.tgz", + "integrity": "sha512-dcorZSyfmm4WTuTnE5Y7MEN1DyoPYy1ZR783QW1FJoenn7RailyWFsq/UL6ZAAA7uXurN9FIpYyUs3OfiIW+Qw==", + "dependencies": { + "acorn": "^7.2.0", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.2.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esquery/node_modules/estraverse": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", + "integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dependencies": { + "estraverse": "^4.1.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" + }, + "node_modules/file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dependencies": { + "flat-cache": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dependencies": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==" + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "engines": { + "node": ">=4" + } + }, + "node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dependencies": { + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "engines": { + "node": ">=4" + } + }, + "node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/js-yaml": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + }, + "node_modules/mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "engines": { + "node": ">=8" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz", + "integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==", + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "engines": { + "node": ">=6" + } + }, + "node_modules/regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/replace-in-file": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/replace-in-file/-/replace-in-file-6.1.0.tgz", + "integrity": "sha512-URzjyF3nucvejuY13HFd7O+Q6tFJRLKGHLYVvSh+LiZj3gFXzSYGnIkQflnJJulCAI2/RTZaZkpOtdVdW0EhQA==", + "dependencies": { + "chalk": "^4.0.0", + "glob": "^7.1.6", + "yargs": "^15.3.1" + }, + "bin": { + "replace-in-file": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "engines": { + "node": ">=4" + } + }, + "node_modules/rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dependencies": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "engines": { + "node": ">=4" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, + "node_modules/string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dependencies": { + "ansi-regex": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", + "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dependencies": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/table/node_modules/ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "engines": { + "node": ">=6" + } + }, + "node_modules/table/node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" + }, + "node_modules/table/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "engines": { + "node": ">=4" + } + }, + "node_modules/table/node_modules/string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/table/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" + }, + "node_modules/tslib": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", + "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==" + }, + "node_modules/tsutils": { + "version": "3.17.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz", + "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==", + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "engines": { + "node": ">=8" + } + }, + "node_modules/typescript": { + "version": "3.9.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.6.tgz", + "integrity": "sha512-Pspx3oKAPJtjNwE92YS05HQoY7z2SFyOpHo9MqJor3BXAGNaPUs83CuVp9VISFkSjyRfiTpmKuAYGJB7S7hOxw==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/v8-compile-cache": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", + "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==" + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + }, + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dependencies": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "node_modules/write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dependencies": { + "mkdirp": "^0.5.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + }, + "node_modules/yargs": { + "version": "15.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz", + "integrity": "sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + } + }, "dependencies": { "@babel/code-frame": { "version": "7.10.4", @@ -39,6 +1614,24 @@ } } }, + "@maxim_mazurok/gapi.client.discovery-v1": { + "version": "0.0.20200806", + "resolved": "https://registry.npmjs.org/@maxim_mazurok/gapi.client.discovery-v1/-/gapi.client.discovery-v1-0.0.20200806.tgz", + "integrity": "sha512-0pZtrElj8bc0YROIo7nH8VVvks/iww/L68l7r74oC9+ksSVO3Lum1zUR8dXTvJ7TqLGaNYiiNaUZianK6doh/w==", + "requires": { + "@types/gapi.client": "*", + "@types/gapi.client.discovery": "*" + } + }, + "@maxim_mazurok/gapi.client.firestore-v1": { + "version": "0.0.20220915", + "resolved": "https://registry.npmjs.org/@maxim_mazurok/gapi.client.firestore-v1/-/gapi.client.firestore-v1-0.0.20220915.tgz", + "integrity": "sha512-NEkqDI3lWUPoILFjLy8zEs4CFmI71LBA+Ji5fwYpLzAK7vTfqGMti0OLDlcoxLy+MEibfs1ZPnJg8JNG6Fp/rQ==", + "requires": { + "@types/gapi.client": "*", + "@types/gapi.client.discovery": "*" + } + }, "@types/color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", @@ -54,6 +1647,22 @@ "resolved": "https://registry.npmjs.org/@types/gapi.client/-/gapi.client-1.0.3.tgz", "integrity": "sha512-XhJ45zhedkqXln75Y0XZAFmHFHNu6zCGe9EyPiu5a20Q7XnsEENR3dnUqbYvp7w9e6vjXW+uKGqb3z/ezZijDg==" }, + "@types/gapi.client.discovery": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/gapi.client.discovery/-/gapi.client.discovery-1.0.8.tgz", + "integrity": "sha512-cYVp7ISY2oqH/cHIfLVjppJo7xmMiY/RhMVN0O/6Z+X3grwojmuDIHcUw/C1F31/zFpFWDSjaPkwNP0aKIbbcw==", + "requires": { + "@maxim_mazurok/gapi.client.discovery-v1": "latest" + } + }, + "@types/gapi.client.firestore-v1": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/@types/gapi.client.firestore-v1/-/gapi.client.firestore-v1-0.0.0.tgz", + "integrity": "sha512-6iMYLh6KOjm3Kz0t28CZdOqdwIk6U+lRypz8AAXw0C0NnPrE6ATRJn2MBYsQvFOYlDwKjdz16HH//iiGZyJF/g==", + "requires": { + "@maxim_mazurok/gapi.client.firestore-v1": "latest" + } + }, "@types/google-apps-script": { "version": "1.0.14", "resolved": "https://registry.npmjs.org/@types/google-apps-script/-/google-apps-script-1.0.14.tgz", @@ -150,7 +1759,8 @@ "acorn-jsx": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", - "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==" + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", + "requires": {} }, "ajv": { "version": "6.12.3", @@ -169,9 +1779,9 @@ "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==" }, "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "ansi-styles": { "version": "3.2.1", @@ -692,9 +2302,9 @@ } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" }, "mkdirp": { "version": "0.5.5", @@ -933,9 +2543,9 @@ }, "dependencies": { "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==" }, "emoji-regex": { "version": "7.0.3", @@ -1082,9 +2692,9 @@ } }, "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" }, "yargs": { "version": "15.3.1", diff --git a/package.json b/package.json index 54bcce2..be1f8bd 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "impliedStrict": true, "project": [ "./tsconfig.json", - "./typings/gapi.client.firestore/tsconfig.json" + "./typings/gapi.client.firestore-v1/tsconfig.json" ], "tsconfigRootDir": "./" }, @@ -53,7 +53,7 @@ "overrides": [ { "files": [ - "typings/gapi.client.firestore/index.d.ts" + "typings/gapi.client.firestore-v1/index.d.ts" ], "rules": { "@typescript-eslint/ban-types": "off" @@ -72,9 +72,9 @@ "fix": "eslint --color --fix --ext .ts . && tsc || true", "postinstall": "replace-in-file \"declare var console\" \"//declare var console\" node_modules/@types/google-apps-script/google-apps-script.base.d.ts" }, - "repository": "github:grahamearley/FirestoreGoogleAppsScript", + "repository": "github:abkarino/FirestoreGoogleAppsScript", "dependencies": { - "@types/gapi.client": "^1.0.3", + "@types/gapi.client.firestore-v1": "^0.0.0", "@types/google-apps-script": "^1.0.14", "@types/jsonwebtoken": "^8.5.0", "@typescript-eslint/eslint-plugin": "^3.6.0", diff --git a/typings/gapi.client.firestore/index.d.ts b/typings/gapi.client.firestore-v1/index.d.ts similarity index 52% rename from typings/gapi.client.firestore/index.d.ts rename to typings/gapi.client.firestore-v1/index.d.ts index a03dd04..13b041b 100644 --- a/typings/gapi.client.firestore/index.d.ts +++ b/typings/gapi.client.firestore-v1/index.d.ts @@ -1,52 +1,61 @@ -// Type definitions for non-npm package Cloud Firestore API v1 1.0 +/* Type definitions for non-npm package Cloud Firestore API v1 0.0 */ // Project: https://cloud.google.com/firestore // Definitions by: Maxim Mazurok +// Nick Amoscato +// Declan Vong // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 // IMPORTANT // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually. // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator -// Generated from: https://firestore.googleapis.com/\$discovery/rest?version=v1 -// Revision: 20200405 +// Generated from: https://firestore.googleapis.com/$discovery/rest?version=v1 +// Revision: 20220915 + /// declare namespace gapi.client { /** Load Cloud Firestore API v1 */ - function load(name: 'firestore', version: 'v1'): PromiseLike; + function load(urlOrObject: 'https://firestore.googleapis.com/$discovery/rest?version=v1'): Promise; + /** @deprecated Please load APIs with discovery documents. */ + function load(name: 'firestore', version: 'v1'): Promise; + /** @deprecated Please load APIs with discovery documents. */ function load(name: 'firestore', version: 'v1', callback: () => any): void; - export namespace firestore { + namespace firestore { + interface Aggregation { + /** + * Optional. Optional name of the field to store the result of the aggregation into. If not provided, Firestore will pick a default name following the format `field_`. For example: ``` + * AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2), COUNT_UP_TO(3) AS count_up_to_3, COUNT_UP_TO(4) OVER ( ... ); ``` becomes: ``` AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2) AS field_1, COUNT_UP_TO(3) AS count_up_to_3, COUNT_UP_TO(4) AS field_2 OVER ( ... ); ``` Requires: * Must be unique across all aggregation aliases. * Conform to + * document field name limitations. + */ + alias?: string; + /** Count aggregator. */ + count?: Count; + } + interface AggregationResult { + /** + * The result of the aggregation functions, ex: `COUNT(*) AS total_docs`. The key is the alias assigned to the aggregation function on input and the size of this map equals the number + * of aggregation functions in the query. + */ + aggregateFields?: { [P in string]: Value }; + } interface ArrayValue { /** Values in the array. */ values?: Value[]; } interface BatchGetDocumentsRequest { /** - * The names of the documents to retrieve. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * The request will fail if any of the document is not a child resource of the - * given `database`. Duplicate names will be elided. + * The names of the documents to retrieve. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. The request will fail if any of the document is not + * a child resource of the given `database`. Duplicate names will be elided. */ documents?: string[]; - /** - * The fields to return. If not set, returns all fields. - * - * If a document has a field that is not present in this mask, that field will - * not be returned in the response. - */ + /** The fields to return. If not set, returns all fields. If a document has a field that is not present in this mask, that field will not be returned in the response. */ mask?: DocumentMask; - /** - * Starts a new transaction and reads the documents. - * Defaults to a read-only transaction. - * The new transaction ID will be returned as the first response in the - * stream. - */ + /** Starts a new transaction and reads the documents. Defaults to a read-only transaction. The new transaction ID will be returned as the first response in the stream. */ newTransaction?: TransactionOptions; - /** - * Reads documents as they were at the given time. - * This may not be older than 270 seconds. - */ + /** Reads documents as they were at the given time. This may not be older than 270 seconds. */ readTime?: string; /** Reads documents in a transaction. */ transaction?: string; @@ -54,30 +63,33 @@ declare namespace gapi.client { interface BatchGetDocumentsResponse { /** A document that was requested. */ found?: Document; - /** - * A document name that was requested but does not exist. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - */ + /** A document name that was requested but does not exist. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. */ missing?: string; /** - * The time at which the document was read. - * This may be monotically increasing, in this case the previous documents in - * the result stream are guaranteed not to have changed between their - * read_time and this one. + * The time at which the document was read. This may be monotically increasing, in this case the previous documents in the result stream are guaranteed not to have changed between + * their read_time and this one. */ readTime?: string; - /** - * The transaction that was started as part of this request. - * Will only be set in the first response, and only if - * BatchGetDocumentsRequest.new_transaction was set in the request. - */ + /** The transaction that was started as part of this request. Will only be set in the first response, and only if BatchGetDocumentsRequest.new_transaction was set in the request. */ transaction?: string; } - interface BeginTransactionRequest { + interface BatchWriteRequest { + /** Labels associated with this batch write. */ + labels?: { [P in string]: string }; /** - * The options for the transaction. - * Defaults to a read-write transaction. + * The writes to apply. Method does not apply writes atomically and does not guarantee ordering. Each write succeeds or fails independently. You cannot write to the same document more + * than once per request. */ + writes?: Write[]; + } + interface BatchWriteResponse { + /** The status of applying the writes. This i-th write status corresponds to the i-th write in the request. */ + status?: Status[]; + /** The result of applying the writes. This i-th write result corresponds to the i-th write in the request. */ + writeResults?: WriteResult[]; + } + interface BeginTransactionRequest { + /** The options for the transaction. Defaults to a read-write transaction. */ options?: TransactionOptions; } interface BeginTransactionResponse { @@ -85,121 +97,67 @@ declare namespace gapi.client { transaction?: string; } interface CollectionSelector { - /** - * When false, selects only collections that are immediate children of - * the `parent` specified in the containing `RunQueryRequest`. - * When true, selects all descendant collections. - */ + /** When false, selects only collections that are immediate children of the `parent` specified in the containing `RunQueryRequest`. When true, selects all descendant collections. */ allDescendants?: boolean; - /** - * The collection ID. - * When set, selects only collections with this ID. - */ + /** The collection ID. When set, selects only collections with this ID. */ collectionId?: string; } interface CommitRequest { /** If set, applies all writes in this transaction, and commits it. */ transaction?: string; - /** - * The writes to apply. - * - * Always executed atomically and in order. - */ + /** The writes to apply. Always executed atomically and in order. */ writes?: Write[]; } interface CommitResponse { - /** - * The time at which the commit occurred. Any read with an equal or greater - * `read_time` is guaranteed to see the effects of the commit. - */ + /** The time at which the commit occurred. Any read with an equal or greater `read_time` is guaranteed to see the effects of the commit. */ commitTime?: string; - /** - * The result of applying the writes. - * - * This i-th write result corresponds to the i-th write in the - * request. - */ + /** The result of applying the writes. This i-th write result corresponds to the i-th write in the request. */ writeResults?: WriteResult[]; } interface CompositeFilter { - /** - * The list of filters to combine. - * Must contain at least one filter. - */ + /** The list of filters to combine. Requires: * At least one filter is present. */ filters?: Filter[]; /** The operator for combining multiple filters. */ op?: string; } - interface Cursor { + interface Count { /** - * If the position is just before or just after the given values, relative - * to the sort order defined by the query. + * Optional. Optional constraint on the maximum number of documents to count. This provides a way to set an upper bound on the number of documents to scan, limiting latency and cost. + * Unspecified is interpreted as no bound. High-Level Example: ``` AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); ``` Requires: * Must be greater than zero when present. */ + upTo?: string; + } + interface Cursor { + /** If the position is just before or just after the given values, relative to the sort order defined by the query. */ before?: boolean; - /** - * The values that represent a position, in the order they appear in - * the order by clause of a query. - * - * Can contain fewer values than specified in the order by clause. - */ + /** The values that represent a position, in the order they appear in the order by clause of a query. Can contain fewer values than specified in the order by clause. */ values?: Value[]; } interface Document { /** - * Output only. The time at which the document was created. - * - * This value increases monotonically when a document is deleted then - * recreated. It can also be compared to values from other documents and - * the `read_time` of a query. + * Output only. The time at which the document was created. This value increases monotonically when a document is deleted then recreated. It can also be compared to values from other + * documents and the `read_time` of a query. */ createTime?: string; /** - * The document's fields. - * - * The map keys represent field names. - * - * A simple field name contains only characters `a` to `z`, `A` to `Z`, - * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, - * `foo_bar_17`. - * - * Field names matching the regular expression `__.*__` are reserved. Reserved - * field names are forbidden except in certain documented contexts. The map - * keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be - * empty. - * - * Field paths may be used in other contexts to refer to structured fields - * defined here. For `map_value`, the field path is represented by the simple - * or quoted field names of the containing fields, delimited by `.`. For - * example, the structured field - * `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be - * represented by the field path `foo.x&y`. - * - * Within a field path, a quoted field name starts and ends with `` ` `` and - * may contain any character. Some characters, including `` ` ``, must be - * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and - * `` `bak\`tik` `` represents `` bak`tik ``. - */ - fields?: Record; - /** - * The resource name of the document, for example - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * The document's fields. The map keys represent field names. A simple field name contains only characters `a` to `z`, `A` to `Z`, `0` to `9`, or `_`, and must not start with `0` to + * `9`. For example, `foo_bar_17`. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain documented contexts. The map + * keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. Field paths may be used in other contexts to refer to structured fields defined here. For `map_value`, + * the field path is represented by the simple or quoted field names of the containing fields, delimited by `.`. For example, the structured field `"foo" : { map_value: { "x&y" : { + * string_value: "hello" }}}` would be represented by the field path `foo.x&y`. Within a field path, a quoted field name starts and ends with `` ` `` and may contain any character. + * Some characters, including `` ` ``, must be escaped using a `\`. For example, `` `x&y` `` represents `x&y` and `` `bak\`tik` `` represents `` bak`tik ``. */ + fields?: { [P in string]: Value }; + /** The resource name of the document, for example `projects/{project_id}/databases/{database_id}/documents/{document_path}`. */ name?: string; /** - * Output only. The time at which the document was last changed. - * - * This value is initially set to the `create_time` then increases - * monotonically with each change to the document. It can also be - * compared to values from other documents and the `read_time` of a query. + * Output only. The time at which the document was last changed. This value is initially set to the `create_time` then increases monotonically with each change to the document. It can + * also be compared to values from other documents and the `read_time` of a query. */ updateTime?: string; } interface DocumentChange { - /** - * The new state of the Document. - * - * If `mask` is set, contains only fields that were updated or added. - */ + /** The new state of the Document. If `mask` is set, contains only fields that were updated or added. */ document?: Document; /** A set of target IDs for targets that no longer match this document. */ removedTargetIds?: number[]; @@ -209,61 +167,42 @@ declare namespace gapi.client { interface DocumentDelete { /** The resource name of the Document that was deleted. */ document?: string; - /** - * The read timestamp at which the delete was observed. - * - * Greater or equal to the `commit_time` of the delete. - */ + /** The read timestamp at which the delete was observed. Greater or equal to the `commit_time` of the delete. */ readTime?: string; /** A set of target IDs for targets that previously matched this entity. */ removedTargetIds?: number[]; } interface DocumentMask { - /** - * The list of field paths in the mask. See Document.fields for a field - * path syntax reference. - */ + /** The list of field paths in the mask. See Document.fields for a field path syntax reference. */ fieldPaths?: string[]; } interface DocumentRemove { /** The resource name of the Document that has gone out of view. */ document?: string; - /** - * The read timestamp at which the remove was observed. - * - * Greater or equal to the `commit_time` of the change/delete/remove. - */ + /** The read timestamp at which the remove was observed. Greater or equal to the `commit_time` of the change/delete/remove. */ readTime?: string; /** A set of target IDs for targets that previously matched this document. */ removedTargetIds?: number[]; } interface DocumentsTarget { /** - * The names of the documents to retrieve. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * The request will fail if any of the document is not a child resource of - * the given `database`. Duplicate names will be elided. + * The names of the documents to retrieve. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. The request will fail if any of the document is not + * a child resource of the given `database`. Duplicate names will be elided. */ documents?: string[]; } interface DocumentTransform { /** The name of the document to transform. */ document?: string; - /** - * The list of transformations to apply to the fields of the document, in - * order. - * This must not be empty. - */ + /** The list of transformations to apply to the fields of the document, in order. This must not be empty. */ fieldTransforms?: FieldTransform[]; } - // eslint-disable-next-line @typescript-eslint/no-empty-interface + // tslint:disable-next-line:no-empty-interface interface Empty {} interface ExistenceFilter { /** - * The total count of documents that match target_id. - * - * If different from the count of documents in the client that match, the - * client must manually determine which documents no longer match the target. + * The total count of documents that match target_id. If different from the count of documents in the client that match, the client must manually determine which documents no longer + * match the target. */ count?: number; /** The target ID to which this filter applies. */ @@ -278,83 +217,43 @@ declare namespace gapi.client { value?: Value; } interface FieldReference { + /** The relative path of the document being referenced. Requires: * Conform to document field name limitations. */ fieldPath?: string; } interface FieldTransform { /** - * Append the given elements in order if they are not already present in - * the current field value. - * If the field is not an array, or if the field does not yet exist, it is - * first set to the empty array. - * - * Equivalent numbers of different types (e.g. 3L and 3.0) are - * considered equal when checking if a value is missing. - * NaN is equal to NaN, and Null is equal to Null. - * If the input contains multiple equivalent values, only the first will - * be considered. - * - * The corresponding transform_result will be the null value. + * Append the given elements in order if they are not already present in the current field value. If the field is not an array, or if the field does not yet exist, it is first set to + * the empty array. Equivalent numbers of different types (e.g. 3L and 3.0) are considered equal when checking if a value is missing. NaN is equal to NaN, and Null is equal to Null. If + * the input contains multiple equivalent values, only the first will be considered. The corresponding transform_result will be the null value. */ appendMissingElements?: ArrayValue; - /** - * The path of the field. See Document.fields for the field path syntax - * reference. - */ + /** The path of the field. See Document.fields for the field path syntax reference. */ fieldPath?: string; /** - * Adds the given value to the field's current value. - * - * This must be an integer or a double value. - * If the field is not an integer or double, or if the field does not yet - * exist, the transformation will set the field to the given value. - * If either of the given value or the current field value are doubles, - * both values will be interpreted as doubles. Double arithmetic and - * representation of double values follow IEEE 754 semantics. - * If there is positive/negative integer overflow, the field is resolved - * to the largest magnitude positive/negative integer. + * Adds the given value to the field's current value. This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the + * transformation will set the field to the given value. If either of the given value or the current field value are doubles, both values will be interpreted as doubles. Double + * arithmetic and representation of double values follow IEEE 754 semantics. If there is positive/negative integer overflow, the field is resolved to the largest magnitude + * positive/negative integer. */ increment?: Value; /** - * Sets the field to the maximum of its current value and the given value. - * - * This must be an integer or a double value. - * If the field is not an integer or double, or if the field does not yet - * exist, the transformation will set the field to the given value. - * If a maximum operation is applied where the field and the input value - * are of mixed types (that is - one is an integer and one is a double) - * the field takes on the type of the larger operand. If the operands are - * equivalent (e.g. 3 and 3.0), the field does not change. - * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and - * zero input value is always the stored value. - * The maximum of any numeric value x and NaN is NaN. + * Sets the field to the maximum of its current value and the given value. This must be an integer or a double value. If the field is not an integer or double, or if the field does not + * yet exist, the transformation will set the field to the given value. If a maximum operation is applied where the field and the input value are of mixed types (that is - one is an + * integer and one is a double) the field takes on the type of the larger operand. If the operands are equivalent (e.g. 3 and 3.0), the field does not change. 0, 0.0, and -0.0 are all + * zero. The maximum of a zero stored value and zero input value is always the stored value. The maximum of any numeric value x and NaN is NaN. */ maximum?: Value; /** - * Sets the field to the minimum of its current value and the given value. - * - * This must be an integer or a double value. - * If the field is not an integer or double, or if the field does not yet - * exist, the transformation will set the field to the input value. - * If a minimum operation is applied where the field and the input value - * are of mixed types (that is - one is an integer and one is a double) - * the field takes on the type of the smaller operand. If the operands are - * equivalent (e.g. 3 and 3.0), the field does not change. - * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and - * zero input value is always the stored value. - * The minimum of any numeric value x and NaN is NaN. + * Sets the field to the minimum of its current value and the given value. This must be an integer or a double value. If the field is not an integer or double, or if the field does not + * yet exist, the transformation will set the field to the input value. If a minimum operation is applied where the field and the input value are of mixed types (that is - one is an + * integer and one is a double) the field takes on the type of the smaller operand. If the operands are equivalent (e.g. 3 and 3.0), the field does not change. 0, 0.0, and -0.0 are all + * zero. The minimum of a zero stored value and zero input value is always the stored value. The minimum of any numeric value x and NaN is NaN. */ minimum?: Value; /** - * Remove all of the given elements from the array in the field. - * If the field is not an array, or if the field does not yet exist, it is - * set to the empty array. - * - * Equivalent numbers of the different types (e.g. 3L and 3.0) are - * considered equal when deciding whether an element should be removed. - * NaN is equal to NaN, and Null is equal to Null. - * This will remove all equivalent values if there are duplicates. - * - * The corresponding transform_result will be the null value. + * Remove all of the given elements from the array in the field. If the field is not an array, or if the field does not yet exist, it is set to the empty array. Equivalent numbers of + * the different types (e.g. 3L and 3.0) are considered equal when deciding whether an element should be removed. NaN is equal to NaN, and Null is equal to Null. This will remove all + * equivalent values if there are duplicates. The corresponding transform_result will be the null value. */ removeAllFromArray?: ArrayValue; /** Sets the field to the given server value. */ @@ -368,13 +267,33 @@ declare namespace gapi.client { /** A filter that takes exactly one argument. */ unaryFilter?: UnaryFilter; } + interface GoogleFirestoreAdminV1Database { + /** The App Engine integration mode to use for this database. */ + appEngineIntegrationMode?: string; + /** The concurrency control mode to use for this database. */ + concurrencyMode?: string; + /** + * This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before + * proceeding. + */ + etag?: string; + /** + * Output only. The key_prefix for this database. This key_prefix is used, in combination with the project id ("~") to construct the application id that is returned from the Cloud + * Datastore APIs in Google App Engine first generation runtimes. This value may be empty in which case the appid to use for URL-encoded keys is the project_id (eg: foo instead of + * v~foo). + */ + keyPrefix?: string; + /** The location of the database. Available databases are listed at https://cloud.google.com/firestore/docs/locations. */ + locationId?: string; + /** The resource name of the Database. Format: `projects/{project}/databases/{database}` */ + name?: string; + /** The type of the database. See https://cloud.google.com/datastore/docs/firestore-or-datastore for information about how to choose. */ + type?: string; + } interface GoogleFirestoreAdminV1ExportDocumentsMetadata { /** Which collection ids are being exported. */ collectionIds?: string[]; - /** - * The time this operation completed. Will be unset if operation still in - * progress. - */ + /** The time this operation completed. Will be unset if operation still in progress. */ endTime?: string; /** The state of the export operation. */ operationState?: string; @@ -391,78 +310,42 @@ declare namespace gapi.client { /** Which collection ids to export. Unspecified means all collections. */ collectionIds?: string[]; /** - * The output URI. Currently only supports Google Cloud Storage URIs of the - * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name - * of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional - * Google Cloud Storage namespace path. When - * choosing a name, be sure to consider Google Cloud Storage naming - * guidelines: https://cloud.google.com/storage/docs/naming. - * If the URI is a bucket (without a namespace path), a prefix will be - * generated based on the start time. + * The output URI. Currently only supports Google Cloud Storage URIs of the form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name of the Google Cloud Storage + * bucket and `NAMESPACE_PATH` is an optional Google Cloud Storage namespace path. When choosing a name, be sure to consider Google Cloud Storage naming guidelines: + * https://cloud.google.com/storage/docs/naming. If the URI is a bucket (without a namespace path), a prefix will be generated based on the start time. */ outputUriPrefix?: string; } interface GoogleFirestoreAdminV1ExportDocumentsResponse { - /** - * Location of the output files. This can be used to begin an import - * into Cloud Firestore (this project or another project) after the operation - * completes successfully. - */ + /** Location of the output files. This can be used to begin an import into Cloud Firestore (this project or another project) after the operation completes successfully. */ outputUriPrefix?: string; } interface GoogleFirestoreAdminV1Field { /** - * The index configuration for this field. If unset, field indexing will - * revert to the configuration defined by the `ancestor_field`. To - * explicitly remove all indexes for this field, specify an index config - * with an empty list of indexes. + * The index configuration for this field. If unset, field indexing will revert to the configuration defined by the `ancestor_field`. To explicitly remove all indexes for this field, + * specify an index config with an empty list of indexes. */ indexConfig?: GoogleFirestoreAdminV1IndexConfig; /** - * A field name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` - * - * A field path may be a simple field name, e.g. `address` or a path to fields - * within map_value , e.g. `address.city`, - * or a special field path. The only valid special field is `*`, which - * represents any field. - * - * Field paths may be quoted using ` (backtick). The only character that needs - * to be escaped within a quoted field path is the backtick character itself, - * escaped using a backslash. Special characters in field paths that - * must be quoted include: `*`, `.`, - * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. - * - * Examples: - * (Note: Comments here are written in markdown syntax, so there is an - * additional layer of backticks to represent a code block) - * `\`address.city\`` represents a field named `address.city`, not the map key - * `city` in the field `address`. - * `\`*\`` represents a field named `*`, not any field. - * - * A special `Field` contains the default indexing settings for all fields. - * This field's resource name is: - * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` - * Indexes defined on this `Field` will be applied to all fields which do not - * have their own `Field` index configuration. + * Required. A field name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` A field path may be a simple field name, e.g. + * `address` or a path to fields within map_value , e.g. `address.city`, or a special field path. The only valid special field is `*`, which represents any field. Field paths may be + * quoted using ` (backtick). The only character that needs to be escaped within a quoted field path is the backtick character itself, escaped using a backslash. Special characters in + * field paths that must be quoted include: `*`, `.`, ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. Examples: (Note: Comments here are written in markdown syntax, + * so there is an additional layer of backticks to represent a code block) `\`address.city\`` represents a field named `address.city`, not the map key `city` in the field `address`. + * `\`*\`` represents a field named `*`, not any field. A special `Field` contains the default indexing settings for all fields. This field's resource name is: + * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` Indexes defined on this `Field` will be applied to all fields which do not have their own + * `Field` index configuration. */ name?: string; + /** The TTL configuration for this `Field`. Setting or unsetting this will enable or disable the TTL for documents that have this `Field`. */ + ttlConfig?: GoogleFirestoreAdminV1TtlConfig; } interface GoogleFirestoreAdminV1FieldOperationMetadata { - /** - * The time this operation completed. Will be unset if operation still in - * progress. - */ + /** The time this operation completed. Will be unset if operation still in progress. */ endTime?: string; - /** - * The field resource that this operation is acting on. For example: - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` - */ + /** The field resource that this operation is acting on. For example: `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` */ field?: string; - /** - * A list of IndexConfigDelta, which describe the intent of this - * operation. - */ + /** A list of IndexConfigDelta, which describe the intent of this operation. */ indexConfigDeltas?: GoogleFirestoreAdminV1IndexConfigDelta[]; /** The progress, in bytes, of this operation. */ progressBytes?: GoogleFirestoreAdminV1Progress; @@ -472,14 +355,13 @@ declare namespace gapi.client { startTime?: string; /** The state of the operation. */ state?: string; + /** Describes the deltas of TTL configuration. */ + ttlConfigDelta?: GoogleFirestoreAdminV1TtlConfigDelta; } interface GoogleFirestoreAdminV1ImportDocumentsMetadata { /** Which collection ids are being imported. */ collectionIds?: string[]; - /** - * The time this operation completed. Will be unset if operation still in - * progress. - */ + /** The time this operation completed. Will be unset if operation still in progress. */ endTime?: string; /** The location of the documents being imported. */ inputUriPrefix?: string; @@ -493,50 +375,31 @@ declare namespace gapi.client { startTime?: string; } interface GoogleFirestoreAdminV1ImportDocumentsRequest { - /** - * Which collection ids to import. Unspecified means all collections included - * in the import. - */ + /** Which collection ids to import. Unspecified means all collections included in the import. */ collectionIds?: string[]; /** - * Location of the exported files. - * This must match the output_uri_prefix of an ExportDocumentsResponse from - * an export that has completed successfully. - * See: + * Location of the exported files. This must match the output_uri_prefix of an ExportDocumentsResponse from an export that has completed successfully. See: * google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix. */ inputUriPrefix?: string; } interface GoogleFirestoreAdminV1Index { /** - * The fields supported by this index. - * - * For composite indexes, this is always 2 or more fields. - * The last field entry is always for the field path `__name__`. If, on - * creation, `__name__` was not specified as the last field, it will be added - * automatically with the same direction as that of the last field defined. If - * the final field in a composite index is not directional, the `__name__` - * will be ordered ASCENDING (unless explicitly specified). - * - * For single field indexes, this will always be exactly one entry with a + * The fields supported by this index. For composite indexes, this requires a minimum of 2 and a maximum of 100 fields. The last field entry is always for the field path `__name__`. + * If, on creation, `__name__` was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a + * composite index is not directional, the `__name__` will be ordered ASCENDING (unless explicitly specified). For single field indexes, this will always be exactly one entry with a * field path equal to the field path of the associated field. */ fields?: GoogleFirestoreAdminV1IndexField[]; /** - * Output only. A server defined name for this index. - * The form of this name for composite indexes will be: - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}` - * For single field indexes, this field will be empty. + * Output only. A server defined name for this index. The form of this name for composite indexes will be: + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}` For single field indexes, this field will be empty. */ name?: string; /** - * Indexes with a collection query scope specified allow queries - * against a collection that is the child of a specific document, specified at - * query time, and that has the same collection id. - * - * Indexes with a collection group query scope specified allow queries against - * all collections descended from a specific document, specified at query - * time, and that have the same collection id as this index. + * Indexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the same + * collection id. Indexes with a collection group query scope specified allow queries against all collections descended from a specific document, specified at query time, and that have + * the same collection id as this index. */ queryScope?: string; /** Output only. The serving state of the index. */ @@ -544,26 +407,20 @@ declare namespace gapi.client { } interface GoogleFirestoreAdminV1IndexConfig { /** - * Output only. Specifies the resource name of the `Field` from which this field's - * index configuration is set (when `uses_ancestor_config` is true), - * or from which it *would* be set if this field had no index configuration - * (when `uses_ancestor_config` is false). + * Output only. Specifies the resource name of the `Field` from which this field's index configuration is set (when `uses_ancestor_config` is true), or from which it *would* be set if + * this field had no index configuration (when `uses_ancestor_config` is false). */ ancestorField?: string; /** The indexes supported for this field. */ indexes?: GoogleFirestoreAdminV1Index[]; /** - * Output only - * When true, the `Field`'s index configuration is in the process of being - * reverted. Once complete, the index config will transition to the same - * state as the field specified by `ancestor_field`, at which point - * `uses_ancestor_config` will be `true` and `reverting` will be `false`. + * Output only When true, the `Field`'s index configuration is in the process of being reverted. Once complete, the index config will transition to the same state as the field + * specified by `ancestor_field`, at which point `uses_ancestor_config` will be `true` and `reverting` will be `false`. */ reverting?: boolean; /** - * Output only. When true, the `Field`'s index configuration is set from the - * configuration specified by the `ancestor_field`. - * When false, the `Field`'s index configuration is defined explicitly. + * Output only. When true, the `Field`'s index configuration is set from the configuration specified by the `ancestor_field`. When false, the `Field`'s index configuration is defined + * explicitly. */ usesAncestorConfig?: boolean; } @@ -576,28 +433,15 @@ declare namespace gapi.client { interface GoogleFirestoreAdminV1IndexField { /** Indicates that this field supports operations on `array_value`s. */ arrayConfig?: string; - /** - * Can be __name__. - * For single field indexes, this must match the name of the field or may - * be omitted. - */ + /** Can be __name__. For single field indexes, this must match the name of the field or may be omitted. */ fieldPath?: string; - /** - * Indicates that this field supports ordering by the specified order or - * comparing using =, <, <=, >, >=. - */ + /** Indicates that this field supports ordering by the specified order or comparing using =, !=, <, <=, >, >=. */ order?: string; } interface GoogleFirestoreAdminV1IndexOperationMetadata { - /** - * The time this operation completed. Will be unset if operation still in - * progress. - */ + /** The time this operation completed. Will be unset if operation still in progress. */ endTime?: string; - /** - * The index resource that this operation is acting on. For example: - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - */ + /** The index resource that this operation is acting on. For example: `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` */ index?: string; /** The progress, in bytes, of this operation. */ progressBytes?: GoogleFirestoreAdminV1Progress; @@ -608,25 +452,23 @@ declare namespace gapi.client { /** The state of the operation. */ state?: string; } + interface GoogleFirestoreAdminV1ListDatabasesResponse { + /** The databases in the project. */ + databases?: GoogleFirestoreAdminV1Database[]; + } interface GoogleFirestoreAdminV1ListFieldsResponse { /** The requested fields. */ fields?: GoogleFirestoreAdminV1Field[]; - /** - * A page token that may be used to request another page of results. If blank, - * this is the last page. - */ + /** A page token that may be used to request another page of results. If blank, this is the last page. */ nextPageToken?: string; } interface GoogleFirestoreAdminV1ListIndexesResponse { /** The requested indexes. */ indexes?: GoogleFirestoreAdminV1Index[]; - /** - * A page token that may be used to request another page of results. If blank, - * this is the last page. - */ + /** A page token that may be used to request another page of results. If blank, this is the last page. */ nextPageToken?: string; } - // eslint-disable-next-line @typescript-eslint/no-empty-interface + // tslint:disable-next-line:no-empty-interface interface GoogleFirestoreAdminV1LocationMetadata {} interface GoogleFirestoreAdminV1Progress { /** The amount of work completed. */ @@ -634,7 +476,17 @@ declare namespace gapi.client { /** The amount of work estimated. */ estimatedWork?: string; } - // eslint-disable-next-line @typescript-eslint/no-empty-interface + interface GoogleFirestoreAdminV1TtlConfig { + /** Output only. The state of the TTL configuration. */ + state?: string; + } + interface GoogleFirestoreAdminV1TtlConfigDelta { + /** Specifies how the TTL configuration is changing. */ + changeType?: string; + } + // tslint:disable-next-line:no-empty-interface + interface GoogleFirestoreAdminV1UpdateDatabaseMetadata {} + // tslint:disable-next-line:no-empty-interface interface GoogleLongrunningCancelOperationRequest {} interface GoogleLongrunningListOperationsResponse { /** The standard List next-page token. */ @@ -643,38 +495,26 @@ declare namespace gapi.client { operations?: GoogleLongrunningOperation[]; } interface GoogleLongrunningOperation { - /** - * If the value is `false`, it means the operation is still in progress. - * If `true`, the operation is completed, and either `error` or `response` is - * available. - */ + /** If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */ done?: boolean; /** The error result of the operation in case of failure or cancellation. */ error?: Status; /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. - * Some services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. + * Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such + * metadata. Any method that returns a long-running operation should document the metadata type, if any. */ - metadata?: Record; + metadata?: { [P in string]: any }; /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the - * `name` should be a resource name ending with `operations/{unique_id}`. + * The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending + * with `operations/{unique_id}`. */ name?: string; /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` - * is the original method name. For example, if the original method name - * is `TakeSnapshot()`, the inferred response type is - * `TakeSnapshotResponse`. + * The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the + * original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the + * original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. */ - response?: Record; + response?: { [P in string]: any }; } interface LatLng { /** The latitude in degrees. It must be in the range [-90.0, +90.0]. */ @@ -685,11 +525,10 @@ declare namespace gapi.client { interface ListCollectionIdsRequest { /** The maximum number of results to return. */ pageSize?: number; - /** - * A page token. Must be a value from - * ListCollectionIdsResponse. - */ + /** A page token. Must be a value from ListCollectionIdsResponse. */ pageToken?: string; + /** Reads documents as they were at the given time. This may not be older than 270 seconds. */ + readTime?: string; } interface ListCollectionIdsResponse { /** The collection ids. */ @@ -707,7 +546,7 @@ declare namespace gapi.client { /** A target to add to this stream. */ addTarget?: Target; /** Labels associated with this target change. */ - labels?: Record; + labels?: { [P in string]: string }; /** The ID of a target to remove from this stream. */ removeTarget?: number; } @@ -716,17 +555,11 @@ declare namespace gapi.client { documentChange?: DocumentChange; /** A Document has been deleted. */ documentDelete?: DocumentDelete; - /** - * A Document has been removed from a target (because it is no longer - * relevant to that target). - */ + /** A Document has been removed from a target (because it is no longer relevant to that target). */ documentRemove?: DocumentRemove; /** - * A filter to apply to the set of documents previously returned for the - * given target. - * - * Returned when documents may have been removed from the given target, but - * the exact documents are unknown. + * A filter to apply to the set of documents previously returned for the given target. Returned when documents may have been removed from the given target, but the exact documents are + * unknown. */ filter?: ExistenceFilter; /** Targets have changed. */ @@ -739,40 +572,23 @@ declare namespace gapi.client { nextPageToken?: string; } interface Location { - /** - * The friendly name for this location, typically a nearby city name. - * For example, "Tokyo". - */ + /** The friendly name for this location, typically a nearby city name. For example, "Tokyo". */ displayName?: string; - /** - * Cross-service attributes for the location. For example - * - * {"cloud.googleapis.com/region": "us-east1"} - */ - labels?: Record; + /** Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"} */ + labels?: { [P in string]: string }; /** The canonical id for this location. For example: `"us-east1"`. */ locationId?: string; - /** - * Service-specific metadata. For example the available capacity at the given - * location. - */ - metadata?: Record; - /** - * Resource name for the location, which may vary between implementations. - * For example: `"projects/example-project/locations/us-east1"` - */ + /** Service-specific metadata. For example the available capacity at the given location. */ + metadata?: { [P in string]: any }; + /** Resource name for the location, which may vary between implementations. For example: `"projects/example-project/locations/us-east1"` */ name?: string; } interface MapValue { /** - * The map's fields. - * - * The map keys represent field names. Field names matching the regular - * expression `__.*__` are reserved. Reserved field names are forbidden except - * in certain documented contexts. The map keys, represented as UTF-8, must - * not exceed 1,500 bytes and cannot be empty. + * The map's fields. The map keys represent field names. Field names matching the regular expression `__.*__` are reserved. Reserved field names are forbidden except in certain + * documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. */ - fields?: Record; + fields?: { [P in string]: Value }; } interface Order { /** The direction to order by. Defaults to `ASCENDING`. */ @@ -780,45 +596,69 @@ declare namespace gapi.client { /** The field to order by. */ field?: FieldReference; } - interface Precondition { + interface PartitionQueryRequest { /** - * When set to `true`, the target document must exist. - * When set to `false`, the target document must not exist. + * The maximum number of partitions to return in this call, subject to `partition_count`. For example, if `partition_count` = 10 and `page_size` = 8, the first call to PartitionQuery + * will return up to 8 partitions and a `next_page_token` if more results exist. A second call to PartitionQuery will return up to 2 partitions, to complete the total of 10 specified + * in `partition_count`. */ - exists?: boolean; + pageSize?: number; /** - * When set, the target document must exist and have been last updated at - * that time. + * The `next_page_token` value returned from a previous call to PartitionQuery that may be used to get an additional set of results. There are no ordering guarantees between sets of + * results. Thus, using multiple sets of results will require merging the different result sets. For example, two subsequent calls using a page_token may return: * cursor B, cursor M, + * cursor Q * cursor A, cursor U, cursor W To obtain a complete result set ordered with respect to the results of the query supplied to PartitionQuery, the results sets should be + * merged: cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W */ - updateTime?: string; + pageToken?: string; + /** + * The desired maximum number of partition points. The partitions may be returned across multiple pages of results. The number must be positive. The actual number of partitions + * returned may be fewer. For example, this may be set to one fewer than the number of parallel queries to be run, or in running a data pipeline job, one fewer than the number of + * workers or compute instances available. + */ + partitionCount?: string; + /** Reads documents as they were at the given time. This may not be older than 270 seconds. */ + readTime?: string; + /** + * A structured query. Query must specify collection with all descendants and be ordered by name ascending. Other filters, order bys, limits, offsets, and start/end cursors are not + * supported. + */ + structuredQuery?: StructuredQuery; } - interface Projection { + interface PartitionQueryResponse { + /** + * A page token that may be used to request an additional set of results, up to the number specified by `partition_count` in the PartitionQuery request. If blank, there are no more + * results. + */ + nextPageToken?: string; /** - * The fields to return. - * - * If empty, all fields are returned. To only return the name - * of the document, use `['__name__']`. + * Partition results. Each partition is a split point that can be used by RunQuery as a starting or end point for the query results. The RunQuery requests must be made with the same + * query supplied to this PartitionQuery request. The partition cursors will be ordered according to same ordering as the results of the query supplied to PartitionQuery. For example, + * if a PartitionQuery request returns partition cursors A and B, running the following three queries will return the entire result set of the original query: * query, end_at A * + * query, start_at A, end_at B * query, start_at B An empty result may indicate that the query has too few results to be partitioned. */ + partitions?: Cursor[]; + } + interface Precondition { + /** When set to `true`, the target document must exist. When set to `false`, the target document must not exist. */ + exists?: boolean; + /** When set, the target document must exist and have been last updated at that time. Timestamp must be microsecond aligned. */ + updateTime?: string; + } + interface Projection { + /** The fields to return. If empty, all fields are returned. To only return the name of the document, use `['__name__']`. */ fields?: FieldReference[]; } interface QueryTarget { /** - * The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For + * example: `projects/my-project/databases/my-database/documents` or `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` */ parent?: string; /** A structured query. */ structuredQuery?: StructuredQuery; } interface ReadOnly { - /** - * Reads documents at the given time. - * This may not be older than 60 seconds. - */ + /** Reads documents at the given time. This may not be older than 60 seconds. */ readTime?: string; } interface ReadWrite { @@ -829,111 +669,104 @@ declare namespace gapi.client { /** Required. The transaction to roll back. */ transaction?: string; } + interface RunAggregationQueryRequest { + /** Starts a new transaction as part of the query, defaulting to read-only. The new transaction ID will be returned as the first response in the stream. */ + newTransaction?: TransactionOptions; + /** Executes the query at the given timestamp. Requires: * Cannot be more than 270 seconds in the past. */ + readTime?: string; + /** An aggregation query. */ + structuredAggregationQuery?: StructuredAggregationQuery; + /** Run the aggregation within an already active transaction. The value here is the opaque transaction ID to execute the query in. */ + transaction?: string; + } + interface RunAggregationQueryResponse { + /** The time at which the aggregate value is valid for. */ + readTime?: string; + /** A single aggregation result. Not present when reporting partial progress. */ + result?: AggregationResult; + /** The transaction that was started as part of this request. Only present on the first response when the request requested to start a new transaction. */ + transaction?: string; + } interface RunQueryRequest { - /** - * Starts a new transaction and reads the documents. - * Defaults to a read-only transaction. - * The new transaction ID will be returned as the first response in the - * stream. - */ + /** Starts a new transaction and reads the documents. Defaults to a read-only transaction. The new transaction ID will be returned as the first response in the stream. */ newTransaction?: TransactionOptions; - /** - * Reads documents as they were at the given time. - * This may not be older than 270 seconds. - */ + /** Reads documents as they were at the given time. This may not be older than 270 seconds. */ readTime?: string; /** A structured query. */ structuredQuery?: StructuredQuery; - /** Reads documents in a transaction. */ + /** Run the query within an already active transaction. The value here is the opaque transaction ID to execute the query in. */ transaction?: string; } interface RunQueryResponse { - /** - * A query result. - * Not set when reporting partial progress. - */ + /** A query result, not set when reporting partial progress. */ document?: Document; + /** If present, Firestore has completely finished the request and no more documents will be returned. */ + done?: boolean; /** - * The time at which the document was read. This may be monotonically - * increasing; in this case, the previous documents in the result stream are - * guaranteed not to have changed between their `read_time` and this one. - * - * If the query returns no results, a response with `read_time` and no - * `document` will be sent, and this represents the time at which the query - * was run. + * The time at which the document was read. This may be monotonically increasing; in this case, the previous documents in the result stream are guaranteed not to have changed between + * their `read_time` and this one. If the query returns no results, a response with `read_time` and no `document` will be sent, and this represents the time at which the query was run. */ readTime?: string; - /** - * The number of results that have been skipped due to an offset between - * the last response and the current response. - */ + /** The number of results that have been skipped due to an offset between the last response and the current response. */ skippedResults?: number; /** - * The transaction that was started as part of this request. - * Can only be set in the first response, and only if - * RunQueryRequest.new_transaction was set in the request. - * If set, no other fields will be set in this response. + * The transaction that was started as part of this request. Can only be set in the first response, and only if RunQueryRequest.new_transaction was set in the request. If set, no other + * fields will be set in this response. */ transaction?: string; } interface Status { /** The status code, which should be an enum value of google.rpc.Code. */ code?: number; + /** A list of messages that carry the error details. There is a common set of message types for APIs to use. */ + details?: Array<{ [P in string]: any }>; /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details?: Array>; - /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. + * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the + * client. */ message?: string; } + interface StructuredAggregationQuery { + /** Optional. Series of aggregations to apply over the results of the `structured_query`. Requires: * A minimum of one and maximum of five aggregations per query. */ + aggregations?: Aggregation[]; + /** Nested structured query. */ + structuredQuery?: StructuredQuery; + } interface StructuredQuery { - /** A end point for the query results. */ + /** + * A potential prefix of a position in the result set to end the query at. This is similar to `START_AT` but with it controlling the end position rather than the start position. + * Requires: * The number of values cannot be greater than the number of fields specified in the `ORDER BY` clause. + */ endAt?: Cursor; /** The collections to query. */ from?: CollectionSelector[]; - /** - * The maximum number of results to return. - * - * Applies after all other constraints. - * Must be >= 0 if specified. - */ + /** The maximum number of results to return. Applies after all other constraints. Requires: * The value must be greater than or equal to zero if specified. */ limit?: number; /** - * The number of results to skip. - * - * Applies before limit, but after all other constraints. Must be >= 0 if - * specified. + * The number of documents to skip before returning the first result. This applies after the constraints specified by the `WHERE`, `START AT`, & `END AT` but before the `LIMIT` clause. + * Requires: * The value must be greater than or equal to zero if specified. */ offset?: number; /** - * The order to apply to the query results. - * - * Firestore guarantees a stable ordering through the following rules: - * - * * Any field required to appear in `order_by`, that is not already - * specified in `order_by`, is appended to the order in field name order - * by default. - * * If an order on `__name__` is not specified, it is appended by default. - * - * Fields are appended with the same sort direction as the last order - * specified, or 'ASCENDING' if no order was specified. For example: - * - * * `SELECT * FROM Foo ORDER BY A` becomes - * `SELECT * FROM Foo ORDER BY A, __name__` - * * `SELECT * FROM Foo ORDER BY A DESC` becomes - * `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC` - * * `SELECT * FROM Foo WHERE A > 1` becomes - * `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__` + * The order to apply to the query results. Firestore allows callers to provide a full ordering, a partial ordering, or no ordering at all. In all cases, Firestore guarantees a stable + * ordering through the following rules: * The `order_by` is required to reference all fields used with an inequality filter. * All fields that are required to be in the `order_by` but + * are not already present are appended in lexicographical ordering of the field name. * If an order on `__name__` is not specified, it is appended by default. Fields are appended with + * the same sort direction as the last order specified, or 'ASCENDING' if no order was specified. For example: * `ORDER BY a` becomes `ORDER BY a ASC, __name__ ASC` * `ORDER BY a DESC` + * becomes `ORDER BY a DESC, __name__ DESC` * `WHERE a > 1` becomes `WHERE a > 1 ORDER BY a ASC, __name__ ASC` * `WHERE __name__ > ... AND a > 1` becomes `WHERE __name__ > ... AND a > + * 1 ORDER BY a ASC, __name__ ASC` */ orderBy?: Order[]; /** The projection to return. */ select?: Projection; - /** A starting point for the query results. */ + /** + * A potential prefix of a position in the result set to start the query at. The ordering of the result set is based on the `ORDER BY` clause of the original query. ``` SELECT * FROM k + * WHERE a = 1 AND b > 2 ORDER BY b ASC, __name__ ASC; ``` This query's results are ordered by `(b ASC, __name__ ASC)`. Cursors can reference either the full ordering or a prefix of + * the location, though it cannot reference more fields than what are in the provided `ORDER BY`. Continuing off the example above, attaching the following start cursors will have + * varying impact: - `START BEFORE (2, /k/123)`: start the query right before `a = 1 AND b > 2 AND __name__ > /k/123`. - `START AFTER (10)`: start the query right after `a = 1 AND b > + * 10`. Unlike `OFFSET` which requires scanning over the first N results to skip, a start cursor allows the query to begin at a logical position. This position is not required to match + * an actual result, it will scan forward from this position to find the next document. Requires: * The number of values cannot be greater than the number of fields specified in the + * `ORDER BY` clause. + */ startAt?: Cursor; /** The filter to apply. */ where?: Filter; @@ -945,56 +778,27 @@ declare namespace gapi.client { once?: boolean; /** A target specified by a query. */ query?: QueryTarget; - /** - * Start listening after a specific `read_time`. - * - * The client must know the state of matching documents at this time. - */ + /** Start listening after a specific `read_time`. The client must know the state of matching documents at this time. */ readTime?: string; - /** - * A resume token from a prior TargetChange for an identical target. - * - * Using a resume token with a different target is unsupported and may fail. - */ + /** A resume token from a prior TargetChange for an identical target. Using a resume token with a different target is unsupported and may fail. */ resumeToken?: string; - /** - * The target ID that identifies the target on the stream. Must be a positive - * number and non-zero. - */ + /** The target ID that identifies the target on the stream. Must be a positive number and non-zero. */ targetId?: number; } interface TargetChange { /** The error that resulted in this change, if applicable. */ cause?: Status; /** - * The consistent `read_time` for the given `target_ids` (omitted when the - * target_ids are not at a consistent snapshot). - * - * The stream is guaranteed to send a `read_time` with `target_ids` empty - * whenever the entire stream reaches a new consistent snapshot. ADD, - * CURRENT, and RESET messages are guaranteed to (eventually) result in a - * new consistent snapshot (while NO_CHANGE and REMOVE messages are not). - * - * For a given stream, `read_time` is guaranteed to be monotonically - * increasing. + * The consistent `read_time` for the given `target_ids` (omitted when the target_ids are not at a consistent snapshot). The stream is guaranteed to send a `read_time` with + * `target_ids` empty whenever the entire stream reaches a new consistent snapshot. ADD, CURRENT, and RESET messages are guaranteed to (eventually) result in a new consistent snapshot + * (while NO_CHANGE and REMOVE messages are not). For a given stream, `read_time` is guaranteed to be monotonically increasing. */ readTime?: string; - /** - * A token that can be used to resume the stream for the given `target_ids`, - * or all targets if `target_ids` is empty. - * - * Not set on every target change. - */ + /** A token that can be used to resume the stream for the given `target_ids`, or all targets if `target_ids` is empty. Not set on every target change. */ resumeToken?: string; /** The type of change that occurred. */ targetChangeType?: string; - /** - * The target IDs of targets that have changed. - * - * If empty, the change applies to all targets. - * - * The order of the target IDs is not defined. - */ + /** The target IDs of targets that have changed. If empty, the change applies to all targets. The order of the target IDs is not defined. */ targetIds?: number[]; } interface TransactionOptions { @@ -1010,21 +814,11 @@ declare namespace gapi.client { op?: string; } interface Value { - /** - * An array value. - * - * Cannot directly contain another array value, though can contain an - * map which contains another array. - */ + /** An array value. Cannot directly contain another array value, though can contain an map which contains another array. */ arrayValue?: ArrayValue; /** A boolean value. */ booleanValue?: boolean; - /** - * A bytes value. - * - * Must not exceed 1 MiB - 89 bytes. - * Only the first 1,500 bytes are considered by queries. - */ + /** A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries. */ bytesValue?: string; /** A double value. */ doubleValue?: number; @@ -1035,141 +829,67 @@ declare namespace gapi.client { /** A map value. */ mapValue?: MapValue; /** A null value. */ - nullValue?: null; - /** - * A reference to a document. For example: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - */ + nullValue?: string; + /** A reference to a document. For example: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. */ referenceValue?: string; - /** - * A string value. - * - * The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. - * Only the first 1,500 bytes of the UTF-8 representation are considered by - * queries. - */ + /** A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries. */ stringValue?: string; - /** - * A timestamp value. - * - * Precise only to microseconds. When stored, any additional precision is - * rounded down. - */ + /** A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down. */ timestampValue?: string; } interface Write { - /** - * An optional precondition on the document. - * - * The write will fail if this is set and not met by the target document. - */ + /** An optional precondition on the document. The write will fail if this is set and not met by the target document. */ currentDocument?: Precondition; - /** - * A document name to delete. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - */ + /** A document name to delete. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. */ delete?: string; /** Applies a transformation to a document. */ transform?: DocumentTransform; /** A document to write. */ update?: Document; /** - * The fields to update in this write. - * - * This field can be set only when the operation is `update`. - * If the mask is not set for an `update` and the document exists, any - * existing data will be overwritten. - * If the mask is set and the document on the server has fields not covered by - * the mask, they are left unchanged. - * Fields referenced in the mask, but not present in the input document, are - * deleted from the document on the server. - * The field paths in this mask must not contain a reserved field name. + * The fields to update in this write. This field can be set only when the operation is `update`. If the mask is not set for an `update` and the document exists, any existing data will + * be overwritten. If the mask is set and the document on the server has fields not covered by the mask, they are left unchanged. Fields referenced in the mask, but not present in the + * input document, are deleted from the document on the server. The field paths in this mask must not contain a reserved field name. */ updateMask?: DocumentMask; /** - * The transforms to perform after update. - * - * This field can be set only when the operation is `update`. If present, this - * write is equivalent to performing `update` and `transform` to the same - * document atomically and in order. + * The transforms to perform after update. This field can be set only when the operation is `update`. If present, this write is equivalent to performing `update` and `transform` to the + * same document atomically and in order. */ updateTransforms?: FieldTransform[]; } interface WriteRequest { /** Labels associated with this write request. */ - labels?: Record; - /** - * The ID of the write stream to resume. - * This may only be set in the first message. When left empty, a new write - * stream will be created. - */ + labels?: { [P in string]: string }; + /** The ID of the write stream to resume. This may only be set in the first message. When left empty, a new write stream will be created. */ streamId?: string; /** - * A stream token that was previously sent by the server. - * - * The client should set this field to the token from the most recent - * WriteResponse it has received. This acknowledges that the client has - * received responses up to this token. After sending this token, earlier - * tokens may not be used anymore. - * - * The server may close the stream if there are too many unacknowledged - * responses. - * - * Leave this field unset when creating a new stream. To resume a stream at - * a specific point, set this field and the `stream_id` field. - * - * Leave this field unset when creating a new stream. + * A stream token that was previously sent by the server. The client should set this field to the token from the most recent WriteResponse it has received. This acknowledges that the + * client has received responses up to this token. After sending this token, earlier tokens may not be used anymore. The server may close the stream if there are too many + * unacknowledged responses. Leave this field unset when creating a new stream. To resume a stream at a specific point, set this field and the `stream_id` field. Leave this field unset + * when creating a new stream. */ streamToken?: string; /** - * The writes to apply. - * - * Always executed atomically and in order. - * This must be empty on the first request. - * This may be empty on the last request. - * This must not be empty on all other requests. + * The writes to apply. Always executed atomically and in order. This must be empty on the first request. This may be empty on the last request. This must not be empty on all other + * requests. */ writes?: Write[]; } interface WriteResponse { - /** - * The time at which the commit occurred. Any read with an equal or greater - * `read_time` is guaranteed to see the effects of the write. - */ + /** The time at which the commit occurred. Any read with an equal or greater `read_time` is guaranteed to see the effects of the write. */ commitTime?: string; - /** - * The ID of the stream. - * Only set on the first message, when a new stream was created. - */ + /** The ID of the stream. Only set on the first message, when a new stream was created. */ streamId?: string; - /** - * A token that represents the position of this response in the stream. - * This can be used by a client to resume the stream at this point. - * - * This field is always set. - */ + /** A token that represents the position of this response in the stream. This can be used by a client to resume the stream at this point. This field is always set. */ streamToken?: string; - /** - * The result of applying the writes. - * - * This i-th write result corresponds to the i-th write in the - * request. - */ + /** The result of applying the writes. This i-th write result corresponds to the i-th write in the request. */ writeResults?: WriteResult[]; } interface WriteResult { - /** - * The results of applying each DocumentTransform.FieldTransform, in the - * same order. - */ + /** The results of applying each DocumentTransform.FieldTransform, in the same order. */ transformResults?: Value[]; - /** - * The last update time of the document after applying the write. Not set - * after a `delete`. - * - * If the write did not actually change the document, this will be the - * previous update_time. - */ + /** The last update time of the document after applying the write. Not set after a `delete`. If the write did not actually change the document, this will be the previous update_time. */ updateTime?: string; } interface FieldsResource { @@ -1187,10 +907,7 @@ declare namespace gapi.client { 'fields'?: string; /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ 'key'?: string; - /** - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` - */ + /** Required. A name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` */ 'name': string; /** OAuth 2.0 token for the current user. */ 'oauth_token'?: string; @@ -1204,12 +921,8 @@ declare namespace gapi.client { 'uploadType'?: string; }): Request; /** - * Lists the field configuration and metadata for this database. - * - * Currently, FirestoreAdmin.ListFields only supports listing fields - * that have been explicitly overridden. To issue this query, call - * FirestoreAdmin.ListFields with the filter set to - * `indexConfig.usesAncestorConfig:false`. + * Lists the field configuration and metadata for this database. Currently, FirestoreAdmin.ListFields only supports listing fields that have been explicitly overridden. To issue this + * query, call FirestoreAdmin.ListFields with the filter set to `indexConfig.usesAncestorConfig:false` . */ list(request?: { /** V1 error format. */ @@ -1223,11 +936,8 @@ declare namespace gapi.client { /** Selector specifying which fields to include in a partial response. */ 'fields'?: string; /** - * The filter to apply to list results. Currently, - * FirestoreAdmin.ListFields only supports listing fields - * that have been explicitly overridden. To issue this query, call - * FirestoreAdmin.ListFields with the filter set to - * `indexConfig.usesAncestorConfig:false`. + * The filter to apply to list results. Currently, FirestoreAdmin.ListFields only supports listing fields that have been explicitly overridden. To issue this query, call + * FirestoreAdmin.ListFields with a filter that includes `indexConfig.usesAncestorConfig:false` . */ 'filter'?: string; /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ @@ -1236,16 +946,9 @@ declare namespace gapi.client { 'oauth_token'?: string; /** The number of results to return. */ 'pageSize'?: number; - /** - * A page token, returned from a previous call to - * FirestoreAdmin.ListFields, that may be used to get the next - * page of results. - */ + /** A page token, returned from a previous call to FirestoreAdmin.ListFields, that may be used to get the next page of results. */ 'pageToken'?: string; - /** - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - */ + /** Required. A parent name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` */ 'parent': string; /** Returns response with indentations and line breaks. */ 'prettyPrint'?: boolean; @@ -1257,19 +960,10 @@ declare namespace gapi.client { 'uploadType'?: string; }): Request; /** - * Updates a field configuration. Currently, field updates apply only to - * single field index configuration. However, calls to - * FirestoreAdmin.UpdateField should provide a field mask to avoid - * changing any configuration that the caller isn't aware of. The field mask - * should be specified as: `{ paths: "index_config" }`. - * - * This call returns a google.longrunning.Operation which may be used to - * track the status of the field update. The metadata for - * the operation will be the type FieldOperationMetadata. - * - * To configure the default field settings for the database, use - * the special `Field` with resource name: - * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`. + * Updates a field configuration. Currently, field updates apply only to single field index configuration. However, calls to FirestoreAdmin.UpdateField should provide a field mask to + * avoid changing any configuration that the caller isn't aware of. The field mask should be specified as: `{ paths: "index_config" }`. This call returns a google.longrunning.Operation + * which may be used to track the status of the field update. The metadata for the operation will be the type FieldOperationMetadata. To configure the default field settings for the + * database, use the special `Field` with resource name: `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`. */ patch(request: { /** V1 error format. */ @@ -1285,32 +979,14 @@ declare namespace gapi.client { /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ 'key'?: string; /** - * A field name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` - * - * A field path may be a simple field name, e.g. `address` or a path to fields - * within map_value , e.g. `address.city`, - * or a special field path. The only valid special field is `*`, which - * represents any field. - * - * Field paths may be quoted using ` (backtick). The only character that needs - * to be escaped within a quoted field path is the backtick character itself, - * escaped using a backslash. Special characters in field paths that - * must be quoted include: `*`, `.`, - * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. - * - * Examples: - * (Note: Comments here are written in markdown syntax, so there is an - * additional layer of backticks to represent a code block) - * `\`address.city\`` represents a field named `address.city`, not the map key - * `city` in the field `address`. - * `\`*\`` represents a field named `*`, not any field. - * - * A special `Field` contains the default indexing settings for all fields. - * This field's resource name is: - * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` - * Indexes defined on this `Field` will be applied to all fields which do not - * have their own `Field` index configuration. + * Required. A field name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` A field path may be a simple field name, + * e.g. `address` or a path to fields within map_value , e.g. `address.city`, or a special field path. The only valid special field is `*`, which represents any field. Field paths + * may be quoted using ` (backtick). The only character that needs to be escaped within a quoted field path is the backtick character itself, escaped using a backslash. Special + * characters in field paths that must be quoted include: `*`, `.`, ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. Examples: (Note: Comments here are written + * in markdown syntax, so there is an additional layer of backticks to represent a code block) `\`address.city\`` represents a field named `address.city`, not the map key `city` in + * the field `address`. `\`*\`` represents a field named `*`, not any field. A special `Field` contains the default indexing settings for all fields. This field's resource name is: + * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` Indexes defined on this `Field` will be applied to all fields which do not have their own + * `Field` index configuration. */ 'name': string; /** OAuth 2.0 token for the current user. */ @@ -1319,10 +995,7 @@ declare namespace gapi.client { 'prettyPrint'?: boolean; /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ 'quotaUser'?: string; - /** - * A mask, relative to the field. If specified, only configuration specified - * by this field_mask will be updated in the field. - */ + /** A mask, relative to the field. If specified, only configuration specified by this field_mask will be updated in the field. */ 'updateMask'?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ 'upload_protocol'?: string; @@ -1346,32 +1019,14 @@ declare namespace gapi.client { /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ 'key'?: string; /** - * A field name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` - * - * A field path may be a simple field name, e.g. `address` or a path to fields - * within map_value , e.g. `address.city`, - * or a special field path. The only valid special field is `*`, which - * represents any field. - * - * Field paths may be quoted using ` (backtick). The only character that needs - * to be escaped within a quoted field path is the backtick character itself, - * escaped using a backslash. Special characters in field paths that - * must be quoted include: `*`, `.`, - * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. - * - * Examples: - * (Note: Comments here are written in markdown syntax, so there is an - * additional layer of backticks to represent a code block) - * `\`address.city\`` represents a field named `address.city`, not the map key - * `city` in the field `address`. - * `\`*\`` represents a field named `*`, not any field. - * - * A special `Field` contains the default indexing settings for all fields. - * This field's resource name is: - * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` - * Indexes defined on this `Field` will be applied to all fields which do not - * have their own `Field` index configuration. + * Required. A field name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` A field path may be a simple field name, + * e.g. `address` or a path to fields within map_value , e.g. `address.city`, or a special field path. The only valid special field is `*`, which represents any field. Field paths + * may be quoted using ` (backtick). The only character that needs to be escaped within a quoted field path is the backtick character itself, escaped using a backslash. Special + * characters in field paths that must be quoted include: `*`, `.`, ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. Examples: (Note: Comments here are written + * in markdown syntax, so there is an additional layer of backticks to represent a code block) `\`address.city\`` represents a field named `address.city`, not the map key `city` in + * the field `address`. `\`*\`` represents a field named `*`, not any field. A special `Field` contains the default indexing settings for all fields. This field's resource name is: + * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` Indexes defined on this `Field` will be applied to all fields which do not have their own + * `Field` index configuration. */ 'name': string; /** OAuth 2.0 token for the current user. */ @@ -1380,10 +1035,7 @@ declare namespace gapi.client { 'prettyPrint'?: boolean; /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ 'quotaUser'?: string; - /** - * A mask, relative to the field. If specified, only configuration specified - * by this field_mask will be updated in the field. - */ + /** A mask, relative to the field. If specified, only configuration specified by this field_mask will be updated in the field. */ 'updateMask'?: string; /** Upload protocol for media (e.g. "raw", "multipart"). */ 'upload_protocol'?: string; @@ -1393,12 +1045,10 @@ declare namespace gapi.client { body: GoogleFirestoreAdminV1Field ): Request; } - // tslint:disable-next-line:interface-name interface IndexesResource { /** - * Creates a composite index. This returns a google.longrunning.Operation - * which may be used to track the status of the creation. The metadata for - * the operation will be the type IndexOperationMetadata. + * Creates a composite index. This returns a google.longrunning.Operation which may be used to track the status of the creation. The metadata for the operation will be the type + * IndexOperationMetadata. */ create(request: { /** V1 error format. */ @@ -1415,10 +1065,7 @@ declare namespace gapi.client { 'key'?: string; /** OAuth 2.0 token for the current user. */ 'oauth_token'?: string; - /** - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - */ + /** Required. A parent name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` */ 'parent': string; /** Returns response with indentations and line breaks. */ 'prettyPrint'?: boolean; @@ -1447,10 +1094,7 @@ declare namespace gapi.client { 'key'?: string; /** OAuth 2.0 token for the current user. */ 'oauth_token'?: string; - /** - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - */ + /** Required. A parent name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` */ 'parent': string; /** Returns response with indentations and line breaks. */ 'prettyPrint'?: boolean; @@ -1477,10 +1121,7 @@ declare namespace gapi.client { 'fields'?: string; /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ 'key'?: string; - /** - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - */ + /** Required. A name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` */ 'name': string; /** OAuth 2.0 token for the current user. */ 'oauth_token'?: string; @@ -1507,10 +1148,7 @@ declare namespace gapi.client { 'fields'?: string; /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ 'key'?: string; - /** - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - */ + /** Required. A name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` */ 'name': string; /** OAuth 2.0 token for the current user. */ 'oauth_token'?: string; @@ -1543,16 +1181,9 @@ declare namespace gapi.client { 'oauth_token'?: string; /** The number of results to return. */ 'pageSize'?: number; - /** - * A page token, returned from a previous call to - * FirestoreAdmin.ListIndexes, that may be used to get the next - * page of results. - */ + /** A page token, returned from a previous call to FirestoreAdmin.ListIndexes, that may be used to get the next page of results. */ 'pageToken'?: string; - /** - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - */ + /** Required. A parent name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` */ 'parent': string; /** Returns response with indentations and line breaks. */ 'prettyPrint'?: boolean; @@ -1569,12 +1200,7 @@ declare namespace gapi.client { indexes: IndexesResource; } interface DocumentsResource { - /** - * Gets multiple documents. - * - * Documents returned by this method are not guaranteed to be returned in the - * same order that they were requested. - */ + /** Gets multiple documents. Documents returned by this method are not guaranteed to be returned in the same order that they were requested. */ batchGet(request: { /** V1 error format. */ '$.xgafv'?: string; @@ -1584,10 +1210,7 @@ declare namespace gapi.client { 'alt'?: string; /** JSONP */ 'callback'?: string; - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - */ + /** Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. */ 'database': string; /** Selector specifying which fields to include in a partial response. */ 'fields'?: string; @@ -1616,10 +1239,7 @@ declare namespace gapi.client { 'alt'?: string; /** JSONP */ 'callback'?: string; - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - */ + /** Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. */ 'database': string; /** Selector specifying which fields to include in a partial response. */ 'fields'?: string; @@ -1638,8 +1258,12 @@ declare namespace gapi.client { }, body: BatchGetDocumentsRequest ): Request; - /** Starts a new transaction. */ - beginTransaction(request: { + /** + * Applies a batch of write operations. The BatchWrite method does not apply the write operations atomically and can apply them out of order. Method does not allow more than one write + * per document. Each write succeeds or fails independently. See the BatchWriteResponse for the success status of each write. If you require an atomically applied set of writes, use + * Commit instead. + */ + batchWrite(request: { /** V1 error format. */ '$.xgafv'?: string; /** OAuth access token. */ @@ -1648,10 +1272,7 @@ declare namespace gapi.client { 'alt'?: string; /** JSONP */ 'callback'?: string; - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - */ + /** Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. */ 'database': string; /** Selector specifying which fields to include in a partial response. */ 'fields'?: string; @@ -1668,9 +1289,9 @@ declare namespace gapi.client { /** Legacy upload protocol for media (e.g. "media", "multipart"). */ 'uploadType'?: string; /** Request body */ - 'resource': BeginTransactionRequest; - }): Request; - beginTransaction( + 'resource': BatchWriteRequest; + }): Request; + batchWrite( request: { /** V1 error format. */ '$.xgafv'?: string; @@ -1680,10 +1301,7 @@ declare namespace gapi.client { 'alt'?: string; /** JSONP */ 'callback'?: string; - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - */ + /** Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. */ 'database': string; /** Selector specifying which fields to include in a partial response. */ 'fields'?: string; @@ -1700,10 +1318,10 @@ declare namespace gapi.client { /** Legacy upload protocol for media (e.g. "media", "multipart"). */ 'uploadType'?: string; }, - body: BeginTransactionRequest - ): Request; - /** Commits a transaction, while optionally updating documents. */ - commit(request: { + body: BatchWriteRequest + ): Request; + /** Starts a new transaction. */ + beginTransaction(request: { /** V1 error format. */ '$.xgafv'?: string; /** OAuth access token. */ @@ -1712,10 +1330,7 @@ declare namespace gapi.client { 'alt'?: string; /** JSONP */ 'callback'?: string; - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - */ + /** Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. */ 'database': string; /** Selector specifying which fields to include in a partial response. */ 'fields'?: string; @@ -1732,9 +1347,9 @@ declare namespace gapi.client { /** Legacy upload protocol for media (e.g. "media", "multipart"). */ 'uploadType'?: string; /** Request body */ - 'resource': CommitRequest; - }): Request; - commit( + 'resource': BeginTransactionRequest; + }): Request; + beginTransaction( request: { /** V1 error format. */ '$.xgafv'?: string; @@ -1744,10 +1359,7 @@ declare namespace gapi.client { 'alt'?: string; /** JSONP */ 'callback'?: string; - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - */ + /** Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. */ 'database': string; /** Selector specifying which fields to include in a partial response. */ 'fields'?: string; @@ -1764,12 +1376,70 @@ declare namespace gapi.client { /** Legacy upload protocol for media (e.g. "media", "multipart"). */ 'uploadType'?: string; }, - body: CommitRequest - ): Request; - /** Creates a new document. */ - createDocument(request: { - /** V1 error format. */ - '$.xgafv'?: string; + body: BeginTransactionRequest + ): Request; + /** Commits a transaction, while optionally updating documents. */ + commit(request: { + /** V1 error format. */ + '$.xgafv'?: string; + /** OAuth access token. */ + 'access_token'?: string; + /** Data format for response. */ + 'alt'?: string; + /** JSONP */ + 'callback'?: string; + /** Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. */ + 'database': string; + /** Selector specifying which fields to include in a partial response. */ + 'fields'?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + 'key'?: string; + /** OAuth 2.0 token for the current user. */ + 'oauth_token'?: string; + /** Returns response with indentations and line breaks. */ + 'prettyPrint'?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + 'quotaUser'?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + 'upload_protocol'?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + 'uploadType'?: string; + /** Request body */ + 'resource': CommitRequest; + }): Request; + commit( + request: { + /** V1 error format. */ + '$.xgafv'?: string; + /** OAuth access token. */ + 'access_token'?: string; + /** Data format for response. */ + 'alt'?: string; + /** JSONP */ + 'callback'?: string; + /** Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. */ + 'database': string; + /** Selector specifying which fields to include in a partial response. */ + 'fields'?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + 'key'?: string; + /** OAuth 2.0 token for the current user. */ + 'oauth_token'?: string; + /** Returns response with indentations and line breaks. */ + 'prettyPrint'?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + 'quotaUser'?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + 'upload_protocol'?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + 'uploadType'?: string; + }, + body: CommitRequest + ): Request; + /** Creates a new document. */ + createDocument(request: { + /** V1 error format. */ + '$.xgafv'?: string; /** OAuth access token. */ 'access_token'?: string; /** Data format for response. */ @@ -1778,26 +1448,18 @@ declare namespace gapi.client { 'callback'?: string; /** Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`. */ 'collectionId': string; - /** - * The client-assigned document ID to use for this document. - * - * Optional. If not specified, an ID will be assigned by the service. - */ + /** The client-assigned document ID to use for this document. Optional. If not specified, an ID will be assigned by the service. */ 'documentId'?: string; /** Selector specifying which fields to include in a partial response. */ 'fields'?: string; /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ 'key'?: string; - /** - * The list of field paths in the mask. See Document.fields for a field - * path syntax reference. - */ + /** The list of field paths in the mask. See Document.fields for a field path syntax reference. */ 'mask.fieldPaths'?: string | string[]; /** OAuth 2.0 token for the current user. */ 'oauth_token'?: string; /** - * Required. The parent resource. For example: - * `projects/{project_id}/databases/{database_id}/documents` or + * Required. The parent resource. For example: `projects/{project_id}/databases/{database_id}/documents` or * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` */ 'parent': string; @@ -1824,26 +1486,18 @@ declare namespace gapi.client { 'callback'?: string; /** Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`. */ 'collectionId': string; - /** - * The client-assigned document ID to use for this document. - * - * Optional. If not specified, an ID will be assigned by the service. - */ + /** The client-assigned document ID to use for this document. Optional. If not specified, an ID will be assigned by the service. */ 'documentId'?: string; /** Selector specifying which fields to include in a partial response. */ 'fields'?: string; /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ 'key'?: string; - /** - * The list of field paths in the mask. See Document.fields for a field - * path syntax reference. - */ + /** The list of field paths in the mask. See Document.fields for a field path syntax reference. */ 'mask.fieldPaths'?: string | string[]; /** OAuth 2.0 token for the current user. */ 'oauth_token'?: string; /** - * Required. The parent resource. For example: - * `projects/{project_id}/databases/{database_id}/documents` or + * Required. The parent resource. For example: `projects/{project_id}/databases/{database_id}/documents` or * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` */ 'parent': string; @@ -1868,24 +1522,15 @@ declare namespace gapi.client { 'alt'?: string; /** JSONP */ 'callback'?: string; - /** - * When set to `true`, the target document must exist. - * When set to `false`, the target document must not exist. - */ + /** When set to `true`, the target document must exist. When set to `false`, the target document must not exist. */ 'currentDocument.exists'?: boolean; - /** - * When set, the target document must exist and have been last updated at - * that time. - */ + /** When set, the target document must exist and have been last updated at that time. Timestamp must be microsecond aligned. */ 'currentDocument.updateTime'?: string; /** Selector specifying which fields to include in a partial response. */ 'fields'?: string; /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ 'key'?: string; - /** - * Required. The resource name of the Document to delete. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - */ + /** Required. The resource name of the Document to delete. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. */ 'name': string; /** OAuth 2.0 token for the current user. */ 'oauth_token'?: string; @@ -1912,15 +1557,9 @@ declare namespace gapi.client { 'fields'?: string; /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ 'key'?: string; - /** - * The list of field paths in the mask. See Document.fields for a field - * path syntax reference. - */ + /** The list of field paths in the mask. See Document.fields for a field path syntax reference. */ 'mask.fieldPaths'?: string | string[]; - /** - * Required. The resource name of the Document to get. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - */ + /** Required. The resource name of the Document to get. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. */ 'name': string; /** OAuth 2.0 token for the current user. */ 'oauth_token'?: string; @@ -1928,10 +1567,7 @@ declare namespace gapi.client { 'prettyPrint'?: boolean; /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ 'quotaUser'?: string; - /** - * Reads the version of the document at the given time. - * This may not be older than 270 seconds. - */ + /** Reads the version of the document at the given time. This may not be older than 270 seconds. */ 'readTime'?: string; /** Reads the document in a transaction. */ 'transaction'?: string; @@ -1950,19 +1586,13 @@ declare namespace gapi.client { 'alt'?: string; /** JSONP */ 'callback'?: string; - /** - * Required. The collection ID, relative to `parent`, to list. For example: `chatrooms` - * or `messages`. - */ + /** Required. The collection ID, relative to `parent`, to list. For example: `chatrooms` or `messages`. */ 'collectionId': string; /** Selector specifying which fields to include in a partial response. */ 'fields'?: string; /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ 'key'?: string; - /** - * The list of field paths in the mask. See Document.fields for a field - * path syntax reference. - */ + /** The list of field paths in the mask. See Document.fields for a field path syntax reference. */ 'mask.fieldPaths'?: string | string[]; /** OAuth 2.0 token for the current user. */ 'oauth_token'?: string; @@ -1973,11 +1603,8 @@ declare namespace gapi.client { /** The `next_page_token` value returned from a previous List request, if any. */ 'pageToken'?: string; /** - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or + * Required. The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: `projects/my-project/databases/my-database/documents` or * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` */ 'parent': string; @@ -1985,19 +1612,11 @@ declare namespace gapi.client { 'prettyPrint'?: boolean; /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ 'quotaUser'?: string; - /** - * Reads documents as they were at the given time. - * This may not be older than 270 seconds. - */ + /** Reads documents as they were at the given time. This may not be older than 270 seconds. */ 'readTime'?: string; /** - * If the list should show missing documents. A missing document is a - * document that does not exist but has sub-documents. These documents will - * be returned with a key but will not have fields, Document.create_time, - * or Document.update_time set. - * - * Requests with `show_missing` may not specify `where` or - * `order_by`. + * If the list should show missing documents. A missing document is a document that does not exist but has sub-documents. These documents will be returned with a key but will not + * have fields, Document.create_time, or Document.update_time set. Requests with `show_missing` may not specify `where` or `order_by`. */ 'showMissing'?: boolean; /** Reads documents in a transaction. */ @@ -2024,9 +1643,7 @@ declare namespace gapi.client { /** OAuth 2.0 token for the current user. */ 'oauth_token'?: string; /** - * Required. The parent document. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: + * Required. The parent document. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` */ 'parent': string; @@ -2058,9 +1675,7 @@ declare namespace gapi.client { /** OAuth 2.0 token for the current user. */ 'oauth_token'?: string; /** - * Required. The parent document. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: + * Required. The parent document. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` */ 'parent': string; @@ -2075,8 +1690,8 @@ declare namespace gapi.client { }, body: ListCollectionIdsRequest ): Request; - /** Listens to changes. */ - listen(request: { + /** Lists documents. */ + listDocuments(request?: { /** V1 error format. */ '$.xgafv'?: string; /** OAuth access token. */ @@ -2085,10 +1700,57 @@ declare namespace gapi.client { 'alt'?: string; /** JSONP */ 'callback'?: string; + /** Required. The collection ID, relative to `parent`, to list. For example: `chatrooms` or `messages`. */ + 'collectionId': string; + /** Selector specifying which fields to include in a partial response. */ + 'fields'?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + 'key'?: string; + /** The list of field paths in the mask. See Document.fields for a field path syntax reference. */ + 'mask.fieldPaths'?: string | string[]; + /** OAuth 2.0 token for the current user. */ + 'oauth_token'?: string; + /** The order to sort results by. For example: `priority desc, name`. */ + 'orderBy'?: string; + /** The maximum number of documents to return. */ + 'pageSize'?: number; + /** The `next_page_token` value returned from a previous List request, if any. */ + 'pageToken'?: string; /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. + * Required. The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` */ + 'parent': string; + /** Returns response with indentations and line breaks. */ + 'prettyPrint'?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + 'quotaUser'?: string; + /** Reads documents as they were at the given time. This may not be older than 270 seconds. */ + 'readTime'?: string; + /** + * If the list should show missing documents. A missing document is a document that does not exist but has sub-documents. These documents will be returned with a key but will not + * have fields, Document.create_time, or Document.update_time set. Requests with `show_missing` may not specify `where` or `order_by`. + */ + 'showMissing'?: boolean; + /** Reads documents in a transaction. */ + 'transaction'?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + 'upload_protocol'?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + 'uploadType'?: string; + }): Request; + /** Listens to changes. */ + listen(request: { + /** V1 error format. */ + '$.xgafv'?: string; + /** OAuth access token. */ + 'access_token'?: string; + /** Data format for response. */ + 'alt'?: string; + /** JSONP */ + 'callback'?: string; + /** Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. */ 'database': string; /** Selector specifying which fields to include in a partial response. */ 'fields'?: string; @@ -2117,10 +1779,7 @@ declare namespace gapi.client { 'alt'?: string; /** JSONP */ 'callback'?: string; - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - */ + /** Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. */ 'database': string; /** Selector specifying which fields to include in a partial response. */ 'fields'?: string; @@ -2139,8 +1798,11 @@ declare namespace gapi.client { }, body: ListenRequest ): Request; - /** Updates or inserts a document. */ - patch(request: { + /** + * Partitions a query by returning partition cursors that can be used to run the query in parallel. The returned partition cursors are split points that can be used by RunQuery as + * starting/end points for the query results. + */ + partitionQuery(request: { /** V1 error format. */ '$.xgafv'?: string; /** OAuth access token. */ @@ -2149,29 +1811,81 @@ declare namespace gapi.client { 'alt'?: string; /** JSONP */ 'callback'?: string; + /** Selector specifying which fields to include in a partial response. */ + 'fields'?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + 'key'?: string; + /** OAuth 2.0 token for the current user. */ + 'oauth_token'?: string; /** - * When set to `true`, the target document must exist. - * When set to `false`, the target document must not exist. + * Required. The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents`. Document resource names are not supported; only database resource + * names can be specified. */ + 'parent': string; + /** Returns response with indentations and line breaks. */ + 'prettyPrint'?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + 'quotaUser'?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + 'upload_protocol'?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + 'uploadType'?: string; + /** Request body */ + 'resource': PartitionQueryRequest; + }): Request; + partitionQuery( + request: { + /** V1 error format. */ + '$.xgafv'?: string; + /** OAuth access token. */ + 'access_token'?: string; + /** Data format for response. */ + 'alt'?: string; + /** JSONP */ + 'callback'?: string; + /** Selector specifying which fields to include in a partial response. */ + 'fields'?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + 'key'?: string; + /** OAuth 2.0 token for the current user. */ + 'oauth_token'?: string; + /** + * Required. The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents`. Document resource names are not supported; only database resource + * names can be specified. + */ + 'parent': string; + /** Returns response with indentations and line breaks. */ + 'prettyPrint'?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + 'quotaUser'?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + 'upload_protocol'?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + 'uploadType'?: string; + }, + body: PartitionQueryRequest + ): Request; + /** Updates or inserts a document. */ + patch(request: { + /** V1 error format. */ + '$.xgafv'?: string; + /** OAuth access token. */ + 'access_token'?: string; + /** Data format for response. */ + 'alt'?: string; + /** JSONP */ + 'callback'?: string; + /** When set to `true`, the target document must exist. When set to `false`, the target document must not exist. */ 'currentDocument.exists'?: boolean; - /** - * When set, the target document must exist and have been last updated at - * that time. - */ + /** When set, the target document must exist and have been last updated at that time. Timestamp must be microsecond aligned. */ 'currentDocument.updateTime'?: string; /** Selector specifying which fields to include in a partial response. */ 'fields'?: string; /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ 'key'?: string; - /** - * The list of field paths in the mask. See Document.fields for a field - * path syntax reference. - */ + /** The list of field paths in the mask. See Document.fields for a field path syntax reference. */ 'mask.fieldPaths'?: string | string[]; - /** - * The resource name of the document, for example - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - */ + /** The resource name of the document, for example `projects/{project_id}/databases/{database_id}/documents/{document_path}`. */ 'name': string; /** OAuth 2.0 token for the current user. */ 'oauth_token'?: string; @@ -2179,10 +1893,7 @@ declare namespace gapi.client { 'prettyPrint'?: boolean; /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ 'quotaUser'?: string; - /** - * The list of field paths in the mask. See Document.fields for a field - * path syntax reference. - */ + /** The list of field paths in the mask. See Document.fields for a field path syntax reference. */ 'updateMask.fieldPaths'?: string | string[]; /** Upload protocol for media (e.g. "raw", "multipart"). */ 'upload_protocol'?: string; @@ -2201,29 +1912,17 @@ declare namespace gapi.client { 'alt'?: string; /** JSONP */ 'callback'?: string; - /** - * When set to `true`, the target document must exist. - * When set to `false`, the target document must not exist. - */ + /** When set to `true`, the target document must exist. When set to `false`, the target document must not exist. */ 'currentDocument.exists'?: boolean; - /** - * When set, the target document must exist and have been last updated at - * that time. - */ + /** When set, the target document must exist and have been last updated at that time. Timestamp must be microsecond aligned. */ 'currentDocument.updateTime'?: string; /** Selector specifying which fields to include in a partial response. */ 'fields'?: string; /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ 'key'?: string; - /** - * The list of field paths in the mask. See Document.fields for a field - * path syntax reference. - */ + /** The list of field paths in the mask. See Document.fields for a field path syntax reference. */ 'mask.fieldPaths'?: string | string[]; - /** - * The resource name of the document, for example - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - */ + /** The resource name of the document, for example `projects/{project_id}/databases/{database_id}/documents/{document_path}`. */ 'name': string; /** OAuth 2.0 token for the current user. */ 'oauth_token'?: string; @@ -2231,10 +1930,7 @@ declare namespace gapi.client { 'prettyPrint'?: boolean; /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ 'quotaUser'?: string; - /** - * The list of field paths in the mask. See Document.fields for a field - * path syntax reference. - */ + /** The list of field paths in the mask. See Document.fields for a field path syntax reference. */ 'updateMask.fieldPaths'?: string | string[]; /** Upload protocol for media (e.g. "raw", "multipart"). */ 'upload_protocol'?: string; @@ -2253,10 +1949,7 @@ declare namespace gapi.client { 'alt'?: string; /** JSONP */ 'callback'?: string; - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - */ + /** Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. */ 'database': string; /** Selector specifying which fields to include in a partial response. */ 'fields'?: string; @@ -2285,10 +1978,7 @@ declare namespace gapi.client { 'alt'?: string; /** JSONP */ 'callback'?: string; - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - */ + /** Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. */ 'database': string; /** Selector specifying which fields to include in a partial response. */ 'fields'?: string; @@ -2307,6 +1997,75 @@ declare namespace gapi.client { }, body: RollbackRequest ): Request<{}>; + /** + * Runs an aggregation query. Rather than producing Document results like Firestore.RunQuery, this API allows running an aggregation to produce a series of AggregationResult + * server-side. High-Level Example: ``` -- Return the number of documents in table given a filter. SELECT COUNT(*) FROM ( SELECT * FROM k where a = true ); ``` + */ + runAggregationQuery(request: { + /** V1 error format. */ + '$.xgafv'?: string; + /** OAuth access token. */ + 'access_token'?: string; + /** Data format for response. */ + 'alt'?: string; + /** JSONP */ + 'callback'?: string; + /** Selector specifying which fields to include in a partial response. */ + 'fields'?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + 'key'?: string; + /** OAuth 2.0 token for the current user. */ + 'oauth_token'?: string; + /** + * Required. The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + */ + 'parent': string; + /** Returns response with indentations and line breaks. */ + 'prettyPrint'?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + 'quotaUser'?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + 'upload_protocol'?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + 'uploadType'?: string; + /** Request body */ + 'resource': RunAggregationQueryRequest; + }): Request; + runAggregationQuery( + request: { + /** V1 error format. */ + '$.xgafv'?: string; + /** OAuth access token. */ + 'access_token'?: string; + /** Data format for response. */ + 'alt'?: string; + /** JSONP */ + 'callback'?: string; + /** Selector specifying which fields to include in a partial response. */ + 'fields'?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + 'key'?: string; + /** OAuth 2.0 token for the current user. */ + 'oauth_token'?: string; + /** + * Required. The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + */ + 'parent': string; + /** Returns response with indentations and line breaks. */ + 'prettyPrint'?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + 'quotaUser'?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + 'upload_protocol'?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + 'uploadType'?: string; + }, + body: RunAggregationQueryRequest + ): Request; /** Runs a query. */ runQuery(request: { /** V1 error format. */ @@ -2324,11 +2083,8 @@ declare namespace gapi.client { /** OAuth 2.0 token for the current user. */ 'oauth_token'?: string; /** - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or + * Required. The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: `projects/my-project/databases/my-database/documents` or * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` */ 'parent': string; @@ -2360,11 +2116,8 @@ declare namespace gapi.client { /** OAuth 2.0 token for the current user. */ 'oauth_token'?: string; /** - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or + * Required. The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: `projects/my-project/databases/my-database/documents` or * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` */ 'parent': string; @@ -2389,11 +2142,7 @@ declare namespace gapi.client { 'alt'?: string; /** JSONP */ 'callback'?: string; - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * This is only required in the first message. - */ + /** Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. This is only required in the first message. */ 'database': string; /** Selector specifying which fields to include in a partial response. */ 'fields'?: string; @@ -2422,11 +2171,7 @@ declare namespace gapi.client { 'alt'?: string; /** JSONP */ 'callback'?: string; - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * This is only required in the first message. - */ + /** Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. This is only required in the first message. */ 'database': string; /** Selector specifying which fields to include in a partial response. */ 'fields'?: string; @@ -2448,16 +2193,10 @@ declare namespace gapi.client { } interface OperationsResource { /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * Operations.GetOperation or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an Operation.error value with a google.rpc.Status.code of 1, - * corresponding to `Code.CANCELLED`. + * Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support + * this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a + * google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. */ cancel(request: { /** V1 error format. */ @@ -2517,10 +2256,8 @@ declare namespace gapi.client { body: GoogleLongrunningCancelOperationRequest ): Request<{}>; /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. + * Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't + * support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. */ delete(request?: { /** V1 error format. */ @@ -2548,11 +2285,7 @@ declare namespace gapi.client { /** Legacy upload protocol for media (e.g. "media", "multipart"). */ 'uploadType'?: string; }): Request<{}>; - /** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - */ + /** Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. */ get(request?: { /** V1 error format. */ '$.xgafv'?: string; @@ -2580,16 +2313,10 @@ declare namespace gapi.client { 'uploadType'?: string; }): Request; /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. - * - * NOTE: the `name` binding allows API services to override the binding - * to use different resource name schemes, such as `users/*/operations`. To - * override the binding, API services can add a binding such as - * `"/v1/{name=users/*}/operations"` to their service configuration. - * For backwards compatibility, the default name includes the operations - * collection id, however overriding users must ensure the name binding - * is the parent resource, without the operations collection id. + * Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services + * to override the binding to use different resource name schemes, such as `users/*‍/operations`. To override the binding, API services can add a binding such as + * `"/v1/{name=users/*}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must + * ensure the name binding is the parent resource, without the operations collection id. */ list(request?: { /** V1 error format. */ @@ -2625,15 +2352,79 @@ declare namespace gapi.client { }): Request; } interface DatabasesResource { + /** Create a database. */ + create(request: { + /** V1 error format. */ + '$.xgafv'?: string; + /** OAuth access token. */ + 'access_token'?: string; + /** Data format for response. */ + 'alt'?: string; + /** JSONP */ + 'callback'?: string; + /** + * Required. The ID to use for the database, which will become the final component of the database's resource name. This value should be 4-63 characters. Valid characters are + * /a-z-/ with first character a letter and the last a letter or a number. Must not be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. "(default)" database id is also valid. + */ + 'databaseId'?: string; + /** Selector specifying which fields to include in a partial response. */ + 'fields'?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + 'key'?: string; + /** OAuth 2.0 token for the current user. */ + 'oauth_token'?: string; + /** Required. A parent name of the form `projects/{project_id}` */ + 'parent': string; + /** Returns response with indentations and line breaks. */ + 'prettyPrint'?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + 'quotaUser'?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + 'upload_protocol'?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + 'uploadType'?: string; + /** Request body */ + 'resource': GoogleFirestoreAdminV1Database; + }): Request; + create( + request: { + /** V1 error format. */ + '$.xgafv'?: string; + /** OAuth access token. */ + 'access_token'?: string; + /** Data format for response. */ + 'alt'?: string; + /** JSONP */ + 'callback'?: string; + /** + * Required. The ID to use for the database, which will become the final component of the database's resource name. This value should be 4-63 characters. Valid characters are + * /a-z-/ with first character a letter and the last a letter or a number. Must not be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. "(default)" database id is also valid. + */ + 'databaseId'?: string; + /** Selector specifying which fields to include in a partial response. */ + 'fields'?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + 'key'?: string; + /** OAuth 2.0 token for the current user. */ + 'oauth_token'?: string; + /** Required. A parent name of the form `projects/{project_id}` */ + 'parent': string; + /** Returns response with indentations and line breaks. */ + 'prettyPrint'?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + 'quotaUser'?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + 'upload_protocol'?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + 'uploadType'?: string; + }, + body: GoogleFirestoreAdminV1Database + ): Request; /** - * Exports a copy of all or a subset of documents from Google Cloud Firestore - * to another storage system, such as Google Cloud Storage. Recent updates to - * documents may not be reflected in the export. The export occurs in the - * background and its progress can be monitored and managed via the - * Operation resource that is created. The output of an export may only be - * used once the associated operation is done. If an export operation is - * cancelled before completion it may leave partial data behind in Google - * Cloud Storage. + * Exports a copy of all or a subset of documents from Google Cloud Firestore to another storage system, such as Google Cloud Storage. Recent updates to documents may not be reflected + * in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used + * once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage. For more details on export + * behavior and output format, refer to: https://cloud.google.com/firestore/docs/manage-data/export-import */ exportDocuments(request: { /** V1 error format. */ @@ -2648,10 +2439,7 @@ declare namespace gapi.client { 'fields'?: string; /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ 'key'?: string; - /** - * Required. Database to export. Should be of the form: - * `projects/{project_id}/databases/{database_id}`. - */ + /** Required. Database to export. Should be of the form: `projects/{project_id}/databases/{database_id}`. */ 'name': string; /** OAuth 2.0 token for the current user. */ 'oauth_token'?: string; @@ -2680,10 +2468,7 @@ declare namespace gapi.client { 'fields'?: string; /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ 'key'?: string; - /** - * Required. Database to export. Should be of the form: - * `projects/{project_id}/databases/{database_id}`. - */ + /** Required. Database to export. Should be of the form: `projects/{project_id}/databases/{database_id}`. */ 'name': string; /** OAuth 2.0 token for the current user. */ 'oauth_token'?: string; @@ -2698,12 +2483,37 @@ declare namespace gapi.client { }, body: GoogleFirestoreAdminV1ExportDocumentsRequest ): Request; + /** Gets information about a database. */ + get(request?: { + /** V1 error format. */ + '$.xgafv'?: string; + /** OAuth access token. */ + 'access_token'?: string; + /** Data format for response. */ + 'alt'?: string; + /** JSONP */ + 'callback'?: string; + /** Selector specifying which fields to include in a partial response. */ + 'fields'?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + 'key'?: string; + /** Required. A name of the form `projects/{project_id}/databases/{database_id}` */ + 'name': string; + /** OAuth 2.0 token for the current user. */ + 'oauth_token'?: string; + /** Returns response with indentations and line breaks. */ + 'prettyPrint'?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + 'quotaUser'?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + 'upload_protocol'?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + 'uploadType'?: string; + }): Request; /** - * Imports documents into Google Cloud Firestore. Existing documents with the - * same name are overwritten. The import occurs in the background and its - * progress can be monitored and managed via the Operation resource that is - * created. If an ImportDocuments operation is cancelled, it is possible - * that a subset of the data has already been imported to Cloud Firestore. + * Imports documents into Google Cloud Firestore. Existing documents with the same name are overwritten. The import occurs in the background and its progress can be monitored and + * managed via the Operation resource that is created. If an ImportDocuments operation is cancelled, it is possible that a subset of the data has already been imported to Cloud + * Firestore. */ importDocuments(request: { /** V1 error format. */ @@ -2718,10 +2528,7 @@ declare namespace gapi.client { 'fields'?: string; /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ 'key'?: string; - /** - * Required. Database to import into. Should be of the form: - * `projects/{project_id}/databases/{database_id}`. - */ + /** Required. Database to import into. Should be of the form: `projects/{project_id}/databases/{database_id}`. */ 'name': string; /** OAuth 2.0 token for the current user. */ 'oauth_token'?: string; @@ -2750,10 +2557,7 @@ declare namespace gapi.client { 'fields'?: string; /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ 'key'?: string; - /** - * Required. Database to import into. Should be of the form: - * `projects/{project_id}/databases/{database_id}`. - */ + /** Required. Database to import into. Should be of the form: `projects/{project_id}/databases/{database_id}`. */ 'name': string; /** OAuth 2.0 token for the current user. */ 'oauth_token'?: string; @@ -2768,6 +2572,95 @@ declare namespace gapi.client { }, body: GoogleFirestoreAdminV1ImportDocumentsRequest ): Request; + /** List all the databases in the project. */ + list(request?: { + /** V1 error format. */ + '$.xgafv'?: string; + /** OAuth access token. */ + 'access_token'?: string; + /** Data format for response. */ + 'alt'?: string; + /** JSONP */ + 'callback'?: string; + /** Selector specifying which fields to include in a partial response. */ + 'fields'?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + 'key'?: string; + /** OAuth 2.0 token for the current user. */ + 'oauth_token'?: string; + /** Required. A parent name of the form `projects/{project_id}` */ + 'parent': string; + /** Returns response with indentations and line breaks. */ + 'prettyPrint'?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + 'quotaUser'?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + 'upload_protocol'?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + 'uploadType'?: string; + }): Request; + /** Updates a database. */ + patch(request: { + /** V1 error format. */ + '$.xgafv'?: string; + /** OAuth access token. */ + 'access_token'?: string; + /** Data format for response. */ + 'alt'?: string; + /** JSONP */ + 'callback'?: string; + /** Selector specifying which fields to include in a partial response. */ + 'fields'?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + 'key'?: string; + /** The resource name of the Database. Format: `projects/{project}/databases/{database}` */ + 'name': string; + /** OAuth 2.0 token for the current user. */ + 'oauth_token'?: string; + /** Returns response with indentations and line breaks. */ + 'prettyPrint'?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + 'quotaUser'?: string; + /** The list of fields to be updated. */ + 'updateMask'?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + 'upload_protocol'?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + 'uploadType'?: string; + /** Request body */ + 'resource': GoogleFirestoreAdminV1Database; + }): Request; + patch( + request: { + /** V1 error format. */ + '$.xgafv'?: string; + /** OAuth access token. */ + 'access_token'?: string; + /** Data format for response. */ + 'alt'?: string; + /** JSONP */ + 'callback'?: string; + /** Selector specifying which fields to include in a partial response. */ + 'fields'?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + 'key'?: string; + /** The resource name of the Database. Format: `projects/{project}/databases/{database}` */ + 'name': string; + /** OAuth 2.0 token for the current user. */ + 'oauth_token'?: string; + /** Returns response with indentations and line breaks. */ + 'prettyPrint'?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + 'quotaUser'?: string; + /** The list of fields to be updated. */ + 'updateMask'?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + 'upload_protocol'?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + 'uploadType'?: string; + }, + body: GoogleFirestoreAdminV1Database + ): Request; collectionGroups: CollectionGroupsResource; documents: DocumentsResource; operations: OperationsResource; @@ -2812,7 +2705,10 @@ declare namespace gapi.client { 'callback'?: string; /** Selector specifying which fields to include in a partial response. */ 'fields'?: string; - /** The standard list filter. */ + /** + * A filter to narrow down results to a preferred subset. The filtering language accepts strings like `"displayName=tokyo"`, and is documented in more detail in + * [AIP-160](https://google.aip.dev/160). + */ 'filter'?: string; /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ 'key'?: string; @@ -2820,9 +2716,9 @@ declare namespace gapi.client { 'name': string; /** OAuth 2.0 token for the current user. */ 'oauth_token'?: string; - /** The standard list page size. */ + /** The maximum number of results to return. If not set, the service selects a default. */ 'pageSize'?: number; - /** The standard list page token. */ + /** A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page. */ 'pageToken'?: string; /** Returns response with indentations and line breaks. */ 'prettyPrint'?: boolean; diff --git a/typings/gapi.client.firestore/readme.md b/typings/gapi.client.firestore-v1/readme.md similarity index 61% rename from typings/gapi.client.firestore/readme.md rename to typings/gapi.client.firestore-v1/readme.md index 568cf71..2f8ff86 100644 --- a/typings/gapi.client.firestore/readme.md +++ b/typings/gapi.client.firestore-v1/readme.md @@ -1,7 +1,6 @@ # TypeScript typings for Cloud Firestore API v1 -Accesses the NoSQL document database built for automatic scaling, high performance, and ease of application development. - +Accesses the NoSQL document database built for automatic scaling, high performance, and ease of application development. For detailed description please check [documentation](https://cloud.google.com/firestore). ## Installing @@ -9,7 +8,7 @@ For detailed description please check [documentation](https://cloud.google.com/f Install typings for Cloud Firestore API: ``` -npm install @types/gapi.client.firestore@v1 --save-dev +npm install @types/gapi.client.firestore-v1 --save-dev ``` ## Usage @@ -26,9 +25,17 @@ gapi.load('client', () => { Then load api client wrapper: ```typescript +gapi.client.load('https://firestore.googleapis.com/$discovery/rest?version=v1', () => { + // now we can use: + // gapi.client.firestore +}); +``` + +```typescript +// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback-- gapi.client.load('firestore', 'v1', () => { - // now we can use gapi.client.firestore - // ... + // now we can use: + // gapi.client.firestore }); ``` @@ -37,8 +44,8 @@ Don't forget to authenticate your client before sending any request to resources ```typescript // declare client_id registered in Google Developers Console var client_id = '', - scope = [ - // View and manage your data across Google Cloud Platform services + scope = [ + // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. 'https://www.googleapis.com/auth/cloud-platform', // View and manage your Google Cloud Datastore data @@ -58,7 +65,7 @@ gapi.auth.authorize( }); ``` -After that you can use Cloud Firestore API resources: +After that you can use Cloud Firestore API resources: ```typescript ``` diff --git a/typings/gapi.client.firestore-v1/tests.ts b/typings/gapi.client.firestore-v1/tests.ts new file mode 100644 index 0000000..a51bb1a --- /dev/null +++ b/typings/gapi.client.firestore-v1/tests.ts @@ -0,0 +1,1767 @@ +/* This is stub file for gapi.client.firestore-v1 definition tests */ +// IMPORTANT +// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator + +// Revision: 20220915 + +gapi.load('client', async () => { + /** now we can use gapi.client */ + + await gapi.client.load('https://firestore.googleapis.com/$discovery/rest?version=v1'); + /** now we can use gapi.client.firestore */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View and manage your Google Cloud Datastore data */ + 'https://www.googleapis.com/auth/datastore', + ]; + const immediate = false; + gapi.auth.authorize({ client_id, scope, immediate }, (authResult) => { + if (authResult && !authResult.error) { + /** handle successful authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + + async function run() { + /** Create a database. */ + await gapi.client.firestore.projects.databases.create( + { + databaseId: 'Test string', + parent: 'Test string', + }, + { + appEngineIntegrationMode: 'Test string', + concurrencyMode: 'Test string', + etag: 'Test string', + keyPrefix: 'Test string', + locationId: 'Test string', + name: 'Test string', + type: 'Test string', + } + ); + /** + * Exports a copy of all or a subset of documents from Google Cloud Firestore to another storage system, such as Google Cloud Storage. Recent updates to documents may not be reflected in + * the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once + * the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage. For more details on export behavior and + * output format, refer to: https://cloud.google.com/firestore/docs/manage-data/export-import + */ + await gapi.client.firestore.projects.databases.exportDocuments( + { + name: 'Test string', + }, + { + collectionIds: ['Test string'], + outputUriPrefix: 'Test string', + } + ); + /** Gets information about a database. */ + await gapi.client.firestore.projects.databases.get({ + name: 'Test string', + }); + /** + * Imports documents into Google Cloud Firestore. Existing documents with the same name are overwritten. The import occurs in the background and its progress can be monitored and managed + * via the Operation resource that is created. If an ImportDocuments operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Firestore. + */ + await gapi.client.firestore.projects.databases.importDocuments( + { + name: 'Test string', + }, + { + collectionIds: ['Test string'], + inputUriPrefix: 'Test string', + } + ); + /** List all the databases in the project. */ + await gapi.client.firestore.projects.databases.list({ + parent: 'Test string', + }); + /** Updates a database. */ + await gapi.client.firestore.projects.databases.patch( + { + name: 'Test string', + updateMask: 'Test string', + }, + { + appEngineIntegrationMode: 'Test string', + concurrencyMode: 'Test string', + etag: 'Test string', + keyPrefix: 'Test string', + locationId: 'Test string', + name: 'Test string', + type: 'Test string', + } + ); + /** Gets the metadata and configuration for a Field. */ + await gapi.client.firestore.projects.databases.collectionGroups.fields.get({ + name: 'Test string', + }); + /** + * Lists the field configuration and metadata for this database. Currently, FirestoreAdmin.ListFields only supports listing fields that have been explicitly overridden. To issue this + * query, call FirestoreAdmin.ListFields with the filter set to `indexConfig.usesAncestorConfig:false` . + */ + await gapi.client.firestore.projects.databases.collectionGroups.fields.list({ + filter: 'Test string', + pageSize: 42, + pageToken: 'Test string', + parent: 'Test string', + }); + /** + * Updates a field configuration. Currently, field updates apply only to single field index configuration. However, calls to FirestoreAdmin.UpdateField should provide a field mask to avoid + * changing any configuration that the caller isn't aware of. The field mask should be specified as: `{ paths: "index_config" }`. This call returns a google.longrunning.Operation which may + * be used to track the status of the field update. The metadata for the operation will be the type FieldOperationMetadata. To configure the default field settings for the database, use + * the special `Field` with resource name: `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`. + */ + await gapi.client.firestore.projects.databases.collectionGroups.fields.patch( + { + name: 'Test string', + updateMask: 'Test string', + }, + { + indexConfig: { + ancestorField: 'Test string', + indexes: [ + { + fields: [ + { + arrayConfig: 'Test string', + fieldPath: 'Test string', + order: 'Test string', + }, + ], + name: 'Test string', + queryScope: 'Test string', + state: 'Test string', + }, + ], + reverting: true, + usesAncestorConfig: true, + }, + name: 'Test string', + ttlConfig: { + state: 'Test string', + }, + } + ); + /** + * Creates a composite index. This returns a google.longrunning.Operation which may be used to track the status of the creation. The metadata for the operation will be the type + * IndexOperationMetadata. + */ + await gapi.client.firestore.projects.databases.collectionGroups.indexes.create( + { + parent: 'Test string', + }, + { + fields: [ + { + arrayConfig: 'Test string', + fieldPath: 'Test string', + order: 'Test string', + }, + ], + name: 'Test string', + queryScope: 'Test string', + state: 'Test string', + } + ); + /** Deletes a composite index. */ + await gapi.client.firestore.projects.databases.collectionGroups.indexes.delete({ + name: 'Test string', + }); + /** Gets a composite index. */ + await gapi.client.firestore.projects.databases.collectionGroups.indexes.get({ + name: 'Test string', + }); + /** Lists composite indexes. */ + await gapi.client.firestore.projects.databases.collectionGroups.indexes.list({ + filter: 'Test string', + pageSize: 42, + pageToken: 'Test string', + parent: 'Test string', + }); + /** Gets multiple documents. Documents returned by this method are not guaranteed to be returned in the same order that they were requested. */ + await gapi.client.firestore.projects.databases.documents.batchGet( + { + database: 'Test string', + }, + { + documents: ['Test string'], + mask: { + fieldPaths: ['Test string'], + }, + newTransaction: { + readOnly: { + readTime: 'Test string', + }, + readWrite: { + retryTransaction: 'Test string', + }, + }, + readTime: 'Test string', + transaction: 'Test string', + } + ); + /** + * Applies a batch of write operations. The BatchWrite method does not apply the write operations atomically and can apply them out of order. Method does not allow more than one write per + * document. Each write succeeds or fails independently. See the BatchWriteResponse for the success status of each write. If you require an atomically applied set of writes, use Commit + * instead. + */ + await gapi.client.firestore.projects.databases.documents.batchWrite( + { + database: 'Test string', + }, + { + labels: { + A: 'Test string', + }, + writes: [ + { + currentDocument: { + exists: true, + updateTime: 'Test string', + }, + delete: 'Test string', + transform: { + document: 'Test string', + fieldTransforms: [ + { + appendMissingElements: { + values: [ + { + arrayValue: undefined, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + ], + }, + fieldPath: 'Test string', + increment: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + maximum: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + minimum: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + removeAllFromArray: { + values: [ + { + arrayValue: undefined, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + ], + }, + setToServerValue: 'Test string', + }, + ], + }, + update: { + createTime: 'Test string', + fields: { + A: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + }, + name: 'Test string', + updateTime: 'Test string', + }, + updateMask: { + fieldPaths: ['Test string'], + }, + updateTransforms: [ + { + appendMissingElements: { + values: [ + { + arrayValue: undefined, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + ], + }, + fieldPath: 'Test string', + increment: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + maximum: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + minimum: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + removeAllFromArray: { + values: [ + { + arrayValue: undefined, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + ], + }, + setToServerValue: 'Test string', + }, + ], + }, + ], + } + ); + /** Starts a new transaction. */ + await gapi.client.firestore.projects.databases.documents.beginTransaction( + { + database: 'Test string', + }, + { + options: { + readOnly: { + readTime: 'Test string', + }, + readWrite: { + retryTransaction: 'Test string', + }, + }, + } + ); + /** Commits a transaction, while optionally updating documents. */ + await gapi.client.firestore.projects.databases.documents.commit( + { + database: 'Test string', + }, + { + transaction: 'Test string', + writes: [ + { + currentDocument: { + exists: true, + updateTime: 'Test string', + }, + delete: 'Test string', + transform: { + document: 'Test string', + fieldTransforms: [ + { + appendMissingElements: { + values: [ + { + arrayValue: undefined, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + ], + }, + fieldPath: 'Test string', + increment: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + maximum: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + minimum: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + removeAllFromArray: { + values: [ + { + arrayValue: undefined, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + ], + }, + setToServerValue: 'Test string', + }, + ], + }, + update: { + createTime: 'Test string', + fields: { + A: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + }, + name: 'Test string', + updateTime: 'Test string', + }, + updateMask: { + fieldPaths: ['Test string'], + }, + updateTransforms: [ + { + appendMissingElements: { + values: [ + { + arrayValue: undefined, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + ], + }, + fieldPath: 'Test string', + increment: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + maximum: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + minimum: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + removeAllFromArray: { + values: [ + { + arrayValue: undefined, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + ], + }, + setToServerValue: 'Test string', + }, + ], + }, + ], + } + ); + /** Creates a new document. */ + await gapi.client.firestore.projects.databases.documents.createDocument( + { + 'collectionId': 'Test string', + 'documentId': 'Test string', + 'mask.fieldPaths': 'Test string', + 'parent': 'Test string', + }, + { + createTime: 'Test string', + fields: { + A: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + }, + name: 'Test string', + updateTime: 'Test string', + } + ); + /** Deletes a document. */ + await gapi.client.firestore.projects.databases.documents.delete({ + 'currentDocument.exists': true, + 'currentDocument.updateTime': 'Test string', + 'name': 'Test string', + }); + /** Gets a single document. */ + await gapi.client.firestore.projects.databases.documents.get({ + 'mask.fieldPaths': 'Test string', + 'name': 'Test string', + 'readTime': 'Test string', + 'transaction': 'Test string', + }); + /** Lists documents. */ + await gapi.client.firestore.projects.databases.documents.list({ + 'collectionId': 'Test string', + 'mask.fieldPaths': 'Test string', + 'orderBy': 'Test string', + 'pageSize': 42, + 'pageToken': 'Test string', + 'parent': 'Test string', + 'readTime': 'Test string', + 'showMissing': true, + 'transaction': 'Test string', + }); + /** Lists all the collection IDs underneath a document. */ + await gapi.client.firestore.projects.databases.documents.listCollectionIds( + { + parent: 'Test string', + }, + { + pageSize: 42, + pageToken: 'Test string', + readTime: 'Test string', + } + ); + /** Lists documents. */ + await gapi.client.firestore.projects.databases.documents.listDocuments({ + 'collectionId': 'Test string', + 'mask.fieldPaths': 'Test string', + 'orderBy': 'Test string', + 'pageSize': 42, + 'pageToken': 'Test string', + 'parent': 'Test string', + 'readTime': 'Test string', + 'showMissing': true, + 'transaction': 'Test string', + }); + /** Listens to changes. */ + await gapi.client.firestore.projects.databases.documents.listen( + { + database: 'Test string', + }, + { + addTarget: { + documents: { + documents: ['Test string'], + }, + once: true, + query: { + parent: 'Test string', + structuredQuery: { + endAt: { + before: true, + values: [ + { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + ], + }, + from: [ + { + allDescendants: true, + collectionId: 'Test string', + }, + ], + limit: 42, + offset: 42, + orderBy: [ + { + direction: 'Test string', + field: { + fieldPath: 'Test string', + }, + }, + ], + select: { + fields: [ + { + fieldPath: 'Test string', + }, + ], + }, + startAt: { + before: true, + values: [ + { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + ], + }, + where: { + compositeFilter: { + filters: undefined, + op: 'Test string', + }, + fieldFilter: { + field: { + fieldPath: 'Test string', + }, + op: 'Test string', + value: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + }, + unaryFilter: { + field: { + fieldPath: 'Test string', + }, + op: 'Test string', + }, + }, + }, + }, + readTime: 'Test string', + resumeToken: 'Test string', + targetId: 42, + }, + labels: { + A: 'Test string', + }, + removeTarget: 42, + } + ); + /** + * Partitions a query by returning partition cursors that can be used to run the query in parallel. The returned partition cursors are split points that can be used by RunQuery as + * starting/end points for the query results. + */ + await gapi.client.firestore.projects.databases.documents.partitionQuery( + { + parent: 'Test string', + }, + { + pageSize: 42, + pageToken: 'Test string', + partitionCount: 'Test string', + readTime: 'Test string', + structuredQuery: { + endAt: { + before: true, + values: [ + { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + ], + }, + from: [ + { + allDescendants: true, + collectionId: 'Test string', + }, + ], + limit: 42, + offset: 42, + orderBy: [ + { + direction: 'Test string', + field: { + fieldPath: 'Test string', + }, + }, + ], + select: { + fields: [ + { + fieldPath: 'Test string', + }, + ], + }, + startAt: { + before: true, + values: [ + { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + ], + }, + where: { + compositeFilter: { + filters: undefined, + op: 'Test string', + }, + fieldFilter: { + field: { + fieldPath: 'Test string', + }, + op: 'Test string', + value: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + }, + unaryFilter: { + field: { + fieldPath: 'Test string', + }, + op: 'Test string', + }, + }, + }, + } + ); + /** Updates or inserts a document. */ + await gapi.client.firestore.projects.databases.documents.patch( + { + 'currentDocument.exists': true, + 'currentDocument.updateTime': 'Test string', + 'mask.fieldPaths': 'Test string', + 'name': 'Test string', + 'updateMask.fieldPaths': 'Test string', + }, + { + createTime: 'Test string', + fields: { + A: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + }, + name: 'Test string', + updateTime: 'Test string', + } + ); + /** Rolls back a transaction. */ + await gapi.client.firestore.projects.databases.documents.rollback( + { + database: 'Test string', + }, + { + transaction: 'Test string', + } + ); + /** + * Runs an aggregation query. Rather than producing Document results like Firestore.RunQuery, this API allows running an aggregation to produce a series of AggregationResult server-side. + * High-Level Example: ``` -- Return the number of documents in table given a filter. SELECT COUNT(*) FROM ( SELECT * FROM k where a = true ); ``` + */ + await gapi.client.firestore.projects.databases.documents.runAggregationQuery( + { + parent: 'Test string', + }, + { + newTransaction: { + readOnly: { + readTime: 'Test string', + }, + readWrite: { + retryTransaction: 'Test string', + }, + }, + readTime: 'Test string', + structuredAggregationQuery: { + aggregations: [ + { + alias: 'Test string', + count: { + upTo: 'Test string', + }, + }, + ], + structuredQuery: { + endAt: { + before: true, + values: [ + { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + ], + }, + from: [ + { + allDescendants: true, + collectionId: 'Test string', + }, + ], + limit: 42, + offset: 42, + orderBy: [ + { + direction: 'Test string', + field: { + fieldPath: 'Test string', + }, + }, + ], + select: { + fields: [ + { + fieldPath: 'Test string', + }, + ], + }, + startAt: { + before: true, + values: [ + { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + ], + }, + where: { + compositeFilter: { + filters: undefined, + op: 'Test string', + }, + fieldFilter: { + field: { + fieldPath: 'Test string', + }, + op: 'Test string', + value: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + }, + unaryFilter: { + field: { + fieldPath: 'Test string', + }, + op: 'Test string', + }, + }, + }, + }, + transaction: 'Test string', + } + ); + /** Runs a query. */ + await gapi.client.firestore.projects.databases.documents.runQuery( + { + parent: 'Test string', + }, + { + newTransaction: { + readOnly: { + readTime: 'Test string', + }, + readWrite: { + retryTransaction: 'Test string', + }, + }, + readTime: 'Test string', + structuredQuery: { + endAt: { + before: true, + values: [ + { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + ], + }, + from: [ + { + allDescendants: true, + collectionId: 'Test string', + }, + ], + limit: 42, + offset: 42, + orderBy: [ + { + direction: 'Test string', + field: { + fieldPath: 'Test string', + }, + }, + ], + select: { + fields: [ + { + fieldPath: 'Test string', + }, + ], + }, + startAt: { + before: true, + values: [ + { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + ], + }, + where: { + compositeFilter: { + filters: undefined, + op: 'Test string', + }, + fieldFilter: { + field: { + fieldPath: 'Test string', + }, + op: 'Test string', + value: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + }, + unaryFilter: { + field: { + fieldPath: 'Test string', + }, + op: 'Test string', + }, + }, + }, + transaction: 'Test string', + } + ); + /** Streams batches of document updates and deletes, in order. */ + await gapi.client.firestore.projects.databases.documents.write( + { + database: 'Test string', + }, + { + labels: { + A: 'Test string', + }, + streamId: 'Test string', + streamToken: 'Test string', + writes: [ + { + currentDocument: { + exists: true, + updateTime: 'Test string', + }, + delete: 'Test string', + transform: { + document: 'Test string', + fieldTransforms: [ + { + appendMissingElements: { + values: [ + { + arrayValue: undefined, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + ], + }, + fieldPath: 'Test string', + increment: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + maximum: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + minimum: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + removeAllFromArray: { + values: [ + { + arrayValue: undefined, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + ], + }, + setToServerValue: 'Test string', + }, + ], + }, + update: { + createTime: 'Test string', + fields: { + A: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + }, + name: 'Test string', + updateTime: 'Test string', + }, + updateMask: { + fieldPaths: ['Test string'], + }, + updateTransforms: [ + { + appendMissingElements: { + values: [ + { + arrayValue: undefined, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + ], + }, + fieldPath: 'Test string', + increment: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + maximum: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + minimum: { + arrayValue: { + values: undefined, + }, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + removeAllFromArray: { + values: [ + { + arrayValue: undefined, + booleanValue: true, + bytesValue: 'Test string', + doubleValue: 42, + geoPointValue: { + latitude: 42, + longitude: 42, + }, + integerValue: 'Test string', + mapValue: { + fields: undefined, + }, + nullValue: 'Test string', + referenceValue: 'Test string', + stringValue: 'Test string', + timestampValue: 'Test string', + }, + ], + }, + setToServerValue: 'Test string', + }, + ], + }, + ], + } + ); + /** + * Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this + * method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation + * completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of + * 1, corresponding to `Code.CANCELLED`. + */ + await gapi.client.firestore.projects.databases.operations.cancel( + { + name: 'Test string', + }, + {} + ); + /** + * Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support + * this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + */ + await gapi.client.firestore.projects.databases.operations.delete({ + name: 'Test string', + }); + /** Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. */ + await gapi.client.firestore.projects.databases.operations.get({ + name: 'Test string', + }); + /** + * Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to + * override the binding to use different resource name schemes, such as `users/*‍/operations`. To override the binding, API services can add a binding such as + * `"/v1/{name=users/*}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must + * ensure the name binding is the parent resource, without the operations collection id. + */ + await gapi.client.firestore.projects.databases.operations.list({ + filter: 'Test string', + name: 'Test string', + pageSize: 42, + pageToken: 'Test string', + }); + /** Gets information about a location. */ + await gapi.client.firestore.projects.locations.get({ + name: 'Test string', + }); + /** Lists information about the supported locations for this service. */ + await gapi.client.firestore.projects.locations.list({ + filter: 'Test string', + name: 'Test string', + pageSize: 42, + pageToken: 'Test string', + }); + } +}); diff --git a/typings/gapi.client.firestore-v1/tsconfig.json b/typings/gapi.client.firestore-v1/tsconfig.json new file mode 100644 index 0000000..d554026 --- /dev/null +++ b/typings/gapi.client.firestore-v1/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": ["index.d.ts", "tests.ts"] +} diff --git a/typings/gapi.client.firestore-v1/tslint.json b/typings/gapi.client.firestore-v1/tslint.json new file mode 100644 index 0000000..1598764 --- /dev/null +++ b/typings/gapi.client.firestore-v1/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dtslint.json", + "rules": { + "no-redundant-jsdoc": false + } +} diff --git a/typings/gapi.client.firestore/gapi.client.firestore-tests.ts b/typings/gapi.client.firestore/gapi.client.firestore-tests.ts deleted file mode 100644 index 09c8125..0000000 --- a/typings/gapi.client.firestore/gapi.client.firestore-tests.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* This is stub file for gapi.client.firestore definition tests */ -/* IMPORTANT. - * This file was automatically generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually. - * In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator - **/ -gapi.load('client', () => { - // eslint-disable-next-line @typescript-eslint/no-empty-function - async function run(): Promise {} - - /** now we can use gapi.client */ - gapi.client.load('firestore', 'v1', () => { - /** now we can use gapi.client.firestore */ - - /** don't forget to authenticate your client before sending any request to resources: */ - /** declare client_id registered in Google Developers Console */ - const client_id = '<>'; - const scope = [ - /** View and manage your data across Google Cloud Platform services */ - 'https://www.googleapis.com/auth/cloud-platform', - /** View and manage your Google Cloud Datastore data */ - 'https://www.googleapis.com/auth/datastore', - ]; - const immediate = false; - gapi.auth.authorize({ client_id, scope, immediate }, (authResult) => { - if (authResult && !authResult.error) { - /** handle successful authorization */ - run(); - } else { - /** handle authorization error */ - } - }); - }); -}); diff --git a/typings/gapi.client.firestore/tsconfig.json b/typings/gapi.client.firestore/tsconfig.json deleted file mode 100644 index 0e7ac01..0000000 --- a/typings/gapi.client.firestore/tsconfig.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": ["es6", "dom"], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true, - "strictFunctionTypes": true - }, - "files": ["index.d.ts", "gapi.client.firestore-tests.ts"] -} diff --git a/typings/gapi.client.firestore/tslint.json b/typings/gapi.client.firestore/tslint.json deleted file mode 100644 index d88586e..0000000 --- a/typings/gapi.client.firestore/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "dtslint/dt.json" -}