google-ads-api 13.0.0-global-service-cache-alpha-0 → 13.0.1
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/build/src/customer.d.ts +6 -6
- package/build/src/customer.js +1 -2
- package/build/src/query.d.ts +8 -8
- package/package.json +1 -1
package/build/src/customer.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare class Customer extends ServiceFactory {
|
|
|
10
10
|
@description Single query using a raw GAQL string.
|
|
11
11
|
@hooks onQueryStart, onQueryError, onQueryEnd
|
|
12
12
|
*/
|
|
13
|
-
query<T = services.IGoogleAdsRow[]>(gaqlQuery: string, requestOptions?: RequestOptions): Promise<T>;
|
|
13
|
+
query<T = services.IGoogleAdsRow[]>(gaqlQuery: string, requestOptions?: Readonly<RequestOptions>): Promise<T>;
|
|
14
14
|
/**
|
|
15
15
|
@description Stream query using a raw GAQL string. If a generic type is provided, it must be the type of a single row.
|
|
16
16
|
If a summary row is requested then this will be the last emitted row of the stream.
|
|
@@ -19,18 +19,18 @@ export declare class Customer extends ServiceFactory {
|
|
|
19
19
|
const stream = queryStream<T>(gaqlQuery)
|
|
20
20
|
for await (const row of stream) { ... }
|
|
21
21
|
*/
|
|
22
|
-
queryStream<T = services.IGoogleAdsRow>(gaqlQuery: string, requestOptions?: RequestOptions): AsyncGenerator<T>;
|
|
22
|
+
queryStream<T = services.IGoogleAdsRow>(gaqlQuery: string, requestOptions?: Readonly<RequestOptions>): AsyncGenerator<T>;
|
|
23
23
|
/**
|
|
24
24
|
@description Single query using ReportOptions.
|
|
25
25
|
If a summary row is requested then this will be the first row of the results.
|
|
26
26
|
@hooks onQueryStart, onQueryError, onQueryEnd
|
|
27
27
|
*/
|
|
28
|
-
report<T = services.IGoogleAdsRow[]>(options: ReportOptions): Promise<T>;
|
|
28
|
+
report<T = services.IGoogleAdsRow[]>(options: Readonly<ReportOptions>): Promise<T>;
|
|
29
29
|
/**
|
|
30
30
|
@description Get the total row count of a report.
|
|
31
31
|
@hooks none
|
|
32
32
|
*/
|
|
33
|
-
reportCount(options: ReportOptions): Promise<number | undefined>;
|
|
33
|
+
reportCount(options: Readonly<ReportOptions>): Promise<number | undefined>;
|
|
34
34
|
/**
|
|
35
35
|
@description Stream query using ReportOptions. If a generic type is provided, it must be the type of a single row.
|
|
36
36
|
If a summary row is requested then this will be the last emitted row of the stream.
|
|
@@ -39,7 +39,7 @@ export declare class Customer extends ServiceFactory {
|
|
|
39
39
|
const stream = reportStream<T>(reportOptions)
|
|
40
40
|
for await (const row of stream) { ... }
|
|
41
41
|
*/
|
|
42
|
-
reportStream<T = services.IGoogleAdsRow>(reportOptions: ReportOptions): AsyncGenerator<T>;
|
|
42
|
+
reportStream<T = services.IGoogleAdsRow>(reportOptions: Readonly<ReportOptions>): AsyncGenerator<T>;
|
|
43
43
|
/**
|
|
44
44
|
@description Retreive the raw stream using ReportOptions.
|
|
45
45
|
@hooks onStreamStart
|
|
@@ -49,7 +49,7 @@ export declare class Customer extends ServiceFactory {
|
|
|
49
49
|
stream.on('error', (error) => { ... })
|
|
50
50
|
stream.on('end', () => { ... })
|
|
51
51
|
*/
|
|
52
|
-
reportStreamRaw(reportOptions: ReportOptions): Promise<CancellableStream | void>;
|
|
52
|
+
reportStreamRaw(reportOptions: Readonly<ReportOptions>): Promise<CancellableStream | void>;
|
|
53
53
|
private search;
|
|
54
54
|
private paginatedSearch;
|
|
55
55
|
private querier;
|
package/build/src/customer.js
CHANGED
|
@@ -49,8 +49,7 @@ class Customer extends serviceFactory_1.default {
|
|
|
49
49
|
@hooks none
|
|
50
50
|
*/
|
|
51
51
|
async reportCount(options) {
|
|
52
|
-
options
|
|
53
|
-
const { gaqlQuery, requestOptions } = (0, query_1.buildQuery)(options);
|
|
52
|
+
const { gaqlQuery, requestOptions } = (0, query_1.buildQuery)({ ...options, limit: 1 }); // must get at least one row
|
|
54
53
|
// @ts-expect-error we do not allow this field in reportOptions, however it is still a valid request option
|
|
55
54
|
requestOptions.return_total_results_count = true;
|
|
56
55
|
const useHooks = false; // to avoid cacheing conflicts
|
package/build/src/query.d.ts
CHANGED
|
@@ -44,18 +44,18 @@ export declare function validateConstraintKeyAndValue(key: ConstraintKey, op: Co
|
|
|
44
44
|
val: ParsedConstraintValue;
|
|
45
45
|
};
|
|
46
46
|
export declare function convertNumericEnumToString(key: ConstraintKey, val: ParsedConstraintValue): ParsedConstraintValue;
|
|
47
|
-
export declare function extractConstraintConditions(constraints: ReportOptions["constraints"]): ConstraintString[];
|
|
47
|
+
export declare function extractConstraintConditions(constraints: Readonly<ReportOptions["constraints"]>): ConstraintString[];
|
|
48
48
|
export declare function extractDateConstantConditions(dateConstant: ReportOptions["date_constant"]): ConstraintString[];
|
|
49
49
|
export declare function extractDateConditions(fromDate: ReportOptions["from_date"], toDate: ReportOptions["to_date"]): ConstraintString[];
|
|
50
|
-
export declare function buildWhereClause(constraints: ReportOptions["constraints"]
|
|
50
|
+
export declare function buildWhereClause(constraints: Readonly<ReportOptions["constraints"]>, dateConstant: Readonly<ReportOptions["date_constant"]>, fromDate: Readonly<ReportOptions["from_date"]>, toDate: Readonly<ReportOptions["to_date"]>): WhereClause;
|
|
51
51
|
export declare function buildLimitClause(limit: ReportOptions["limit"]): LimitClause;
|
|
52
|
-
export declare function buildParametersClause(parameters: ReportOptions["parameters"]): ParametersClause;
|
|
52
|
+
export declare function buildParametersClause(parameters: Readonly<ReportOptions["parameters"]>): ParametersClause;
|
|
53
53
|
export declare function completeOrderly(orderly: string, entity: ReportOptions["entity"]): string;
|
|
54
|
-
export declare function buildOrderClauseOld(orderBy: ReportOptions["order_by"]
|
|
55
|
-
export declare function buildOrderClauseNew(order: Required<ReportOptions["order"]
|
|
56
|
-
export declare function buildOrderClause(order: ReportOptions["order"]
|
|
57
|
-
export declare function buildRequestOptions(reportOptions: ReportOptions): RequestOptions;
|
|
58
|
-
export declare function buildQuery(reportOptions: ReportOptions): {
|
|
54
|
+
export declare function buildOrderClauseOld(orderBy: Readonly<ReportOptions["order_by"]>, sortOrder: Readonly<ReportOptions["sort_order"]>, entity: Readonly<ReportOptions["entity"]>): OrderClause;
|
|
55
|
+
export declare function buildOrderClauseNew(order: Readonly<Required<ReportOptions["order"]>>, entity: Readonly<ReportOptions["entity"]>): OrderClause;
|
|
56
|
+
export declare function buildOrderClause(order: Readonly<ReportOptions["order"]>, orderBy: Readonly<ReportOptions["order_by"]>, sortOrder: Readonly<ReportOptions["sort_order"]>, entity: Readonly<ReportOptions["entity"]>): OrderClause;
|
|
57
|
+
export declare function buildRequestOptions(reportOptions: Readonly<ReportOptions>): RequestOptions;
|
|
58
|
+
export declare function buildQuery(reportOptions: Readonly<ReportOptions>): {
|
|
59
59
|
gaqlQuery: Query;
|
|
60
60
|
requestOptions: RequestOptions;
|
|
61
61
|
};
|
package/package.json
CHANGED