@google-analytics/data 4.3.0 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/build/protos/google/analytics/data/v1alpha/analytics_data_api.proto +101 -16
- package/build/protos/protos.d.ts +128 -1
- package/build/protos/protos.js +348 -1
- package/build/protos/protos.json +58 -0
- package/build/src/index.js +1 -1
- package/build/src/v1alpha/alpha_analytics_data_client.d.ts +145 -18
- package/build/src/v1alpha/alpha_analytics_data_client.js +165 -10
- package/build/src/v1alpha/index.js +1 -1
- package/build/src/v1beta/beta_analytics_data_client.d.ts +11 -2
- package/build/src/v1beta/beta_analytics_data_client.js +37 -10
- package/build/src/v1beta/index.js +1 -1
- package/package.json +2 -2
|
@@ -16,6 +16,8 @@ export declare class AlphaAnalyticsDataClient {
|
|
|
16
16
|
private _gaxGrpc;
|
|
17
17
|
private _protos;
|
|
18
18
|
private _defaults;
|
|
19
|
+
private _universeDomain;
|
|
20
|
+
private _servicePath;
|
|
19
21
|
auth: gax.GoogleAuth;
|
|
20
22
|
descriptors: Descriptors;
|
|
21
23
|
warn: (code: string, message: string, warnType?: string) => void;
|
|
@@ -85,15 +87,22 @@ export declare class AlphaAnalyticsDataClient {
|
|
|
85
87
|
}>;
|
|
86
88
|
/**
|
|
87
89
|
* The DNS address for this API service.
|
|
90
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
88
91
|
* @returns {string} The DNS address for this service.
|
|
89
92
|
*/
|
|
90
93
|
static get servicePath(): string;
|
|
91
94
|
/**
|
|
92
|
-
* The DNS address for this API service - same as servicePath
|
|
93
|
-
*
|
|
95
|
+
* The DNS address for this API service - same as servicePath.
|
|
96
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
94
97
|
* @returns {string} The DNS address for this service.
|
|
95
98
|
*/
|
|
96
99
|
static get apiEndpoint(): string;
|
|
100
|
+
/**
|
|
101
|
+
* The DNS address for this API service.
|
|
102
|
+
* @returns {string} The DNS address for this service.
|
|
103
|
+
*/
|
|
104
|
+
get apiEndpoint(): string;
|
|
105
|
+
get universeDomain(): string;
|
|
97
106
|
/**
|
|
98
107
|
* The port for this API service.
|
|
99
108
|
* @returns {number} The default port for this service.
|
|
@@ -219,11 +228,10 @@ export declare class AlphaAnalyticsDataClient {
|
|
|
219
228
|
* that are important to your business. To learn more, see
|
|
220
229
|
* https://support.google.com/analytics/answer/9267572.
|
|
221
230
|
*
|
|
222
|
-
* This method is
|
|
223
|
-
*
|
|
224
|
-
* your feedback on this API, complete the
|
|
225
|
-
*
|
|
226
|
-
* Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
|
|
231
|
+
* This method is available at beta stability at
|
|
232
|
+
* [audienceExports.query](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/query).
|
|
233
|
+
* To give your feedback on this API, complete the [Google Analytics Audience
|
|
234
|
+
* Export API Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
|
|
227
235
|
*
|
|
228
236
|
* @param {Object} request
|
|
229
237
|
* The request object that will be sent.
|
|
@@ -338,9 +346,9 @@ export declare class AlphaAnalyticsDataClient {
|
|
|
338
346
|
* List](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics)
|
|
339
347
|
* for an introduction to Audience Lists with examples.
|
|
340
348
|
*
|
|
341
|
-
* This method is
|
|
342
|
-
*
|
|
343
|
-
* your feedback on this API, complete the
|
|
349
|
+
* This method is available at beta stability at
|
|
350
|
+
* [audienceExports.get](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/get).
|
|
351
|
+
* To give your feedback on this API, complete the
|
|
344
352
|
* [Google Analytics Audience Export API
|
|
345
353
|
* Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
|
|
346
354
|
*
|
|
@@ -464,11 +472,10 @@ export declare class AlphaAnalyticsDataClient {
|
|
|
464
472
|
* https://support.google.com/analytics/answer/9267572. Audience lists contain
|
|
465
473
|
* the users in each audience.
|
|
466
474
|
*
|
|
467
|
-
* This method is
|
|
468
|
-
*
|
|
469
|
-
* your feedback on this API, complete the
|
|
470
|
-
*
|
|
471
|
-
* Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
|
|
475
|
+
* This method is available at beta stability at
|
|
476
|
+
* [audienceExports.create](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/create).
|
|
477
|
+
* To give your feedback on this API, complete the [Google Analytics Audience
|
|
478
|
+
* Export API Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
|
|
472
479
|
*
|
|
473
480
|
* @param {Object} request
|
|
474
481
|
* The request object that will be sent.
|
|
@@ -517,9 +524,9 @@ export declare class AlphaAnalyticsDataClient {
|
|
|
517
524
|
* List](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics)
|
|
518
525
|
* for an introduction to Audience Lists with examples.
|
|
519
526
|
*
|
|
520
|
-
* This method is
|
|
521
|
-
*
|
|
522
|
-
* your feedback on this API, complete the
|
|
527
|
+
* This method is available at beta stability at
|
|
528
|
+
* [audienceExports.list](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/list).
|
|
529
|
+
* To give your feedback on this API, complete the
|
|
523
530
|
* [Google Analytics Audience Export API
|
|
524
531
|
* Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
|
|
525
532
|
*
|
|
@@ -739,6 +746,126 @@ export declare class AlphaAnalyticsDataClient {
|
|
|
739
746
|
* region_tag:analyticsdata_v1alpha_generated_AlphaAnalyticsData_ListRecurringAudienceLists_async
|
|
740
747
|
*/
|
|
741
748
|
listRecurringAudienceListsAsync(request?: protos.google.analytics.data.v1alpha.IListRecurringAudienceListsRequest, options?: CallOptions): AsyncIterable<protos.google.analytics.data.v1alpha.IRecurringAudienceList>;
|
|
749
|
+
/**
|
|
750
|
+
* Gets the latest state of a long-running operation. Clients can use this
|
|
751
|
+
* method to poll the operation result at intervals as recommended by the API
|
|
752
|
+
* service.
|
|
753
|
+
*
|
|
754
|
+
* @param {Object} request - The request object that will be sent.
|
|
755
|
+
* @param {string} request.name - The name of the operation resource.
|
|
756
|
+
* @param {Object=} options
|
|
757
|
+
* Optional parameters. You can override the default settings for this call,
|
|
758
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
|
759
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
|
|
760
|
+
* for the details.
|
|
761
|
+
* @param {function(?Error, ?Object)=} callback
|
|
762
|
+
* The function which will be called with the result of the API call.
|
|
763
|
+
*
|
|
764
|
+
* The second parameter to the callback is an object representing
|
|
765
|
+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
|
|
766
|
+
* @return {Promise} - The promise which resolves to an array.
|
|
767
|
+
* The first element of the array is an object representing
|
|
768
|
+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
|
|
769
|
+
* The promise has a method named "cancel" which cancels the ongoing API call.
|
|
770
|
+
*
|
|
771
|
+
* @example
|
|
772
|
+
* ```
|
|
773
|
+
* const client = longrunning.operationsClient();
|
|
774
|
+
* const name = '';
|
|
775
|
+
* const [response] = await client.getOperation({name});
|
|
776
|
+
* // doThingsWith(response)
|
|
777
|
+
* ```
|
|
778
|
+
*/
|
|
779
|
+
getOperation(request: protos.google.longrunning.GetOperationRequest, options?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.Operation]>;
|
|
780
|
+
/**
|
|
781
|
+
* Lists operations that match the specified filter in the request. If the
|
|
782
|
+
* server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.
|
|
783
|
+
*
|
|
784
|
+
* For-await-of syntax is used with the iterable to recursively get response element on-demand.
|
|
785
|
+
*
|
|
786
|
+
* @param {Object} request - The request object that will be sent.
|
|
787
|
+
* @param {string} request.name - The name of the operation collection.
|
|
788
|
+
* @param {string} request.filter - The standard list filter.
|
|
789
|
+
* @param {number=} request.pageSize -
|
|
790
|
+
* The maximum number of resources contained in the underlying API
|
|
791
|
+
* response. If page streaming is performed per-resource, this
|
|
792
|
+
* parameter does not affect the return value. If page streaming is
|
|
793
|
+
* performed per-page, this determines the maximum number of
|
|
794
|
+
* resources in a page.
|
|
795
|
+
* @param {Object=} options
|
|
796
|
+
* Optional parameters. You can override the default settings for this call,
|
|
797
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
|
798
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
|
|
799
|
+
* details.
|
|
800
|
+
* @returns {Object}
|
|
801
|
+
* An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}.
|
|
802
|
+
*
|
|
803
|
+
* @example
|
|
804
|
+
* ```
|
|
805
|
+
* const client = longrunning.operationsClient();
|
|
806
|
+
* for await (const response of client.listOperationsAsync(request));
|
|
807
|
+
* // doThingsWith(response)
|
|
808
|
+
* ```
|
|
809
|
+
*/
|
|
810
|
+
listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.ListOperationsResponse>;
|
|
811
|
+
/**
|
|
812
|
+
* Starts asynchronous cancellation on a long-running operation. The server
|
|
813
|
+
* makes a best effort to cancel the operation, but success is not
|
|
814
|
+
* guaranteed. If the server doesn't support this method, it returns
|
|
815
|
+
* `google.rpc.Code.UNIMPLEMENTED`. Clients can use
|
|
816
|
+
* {@link Operations.GetOperation} or
|
|
817
|
+
* other methods to check whether the cancellation succeeded or whether the
|
|
818
|
+
* operation completed despite cancellation. On successful cancellation,
|
|
819
|
+
* the operation is not deleted; instead, it becomes an operation with
|
|
820
|
+
* an {@link Operation.error} value with a {@link google.rpc.Status.code} of
|
|
821
|
+
* 1, corresponding to `Code.CANCELLED`.
|
|
822
|
+
*
|
|
823
|
+
* @param {Object} request - The request object that will be sent.
|
|
824
|
+
* @param {string} request.name - The name of the operation resource to be cancelled.
|
|
825
|
+
* @param {Object=} options
|
|
826
|
+
* Optional parameters. You can override the default settings for this call,
|
|
827
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
|
828
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
|
|
829
|
+
* details.
|
|
830
|
+
* @param {function(?Error)=} callback
|
|
831
|
+
* The function which will be called with the result of the API call.
|
|
832
|
+
* @return {Promise} - The promise which resolves when API call finishes.
|
|
833
|
+
* The promise has a method named "cancel" which cancels the ongoing API
|
|
834
|
+
* call.
|
|
835
|
+
*
|
|
836
|
+
* @example
|
|
837
|
+
* ```
|
|
838
|
+
* const client = longrunning.operationsClient();
|
|
839
|
+
* await client.cancelOperation({name: ''});
|
|
840
|
+
* ```
|
|
841
|
+
*/
|
|
842
|
+
cancelOperation(request: protos.google.longrunning.CancelOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.Empty>;
|
|
843
|
+
/**
|
|
844
|
+
* Deletes a long-running operation. This method indicates that the client is
|
|
845
|
+
* no longer interested in the operation result. It does not cancel the
|
|
846
|
+
* operation. If the server doesn't support this method, it returns
|
|
847
|
+
* `google.rpc.Code.UNIMPLEMENTED`.
|
|
848
|
+
*
|
|
849
|
+
* @param {Object} request - The request object that will be sent.
|
|
850
|
+
* @param {string} request.name - The name of the operation resource to be deleted.
|
|
851
|
+
* @param {Object=} options
|
|
852
|
+
* Optional parameters. You can override the default settings for this call,
|
|
853
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
|
854
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
|
|
855
|
+
* for the details.
|
|
856
|
+
* @param {function(?Error)=} callback
|
|
857
|
+
* The function which will be called with the result of the API call.
|
|
858
|
+
* @return {Promise} - The promise which resolves when API call finishes.
|
|
859
|
+
* The promise has a method named "cancel" which cancels the ongoing API
|
|
860
|
+
* call.
|
|
861
|
+
*
|
|
862
|
+
* @example
|
|
863
|
+
* ```
|
|
864
|
+
* const client = longrunning.operationsClient();
|
|
865
|
+
* await client.deleteOperation({name: ''});
|
|
866
|
+
* ```
|
|
867
|
+
*/
|
|
868
|
+
deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): Promise<protos.google.protobuf.Empty>;
|
|
742
869
|
/**
|
|
743
870
|
* Return a fully-qualified audienceList resource name string.
|
|
744
871
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright
|
|
2
|
+
// Copyright 2024 Google LLC
|
|
3
3
|
//
|
|
4
4
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
// you may not use this file except in compliance with the License.
|
|
@@ -72,7 +72,7 @@ class AlphaAnalyticsDataClient {
|
|
|
72
72
|
* ```
|
|
73
73
|
*/
|
|
74
74
|
constructor(opts, gaxInstance) {
|
|
75
|
-
var _a, _b;
|
|
75
|
+
var _a, _b, _c, _d;
|
|
76
76
|
this._terminated = false;
|
|
77
77
|
this.descriptors = {
|
|
78
78
|
page: {},
|
|
@@ -82,16 +82,24 @@ class AlphaAnalyticsDataClient {
|
|
|
82
82
|
};
|
|
83
83
|
// Ensure that options include all the required fields.
|
|
84
84
|
const staticMembers = this.constructor;
|
|
85
|
-
|
|
85
|
+
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
|
|
86
|
+
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
|
|
87
|
+
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
|
|
88
|
+
throw new Error('Please set either universe_domain or universeDomain, but not both.');
|
|
89
|
+
}
|
|
90
|
+
this._universeDomain =
|
|
91
|
+
(_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 : 'googleapis.com';
|
|
92
|
+
this._servicePath = 'analyticsdata.' + this._universeDomain;
|
|
93
|
+
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
|
|
86
94
|
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
|
|
87
95
|
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
|
|
88
|
-
const clientConfig = (
|
|
89
|
-
const fallback = (
|
|
96
|
+
const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {};
|
|
97
|
+
const fallback = (_d = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _d !== void 0 ? _d : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
|
|
90
98
|
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
|
|
91
99
|
// Request numeric enum values if REST transport is used.
|
|
92
100
|
opts.numericEnums = true;
|
|
93
101
|
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
|
|
94
|
-
if (servicePath !==
|
|
102
|
+
if (servicePath !== this._servicePath && !('scopes' in opts)) {
|
|
95
103
|
opts['scopes'] = staticMembers.scopes;
|
|
96
104
|
}
|
|
97
105
|
// Load google-gax module synchronously if needed
|
|
@@ -109,9 +117,9 @@ class AlphaAnalyticsDataClient {
|
|
|
109
117
|
// Set useJWTAccessWithScope on the auth object.
|
|
110
118
|
this.auth.useJWTAccessWithScope = true;
|
|
111
119
|
// Set defaultServicePath on the auth object.
|
|
112
|
-
this.auth.defaultServicePath =
|
|
120
|
+
this.auth.defaultServicePath = this._servicePath;
|
|
113
121
|
// Set the default scopes in auth client if needed.
|
|
114
|
-
if (servicePath ===
|
|
122
|
+
if (servicePath === this._servicePath) {
|
|
115
123
|
this.auth.defaultScopes = staticMembers.scopes;
|
|
116
124
|
}
|
|
117
125
|
// Determine the client header string.
|
|
@@ -233,19 +241,38 @@ class AlphaAnalyticsDataClient {
|
|
|
233
241
|
}
|
|
234
242
|
/**
|
|
235
243
|
* The DNS address for this API service.
|
|
244
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
236
245
|
* @returns {string} The DNS address for this service.
|
|
237
246
|
*/
|
|
238
247
|
static get servicePath() {
|
|
248
|
+
if (typeof process !== undefined &&
|
|
249
|
+
typeof process.emitWarning === 'function') {
|
|
250
|
+
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
|
251
|
+
}
|
|
239
252
|
return 'analyticsdata.googleapis.com';
|
|
240
253
|
}
|
|
241
254
|
/**
|
|
242
|
-
* The DNS address for this API service - same as servicePath
|
|
243
|
-
*
|
|
255
|
+
* The DNS address for this API service - same as servicePath.
|
|
256
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
244
257
|
* @returns {string} The DNS address for this service.
|
|
245
258
|
*/
|
|
246
259
|
static get apiEndpoint() {
|
|
260
|
+
if (typeof process !== undefined &&
|
|
261
|
+
typeof process.emitWarning === 'function') {
|
|
262
|
+
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
|
263
|
+
}
|
|
247
264
|
return 'analyticsdata.googleapis.com';
|
|
248
265
|
}
|
|
266
|
+
/**
|
|
267
|
+
* The DNS address for this API service.
|
|
268
|
+
* @returns {string} The DNS address for this service.
|
|
269
|
+
*/
|
|
270
|
+
get apiEndpoint() {
|
|
271
|
+
return this._servicePath;
|
|
272
|
+
}
|
|
273
|
+
get universeDomain() {
|
|
274
|
+
return this._universeDomain;
|
|
275
|
+
}
|
|
249
276
|
/**
|
|
250
277
|
* The port for this API service.
|
|
251
278
|
* @returns {number} The default port for this service.
|
|
@@ -670,6 +697,134 @@ class AlphaAnalyticsDataClient {
|
|
|
670
697
|
this.initialize();
|
|
671
698
|
return this.descriptors.page.listRecurringAudienceLists.asyncIterate(this.innerApiCalls['listRecurringAudienceLists'], request, callSettings);
|
|
672
699
|
}
|
|
700
|
+
/**
|
|
701
|
+
* Gets the latest state of a long-running operation. Clients can use this
|
|
702
|
+
* method to poll the operation result at intervals as recommended by the API
|
|
703
|
+
* service.
|
|
704
|
+
*
|
|
705
|
+
* @param {Object} request - The request object that will be sent.
|
|
706
|
+
* @param {string} request.name - The name of the operation resource.
|
|
707
|
+
* @param {Object=} options
|
|
708
|
+
* Optional parameters. You can override the default settings for this call,
|
|
709
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
|
710
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
|
|
711
|
+
* for the details.
|
|
712
|
+
* @param {function(?Error, ?Object)=} callback
|
|
713
|
+
* The function which will be called with the result of the API call.
|
|
714
|
+
*
|
|
715
|
+
* The second parameter to the callback is an object representing
|
|
716
|
+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
|
|
717
|
+
* @return {Promise} - The promise which resolves to an array.
|
|
718
|
+
* The first element of the array is an object representing
|
|
719
|
+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
|
|
720
|
+
* The promise has a method named "cancel" which cancels the ongoing API call.
|
|
721
|
+
*
|
|
722
|
+
* @example
|
|
723
|
+
* ```
|
|
724
|
+
* const client = longrunning.operationsClient();
|
|
725
|
+
* const name = '';
|
|
726
|
+
* const [response] = await client.getOperation({name});
|
|
727
|
+
* // doThingsWith(response)
|
|
728
|
+
* ```
|
|
729
|
+
*/
|
|
730
|
+
getOperation(request, options, callback) {
|
|
731
|
+
return this.operationsClient.getOperation(request, options, callback);
|
|
732
|
+
}
|
|
733
|
+
/**
|
|
734
|
+
* Lists operations that match the specified filter in the request. If the
|
|
735
|
+
* server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.
|
|
736
|
+
*
|
|
737
|
+
* For-await-of syntax is used with the iterable to recursively get response element on-demand.
|
|
738
|
+
*
|
|
739
|
+
* @param {Object} request - The request object that will be sent.
|
|
740
|
+
* @param {string} request.name - The name of the operation collection.
|
|
741
|
+
* @param {string} request.filter - The standard list filter.
|
|
742
|
+
* @param {number=} request.pageSize -
|
|
743
|
+
* The maximum number of resources contained in the underlying API
|
|
744
|
+
* response. If page streaming is performed per-resource, this
|
|
745
|
+
* parameter does not affect the return value. If page streaming is
|
|
746
|
+
* performed per-page, this determines the maximum number of
|
|
747
|
+
* resources in a page.
|
|
748
|
+
* @param {Object=} options
|
|
749
|
+
* Optional parameters. You can override the default settings for this call,
|
|
750
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
|
751
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
|
|
752
|
+
* details.
|
|
753
|
+
* @returns {Object}
|
|
754
|
+
* An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}.
|
|
755
|
+
*
|
|
756
|
+
* @example
|
|
757
|
+
* ```
|
|
758
|
+
* const client = longrunning.operationsClient();
|
|
759
|
+
* for await (const response of client.listOperationsAsync(request));
|
|
760
|
+
* // doThingsWith(response)
|
|
761
|
+
* ```
|
|
762
|
+
*/
|
|
763
|
+
listOperationsAsync(request, options) {
|
|
764
|
+
return this.operationsClient.listOperationsAsync(request, options);
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* Starts asynchronous cancellation on a long-running operation. The server
|
|
768
|
+
* makes a best effort to cancel the operation, but success is not
|
|
769
|
+
* guaranteed. If the server doesn't support this method, it returns
|
|
770
|
+
* `google.rpc.Code.UNIMPLEMENTED`. Clients can use
|
|
771
|
+
* {@link Operations.GetOperation} or
|
|
772
|
+
* other methods to check whether the cancellation succeeded or whether the
|
|
773
|
+
* operation completed despite cancellation. On successful cancellation,
|
|
774
|
+
* the operation is not deleted; instead, it becomes an operation with
|
|
775
|
+
* an {@link Operation.error} value with a {@link google.rpc.Status.code} of
|
|
776
|
+
* 1, corresponding to `Code.CANCELLED`.
|
|
777
|
+
*
|
|
778
|
+
* @param {Object} request - The request object that will be sent.
|
|
779
|
+
* @param {string} request.name - The name of the operation resource to be cancelled.
|
|
780
|
+
* @param {Object=} options
|
|
781
|
+
* Optional parameters. You can override the default settings for this call,
|
|
782
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
|
783
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
|
|
784
|
+
* details.
|
|
785
|
+
* @param {function(?Error)=} callback
|
|
786
|
+
* The function which will be called with the result of the API call.
|
|
787
|
+
* @return {Promise} - The promise which resolves when API call finishes.
|
|
788
|
+
* The promise has a method named "cancel" which cancels the ongoing API
|
|
789
|
+
* call.
|
|
790
|
+
*
|
|
791
|
+
* @example
|
|
792
|
+
* ```
|
|
793
|
+
* const client = longrunning.operationsClient();
|
|
794
|
+
* await client.cancelOperation({name: ''});
|
|
795
|
+
* ```
|
|
796
|
+
*/
|
|
797
|
+
cancelOperation(request, options, callback) {
|
|
798
|
+
return this.operationsClient.cancelOperation(request, options, callback);
|
|
799
|
+
}
|
|
800
|
+
/**
|
|
801
|
+
* Deletes a long-running operation. This method indicates that the client is
|
|
802
|
+
* no longer interested in the operation result. It does not cancel the
|
|
803
|
+
* operation. If the server doesn't support this method, it returns
|
|
804
|
+
* `google.rpc.Code.UNIMPLEMENTED`.
|
|
805
|
+
*
|
|
806
|
+
* @param {Object} request - The request object that will be sent.
|
|
807
|
+
* @param {string} request.name - The name of the operation resource to be deleted.
|
|
808
|
+
* @param {Object=} options
|
|
809
|
+
* Optional parameters. You can override the default settings for this call,
|
|
810
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
|
811
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
|
|
812
|
+
* for the details.
|
|
813
|
+
* @param {function(?Error)=} callback
|
|
814
|
+
* The function which will be called with the result of the API call.
|
|
815
|
+
* @return {Promise} - The promise which resolves when API call finishes.
|
|
816
|
+
* The promise has a method named "cancel" which cancels the ongoing API
|
|
817
|
+
* call.
|
|
818
|
+
*
|
|
819
|
+
* @example
|
|
820
|
+
* ```
|
|
821
|
+
* const client = longrunning.operationsClient();
|
|
822
|
+
* await client.deleteOperation({name: ''});
|
|
823
|
+
* ```
|
|
824
|
+
*/
|
|
825
|
+
deleteOperation(request, options, callback) {
|
|
826
|
+
return this.operationsClient.deleteOperation(request, options, callback);
|
|
827
|
+
}
|
|
673
828
|
// --------------------
|
|
674
829
|
// -- Path templates --
|
|
675
830
|
// --------------------
|
|
@@ -16,6 +16,8 @@ export declare class BetaAnalyticsDataClient {
|
|
|
16
16
|
private _gaxGrpc;
|
|
17
17
|
private _protos;
|
|
18
18
|
private _defaults;
|
|
19
|
+
private _universeDomain;
|
|
20
|
+
private _servicePath;
|
|
19
21
|
auth: gax.GoogleAuth;
|
|
20
22
|
descriptors: Descriptors;
|
|
21
23
|
warn: (code: string, message: string, warnType?: string) => void;
|
|
@@ -85,15 +87,22 @@ export declare class BetaAnalyticsDataClient {
|
|
|
85
87
|
}>;
|
|
86
88
|
/**
|
|
87
89
|
* The DNS address for this API service.
|
|
90
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
88
91
|
* @returns {string} The DNS address for this service.
|
|
89
92
|
*/
|
|
90
93
|
static get servicePath(): string;
|
|
91
94
|
/**
|
|
92
|
-
* The DNS address for this API service - same as servicePath
|
|
93
|
-
*
|
|
95
|
+
* The DNS address for this API service - same as servicePath.
|
|
96
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
94
97
|
* @returns {string} The DNS address for this service.
|
|
95
98
|
*/
|
|
96
99
|
static get apiEndpoint(): string;
|
|
100
|
+
/**
|
|
101
|
+
* The DNS address for this API service.
|
|
102
|
+
* @returns {string} The DNS address for this service.
|
|
103
|
+
*/
|
|
104
|
+
get apiEndpoint(): string;
|
|
105
|
+
get universeDomain(): string;
|
|
97
106
|
/**
|
|
98
107
|
* The port for this API service.
|
|
99
108
|
* @returns {number} The default port for this service.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright
|
|
2
|
+
// Copyright 2024 Google LLC
|
|
3
3
|
//
|
|
4
4
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
// you may not use this file except in compliance with the License.
|
|
@@ -72,7 +72,7 @@ class BetaAnalyticsDataClient {
|
|
|
72
72
|
* ```
|
|
73
73
|
*/
|
|
74
74
|
constructor(opts, gaxInstance) {
|
|
75
|
-
var _a, _b;
|
|
75
|
+
var _a, _b, _c, _d;
|
|
76
76
|
this._terminated = false;
|
|
77
77
|
this.descriptors = {
|
|
78
78
|
page: {},
|
|
@@ -82,16 +82,24 @@ class BetaAnalyticsDataClient {
|
|
|
82
82
|
};
|
|
83
83
|
// Ensure that options include all the required fields.
|
|
84
84
|
const staticMembers = this.constructor;
|
|
85
|
-
|
|
85
|
+
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
|
|
86
|
+
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
|
|
87
|
+
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
|
|
88
|
+
throw new Error('Please set either universe_domain or universeDomain, but not both.');
|
|
89
|
+
}
|
|
90
|
+
this._universeDomain =
|
|
91
|
+
(_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 : 'googleapis.com';
|
|
92
|
+
this._servicePath = 'analyticsdata.' + this._universeDomain;
|
|
93
|
+
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
|
|
86
94
|
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
|
|
87
95
|
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
|
|
88
|
-
const clientConfig = (
|
|
89
|
-
const fallback = (
|
|
96
|
+
const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {};
|
|
97
|
+
const fallback = (_d = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _d !== void 0 ? _d : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
|
|
90
98
|
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
|
|
91
99
|
// Request numeric enum values if REST transport is used.
|
|
92
100
|
opts.numericEnums = true;
|
|
93
101
|
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
|
|
94
|
-
if (servicePath !==
|
|
102
|
+
if (servicePath !== this._servicePath && !('scopes' in opts)) {
|
|
95
103
|
opts['scopes'] = staticMembers.scopes;
|
|
96
104
|
}
|
|
97
105
|
// Load google-gax module synchronously if needed
|
|
@@ -109,9 +117,9 @@ class BetaAnalyticsDataClient {
|
|
|
109
117
|
// Set useJWTAccessWithScope on the auth object.
|
|
110
118
|
this.auth.useJWTAccessWithScope = true;
|
|
111
119
|
// Set defaultServicePath on the auth object.
|
|
112
|
-
this.auth.defaultServicePath =
|
|
120
|
+
this.auth.defaultServicePath = this._servicePath;
|
|
113
121
|
// Set the default scopes in auth client if needed.
|
|
114
|
-
if (servicePath ===
|
|
122
|
+
if (servicePath === this._servicePath) {
|
|
115
123
|
this.auth.defaultScopes = staticMembers.scopes;
|
|
116
124
|
}
|
|
117
125
|
// Determine the client header string.
|
|
@@ -233,19 +241,38 @@ class BetaAnalyticsDataClient {
|
|
|
233
241
|
}
|
|
234
242
|
/**
|
|
235
243
|
* The DNS address for this API service.
|
|
244
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
236
245
|
* @returns {string} The DNS address for this service.
|
|
237
246
|
*/
|
|
238
247
|
static get servicePath() {
|
|
248
|
+
if (typeof process !== undefined &&
|
|
249
|
+
typeof process.emitWarning === 'function') {
|
|
250
|
+
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
|
251
|
+
}
|
|
239
252
|
return 'analyticsdata.googleapis.com';
|
|
240
253
|
}
|
|
241
254
|
/**
|
|
242
|
-
* The DNS address for this API service - same as servicePath
|
|
243
|
-
*
|
|
255
|
+
* The DNS address for this API service - same as servicePath.
|
|
256
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
244
257
|
* @returns {string} The DNS address for this service.
|
|
245
258
|
*/
|
|
246
259
|
static get apiEndpoint() {
|
|
260
|
+
if (typeof process !== undefined &&
|
|
261
|
+
typeof process.emitWarning === 'function') {
|
|
262
|
+
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
|
263
|
+
}
|
|
247
264
|
return 'analyticsdata.googleapis.com';
|
|
248
265
|
}
|
|
266
|
+
/**
|
|
267
|
+
* The DNS address for this API service.
|
|
268
|
+
* @returns {string} The DNS address for this service.
|
|
269
|
+
*/
|
|
270
|
+
get apiEndpoint() {
|
|
271
|
+
return this._servicePath;
|
|
272
|
+
}
|
|
273
|
+
get universeDomain() {
|
|
274
|
+
return this._universeDomain;
|
|
275
|
+
}
|
|
249
276
|
/**
|
|
250
277
|
* The port for this API service.
|
|
251
278
|
* @returns {number} The default port for this service.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google-analytics/data",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "Data client for Node.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@types/node": "^20.4.5",
|
|
53
53
|
"@types/sinon": "^17.0.0",
|
|
54
54
|
"c8": "^8.0.1",
|
|
55
|
-
"gapic-tools": "^0.
|
|
55
|
+
"gapic-tools": "^0.3.0",
|
|
56
56
|
"gts": "^5.0.0",
|
|
57
57
|
"jsdoc": "^4.0.0",
|
|
58
58
|
"jsdoc-fresh": "^3.0.0",
|