firebase-admin-edge 1.1.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +103 -260
- package/dist/app-check/app-check-endpoints.d.ts +31 -0
- package/dist/app-check/app-check-endpoints.d.ts.map +1 -0
- package/dist/app-check/app-check-endpoints.js +75 -0
- package/dist/app-check/app-check-endpoints.js.map +1 -0
- package/dist/app-check/app-check-jwt.d.ts +16 -0
- package/dist/app-check/app-check-jwt.d.ts.map +1 -0
- package/dist/app-check/app-check-jwt.js +59 -0
- package/dist/app-check/app-check-jwt.js.map +1 -0
- package/dist/app-check/app-check.d.ts +48 -0
- package/dist/app-check/app-check.d.ts.map +1 -0
- package/dist/app-check/app-check.js +142 -0
- package/dist/app-check/app-check.js.map +1 -0
- package/dist/auth/auth-blocking-types.d.ts +44 -0
- package/dist/auth/auth-blocking-types.d.ts.map +1 -0
- package/dist/auth/auth-blocking-types.js +2 -0
- package/dist/auth/auth-blocking-types.js.map +1 -0
- package/dist/auth/auth-config-types.d.ts +146 -0
- package/dist/auth/auth-config-types.d.ts.map +1 -0
- package/dist/auth/auth-config-types.js +2 -0
- package/dist/auth/auth-config-types.js.map +1 -0
- package/dist/auth/auth-config.d.ts +15 -0
- package/dist/auth/auth-config.d.ts.map +1 -0
- package/dist/auth/auth-config.js +413 -0
- package/dist/auth/auth-config.js.map +1 -0
- package/dist/auth/auth-emulator.d.ts +7 -0
- package/dist/auth/auth-emulator.d.ts.map +1 -0
- package/dist/auth/auth-emulator.js +24 -0
- package/dist/auth/auth-emulator.js.map +1 -0
- package/dist/auth/auth-endpoint-errors.d.ts +2 -0
- package/dist/auth/auth-endpoint-errors.d.ts.map +1 -1
- package/dist/auth/auth-endpoint-errors.js +20 -1
- package/dist/auth/auth-endpoint-errors.js.map +1 -1
- package/dist/auth/email-link.d.ts +24 -0
- package/dist/auth/email-link.d.ts.map +1 -0
- package/dist/auth/email-link.js +103 -0
- package/dist/auth/email-link.js.map +1 -0
- package/dist/auth/firebase-admin-auth.d.ts +56 -8
- package/dist/auth/firebase-admin-auth.d.ts.map +1 -1
- package/dist/auth/firebase-admin-auth.js +323 -63
- package/dist/auth/firebase-admin-auth.js.map +1 -1
- package/dist/auth/firebase-auth-endpoints.d.ts +93 -5
- package/dist/auth/firebase-auth-endpoints.d.ts.map +1 -1
- package/dist/auth/firebase-auth-endpoints.js +342 -73
- package/dist/auth/firebase-auth-endpoints.js.map +1 -1
- package/dist/auth/firebase-auth.d.ts +82 -6
- package/dist/auth/firebase-auth.d.ts.map +1 -1
- package/dist/auth/firebase-auth.js +103 -10
- package/dist/auth/firebase-auth.js.map +1 -1
- package/dist/auth/firebase-jwt.d.ts +19 -10
- package/dist/auth/firebase-jwt.d.ts.map +1 -1
- package/dist/auth/firebase-jwt.js +176 -39
- package/dist/auth/firebase-jwt.js.map +1 -1
- package/dist/auth/firebase-types.d.ts +3 -0
- package/dist/auth/firebase-types.d.ts.map +1 -1
- package/dist/auth/google-oauth.d.ts +0 -1
- package/dist/auth/google-oauth.d.ts.map +1 -1
- package/dist/auth/google-oauth.js +16 -86
- package/dist/auth/google-oauth.js.map +1 -1
- package/dist/auth/identity-builder-types.d.ts +36 -0
- package/dist/auth/identity-builder-types.d.ts.map +1 -0
- package/dist/auth/identity-builder-types.js +2 -0
- package/dist/auth/identity-builder-types.js.map +1 -0
- package/dist/auth/identity-count-query.d.ts +17 -0
- package/dist/auth/identity-count-query.d.ts.map +1 -0
- package/dist/auth/identity-count-query.js +51 -0
- package/dist/auth/identity-count-query.js.map +1 -0
- package/dist/auth/identity-filter.d.ts +9 -0
- package/dist/auth/identity-filter.d.ts.map +1 -0
- package/dist/auth/identity-filter.js +129 -0
- package/dist/auth/identity-filter.js.map +1 -0
- package/dist/auth/identity-query.d.ts +11 -0
- package/dist/auth/identity-query.d.ts.map +1 -0
- package/dist/auth/identity-query.js +122 -0
- package/dist/auth/identity-query.js.map +1 -0
- package/dist/auth/identity-reference.d.ts +131 -0
- package/dist/auth/identity-reference.d.ts.map +1 -0
- package/dist/auth/identity-reference.js +293 -0
- package/dist/auth/identity-reference.js.map +1 -0
- package/dist/auth/identity-types.d.ts +44 -0
- package/dist/auth/identity-types.d.ts.map +1 -0
- package/dist/auth/identity-types.js +2 -0
- package/dist/auth/identity-types.js.map +1 -0
- package/dist/auth/identity-write.d.ts +41 -0
- package/dist/auth/identity-write.d.ts.map +1 -0
- package/dist/auth/identity-write.js +146 -0
- package/dist/auth/identity-write.js.map +1 -0
- package/dist/auth/identity.d.ts +84 -0
- package/dist/auth/identity.d.ts.map +1 -0
- package/dist/auth/identity.js +319 -0
- package/dist/auth/identity.js.map +1 -0
- package/dist/auth/project-config-manager.d.ts +10 -0
- package/dist/auth/project-config-manager.d.ts.map +1 -0
- package/dist/auth/project-config-manager.js +22 -0
- package/dist/auth/project-config-manager.js.map +1 -0
- package/dist/auth/provider-credential.d.ts +43 -0
- package/dist/auth/provider-credential.d.ts.map +1 -0
- package/dist/auth/provider-credential.js +107 -0
- package/dist/auth/provider-credential.js.map +1 -0
- package/dist/auth/provider-session.d.ts +10 -0
- package/dist/auth/provider-session.d.ts.map +1 -0
- package/dist/auth/provider-session.js +28 -0
- package/dist/auth/provider-session.js.map +1 -0
- package/dist/auth/tenant-manager.d.ts +17 -0
- package/dist/auth/tenant-manager.d.ts.map +1 -0
- package/dist/auth/tenant-manager.js +59 -0
- package/dist/auth/tenant-manager.js.map +1 -0
- package/dist/auth/user-import.d.ts +7 -1
- package/dist/auth/user-import.d.ts.map +1 -1
- package/dist/auth/user-import.js +53 -15
- package/dist/auth/user-import.js.map +1 -1
- package/dist/auth/user-record.d.ts +1 -0
- package/dist/auth/user-record.d.ts.map +1 -1
- package/dist/auth/user-record.js +5 -0
- package/dist/auth/user-record.js.map +1 -1
- package/dist/auth/user-request.d.ts +4 -1
- package/dist/auth/user-request.d.ts.map +1 -1
- package/dist/auth/user-request.js +7 -4
- package/dist/auth/user-request.js.map +1 -1
- package/dist/db/aggregate.d.ts +49 -0
- package/dist/db/aggregate.d.ts.map +1 -0
- package/dist/db/aggregate.js +115 -0
- package/dist/db/aggregate.js.map +1 -0
- package/dist/db/bulk-writer.d.ts +55 -0
- package/dist/db/bulk-writer.d.ts.map +1 -0
- package/dist/db/bulk-writer.js +257 -0
- package/dist/db/bulk-writer.js.map +1 -0
- package/dist/db/bundle-builder.d.ts +17 -0
- package/dist/db/bundle-builder.d.ts.map +1 -0
- package/dist/db/bundle-builder.js +118 -0
- package/dist/db/bundle-builder.js.map +1 -0
- package/dist/db/bytes.d.ts +12 -0
- package/dist/db/bytes.d.ts.map +1 -0
- package/dist/db/bytes.js +49 -0
- package/dist/db/bytes.js.map +1 -0
- package/dist/db/collection-group.d.ts +14 -0
- package/dist/db/collection-group.d.ts.map +1 -0
- package/dist/db/collection-group.js +43 -0
- package/dist/db/collection-group.js.map +1 -0
- package/dist/db/collection-reference.d.ts +21 -0
- package/dist/db/collection-reference.d.ts.map +1 -0
- package/dist/db/collection-reference.js +46 -0
- package/dist/db/collection-reference.js.map +1 -0
- package/dist/db/document-reference.d.ts +41 -0
- package/dist/db/document-reference.d.ts.map +1 -0
- package/dist/db/document-reference.js +125 -0
- package/dist/db/document-reference.js.map +1 -0
- package/dist/db/document-snapshot.d.ts +31 -0
- package/dist/db/document-snapshot.d.ts.map +1 -0
- package/dist/db/document-snapshot.js +103 -0
- package/dist/db/document-snapshot.js.map +1 -0
- package/dist/db/explain.d.ts +28 -0
- package/dist/db/explain.d.ts.map +1 -0
- package/dist/db/explain.js +61 -0
- package/dist/db/explain.js.map +1 -0
- package/dist/db/field-path.d.ts +10 -0
- package/dist/db/field-path.d.ts.map +1 -0
- package/dist/db/field-path.js +65 -0
- package/dist/db/field-path.js.map +1 -0
- package/dist/db/field-value.d.ts +17 -0
- package/dist/db/field-value.d.ts.map +1 -0
- package/dist/db/field-value.js +57 -0
- package/dist/db/field-value.js.map +1 -0
- package/dist/db/filter.d.ts +20 -0
- package/dist/db/filter.d.ts.map +1 -0
- package/dist/db/filter.js +48 -0
- package/dist/db/filter.js.map +1 -0
- package/dist/db/firestore-converter.d.ts +11 -0
- package/dist/db/firestore-converter.d.ts.map +1 -0
- package/dist/db/firestore-converter.js +14 -0
- package/dist/db/firestore-converter.js.map +1 -0
- package/dist/db/firestore-document.d.ts +62 -0
- package/dist/db/firestore-document.d.ts.map +1 -0
- package/dist/db/firestore-document.js +238 -0
- package/dist/db/firestore-document.js.map +1 -0
- package/dist/db/firestore-endpoints.d.ts +41 -0
- package/dist/db/firestore-endpoints.d.ts.map +1 -0
- package/dist/db/firestore-endpoints.js +735 -0
- package/dist/db/firestore-endpoints.js.map +1 -0
- package/dist/db/firestore-error-codes.d.ts +24 -0
- package/dist/db/firestore-error-codes.d.ts.map +1 -0
- package/dist/db/firestore-error-codes.js +24 -0
- package/dist/db/firestore-error-codes.js.map +1 -0
- package/dist/db/firestore-logging.d.ts +23 -0
- package/dist/db/firestore-logging.d.ts.map +1 -0
- package/dist/db/firestore-logging.js +41 -0
- package/dist/db/firestore-logging.js.map +1 -0
- package/dist/db/firestore-path.d.ts +4 -0
- package/dist/db/firestore-path.d.ts.map +1 -0
- package/dist/db/firestore-path.js +37 -0
- package/dist/db/firestore-path.js.map +1 -0
- package/dist/db/firestore-results.d.ts +12 -0
- package/dist/db/firestore-results.d.ts.map +1 -0
- package/dist/db/firestore-results.js +19 -0
- package/dist/db/firestore-results.js.map +1 -0
- package/dist/db/firestore-settings.d.ts +22 -0
- package/dist/db/firestore-settings.d.ts.map +1 -0
- package/dist/db/firestore-settings.js +83 -0
- package/dist/db/firestore-settings.js.map +1 -0
- package/dist/db/firestore-telemetry.d.ts +21 -0
- package/dist/db/firestore-telemetry.d.ts.map +1 -0
- package/dist/db/firestore-telemetry.js +84 -0
- package/dist/db/firestore-telemetry.js.map +1 -0
- package/dist/db/firestore-types.d.ts +25 -0
- package/dist/db/firestore-types.d.ts.map +1 -0
- package/dist/db/firestore-types.js +2 -0
- package/dist/db/firestore-types.js.map +1 -0
- package/dist/db/firestore.d.ts +157 -0
- package/dist/db/firestore.d.ts.map +1 -0
- package/dist/db/firestore.js +513 -0
- package/dist/db/firestore.js.map +1 -0
- package/dist/db/geo-point.d.ts +11 -0
- package/dist/db/geo-point.d.ts.map +1 -0
- package/dist/db/geo-point.js +29 -0
- package/dist/db/geo-point.js.map +1 -0
- package/dist/db/json-stream.d.ts +3 -0
- package/dist/db/json-stream.d.ts.map +1 -0
- package/dist/db/json-stream.js +117 -0
- package/dist/db/json-stream.js.map +1 -0
- package/dist/db/pipeline-expression.d.ts +293 -0
- package/dist/db/pipeline-expression.d.ts.map +1 -0
- package/dist/db/pipeline-expression.js +1436 -0
- package/dist/db/pipeline-expression.js.map +1 -0
- package/dist/db/pipeline-query.d.ts +6 -0
- package/dist/db/pipeline-query.d.ts.map +1 -0
- package/dist/db/pipeline-query.js +91 -0
- package/dist/db/pipeline-query.js.map +1 -0
- package/dist/db/pipeline.d.ts +120 -0
- package/dist/db/pipeline.d.ts.map +1 -0
- package/dist/db/pipeline.js +396 -0
- package/dist/db/pipeline.js.map +1 -0
- package/dist/db/query-document-snapshot.d.ts +2 -0
- package/dist/db/query-document-snapshot.d.ts.map +1 -0
- package/dist/db/query-document-snapshot.js +2 -0
- package/dist/db/query-document-snapshot.js.map +1 -0
- package/dist/db/query-partition.d.ts +14 -0
- package/dist/db/query-partition.d.ts.map +1 -0
- package/dist/db/query-partition.js +32 -0
- package/dist/db/query-partition.js.map +1 -0
- package/dist/db/query-request.d.ts +96 -0
- package/dist/db/query-request.d.ts.map +1 -0
- package/dist/db/query-request.js +283 -0
- package/dist/db/query-request.js.map +1 -0
- package/dist/db/query.d.ts +129 -0
- package/dist/db/query.d.ts.map +1 -0
- package/dist/db/query.js +468 -0
- package/dist/db/query.js.map +1 -0
- package/dist/db/recursive-delete.d.ts +6 -0
- package/dist/db/recursive-delete.d.ts.map +1 -0
- package/dist/db/recursive-delete.js +38 -0
- package/dist/db/recursive-delete.js.map +1 -0
- package/dist/db/snapshot-listener.d.ts +10 -0
- package/dist/db/snapshot-listener.d.ts.map +1 -0
- package/dist/db/snapshot-listener.js +71 -0
- package/dist/db/snapshot-listener.js.map +1 -0
- package/dist/db/timestamp.d.ts +29 -0
- package/dist/db/timestamp.d.ts.map +1 -0
- package/dist/db/timestamp.js +98 -0
- package/dist/db/timestamp.js.map +1 -0
- package/dist/db/transaction.d.ts +44 -0
- package/dist/db/transaction.d.ts.map +1 -0
- package/dist/db/transaction.js +177 -0
- package/dist/db/transaction.js.map +1 -0
- package/dist/db/value-equality.d.ts +3 -0
- package/dist/db/value-equality.d.ts.map +1 -0
- package/dist/db/value-equality.js +29 -0
- package/dist/db/value-equality.js.map +1 -0
- package/dist/db/vector-query.d.ts +38 -0
- package/dist/db/vector-query.d.ts.map +1 -0
- package/dist/db/vector-query.js +110 -0
- package/dist/db/vector-query.js.map +1 -0
- package/dist/db/vector-value.d.ts +8 -0
- package/dist/db/vector-value.d.ts.map +1 -0
- package/dist/db/vector-value.js +25 -0
- package/dist/db/vector-value.js.map +1 -0
- package/dist/db/write-batch.d.ts +25 -0
- package/dist/db/write-batch.d.ts.map +1 -0
- package/dist/db/write-batch.js +72 -0
- package/dist/db/write-batch.js.map +1 -0
- package/dist/db/write-request.d.ts +36 -0
- package/dist/db/write-request.d.ts.map +1 -0
- package/dist/db/write-request.js +257 -0
- package/dist/db/write-request.js.map +1 -0
- package/dist/firebase-edge-server.d.ts +145 -36
- package/dist/firebase-edge-server.d.ts.map +1 -1
- package/dist/firebase-edge-server.js +495 -258
- package/dist/firebase-edge-server.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/rest-fetch.d.ts +1 -1
- package/dist/rest-fetch.d.ts.map +1 -1
- package/dist/storage/storage-acl.d.ts +48 -0
- package/dist/storage/storage-acl.d.ts.map +1 -0
- package/dist/storage/storage-acl.js +101 -0
- package/dist/storage/storage-acl.js.map +1 -0
- package/dist/storage/storage-bucket-endpoints.d.ts +10 -0
- package/dist/storage/storage-bucket-endpoints.d.ts.map +1 -0
- package/dist/storage/storage-bucket-endpoints.js +514 -0
- package/dist/storage/storage-bucket-endpoints.js.map +1 -0
- package/dist/storage/storage-bucket-types.d.ts +183 -0
- package/dist/storage/storage-bucket-types.d.ts.map +1 -0
- package/dist/storage/storage-bucket-types.js +2 -0
- package/dist/storage/storage-bucket-types.js.map +1 -0
- package/dist/storage/storage-bucket.d.ts +122 -0
- package/dist/storage/storage-bucket.d.ts.map +1 -0
- package/dist/storage/storage-bucket.js +544 -0
- package/dist/storage/storage-bucket.js.map +1 -0
- package/dist/storage/storage-channel.d.ts +10 -0
- package/dist/storage/storage-channel.d.ts.map +1 -0
- package/dist/storage/storage-channel.js +15 -0
- package/dist/storage/storage-channel.js.map +1 -0
- package/dist/storage/storage-checksum.d.ts +35 -0
- package/dist/storage/storage-checksum.d.ts.map +1 -0
- package/dist/storage/storage-checksum.js +312 -0
- package/dist/storage/storage-checksum.js.map +1 -0
- package/dist/storage/storage-endpoints.d.ts +14 -0
- package/dist/storage/storage-endpoints.d.ts.map +1 -0
- package/dist/storage/storage-endpoints.js +721 -0
- package/dist/storage/storage-endpoints.js.map +1 -0
- package/dist/storage/storage-file.d.ts +126 -0
- package/dist/storage/storage-file.d.ts.map +1 -0
- package/dist/storage/storage-file.js +604 -0
- package/dist/storage/storage-file.js.map +1 -0
- package/dist/storage/storage-hmac-key.d.ts +26 -0
- package/dist/storage/storage-hmac-key.d.ts.map +1 -0
- package/dist/storage/storage-hmac-key.js +45 -0
- package/dist/storage/storage-hmac-key.js.map +1 -0
- package/dist/storage/storage-iam.d.ts +20 -0
- package/dist/storage/storage-iam.d.ts.map +1 -0
- package/dist/storage/storage-iam.js +43 -0
- package/dist/storage/storage-iam.js.map +1 -0
- package/dist/storage/storage-md5.d.ts +11 -0
- package/dist/storage/storage-md5.d.ts.map +1 -0
- package/dist/storage/storage-md5.js +96 -0
- package/dist/storage/storage-md5.js.map +1 -0
- package/dist/storage/storage-notification.d.ts +24 -0
- package/dist/storage/storage-notification.d.ts.map +1 -0
- package/dist/storage/storage-notification.js +40 -0
- package/dist/storage/storage-notification.js.map +1 -0
- package/dist/storage/storage-progress.d.ts +4 -0
- package/dist/storage/storage-progress.d.ts.map +1 -0
- package/dist/storage/storage-progress.js +17 -0
- package/dist/storage/storage-progress.js.map +1 -0
- package/dist/storage/storage-reference-endpoints.d.ts +63 -0
- package/dist/storage/storage-reference-endpoints.d.ts.map +1 -0
- package/dist/storage/storage-reference-endpoints.js +276 -0
- package/dist/storage/storage-reference-endpoints.js.map +1 -0
- package/dist/storage/storage-reference-helpers.d.ts +12 -0
- package/dist/storage/storage-reference-helpers.d.ts.map +1 -0
- package/dist/storage/storage-reference-helpers.js +72 -0
- package/dist/storage/storage-reference-helpers.js.map +1 -0
- package/dist/storage/storage-reference-signing.d.ts +40 -0
- package/dist/storage/storage-reference-signing.d.ts.map +1 -0
- package/dist/storage/storage-reference-signing.js +289 -0
- package/dist/storage/storage-reference-signing.js.map +1 -0
- package/dist/storage/storage-reference-types.d.ts +76 -0
- package/dist/storage/storage-reference-types.d.ts.map +1 -0
- package/dist/storage/storage-reference-types.js +2 -0
- package/dist/storage/storage-reference-types.js.map +1 -0
- package/dist/storage/storage-results.d.ts +8 -0
- package/dist/storage/storage-results.d.ts.map +1 -0
- package/dist/storage/storage-results.js +32 -0
- package/dist/storage/storage-results.js.map +1 -0
- package/dist/storage/storage-resumable.d.ts +18 -0
- package/dist/storage/storage-resumable.d.ts.map +1 -0
- package/dist/storage/storage-resumable.js +166 -0
- package/dist/storage/storage-resumable.js.map +1 -0
- package/dist/storage/storage-retry.d.ts +9 -0
- package/dist/storage/storage-retry.d.ts.map +1 -0
- package/dist/storage/storage-retry.js +104 -0
- package/dist/storage/storage-retry.js.map +1 -0
- package/dist/storage/storage-signed-url.d.ts +9 -0
- package/dist/storage/storage-signed-url.d.ts.map +1 -0
- package/dist/storage/storage-signed-url.js +96 -0
- package/dist/storage/storage-signed-url.js.map +1 -0
- package/dist/storage/storage-special-endpoints.d.ts +10 -0
- package/dist/storage/storage-special-endpoints.d.ts.map +1 -0
- package/dist/storage/storage-special-endpoints.js +394 -0
- package/dist/storage/storage-special-endpoints.js.map +1 -0
- package/dist/storage/storage-special-types.d.ts +154 -0
- package/dist/storage/storage-special-types.d.ts.map +1 -0
- package/dist/storage/storage-special-types.js +2 -0
- package/dist/storage/storage-special-types.js.map +1 -0
- package/dist/storage/storage-types.d.ts +251 -0
- package/dist/storage/storage-types.d.ts.map +1 -0
- package/dist/storage/storage-types.js +2 -0
- package/dist/storage/storage-types.js.map +1 -0
- package/dist/storage/storage-upload-stream.d.ts +41 -0
- package/dist/storage/storage-upload-stream.d.ts.map +1 -0
- package/dist/storage/storage-upload-stream.js +335 -0
- package/dist/storage/storage-upload-stream.js.map +1 -0
- package/dist/storage/storage-xml-signing.d.ts +17 -0
- package/dist/storage/storage-xml-signing.d.ts.map +1 -0
- package/dist/storage/storage-xml-signing.js +144 -0
- package/dist/storage/storage-xml-signing.js.map +1 -0
- package/dist/storage/storage.d.ts +159 -0
- package/dist/storage/storage.d.ts.map +1 -0
- package/dist/storage/storage.js +545 -0
- package/dist/storage/storage.js.map +1 -0
- package/dist/utils/token-cache.d.ts.map +1 -1
- package/dist/utils/token-cache.js +3 -2
- package/dist/utils/token-cache.js.map +1 -1
- package/package.json +24 -8
- package/dist/auth/auth-endpoint-errors.test.d.ts +0 -2
- package/dist/auth/auth-endpoint-errors.test.d.ts.map +0 -1
- package/dist/auth/auth-endpoint-errors.test.js +0 -411
- package/dist/auth/auth-endpoint-errors.test.js.map +0 -1
- package/dist/auth/email-action-request.test.d.ts +0 -2
- package/dist/auth/email-action-request.test.d.ts.map +0 -1
- package/dist/auth/email-action-request.test.js +0 -128
- package/dist/auth/email-action-request.test.js.map +0 -1
- package/dist/auth/errors.test.d.ts +0 -2
- package/dist/auth/errors.test.d.ts.map +0 -1
- package/dist/auth/errors.test.js +0 -123
- package/dist/auth/errors.test.js.map +0 -1
- package/dist/auth/firebase-admin-auth.test.d.ts +0 -2
- package/dist/auth/firebase-admin-auth.test.d.ts.map +0 -1
- package/dist/auth/firebase-admin-auth.test.js +0 -1542
- package/dist/auth/firebase-admin-auth.test.js.map +0 -1
- package/dist/auth/firebase-auth-endpoints.test.d.ts +0 -2
- package/dist/auth/firebase-auth-endpoints.test.d.ts.map +0 -1
- package/dist/auth/firebase-auth-endpoints.test.js +0 -1082
- package/dist/auth/firebase-auth-endpoints.test.js.map +0 -1
- package/dist/auth/firebase-auth.test.d.ts +0 -2
- package/dist/auth/firebase-auth.test.d.ts.map +0 -1
- package/dist/auth/firebase-auth.test.js +0 -167
- package/dist/auth/firebase-auth.test.js.map +0 -1
- package/dist/auth/firebase-jwt.test.d.ts +0 -2
- package/dist/auth/firebase-jwt.test.d.ts.map +0 -1
- package/dist/auth/firebase-jwt.test.js +0 -164
- package/dist/auth/firebase-jwt.test.js.map +0 -1
- package/dist/auth/github-oauth.d.ts +0 -19
- package/dist/auth/github-oauth.d.ts.map +0 -1
- package/dist/auth/github-oauth.js +0 -145
- package/dist/auth/github-oauth.js.map +0 -1
- package/dist/auth/github-oauth.test.d.ts +0 -2
- package/dist/auth/github-oauth.test.d.ts.map +0 -1
- package/dist/auth/github-oauth.test.js +0 -202
- package/dist/auth/github-oauth.test.js.map +0 -1
- package/dist/auth/google-oauth.test.d.ts +0 -2
- package/dist/auth/google-oauth.test.d.ts.map +0 -1
- package/dist/auth/google-oauth.test.js +0 -200
- package/dist/auth/google-oauth.test.js.map +0 -1
- package/dist/auth/oauth.d.ts +0 -3
- package/dist/auth/oauth.d.ts.map +0 -1
- package/dist/auth/oauth.js +0 -48
- package/dist/auth/oauth.js.map +0 -1
- package/dist/auth/oauth.test.d.ts +0 -2
- package/dist/auth/oauth.test.d.ts.map +0 -1
- package/dist/auth/oauth.test.js +0 -109
- package/dist/auth/oauth.test.js.map +0 -1
- package/dist/auth/user-batch.test.d.ts +0 -2
- package/dist/auth/user-batch.test.d.ts.map +0 -1
- package/dist/auth/user-batch.test.js +0 -73
- package/dist/auth/user-batch.test.js.map +0 -1
- package/dist/auth/user-import.test.d.ts +0 -2
- package/dist/auth/user-import.test.d.ts.map +0 -1
- package/dist/auth/user-import.test.js +0 -217
- package/dist/auth/user-import.test.js.map +0 -1
- package/dist/auth/user-record.test.d.ts +0 -2
- package/dist/auth/user-record.test.d.ts.map +0 -1
- package/dist/auth/user-record.test.js +0 -198
- package/dist/auth/user-record.test.js.map +0 -1
- package/dist/auth/user-request.test.d.ts +0 -2
- package/dist/auth/user-request.test.d.ts.map +0 -1
- package/dist/auth/user-request.test.js +0 -327
- package/dist/auth/user-request.test.js.map +0 -1
- package/dist/firebase-edge-errors.test.d.ts +0 -2
- package/dist/firebase-edge-errors.test.d.ts.map +0 -1
- package/dist/firebase-edge-errors.test.js +0 -72
- package/dist/firebase-edge-errors.test.js.map +0 -1
- package/dist/firebase-edge-server.test.d.ts +0 -2
- package/dist/firebase-edge-server.test.d.ts.map +0 -1
- package/dist/firebase-edge-server.test.js +0 -293
- package/dist/firebase-edge-server.test.js.map +0 -1
- package/dist/rest-fetch.test.d.ts +0 -2
- package/dist/rest-fetch.test.d.ts.map +0 -1
- package/dist/rest-fetch.test.js +0 -164
- package/dist/rest-fetch.test.js.map +0 -1
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
import { firestoreResult, firestoreData } from './firestore-results.js';
|
|
2
|
+
import { traceFirestoreOperation } from './firestore-telemetry.js';
|
|
3
|
+
export { setLogFunction, GrpcStatus } from './firestore-logging.js';
|
|
4
|
+
import { PipelineSource } from './pipeline.js';
|
|
5
|
+
export * as Pipelines from './pipeline.js';
|
|
6
|
+
import { FirestoreErrorInfo } from './firestore-error-codes.js';
|
|
7
|
+
export { FirestoreErrorInfo } from './firestore-error-codes.js';
|
|
8
|
+
import { FirebaseEdgeError } from '../auth/errors.js';
|
|
9
|
+
import { getToken } from '../auth/google-oauth.js';
|
|
10
|
+
import { getDocument, executePipeline, streamPipeline, runQuery, createDocumentName, commitWrites, batchWrite, beginTransaction, rollbackTransaction, runAggregate, batchGetDocuments, listCollectionIds, listDocumentPaths, streamQuery, partitionQuery, configureFirestoreFetch, streamQueryRows } from './firestore-endpoints.js';
|
|
11
|
+
import { WriteBatch } from './write-batch.js';
|
|
12
|
+
import { Transaction } from './transaction.js';
|
|
13
|
+
import { BulkWriter } from './bulk-writer.js';
|
|
14
|
+
import { Timestamp } from './timestamp.js';
|
|
15
|
+
import { CollectionGroup } from './collection-group.js';
|
|
16
|
+
import { BundleBuilder } from './bundle-builder.js';
|
|
17
|
+
import { deleteRecursively } from './recursive-delete.js';
|
|
18
|
+
export { CollectionGroup } from './collection-group.js';
|
|
19
|
+
export { QueryPartition } from './query-partition.js';
|
|
20
|
+
export { BundleBuilder } from './bundle-builder.js';
|
|
21
|
+
import { DocumentSnapshot, QueryDocumentSnapshot } from './document-snapshot.js';
|
|
22
|
+
import { normalizeSnapshotDocument, normalizeSnapshotTimestamp } from './firestore-document.js';
|
|
23
|
+
import { validateFieldPath } from './query-request.js';
|
|
24
|
+
import { validateSettings } from './firestore-settings.js';
|
|
25
|
+
import { FieldPath } from './field-path.js';
|
|
26
|
+
import { CollectionReference } from './collection-reference.js';
|
|
27
|
+
import { DocumentReference } from './document-reference.js';
|
|
28
|
+
export { DocumentReference } from './document-reference.js';
|
|
29
|
+
export { CollectionReference } from './collection-reference.js';
|
|
30
|
+
export { Query, QuerySnapshot } from './query.js';
|
|
31
|
+
export { DocumentSnapshot } from './document-snapshot.js';
|
|
32
|
+
export { QueryDocumentSnapshot } from './query-document-snapshot.js';
|
|
33
|
+
export { WriteBatch } from './write-batch.js';
|
|
34
|
+
export { WriteResult } from './write-request.js';
|
|
35
|
+
export { Transaction } from './transaction.js';
|
|
36
|
+
export { BulkWriter, BulkWriterError } from './bulk-writer.js';
|
|
37
|
+
export { Timestamp } from './timestamp.js';
|
|
38
|
+
export { VectorValue } from './vector-value.js';
|
|
39
|
+
export { VectorQuery, VectorQuerySnapshot } from './vector-query.js';
|
|
40
|
+
export { GeoPoint } from './geo-point.js';
|
|
41
|
+
export { Bytes } from './bytes.js';
|
|
42
|
+
export { FieldPath } from './field-path.js';
|
|
43
|
+
export { FieldValue } from './field-value.js';
|
|
44
|
+
export { Filter } from './filter.js';
|
|
45
|
+
export { AggregateField, AggregateQuery, AggregateQuerySnapshot } from './aggregate.js';
|
|
46
|
+
/** Service-account Firestore operations for edge runtimes. */
|
|
47
|
+
export class Firestore {
|
|
48
|
+
serviceAccountKey;
|
|
49
|
+
_databaseId;
|
|
50
|
+
fetch;
|
|
51
|
+
cache;
|
|
52
|
+
cacheName;
|
|
53
|
+
telemetry;
|
|
54
|
+
/** @internal Share operation tracing across references, queries, and writes. */
|
|
55
|
+
_trace(name, operation) {
|
|
56
|
+
return traceFirestoreOperation(name, this.telemetry, operation);
|
|
57
|
+
}
|
|
58
|
+
/** @internal Pipeline streams participate in termination and cancellation. */
|
|
59
|
+
async *_streamPipeline(request, signal, readTime) {
|
|
60
|
+
this.assertActive();
|
|
61
|
+
const controller = new AbortController();
|
|
62
|
+
this.streams.add(controller);
|
|
63
|
+
const combined = AbortSignal.any([signal, controller.signal]);
|
|
64
|
+
try {
|
|
65
|
+
const token = await this.getCachedToken();
|
|
66
|
+
combined.throwIfAborted();
|
|
67
|
+
yield* streamPipeline(this.projectId, this.databaseId, request, token.access_token, this.fetch, combined, readTime);
|
|
68
|
+
}
|
|
69
|
+
finally {
|
|
70
|
+
this.streams.delete(controller);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
pipeline() {
|
|
74
|
+
this.assertActive();
|
|
75
|
+
return new PipelineSource(this);
|
|
76
|
+
}
|
|
77
|
+
/** @internal Coordinate authenticated pipeline execution. */
|
|
78
|
+
async _executePipeline(request, transaction, readTime) {
|
|
79
|
+
const token = await this.getCachedToken();
|
|
80
|
+
return executePipeline(this.projectId, this.databaseId, request, token.access_token, this.fetch, transaction, readTime);
|
|
81
|
+
}
|
|
82
|
+
snapshot_(documentOrName, readTime, encoding = 'protobufJS') {
|
|
83
|
+
if (encoding !== 'json' && encoding !== 'protobufJS')
|
|
84
|
+
throw new FirebaseEdgeError({
|
|
85
|
+
...FirestoreErrorInfo.INVALID_ARGUMENT,
|
|
86
|
+
message: 'Unsupported snapshot encoding. Expected json or protobufJS.'
|
|
87
|
+
});
|
|
88
|
+
this.assertActive();
|
|
89
|
+
const time = readTime === undefined
|
|
90
|
+
? Timestamp.now()
|
|
91
|
+
: normalizeSnapshotTimestamp(readTime, encoding);
|
|
92
|
+
if (typeof documentOrName === 'string')
|
|
93
|
+
return new DocumentSnapshot(this._reference(documentOrName), undefined, time);
|
|
94
|
+
const document = normalizeSnapshotDocument(documentOrName, encoding);
|
|
95
|
+
document.readTime = time.toString();
|
|
96
|
+
return new QueryDocumentSnapshot(this._reference(document.name), document);
|
|
97
|
+
}
|
|
98
|
+
referenceDatabases = new Map();
|
|
99
|
+
get projectId() {
|
|
100
|
+
return this.serviceAccountKey.project_id;
|
|
101
|
+
}
|
|
102
|
+
get databaseId() {
|
|
103
|
+
return this._databaseId;
|
|
104
|
+
}
|
|
105
|
+
/** @internal Serialization option. */
|
|
106
|
+
_useBigInt = false;
|
|
107
|
+
/** @internal Decode fully qualified references, including other databases. */
|
|
108
|
+
_reference(name) {
|
|
109
|
+
const match = /^projects\/([^/]+)\/databases\/([^/]+)\/documents\/(.+)$/.exec(name);
|
|
110
|
+
if (!match)
|
|
111
|
+
throw new FirebaseEdgeError({
|
|
112
|
+
...FirestoreErrorInfo.INVALID_RESPONSE,
|
|
113
|
+
message: 'Invalid document reference.'
|
|
114
|
+
});
|
|
115
|
+
const key = `${match[1]}/${match[2]}`;
|
|
116
|
+
const db = match[1] === this.projectId && match[2] === this.databaseId
|
|
117
|
+
? this
|
|
118
|
+
: (this.referenceDatabases.get(key) ??
|
|
119
|
+
new Firestore({ ...this.serviceAccountKey, project_id: match[1] }, {
|
|
120
|
+
databaseId: match[2],
|
|
121
|
+
fetch: this.fetch,
|
|
122
|
+
cache: this.cache,
|
|
123
|
+
cacheName: this.cacheName
|
|
124
|
+
}));
|
|
125
|
+
if (db !== this)
|
|
126
|
+
this.referenceDatabases.set(key, db);
|
|
127
|
+
db.telemetry = this.telemetry;
|
|
128
|
+
db._useBigInt = this._useBigInt;
|
|
129
|
+
db._ignoreUndefinedProperties = this._ignoreUndefinedProperties;
|
|
130
|
+
return db.documentReference(match[3]);
|
|
131
|
+
}
|
|
132
|
+
started = false;
|
|
133
|
+
configured = false;
|
|
134
|
+
terminated = false;
|
|
135
|
+
streams = new Set();
|
|
136
|
+
snapshotListeners = new Set();
|
|
137
|
+
/** @internal Register polling cleanup and return a deregistration function. */
|
|
138
|
+
_registerSnapshotListener(stop) {
|
|
139
|
+
this.assertActive();
|
|
140
|
+
this.snapshotListeners.add(stop);
|
|
141
|
+
return () => {
|
|
142
|
+
this.snapshotListeners.delete(stop);
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/** @internal Used by write serialization. */
|
|
146
|
+
_ignoreUndefinedProperties = false;
|
|
147
|
+
implicitOrderBy = false;
|
|
148
|
+
get alwaysUseImplicitOrderBy() {
|
|
149
|
+
return this.implicitOrderBy;
|
|
150
|
+
}
|
|
151
|
+
settings(settings) {
|
|
152
|
+
if (this.started || this.configured || this.terminated)
|
|
153
|
+
throw new FirebaseEdgeError({
|
|
154
|
+
...FirestoreErrorInfo.FAILED_PRECONDITION,
|
|
155
|
+
message: 'settings() must be called once, before using Firestore.'
|
|
156
|
+
});
|
|
157
|
+
validateSettings(settings);
|
|
158
|
+
const transport = settings.host !== undefined ||
|
|
159
|
+
settings.ssl !== undefined ||
|
|
160
|
+
settings.port !== undefined ||
|
|
161
|
+
settings.openTelemetry !== undefined
|
|
162
|
+
? configureFirestoreFetch(this.fetch ?? globalThis.fetch, settings.host ?? 'firestore.googleapis.com', settings.ssl, settings.port, settings.openTelemetry)
|
|
163
|
+
: this.fetch;
|
|
164
|
+
this.serviceAccountKey = {
|
|
165
|
+
...this.serviceAccountKey,
|
|
166
|
+
...settings.credentials,
|
|
167
|
+
...(settings.projectId ? { project_id: settings.projectId } : {})
|
|
168
|
+
};
|
|
169
|
+
this._databaseId = settings.databaseId ?? this._databaseId;
|
|
170
|
+
this.fetch = transport;
|
|
171
|
+
this.telemetry = settings.openTelemetry;
|
|
172
|
+
this._ignoreUndefinedProperties =
|
|
173
|
+
settings.ignoreUndefinedProperties ?? false;
|
|
174
|
+
this._useBigInt = settings.useBigInt ?? false;
|
|
175
|
+
this.implicitOrderBy = settings.alwaysUseImplicitOrderBy ?? false;
|
|
176
|
+
this.configured = true;
|
|
177
|
+
}
|
|
178
|
+
toJSON() {
|
|
179
|
+
return { projectId: this.serviceAccountKey.project_id };
|
|
180
|
+
}
|
|
181
|
+
async terminate() {
|
|
182
|
+
return firestoreResult(async () => {
|
|
183
|
+
this.terminated = true;
|
|
184
|
+
for (const stop of this.snapshotListeners) {
|
|
185
|
+
stop();
|
|
186
|
+
}
|
|
187
|
+
this.snapshotListeners.clear();
|
|
188
|
+
for (const controller of this.streams) {
|
|
189
|
+
controller.abort(new FirebaseEdgeError({
|
|
190
|
+
...FirestoreErrorInfo.FAILED_PRECONDITION,
|
|
191
|
+
message: 'Firestore has been terminated.'
|
|
192
|
+
}));
|
|
193
|
+
}
|
|
194
|
+
this.streams.clear();
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
bundle(name) {
|
|
198
|
+
this.assertActive();
|
|
199
|
+
return new BundleBuilder(name);
|
|
200
|
+
}
|
|
201
|
+
async recursiveDelete(ref, bulkWriter) {
|
|
202
|
+
return firestoreResult(async () => {
|
|
203
|
+
return this._trace('Firestore.recursiveDelete', async () => {
|
|
204
|
+
this.assertActive();
|
|
205
|
+
if (!(ref instanceof DocumentReference ||
|
|
206
|
+
ref instanceof CollectionReference) ||
|
|
207
|
+
ref.firestore !== this ||
|
|
208
|
+
(bulkWriter !== undefined &&
|
|
209
|
+
(!(bulkWriter instanceof BulkWriter) ||
|
|
210
|
+
bulkWriter.firestore !== this))) {
|
|
211
|
+
throw new FirebaseEdgeError({
|
|
212
|
+
...FirestoreErrorInfo.INVALID_ARGUMENT,
|
|
213
|
+
message: 'Reference and BulkWriter must belong to this Firestore instance.'
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
const writer = bulkWriter ?? this.bulkWriter();
|
|
217
|
+
try {
|
|
218
|
+
await deleteRecursively(ref, writer);
|
|
219
|
+
}
|
|
220
|
+
finally {
|
|
221
|
+
if (!bulkWriter) {
|
|
222
|
+
await writer.close().then(firestoreData);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
collectionGroup(collectionId) {
|
|
229
|
+
this.assertActive();
|
|
230
|
+
return new CollectionGroup(this, collectionId, (path, options) => this._query(path, options));
|
|
231
|
+
}
|
|
232
|
+
async getAll(...referencesOrOptions) {
|
|
233
|
+
return firestoreResult(async () => {
|
|
234
|
+
return this._trace('Firestore.getAll', async () => {
|
|
235
|
+
return this._getAll(referencesOrOptions);
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
/** @internal Shared bulk read validation for transactions. */
|
|
240
|
+
async _getAll(referencesOrOptions, transaction) {
|
|
241
|
+
const args = [...referencesOrOptions];
|
|
242
|
+
const last = args.at(-1);
|
|
243
|
+
const options = last && !(last instanceof DocumentReference)
|
|
244
|
+
? args.pop()
|
|
245
|
+
: undefined;
|
|
246
|
+
if (!args.length ||
|
|
247
|
+
args.some((ref) => !(ref instanceof DocumentReference) ||
|
|
248
|
+
ref.firestore !== this))
|
|
249
|
+
throw new FirebaseEdgeError({
|
|
250
|
+
...FirestoreErrorInfo.INVALID_ARGUMENT,
|
|
251
|
+
message: 'getAll requires document references belonging to this Firestore instance.'
|
|
252
|
+
});
|
|
253
|
+
if (options?.fieldMask !== undefined &&
|
|
254
|
+
!Array.isArray(options.fieldMask))
|
|
255
|
+
throw new FirebaseEdgeError({
|
|
256
|
+
...FirestoreErrorInfo.INVALID_ARGUMENT,
|
|
257
|
+
message: 'fieldMask must be an array.'
|
|
258
|
+
});
|
|
259
|
+
const fields = options?.fieldMask?.map((field) => {
|
|
260
|
+
if (!(field instanceof FieldPath))
|
|
261
|
+
validateFieldPath(field);
|
|
262
|
+
return field.toString();
|
|
263
|
+
});
|
|
264
|
+
const refs = args;
|
|
265
|
+
const token = await this.getCachedToken();
|
|
266
|
+
const readTime = Timestamp.now();
|
|
267
|
+
const documents = await batchGetDocuments(this.serviceAccountKey.project_id, this._databaseId, refs.map((ref) => ref.path), token.access_token, this.fetch, fields, ...(transaction ? [transaction] : []));
|
|
268
|
+
return refs.map((ref, index) => new DocumentSnapshot(ref, documents[index], documents.readTimes?.[index] ?? readTime));
|
|
269
|
+
}
|
|
270
|
+
listCollections() {
|
|
271
|
+
return firestoreResult(async () => {
|
|
272
|
+
return this._trace('Firestore.listCollections', async () => {
|
|
273
|
+
return this._listCollections('');
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
/** @internal */
|
|
278
|
+
async _listCollections(path) {
|
|
279
|
+
const token = await this.getCachedToken();
|
|
280
|
+
const ids = await listCollectionIds(this.serviceAccountKey.project_id, this._databaseId, path, token.access_token, this.fetch);
|
|
281
|
+
return ids.map((id) => this.collection(path ? `${path}/${id}` : id));
|
|
282
|
+
}
|
|
283
|
+
/** @internal */
|
|
284
|
+
async _listDocuments(path) {
|
|
285
|
+
const token = await this.getCachedToken();
|
|
286
|
+
return listDocumentPaths(this.serviceAccountKey.project_id, this._databaseId, path, token.access_token, this.fetch);
|
|
287
|
+
}
|
|
288
|
+
/** @internal */
|
|
289
|
+
async _query(path, options, transaction) {
|
|
290
|
+
const token = await this.getCachedToken();
|
|
291
|
+
return runQuery(this.serviceAccountKey.project_id, this._databaseId, path, options, token.access_token, this.fetch, ...(transaction ? [transaction] : []));
|
|
292
|
+
}
|
|
293
|
+
/** @internal */
|
|
294
|
+
async *_streamQuery(path, options, signal) {
|
|
295
|
+
this.assertActive();
|
|
296
|
+
const controller = new AbortController();
|
|
297
|
+
this.streams.add(controller);
|
|
298
|
+
const combined = AbortSignal.any([signal, controller.signal]);
|
|
299
|
+
try {
|
|
300
|
+
const token = await this.getCachedToken();
|
|
301
|
+
combined.throwIfAborted();
|
|
302
|
+
yield* streamQuery(this.serviceAccountKey.project_id, this._databaseId, path, options, token.access_token, this.fetch, combined);
|
|
303
|
+
}
|
|
304
|
+
finally {
|
|
305
|
+
this.streams.delete(controller);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
batch() {
|
|
309
|
+
this.assertActive();
|
|
310
|
+
return new WriteBatch(this, (writes) => this._commit(writes));
|
|
311
|
+
}
|
|
312
|
+
/** @internal Explain streams participate in termination and cancellation. */
|
|
313
|
+
async *_explainQuery(path, options, explain, signal) {
|
|
314
|
+
this.assertActive();
|
|
315
|
+
const controller = new AbortController();
|
|
316
|
+
const combined = AbortSignal.any([signal, controller.signal]);
|
|
317
|
+
this.streams.add(controller);
|
|
318
|
+
try {
|
|
319
|
+
const token = await this.getCachedToken();
|
|
320
|
+
combined.throwIfAborted();
|
|
321
|
+
yield* streamQueryRows(this.projectId, this.databaseId, path, options, token.access_token, this.fetch, combined, explain);
|
|
322
|
+
}
|
|
323
|
+
finally {
|
|
324
|
+
this.streams.delete(controller);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
bulkWriter(options) {
|
|
328
|
+
this.assertActive();
|
|
329
|
+
return new BulkWriter(this, options);
|
|
330
|
+
}
|
|
331
|
+
async runTransaction(updateFunction, options = {}) {
|
|
332
|
+
return firestoreResult(async () => {
|
|
333
|
+
return this._trace('Firestore.runTransaction', async () => {
|
|
334
|
+
if (!options ||
|
|
335
|
+
typeof options !== 'object' ||
|
|
336
|
+
Array.isArray(options) ||
|
|
337
|
+
(options.readOnly !== undefined &&
|
|
338
|
+
typeof options.readOnly !== 'boolean') ||
|
|
339
|
+
('readTime' in options &&
|
|
340
|
+
options.readTime !== undefined &&
|
|
341
|
+
(options.readOnly !== true ||
|
|
342
|
+
!(options.readTime instanceof Timestamp))) ||
|
|
343
|
+
(options.readOnly === true && 'maxAttempts' in options)) {
|
|
344
|
+
throw new FirebaseEdgeError({
|
|
345
|
+
...FirestoreErrorInfo.INVALID_ARGUMENT,
|
|
346
|
+
message: 'Invalid transaction options.'
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
const attempts = options.readOnly
|
|
350
|
+
? 1
|
|
351
|
+
: (options.maxAttempts ?? 5);
|
|
352
|
+
if (typeof updateFunction !== 'function' ||
|
|
353
|
+
!Number.isInteger(attempts) ||
|
|
354
|
+
attempts < 1) {
|
|
355
|
+
throw new FirebaseEdgeError({
|
|
356
|
+
...FirestoreErrorInfo.INVALID_ARGUMENT,
|
|
357
|
+
message: 'A transaction callback and positive maxAttempts are required.'
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
const token = await this.getCachedToken();
|
|
361
|
+
for (let attempt = 1;; attempt++) {
|
|
362
|
+
let id;
|
|
363
|
+
let transaction;
|
|
364
|
+
try {
|
|
365
|
+
id = await beginTransaction(this.serviceAccountKey.project_id, this._databaseId, token.access_token, this.fetch, ...(options.readOnly ? [options] : []));
|
|
366
|
+
const transactionId = id;
|
|
367
|
+
transaction = new Transaction(this, async (ref) => {
|
|
368
|
+
this.assertActive();
|
|
369
|
+
const document = await getDocument(this.serviceAccountKey.project_id, this._databaseId, ref.path, token.access_token, this.fetch, transactionId);
|
|
370
|
+
return new DocumentSnapshot(ref, document);
|
|
371
|
+
}, async (writes) => {
|
|
372
|
+
this.assertActive();
|
|
373
|
+
if (options.readOnly) {
|
|
374
|
+
await rollbackTransaction(this.serviceAccountKey.project_id, this._databaseId, transactionId, token.access_token, this.fetch);
|
|
375
|
+
return [];
|
|
376
|
+
}
|
|
377
|
+
return commitWrites(this.serviceAccountKey.project_id, this._databaseId, writes, token.access_token, this.fetch, transactionId);
|
|
378
|
+
}, options.readOnly, transactionId);
|
|
379
|
+
const result = await updateFunction(transaction);
|
|
380
|
+
await transaction._commit();
|
|
381
|
+
return result;
|
|
382
|
+
}
|
|
383
|
+
catch (error) {
|
|
384
|
+
transaction?._close();
|
|
385
|
+
try {
|
|
386
|
+
if (id) {
|
|
387
|
+
await rollbackTransaction(this.serviceAccountKey.project_id, this._databaseId, id, token.access_token, this.fetch);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
catch {
|
|
391
|
+
/* Preserve the original transaction failure. */
|
|
392
|
+
}
|
|
393
|
+
if (!([
|
|
394
|
+
'firestore/aborted',
|
|
395
|
+
'firestore/cancelled',
|
|
396
|
+
'firestore/unknown',
|
|
397
|
+
'firestore/deadline-exceeded',
|
|
398
|
+
'firestore/internal',
|
|
399
|
+
'firestore/unavailable',
|
|
400
|
+
'firestore/unauthenticated',
|
|
401
|
+
'firestore/resource-exhausted'
|
|
402
|
+
].includes(error?.code ?? '') ||
|
|
403
|
+
(error?.code ===
|
|
404
|
+
'firestore/invalid-argument' &&
|
|
405
|
+
error instanceof Error &&
|
|
406
|
+
/transaction has expired/.test(error.message))) ||
|
|
407
|
+
attempt >= attempts) {
|
|
408
|
+
throw error;
|
|
409
|
+
}
|
|
410
|
+
await new Promise((resolve) => setTimeout(resolve, Math.min(10 * 2 ** (attempt - 1), 1000)));
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
/** @internal */
|
|
417
|
+
_documentName(path) {
|
|
418
|
+
return createDocumentName(this.serviceAccountKey.project_id, this._databaseId, path);
|
|
419
|
+
}
|
|
420
|
+
/** @internal */
|
|
421
|
+
async _partitionQuery(collectionId, count) {
|
|
422
|
+
const token = await this.getCachedToken();
|
|
423
|
+
return partitionQuery(this.serviceAccountKey.project_id, this._databaseId, collectionId, count, token.access_token, this.fetch);
|
|
424
|
+
}
|
|
425
|
+
/** @internal */
|
|
426
|
+
async _batchWrite(writes) {
|
|
427
|
+
const token = await this.getCachedToken();
|
|
428
|
+
return batchWrite(this.serviceAccountKey.project_id, this._databaseId, writes, token.access_token, this.fetch);
|
|
429
|
+
}
|
|
430
|
+
/** @internal */
|
|
431
|
+
async _commit(writes) {
|
|
432
|
+
const token = await this.getCachedToken();
|
|
433
|
+
return commitWrites(this.serviceAccountKey.project_id, this._databaseId, writes, token.access_token, this.fetch);
|
|
434
|
+
}
|
|
435
|
+
/** @internal */
|
|
436
|
+
async _aggregate(path, options, spec, transaction, explain) {
|
|
437
|
+
const token = await this.getCachedToken();
|
|
438
|
+
return runAggregate(this.serviceAccountKey.project_id, this._databaseId, path, options, spec, token.access_token, this.fetch, ...(explain
|
|
439
|
+
? [transaction, explain]
|
|
440
|
+
: transaction
|
|
441
|
+
? [transaction]
|
|
442
|
+
: []));
|
|
443
|
+
}
|
|
444
|
+
constructor(serviceAccountKey, options = {}) {
|
|
445
|
+
this.serviceAccountKey = serviceAccountKey;
|
|
446
|
+
const { databaseId = '(default)', fetch, cache, cacheName = '__cache' } = options;
|
|
447
|
+
if (!serviceAccountKey?.project_id) {
|
|
448
|
+
throw new FirebaseEdgeError({
|
|
449
|
+
...FirestoreErrorInfo.INVALID_ARGUMENT,
|
|
450
|
+
message: 'A service account project_id is required.'
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
if (!databaseId || databaseId.includes('/')) {
|
|
454
|
+
throw new FirebaseEdgeError({
|
|
455
|
+
...FirestoreErrorInfo.INVALID_ARGUMENT,
|
|
456
|
+
message: 'A valid Firestore database ID is required.'
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
this._databaseId = databaseId;
|
|
460
|
+
this.fetch = fetch;
|
|
461
|
+
this.cache = cache;
|
|
462
|
+
this.cacheName = cacheName;
|
|
463
|
+
}
|
|
464
|
+
collection(path) {
|
|
465
|
+
this.assertActive();
|
|
466
|
+
return new CollectionReference(this, path, (collectionPath, options) => this._query(collectionPath, options));
|
|
467
|
+
}
|
|
468
|
+
doc(path) {
|
|
469
|
+
this.assertActive();
|
|
470
|
+
return this.documentReference(path);
|
|
471
|
+
}
|
|
472
|
+
documentReference(path) {
|
|
473
|
+
return new DocumentReference(this, path, async (documentPath) => {
|
|
474
|
+
const token = await this.getCachedToken();
|
|
475
|
+
return getDocument(this.serviceAccountKey.project_id, this._databaseId, documentPath, token.access_token, this.fetch);
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
async getCachedToken() {
|
|
479
|
+
this.assertActive();
|
|
480
|
+
const cacheKey = `${this.cacheName}:firestore:${this.serviceAccountKey.client_email}`;
|
|
481
|
+
const cached = await this.cache?.getCache(cacheKey);
|
|
482
|
+
this.assertActive();
|
|
483
|
+
if (cached?.access_token) {
|
|
484
|
+
return cached;
|
|
485
|
+
}
|
|
486
|
+
const { data, error } = await getToken(this.serviceAccountKey, this.fetch);
|
|
487
|
+
this.assertActive();
|
|
488
|
+
if (error) {
|
|
489
|
+
throw error;
|
|
490
|
+
}
|
|
491
|
+
if (!data?.access_token) {
|
|
492
|
+
throw new FirebaseEdgeError({
|
|
493
|
+
...FirestoreErrorInfo.UNAUTHENTICATED,
|
|
494
|
+
message: 'No service account access token returned.'
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
const ttlMs = (data.expires_in - 60) * 1000;
|
|
498
|
+
if (Number.isFinite(ttlMs) && ttlMs > 0) {
|
|
499
|
+
await this.cache?.setCache(cacheKey, data, ttlMs);
|
|
500
|
+
}
|
|
501
|
+
this.assertActive();
|
|
502
|
+
return data;
|
|
503
|
+
}
|
|
504
|
+
assertActive() {
|
|
505
|
+
if (this.terminated)
|
|
506
|
+
throw new FirebaseEdgeError({
|
|
507
|
+
...FirestoreErrorInfo.FAILED_PRECONDITION,
|
|
508
|
+
message: 'Firestore has been terminated.'
|
|
509
|
+
});
|
|
510
|
+
this.started = true;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
//# sourceMappingURL=firestore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firestore.js","sourceRoot":"","sources":["../../src/db/firestore.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,eAAe,EACf,aAAa,EAChB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAyB,MAAM,eAAe,CAAC;AACtE,OAAO,KAAK,SAAS,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAMtD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EACH,WAAW,EACX,eAAe,EACf,cAAc,EACd,QAAQ,EACR,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,uBAAuB,EACvB,eAAe,EAElB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAA0B,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB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E,CAAC;QACpB,OAAO,IAAI,CAAC;IAChB,CAAC;IACO,YAAY;QAChB,IAAI,IAAI,CAAC,UAAU;YACf,MAAM,IAAI,iBAAiB,CAAC;gBACxB,GAAG,kBAAkB,CAAC,mBAAmB;gBACzC,OAAO,EAAE,gCAAgC;aAC5C,CAAC,CAAC;QACP,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACxB,CAAC;CACJ"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class GeoPoint {
|
|
2
|
+
readonly latitude: number;
|
|
3
|
+
readonly longitude: number;
|
|
4
|
+
constructor(latitude: number, longitude: number);
|
|
5
|
+
isEqual(other: GeoPoint): boolean;
|
|
6
|
+
toJSON(): {
|
|
7
|
+
latitude: number;
|
|
8
|
+
longitude: number;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=geo-point.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geo-point.d.ts","sourceRoot":"","sources":["../../src/db/geo-point.ts"],"names":[],"mappings":"AAEA,qBAAa,QAAQ;IAEb,QAAQ,CAAC,QAAQ,EAAE,MAAM;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM;gBADjB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM;IAa9B,OAAO,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO;IAOjC,MAAM,IAAI;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE;CAGpD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { FirestoreErrorInfo } from './firestore-error-codes.js';
|
|
2
|
+
import { FirebaseEdgeError } from '../auth/errors.js';
|
|
3
|
+
export class GeoPoint {
|
|
4
|
+
latitude;
|
|
5
|
+
longitude;
|
|
6
|
+
constructor(latitude, longitude) {
|
|
7
|
+
this.latitude = latitude;
|
|
8
|
+
this.longitude = longitude;
|
|
9
|
+
if (!Number.isFinite(latitude) || latitude < -90 || latitude > 90)
|
|
10
|
+
throw new FirebaseEdgeError({
|
|
11
|
+
...FirestoreErrorInfo.INVALID_ARGUMENT,
|
|
12
|
+
message: 'Invalid latitude.'
|
|
13
|
+
});
|
|
14
|
+
if (!Number.isFinite(longitude) || longitude < -180 || longitude > 180)
|
|
15
|
+
throw new FirebaseEdgeError({
|
|
16
|
+
...FirestoreErrorInfo.INVALID_ARGUMENT,
|
|
17
|
+
message: 'Invalid longitude.'
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
isEqual(other) {
|
|
21
|
+
return (other instanceof GeoPoint &&
|
|
22
|
+
this.latitude === other.latitude &&
|
|
23
|
+
this.longitude === other.longitude);
|
|
24
|
+
}
|
|
25
|
+
toJSON() {
|
|
26
|
+
return { latitude: this.latitude, longitude: this.longitude };
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=geo-point.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geo-point.js","sourceRoot":"","sources":["../../src/db/geo-point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,MAAM,OAAO,QAAQ;IAEJ;IACA;IAFb,YACa,QAAgB,EAChB,SAAiB;QADjB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,cAAS,GAAT,SAAS,CAAQ;QAE1B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,QAAQ,GAAG,CAAC,EAAE,IAAI,QAAQ,GAAG,EAAE;YAC7D,MAAM,IAAI,iBAAiB,CAAC;gBACxB,GAAG,kBAAkB,CAAC,gBAAgB;gBACtC,OAAO,EAAE,mBAAmB;aAC/B,CAAC,CAAC;QACP,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,SAAS,GAAG,C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