From f18ca959ea55b17ba9fbe0ff4b4e62bfa2e80746 Mon Sep 17 00:00:00 2001 From: Jacob Cable Date: Thu, 30 Jul 2026 08:27:24 +0100 Subject: [PATCH 1/5] chore: backfill Apache license headers in ts/js files Claude-Session: https://claude.ai/code/session_013dz9GhC3metut6HFswPavu --- _emulator/functions/src/index.ts | 16 ++++++++++++++++ commitlint.config.js | 16 ++++++++++++++++ .../functions/__tests__/handleDelete.test.ts | 16 ++++++++++++++++ .../functions/__tests__/helpers.test.ts | 16 ++++++++++++++++ .../functions/__tests__/helpers/index.ts | 16 ++++++++++++++++ .../__tests__/helpers/setupEnvironment.ts | 16 ++++++++++++++++ .../functions/__tests__/recursiveDelete.test.ts | 16 ++++++++++++++++ .../__tests__/runBatchPubSubDeletions.test.ts | 16 ++++++++++++++++ .../functions/__tests__/search.test.ts | 16 ++++++++++++++++ .../functions/__tests__/searchFunction.test.ts | 16 ++++++++++++++++ .../functions/__tests__/setupTests.ts | 16 ++++++++++++++++ delete-user-data/functions/jest.config.js | 16 ++++++++++++++++ .../functions/src/recursiveDelete.ts | 16 ++++++++++++++++ .../functions/src/runBatchPubSubDeletions.ts | 16 ++++++++++++++++ .../functions/src/runCustomSearchFunction.ts | 16 ++++++++++++++++ delete-user-data/functions/src/search.ts | 16 ++++++++++++++++ delete-user-data/functions/src/types.ts | 16 ++++++++++++++++ .../jest.config.js | 16 ++++++++++++++++ .../bigquery/alternativeProject.test.ts | 16 ++++++++++++++++ .../src/__tests__/bigquery/checkUpdates.test.ts | 16 ++++++++++++++++ .../src/__tests__/bigquery/clustering.test.ts | 16 ++++++++++++++++ .../src/__tests__/bigquery/e2e.test.ts | 16 ++++++++++++++++ .../__tests__/bigquery/failedTransaction.test.ts | 16 ++++++++++++++++ .../initializeLatestMaterializedView.test.ts | 16 ++++++++++++++++ .../initializeLatestView.test.ts | 16 ++++++++++++++++ .../materializedViews/integration.test.ts | 16 ++++++++++++++++ .../shouldRecreateMaterializedView.test.ts | 16 ++++++++++++++++ .../src/__tests__/bigquery/partitioning.test.ts | 16 ++++++++++++++++ .../bigquery/partitioning/config.test.ts | 16 ++++++++++++++++ .../bigquery/partitioning/converter.test.ts | 16 ++++++++++++++++ .../src/__tests__/bigquery/stresstest.test.ts | 16 ++++++++++++++++ .../__tests__/bigquery/wildcardDocument.test.ts | 16 ++++++++++++++++ .../src/__tests__/fixtures/changeTracker.ts | 16 ++++++++++++++++ .../src/__tests__/fixtures/clearTables.ts | 16 ++++++++++++++++ .../src/__tests__/fixtures/queries.ts | 16 ++++++++++++++++ .../src/__tests__/logger.test.ts | 16 ++++++++++++++++ .../src/bigquery/checkUpdates.ts | 16 ++++++++++++++++ .../src/bigquery/clustering.ts | 16 ++++++++++++++++ .../src/bigquery/handleFailedTransactions.ts | 16 ++++++++++++++++ .../bigquery/initializeLatestMaterializedView.ts | 16 ++++++++++++++++ .../src/bigquery/initializeLatestView.ts | 16 ++++++++++++++++ .../src/bigquery/partitioning/config.ts | 16 ++++++++++++++++ .../src/bigquery/partitioning/converter.ts | 16 ++++++++++++++++ .../src/bigquery/partitioning/index.ts | 16 ++++++++++++++++ .../src/bigquery/types.ts | 16 ++++++++++++++++ .../src/bigquery/utils.test.ts | 16 ++++++++++++++++ .../src/bigquery/utils.ts | 16 ++++++++++++++++ .../src/bigquery/validateProject.ts | 16 ++++++++++++++++ .../src/types.ts | 16 ++++++++++++++++ .../functions/__tests__/__mocks__/console.ts | 16 ++++++++++++++++ .../functions/__tests__/__mocks__/firestore.ts | 16 ++++++++++++++++ .../functions/__tests__/config.test.ts | 16 ++++++++++++++++ .../functions/__tests__/e2e.test.ts | 16 ++++++++++++++++ .../functions/__tests__/fixtures/documentData.ts | 16 ++++++++++++++++ .../functions/__tests__/functions.test.ts | 16 ++++++++++++++++ .../functions/__tests__/jest.setup.ts | 16 ++++++++++++++++ .../functions/__tests__/test.types.d.ts | 16 ++++++++++++++++ .../functions/__tests__/util.test.ts | 16 ++++++++++++++++ .../big-query-table-test/install-script.js | 16 ++++++++++++++++ .../functions/jest.config.js | 16 ++++++++++++++++ .../functions/src/events.ts | 16 ++++++++++++++++ .../functions/stress_test/count.js | 16 ++++++++++++++++ .../functions/stress_test/main.js | 16 ++++++++++++++++ .../functions/stress_test/worker.js | 16 ++++++++++++++++ .../gen-schema-view/__mocks__/inquirer.js | 16 ++++++++++++++++ .../scripts/gen-schema-view/jest.config.js | 16 ++++++++++++++++ .../__tests__/bigquery/schema/extractors.test.ts | 16 ++++++++++++++++ .../bigquery/schema/processLeafField.test.ts | 16 ++++++++++++++++ .../src/__tests__/config/index.test.ts | 16 ++++++++++++++++ .../src/__tests__/config/interactive.test.ts | 16 ++++++++++++++++ .../src/__tests__/config/non-interactive.test.ts | 16 ++++++++++++++++ .../src/__tests__/e2e/helpers/setup.ts | 16 ++++++++++++++++ .../src/schema/processLeafField.ts | 16 ++++++++++++++++ .../scripts/import/__tests__/e2e.test.ts | 16 ++++++++++++++++ .../import/__tests__/getRowsFromDocs.test.ts | 16 ++++++++++++++++ .../scripts/import/__tests__/helpers/waitFor.ts | 16 ++++++++++++++++ .../multiThreadCollectionGroupBug.test.ts | 16 ++++++++++++++++ .../import/__tests__/runMultiThread.test.ts | 16 ++++++++++++++++ .../import/__tests__/runMultiThreadMock.test.ts | 16 ++++++++++++++++ .../scripts/import/__tests__/test.types.d.ts | 16 ++++++++++++++++ .../scripts/import/jest.config.js | 16 ++++++++++++++++ .../scripts/import/src/config.ts | 16 ++++++++++++++++ .../scripts/import/src/helper.ts | 16 ++++++++++++++++ .../scripts/import/src/logs.ts | 16 ++++++++++++++++ .../scripts/import/src/program.ts | 16 ++++++++++++++++ .../scripts/import/src/run-multi-thread.ts | 16 ++++++++++++++++ .../scripts/import/src/run-single-thread.ts | 16 ++++++++++++++++ .../scripts/import/src/types.ts | 16 ++++++++++++++++ .../scripts/import/src/worker.ts | 16 ++++++++++++++++ .../functions/__tests__/test.types.d.ts | 16 ++++++++++++++++ firestore-counter/functions/jest.config.js | 16 ++++++++++++++++ firestore-counter/functions/src/events.ts | 16 ++++++++++++++++ .../functions/__tests__/config.test.ts | 16 ++++++++++++++++ .../functions/__tests__/createSMTPServer.ts | 16 ++++++++++++++++ .../functions/__tests__/e2e.test.ts | 16 ++++++++++++++++ .../functions/__tests__/e2e/sendgrid.test.ts | 16 ++++++++++++++++ .../functions/__tests__/functions.test.ts | 16 ++++++++++++++++ .../functions/__tests__/helpers.test.ts | 16 ++++++++++++++++ .../functions/__tests__/jest.setup.ts | 16 ++++++++++++++++ .../__tests__/nodemailer-sendgrid/index.test.ts | 16 ++++++++++++++++ .../functions/__tests__/prepare-payload.test.ts | 16 ++++++++++++++++ .../functions/__tests__/test.types.d.ts | 16 ++++++++++++++++ .../functions/__tests__/validation.test.ts | 16 ++++++++++++++++ firestore-send-email/functions/jest.config.js | 16 ++++++++++++++++ firestore-send-email/functions/jest.teardown.js | 16 ++++++++++++++++ firestore-send-email/functions/src/events.ts | 16 ++++++++++++++++ firestore-send-email/functions/src/helpers.ts | 16 ++++++++++++++++ .../functions/src/nodemailer-sendgrid/index.ts | 16 ++++++++++++++++ .../functions/src/nodemailer-sendgrid/types.ts | 16 ++++++++++++++++ .../functions/src/prepare-payload.ts | 16 ++++++++++++++++ firestore-send-email/functions/src/types.ts | 16 ++++++++++++++++ firestore-send-email/functions/src/validation.ts | 16 ++++++++++++++++ .../scripts/oauth2-refresh-token-helper.js | 15 +++++++++++++++ .../functions/jest.config.js | 16 ++++++++++++++++ .../functions/src/events.ts | 16 ++++++++++++++++ .../functions/__tests__/config.test.ts | 16 ++++++++++++++++ .../functions/__tests__/functions.test.ts | 16 ++++++++++++++++ .../functions/__tests__/jest.setup.ts | 16 ++++++++++++++++ .../functions/__tests__/mocks/firestore.ts | 16 ++++++++++++++++ .../functions/__tests__/mocks/translate.ts | 16 ++++++++++++++++ .../functions/__tests__/test.types.d.ts | 16 ++++++++++++++++ .../unit/translateMultipleBackfill.test.ts | 16 ++++++++++++++++ .../functions/jest.config.js | 16 ++++++++++++++++ firestore-translate-text/functions/src/events.ts | 16 ++++++++++++++++ .../functions/src/logs/messages.ts | 16 ++++++++++++++++ .../functions/src/translate/common.ts | 16 ++++++++++++++++ .../functions/src/translate/index.ts | 16 ++++++++++++++++ .../functions/src/translate/translateDocument.ts | 16 ++++++++++++++++ .../functions/src/translate/translateMultiple.ts | 16 ++++++++++++++++ .../functions/src/translate/translateSingle.ts | 16 ++++++++++++++++ jest.config.js | 16 ++++++++++++++++ rtdb-limit-child-nodes/functions/jest.config.js | 16 ++++++++++++++++ .../rtdb-uppercase-messages/functions/index.js | 16 ++++++++++++++++ .../integration-tests/functions/index.js | 16 ++++++++++++++++ .../functions/__tests__/__mocks__/src/config.ts | 16 ++++++++++++++++ .../functions/__tests__/__mocks__/src/index.ts | 16 ++++++++++++++++ .../functions/__tests__/config.test.ts | 16 ++++++++++++++++ .../functions/__tests__/content-filter.test.ts | 16 ++++++++++++++++ .../functions/__tests__/convert-image.test.ts | 16 ++++++++++++++++ .../functions/__tests__/e2e.test.ts | 16 ++++++++++++++++ .../functions/__tests__/filters.test.ts | 16 ++++++++++++++++ .../functions/__tests__/function.test.ts | 16 ++++++++++++++++ .../integration/content-filter.live.test.ts | 16 ++++++++++++++++ .../functions/__tests__/resize.test.ts | 16 ++++++++++++++++ .../functions/__tests__/retry-queue.test.ts | 16 ++++++++++++++++ .../functions/__tests__/test.types.d.ts | 16 ++++++++++++++++ .../unit/generateResizedImageHandler.test.ts | 16 ++++++++++++++++ .../functions/__tests__/unit/modifyImage.test.ts | 16 ++++++++++++++++ .../functions/__tests__/util.test.ts | 16 ++++++++++++++++ .../functions/__tests__/util.ts | 16 ++++++++++++++++ .../functions/__tests__/vulnerability.test.ts | 16 ++++++++++++++++ storage-resize-images/functions/jest.config.js | 16 ++++++++++++++++ .../functions/src/content-filter.ts | 16 ++++++++++++++++ storage-resize-images/functions/src/events.ts | 16 ++++++++++++++++ .../functions/src/file-operations.ts | 16 ++++++++++++++++ storage-resize-images/functions/src/filters.ts | 16 ++++++++++++++++ storage-resize-images/functions/src/global.ts | 16 ++++++++++++++++ .../functions/src/placeholder.ts | 16 ++++++++++++++++ .../functions/src/resize-image.ts | 16 ++++++++++++++++ storage-resize-images/functions/src/util.ts | 16 ++++++++++++++++ 160 files changed, 2559 insertions(+) diff --git a/_emulator/functions/src/index.ts b/_emulator/functions/src/index.ts index 65c48daafe..ed8e351c82 100644 --- a/_emulator/functions/src/index.ts +++ b/_emulator/functions/src/index.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as functions from "firebase-functions"; export const findDocumentReferences = functions.https.onRequest( diff --git a/commitlint.config.js b/commitlint.config.js index 5073c20db1..49a815ebbf 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1 +1,17 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + module.exports = { extends: ["@commitlint/config-conventional"] }; diff --git a/delete-user-data/functions/__tests__/handleDelete.test.ts b/delete-user-data/functions/__tests__/handleDelete.test.ts index a2963eb406..f9c7891f90 100644 --- a/delete-user-data/functions/__tests__/handleDelete.test.ts +++ b/delete-user-data/functions/__tests__/handleDelete.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { handleDeletion } from "../src"; import * as admin from "firebase-admin"; // Import Firebase admin to mock Firestore import firebaseFunctionsTest from "firebase-functions-test"; diff --git a/delete-user-data/functions/__tests__/helpers.test.ts b/delete-user-data/functions/__tests__/helpers.test.ts index 659d2ec666..e88d793a75 100644 --- a/delete-user-data/functions/__tests__/helpers.test.ts +++ b/delete-user-data/functions/__tests__/helpers.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as admin from "firebase-admin"; import { UserRecord } from "firebase-functions/v1/auth"; import setupEnvironment from "./helpers/setupEnvironment"; diff --git a/delete-user-data/functions/__tests__/helpers/index.ts b/delete-user-data/functions/__tests__/helpers/index.ts index 803bd3b892..2afbaff77b 100644 --- a/delete-user-data/functions/__tests__/helpers/index.ts +++ b/delete-user-data/functions/__tests__/helpers/index.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as admin from "firebase-admin"; import { UserRecord } from "firebase-functions/v1/auth"; import { Query, DocumentData } from "@google-cloud/firestore"; diff --git a/delete-user-data/functions/__tests__/helpers/setupEnvironment.ts b/delete-user-data/functions/__tests__/helpers/setupEnvironment.ts index 9dc56810ab..db9d1ad361 100644 --- a/delete-user-data/functions/__tests__/helpers/setupEnvironment.ts +++ b/delete-user-data/functions/__tests__/helpers/setupEnvironment.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + export default () => { process.env.FIRESTORE_EMULATOR_HOST = "127.0.0.1:8080"; process.env.FIREBASE_FIRESTORE_EMULATOR_ADDRESS = "127.0.0.1:8080"; diff --git a/delete-user-data/functions/__tests__/recursiveDelete.test.ts b/delete-user-data/functions/__tests__/recursiveDelete.test.ts index 64a5f71c3d..2977347062 100644 --- a/delete-user-data/functions/__tests__/recursiveDelete.test.ts +++ b/delete-user-data/functions/__tests__/recursiveDelete.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // Import your function and any necessary Firebase modules import { recursiveDelete } from "../src/recursiveDelete"; // Update with your actual file path import * as admin from "firebase-admin"; diff --git a/delete-user-data/functions/__tests__/runBatchPubSubDeletions.test.ts b/delete-user-data/functions/__tests__/runBatchPubSubDeletions.test.ts index 02ff79d7d9..7516a10d30 100644 --- a/delete-user-data/functions/__tests__/runBatchPubSubDeletions.test.ts +++ b/delete-user-data/functions/__tests__/runBatchPubSubDeletions.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as admin from "firebase-admin"; import { runBatchPubSubDeletions } from "../src/runBatchPubSubDeletions"; import setupEnvironment from "./helpers/setupEnvironment"; diff --git a/delete-user-data/functions/__tests__/search.test.ts b/delete-user-data/functions/__tests__/search.test.ts index 161dd8167a..d0413dd1b1 100644 --- a/delete-user-data/functions/__tests__/search.test.ts +++ b/delete-user-data/functions/__tests__/search.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as admin from "firebase-admin"; import { UserRecord } from "firebase-admin/lib/auth/user-record"; import { search } from "../src/search"; diff --git a/delete-user-data/functions/__tests__/searchFunction.test.ts b/delete-user-data/functions/__tests__/searchFunction.test.ts index be5b28382a..570085c643 100644 --- a/delete-user-data/functions/__tests__/searchFunction.test.ts +++ b/delete-user-data/functions/__tests__/searchFunction.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as admin from "firebase-admin"; import { UserRecord } from "firebase-functions/v1/auth"; import { createFirebaseUser, waitForDocumentDeletion } from "./helpers"; diff --git a/delete-user-data/functions/__tests__/setupTests.ts b/delete-user-data/functions/__tests__/setupTests.ts index 45bd417df5..4b104734b9 100644 --- a/delete-user-data/functions/__tests__/setupTests.ts +++ b/delete-user-data/functions/__tests__/setupTests.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import path from "path"; (async function () { diff --git a/delete-user-data/functions/jest.config.js b/delete-user-data/functions/jest.config.js index c506da087d..0dad5ada5a 100644 --- a/delete-user-data/functions/jest.config.js +++ b/delete-user-data/functions/jest.config.js @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + const packageJson = require("./package.json"); module.exports = { diff --git a/delete-user-data/functions/src/recursiveDelete.ts b/delete-user-data/functions/src/recursiveDelete.ts index 1c4cb41713..ca0d0f6a37 100644 --- a/delete-user-data/functions/src/recursiveDelete.ts +++ b/delete-user-data/functions/src/recursiveDelete.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as admin from "firebase-admin"; const MAX_RETRY_ATTEMPTS = 3; diff --git a/delete-user-data/functions/src/runBatchPubSubDeletions.ts b/delete-user-data/functions/src/runBatchPubSubDeletions.ts index e447b76b05..71d8da664b 100644 --- a/delete-user-data/functions/src/runBatchPubSubDeletions.ts +++ b/delete-user-data/functions/src/runBatchPubSubDeletions.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import chunk from "lodash.chunk"; const { PubSub } = require("@google-cloud/pubsub"); diff --git a/delete-user-data/functions/src/runCustomSearchFunction.ts b/delete-user-data/functions/src/runCustomSearchFunction.ts index 7763824487..2569da16f1 100644 --- a/delete-user-data/functions/src/runCustomSearchFunction.ts +++ b/delete-user-data/functions/src/runCustomSearchFunction.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { runBatchPubSubDeletions } from "./runBatchPubSubDeletions"; import * as logs from "./logs"; import config from "./config"; diff --git a/delete-user-data/functions/src/search.ts b/delete-user-data/functions/src/search.ts index 4f3d663eca..83dc211fb2 100644 --- a/delete-user-data/functions/src/search.ts +++ b/delete-user-data/functions/src/search.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as admin from "firebase-admin"; import * as config from "./config"; const { PubSub } = require("@google-cloud/pubsub"); diff --git a/delete-user-data/functions/src/types.ts b/delete-user-data/functions/src/types.ts index 7c28f20186..065090ac09 100644 --- a/delete-user-data/functions/src/types.ts +++ b/delete-user-data/functions/src/types.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + export type Paths = { firestorePaths: string[]; }; diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/jest.config.js b/firestore-bigquery-export/firestore-bigquery-change-tracker/jest.config.js index 6db0ea596d..7e64dfa96f 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/jest.config.js +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/jest.config.js @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + const packageJson = require("./package.json"); module.exports = { diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/alternativeProject.test.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/alternativeProject.test.ts index 52a5cf9c2f..c930a23e33 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/alternativeProject.test.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/alternativeProject.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { BigQuery } from "@google-cloud/bigquery"; import { FirestoreDocumentChangeEvent } from "../.."; diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/checkUpdates.test.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/checkUpdates.test.ts index c9c7ece670..a059746c53 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/checkUpdates.test.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/checkUpdates.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { BigQuery } from "@google-cloud/bigquery"; import { FirestoreDocumentChangeEvent } from "../.."; import { changeTracker, changeTrackerEvent } from "../fixtures/changeTracker"; diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/clustering.test.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/clustering.test.ts index c505be20ec..c720c158d1 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/clustering.test.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/clustering.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { BigQuery, Dataset, Table } from "@google-cloud/bigquery"; import { FirestoreDocumentChangeEvent } from "../.."; import { RawChangelogSchema } from "../../bigquery/schema"; diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/e2e.test.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/e2e.test.ts index a17fa74142..c642de74ca 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/e2e.test.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/e2e.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { BigQuery, Dataset, Table } from "@google-cloud/bigquery"; const { logger } = require("firebase-functions"); import waitForExpect from "wait-for-expect"; diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/failedTransaction.test.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/failedTransaction.test.ts index c1b7c9e948..0558adc946 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/failedTransaction.test.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/failedTransaction.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as admin from "firebase-admin"; import { ChangeTrackerConfig } from "../../bigquery/types"; diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/materializedViews/initializeLatestMaterializedView.test.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/materializedViews/initializeLatestMaterializedView.test.ts index 79a753a99a..c26fb4db02 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/materializedViews/initializeLatestMaterializedView.test.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/materializedViews/initializeLatestMaterializedView.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { BigQuery, Dataset, diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/materializedViews/initializeLatestView.test.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/materializedViews/initializeLatestView.test.ts index a73c48389c..ab9d3aa848 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/materializedViews/initializeLatestView.test.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/materializedViews/initializeLatestView.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { initializeLatestView } from "../../../bigquery/initializeLatestView"; import { initializeLatestMaterializedView } from "../../../bigquery/initializeLatestMaterializedView"; import { ChangeTrackerConfig } from "../../../bigquery/types"; diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/materializedViews/integration.test.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/materializedViews/integration.test.ts index e65f3c511e..8b10169d3f 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/materializedViews/integration.test.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/materializedViews/integration.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { BigQuery, Dataset, diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/materializedViews/shouldRecreateMaterializedView.test.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/materializedViews/shouldRecreateMaterializedView.test.ts index 93791bf894..af023dac34 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/materializedViews/shouldRecreateMaterializedView.test.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/materializedViews/shouldRecreateMaterializedView.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { BigQuery, Dataset, TableMetadata } from "@google-cloud/bigquery"; import { firestore } from "firebase-admin"; import { RawChangelogViewSchema } from "../../../bigquery/schema"; diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/partitioning.test.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/partitioning.test.ts index 0fb8e975f8..4144cfff43 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/partitioning.test.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/partitioning.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as admin from "firebase-admin"; import { BigQuery, Dataset, Table } from "@google-cloud/bigquery"; diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/partitioning/config.test.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/partitioning/config.test.ts index ee4428ff9a..5e6512718d 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/partitioning/config.test.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/partitioning/config.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { PartitioningConfig, PartitioningType, diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/partitioning/converter.test.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/partitioning/converter.test.ts index 4a77a537ab..b5cfdee037 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/partitioning/converter.test.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/partitioning/converter.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as admin from "firebase-admin"; import { PartitionValueConverter } from "../../../bigquery/partitioning/converter"; diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/stresstest.test.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/stresstest.test.ts index 8e0a896996..2fbfeb18d0 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/stresstest.test.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/stresstest.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { BigQuery, Dataset, Table } from "@google-cloud/bigquery"; import { FirestoreDocumentChangeEvent } from "../.."; import { RawChangelogSchema } from "../../bigquery"; diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/wildcardDocument.test.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/wildcardDocument.test.ts index 56b9463307..f264f9eed5 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/wildcardDocument.test.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/bigquery/wildcardDocument.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { BigQuery, Dataset, Table } from "@google-cloud/bigquery"; import { FirestoreDocumentChangeEvent } from "../.."; import { RawChangelogSchema } from "../../bigquery"; diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/fixtures/changeTracker.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/fixtures/changeTracker.ts index dab94e1789..b6465dc60d 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/fixtures/changeTracker.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/fixtures/changeTracker.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { firestore } from "firebase-admin"; import { ChangeType, diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/fixtures/clearTables.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/fixtures/clearTables.ts index 486e07877f..0022c63c7a 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/fixtures/clearTables.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/fixtures/clearTables.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { BigQuery } from "@google-cloud/bigquery"; export const deleteTable = async ({ diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/fixtures/queries.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/fixtures/queries.ts index 89bee61d4a..68752e4a2e 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/fixtures/queries.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/fixtures/queries.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { BigQuery } from "@google-cloud/bigquery"; export const defaultQuery = ( diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/logger.test.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/logger.test.ts index 8a056d84dc..c00958bafc 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/logger.test.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/__tests__/logger.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { Logger, LogLevel, logger as defaultLogger } from "../logger"; import { logger as funcsLogger } from "firebase-functions"; diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/checkUpdates.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/checkUpdates.ts index 6313f32cc5..54685e7591 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/checkUpdates.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/checkUpdates.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { Table, TableMetadata } from "@google-cloud/bigquery/build/src/table"; import { Partitioning } from "./partitioning"; import { PartitioningConfig } from "./partitioning/config"; diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/clustering.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/clustering.ts index 9e518af78d..4e4856c4e8 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/clustering.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/clustering.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { ChangeTrackerConfig } from "."; import * as logs from "../logs"; diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/handleFailedTransactions.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/handleFailedTransactions.ts index 4addaeec9d..93e10538fc 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/handleFailedTransactions.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/handleFailedTransactions.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as admin from "firebase-admin"; import { initializeApp } from "firebase-admin/app"; import { getFirestore } from "firebase-admin/firestore"; diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/initializeLatestMaterializedView.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/initializeLatestMaterializedView.ts index 67cc1db642..8241af8a9f 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/initializeLatestMaterializedView.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/initializeLatestMaterializedView.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { BigQuery, Table, TableMetadata } from "@google-cloud/bigquery"; import { ChangeTrackerConfig } from "."; import * as logs from "../logs"; diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/initializeLatestView.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/initializeLatestView.ts index 9f9b59eb1e..b0e7fc9394 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/initializeLatestView.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/initializeLatestView.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { BigQuery, Dataset, diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/partitioning/config.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/partitioning/config.ts index 48165b2fcc..e516c96797 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/partitioning/config.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/partitioning/config.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** Granularity for BigQuery time-based partitioning. */ export type TimePartitioningGranularity = "HOUR" | "DAY" | "MONTH" | "YEAR"; diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/partitioning/converter.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/partitioning/converter.ts index 8d008d635e..1186d450bf 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/partitioning/converter.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/partitioning/converter.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as firebase from "firebase-admin"; import { BigQuery } from "@google-cloud/bigquery"; diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/partitioning/index.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/partitioning/index.ts index 038181df74..cd7ee6b251 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/partitioning/index.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/partitioning/index.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as bigquery from "@google-cloud/bigquery"; import * as functions from "firebase-functions"; import { TableField } from "@google-cloud/bigquery"; diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/types.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/types.ts index 0f7087e3da..fed3c92f3b 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/types.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/types.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { PartitioningStrategy } from "./partitioning/config"; /** diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/utils.test.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/utils.test.ts index f4cf8045f8..e0fc1cee2e 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/utils.test.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/utils.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { waitForInitialization } from "./utils"; import { Dataset, Table } from "@google-cloud/bigquery"; import * as logs from "../logs"; diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/utils.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/utils.ts index 0a67d70dbd..3caade8746 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/utils.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/utils.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { Dataset, Table } from "@google-cloud/bigquery"; import * as logs from "../logs"; diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/validateProject.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/validateProject.ts index 9c84c5a222..329fd383c0 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/validateProject.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/validateProject.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + const { ProjectsClient } = require("@google-cloud/resource-manager"); /* TODO: searchProjectsAsync sometimes returns {}. diff --git a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/types.ts b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/types.ts index 1c72df715e..de9b53b5df 100644 --- a/firestore-bigquery-export/firestore-bigquery-change-tracker/src/types.ts +++ b/firestore-bigquery-export/firestore-bigquery-change-tracker/src/types.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + export enum PartitionFieldType { DATE = "DATE", DATETIME = "DATETIME", diff --git a/firestore-bigquery-export/functions/__tests__/__mocks__/console.ts b/firestore-bigquery-export/functions/__tests__/__mocks__/console.ts index 92fd6eb491..3e2ba68937 100644 --- a/firestore-bigquery-export/functions/__tests__/__mocks__/console.ts +++ b/firestore-bigquery-export/functions/__tests__/__mocks__/console.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { logger } from "firebase-functions"; export const mockConsoleLog = jest.spyOn(logger, "log").mockImplementation(); diff --git a/firestore-bigquery-export/functions/__tests__/__mocks__/firestore.ts b/firestore-bigquery-export/functions/__tests__/__mocks__/firestore.ts index d1603f4a2a..62d2abb243 100644 --- a/firestore-bigquery-export/functions/__tests__/__mocks__/firestore.ts +++ b/firestore-bigquery-export/functions/__tests__/__mocks__/firestore.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as functionsTestInit from "firebase-functions-test"; export const snapshot = ( diff --git a/firestore-bigquery-export/functions/__tests__/config.test.ts b/firestore-bigquery-export/functions/__tests__/config.test.ts index b398c03c37..6970f7cc94 100644 --- a/firestore-bigquery-export/functions/__tests__/config.test.ts +++ b/firestore-bigquery-export/functions/__tests__/config.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { readFileSync } from "fs"; import { resolve as pathResolve } from "path"; diff --git a/firestore-bigquery-export/functions/__tests__/e2e.test.ts b/firestore-bigquery-export/functions/__tests__/e2e.test.ts index 4773a3e25b..d94d0405ab 100644 --- a/firestore-bigquery-export/functions/__tests__/e2e.test.ts +++ b/firestore-bigquery-export/functions/__tests__/e2e.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as admin from "firebase-admin"; import { BigQuery } from "@google-cloud/bigquery"; diff --git a/firestore-bigquery-export/functions/__tests__/fixtures/documentData.ts b/firestore-bigquery-export/functions/__tests__/fixtures/documentData.ts index 99ecbb7094..49f8d32515 100644 --- a/firestore-bigquery-export/functions/__tests__/fixtures/documentData.ts +++ b/firestore-bigquery-export/functions/__tests__/fixtures/documentData.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as admin from "firebase-admin"; export const documentData = async () => { diff --git a/firestore-bigquery-export/functions/__tests__/functions.test.ts b/firestore-bigquery-export/functions/__tests__/functions.test.ts index d759c377e7..38ec652672 100644 --- a/firestore-bigquery-export/functions/__tests__/functions.test.ts +++ b/firestore-bigquery-export/functions/__tests__/functions.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as admin from "firebase-admin"; import { logger } from "firebase-functions"; import * as functionsTestInit from "../node_modules/firebase-functions-test"; diff --git a/firestore-bigquery-export/functions/__tests__/jest.setup.ts b/firestore-bigquery-export/functions/__tests__/jest.setup.ts index 3c093138bf..789df7ebe7 100644 --- a/firestore-bigquery-export/functions/__tests__/jest.setup.ts +++ b/firestore-bigquery-export/functions/__tests__/jest.setup.ts @@ -1 +1,17 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + global.config = () => require("../src/config").default; diff --git a/firestore-bigquery-export/functions/__tests__/test.types.d.ts b/firestore-bigquery-export/functions/__tests__/test.types.d.ts index bf5ab464d8..ab2b77c830 100644 --- a/firestore-bigquery-export/functions/__tests__/test.types.d.ts +++ b/firestore-bigquery-export/functions/__tests__/test.types.d.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + declare namespace NodeJS { interface Global { config: () => jest.ModuleMocker; diff --git a/firestore-bigquery-export/functions/__tests__/util.test.ts b/firestore-bigquery-export/functions/__tests__/util.test.ts index 76d54c2bd3..d0bf3cc961 100644 --- a/firestore-bigquery-export/functions/__tests__/util.test.ts +++ b/firestore-bigquery-export/functions/__tests__/util.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { getChangeType } from "../src/util"; import * as functionsTestInit from "firebase-functions-test"; import { ChangeType } from "@firebaseextensions/firestore-bigquery-change-tracker"; diff --git a/firestore-bigquery-export/functions/big-query-table-test/install-script.js b/firestore-bigquery-export/functions/big-query-table-test/install-script.js index 51ee7c2f78..1c668d3917 100644 --- a/firestore-bigquery-export/functions/big-query-table-test/install-script.js +++ b/firestore-bigquery-export/functions/big-query-table-test/install-script.js @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + const admin = require("firebase-admin"); const faker = require("faker"); diff --git a/firestore-bigquery-export/functions/jest.config.js b/firestore-bigquery-export/functions/jest.config.js index 3dbc0c7c13..83bed38c0c 100644 --- a/firestore-bigquery-export/functions/jest.config.js +++ b/firestore-bigquery-export/functions/jest.config.js @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** @type {import('ts-jest').JestConfigWithTsJest} */ const packageJson = require("./package.json"); diff --git a/firestore-bigquery-export/functions/src/events.ts b/firestore-bigquery-export/functions/src/events.ts index 0d6be8a217..a08b20cdb6 100644 --- a/firestore-bigquery-export/functions/src/events.ts +++ b/firestore-bigquery-export/functions/src/events.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as eventArc from "firebase-admin/eventarc"; const { getEventarc } = eventArc; diff --git a/firestore-bigquery-export/functions/stress_test/count.js b/firestore-bigquery-export/functions/stress_test/count.js index 6f9ea64d96..01fc6c2c43 100644 --- a/firestore-bigquery-export/functions/stress_test/count.js +++ b/firestore-bigquery-export/functions/stress_test/count.js @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + const admin = require("firebase-admin"); // Initialize Firebase Admin with your credentials diff --git a/firestore-bigquery-export/functions/stress_test/main.js b/firestore-bigquery-export/functions/stress_test/main.js index cdecdff8e9..f9288af873 100644 --- a/firestore-bigquery-export/functions/stress_test/main.js +++ b/firestore-bigquery-export/functions/stress_test/main.js @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + const { Worker } = require("worker_threads"); const { performance } = require("perf_hooks"); const path = require("path"); diff --git a/firestore-bigquery-export/functions/stress_test/worker.js b/firestore-bigquery-export/functions/stress_test/worker.js index 3f53e985b9..5e1721a330 100644 --- a/firestore-bigquery-export/functions/stress_test/worker.js +++ b/firestore-bigquery-export/functions/stress_test/worker.js @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + const { parentPort, workerData } = require("worker_threads"); const admin = require("firebase-admin"); const { v4: uuidv4 } = require("uuid"); diff --git a/firestore-bigquery-export/scripts/gen-schema-view/__mocks__/inquirer.js b/firestore-bigquery-export/scripts/gen-schema-view/__mocks__/inquirer.js index d8fdfd9906..7cbb0a6e2a 100644 --- a/firestore-bigquery-export/scripts/gen-schema-view/__mocks__/inquirer.js +++ b/firestore-bigquery-export/scripts/gen-schema-view/__mocks__/inquirer.js @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + const prompt = jest.fn().mockResolvedValue({}); const createPromptModule = jest.fn().mockReturnValue(prompt); diff --git a/firestore-bigquery-export/scripts/gen-schema-view/jest.config.js b/firestore-bigquery-export/scripts/gen-schema-view/jest.config.js index 5cb8d2e58a..cc42c6dc18 100644 --- a/firestore-bigquery-export/scripts/gen-schema-view/jest.config.js +++ b/firestore-bigquery-export/scripts/gen-schema-view/jest.config.js @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + const packageJson = require("./package.json"); module.exports = { diff --git a/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/bigquery/schema/extractors.test.ts b/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/bigquery/schema/extractors.test.ts index f73a2501aa..8c5cde36cc 100644 --- a/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/bigquery/schema/extractors.test.ts +++ b/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/bigquery/schema/extractors.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { jsonExtractScalar, jsonExtract } from "../../../schema/extractors"; import { FirestoreField } from "../../../schema"; diff --git a/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/bigquery/schema/processLeafField.test.ts b/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/bigquery/schema/processLeafField.test.ts index 8ce2d244d3..c3a604a199 100644 --- a/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/bigquery/schema/processLeafField.test.ts +++ b/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/bigquery/schema/processLeafField.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { FirestoreField } from "../../../schema"; import { processLeafField } from "../../../schema/processLeafField"; diff --git a/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/config/index.test.ts b/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/config/index.test.ts index e84df471be..8f8a8703e4 100644 --- a/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/config/index.test.ts +++ b/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/config/index.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { parseConfig } from "../../../src/config"; import { promptInquirer } from "../../../src/config/interactive"; import { diff --git a/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/config/interactive.test.ts b/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/config/interactive.test.ts index 3a5b7aba38..938a2318de 100644 --- a/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/config/interactive.test.ts +++ b/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/config/interactive.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { describe, it, diff --git a/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/config/non-interactive.test.ts b/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/config/non-interactive.test.ts index 8764736cfc..ab9581583b 100644 --- a/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/config/non-interactive.test.ts +++ b/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/config/non-interactive.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { describe, it, diff --git a/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/e2e/helpers/setup.ts b/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/e2e/helpers/setup.ts index b1b4fb808b..1becc687cd 100644 --- a/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/e2e/helpers/setup.ts +++ b/firestore-bigquery-export/scripts/gen-schema-view/src/__tests__/e2e/helpers/setup.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { BigQuery, Table } from "@google-cloud/bigquery"; export const setupBQ = async ( diff --git a/firestore-bigquery-export/scripts/gen-schema-view/src/schema/processLeafField.ts b/firestore-bigquery-export/scripts/gen-schema-view/src/schema/processLeafField.ts index 20a954fd08..ae91f794a0 100644 --- a/firestore-bigquery-export/scripts/gen-schema-view/src/schema/processLeafField.ts +++ b/firestore-bigquery-export/scripts/gen-schema-view/src/schema/processLeafField.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { FirestoreField, firestoreToBigQueryFieldType, diff --git a/firestore-bigquery-export/scripts/import/__tests__/e2e.test.ts b/firestore-bigquery-export/scripts/import/__tests__/e2e.test.ts index b722af27f7..93eedd3d97 100644 --- a/firestore-bigquery-export/scripts/import/__tests__/e2e.test.ts +++ b/firestore-bigquery-export/scripts/import/__tests__/e2e.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { BigQuery } from "@google-cloud/bigquery"; import * as childProcess from "child_process"; import * as admin from "firebase-admin"; diff --git a/firestore-bigquery-export/scripts/import/__tests__/getRowsFromDocs.test.ts b/firestore-bigquery-export/scripts/import/__tests__/getRowsFromDocs.test.ts index baa6a427e3..16ffec5045 100644 --- a/firestore-bigquery-export/scripts/import/__tests__/getRowsFromDocs.test.ts +++ b/firestore-bigquery-export/scripts/import/__tests__/getRowsFromDocs.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { ChangeType } from "@firebaseextensions/firestore-bigquery-change-tracker"; import { getRowsFromDocs } from "../src/helper"; diff --git a/firestore-bigquery-export/scripts/import/__tests__/helpers/waitFor.ts b/firestore-bigquery-export/scripts/import/__tests__/helpers/waitFor.ts index b0a1584594..9e0198d7a2 100644 --- a/firestore-bigquery-export/scripts/import/__tests__/helpers/waitFor.ts +++ b/firestore-bigquery-export/scripts/import/__tests__/helpers/waitFor.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + export async function repeat( fn: { (): Promise; (): any }, until: { ($: any): any; (arg0: any): any }, diff --git a/firestore-bigquery-export/scripts/import/__tests__/multiThreadCollectionGroupBug.test.ts b/firestore-bigquery-export/scripts/import/__tests__/multiThreadCollectionGroupBug.test.ts index d1068ee586..8cfc924d3b 100644 --- a/firestore-bigquery-export/scripts/import/__tests__/multiThreadCollectionGroupBug.test.ts +++ b/firestore-bigquery-export/scripts/import/__tests__/multiThreadCollectionGroupBug.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { runMultiThread } from "../src/run-multi-thread"; import * as admin from "firebase-admin"; import { CliConfig } from "../src/types"; diff --git a/firestore-bigquery-export/scripts/import/__tests__/runMultiThread.test.ts b/firestore-bigquery-export/scripts/import/__tests__/runMultiThread.test.ts index ae681c1e01..413193aeff 100644 --- a/firestore-bigquery-export/scripts/import/__tests__/runMultiThread.test.ts +++ b/firestore-bigquery-export/scripts/import/__tests__/runMultiThread.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { runMultiThread } from "../src/run-multi-thread"; import * as admin from "firebase-admin"; import { CliConfig } from "../src/types"; diff --git a/firestore-bigquery-export/scripts/import/__tests__/runMultiThreadMock.test.ts b/firestore-bigquery-export/scripts/import/__tests__/runMultiThreadMock.test.ts index 22fa36c59d..732cb7e1eb 100644 --- a/firestore-bigquery-export/scripts/import/__tests__/runMultiThreadMock.test.ts +++ b/firestore-bigquery-export/scripts/import/__tests__/runMultiThreadMock.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { runMultiThread } from "../src/run-multi-thread"; import * as workerpool from "workerpool"; import { CliConfig } from "../src/types"; diff --git a/firestore-bigquery-export/scripts/import/__tests__/test.types.d.ts b/firestore-bigquery-export/scripts/import/__tests__/test.types.d.ts index bf5ab464d8..ab2b77c830 100644 --- a/firestore-bigquery-export/scripts/import/__tests__/test.types.d.ts +++ b/firestore-bigquery-export/scripts/import/__tests__/test.types.d.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + declare namespace NodeJS { interface Global { config: () => jest.ModuleMocker; diff --git a/firestore-bigquery-export/scripts/import/jest.config.js b/firestore-bigquery-export/scripts/import/jest.config.js index db5538023e..7c3aea87dc 100644 --- a/firestore-bigquery-export/scripts/import/jest.config.js +++ b/firestore-bigquery-export/scripts/import/jest.config.js @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + const packageJson = require("./package.json"); module.exports = { diff --git a/firestore-bigquery-export/scripts/import/src/config.ts b/firestore-bigquery-export/scripts/import/src/config.ts index 2c956374f9..95db570113 100644 --- a/firestore-bigquery-export/scripts/import/src/config.ts +++ b/firestore-bigquery-export/scripts/import/src/config.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as program from "commander"; import filenamify from "filenamify"; import inquirer from "inquirer"; diff --git a/firestore-bigquery-export/scripts/import/src/helper.ts b/firestore-bigquery-export/scripts/import/src/helper.ts index 97717763c8..9f61200edb 100644 --- a/firestore-bigquery-export/scripts/import/src/helper.ts +++ b/firestore-bigquery-export/scripts/import/src/helper.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { FirestoreBigQueryEventHistoryTracker } from "@firebaseextensions/firestore-bigquery-change-tracker"; import { BigQuery } from "@google-cloud/bigquery"; diff --git a/firestore-bigquery-export/scripts/import/src/logs.ts b/firestore-bigquery-export/scripts/import/src/logs.ts index f180e15c3c..484e96e476 100644 --- a/firestore-bigquery-export/scripts/import/src/logs.ts +++ b/firestore-bigquery-export/scripts/import/src/logs.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { CliConfig } from "./types"; export const finishedImporting = (rowCount: number) => { diff --git a/firestore-bigquery-export/scripts/import/src/program.ts b/firestore-bigquery-export/scripts/import/src/program.ts index 24f4df2c88..94e10540d0 100644 --- a/firestore-bigquery-export/scripts/import/src/program.ts +++ b/firestore-bigquery-export/scripts/import/src/program.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as program from "commander"; const packageJson = require("../package.json"); diff --git a/firestore-bigquery-export/scripts/import/src/run-multi-thread.ts b/firestore-bigquery-export/scripts/import/src/run-multi-thread.ts index fc7f0a71c4..e0d7199fbc 100644 --- a/firestore-bigquery-export/scripts/import/src/run-multi-thread.ts +++ b/firestore-bigquery-export/scripts/import/src/run-multi-thread.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as firebase from "firebase-admin"; import { getFirestore } from "firebase-admin/firestore"; import { cpus } from "os"; diff --git a/firestore-bigquery-export/scripts/import/src/run-single-thread.ts b/firestore-bigquery-export/scripts/import/src/run-single-thread.ts index 9ed00ae92d..f3bd1bdaa5 100644 --- a/firestore-bigquery-export/scripts/import/src/run-single-thread.ts +++ b/firestore-bigquery-export/scripts/import/src/run-single-thread.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { FirestoreBigQueryEventHistoryTracker, FirestoreDocumentChangeEvent, diff --git a/firestore-bigquery-export/scripts/import/src/types.ts b/firestore-bigquery-export/scripts/import/src/types.ts index 2c384000b1..62cd5719f9 100644 --- a/firestore-bigquery-export/scripts/import/src/types.ts +++ b/firestore-bigquery-export/scripts/import/src/types.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as admin from "firebase-admin"; export interface CliConfig { diff --git a/firestore-bigquery-export/scripts/import/src/worker.ts b/firestore-bigquery-export/scripts/import/src/worker.ts index b1a89b1160..b520e14964 100644 --- a/firestore-bigquery-export/scripts/import/src/worker.ts +++ b/firestore-bigquery-export/scripts/import/src/worker.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { FirestoreBigQueryEventHistoryTracker, FirestoreDocumentChangeEvent, diff --git a/firestore-counter/functions/__tests__/test.types.d.ts b/firestore-counter/functions/__tests__/test.types.d.ts index bf5ab464d8..ab2b77c830 100644 --- a/firestore-counter/functions/__tests__/test.types.d.ts +++ b/firestore-counter/functions/__tests__/test.types.d.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + declare namespace NodeJS { interface Global { config: () => jest.ModuleMocker; diff --git a/firestore-counter/functions/jest.config.js b/firestore-counter/functions/jest.config.js index da7a219816..339c8fcef6 100644 --- a/firestore-counter/functions/jest.config.js +++ b/firestore-counter/functions/jest.config.js @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + module.exports = { rootDir: "./", preset: "ts-jest", diff --git a/firestore-counter/functions/src/events.ts b/firestore-counter/functions/src/events.ts index 4fdd5ba553..a59423cf53 100644 --- a/firestore-counter/functions/src/events.ts +++ b/firestore-counter/functions/src/events.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as eventArc from "firebase-admin/eventarc"; const { getEventarc } = eventArc; diff --git a/firestore-send-email/functions/__tests__/config.test.ts b/firestore-send-email/functions/__tests__/config.test.ts index d76b5af634..4c2c389cac 100644 --- a/firestore-send-email/functions/__tests__/config.test.ts +++ b/firestore-send-email/functions/__tests__/config.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as functionsTestInit from "firebase-functions-test"; import mockedEnv from "mocked-env"; import { AuthenticatonType, Config } from "../src/types"; diff --git a/firestore-send-email/functions/__tests__/createSMTPServer.ts b/firestore-send-email/functions/__tests__/createSMTPServer.ts index e3617c6e79..5c95261b42 100644 --- a/firestore-send-email/functions/__tests__/createSMTPServer.ts +++ b/firestore-send-email/functions/__tests__/createSMTPServer.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + const SMTPServer = require("smtp-server").SMTPServer; export const smtpServer = () => { diff --git a/firestore-send-email/functions/__tests__/e2e.test.ts b/firestore-send-email/functions/__tests__/e2e.test.ts index 871b24f88b..c327d8fc5c 100644 --- a/firestore-send-email/functions/__tests__/e2e.test.ts +++ b/firestore-send-email/functions/__tests__/e2e.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as admin from "firebase-admin"; import { smtpServer } from "./createSMTPServer"; diff --git a/firestore-send-email/functions/__tests__/e2e/sendgrid.test.ts b/firestore-send-email/functions/__tests__/e2e/sendgrid.test.ts index c53e296cf3..1ba0680685 100644 --- a/firestore-send-email/functions/__tests__/e2e/sendgrid.test.ts +++ b/firestore-send-email/functions/__tests__/e2e/sendgrid.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // This test suite assumes local emulator is running the extension, with the following config: // AUTH_TYPE=UsernamePassword diff --git a/firestore-send-email/functions/__tests__/functions.test.ts b/firestore-send-email/functions/__tests__/functions.test.ts index b3b30feba4..cad6eaf61e 100644 --- a/firestore-send-email/functions/__tests__/functions.test.ts +++ b/firestore-send-email/functions/__tests__/functions.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + const { logger } = require("firebase-functions"); const consoleLogSpy = jest.spyOn(logger, "log").mockImplementation(); diff --git a/firestore-send-email/functions/__tests__/helpers.test.ts b/firestore-send-email/functions/__tests__/helpers.test.ts index 817b5d8978..2248d337b1 100644 --- a/firestore-send-email/functions/__tests__/helpers.test.ts +++ b/firestore-send-email/functions/__tests__/helpers.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import Mail = require("nodemailer/lib/mailer"); const { logger } = require("firebase-functions"); diff --git a/firestore-send-email/functions/__tests__/jest.setup.ts b/firestore-send-email/functions/__tests__/jest.setup.ts index 3c093138bf..789df7ebe7 100644 --- a/firestore-send-email/functions/__tests__/jest.setup.ts +++ b/firestore-send-email/functions/__tests__/jest.setup.ts @@ -1 +1,17 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + global.config = () => require("../src/config").default; diff --git a/firestore-send-email/functions/__tests__/nodemailer-sendgrid/index.test.ts b/firestore-send-email/functions/__tests__/nodemailer-sendgrid/index.test.ts index bab3e3445c..5fd555cdf3 100644 --- a/firestore-send-email/functions/__tests__/nodemailer-sendgrid/index.test.ts +++ b/firestore-send-email/functions/__tests__/nodemailer-sendgrid/index.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as sgMail from "@sendgrid/mail"; import { SendGridTransport } from "../../src/nodemailer-sendgrid"; import { diff --git a/firestore-send-email/functions/__tests__/prepare-payload.test.ts b/firestore-send-email/functions/__tests__/prepare-payload.test.ts index c9a7be394d..13f5e61e6b 100644 --- a/firestore-send-email/functions/__tests__/prepare-payload.test.ts +++ b/firestore-send-email/functions/__tests__/prepare-payload.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { preparePayload, setDependencies } from "../src/prepare-payload"; class MockTemplates { diff --git a/firestore-send-email/functions/__tests__/test.types.d.ts b/firestore-send-email/functions/__tests__/test.types.d.ts index bf5ab464d8..ab2b77c830 100644 --- a/firestore-send-email/functions/__tests__/test.types.d.ts +++ b/firestore-send-email/functions/__tests__/test.types.d.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + declare namespace NodeJS { interface Global { config: () => jest.ModuleMocker; diff --git a/firestore-send-email/functions/__tests__/validation.test.ts b/firestore-send-email/functions/__tests__/validation.test.ts index e54990b3cc..78233d8db6 100644 --- a/firestore-send-email/functions/__tests__/validation.test.ts +++ b/firestore-send-email/functions/__tests__/validation.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { validatePayload, ValidationError } from "../src/validation"; describe("validatePayload", () => { diff --git a/firestore-send-email/functions/jest.config.js b/firestore-send-email/functions/jest.config.js index d9dc123408..26a5af59fb 100644 --- a/firestore-send-email/functions/jest.config.js +++ b/firestore-send-email/functions/jest.config.js @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + const packageJson = require("./package.json"); module.exports = { diff --git a/firestore-send-email/functions/jest.teardown.js b/firestore-send-email/functions/jest.teardown.js index ff89f0d532..5fb2225bfb 100644 --- a/firestore-send-email/functions/jest.teardown.js +++ b/firestore-send-email/functions/jest.teardown.js @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + module.exports = async function () { delete process.env.LOCATION; delete process.env.MAIL_COLLECTION; diff --git a/firestore-send-email/functions/src/events.ts b/firestore-send-email/functions/src/events.ts index 38b53c9639..ea7a3817ea 100644 --- a/firestore-send-email/functions/src/events.ts +++ b/firestore-send-email/functions/src/events.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { Channel, getEventarc } from "firebase-admin/eventarc"; let eventChannel: Channel | undefined; diff --git a/firestore-send-email/functions/src/helpers.ts b/firestore-send-email/functions/src/helpers.ts index 88e2be15cb..4d5dac74d7 100644 --- a/firestore-send-email/functions/src/helpers.ts +++ b/firestore-send-email/functions/src/helpers.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { createTransport } from "nodemailer"; import { URL } from "url"; import { invalidTlsOptions, invalidURI } from "./logs"; diff --git a/firestore-send-email/functions/src/nodemailer-sendgrid/index.ts b/firestore-send-email/functions/src/nodemailer-sendgrid/index.ts index e02807aa35..fb0a25cbfc 100644 --- a/firestore-send-email/functions/src/nodemailer-sendgrid/index.ts +++ b/firestore-send-email/functions/src/nodemailer-sendgrid/index.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as sgMail from "@sendgrid/mail"; import { SendGridTransportOptions, diff --git a/firestore-send-email/functions/src/nodemailer-sendgrid/types.ts b/firestore-send-email/functions/src/nodemailer-sendgrid/types.ts index 3f7ed10c5c..15e0996043 100644 --- a/firestore-send-email/functions/src/nodemailer-sendgrid/types.ts +++ b/firestore-send-email/functions/src/nodemailer-sendgrid/types.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + export interface SendGridTransportOptions { apiKey?: string; [key: string]: unknown; diff --git a/firestore-send-email/functions/src/prepare-payload.ts b/firestore-send-email/functions/src/prepare-payload.ts index 5574c732d0..8bb53f8ccf 100644 --- a/firestore-send-email/functions/src/prepare-payload.ts +++ b/firestore-send-email/functions/src/prepare-payload.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { DocumentData } from "firebase-admin/firestore"; import { validatePayload, diff --git a/firestore-send-email/functions/src/types.ts b/firestore-send-email/functions/src/types.ts index 1b476fb234..463f72ef10 100644 --- a/firestore-send-email/functions/src/types.ts +++ b/firestore-send-email/functions/src/types.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as nodemailer from "nodemailer"; import * as admin from "firebase-admin"; import * as Handlebars from "handlebars"; diff --git a/firestore-send-email/functions/src/validation.ts b/firestore-send-email/functions/src/validation.ts index 98f4e4ca7c..a43f5ea5a7 100644 --- a/firestore-send-email/functions/src/validation.ts +++ b/firestore-send-email/functions/src/validation.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { z } from "zod"; import { logger } from "firebase-functions/v1"; diff --git a/firestore-send-email/scripts/oauth2-refresh-token-helper.js b/firestore-send-email/scripts/oauth2-refresh-token-helper.js index 67fa569008..6ab00b263f 100644 --- a/firestore-send-email/scripts/oauth2-refresh-token-helper.js +++ b/firestore-send-email/scripts/oauth2-refresh-token-helper.js @@ -1,4 +1,19 @@ #!/usr/bin/env node +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /** * Google OAuth Refresh Token Generator diff --git a/firestore-shorten-urls-bitly/functions/jest.config.js b/firestore-shorten-urls-bitly/functions/jest.config.js index d906041181..1e6b64fc48 100644 --- a/firestore-shorten-urls-bitly/functions/jest.config.js +++ b/firestore-shorten-urls-bitly/functions/jest.config.js @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + const packageJson = require("./package.json"); module.exports = { diff --git a/firestore-shorten-urls-bitly/functions/src/events.ts b/firestore-shorten-urls-bitly/functions/src/events.ts index a39ef6dc50..09136554e8 100644 --- a/firestore-shorten-urls-bitly/functions/src/events.ts +++ b/firestore-shorten-urls-bitly/functions/src/events.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { Channel, getEventarc } from "firebase-admin/eventarc"; const EXTENSION_NAME = "firestore-shorten-urls-bitly"; diff --git a/firestore-translate-text/functions/__tests__/config.test.ts b/firestore-translate-text/functions/__tests__/config.test.ts index ea25187373..d702ee1820 100644 --- a/firestore-translate-text/functions/__tests__/config.test.ts +++ b/firestore-translate-text/functions/__tests__/config.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { readFileSync } from "fs"; import { resolve as pathResolve } from "path"; import * as functionsTestInit from "firebase-functions-test"; diff --git a/firestore-translate-text/functions/__tests__/functions.test.ts b/firestore-translate-text/functions/__tests__/functions.test.ts index c4c819dea5..7fd9ff2d94 100644 --- a/firestore-translate-text/functions/__tests__/functions.test.ts +++ b/firestore-translate-text/functions/__tests__/functions.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import mockedEnv from "mocked-env"; import * as functionsTestInit from "firebase-functions-test"; diff --git a/firestore-translate-text/functions/__tests__/jest.setup.ts b/firestore-translate-text/functions/__tests__/jest.setup.ts index 0a4d905beb..6dbe0aa9b3 100644 --- a/firestore-translate-text/functions/__tests__/jest.setup.ts +++ b/firestore-translate-text/functions/__tests__/jest.setup.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { snapshot, mockDocumentSnapshotFactory, diff --git a/firestore-translate-text/functions/__tests__/mocks/firestore.ts b/firestore-translate-text/functions/__tests__/mocks/firestore.ts index d1603f4a2a..62d2abb243 100644 --- a/firestore-translate-text/functions/__tests__/mocks/firestore.ts +++ b/firestore-translate-text/functions/__tests__/mocks/firestore.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as functionsTestInit from "firebase-functions-test"; export const snapshot = ( diff --git a/firestore-translate-text/functions/__tests__/mocks/translate.ts b/firestore-translate-text/functions/__tests__/mocks/translate.ts index 513dd351a7..083b6587e1 100644 --- a/firestore-translate-text/functions/__tests__/mocks/translate.ts +++ b/firestore-translate-text/functions/__tests__/mocks/translate.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as functionsTestInit from "firebase-functions-test"; export const testTranslations = { diff --git a/firestore-translate-text/functions/__tests__/test.types.d.ts b/firestore-translate-text/functions/__tests__/test.types.d.ts index 7df00facb6..578917f955 100644 --- a/firestore-translate-text/functions/__tests__/test.types.d.ts +++ b/firestore-translate-text/functions/__tests__/test.types.d.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + declare namespace NodeJS { interface Global { config: () => jest.ModuleMocker; diff --git a/firestore-translate-text/functions/__tests__/unit/translateMultipleBackfill.test.ts b/firestore-translate-text/functions/__tests__/unit/translateMultipleBackfill.test.ts index 7009061af1..9d3eaa3b99 100644 --- a/firestore-translate-text/functions/__tests__/unit/translateMultipleBackfill.test.ts +++ b/firestore-translate-text/functions/__tests__/unit/translateMultipleBackfill.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as admin from "firebase-admin"; import * as fft from "firebase-functions-test"; import { diff --git a/firestore-translate-text/functions/jest.config.js b/firestore-translate-text/functions/jest.config.js index 801e44b58b..16d67cf6dd 100644 --- a/firestore-translate-text/functions/jest.config.js +++ b/firestore-translate-text/functions/jest.config.js @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + const packageJson = require("./package.json"); module.exports = { diff --git a/firestore-translate-text/functions/src/events.ts b/firestore-translate-text/functions/src/events.ts index 74e2df2aff..cdf1ec8f09 100644 --- a/firestore-translate-text/functions/src/events.ts +++ b/firestore-translate-text/functions/src/events.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as eventArc from "firebase-admin/eventarc"; const { getEventarc } = eventArc; diff --git a/firestore-translate-text/functions/src/logs/messages.ts b/firestore-translate-text/functions/src/logs/messages.ts index 315284ed47..4a1d07210b 100644 --- a/firestore-translate-text/functions/src/logs/messages.ts +++ b/firestore-translate-text/functions/src/logs/messages.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + export const messages = { backfillComplete: (successCount: number, errorCount: number) => `Finshed backfilling translations. ${successCount} translations succeeded, ${errorCount} errors.`, diff --git a/firestore-translate-text/functions/src/translate/common.ts b/firestore-translate-text/functions/src/translate/common.ts index ec0db984e1..7b4d867657 100644 --- a/firestore-translate-text/functions/src/translate/common.ts +++ b/firestore-translate-text/functions/src/translate/common.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { v2 } from "@google-cloud/translate"; import * as logs from "../logs"; import * as events from "../events"; diff --git a/firestore-translate-text/functions/src/translate/index.ts b/firestore-translate-text/functions/src/translate/index.ts index 02e49a0f9f..a69ac4ea86 100644 --- a/firestore-translate-text/functions/src/translate/index.ts +++ b/firestore-translate-text/functions/src/translate/index.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + export { translateDocument, translateDocumentBackfill, diff --git a/firestore-translate-text/functions/src/translate/translateDocument.ts b/firestore-translate-text/functions/src/translate/translateDocument.ts index 8e5cb444ce..f271907aef 100644 --- a/firestore-translate-text/functions/src/translate/translateDocument.ts +++ b/firestore-translate-text/functions/src/translate/translateDocument.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as logs from "../logs"; import * as admin from "firebase-admin"; import * as validators from "../validators"; diff --git a/firestore-translate-text/functions/src/translate/translateMultiple.ts b/firestore-translate-text/functions/src/translate/translateMultiple.ts index 1531324b50..92a77fca1e 100644 --- a/firestore-translate-text/functions/src/translate/translateMultiple.ts +++ b/firestore-translate-text/functions/src/translate/translateMultiple.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as logs from "../logs"; import * as admin from "firebase-admin"; import config from "../config"; diff --git a/firestore-translate-text/functions/src/translate/translateSingle.ts b/firestore-translate-text/functions/src/translate/translateSingle.ts index cb85b65adb..707036027c 100644 --- a/firestore-translate-text/functions/src/translate/translateSingle.ts +++ b/firestore-translate-text/functions/src/translate/translateSingle.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as logs from "../logs"; import * as events from "../events"; import * as admin from "firebase-admin"; diff --git a/jest.config.js b/jest.config.js index 6c70e7fe5c..b51ee91d9d 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + module.exports = { projects: [ "/*/functions/jest.config.js", diff --git a/rtdb-limit-child-nodes/functions/jest.config.js b/rtdb-limit-child-nodes/functions/jest.config.js index d906041181..1e6b64fc48 100644 --- a/rtdb-limit-child-nodes/functions/jest.config.js +++ b/rtdb-limit-child-nodes/functions/jest.config.js @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + const packageJson = require("./package.json"); module.exports = { diff --git a/samples/rtdb-uppercase-messages/functions/index.js b/samples/rtdb-uppercase-messages/functions/index.js index 96b6c40a70..809d5f8143 100644 --- a/samples/rtdb-uppercase-messages/functions/index.js +++ b/samples/rtdb-uppercase-messages/functions/index.js @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { database, tasks, logger } from "firebase-functions/v1"; import { initializeApp } from "firebase-admin/app"; diff --git a/samples/rtdb-uppercase-messages/functions/integration-tests/functions/index.js b/samples/rtdb-uppercase-messages/functions/integration-tests/functions/index.js index 89d91d5822..de63abdd73 100644 --- a/samples/rtdb-uppercase-messages/functions/integration-tests/functions/index.js +++ b/samples/rtdb-uppercase-messages/functions/integration-tests/functions/index.js @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { logger } from "firebase-functions/v1"; import { onCustomEventPublished } from "firebase-functions/v2/eventarc"; diff --git a/storage-resize-images/functions/__tests__/__mocks__/src/config.ts b/storage-resize-images/functions/__tests__/__mocks__/src/config.ts index c98e07a3c6..3141de1681 100644 --- a/storage-resize-images/functions/__tests__/__mocks__/src/config.ts +++ b/storage-resize-images/functions/__tests__/__mocks__/src/config.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // export enum deleteImage { // always = 0, // never, diff --git a/storage-resize-images/functions/__tests__/__mocks__/src/index.ts b/storage-resize-images/functions/__tests__/__mocks__/src/index.ts index eba67b1632..c40fbe154b 100644 --- a/storage-resize-images/functions/__tests__/__mocks__/src/index.ts +++ b/storage-resize-images/functions/__tests__/__mocks__/src/index.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as functionsTestInit from "firebase-functions-test"; import { generateResizedImage as originalGenerateResizedImage } from "../../../src"; diff --git a/storage-resize-images/functions/__tests__/config.test.ts b/storage-resize-images/functions/__tests__/config.test.ts index 3ff438348b..ff6c819bb8 100644 --- a/storage-resize-images/functions/__tests__/config.test.ts +++ b/storage-resize-images/functions/__tests__/config.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import mockedEnv from "mocked-env"; const environment = { diff --git a/storage-resize-images/functions/__tests__/content-filter.test.ts b/storage-resize-images/functions/__tests__/content-filter.test.ts index 9a0d08779f..92e1b589e8 100644 --- a/storage-resize-images/functions/__tests__/content-filter.test.ts +++ b/storage-resize-images/functions/__tests__/content-filter.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { checkImageContent } from "../src/content-filter"; import * as path from "path"; import { HarmBlockThreshold } from "@google-cloud/vertexai"; diff --git a/storage-resize-images/functions/__tests__/convert-image.test.ts b/storage-resize-images/functions/__tests__/convert-image.test.ts index 08f7cb611d..0259c4faf6 100644 --- a/storage-resize-images/functions/__tests__/convert-image.test.ts +++ b/storage-resize-images/functions/__tests__/convert-image.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import mockedEnv from "mocked-env"; const imageType = require("image-type"); import * as util from "util"; diff --git a/storage-resize-images/functions/__tests__/e2e.test.ts b/storage-resize-images/functions/__tests__/e2e.test.ts index b3be26c8af..2c833288eb 100644 --- a/storage-resize-images/functions/__tests__/e2e.test.ts +++ b/storage-resize-images/functions/__tests__/e2e.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as admin from "firebase-admin"; import { Storage } from "firebase-admin/storage"; import { config } from "dotenv"; diff --git a/storage-resize-images/functions/__tests__/filters.test.ts b/storage-resize-images/functions/__tests__/filters.test.ts index 401a954679..004fe2a023 100644 --- a/storage-resize-images/functions/__tests__/filters.test.ts +++ b/storage-resize-images/functions/__tests__/filters.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as path from "path"; import * as logs from "../src/logs"; import { ObjectMetadata } from "firebase-functions/v1/storage"; diff --git a/storage-resize-images/functions/__tests__/function.test.ts b/storage-resize-images/functions/__tests__/function.test.ts index 8d869c5bd8..3e6dd77cb4 100644 --- a/storage-resize-images/functions/__tests__/function.test.ts +++ b/storage-resize-images/functions/__tests__/function.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { config } from "../src/config"; jest.mock("../src/config"); jest.mock("../src"); diff --git a/storage-resize-images/functions/__tests__/integration/content-filter.live.test.ts b/storage-resize-images/functions/__tests__/integration/content-filter.live.test.ts index 35f698f938..5e62616df2 100644 --- a/storage-resize-images/functions/__tests__/integration/content-filter.live.test.ts +++ b/storage-resize-images/functions/__tests__/integration/content-filter.live.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * Live integration tests for checkImageContent — these hit the real * Vertex AI Gemini 2.5 Flash API. They are skipped by default and only diff --git a/storage-resize-images/functions/__tests__/resize.test.ts b/storage-resize-images/functions/__tests__/resize.test.ts index a18d223761..cc6e6d5504 100644 --- a/storage-resize-images/functions/__tests__/resize.test.ts +++ b/storage-resize-images/functions/__tests__/resize.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as fs from "fs"; import mockedEnv from "mocked-env"; diff --git a/storage-resize-images/functions/__tests__/retry-queue.test.ts b/storage-resize-images/functions/__tests__/retry-queue.test.ts index 5296546b89..4bd24263b4 100644 --- a/storage-resize-images/functions/__tests__/retry-queue.test.ts +++ b/storage-resize-images/functions/__tests__/retry-queue.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import PQueue from "p-queue"; describe("RetryQueue", () => { diff --git a/storage-resize-images/functions/__tests__/test.types.d.ts b/storage-resize-images/functions/__tests__/test.types.d.ts index b0b202d31f..48fc67612f 100644 --- a/storage-resize-images/functions/__tests__/test.types.d.ts +++ b/storage-resize-images/functions/__tests__/test.types.d.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + declare namespace NodeJS { interface Global { config: () => jest.ModuleMocker; diff --git a/storage-resize-images/functions/__tests__/unit/generateResizedImageHandler.test.ts b/storage-resize-images/functions/__tests__/unit/generateResizedImageHandler.test.ts index db255d02ff..6f798607bf 100644 --- a/storage-resize-images/functions/__tests__/unit/generateResizedImageHandler.test.ts +++ b/storage-resize-images/functions/__tests__/unit/generateResizedImageHandler.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as path from "path"; import * as fs from "fs"; import { config as loadEnv } from "dotenv"; diff --git a/storage-resize-images/functions/__tests__/unit/modifyImage.test.ts b/storage-resize-images/functions/__tests__/unit/modifyImage.test.ts index c62b3aa9a4..e07d7b6c74 100644 --- a/storage-resize-images/functions/__tests__/unit/modifyImage.test.ts +++ b/storage-resize-images/functions/__tests__/unit/modifyImage.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as path from "path"; import { config } from "dotenv"; diff --git a/storage-resize-images/functions/__tests__/util.test.ts b/storage-resize-images/functions/__tests__/util.test.ts index ff25b85ff2..a450ee48e5 100644 --- a/storage-resize-images/functions/__tests__/util.test.ts +++ b/storage-resize-images/functions/__tests__/util.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { startsWithArray, convertPathToPosix } from "../src/util"; const imagePath = ["/test/picture"]; diff --git a/storage-resize-images/functions/__tests__/util.ts b/storage-resize-images/functions/__tests__/util.ts index 392be51060..1caa6c454a 100644 --- a/storage-resize-images/functions/__tests__/util.ts +++ b/storage-resize-images/functions/__tests__/util.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as admin from "firebase-admin"; export const waitForFile = async ( diff --git a/storage-resize-images/functions/__tests__/vulnerability.test.ts b/storage-resize-images/functions/__tests__/vulnerability.test.ts index 6f410c8147..055ea7adce 100644 --- a/storage-resize-images/functions/__tests__/vulnerability.test.ts +++ b/storage-resize-images/functions/__tests__/vulnerability.test.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + const firebase = require("firebase/app"); const firebaseAuth = require("firebase/auth"); const firebaseStorage = require("firebase/storage"); diff --git a/storage-resize-images/functions/jest.config.js b/storage-resize-images/functions/jest.config.js index 822dce175a..81de4c2e3c 100644 --- a/storage-resize-images/functions/jest.config.js +++ b/storage-resize-images/functions/jest.config.js @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + const packageJson = require("./package.json"); module.exports = { diff --git a/storage-resize-images/functions/src/content-filter.ts b/storage-resize-images/functions/src/content-filter.ts index e5bf484829..751f22f0d8 100644 --- a/storage-resize-images/functions/src/content-filter.ts +++ b/storage-resize-images/functions/src/content-filter.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import vertexAI, { gemini } from "@genkit-ai/vertexai"; import { genkit, z } from "genkit"; import type { SafetyThreshold } from "./config"; diff --git a/storage-resize-images/functions/src/events.ts b/storage-resize-images/functions/src/events.ts index 6b548d7665..9bf68a0fd9 100644 --- a/storage-resize-images/functions/src/events.ts +++ b/storage-resize-images/functions/src/events.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as eventArc from "firebase-admin/eventarc"; const { getEventarc } = eventArc; diff --git a/storage-resize-images/functions/src/file-operations.ts b/storage-resize-images/functions/src/file-operations.ts index 7ae0e566df..5b5909d417 100644 --- a/storage-resize-images/functions/src/file-operations.ts +++ b/storage-resize-images/functions/src/file-operations.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as path from "path"; import { ObjectMetadata } from "firebase-functions/v1/storage"; import { Bucket, File } from "@google-cloud/storage"; diff --git a/storage-resize-images/functions/src/filters.ts b/storage-resize-images/functions/src/filters.ts index 0f1487f4e3..8156f4a0dd 100644 --- a/storage-resize-images/functions/src/filters.ts +++ b/storage-resize-images/functions/src/filters.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as path from "path"; import * as logs from "./logs"; diff --git a/storage-resize-images/functions/src/global.ts b/storage-resize-images/functions/src/global.ts index 52f0777244..06c628e4d4 100644 --- a/storage-resize-images/functions/src/global.ts +++ b/storage-resize-images/functions/src/global.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import PQueue from "p-queue"; /** diff --git a/storage-resize-images/functions/src/placeholder.ts b/storage-resize-images/functions/src/placeholder.ts index 9e298b0093..43f2986e0f 100644 --- a/storage-resize-images/functions/src/placeholder.ts +++ b/storage-resize-images/functions/src/placeholder.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { Bucket } from "@google-cloud/storage"; import * as log from "./logs"; diff --git a/storage-resize-images/functions/src/resize-image.ts b/storage-resize-images/functions/src/resize-image.ts index 41b7eddb14..2372158118 100644 --- a/storage-resize-images/functions/src/resize-image.ts +++ b/storage-resize-images/functions/src/resize-image.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as os from "os"; import sharp from "sharp"; import * as path from "path"; diff --git a/storage-resize-images/functions/src/util.ts b/storage-resize-images/functions/src/util.ts index 017739b0d1..82f185bacb 100644 --- a/storage-resize-images/functions/src/util.ts +++ b/storage-resize-images/functions/src/util.ts @@ -1,3 +1,19 @@ +/** + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import * as path from "path"; import { FileMetadata } from "@google-cloud/storage"; From ad134fd2d982f4e58e8e1c97408ce382877bcfbd Mon Sep 17 00:00:00 2001 From: Jacob Cable Date: Thu, 30 Jul 2026 08:27:49 +0100 Subject: [PATCH 2/5] ci: enforce Apache license headers with addlicense Adds a license job to the Validate workflow that runs google/addlicense in check mode over tracked ts/js files. Run npm run license:fix locally to add missing headers. Claude-Session: https://claude.ai/code/session_013dz9GhC3metut6HFswPavu --- .github/workflows/validate.yml | 13 +++++++++++++ license-header.tmpl | 13 +++++++++++++ package.json | 2 ++ scripts/addlicense.sh | 18 ++++++++++++++++++ 4 files changed, 46 insertions(+) create mode 100644 license-header.tmpl create mode 100755 scripts/addlicense.sh diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 3e6db004a6..683c20b27f 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -18,3 +18,16 @@ jobs: run: SKIP_POSTINSTALL=yes npm i - name: Prettier Lint Check run: npm run lint + + license: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup go + uses: actions/setup-go@v5 + with: + go-version: stable + - name: Install addlicense + run: go install github.com/google/addlicense@v1.2.0 + - name: Check license headers + run: ./scripts/addlicense.sh check diff --git a/license-header.tmpl b/license-header.tmpl new file mode 100644 index 0000000000..34026aee82 --- /dev/null +++ b/license-header.tmpl @@ -0,0 +1,13 @@ +Copyright {{.Year}} Google LLC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/package.json b/package.json index c503359601..d5ca515df1 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,8 @@ "scripts": { "format": "prettier --write \"**/*.{js,md,yml,ts,json,yaml}\"", "lint": "prettier --list-different \"**/*.{js,md,yml,ts,json,yaml}\"", + "license:check": "./scripts/addlicense.sh check", + "license:fix": "./scripts/addlicense.sh fix", "clean": "lerna run --parallel clean && lerna clean", "build": "lerna run --sort build", "local:emulator": "cd _emulator && firebase emulators:start -P demo-test", diff --git a/scripts/addlicense.sh b/scripts/addlicense.sh new file mode 100755 index 0000000000..aef07ea749 --- /dev/null +++ b/scripts/addlicense.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# Checks (default) or adds Apache license headers on tracked .ts/.js files +# using google/addlicense. Usage: scripts/addlicense.sh [check|fix] +set -euo pipefail +cd "$(dirname "$0")/.." + +if ! command -v addlicense >/dev/null; then + echo "addlicense not found. Install: go install github.com/google/addlicense@v1.2.0" >&2 + exit 1 +fi + +mode="${1:-check}" +flags=(-f license-header.tmpl) +if [ "$mode" = "check" ]; then flags+=(-check); fi + +git ls-files -- '*.ts' '*.js' \ + | grep -vE '(^|/)(node_modules|lib|dist|coverage)/' \ + | xargs addlicense "${flags[@]}" From fd6aff9f462c66deddd027c129add1fc3260f2b9 Mon Sep 17 00:00:00 2001 From: Jacob Cable Date: Thu, 30 Jul 2026 08:31:48 +0100 Subject: [PATCH 3/5] ci: pin validate workflow actions to commit SHAs Required by zizmor unpinned-uses mandatory policy. Claude-Session: https://claude.ai/code/session_013dz9GhC3metut6HFswPavu --- .github/workflows/validate.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 683c20b27f..2d8bf17a7b 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -9,9 +9,9 @@ jobs: formatting: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - name: Setup node - uses: actions/setup-node@v3 + uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 with: node-version: 22 - name: NPM install @@ -22,9 +22,9 @@ jobs: license: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - name: Setup go - uses: actions/setup-go@v5 + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version: stable - name: Install addlicense From 651279a6743fc130a4f386096efb824aa7a48ae5 Mon Sep 17 00:00:00 2001 From: Jacob Cable Date: Thu, 30 Jul 2026 08:33:56 +0100 Subject: [PATCH 4/5] ci: restrict validate workflow to read-only permissions Resolves zizmor excessive-permissions finding. Claude-Session: https://claude.ai/code/session_013dz9GhC3metut6HFswPavu --- .github/workflows/validate.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 2d8bf17a7b..3f7de598d8 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -5,6 +5,9 @@ on: branches: - "**" +permissions: + contents: read + jobs: formatting: runs-on: ubuntu-latest From 93a8dc2850cb346896436f844e350d631b647417 Mon Sep 17 00:00:00 2001 From: Jacob Cable Date: Thu, 30 Jul 2026 08:37:18 +0100 Subject: [PATCH 5/5] chore: harden addlicense script NUL-separated file list for filenames with special characters, and reject unknown modes instead of defaulting to fix. Claude-Session: https://claude.ai/code/session_013dz9GhC3metut6HFswPavu --- scripts/addlicense.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/addlicense.sh b/scripts/addlicense.sh index aef07ea749..5da6ad8623 100755 --- a/scripts/addlicense.sh +++ b/scripts/addlicense.sh @@ -11,8 +11,13 @@ fi mode="${1:-check}" flags=(-f license-header.tmpl) -if [ "$mode" = "check" ]; then flags+=(-check); fi +if [ "$mode" = "check" ]; then + flags+=(-check) +elif [ "$mode" != "fix" ]; then + echo "Invalid mode: $mode. Usage: $0 [check|fix]" >&2 + exit 1 +fi -git ls-files -- '*.ts' '*.js' \ - | grep -vE '(^|/)(node_modules|lib|dist|coverage)/' \ - | xargs addlicense "${flags[@]}" +git ls-files -z -- '*.ts' '*.js' \ + | grep -zvE '(^|/)(node_modules|lib|dist|coverage)/' \ + | xargs -0 addlicense "${flags[@]}"