glitch-javascript-sdk 0.8.3 → 0.8.5
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 +75 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Campaigns.d.ts +49 -0
- package/dist/esm/api/Messages.d.ts +8 -0
- package/dist/esm/index.js +75 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +57 -0
- package/package.json +1 -1
- package/src/api/Campaigns.ts +69 -0
- package/src/api/Messages.ts +11 -0
- package/src/routes/CampaignsRoute.ts +6 -1
- package/src/routes/MessagesRoute.ts +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -2391,6 +2391,55 @@ declare class Campaigns {
|
|
|
2391
2391
|
* @returns promise
|
|
2392
2392
|
*/
|
|
2393
2393
|
static listInfluencerCampaignLinks<T>(campaign_id: string, user_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2394
|
+
/**
|
|
2395
|
+
* List all the campaign mentions.
|
|
2396
|
+
*
|
|
2397
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getCampaignLinks
|
|
2398
|
+
*
|
|
2399
|
+
* @returns promise
|
|
2400
|
+
*/
|
|
2401
|
+
static listCampaignMentions<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2402
|
+
/**
|
|
2403
|
+
* Create a new campaign mention.
|
|
2404
|
+
*
|
|
2405
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/storeCampaignLink
|
|
2406
|
+
*
|
|
2407
|
+
* @param data The data to be passed when creating a campaign.
|
|
2408
|
+
*
|
|
2409
|
+
* @returns Promise
|
|
2410
|
+
*/
|
|
2411
|
+
static createCampaignMention<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2412
|
+
/**
|
|
2413
|
+
* Update a campaign mention.
|
|
2414
|
+
*
|
|
2415
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/1bb1492981b4529693604b03aade8bf6
|
|
2416
|
+
*
|
|
2417
|
+
* @param campaign_id The id of the campaign to update.
|
|
2418
|
+
* @param data The data to update.
|
|
2419
|
+
*
|
|
2420
|
+
* @returns promise
|
|
2421
|
+
*/
|
|
2422
|
+
static updateCampaignMention<T>(campaign_id: string, mention_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2423
|
+
/**
|
|
2424
|
+
* Retrieve the information for a single campaign mention.
|
|
2425
|
+
*
|
|
2426
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getCampaignLink
|
|
2427
|
+
*
|
|
2428
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
2429
|
+
*
|
|
2430
|
+
* @returns promise
|
|
2431
|
+
*/
|
|
2432
|
+
static getCampaignMention<T>(campaign_id: string, mention_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2433
|
+
/**
|
|
2434
|
+
* Delete the information for a single campaign mention.
|
|
2435
|
+
*
|
|
2436
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getCampaignLink
|
|
2437
|
+
*
|
|
2438
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
2439
|
+
*
|
|
2440
|
+
* @returns promise
|
|
2441
|
+
*/
|
|
2442
|
+
static deleteCampaignMention<T>(campaign_id: string, mention_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2394
2443
|
}
|
|
2395
2444
|
|
|
2396
2445
|
declare class Subscriptions {
|
|
@@ -2494,6 +2543,14 @@ declare class Messages {
|
|
|
2494
2543
|
* @returns A promise
|
|
2495
2544
|
*/
|
|
2496
2545
|
static createOrGetThread<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2546
|
+
/**
|
|
2547
|
+
* Get a single thread.
|
|
2548
|
+
*
|
|
2549
|
+
* @see https://api.glitch.fun/api/documentation#/Messages/getThread
|
|
2550
|
+
*
|
|
2551
|
+
* @returns promise
|
|
2552
|
+
*/
|
|
2553
|
+
static getThread<T>(thread_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2497
2554
|
}
|
|
2498
2555
|
|
|
2499
2556
|
declare class Feedback {
|
package/package.json
CHANGED
package/src/api/Campaigns.ts
CHANGED
|
@@ -219,6 +219,75 @@ class Campaigns {
|
|
|
219
219
|
return Requests.processRoute(CampaignsRoute.routes.listInfluencerCampaignLinks , undefined, { campaign_id: campaign_id, user_id: user_id }, params);
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
+
/**
|
|
223
|
+
* List all the campaign mentions.
|
|
224
|
+
*
|
|
225
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getCampaignLinks
|
|
226
|
+
*
|
|
227
|
+
* @returns promise
|
|
228
|
+
*/
|
|
229
|
+
public static listCampaignMentions<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
230
|
+
return Requests.processRoute(CampaignsRoute.routes.listCampaignMentions, undefined, { campaign_id: campaign_id }, params);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Create a new campaign mention.
|
|
235
|
+
*
|
|
236
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/storeCampaignLink
|
|
237
|
+
*
|
|
238
|
+
* @param data The data to be passed when creating a campaign.
|
|
239
|
+
*
|
|
240
|
+
* @returns Promise
|
|
241
|
+
*/
|
|
242
|
+
public static createCampaignMention<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
243
|
+
|
|
244
|
+
return Requests.processRoute(CampaignsRoute.routes.createCampaignMention, data, { campaign_id: campaign_id }, params);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Update a campaign mention.
|
|
249
|
+
*
|
|
250
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/1bb1492981b4529693604b03aade8bf6
|
|
251
|
+
*
|
|
252
|
+
* @param campaign_id The id of the campaign to update.
|
|
253
|
+
* @param data The data to update.
|
|
254
|
+
*
|
|
255
|
+
* @returns promise
|
|
256
|
+
*/
|
|
257
|
+
public static updateCampaignMention<T>(campaign_id: string, mention_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
258
|
+
|
|
259
|
+
return Requests.processRoute(CampaignsRoute.routes.updateCampaignMention, data, { campaign_id: campaign_id, mention_id: mention_id }, params);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Retrieve the information for a single campaign mention.
|
|
264
|
+
*
|
|
265
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getCampaignLink
|
|
266
|
+
*
|
|
267
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
268
|
+
*
|
|
269
|
+
* @returns promise
|
|
270
|
+
*/
|
|
271
|
+
public static getCampaignMention<T>(campaign_id: string, mention_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
272
|
+
|
|
273
|
+
return Requests.processRoute(CampaignsRoute.routes.getCampaignMention, {}, { campaign_id: campaign_id, mention_id: mention_id }, params);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Delete the information for a single campaign mention.
|
|
278
|
+
*
|
|
279
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getCampaignLink
|
|
280
|
+
*
|
|
281
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
282
|
+
*
|
|
283
|
+
* @returns promise
|
|
284
|
+
*/
|
|
285
|
+
public static deleteCampaignMention<T>(campaign_id: string, mention_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
286
|
+
|
|
287
|
+
return Requests.processRoute(CampaignsRoute.routes.deleteCampaignMention, {}, { campaign_id: campaign_id, mention_id: mention_id }, params);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
|
|
222
291
|
}
|
|
223
292
|
|
|
224
293
|
export default Campaigns;
|
package/src/api/Messages.ts
CHANGED
|
@@ -50,6 +50,17 @@ class Messages {
|
|
|
50
50
|
return Requests.processRoute(MessagesRoute.routes.createOrGetThread, data, {}, params);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Get a single thread.
|
|
55
|
+
*
|
|
56
|
+
* @see https://api.glitch.fun/api/documentation#/Messages/getThread
|
|
57
|
+
*
|
|
58
|
+
* @returns promise
|
|
59
|
+
*/
|
|
60
|
+
public static getThread<T>(thread_id : string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
61
|
+
return Requests.processRoute(MessagesRoute.routes.getThread, undefined, {thread_id : thread_id}, params);
|
|
62
|
+
}
|
|
63
|
+
|
|
53
64
|
|
|
54
65
|
|
|
55
66
|
}
|
|
@@ -19,7 +19,12 @@ class CampaignsRoute {
|
|
|
19
19
|
updateInfluencerCampaign :{ url: '/campaigns/{campaign_id}/influencers/{user_id}', method: HTTP_METHODS.PUT },
|
|
20
20
|
markInfluencerCampaignComplete :{ url: '/campaigns/{campaign_id}/influencers/{user_id}/setComplete', method: HTTP_METHODS.POST },
|
|
21
21
|
markInfluencerCampaignIncomplete :{ url: '/campaigns/{campaign_id}/influencers/{user_id}/setIncomplete', method: HTTP_METHODS.POST },
|
|
22
|
-
listInfluencerCampaignLinks :{ url: '/campaigns/{campaign_id}/influencers/{user_id}/links', method: HTTP_METHODS.GET },
|
|
22
|
+
listInfluencerCampaignLinks :{ url: '/campaigns/{campaign_id}/influencers/{user_id}/links', method: HTTP_METHODS.GET },
|
|
23
|
+
listCampaignMentions :{ url: '/campaigns/{campaign_id}/mentions', method: HTTP_METHODS.GET },
|
|
24
|
+
createCampaignMention :{ url: '/campaigns/{campaign_id}/mentions', method: HTTP_METHODS.POST },
|
|
25
|
+
getCampaignMention :{ url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.GET },
|
|
26
|
+
updateCampaignMention :{ url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.PUT },
|
|
27
|
+
deleteCampaignMention :{ url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.DELETE },
|
|
23
28
|
};
|
|
24
29
|
|
|
25
30
|
}
|
|
@@ -8,6 +8,7 @@ class MessagesRoute {
|
|
|
8
8
|
sendMessage: { url: '/messages', method: HTTP_METHODS.POST },
|
|
9
9
|
deleteMessage: { url: '/messages/{message_id}', method: HTTP_METHODS.DELETE },
|
|
10
10
|
createOrGetThread: { url: '/messages/makeThread', method: HTTP_METHODS.POST },
|
|
11
|
+
getThread: { url: '/messages/thread/{thread_id}', method: HTTP_METHODS.GET },
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
}
|