glitch-javascript-sdk 0.8.2 → 0.8.4

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/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 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "0.8.2",
3
+ "version": "0.8.4",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -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;
@@ -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.PUT },
23
28
  };
24
29
 
25
30
  }
@@ -258,7 +258,7 @@ class Requests {
258
258
  const totalProgress = totalUploaded + currentChunkProgress;
259
259
 
260
260
  if(onProgress){
261
- onProgress(fileSize, totalProgress);
261
+ onProgress(fileSize, end);
262
262
  }
263
263
  }
264
264
  });