Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,22 @@ jobs:
- name: Run googleapis_firestore tests with coverage
run: ${{ github.workspace }}/scripts/firestore-coverage.sh

- name: Run googleapis_storage tests with coverage
- name: Run google_cloud_storage tests with coverage
run: ${{ github.workspace }}/scripts/storage-coverage.sh

- name: Merge coverage reports
run: |
# Save individual package coverage files before merging
cp coverage.lcov coverage_admin.lcov
cp ../googleapis_firestore/coverage.lcov coverage_firestore.lcov
cp ../googleapis_storage/coverage.lcov coverage_storage.lcov
cp ../google_cloud_storage/coverage.lcov coverage_storage.lcov

# Merge coverage reports from all packages (relative to packages/dart_firebase_admin)
# Only merge files that exist
COVERAGE_FILES=""
[ -f coverage.lcov ] && COVERAGE_FILES="$COVERAGE_FILES coverage.lcov"
[ -f ../googleapis_firestore/coverage.lcov ] && COVERAGE_FILES="$COVERAGE_FILES ../googleapis_firestore/coverage.lcov"
[ -f ../googleapis_storage/coverage.lcov ] && COVERAGE_FILES="$COVERAGE_FILES ../googleapis_storage/coverage.lcov"
[ -f ../google_cloud_storage/coverage.lcov ] && COVERAGE_FILES="$COVERAGE_FILES ../google_cloud_storage/coverage.lcov"

if [ -n "$COVERAGE_FILES" ]; then
cat $COVERAGE_FILES > merged_coverage.lcov
Expand Down Expand Up @@ -220,7 +220,7 @@ jobs:
echo "=== Coverage Report ==="
echo "dart_firebase_admin: ${ADMIN_PCT}% (${ADMIN_HIT}/${ADMIN_TOTAL} lines)"
echo "googleapis_firestore: ${FIRESTORE_PCT}% (${FIRESTORE_HIT}/${FIRESTORE_TOTAL} lines)"
echo "googleapis_storage: ${STORAGE_PCT}% (${STORAGE_HIT}/${STORAGE_TOTAL} lines)"
echo "google_cloud_storage: ${STORAGE_PCT}% (${STORAGE_HIT}/${STORAGE_TOTAL} lines)"
echo "----------------------"
echo "Total: ${COVERAGE_PCT}% (${HIT_LINES}/${TOTAL_LINES} lines)"

Expand Down Expand Up @@ -257,7 +257,7 @@ jobs:
|---------|----------|
| dart_firebase_admin | ${adminCov}% |
| googleapis_firestore | ${firestoreCov}% |
| googleapis_storage | ${storageCov}% |
| google_cloud_storage | ${storageCov}% |

_Minimum threshold: 40%_`;

Expand Down
4 changes: 2 additions & 2 deletions doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ <h2>googleapis_firestore</h2>
</li>

<li class="package-item">
<h2>googleapis_storage</h2>
<h2>google_cloud_storage</h2>
<p>Standalone Cloud Storage client library for Dart. Provides access to bucket and file operations including uploads, downloads, signed URLs, HMAC keys, and metadata management.</p>
<a href="api/googleapis_storage/index.html">View Documentation →</a>
<a href="api/google_cloud_storage/index.html">View Documentation →</a>
</li>
</ul>
</body>
Expand Down
4 changes: 2 additions & 2 deletions packages/dart_firebase_admin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ await messaging.unsubscribeFromTopic(['<token-1>', '<token-2>'], 'news');

```dart
import 'package:dart_firebase_admin/dart_firebase_admin.dart';
import 'package:googleapis_storage/googleapis_storage.dart' hide Storage;
import 'package:google_cloud_storage/google_cloud_storage.dart' hide Storage;

