@parra/parra-js-sdk 0.2.112 → 0.2.114
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/ParraAPI.d.ts +30 -29
- package/dist/ParraAPI.js +15 -11
- package/package.json +1 -1
package/dist/ParraAPI.d.ts
CHANGED
|
@@ -342,6 +342,7 @@ export interface UpdateCampaignRequestBody {
|
|
|
342
342
|
description?: string | null;
|
|
343
343
|
start_at?: string | null;
|
|
344
344
|
end_at?: string | null;
|
|
345
|
+
paused_at?: string | null;
|
|
345
346
|
triggers?: UpdateCampaignTriggerList;
|
|
346
347
|
actions?: UpdateCampaignActionList;
|
|
347
348
|
}
|
|
@@ -350,6 +351,7 @@ export interface CreateCampaignRequestBody {
|
|
|
350
351
|
description?: string | null;
|
|
351
352
|
start_at?: string | null;
|
|
352
353
|
end_at?: string | null;
|
|
354
|
+
paused_at?: string | null;
|
|
353
355
|
triggers?: UpdateCampaignTriggerList;
|
|
354
356
|
actions?: UpdateCampaignActionList;
|
|
355
357
|
}
|
|
@@ -390,8 +392,18 @@ export interface CampaignTrigger {
|
|
|
390
392
|
analytic_event_type_id: string;
|
|
391
393
|
}
|
|
392
394
|
export declare type CampaignTriggerList = Array<CampaignTrigger>;
|
|
395
|
+
export declare enum CampaignActionType {
|
|
396
|
+
question = "question"
|
|
397
|
+
}
|
|
398
|
+
export declare enum CampaignActionDisplayType {
|
|
399
|
+
popup = "popup",
|
|
400
|
+
inline = "inline"
|
|
401
|
+
}
|
|
393
402
|
export interface UpdateCampaignActionRequestBody {
|
|
403
|
+
type: CampaignActionType;
|
|
394
404
|
question_id?: string;
|
|
405
|
+
display_type?: CampaignActionDisplayType | null;
|
|
406
|
+
app_area_id?: string | null;
|
|
395
407
|
}
|
|
396
408
|
export declare type UpdateCampaignActionList = Array<UpdateCampaignActionRequestBody>;
|
|
397
409
|
export interface CampaignAction {
|
|
@@ -399,7 +411,10 @@ export interface CampaignAction {
|
|
|
399
411
|
created_at: string;
|
|
400
412
|
updated_at: string;
|
|
401
413
|
deleted_at?: string | null;
|
|
414
|
+
type: CampaignActionType;
|
|
402
415
|
question_id?: string;
|
|
416
|
+
display_type?: CampaignActionDisplayType | null;
|
|
417
|
+
app_area_id?: string | null;
|
|
403
418
|
}
|
|
404
419
|
export declare type CampaignActionList = Array<CampaignAction>;
|
|
405
420
|
export interface FormResponse {
|
|
@@ -420,6 +435,7 @@ export interface Answer {
|
|
|
420
435
|
question_id: string;
|
|
421
436
|
user_id: string;
|
|
422
437
|
tenant_id: string;
|
|
438
|
+
campaign_id?: string | null;
|
|
423
439
|
data: AnswerData;
|
|
424
440
|
}
|
|
425
441
|
export interface AnswerQuestionBody {
|
|
@@ -431,11 +447,20 @@ export interface BulkAnswerQuestionBody {
|
|
|
431
447
|
}
|
|
432
448
|
export declare type BulkAnswerQuestionsBody = Array<BulkAnswerQuestionBody>;
|
|
433
449
|
export declare type CardItemData = Question;
|
|
450
|
+
export declare enum CardItemDisplayType {
|
|
451
|
+
inline = "inline",
|
|
452
|
+
popup = "popup"
|
|
453
|
+
}
|
|
434
454
|
export declare enum CardItemType {
|
|
435
455
|
question = "question"
|
|
436
456
|
}
|
|
437
457
|
export interface CardItem {
|
|
458
|
+
id: string;
|
|
459
|
+
campaign_id: string;
|
|
460
|
+
campaign_action_id: string;
|
|
461
|
+
question_id?: string | null;
|
|
438
462
|
type: CardItemType;
|
|
463
|
+
display_type?: CardItemDisplayType;
|
|
439
464
|
version: string;
|
|
440
465
|
data: CardItemData;
|
|
441
466
|
}
|
|
@@ -588,57 +613,29 @@ export declare type QuestionData = ChoiceQuestionBody | CheckboxQuestionBody | I
|
|
|
588
613
|
export interface UpdateQuestionRequestBody {
|
|
589
614
|
title: string;
|
|
590
615
|
subtitle?: string | null;
|
|
591
|
-
app_area_id?: string | null;
|
|
592
616
|
data: MutableQuestionData;
|
|
593
|
-
active?: boolean;
|
|
594
|
-
expires_at?: string | null;
|
|
595
|
-
answer_quota?: number | null;
|
|
596
|
-
show_expires_at: boolean;
|
|
597
|
-
show_answer_count: boolean;
|
|
598
|
-
show_answer_quota: boolean;
|
|
599
617
|
}
|
|
600
618
|
export interface CreateQuestionRequestBody {
|
|
601
619
|
title: string;
|
|
602
620
|
subtitle?: string | null;
|
|
603
|
-
app_area_id?: string | null;
|
|
604
621
|
data: MutableQuestionData;
|
|
605
|
-
active?: boolean;
|
|
606
|
-
expires_at?: string | null;
|
|
607
|
-
answer_quota?: number | null;
|
|
608
|
-
show_expires_at: boolean;
|
|
609
|
-
show_answer_count: boolean;
|
|
610
|
-
show_answer_quota: boolean;
|
|
611
622
|
type: QuestionType;
|
|
612
623
|
kind: QuestionKind;
|
|
613
624
|
}
|
|
614
|
-
export declare enum QuestionStatus {
|
|
615
|
-
open = "open",
|
|
616
|
-
closed = "closed"
|
|
617
|
-
}
|
|
618
625
|
export interface Question {
|
|
619
626
|
id: string;
|
|
620
627
|
created_at: string;
|
|
621
628
|
updated_at: string;
|
|
622
629
|
deleted_at?: string | null;
|
|
623
|
-
status: QuestionStatus;
|
|
624
630
|
tenant_id: string;
|
|
625
631
|
title: string;
|
|
626
632
|
subtitle?: string | null;
|
|
627
|
-
app_area_id?: string | null;
|
|
628
633
|
type: QuestionType;
|
|
629
634
|
kind: QuestionKind;
|
|
630
635
|
data: QuestionData;
|
|
631
|
-
active?: boolean;
|
|
632
|
-
answer_quota?: number | null;
|
|
633
636
|
answer_count?: number | null;
|
|
634
|
-
show_answer_count: boolean;
|
|
635
|
-
show_answer_quota: boolean;
|
|
636
|
-
show_expires_at: boolean;
|
|
637
|
-
expires_at?: string | null;
|
|
638
|
-
closed_at?: string | null;
|
|
639
637
|
answer?: Answer;
|
|
640
638
|
metrics?: QuestionMetrics;
|
|
641
|
-
app_area?: AppArea;
|
|
642
639
|
}
|
|
643
640
|
export interface QuestionCollectionResponse {
|
|
644
641
|
page: number;
|
|
@@ -744,6 +741,11 @@ export interface Session {
|
|
|
744
741
|
user_properties?: Map<string, any> | null;
|
|
745
742
|
events?: Array<Event>;
|
|
746
743
|
}
|
|
744
|
+
export interface ReportSessionResponse {
|
|
745
|
+
should_poll: boolean;
|
|
746
|
+
retry_delay: number;
|
|
747
|
+
retry_times: number;
|
|
748
|
+
}
|
|
747
749
|
export interface UpdateTemplateRequestBody {
|
|
748
750
|
description?: string | null;
|
|
749
751
|
}
|
|
@@ -1036,7 +1038,6 @@ declare class ParraAPI {
|
|
|
1036
1038
|
getQuestionById: (question_id: string) => Promise<Question>;
|
|
1037
1039
|
updateQuestionById: (question_id: string, body?: UpdateQuestionRequestBody | undefined) => Promise<Question>;
|
|
1038
1040
|
deleteQuestionById: (question_id: string) => Promise<Response>;
|
|
1039
|
-
closeQuestionById: (question_id: string) => Promise<Response>;
|
|
1040
1041
|
createMetricsForQuestionById: (question_id: string) => Promise<QuestionMetrics>;
|
|
1041
1042
|
answerQuestionById: (question_id: string, body?: AnswerQuestionBody | undefined) => Promise<Response>;
|
|
1042
1043
|
paginateAnswersForQuestionById: (question_id: string, query?: {
|
package/dist/ParraAPI.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TemplateType = exports.
|
|
3
|
+
exports.TemplateType = exports.QuestionKind = exports.QuestionType = exports.CardItemType = exports.CardItemDisplayType = exports.CampaignActionDisplayType = exports.CampaignActionType = exports.CampaignStatus = exports.SubscriptionStatus = exports.Interval = exports.Currency = void 0;
|
|
4
4
|
var Currency;
|
|
5
5
|
(function (Currency) {
|
|
6
6
|
Currency["usd"] = "usd";
|
|
@@ -30,6 +30,20 @@ var CampaignStatus;
|
|
|
30
30
|
CampaignStatus["closed"] = "closed";
|
|
31
31
|
CampaignStatus["archived"] = "archived";
|
|
32
32
|
})(CampaignStatus = exports.CampaignStatus || (exports.CampaignStatus = {}));
|
|
33
|
+
var CampaignActionType;
|
|
34
|
+
(function (CampaignActionType) {
|
|
35
|
+
CampaignActionType["question"] = "question";
|
|
36
|
+
})(CampaignActionType = exports.CampaignActionType || (exports.CampaignActionType = {}));
|
|
37
|
+
var CampaignActionDisplayType;
|
|
38
|
+
(function (CampaignActionDisplayType) {
|
|
39
|
+
CampaignActionDisplayType["popup"] = "popup";
|
|
40
|
+
CampaignActionDisplayType["inline"] = "inline";
|
|
41
|
+
})(CampaignActionDisplayType = exports.CampaignActionDisplayType || (exports.CampaignActionDisplayType = {}));
|
|
42
|
+
var CardItemDisplayType;
|
|
43
|
+
(function (CardItemDisplayType) {
|
|
44
|
+
CardItemDisplayType["inline"] = "inline";
|
|
45
|
+
CardItemDisplayType["popup"] = "popup";
|
|
46
|
+
})(CardItemDisplayType = exports.CardItemDisplayType || (exports.CardItemDisplayType = {}));
|
|
33
47
|
var CardItemType;
|
|
34
48
|
(function (CardItemType) {
|
|
35
49
|
CardItemType["question"] = "question";
|
|
@@ -57,11 +71,6 @@ var QuestionKind;
|
|
|
57
71
|
QuestionKind["rankedChoice"] = "ranked-choice";
|
|
58
72
|
QuestionKind["tag"] = "tag";
|
|
59
73
|
})(QuestionKind = exports.QuestionKind || (exports.QuestionKind = {}));
|
|
60
|
-
var QuestionStatus;
|
|
61
|
-
(function (QuestionStatus) {
|
|
62
|
-
QuestionStatus["open"] = "open";
|
|
63
|
-
QuestionStatus["closed"] = "closed";
|
|
64
|
-
})(QuestionStatus = exports.QuestionStatus || (exports.QuestionStatus = {}));
|
|
65
74
|
var TemplateType;
|
|
66
75
|
(function (TemplateType) {
|
|
67
76
|
TemplateType["question"] = "question";
|
|
@@ -407,11 +416,6 @@ var ParraAPI = /** @class */ (function () {
|
|
|
407
416
|
method: "delete",
|
|
408
417
|
});
|
|
409
418
|
};
|
|
410
|
-
this.closeQuestionById = function (question_id) {
|
|
411
|
-
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions/").concat(question_id, "/close"), {
|
|
412
|
-
method: "post",
|
|
413
|
-
});
|
|
414
|
-
};
|
|
415
419
|
this.createMetricsForQuestionById = function (question_id) {
|
|
416
420
|
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions/").concat(question_id, "/metrics"), {
|
|
417
421
|
method: "post",
|