glitch-javascript-sdk 1.9.6 → 1.9.7
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/dist/cjs/index.js +118 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Ads.d.ts +40 -0
- package/dist/esm/index.js +118 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +40 -0
- package/package.json +1 -1
- package/src/api/Ads.ts +183 -0
- package/src/routes/AdsRoute.ts +60 -1
package/dist/index.d.ts
CHANGED
|
@@ -1059,6 +1059,46 @@ declare class Ads {
|
|
|
1059
1059
|
community_id?: string;
|
|
1060
1060
|
platform?: string;
|
|
1061
1061
|
}): AxiosPromise<Response<T>>;
|
|
1062
|
+
/**
|
|
1063
|
+
* GET /ads/google/targeting/geo/suggest
|
|
1064
|
+
*/
|
|
1065
|
+
static listGoogleGeoSuggestions<T>(params: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1066
|
+
/**
|
|
1067
|
+
* POST /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations
|
|
1068
|
+
*/
|
|
1069
|
+
static addGoogleLocationTargets<T>(customer_id: number, campaign_id: number, data: object): AxiosPromise<Response<T>>;
|
|
1070
|
+
/**
|
|
1071
|
+
* GET /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations
|
|
1072
|
+
*/
|
|
1073
|
+
static getGoogleLocationTargets<T>(customer_id: number, campaign_id: number, params: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1074
|
+
/**
|
|
1075
|
+
* DELETE /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations
|
|
1076
|
+
*/
|
|
1077
|
+
static removeGoogleLocationTargets<T>(customer_id: number, campaign_id: number, data: object): AxiosPromise<Response<T>>;
|
|
1078
|
+
/**
|
|
1079
|
+
* POST /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/proximity
|
|
1080
|
+
*/
|
|
1081
|
+
static addGoogleProximityTarget<T>(customer_id: number, campaign_id: number, data: object): AxiosPromise<Response<T>>;
|
|
1082
|
+
/**
|
|
1083
|
+
* PUT /ads/google/targeting/{resource_type}/{customer_id}/{resource_id}/settings
|
|
1084
|
+
*/
|
|
1085
|
+
static updateGoogleTargetingSettings<T>(resource_type: 'campaign' | 'ad_group', customer_id: number, resource_id: number, data: object): AxiosPromise<Response<T>>;
|
|
1086
|
+
/**
|
|
1087
|
+
* GET /ads/google/targeting/{resource_type}/{customer_id}/{resource_id}/settings
|
|
1088
|
+
*/
|
|
1089
|
+
static getGoogleTargetingSettings<T>(resource_type: 'campaign' | 'ad_group', customer_id: number, resource_id: number, params: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1090
|
+
/** GET /ads/posts/google */
|
|
1091
|
+
static listGoogleAdPosts<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1092
|
+
/** POST /ads/posts/google */
|
|
1093
|
+
static createGoogleAdPost<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1094
|
+
/** PUT /ads/posts/google/{post_id} */
|
|
1095
|
+
static updateGoogleAdPost<T>(post_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1096
|
+
/** DELETE /ads/posts/google/{post_id} */
|
|
1097
|
+
static deleteGoogleAdPost<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1098
|
+
/** POST /ads/posts/google/{post_id}/pause */
|
|
1099
|
+
static pauseGoogleAdPost<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1100
|
+
/** POST /ads/posts/google/{post_id}/enable */
|
|
1101
|
+
static enableGoogleAdPost<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1062
1102
|
}
|
|
1063
1103
|
|
|
1064
1104
|
declare class Communities {
|
package/package.json
CHANGED
package/src/api/Ads.ts
CHANGED
|
@@ -1090,6 +1090,189 @@ class Ads {
|
|
|
1090
1090
|
return Requests.processRoute(AdsRoute.routes.getTimePerformanceReport, undefined, undefined, params);
|
|
1091
1091
|
}
|
|
1092
1092
|
|
|
1093
|
+
/**
|
|
1094
|
+
* GET /ads/google/targeting/geo/suggest
|
|
1095
|
+
*/
|
|
1096
|
+
public static listGoogleGeoSuggestions<T>(params: Record<string, any>): AxiosPromise<Response<T>> {
|
|
1097
|
+
return Requests.processRoute(
|
|
1098
|
+
AdsRoute.routes.getGoogleGeoSuggestions,
|
|
1099
|
+
undefined,
|
|
1100
|
+
undefined,
|
|
1101
|
+
params
|
|
1102
|
+
);
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
/**
|
|
1106
|
+
* POST /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations
|
|
1107
|
+
*/
|
|
1108
|
+
public static addGoogleLocationTargets<T>(
|
|
1109
|
+
customer_id: number,
|
|
1110
|
+
campaign_id: number,
|
|
1111
|
+
data: object
|
|
1112
|
+
): AxiosPromise<Response<T>> {
|
|
1113
|
+
return Requests.processRoute(
|
|
1114
|
+
AdsRoute.routes.addGoogleLocationTargets,
|
|
1115
|
+
data,
|
|
1116
|
+
{ customer_id, campaign_id }
|
|
1117
|
+
);
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
/**
|
|
1121
|
+
* GET /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations
|
|
1122
|
+
*/
|
|
1123
|
+
public static getGoogleLocationTargets<T>(
|
|
1124
|
+
customer_id: number,
|
|
1125
|
+
campaign_id: number,
|
|
1126
|
+
params: Record<string, any>
|
|
1127
|
+
): AxiosPromise<Response<T>> {
|
|
1128
|
+
return Requests.processRoute(
|
|
1129
|
+
AdsRoute.routes.getGoogleLocationTargets,
|
|
1130
|
+
undefined,
|
|
1131
|
+
{ customer_id, campaign_id },
|
|
1132
|
+
params
|
|
1133
|
+
);
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
* DELETE /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations
|
|
1138
|
+
*/
|
|
1139
|
+
public static removeGoogleLocationTargets<T>(
|
|
1140
|
+
customer_id: number,
|
|
1141
|
+
campaign_id: number,
|
|
1142
|
+
data: object
|
|
1143
|
+
): AxiosPromise<Response<T>> {
|
|
1144
|
+
return Requests.processRoute(
|
|
1145
|
+
AdsRoute.routes.removeGoogleLocationTargets,
|
|
1146
|
+
data,
|
|
1147
|
+
{ customer_id, campaign_id }
|
|
1148
|
+
);
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
/**
|
|
1152
|
+
* POST /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/proximity
|
|
1153
|
+
*/
|
|
1154
|
+
public static addGoogleProximityTarget<T>(
|
|
1155
|
+
customer_id: number,
|
|
1156
|
+
campaign_id: number,
|
|
1157
|
+
data: object
|
|
1158
|
+
): AxiosPromise<Response<T>> {
|
|
1159
|
+
return Requests.processRoute(
|
|
1160
|
+
AdsRoute.routes.addGoogleProximityTarget,
|
|
1161
|
+
data,
|
|
1162
|
+
{ customer_id, campaign_id }
|
|
1163
|
+
);
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
/**
|
|
1167
|
+
* PUT /ads/google/targeting/{resource_type}/{customer_id}/{resource_id}/settings
|
|
1168
|
+
*/
|
|
1169
|
+
public static updateGoogleTargetingSettings<T>(
|
|
1170
|
+
resource_type: 'campaign' | 'ad_group',
|
|
1171
|
+
customer_id: number,
|
|
1172
|
+
resource_id: number,
|
|
1173
|
+
data: object
|
|
1174
|
+
): AxiosPromise<Response<T>> {
|
|
1175
|
+
return Requests.processRoute(
|
|
1176
|
+
AdsRoute.routes.updateGoogleTargetingSettings,
|
|
1177
|
+
data,
|
|
1178
|
+
{ resource_type, customer_id, resource_id }
|
|
1179
|
+
);
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
/**
|
|
1183
|
+
* GET /ads/google/targeting/{resource_type}/{customer_id}/{resource_id}/settings
|
|
1184
|
+
*/
|
|
1185
|
+
public static getGoogleTargetingSettings<T>(
|
|
1186
|
+
resource_type: 'campaign' | 'ad_group',
|
|
1187
|
+
customer_id: number,
|
|
1188
|
+
resource_id: number,
|
|
1189
|
+
params: Record<string, any>
|
|
1190
|
+
): AxiosPromise<Response<T>> {
|
|
1191
|
+
return Requests.processRoute(
|
|
1192
|
+
AdsRoute.routes.getGoogleTargetingSettings,
|
|
1193
|
+
undefined,
|
|
1194
|
+
{ resource_type, customer_id, resource_id },
|
|
1195
|
+
params
|
|
1196
|
+
);
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
/** GET /ads/posts/google */
|
|
1200
|
+
public static listGoogleAdPosts<T>(
|
|
1201
|
+
params?: Record<string, any>
|
|
1202
|
+
): AxiosPromise<Response<T>> {
|
|
1203
|
+
return Requests.processRoute(
|
|
1204
|
+
AdsRoute.routes.getGoogleAdPosts,
|
|
1205
|
+
undefined,
|
|
1206
|
+
undefined,
|
|
1207
|
+
params
|
|
1208
|
+
);
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
/** POST /ads/posts/google */
|
|
1212
|
+
public static createGoogleAdPost<T>(
|
|
1213
|
+
data?: object,
|
|
1214
|
+
params?: Record<string, any>
|
|
1215
|
+
): AxiosPromise<Response<T>> {
|
|
1216
|
+
return Requests.processRoute(
|
|
1217
|
+
AdsRoute.routes.createGoogleAdPost,
|
|
1218
|
+
data,
|
|
1219
|
+
{},
|
|
1220
|
+
params
|
|
1221
|
+
);
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
/** PUT /ads/posts/google/{post_id} */
|
|
1225
|
+
public static updateGoogleAdPost<T>(
|
|
1226
|
+
post_id: string,
|
|
1227
|
+
data?: object,
|
|
1228
|
+
params?: Record<string, any>
|
|
1229
|
+
): AxiosPromise<Response<T>> {
|
|
1230
|
+
return Requests.processRoute(
|
|
1231
|
+
AdsRoute.routes.updateGoogleAdPost,
|
|
1232
|
+
data,
|
|
1233
|
+
{ post_id },
|
|
1234
|
+
params
|
|
1235
|
+
);
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
/** DELETE /ads/posts/google/{post_id} */
|
|
1239
|
+
public static deleteGoogleAdPost<T>(
|
|
1240
|
+
post_id: string,
|
|
1241
|
+
params?: Record<string, any>
|
|
1242
|
+
): AxiosPromise<Response<T>> {
|
|
1243
|
+
return Requests.processRoute(
|
|
1244
|
+
AdsRoute.routes.deleteGoogleAdPost,
|
|
1245
|
+
{},
|
|
1246
|
+
{ post_id },
|
|
1247
|
+
params
|
|
1248
|
+
);
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
/** POST /ads/posts/google/{post_id}/pause */
|
|
1252
|
+
public static pauseGoogleAdPost<T>(
|
|
1253
|
+
post_id: string,
|
|
1254
|
+
params?: Record<string, any>
|
|
1255
|
+
): AxiosPromise<Response<T>> {
|
|
1256
|
+
return Requests.processRoute(
|
|
1257
|
+
AdsRoute.routes.pauseGoogleAdPost,
|
|
1258
|
+
{},
|
|
1259
|
+
{ post_id },
|
|
1260
|
+
params
|
|
1261
|
+
);
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
/** POST /ads/posts/google/{post_id}/enable */
|
|
1265
|
+
public static enableGoogleAdPost<T>(
|
|
1266
|
+
post_id: string,
|
|
1267
|
+
params?: Record<string, any>
|
|
1268
|
+
): AxiosPromise<Response<T>> {
|
|
1269
|
+
return Requests.processRoute(
|
|
1270
|
+
AdsRoute.routes.enableGoogleAdPost,
|
|
1271
|
+
{},
|
|
1272
|
+
{ post_id },
|
|
1273
|
+
params
|
|
1274
|
+
);
|
|
1275
|
+
}
|
|
1093
1276
|
|
|
1094
1277
|
|
|
1095
1278
|
}
|
package/src/routes/AdsRoute.ts
CHANGED
|
@@ -401,7 +401,66 @@ class AdsRoute {
|
|
|
401
401
|
url: "/ads/reports/time-performance",
|
|
402
402
|
method: HTTP_METHODS.GET,
|
|
403
403
|
},
|
|
404
|
-
|
|
404
|
+
|
|
405
|
+
getGoogleGeoSuggestions: {
|
|
406
|
+
url: "/ads/google/targeting/geo/suggest",
|
|
407
|
+
method: HTTP_METHODS.GET,
|
|
408
|
+
},
|
|
409
|
+
|
|
410
|
+
addGoogleLocationTargets: {
|
|
411
|
+
url: "/ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations",
|
|
412
|
+
method: HTTP_METHODS.POST,
|
|
413
|
+
},
|
|
414
|
+
|
|
415
|
+
getGoogleLocationTargets: {
|
|
416
|
+
url: "/ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations",
|
|
417
|
+
method: HTTP_METHODS.GET,
|
|
418
|
+
},
|
|
419
|
+
|
|
420
|
+
removeGoogleLocationTargets: {
|
|
421
|
+
url: "/ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations",
|
|
422
|
+
method: HTTP_METHODS.DELETE,
|
|
423
|
+
},
|
|
424
|
+
|
|
425
|
+
addGoogleProximityTarget: {
|
|
426
|
+
url: "/ads/google/targeting/campaigns/{customer_id}/{campaign_id}/proximity",
|
|
427
|
+
method: HTTP_METHODS.POST,
|
|
428
|
+
},
|
|
429
|
+
|
|
430
|
+
updateGoogleTargetingSettings: {
|
|
431
|
+
url: "/ads/google/targeting/{resource_type}/{customer_id}/{resource_id}/settings",
|
|
432
|
+
method: HTTP_METHODS.PUT,
|
|
433
|
+
},
|
|
434
|
+
|
|
435
|
+
getGoogleTargetingSettings: {
|
|
436
|
+
url: "/ads/google/targeting/{resource_type}/{customer_id}/{resource_id}/settings",
|
|
437
|
+
method: HTTP_METHODS.GET,
|
|
438
|
+
},
|
|
439
|
+
getGoogleAdPosts: {
|
|
440
|
+
url: "/ads/posts/google",
|
|
441
|
+
method: HTTP_METHODS.GET,
|
|
442
|
+
},
|
|
443
|
+
createGoogleAdPost: {
|
|
444
|
+
url: "/ads/posts/google",
|
|
445
|
+
method: HTTP_METHODS.POST,
|
|
446
|
+
},
|
|
447
|
+
updateGoogleAdPost: {
|
|
448
|
+
url: "/ads/posts/google/{post_id}",
|
|
449
|
+
method: HTTP_METHODS.PUT,
|
|
450
|
+
},
|
|
451
|
+
deleteGoogleAdPost: {
|
|
452
|
+
url: "/ads/posts/google/{post_id}",
|
|
453
|
+
method: HTTP_METHODS.DELETE,
|
|
454
|
+
},
|
|
455
|
+
pauseGoogleAdPost: {
|
|
456
|
+
url: "/ads/posts/google/{post_id}/pause",
|
|
457
|
+
method: HTTP_METHODS.POST,
|
|
458
|
+
},
|
|
459
|
+
enableGoogleAdPost: {
|
|
460
|
+
url: "/ads/posts/google/{post_id}/enable",
|
|
461
|
+
method: HTTP_METHODS.POST,
|
|
462
|
+
},
|
|
463
|
+
|
|
405
464
|
};
|
|
406
465
|
}
|
|
407
466
|
|