@parra/parra-js-sdk 0.2.108 → 0.2.111

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.
@@ -330,6 +330,7 @@ export interface AppAreaCollectionResponse {
330
330
  export declare type AppAreaListResponse = Array<AppArea>;
331
331
  export declare enum CampaignStatus {
332
332
  active = "active",
333
+ paused = "paused",
333
334
  draft = "draft",
334
335
  scheduled = "scheduled",
335
336
  complete = "complete",
@@ -337,12 +338,16 @@ export declare enum CampaignStatus {
337
338
  archived = "archived"
338
339
  }
339
340
  export interface UpdateCampaignRequestBody {
340
- name: string;
341
+ name?: string;
341
342
  description?: string | null;
343
+ triggers?: UpdateCampaignTriggerList;
344
+ actions?: UpdateCampaignActionList;
342
345
  }
343
346
  export interface CreateCampaignRequestBody {
344
- name: string;
347
+ name?: string;
345
348
  description?: string | null;
349
+ triggers?: UpdateCampaignTriggerList;
350
+ actions?: UpdateCampaignActionList;
346
351
  }
347
352
  export interface Campaign {
348
353
  id: string;
@@ -355,7 +360,11 @@ export interface Campaign {
355
360
  published_at?: string | null;
356
361
  start_at?: string | null;
357
362
  end_at?: string | null;
363
+ paused_at?: string | null;
364
+ closed_at?: string | null;
358
365
  status: CampaignStatus;
366
+ triggers?: CampaignTriggerList;
367
+ actions?: CampaignActionList;
359
368
  }
360
369
  export interface CampaignCollectionResponse {
361
370
  page: number;
@@ -365,6 +374,30 @@ export interface CampaignCollectionResponse {
365
374
  data: Array<Campaign>;
366
375
  }
367
376
  export declare type CampaignListResponse = Array<Campaign>;
377
+ export interface UpdateCampaignTriggerRequestBody {
378
+ analytic_event_type_id: string;
379
+ }
380
+ export declare type UpdateCampaignTriggerList = Array<UpdateCampaignTriggerRequestBody>;
381
+ export interface CampaignTrigger {
382
+ id: string;
383
+ created_at: string;
384
+ updated_at: string;
385
+ deleted_at?: string | null;
386
+ analytic_event_type_id: string;
387
+ }
388
+ export declare type CampaignTriggerList = Array<CampaignTrigger>;
389
+ export interface UpdateCampaignActionRequestBody {
390
+ question_id?: string;
391
+ }
392
+ export declare type UpdateCampaignActionList = Array<UpdateCampaignActionRequestBody>;
393
+ export interface CampaignAction {
394
+ id: string;
395
+ created_at: string;
396
+ updated_at: string;
397
+ deleted_at?: string | null;
398
+ question_id?: string;
399
+ }
400
+ export declare type CampaignActionList = Array<CampaignAction>;
368
401
  export interface FormResponse {
369
402
  }
370
403
  export interface Form {
@@ -512,24 +545,24 @@ export interface MutableStarQuestionBody {
512
545
  trailing_label?: string;
513
546
  }
514
547
  export interface ShortTextQuestionBody {
515
- placeholder?: string;
516
- min_length?: number;
517
- max_length?: number;
548
+ placeholder?: string | null;
549
+ min_length?: number | null;
550
+ max_length?: number | null;
518
551
  }
519
552
  export interface MutableShortTextQuestionBody {
520
- placeholder?: string;
521
- min_length?: number;
522
- max_length?: number;
553
+ placeholder?: string | null;
554
+ min_length?: number | null;
555
+ max_length?: number | null;
523
556
  }
524
557
  export interface LongTextQuestionBody {
525
- placeholder?: string;
526
- min_length?: number;
527
- max_length?: number;
558
+ placeholder?: string | null;
559
+ min_length?: number | null;
560
+ max_length?: number | null;
528
561
  }
529
562
  export interface MutableLongTextQuestionBody {
530
- placeholder?: string;
531
- min_length?: number;
532
- max_length?: number;
563
+ placeholder?: string | null;
564
+ min_length?: number | null;
565
+ max_length?: number | null;
533
566
  }
534
567
  export interface MutableBooleanQuestionOption {
535
568
  title: string;
@@ -702,6 +735,8 @@ export interface Event {
702
735
  metadata?: Map<string, any> | null;
703
736
  }
704
737
  export interface Session {
738
+ started_at?: string | null;
739
+ ended_at?: string | null;
705
740
  user_properties?: Map<string, any> | null;
706
741
  events?: Array<Event>;
707
742
  }
@@ -972,9 +1007,13 @@ declare class ParraAPI {
972
1007
  $expand?: string | undefined;
973
1008
  $search?: string | undefined;
974
1009
  } | undefined) => Promise<CampaignCollectionResponse>;
975
- getCampaignById: (tenant_id: string, campaign_id: string) => Promise<Campaign>;
1010
+ getCampaignById: (tenant_id: string, campaign_id: string, query?: {
1011
+ include?: string | undefined;
1012
+ } | undefined) => Promise<Campaign>;
976
1013
  updateCampaignById: (tenant_id: string, campaign_id: string, body?: UpdateCampaignRequestBody | undefined) => Promise<Campaign>;
977
1014
  deleteCampaignById: (tenant_id: string, campaign_id: string) => Promise<Response>;
1015
+ publishCampaignById: (tenant_id: string, campaign_id: string, body?: UpdateCampaignRequestBody | undefined) => Promise<Campaign>;
1016
+ closeCampaignById: (tenant_id: string, campaign_id: string) => Promise<Campaign>;
978
1017
  getCards: (query?: {
979
1018
  app_area_id?: string | undefined;
980
1019
  } | undefined) => Promise<CardsResponse>;
package/dist/ParraAPI.js CHANGED
@@ -23,6 +23,7 @@ var SubscriptionStatus;
23
23
  var CampaignStatus;
24
24
  (function (CampaignStatus) {
25
25
  CampaignStatus["active"] = "active";
26
+ CampaignStatus["paused"] = "paused";
26
27
  CampaignStatus["draft"] = "draft";
27
28
  CampaignStatus["scheduled"] = "scheduled";
28
29
  CampaignStatus["complete"] = "complete";
@@ -317,14 +318,15 @@ var ParraAPI = /** @class */ (function () {
317
318
  query: query,
318
319
  });
319
320
  };
320
- this.getCampaignById = function (tenant_id, campaign_id) {
321
+ this.getCampaignById = function (tenant_id, campaign_id, query) {
321
322
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/campaigns/").concat(campaign_id), {
322
323
  method: "get",
324
+ query: query,
323
325
  });
324
326
  };
325
327
  this.updateCampaignById = function (tenant_id, campaign_id, body) {
326
328
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/campaigns/").concat(campaign_id), {
327
- method: "put",
329
+ method: "patch",
328
330
  body: JSON.stringify(body),
329
331
  headers: {
330
332
  "content-type": "application/json",
@@ -336,6 +338,20 @@ var ParraAPI = /** @class */ (function () {
336
338
  method: "delete",
337
339
  });
338
340
  };
341
+ this.publishCampaignById = function (tenant_id, campaign_id, body) {
342
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/campaigns/").concat(campaign_id, "/publish"), {
343
+ method: "post",
344
+ body: JSON.stringify(body),
345
+ headers: {
346
+ "content-type": "application/json",
347
+ },
348
+ });
349
+ };
350
+ this.closeCampaignById = function (tenant_id, campaign_id) {
351
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/campaigns/").concat(campaign_id, "/close"), {
352
+ method: "post",
353
+ });
354
+ };
339
355
  this.getCards = function (query) {
340
356
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/cards"), {
341
357
  method: "get",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.2.108",
3
+ "version": "0.2.111",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",