final app = FirebaseApp.initializeApp();
final bucket = app.storage().bucket('<bucket-name>');
Expand Down Expand Up @@ -544,7 +544,7 @@ The Firebase Admin Dart SDK currently supports the following Firebase services:
Alongside the Firebase Admin Dart SDK, this repository contains additional workspace/pub.dev packages to accomodate the SDK:

- [googleapis_firestore](/packages/googleapis_firestore/): Standalone Google APIs Firestore SDK, which the Firebase SDK extends.
- [googleapis_storage](/packages/googleapis_storage/): Standalone Google APIs Storage SDK, which the Firebase SDK extends.
- [google_cloud_storage](/packages/google_cloud_storage/): Standalone Google APIs Storage SDK, which the Firebase SDK extends.

# Contributing

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:convert';
import 'package:dart_firebase_admin/dart_firebase_admin.dart';
import 'package:googleapis_storage/googleapis_storage.dart' hide Storage;
import 'package:google_cloud_storage/google_cloud_storage.dart' hide Storage;

Future<void> storageExample(FirebaseApp admin) async {
print('\n### Storage Example ###\n');
Expand Down
6 changes: 3 additions & 3 deletions packages/dart_firebase_admin/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ environment:

dependencies:
dart_firebase_admin: ^0.1.0
google_cloud_storage: ^0.1.0
googleapis_firestore: ^0.1.0
googleapis_storage: ^0.1.0

dependency_overrides:
dart_firebase_admin:
path: ../../dart_firebase_admin
google_cloud_storage:
path: ../../google_cloud_storage
googleapis_firestore:
path: ../../googleapis_firestore
googleapis_storage:
path: ../../googleapis_storage

12 changes: 6 additions & 6 deletions packages/dart_firebase_admin/lib/src/storage/storage.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:googleapis_storage/googleapis_storage.dart'
as googleapis_storage;
import 'package:google_cloud_storage/google_cloud_storage.dart'
as google_cloud_storage;
import 'package:meta/meta.dart';
import '../app.dart';

Expand All @@ -21,8 +21,8 @@ class Storage implements FirebaseService {
apiEndpoint = 'http://$emulatorHost';
}

_delegate = googleapis_storage.Storage(
googleapis_storage.StorageOptions(
_delegate = google_cloud_storage.Storage(
google_cloud_storage.StorageOptions(
authClient: isEmulator ? null : app.client,
apiEndpoint: apiEndpoint,
useAuthWithCustomEndpoint: false,
Expand All @@ -39,9 +39,9 @@ class Storage implements FirebaseService {
@override
final FirebaseApp app;

late final googleapis_storage.Storage _delegate;
late final google_cloud_storage.Storage _delegate;

googleapis_storage.Bucket bucket(String? name) {
google_cloud_storage.Bucket bucket(String? name) {
final bucketName = name ?? app.options.storageBucket;
if (bucketName == null || bucketName.isEmpty) {
throw FirebaseAppException(
Expand Down
2 changes: 1 addition & 1 deletion packages/dart_firebase_admin/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ dependencies:
dart_jsonwebtoken: ^3.0.0
equatable: ^2.0.7
google_cloud: ^0.3.0
google_cloud_storage: ^0.1.0
googleapis: ^15.0.0
googleapis_auth: ^2.1.0
googleapis_beta: ^9.0.0
googleapis_firestore: ^0.1.0
googleapis_storage: ^0.1.0
http: ^1.0.0
intl: ^0.20.0
jose: ^0.3.4
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:typed_data';

import 'package:dart_firebase_admin/src/app.dart';
import 'package:googleapis_storage/googleapis_storage.dart' as gcs;
import 'package:google_cloud_storage/google_cloud_storage.dart' as gcs;
import 'package:test/test.dart';

import '../helpers.dart';
Expand Down
6 changes: 3 additions & 3 deletions packages/dart_firebase_admin/test/storage/storage_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import 'dart:async';

import 'package:dart_firebase_admin/src/app.dart';
import 'package:dart_firebase_admin/src/storage/storage.dart';
import 'package:google_cloud_storage/google_cloud_storage.dart' as gcs;
import 'package:googleapis_auth/auth_io.dart' as auth;
import 'package:googleapis_storage/googleapis_storage.dart' as gcs;
import 'package:mocktail/mocktail.dart';
import 'package:test/test.dart';

Expand Down Expand Up @@ -358,14 +358,14 @@ void main() {
});

group('Integration with underlying Storage library', () {
test('should pass through to googleapis_storage correctly', () {
test('should pass through to google_cloud_storage correctly', () {
final storage = Storage.internal(appWithBucket);
final bucket = storage.bucket('integration-test-bucket');

expect(bucket, isA<gcs.Bucket>());
expect(bucket.name, 'integration-test-bucket');

// The bucket should be a valid googleapis_storage.Bucket instance
// The bucket should be a valid google_cloud_storage.Bucket instance
expect(bucket.storage, isNotNull);
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:googleapis_storage/googleapis_storage.dart';
import 'package:google_cloud_storage/google_cloud_storage.dart';

void main() async {
final storage = Storage(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:io' as io;

import 'package:googleapis_storage/googleapis_storage.dart';
import 'package:google_cloud_storage/google_cloud_storage.dart';

/// Example demonstrating resumable uploads with Google Cloud Storage.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import 'package:crypto/crypto.dart' as crypto;

import 'package:googleapis/storage/v1.dart' as storage_v1;
import 'package:googleapis_auth/auth_io.dart';
import 'package:googleapis_storage/src/internal/api_error.dart';
import 'package:googleapis_storage/src/internal/api.dart';
import 'package:googleapis_storage/src/internal/service.dart';
import 'package:google_cloud_storage/src/internal/api_error.dart';
import 'package:google_cloud_storage/src/internal/api.dart';
import 'package:google_cloud_storage/src/internal/service.dart';
import 'package:http/http.dart' as http;
import 'package:intl/intl.dart';
import 'package:meta/meta.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of '../googleapis_storage.dart';
part of '../google_cloud_storage.dart';

/// Team role within a project team, matching the Node SDK's team values.
enum ProjectTeamRole {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of '../googleapis_storage.dart';
part of '../google_cloud_storage.dart';

class Bucket extends ServiceObject<BucketMetadata>
with
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of '../googleapis_storage.dart';
part of '../google_cloud_storage.dart';

/// Create a channel object to interact with a Cloud Storage channel.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of '../googleapis_storage.dart';
part of '../google_cloud_storage.dart';

/// A validator interface for CRC32C hashing and validation, analogous to the
/// Node.js `CRC32CValidator`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:async';
import 'dart:io';

import '../googleapis_storage.dart';
import '../google_cloud_storage.dart';

/// Environment variable names used by Google Cloud Storage.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of '../googleapis_storage.dart';
part of '../google_cloud_storage.dart';

final _gsUtilUrlRegex = RegExp(r'^gs://([a-z0-9_.-]+)/(.+)$');
final _httpsPublicUrlRegex = RegExp(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of '../googleapis_storage.dart';
part of '../google_cloud_storage.dart';

/// Options for configuring a [HashStreamValidator].
class HashStreamValidatorOptions {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of '../googleapis_storage.dart';
part of '../google_cloud_storage.dart';

/// A handle to a single HMAC key, analogous to the Node.js HmacKey class.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of '../googleapis_storage.dart';
part of '../google_cloud_storage.dart';

class Iam {
final Bucket bucket;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'dart:convert';

import 'package:googleapis/storage/v1.dart';
import 'package:google_cloud/google_cloud.dart' as google_cloud;
import 'package:googleapis_storage/googleapis_storage.dart';
import 'package:google_cloud_storage/google_cloud_storage.dart';

/// Decide if an error should be retried, roughly mirroring Node's
/// Util.shouldRetryRequest (status codes + JSON error reasons).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:async';

import 'package:googleapis/storage/v1.dart' as storage_v1;
import 'package:googleapis_auth/auth_io.dart' as auth_io;
import 'package:googleapis_storage/googleapis_storage.dart';
import 'package:google_cloud_storage/google_cloud_storage.dart';
import 'package:http/http.dart' as http;
import 'emulator_client.dart';

Expand Down Expand Up @@ -221,7 +221,7 @@ abstract class Service<T extends ServiceOptions> {
// Map<String, String> buildHeaders([Map<String, String>? extra]) {
// final headers = <String, String>{
// HttpHeaders.userAgentHeader:
// userAgent ?? 'googleapis_storage/0.1.0 (dart)',
// userAgent ?? 'google_cloud_storage/0.1.0 (dart)',
// 'x-goog-api-client': 'gl-dart/3 gccl/0.1.0',
// };
// if (extra != null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:googleapis_storage/googleapis_storage.dart';
import 'package:google_cloud_storage/google_cloud_storage.dart';
import 'service.dart';

mixin CreatableMixin<M, T> on ServiceObject<M> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of '../googleapis_storage.dart';
part of '../google_cloud_storage.dart';

class Notification extends ServiceObject<NotificationMetadata>
with
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of '../googleapis_storage.dart';
part of '../google_cloud_storage.dart';

/// Configuration for a resumable upload.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of '../googleapis_storage.dart';
part of '../google_cloud_storage.dart';

class _InternalSignedUrlConfig {
final SignedUrlConfig signedConfig;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of '../googleapis_storage.dart';
part of '../google_cloud_storage.dart';

class StorageOptions extends ServiceOptions {
const StorageOptions({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of '../googleapis_storage.dart';
part of '../google_cloud_storage.dart';

// Constants
const _defaultParallelUploadLimit = 5;
Expand Down Expand Up @@ -78,7 +78,7 @@ class XMLMultiPartUploadHelper {
}

if (!userAgentFound) {
result['User-Agent'] = 'googleapis_storage/$packageVersion (dart)';
result['User-Agent'] = 'google_cloud_storage/$packageVersion (dart)';
}

return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'dart:io' as io;
import 'package:crypto/crypto.dart' as crypto;
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:googleapis/storage/v1.dart' as storage_v1;
import 'package:googleapis_storage/googleapis_storage.dart';
import 'package:google_cloud_storage/google_cloud_storage.dart';

part 'types.freezed.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: googleapis_storage
name: google_cloud_storage
resolution: workspace
description: Dart client for Gogole Cloud Storage - unified object storage for developers and enterprises, from live data serving to data analytics/ML to data archiving.
version: 0.1.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:io';

import 'package:googleapis_storage/googleapis_storage.dart' as storage;
import 'package:google_cloud_storage/google_cloud_storage.dart' as storage;

/// Whether Google Application Default Credentials are available.
/// Used to skip tests that require Google Cloud credentials.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:async';
import 'dart:convert';
import 'dart:io';

import 'package:googleapis_storage/googleapis_storage.dart';
import 'package:google_cloud_storage/google_cloud_storage.dart';
import 'package:test/test.dart';

import '../helpers.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';

import 'package:googleapis_storage/googleapis_storage.dart';
import 'package:google_cloud_storage/google_cloud_storage.dart';
import 'package:test/test.dart';

import '../helpers.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'dart:io';
import 'package:crypto/crypto.dart';
import 'package:googleapis/storage/v1.dart' as storage_v1;
import 'package:googleapis_auth/auth_io.dart' as auth;
import 'package:googleapis_storage/googleapis_storage.dart';
import 'package:google_cloud_storage/google_cloud_storage.dart';
import 'package:test/test.dart';

import 'storage.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:io';
import 'dart:async';
import 'package:googleapis_storage/googleapis_storage.dart';
import 'package:google_cloud_storage/google_cloud_storage.dart';
import 'package:test/test.dart';

import '../helpers.dart';
Expand Down
Loading
Loading