@cemiar/cemiarlink-sdk 1.0.26 → 1.0.28
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/README.md +2 -2
- package/dist/models/googleads/GoogleAds.d.ts +18 -0
- package/dist/models/googleads/GoogleAds.js +2 -0
- package/dist/models/googleads/index.d.ts +1 -0
- package/dist/models/googleads/index.js +17 -0
- package/dist/services/GoogleAdsService.d.ts +17 -0
- package/dist/services/GoogleAdsService.js +25 -0
- package/package.json +38 -38
package/README.md
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
# @cemiar/cemiarlink-sdk
|
|
2
|
-
|
|
1
|
+
# @cemiar/cemiarlink-sdk
|
|
2
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Ads conversion data for upload
|
|
3
|
+
*/
|
|
4
|
+
export interface GoogleAdsConversion {
|
|
5
|
+
gclid: string;
|
|
6
|
+
conversion_action: string;
|
|
7
|
+
conversion_date_time: string;
|
|
8
|
+
conversion_value: number;
|
|
9
|
+
currency_code: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Response for conversion upload
|
|
13
|
+
*/
|
|
14
|
+
export interface GoogleAdsConversionUploadResponse {
|
|
15
|
+
success: boolean;
|
|
16
|
+
partial_failure_error?: string;
|
|
17
|
+
results?: any[];
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './GoogleAds';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./GoogleAds"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { GoogleAdsConversion, GoogleAdsConversionUploadResponse } from '../models/googleads';
|
|
3
|
+
/**
|
|
4
|
+
* GoogleAdsService provides methods to interact with Google Ads API.
|
|
5
|
+
* It offers methods for campaigns, ads, click views, conversion actions, and conversion uploads.
|
|
6
|
+
*/
|
|
7
|
+
export declare class GoogleAdsService {
|
|
8
|
+
axiosInstance: AxiosInstance;
|
|
9
|
+
constructor(baseUrl: string | undefined, headers: object);
|
|
10
|
+
/**
|
|
11
|
+
* Upload offline conversions to Google Ads
|
|
12
|
+
* @param enterprise - The enterprise identifier
|
|
13
|
+
* @param conversions - Array of conversions to upload (each requires gclid, conversion_action, conversion_date_time, conversion_value, currency_code)
|
|
14
|
+
* @returns Upload result including success status and partial failure errors if any
|
|
15
|
+
*/
|
|
16
|
+
uploadConversions(enterprise: string, conversions: GoogleAdsConversion[]): Promise<GoogleAdsConversionUploadResponse>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GoogleAdsService = void 0;
|
|
4
|
+
const AxiosClient_1 = require("../utils/AxiosClient");
|
|
5
|
+
const BASE_PATH = 'google-ads';
|
|
6
|
+
/**
|
|
7
|
+
* GoogleAdsService provides methods to interact with Google Ads API.
|
|
8
|
+
* It offers methods for campaigns, ads, click views, conversion actions, and conversion uploads.
|
|
9
|
+
*/
|
|
10
|
+
class GoogleAdsService {
|
|
11
|
+
constructor(baseUrl, headers) {
|
|
12
|
+
this.axiosInstance = new AxiosClient_1.AxiosClient(baseUrl, headers).getInstance();
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Upload offline conversions to Google Ads
|
|
16
|
+
* @param enterprise - The enterprise identifier
|
|
17
|
+
* @param conversions - Array of conversions to upload (each requires gclid, conversion_action, conversion_date_time, conversion_value, currency_code)
|
|
18
|
+
* @returns Upload result including success status and partial failure errors if any
|
|
19
|
+
*/
|
|
20
|
+
async uploadConversions(enterprise, conversions) {
|
|
21
|
+
const { data } = await this.axiosInstance.post(`${BASE_PATH}/${encodeURIComponent(enterprise)}/conversions`, conversions);
|
|
22
|
+
return data;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.GoogleAdsService = GoogleAdsService;
|
package/package.json
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@cemiar/cemiarlink-sdk",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "CemiarLink SDK to access CemiarLink API services",
|
|
5
|
-
"engines": {
|
|
6
|
-
"npm": ">=9.5.1",
|
|
7
|
-
"node": ">=18.16.0"
|
|
8
|
-
},
|
|
9
|
-
"author": "Cemiar",
|
|
10
|
-
"license": "ISC",
|
|
11
|
-
"main": "dist/services/Admin.js",
|
|
12
|
-
"module": "./dist/services/Admin.mjs",
|
|
13
|
-
"types": "./dist/services/Admin.d.ts",
|
|
14
|
-
"files": [
|
|
15
|
-
"dist"
|
|
16
|
-
],
|
|
17
|
-
"dependencies": {
|
|
18
|
-
"@types/nodemailer": "^8.0.0",
|
|
19
|
-
"axios": "^1.15.0",
|
|
20
|
-
"fs": "^0.0.1-security",
|
|
21
|
-
"nodemailer": "^8.0.5",
|
|
22
|
-
"path": "^0.12.7",
|
|
23
|
-
"xlsx": "^0.18.5"
|
|
24
|
-
},
|
|
25
|
-
"devDependencies": {
|
|
26
|
-
"@types/node": "^18.19.0",
|
|
27
|
-
"ts-node": "^10.9.2"
|
|
28
|
-
},
|
|
29
|
-
"scripts": {
|
|
30
|
-
"build": "rm -rf dist/ && tsc -p tsconfig.json",
|
|
31
|
-
"buildWindows": "rmdir /s /q dist & tsc -p tsconfig.json"
|
|
32
|
-
},
|
|
33
|
-
"overrides": {
|
|
34
|
-
"xlsx": {
|
|
35
|
-
"sheetjs": "^2.0.0"
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@cemiar/cemiarlink-sdk",
|
|
3
|
+
"version": "1.0.28",
|
|
4
|
+
"description": "CemiarLink SDK to access CemiarLink API services",
|
|
5
|
+
"engines": {
|
|
6
|
+
"npm": ">=9.5.1",
|
|
7
|
+
"node": ">=18.16.0"
|
|
8
|
+
},
|
|
9
|
+
"author": "Cemiar",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"main": "dist/services/Admin.js",
|
|
12
|
+
"module": "./dist/services/Admin.mjs",
|
|
13
|
+
"types": "./dist/services/Admin.d.ts",
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@types/nodemailer": "^8.0.0",
|
|
19
|
+
"axios": "^1.15.0",
|
|
20
|
+
"fs": "^0.0.1-security",
|
|
21
|
+
"nodemailer": "^8.0.5",
|
|
22
|
+
"path": "^0.12.7",
|
|
23
|
+
"xlsx": "^0.18.5"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/node": "^18.19.0",
|
|
27
|
+
"ts-node": "^10.9.2"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "rm -rf dist/ && tsc -p tsconfig.json",
|
|
31
|
+
"buildWindows": "rmdir /s /q dist & tsc -p tsconfig.json"
|
|
32
|
+
},
|
|
33
|
+
"overrides": {
|
|
34
|
+
"xlsx": {
|
|
35
|
+
"sheetjs": "^2.0.0"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|