glitch-javascript-sdk 1.9.9 → 2.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/dist/cjs/index.js +241 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Ads.d.ts +19 -0
- package/dist/esm/api/MarketingAgencies.d.ts +174 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +241 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/MarketingAgenciesRoute.d.ts +7 -0
- package/dist/index.d.ts +192 -0
- package/package.json +1 -1
- package/src/api/Ads.ts +29 -0
- package/src/api/MarketingAgencies.ts +210 -0
- package/src/api/index.ts +3 -1
- package/src/index.ts +3 -1
- package/src/routes/AdsRoute.ts +4 -0
- package/src/routes/MarketingAgenciesRoute.ts +36 -0
package/dist/index.d.ts
CHANGED
|
@@ -1099,6 +1099,25 @@ declare class Ads {
|
|
|
1099
1099
|
static pauseGoogleAdPost<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1100
1100
|
/** POST /ads/posts/google/{post_id}/enable */
|
|
1101
1101
|
static enableGoogleAdPost<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1102
|
+
/**
|
|
1103
|
+
* Creates a new Google Ads client account under a specified manager account.
|
|
1104
|
+
* Corresponds to POST /ads/google/accounts/create
|
|
1105
|
+
*
|
|
1106
|
+
* @param data The creation payload.
|
|
1107
|
+
* @param data.scheduler_id The UUID of the scheduler with auth tokens.
|
|
1108
|
+
* @param data.manager_customer_id The 10-digit MCC ID.
|
|
1109
|
+
* @param data.descriptive_name The name for the new account.
|
|
1110
|
+
* @param data.currency_code ISO 4217 currency code.
|
|
1111
|
+
* @param data.time_zone Time zone identifier (e.g., 'America/New_York').
|
|
1112
|
+
* @returns The newly created Google Ads account details.
|
|
1113
|
+
*/
|
|
1114
|
+
static createGoogleAccount<T>(data: {
|
|
1115
|
+
scheduler_id: string;
|
|
1116
|
+
manager_customer_id: string;
|
|
1117
|
+
descriptive_name: string;
|
|
1118
|
+
currency_code: string;
|
|
1119
|
+
time_zone: string;
|
|
1120
|
+
}): AxiosPromise<Response<T>>;
|
|
1102
1121
|
}
|
|
1103
1122
|
|
|
1104
1123
|
declare class Communities {
|
|
@@ -5669,6 +5688,178 @@ declare class AIUsage {
|
|
|
5669
5688
|
static summary<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5670
5689
|
}
|
|
5671
5690
|
|
|
5691
|
+
declare class MarketingAgencies {
|
|
5692
|
+
/**
|
|
5693
|
+
* List all marketing agencies.
|
|
5694
|
+
*
|
|
5695
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies
|
|
5696
|
+
*
|
|
5697
|
+
* @param params Optional query parameters (e.g., is_admin, sort_by, sort_order, page, per_page).
|
|
5698
|
+
* @returns promise
|
|
5699
|
+
*/
|
|
5700
|
+
static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5701
|
+
/**
|
|
5702
|
+
* Create a new marketing agency.
|
|
5703
|
+
*
|
|
5704
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies
|
|
5705
|
+
*
|
|
5706
|
+
* @param data The data for the new agency.
|
|
5707
|
+
* @returns Promise
|
|
5708
|
+
*/
|
|
5709
|
+
static create<T>(data: object): AxiosPromise<Response<T>>;
|
|
5710
|
+
/**
|
|
5711
|
+
* Retrieve a single marketing agency by its ID.
|
|
5712
|
+
*
|
|
5713
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-id
|
|
5714
|
+
*
|
|
5715
|
+
* @param id The UUID of the agency to retrieve.
|
|
5716
|
+
* @returns promise
|
|
5717
|
+
*/
|
|
5718
|
+
static view<T>(id: string): AxiosPromise<Response<T>>;
|
|
5719
|
+
/**
|
|
5720
|
+
* Update a marketing agency.
|
|
5721
|
+
*
|
|
5722
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/putMarketing-agencies-id
|
|
5723
|
+
*
|
|
5724
|
+
* @param id The UUID of the agency to update.
|
|
5725
|
+
* @param data The data to update.
|
|
5726
|
+
* @returns promise
|
|
5727
|
+
*/
|
|
5728
|
+
static update<T>(id: string, data: object): AxiosPromise<Response<T>>;
|
|
5729
|
+
/**
|
|
5730
|
+
* Deletes a marketing agency.
|
|
5731
|
+
*
|
|
5732
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id
|
|
5733
|
+
*
|
|
5734
|
+
* @param id The UUID of the agency to delete.
|
|
5735
|
+
* @returns promise
|
|
5736
|
+
*/
|
|
5737
|
+
static delete<T>(id: string): AxiosPromise<Response<T>>;
|
|
5738
|
+
/**
|
|
5739
|
+
* Add a user as an administrator to an agency.
|
|
5740
|
+
*
|
|
5741
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-administrators
|
|
5742
|
+
*
|
|
5743
|
+
* @param id The UUID of the agency.
|
|
5744
|
+
* @param data The data containing the user_id to add.
|
|
5745
|
+
* @returns Promise
|
|
5746
|
+
*/
|
|
5747
|
+
static addAdministrator<T>(id: string, data: {
|
|
5748
|
+
user_id: string;
|
|
5749
|
+
}): AxiosPromise<Response<T>>;
|
|
5750
|
+
/**
|
|
5751
|
+
* Remove a user as an administrator from an agency.
|
|
5752
|
+
*
|
|
5753
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-administrators-user_id
|
|
5754
|
+
*
|
|
5755
|
+
* @param id The UUID of the agency.
|
|
5756
|
+
* @param user_id The UUID of the user to remove.
|
|
5757
|
+
* @returns Promise
|
|
5758
|
+
*/
|
|
5759
|
+
static removeAdministrator<T>(id: string, user_id: string): AxiosPromise<Response<T>>;
|
|
5760
|
+
/**
|
|
5761
|
+
* Set the logo for an agency.
|
|
5762
|
+
*
|
|
5763
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-logo
|
|
5764
|
+
*
|
|
5765
|
+
* @param id The UUID of the agency.
|
|
5766
|
+
* @param data The data containing the media_id for the logo.
|
|
5767
|
+
* @returns Promise
|
|
5768
|
+
*/
|
|
5769
|
+
static setLogo<T>(id: string, data: {
|
|
5770
|
+
media_id: string;
|
|
5771
|
+
}): AxiosPromise<Response<T>>;
|
|
5772
|
+
/**
|
|
5773
|
+
* Add a case study to an agency.
|
|
5774
|
+
*
|
|
5775
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-case-studies
|
|
5776
|
+
*
|
|
5777
|
+
* @param id The UUID of the agency.
|
|
5778
|
+
* @param data The data containing the media_id and optional order.
|
|
5779
|
+
* @returns Promise
|
|
5780
|
+
*/
|
|
5781
|
+
static addCaseStudy<T>(id: string, data: {
|
|
5782
|
+
media_id: string;
|
|
5783
|
+
order?: number;
|
|
5784
|
+
}): AxiosPromise<Response<T>>;
|
|
5785
|
+
/**
|
|
5786
|
+
* Remove a case study from an agency.
|
|
5787
|
+
*
|
|
5788
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-case-studies-media_id
|
|
5789
|
+
*
|
|
5790
|
+
* @param id The UUID of the agency.
|
|
5791
|
+
* @param media_id The UUID of the media to remove.
|
|
5792
|
+
* @returns Promise
|
|
5793
|
+
*/
|
|
5794
|
+
static removeCaseStudy<T>(id: string, media_id: string): AxiosPromise<Response<T>>;
|
|
5795
|
+
/**
|
|
5796
|
+
* Update the order of case studies for an agency.
|
|
5797
|
+
*
|
|
5798
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-case-studies-order
|
|
5799
|
+
*
|
|
5800
|
+
* @param id The UUID of the agency.
|
|
5801
|
+
* @param order_data An array of objects with media_id and new order.
|
|
5802
|
+
* @returns Promise
|
|
5803
|
+
*/
|
|
5804
|
+
static updateCaseStudyOrder<T>(id: string, order_data: {
|
|
5805
|
+
media_id: string;
|
|
5806
|
+
order: number;
|
|
5807
|
+
}[]): AxiosPromise<Response<T>>;
|
|
5808
|
+
/**
|
|
5809
|
+
* Invite a user to become an administrator of an agency.
|
|
5810
|
+
*
|
|
5811
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-invites
|
|
5812
|
+
*
|
|
5813
|
+
* @param id The UUID of the agency.
|
|
5814
|
+
* @param data The data containing the email of the user to invite.
|
|
5815
|
+
* @returns Promise
|
|
5816
|
+
*/
|
|
5817
|
+
static invite<T>(id: string, data: {
|
|
5818
|
+
email: string;
|
|
5819
|
+
}): AxiosPromise<Response<T>>;
|
|
5820
|
+
/**
|
|
5821
|
+
* List all pending invitations for an agency.
|
|
5822
|
+
*
|
|
5823
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-id-invites
|
|
5824
|
+
*
|
|
5825
|
+
* @param id The UUID of the agency.
|
|
5826
|
+
* @returns Promise
|
|
5827
|
+
*/
|
|
5828
|
+
static listInvites<T>(id: string): AxiosPromise<Response<T>>;
|
|
5829
|
+
/**
|
|
5830
|
+
* Revoke a pending invitation.
|
|
5831
|
+
*
|
|
5832
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-invites-invite_id
|
|
5833
|
+
*
|
|
5834
|
+
* @param id The UUID of the agency.
|
|
5835
|
+
* @param invite_id The UUID of the invitation to revoke.
|
|
5836
|
+
* @returns Promise
|
|
5837
|
+
*/
|
|
5838
|
+
static revokeInvite<T>(id: string, invite_id: string): AxiosPromise<Response<T>>;
|
|
5839
|
+
/**
|
|
5840
|
+
* Get the details of a pending invitation using its token.
|
|
5841
|
+
*
|
|
5842
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-invites-details
|
|
5843
|
+
*
|
|
5844
|
+
* @param params An object containing the token.
|
|
5845
|
+
* @returns Promise
|
|
5846
|
+
*/
|
|
5847
|
+
static getInviteDetails<T>(params: {
|
|
5848
|
+
token: string;
|
|
5849
|
+
}): AxiosPromise<Response<T>>;
|
|
5850
|
+
/**
|
|
5851
|
+
* Accept an invitation to become an administrator.
|
|
5852
|
+
*
|
|
5853
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-invites-accept
|
|
5854
|
+
*
|
|
5855
|
+
* @param data The data containing the invitation token.
|
|
5856
|
+
* @returns Promise
|
|
5857
|
+
*/
|
|
5858
|
+
static acceptInvite<T>(data: {
|
|
5859
|
+
token: string;
|
|
5860
|
+
}): AxiosPromise<Response<T>>;
|
|
5861
|
+
}
|
|
5862
|
+
|
|
5672
5863
|
interface Route {
|
|
5673
5864
|
url: string;
|
|
5674
5865
|
method: string;
|
|
@@ -6013,6 +6204,7 @@ declare class Glitch {
|
|
|
6013
6204
|
Fingerprinting: typeof Fingerprinting;
|
|
6014
6205
|
ShortLinks: typeof ShortLinks;
|
|
6015
6206
|
AIUsage: typeof AIUsage;
|
|
6207
|
+
MarketingAgencies: typeof MarketingAgencies;
|
|
6016
6208
|
};
|
|
6017
6209
|
static util: {
|
|
6018
6210
|
Requests: typeof Requests;
|
package/package.json
CHANGED
package/src/api/Ads.ts
CHANGED
|
@@ -1274,6 +1274,35 @@ class Ads {
|
|
|
1274
1274
|
);
|
|
1275
1275
|
}
|
|
1276
1276
|
|
|
1277
|
+
/**
|
|
1278
|
+
* Creates a new Google Ads client account under a specified manager account.
|
|
1279
|
+
* Corresponds to POST /ads/google/accounts/create
|
|
1280
|
+
*
|
|
1281
|
+
* @param data The creation payload.
|
|
1282
|
+
* @param data.scheduler_id The UUID of the scheduler with auth tokens.
|
|
1283
|
+
* @param data.manager_customer_id The 10-digit MCC ID.
|
|
1284
|
+
* @param data.descriptive_name The name for the new account.
|
|
1285
|
+
* @param data.currency_code ISO 4217 currency code.
|
|
1286
|
+
* @param data.time_zone Time zone identifier (e.g., 'America/New_York').
|
|
1287
|
+
* @returns The newly created Google Ads account details.
|
|
1288
|
+
*/
|
|
1289
|
+
public static createGoogleAccount<T>(
|
|
1290
|
+
data: {
|
|
1291
|
+
scheduler_id: string;
|
|
1292
|
+
manager_customer_id: string;
|
|
1293
|
+
descriptive_name: string;
|
|
1294
|
+
currency_code: string;
|
|
1295
|
+
time_zone: string;
|
|
1296
|
+
}
|
|
1297
|
+
): AxiosPromise<Response<T>> {
|
|
1298
|
+
return Requests.processRoute(
|
|
1299
|
+
AdsRoute.routes.createGoogleAccount,
|
|
1300
|
+
data,
|
|
1301
|
+
undefined,
|
|
1302
|
+
undefined
|
|
1303
|
+
);
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1277
1306
|
|
|
1278
1307
|
}
|
|
1279
1308
|
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import MarketingAgenciesRoute from "../routes/MarketingAgenciesRoute";
|
|
2
|
+
import Requests from "../util/Requests";
|
|
3
|
+
import Response from "../util/Response";
|
|
4
|
+
import { AxiosPromise } from "axios";
|
|
5
|
+
|
|
6
|
+
class MarketingAgencies {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* List all marketing agencies.
|
|
10
|
+
*
|
|
11
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies
|
|
12
|
+
*
|
|
13
|
+
* @param params Optional query parameters (e.g., is_admin, sort_by, sort_order, page, per_page).
|
|
14
|
+
* @returns promise
|
|
15
|
+
*/
|
|
16
|
+
public static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
17
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.list, undefined, undefined, params);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Create a new marketing agency.
|
|
22
|
+
*
|
|
23
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies
|
|
24
|
+
*
|
|
25
|
+
* @param data The data for the new agency.
|
|
26
|
+
* @returns Promise
|
|
27
|
+
*/
|
|
28
|
+
public static create<T>(data: object): AxiosPromise<Response<T>> {
|
|
29
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.create, data);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Retrieve a single marketing agency by its ID.
|
|
34
|
+
*
|
|
35
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-id
|
|
36
|
+
*
|
|
37
|
+
* @param id The UUID of the agency to retrieve.
|
|
38
|
+
* @returns promise
|
|
39
|
+
*/
|
|
40
|
+
public static view<T>(id: string): AxiosPromise<Response<T>> {
|
|
41
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.view, {}, { id });
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Update a marketing agency.
|
|
46
|
+
*
|
|
47
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/putMarketing-agencies-id
|
|
48
|
+
*
|
|
49
|
+
* @param id The UUID of the agency to update.
|
|
50
|
+
* @param data The data to update.
|
|
51
|
+
* @returns promise
|
|
52
|
+
*/
|
|
53
|
+
public static update<T>(id: string, data: object): AxiosPromise<Response<T>> {
|
|
54
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.update, data, { id });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Deletes a marketing agency.
|
|
59
|
+
*
|
|
60
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id
|
|
61
|
+
*
|
|
62
|
+
* @param id The UUID of the agency to delete.
|
|
63
|
+
* @returns promise
|
|
64
|
+
*/
|
|
65
|
+
public static delete<T>(id: string): AxiosPromise<Response<T>> {
|
|
66
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.delete, {}, { id });
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Add a user as an administrator to an agency.
|
|
71
|
+
*
|
|
72
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-administrators
|
|
73
|
+
*
|
|
74
|
+
* @param id The UUID of the agency.
|
|
75
|
+
* @param data The data containing the user_id to add.
|
|
76
|
+
* @returns Promise
|
|
77
|
+
*/
|
|
78
|
+
public static addAdministrator<T>(id: string, data: { user_id: string }): AxiosPromise<Response<T>> {
|
|
79
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.addAdministrator, data, { id });
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Remove a user as an administrator from an agency.
|
|
84
|
+
*
|
|
85
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-administrators-user_id
|
|
86
|
+
*
|
|
87
|
+
* @param id The UUID of the agency.
|
|
88
|
+
* @param user_id The UUID of the user to remove.
|
|
89
|
+
* @returns Promise
|
|
90
|
+
*/
|
|
91
|
+
public static removeAdministrator<T>(id: string, user_id: string): AxiosPromise<Response<T>> {
|
|
92
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.removeAdministrator, {}, { id, user_id });
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Set the logo for an agency.
|
|
97
|
+
*
|
|
98
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-logo
|
|
99
|
+
*
|
|
100
|
+
* @param id The UUID of the agency.
|
|
101
|
+
* @param data The data containing the media_id for the logo.
|
|
102
|
+
* @returns Promise
|
|
103
|
+
*/
|
|
104
|
+
public static setLogo<T>(id: string, data: { media_id: string }): AxiosPromise<Response<T>> {
|
|
105
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.setLogo, data, { id });
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Add a case study to an agency.
|
|
110
|
+
*
|
|
111
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-case-studies
|
|
112
|
+
*
|
|
113
|
+
* @param id The UUID of the agency.
|
|
114
|
+
* @param data The data containing the media_id and optional order.
|
|
115
|
+
* @returns Promise
|
|
116
|
+
*/
|
|
117
|
+
public static addCaseStudy<T>(id: string, data: { media_id: string, order?: number }): AxiosPromise<Response<T>> {
|
|
118
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.addCaseStudy, data, { id });
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Remove a case study from an agency.
|
|
123
|
+
*
|
|
124
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-case-studies-media_id
|
|
125
|
+
*
|
|
126
|
+
* @param id The UUID of the agency.
|
|
127
|
+
* @param media_id The UUID of the media to remove.
|
|
128
|
+
* @returns Promise
|
|
129
|
+
*/
|
|
130
|
+
public static removeCaseStudy<T>(id: string, media_id: string): AxiosPromise<Response<T>> {
|
|
131
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.removeCaseStudy, {}, { id, media_id });
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Update the order of case studies for an agency.
|
|
136
|
+
*
|
|
137
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-case-studies-order
|
|
138
|
+
*
|
|
139
|
+
* @param id The UUID of the agency.
|
|
140
|
+
* @param order_data An array of objects with media_id and new order.
|
|
141
|
+
* @returns Promise
|
|
142
|
+
*/
|
|
143
|
+
public static updateCaseStudyOrder<T>(id: string, order_data: { media_id: string, order: number }[]): AxiosPromise<Response<T>> {
|
|
144
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.updateCaseStudyOrder, { order_data }, { id });
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Invite a user to become an administrator of an agency.
|
|
149
|
+
*
|
|
150
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-invites
|
|
151
|
+
*
|
|
152
|
+
* @param id The UUID of the agency.
|
|
153
|
+
* @param data The data containing the email of the user to invite.
|
|
154
|
+
* @returns Promise
|
|
155
|
+
*/
|
|
156
|
+
public static invite<T>(id: string, data: { email: string }): AxiosPromise<Response<T>> {
|
|
157
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.invite, data, { id });
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* List all pending invitations for an agency.
|
|
162
|
+
*
|
|
163
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-id-invites
|
|
164
|
+
*
|
|
165
|
+
* @param id The UUID of the agency.
|
|
166
|
+
* @returns Promise
|
|
167
|
+
*/
|
|
168
|
+
public static listInvites<T>(id: string): AxiosPromise<Response<T>> {
|
|
169
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.listInvites, {}, { id });
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Revoke a pending invitation.
|
|
174
|
+
*
|
|
175
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-invites-invite_id
|
|
176
|
+
*
|
|
177
|
+
* @param id The UUID of the agency.
|
|
178
|
+
* @param invite_id The UUID of the invitation to revoke.
|
|
179
|
+
* @returns Promise
|
|
180
|
+
*/
|
|
181
|
+
public static revokeInvite<T>(id: string, invite_id: string): AxiosPromise<Response<T>> {
|
|
182
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.revokeInvite, {}, { id, invite_id });
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Get the details of a pending invitation using its token.
|
|
187
|
+
*
|
|
188
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-invites-details
|
|
189
|
+
*
|
|
190
|
+
* @param params An object containing the token.
|
|
191
|
+
* @returns Promise
|
|
192
|
+
*/
|
|
193
|
+
public static getInviteDetails<T>(params: { token: string }): AxiosPromise<Response<T>> {
|
|
194
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.getInviteDetails, undefined, undefined, params);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Accept an invitation to become an administrator.
|
|
199
|
+
*
|
|
200
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-invites-accept
|
|
201
|
+
*
|
|
202
|
+
* @param data The data containing the invitation token.
|
|
203
|
+
* @returns Promise
|
|
204
|
+
*/
|
|
205
|
+
public static acceptInvite<T>(data: { token: string }): AxiosPromise<Response<T>> {
|
|
206
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.acceptInvite, data);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export default MarketingAgencies;
|
package/src/api/index.ts
CHANGED
|
@@ -35,6 +35,7 @@ import Hashtags from "./Hashtags";
|
|
|
35
35
|
import WebsiteAnalytics from "./WebsiteAnalytics";
|
|
36
36
|
import ShortLinks from "./ShortLinks";
|
|
37
37
|
import AIUsage from "./AIUsage";
|
|
38
|
+
import MarketingAgencies from "./MarketingAgencies";
|
|
38
39
|
|
|
39
40
|
export {Ads};
|
|
40
41
|
export {Auth};
|
|
@@ -72,4 +73,5 @@ export {Hashtags};
|
|
|
72
73
|
export {WebsiteAnalytics};
|
|
73
74
|
export {Fingerprinting};
|
|
74
75
|
export {ShortLinks};
|
|
75
|
-
export {AIUsage};
|
|
76
|
+
export {AIUsage};
|
|
77
|
+
export {MarketingAgencies};
|
package/src/index.ts
CHANGED
|
@@ -39,6 +39,7 @@ import {WebsiteAnalytics} from "./api";
|
|
|
39
39
|
import {Fingerprinting} from "./api";
|
|
40
40
|
import {ShortLinks} from "./api";
|
|
41
41
|
import {AIUsage} from "./api";
|
|
42
|
+
import {MarketingAgencies} from "./api"
|
|
42
43
|
|
|
43
44
|
import Requests from "./util/Requests";
|
|
44
45
|
import Parser from "./util/Parser";
|
|
@@ -106,7 +107,8 @@ class Glitch {
|
|
|
106
107
|
WebsiteAnalytics: WebsiteAnalytics,
|
|
107
108
|
Fingerprinting : Fingerprinting,
|
|
108
109
|
ShortLinks : ShortLinks,
|
|
109
|
-
AIUsage : AIUsage
|
|
110
|
+
AIUsage : AIUsage,
|
|
111
|
+
MarketingAgencies : MarketingAgencies
|
|
110
112
|
}
|
|
111
113
|
|
|
112
114
|
public static util = {
|
package/src/routes/AdsRoute.ts
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import Route from "./interface";
|
|
2
|
+
import HTTP_METHODS from "../constants/HttpMethods";
|
|
3
|
+
|
|
4
|
+
class MarketingAgenciesRoute {
|
|
5
|
+
|
|
6
|
+
public static routes: { [key: string]: Route } = {
|
|
7
|
+
// CRUD for agencies
|
|
8
|
+
list: { url: '/marketing-agencies', method: HTTP_METHODS.GET },
|
|
9
|
+
create: { url: '/marketing-agencies', method: HTTP_METHODS.POST },
|
|
10
|
+
view: { url: '/marketing-agencies/{id}', method: HTTP_METHODS.GET },
|
|
11
|
+
update: { url: '/marketing-agencies/{id}', method: HTTP_METHODS.PUT },
|
|
12
|
+
delete: { url: '/marketing-agencies/{id}', method: HTTP_METHODS.DELETE },
|
|
13
|
+
|
|
14
|
+
// Administrator management
|
|
15
|
+
addAdministrator: { url: '/marketing-agencies/{id}/administrators', method: HTTP_METHODS.POST },
|
|
16
|
+
removeAdministrator: { url: '/marketing-agencies/{id}/administrators/{user_id}', method: HTTP_METHODS.DELETE },
|
|
17
|
+
|
|
18
|
+
// Logo management
|
|
19
|
+
setLogo: { url: '/marketing-agencies/{id}/logo', method: HTTP_METHODS.POST },
|
|
20
|
+
|
|
21
|
+
// Case Study management
|
|
22
|
+
addCaseStudy: { url: '/marketing-agencies/{id}/case-studies', method: HTTP_METHODS.POST },
|
|
23
|
+
removeCaseStudy: { url: '/marketing-agencies/{id}/case-studies/{media_id}', method: HTTP_METHODS.DELETE },
|
|
24
|
+
updateCaseStudyOrder: { url: '/marketing-agencies/{id}/case-studies/order', method: HTTP_METHODS.POST },
|
|
25
|
+
|
|
26
|
+
// Invitation management
|
|
27
|
+
invite: { url: '/marketing-agencies/{id}/invites', method: HTTP_METHODS.POST },
|
|
28
|
+
listInvites: { url: '/marketing-agencies/{id}/invites', method: HTTP_METHODS.GET },
|
|
29
|
+
revokeInvite: { url: '/marketing-agencies/{id}/invites/{invite_id}', method: HTTP_METHODS.DELETE },
|
|
30
|
+
getInviteDetails: { url: '/marketing-agencies/invites/details', method: HTTP_METHODS.GET },
|
|
31
|
+
acceptInvite: { url: '/marketing-agencies/invites/accept', method: HTTP_METHODS.POST },
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default MarketingAgenciesRoute;
|