🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

@google-cloud/functions

Package Overview
Dependencies
Maintainers
2
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google-cloud/functions - npm Package Compare versions

Comparing version

to
4.0.0

build/src/v1/cloud_functions_service_proto_list.json

3

build/src/v1/cloud_functions_service_client.d.ts

@@ -20,2 +20,3 @@ import type * as gax from 'google-gax';

private _servicePath;
private _log;
auth: gax.GoogleAuth;

@@ -57,3 +58,3 @@ descriptors: Descriptors;

* app is running in an environment which supports
* {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
* {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},
* your project ID will be detected automatically.

@@ -60,0 +61,0 @@ * @param {string} [options.apiEndpoint] - The domain name of the

@@ -22,2 +22,3 @@ "use strict";

const jsonProtos = require("../../protos/protos.json");
const google_gax_1 = require("google-gax");
/**

@@ -36,2 +37,25 @@ * Client JSON configuration object, loaded from

class CloudFunctionsServiceClient {
_terminated = false;
_opts;
_providedCustomServicePath;
_gaxModule;
_gaxGrpc;
_protos;
_defaults;
_universeDomain;
_servicePath;
_log = google_gax_1.loggingUtils.log('functions');
auth;
descriptors = {
page: {},
stream: {},
longrunning: {},
batching: {},
};
warn;
innerApiCalls;
locationsClient;
pathTemplates;
operationsClient;
cloudFunctionsServiceStub;
/**

@@ -59,3 +83,3 @@ * Construct an instance of CloudFunctionsServiceClient.

* app is running in an environment which supports
* {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
* {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},
* your project ID will be detected automatically.

@@ -78,16 +102,8 @@ * @param {string} [options.apiEndpoint] - The domain name of the

constructor(opts, gaxInstance) {
var _a, _b, _c, _d, _e;
this._terminated = false;
this.descriptors = {
page: {},
stream: {},
longrunning: {},
batching: {},
};
// Ensure that options include all the required fields.
const staticMembers = this
.constructor;
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
if (opts?.universe_domain &&
opts?.universeDomain &&
opts?.universe_domain !== opts?.universeDomain) {
throw new Error('Please set either universe_domain or universeDomain, but not both.');

@@ -99,9 +115,13 @@ }

this._universeDomain =
(_c = (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : universeDomainEnvVar) !== null && _c !== void 0 ? _c : 'googleapis.com';
opts?.universeDomain ??
opts?.universe_domain ??
universeDomainEnvVar ??
'googleapis.com';
this._servicePath = 'cloudfunctions.' + this._universeDomain;
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
const fallback = (_e = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _e !== void 0 ? _e : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
const port = opts?.port || staticMembers.port;
const clientConfig = opts?.clientConfig ?? {};
const fallback = opts?.fallback ??
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);

@@ -333,3 +353,2 @@ // Request numeric enum values if REST transport is used.

getFunction(request, optionsOrCallback, callback) {
var _a;
request = request || {};

@@ -349,9 +368,20 @@ let options;

this._gaxModule.routingHeader.fromParams({
name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
name: request.name ?? '',
});
this.initialize();
return this.innerApiCalls.getFunction(request, options, callback);
this._log.info('getFunction request %j', request);
const wrappedCallback = callback
? (error, response, options, rawResponse) => {
this._log.info('getFunction response %j', response);
callback(error, response, options, rawResponse); // We verified callback above.
}
: undefined;
return this.innerApiCalls
.getFunction(request, options, wrappedCallback)
?.then(([response, options, rawResponse]) => {
this._log.info('getFunction response %j', response);
return [response, options, rawResponse];
});
}
callFunction(request, optionsOrCallback, callback) {
var _a;
request = request || {};

@@ -371,9 +401,20 @@ let options;

this._gaxModule.routingHeader.fromParams({
name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
name: request.name ?? '',
});
this.initialize();
return this.innerApiCalls.callFunction(request, options, callback);
this._log.info('callFunction request %j', request);
const wrappedCallback = callback
? (error, response, options, rawResponse) => {
this._log.info('callFunction response %j', response);
callback(error, response, options, rawResponse); // We verified callback above.
}
: undefined;
return this.innerApiCalls
.callFunction(request, options, wrappedCallback)
?.then(([response, options, rawResponse]) => {
this._log.info('callFunction response %j', response);
return [response, options, rawResponse];
});
}
generateUploadUrl(request, optionsOrCallback, callback) {
var _a;
request = request || {};

@@ -393,9 +434,20 @@ let options;

this._gaxModule.routingHeader.fromParams({
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
parent: request.parent ?? '',
});
this.initialize();
return this.innerApiCalls.generateUploadUrl(request, options, callback);
this._log.info('generateUploadUrl request %j', request);
const wrappedCallback = callback
? (error, response, options, rawResponse) => {
this._log.info('generateUploadUrl response %j', response);
callback(error, response, options, rawResponse); // We verified callback above.
}
: undefined;
return this.innerApiCalls
.generateUploadUrl(request, options, wrappedCallback)
?.then(([response, options, rawResponse]) => {
this._log.info('generateUploadUrl response %j', response);
return [response, options, rawResponse];
});
}
generateDownloadUrl(request, optionsOrCallback, callback) {
var _a;
request = request || {};

@@ -415,9 +467,20 @@ let options;

this._gaxModule.routingHeader.fromParams({
name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
name: request.name ?? '',
});
this.initialize();
return this.innerApiCalls.generateDownloadUrl(request, options, callback);
this._log.info('generateDownloadUrl request %j', request);
const wrappedCallback = callback
? (error, response, options, rawResponse) => {
this._log.info('generateDownloadUrl response %j', response);
callback(error, response, options, rawResponse); // We verified callback above.
}
: undefined;
return this.innerApiCalls
.generateDownloadUrl(request, options, wrappedCallback)
?.then(([response, options, rawResponse]) => {
this._log.info('generateDownloadUrl response %j', response);
return [response, options, rawResponse];
});
}
setIamPolicy(request, optionsOrCallback, callback) {
var _a;
request = request || {};

@@ -437,9 +500,20 @@ let options;

this._gaxModule.routingHeader.fromParams({
resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
resource: request.resource ?? '',
});
this.initialize();
return this.innerApiCalls.setIamPolicy(request, options, callback);
this._log.info('setIamPolicy request %j', request);
const wrappedCallback = callback
? (error, response, options, rawResponse) => {
this._log.info('setIamPolicy response %j', response);
callback(error, response, options, rawResponse); // We verified callback above.
}
: undefined;
return this.innerApiCalls
.setIamPolicy(request, options, wrappedCallback)
?.then(([response, options, rawResponse]) => {
this._log.info('setIamPolicy response %j', response);
return [response, options, rawResponse];
});
}
getIamPolicy(request, optionsOrCallback, callback) {
var _a;
request = request || {};

@@ -459,9 +533,20 @@ let options;

this._gaxModule.routingHeader.fromParams({
resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
resource: request.resource ?? '',
});
this.initialize();
return this.innerApiCalls.getIamPolicy(request, options, callback);
this._log.info('getIamPolicy request %j', request);
const wrappedCallback = callback
? (error, response, options, rawResponse) => {
this._log.info('getIamPolicy response %j', response);
callback(error, response, options, rawResponse); // We verified callback above.
}
: undefined;
return this.innerApiCalls
.getIamPolicy(request, options, wrappedCallback)
?.then(([response, options, rawResponse]) => {
this._log.info('getIamPolicy response %j', response);
return [response, options, rawResponse];
});
}
testIamPermissions(request, optionsOrCallback, callback) {
var _a;
request = request || {};

@@ -481,9 +566,20 @@ let options;

this._gaxModule.routingHeader.fromParams({
resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
resource: request.resource ?? '',
});
this.initialize();
return this.innerApiCalls.testIamPermissions(request, options, callback);
this._log.info('testIamPermissions request %j', request);
const wrappedCallback = callback
? (error, response, options, rawResponse) => {
this._log.info('testIamPermissions response %j', response);
callback(error, response, options, rawResponse); // We verified callback above.
}
: undefined;
return this.innerApiCalls
.testIamPermissions(request, options, wrappedCallback)
?.then(([response, options, rawResponse]) => {
this._log.info('testIamPermissions response %j', response);
return [response, options, rawResponse];
});
}
createFunction(request, optionsOrCallback, callback) {
var _a;
request = request || {};

@@ -503,6 +599,18 @@ let options;

this._gaxModule.routingHeader.fromParams({
location: (_a = request.location) !== null && _a !== void 0 ? _a : '',
location: request.location ?? '',
});
this.initialize();
return this.innerApiCalls.createFunction(request, options, callback);
const wrappedCallback = callback
? (error, response, rawResponse, _) => {
this._log.info('createFunction response %j', rawResponse);
callback(error, response, rawResponse, _); // We verified callback above.
}
: undefined;
this._log.info('createFunction request %j', request);
return this.innerApiCalls
.createFunction(request, options, wrappedCallback)
?.then(([response, rawResponse, _]) => {
this._log.info('createFunction response %j', rawResponse);
return [response, rawResponse, _];
});
}

@@ -521,2 +629,3 @@ /**

async checkCreateFunctionProgress(name) {
this._log.info('createFunction long-running');
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });

@@ -528,3 +637,2 @@ const [operation] = await this.operationsClient.getOperation(request);

updateFunction(request, optionsOrCallback, callback) {
var _a;
request = request || {};

@@ -544,6 +652,18 @@ let options;

this._gaxModule.routingHeader.fromParams({
'function.name': (_a = request.function.name) !== null && _a !== void 0 ? _a : '',
'function.name': request.function.name ?? '',
});
this.initialize();
return this.innerApiCalls.updateFunction(request, options, callback);
const wrappedCallback = callback
? (error, response, rawResponse, _) => {
this._log.info('updateFunction response %j', rawResponse);
callback(error, response, rawResponse, _); // We verified callback above.
}
: undefined;
this._log.info('updateFunction request %j', request);
return this.innerApiCalls
.updateFunction(request, options, wrappedCallback)
?.then(([response, rawResponse, _]) => {
this._log.info('updateFunction response %j', rawResponse);
return [response, rawResponse, _];
});
}

@@ -562,2 +682,3 @@ /**

async checkUpdateFunctionProgress(name) {
this._log.info('updateFunction long-running');
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });

@@ -569,3 +690,2 @@ const [operation] = await this.operationsClient.getOperation(request);

deleteFunction(request, optionsOrCallback, callback) {
var _a;
request = request || {};

@@ -585,6 +705,18 @@ let options;

this._gaxModule.routingHeader.fromParams({
name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
name: request.name ?? '',
});
this.initialize();
return this.innerApiCalls.deleteFunction(request, options, callback);
const wrappedCallback = callback
? (error, response, rawResponse, _) => {
this._log.info('deleteFunction response %j', rawResponse);
callback(error, response, rawResponse, _); // We verified callback above.
}
: undefined;
this._log.info('deleteFunction request %j', request);
return this.innerApiCalls
.deleteFunction(request, options, wrappedCallback)
?.then(([response, rawResponse, _]) => {
this._log.info('deleteFunction response %j', rawResponse);
return [response, rawResponse, _];
});
}

@@ -603,2 +735,3 @@ /**

async checkDeleteFunctionProgress(name) {
this._log.info('deleteFunction long-running');
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });

@@ -610,3 +743,2 @@ const [operation] = await this.operationsClient.getOperation(request);

listFunctions(request, optionsOrCallback, callback) {
var _a;
request = request || {};

@@ -626,6 +758,18 @@ let options;

this._gaxModule.routingHeader.fromParams({
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
parent: request.parent ?? '',
});
this.initialize();
return this.innerApiCalls.listFunctions(request, options, callback);
const wrappedCallback = callback
? (error, values, nextPageRequest, rawResponse) => {
this._log.info('listFunctions values %j', values);
callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
}
: undefined;
this._log.info('listFunctions request %j', request);
return this.innerApiCalls
.listFunctions(request, options, wrappedCallback)
?.then(([response, input, output]) => {
this._log.info('listFunctions values %j', response);
return [response, input, output];
});
}

@@ -662,3 +806,2 @@ /**

listFunctionsStream(request, options) {
var _a;
request = request || {};

@@ -670,3 +813,3 @@ options = options || {};

this._gaxModule.routingHeader.fromParams({
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
parent: request.parent ?? '',
});

@@ -676,2 +819,3 @@ const defaultCallSettings = this._defaults['listFunctions'];

this.initialize();
this._log.info('listFunctions stream %j', request);
return this.descriptors.page.listFunctions.createStream(this.innerApiCalls.listFunctions, request, callSettings);

@@ -712,3 +856,2 @@ }

listFunctionsAsync(request, options) {
var _a;
request = request || {};

@@ -720,3 +863,3 @@ options = options || {};

this._gaxModule.routingHeader.fromParams({
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
parent: request.parent ?? '',
});

@@ -726,2 +869,3 @@ const defaultCallSettings = this._defaults['listFunctions'];

this.initialize();
this._log.info('listFunctions iterate %j', request);
return this.descriptors.page.listFunctions.asyncIterate(this.innerApiCalls['listFunctions'], request, callSettings);

@@ -815,3 +959,2 @@ }

getOperation(request, optionsOrCallback, callback) {
var _a;
let options;

@@ -830,3 +973,3 @@ if (typeof optionsOrCallback === 'function' && callback === undefined) {

this._gaxModule.routingHeader.fromParams({
name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
name: request.name ?? '',
});

@@ -866,3 +1009,2 @@ return this.operationsClient.getOperation(request, options, callback);

listOperationsAsync(request, options) {
var _a;
options = options || {};

@@ -873,3 +1015,3 @@ options.otherArgs = options.otherArgs || {};

this._gaxModule.routingHeader.fromParams({
name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
name: request.name ?? '',
});

@@ -910,3 +1052,2 @@ return this.operationsClient.listOperationsAsync(request, options);

cancelOperation(request, optionsOrCallback, callback) {
var _a;
let options;

@@ -925,3 +1066,3 @@ if (typeof optionsOrCallback === 'function' && callback === undefined) {

this._gaxModule.routingHeader.fromParams({
name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
name: request.name ?? '',
});

@@ -956,3 +1097,2 @@ return this.operationsClient.cancelOperation(request, options, callback);

deleteOperation(request, optionsOrCallback, callback) {
var _a;
let options;

@@ -971,3 +1111,3 @@ if (typeof optionsOrCallback === 'function' && callback === undefined) {

this._gaxModule.routingHeader.fromParams({
name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
name: request.name ?? '',
});

@@ -1178,2 +1318,3 @@ return this.operationsClient.deleteOperation(request, options, callback);

return this.cloudFunctionsServiceStub.then(stub => {
this._log.info('ending gRPC channel');
this._terminated = true;

@@ -1180,0 +1321,0 @@ stub.close();

# Changelog
## [4.0.0](https://github.com/googleapis/google-cloud-node/compare/functions-v3.6.1...functions-v4.0.0) (2025-03-18)
### ⚠ BREAKING CHANGES
* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))
### Features
* [Many APIs] add request/response debug logging to gapics ([afcb5c0](https://github.com/googleapis/google-cloud-node/commit/afcb5c07e82bc8349b9677766cd880f69a97f77f))
### Miscellaneous Chores
* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436))
## [3.6.1](https://github.com/googleapis/google-cloud-node/compare/functions-v3.6.0...functions-v3.6.1) (2025-02-12)

@@ -4,0 +20,0 @@

{
"name": "@google-cloud/functions",
"version": "3.6.1",
"version": "4.0.0",
"description": "Functions client for Node.js",

@@ -48,25 +48,25 @@ "repository": {

"dependencies": {
"google-gax": "^4.0.3"
"google-gax": "^5.0.0-rc.0"
},
"devDependencies": {
"@types/mocha": "^9.0.0",
"@types/node": "^22.0.0",
"@types/sinon": "^17.0.0",
"c8": "^9.0.0",
"gapic-tools": "^0.4.0",
"gts": "^5.0.0",
"jsdoc": "^4.0.0",
"@types/mocha": "^10.0.10",
"@types/node": "^22.13.9",
"@types/sinon": "^17.0.4",
"c8": "^10.1.3",
"gapic-tools": "^1.0.0",
"gts": "^6.0.2",
"jsdoc": "^4.0.4",
"jsdoc-fresh": "^3.0.0",
"jsdoc-region-tag": "^3.0.0",
"linkinator": "4.1.2",
"long": "^5.2.3",
"mocha": "^9.2.2",
"pack-n-play": "^2.0.0",
"sinon": "^18.0.0",
"typescript": "^5.1.6"
"linkinator": "^6.1.2",
"long": "^5.3.1",
"mocha": "^11.1.0",
"pack-n-play": "^3.0.0",
"sinon": "^19.0.2",
"typescript": "^5.8.2"
},
"engines": {
"node": ">=14.0.0"
"node": ">=18"
},
"homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-functions"
}

@@ -46,3 +46,3 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost."

1. [Enable the Google Cloud Functions API][enable_api].
1. [Set up authentication][auth] so you can access the
1. [Set up authentication with a service account][auth] so you can access the
API from your local workstation.

@@ -196,2 +196,2 @@

[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=cloudfunctions.googleapis.com
[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local
[auth]: https://cloud.google.com/docs/authentication/getting-started

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display