@parra/parra-js-sdk 0.3.1 → 0.3.3
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 +159 -159
- package/dist/index.d.ts +1 -1
- package/package.json +4 -4
- package/dist/AccessToken.d.ts +0 -1
- package/dist/AccessToken.js +0 -63
package/dist/ParraAPI.d.ts
CHANGED
|
@@ -144,7 +144,7 @@ export interface CreateAuthTokenRequestBody {
|
|
|
144
144
|
}
|
|
145
145
|
export interface Entitlement {
|
|
146
146
|
}
|
|
147
|
-
export
|
|
147
|
+
export type UpdateEntitlementsRequestBody = Array<Entitlement>;
|
|
148
148
|
export interface UpdateTenantRequestBody {
|
|
149
149
|
name: string;
|
|
150
150
|
}
|
|
@@ -191,7 +191,7 @@ export interface TenantMember {
|
|
|
191
191
|
metrics?: TenantMetrics | null;
|
|
192
192
|
scopes: Array<string>;
|
|
193
193
|
}
|
|
194
|
-
export
|
|
194
|
+
export type TenantListResponse = Array<Tenant>;
|
|
195
195
|
export interface TenantCollectionResponse {
|
|
196
196
|
page: number;
|
|
197
197
|
page_count: number;
|
|
@@ -296,7 +296,7 @@ export interface TenantInvitation {
|
|
|
296
296
|
expires_at?: string;
|
|
297
297
|
accepted_at?: string | null;
|
|
298
298
|
}
|
|
299
|
-
export
|
|
299
|
+
export type TenantInvitationListResponse = Array<TenantInvitation>;
|
|
300
300
|
export interface TeamMember {
|
|
301
301
|
id: string;
|
|
302
302
|
created_at: string;
|
|
@@ -308,7 +308,7 @@ export interface TeamMember {
|
|
|
308
308
|
email: string;
|
|
309
309
|
avatar_url?: string;
|
|
310
310
|
}
|
|
311
|
-
export
|
|
311
|
+
export type TeamMemberListResponse = Array<TeamMember>;
|
|
312
312
|
export interface AnswerData {
|
|
313
313
|
}
|
|
314
314
|
export interface AnswerCollectionResponse {
|
|
@@ -342,7 +342,7 @@ export interface AnalyticEventTypeCollectionResponse {
|
|
|
342
342
|
total_count: number;
|
|
343
343
|
data: Array<AnalyticEventType>;
|
|
344
344
|
}
|
|
345
|
-
export
|
|
345
|
+
export type AnalyticEventTypeListResponse = Array<AnalyticEventType>;
|
|
346
346
|
export interface UpdateAppAreaRequestBody {
|
|
347
347
|
title: string;
|
|
348
348
|
slug: string;
|
|
@@ -370,7 +370,7 @@ export interface AppAreaCollectionResponse {
|
|
|
370
370
|
total_count: number;
|
|
371
371
|
data: Array<AppArea>;
|
|
372
372
|
}
|
|
373
|
-
export
|
|
373
|
+
export type AppAreaListResponse = Array<AppArea>;
|
|
374
374
|
export declare enum CampaignStatus {
|
|
375
375
|
active = "active",
|
|
376
376
|
paused = "paused",
|
|
@@ -422,12 +422,12 @@ export interface CampaignCollectionResponse {
|
|
|
422
422
|
total_count: number;
|
|
423
423
|
data: Array<Campaign>;
|
|
424
424
|
}
|
|
425
|
-
export
|
|
425
|
+
export type CampaignListResponse = Array<Campaign>;
|
|
426
426
|
export interface UpdateCampaignTriggerRequestBody {
|
|
427
427
|
type: string;
|
|
428
428
|
analytic_event_type_id?: string | null;
|
|
429
429
|
}
|
|
430
|
-
export
|
|
430
|
+
export type UpdateCampaignTriggerList = Array<UpdateCampaignTriggerRequestBody>;
|
|
431
431
|
export interface CampaignTrigger {
|
|
432
432
|
id: string;
|
|
433
433
|
created_at: string;
|
|
@@ -436,7 +436,7 @@ export interface CampaignTrigger {
|
|
|
436
436
|
type: string;
|
|
437
437
|
analytic_event_type_id?: string | null;
|
|
438
438
|
}
|
|
439
|
-
export
|
|
439
|
+
export type CampaignTriggerList = Array<CampaignTrigger>;
|
|
440
440
|
export declare enum CampaignActionType {
|
|
441
441
|
question = "question",
|
|
442
442
|
notification = "notification"
|
|
@@ -452,7 +452,7 @@ export interface UpdateCampaignActionRequestBody {
|
|
|
452
452
|
display_type?: CampaignActionDisplayType | null;
|
|
453
453
|
app_area_id?: string | null;
|
|
454
454
|
}
|
|
455
|
-
export
|
|
455
|
+
export type UpdateCampaignActionList = Array<UpdateCampaignActionRequestBody>;
|
|
456
456
|
export interface CampaignAction {
|
|
457
457
|
id: string;
|
|
458
458
|
created_at: string;
|
|
@@ -464,7 +464,7 @@ export interface CampaignAction {
|
|
|
464
464
|
display_type?: CampaignActionDisplayType | null;
|
|
465
465
|
app_area_id?: string | null;
|
|
466
466
|
}
|
|
467
|
-
export
|
|
467
|
+
export type CampaignActionList = Array<CampaignAction>;
|
|
468
468
|
export interface UpdateFeedbackFormRequestBody {
|
|
469
469
|
title: string;
|
|
470
470
|
description?: string | null;
|
|
@@ -535,7 +535,7 @@ export interface FeedbackFormField {
|
|
|
535
535
|
required?: boolean;
|
|
536
536
|
data: FeedbackFormFieldData;
|
|
537
537
|
}
|
|
538
|
-
export
|
|
538
|
+
export type FeedbackFormFieldData = FeedbackFormTextFieldData | FeedbackFormSelectFieldData | FeedbackFormInputFieldData;
|
|
539
539
|
export interface FeedbackFormTextFieldData {
|
|
540
540
|
placeholder?: string;
|
|
541
541
|
lines?: number;
|
|
@@ -590,8 +590,8 @@ export interface BulkAnswerQuestionBody {
|
|
|
590
590
|
bucket_item_id?: string | null;
|
|
591
591
|
data: AnswerData;
|
|
592
592
|
}
|
|
593
|
-
export
|
|
594
|
-
export
|
|
593
|
+
export type BulkAnswerQuestionsBody = Array<BulkAnswerQuestionBody>;
|
|
594
|
+
export type CardItemData = Question;
|
|
595
595
|
export declare enum CardItemDisplayType {
|
|
596
596
|
inline = "inline",
|
|
597
597
|
popup = "popup"
|
|
@@ -753,8 +753,8 @@ export interface BooleanQuestionBody {
|
|
|
753
753
|
export interface MutableBooleanQuestionBody {
|
|
754
754
|
options: Array<MutableBooleanQuestionOption>;
|
|
755
755
|
}
|
|
756
|
-
export
|
|
757
|
-
export
|
|
756
|
+
export type MutableQuestionData = MutableChoiceQuestionBody | MutableCheckboxQuestionBody | MutableImageQuestionBody | MutableRatingQuestionBody | MutableStarQuestionBody | MutableShortTextQuestionBody | MutableLongTextQuestionBody | MutableBooleanQuestionBody;
|
|
757
|
+
export type QuestionData = ChoiceQuestionBody | CheckboxQuestionBody | ImageQuestionBody | RatingQuestionBody | StarQuestionBody | ShortTextQuestionBody | LongTextQuestionBody | BooleanQuestionBody;
|
|
758
758
|
export interface UpdateQuestionRequestBody {
|
|
759
759
|
title: string;
|
|
760
760
|
subtitle?: string | null;
|
|
@@ -804,7 +804,7 @@ export interface QuestionMetrics {
|
|
|
804
804
|
kind: QuestionKind;
|
|
805
805
|
data: QuestionMetricsData;
|
|
806
806
|
}
|
|
807
|
-
export
|
|
807
|
+
export type QuestionMetricsData = ChoiceQuestionMetricsBody | CheckboxQuestionMetricsBody | InageQuestionMetricsBody | RatingQuestionMetricsBody | StarQuestionMetricsBody | LongTextQuestionMetricsBody | ShortTextQuestionMetricsBody | BooleanQuestionMetricsBody;
|
|
808
808
|
export interface ChoiceQuestionMetricsBody {
|
|
809
809
|
options: Array<ChoiceQuestionMetricsOption>;
|
|
810
810
|
}
|
|
@@ -935,7 +935,7 @@ export interface TemplateCollectionResponse {
|
|
|
935
935
|
total_count: number;
|
|
936
936
|
data: Array<Template>;
|
|
937
937
|
}
|
|
938
|
-
export
|
|
938
|
+
export type TemplateResponse = Array<Template>;
|
|
939
939
|
export interface UpdateTemplateTagRequestBody {
|
|
940
940
|
description?: string | null;
|
|
941
941
|
}
|
|
@@ -993,7 +993,7 @@ export interface ApplicationCollectionResponse {
|
|
|
993
993
|
total_count: number;
|
|
994
994
|
data: Array<Application>;
|
|
995
995
|
}
|
|
996
|
-
export
|
|
996
|
+
export type ApplicationListResponse = Array<Application>;
|
|
997
997
|
export declare enum ApnsEnvironment {
|
|
998
998
|
production = "production",
|
|
999
999
|
sandbox = "sandbox"
|
|
@@ -1158,7 +1158,7 @@ export interface NotificationTemplateCollectionResponse {
|
|
|
1158
1158
|
total_count: number;
|
|
1159
1159
|
data: Array<NotificationTemplate>;
|
|
1160
1160
|
}
|
|
1161
|
-
export
|
|
1161
|
+
export type NotificationTemplateListResponse = Array<NotificationTemplate>;
|
|
1162
1162
|
export interface NotificationRecipient {
|
|
1163
1163
|
user_id?: string;
|
|
1164
1164
|
data?: object | null;
|
|
@@ -1251,200 +1251,200 @@ declare class ParraAPI {
|
|
|
1251
1251
|
constructor(http: HTTPClient, options: {
|
|
1252
1252
|
baseUrl: string;
|
|
1253
1253
|
});
|
|
1254
|
-
uploadImageAssetForTenantById: (tenant_id: string, body?: UploadImageAssetRequestBody
|
|
1255
|
-
createCustomer: (body?: CreateCustomerRequestBody
|
|
1254
|
+
uploadImageAssetForTenantById: (tenant_id: string, body?: UploadImageAssetRequestBody) => Promise<ImageAsset>;
|
|
1255
|
+
createCustomer: (body?: CreateCustomerRequestBody) => Promise<Customer>;
|
|
1256
1256
|
updateEntitlementsForCustomerById: (customer_id: string) => Promise<Response>;
|
|
1257
1257
|
createBillingPortalSession: (tenant_id: string) => Promise<BillingPortalSession>;
|
|
1258
|
-
createCheckoutSession: (body?: CreateCheckoutSessionRequestBody
|
|
1258
|
+
createCheckoutSession: (body?: CreateCheckoutSessionRequestBody) => Promise<CheckoutSession>;
|
|
1259
1259
|
getPlansForTenantById: (tenant_id: string) => Promise<TenantPlansResponse>;
|
|
1260
|
-
createAudience: (body?: CreateAudienceRequestBody
|
|
1261
|
-
createSubscriberForAudienceById: (audience_id: string, body?: CreateSubscriberRequestBody
|
|
1262
|
-
createTenant: (body?: CreateTenantRequestBody
|
|
1260
|
+
createAudience: (body?: CreateAudienceRequestBody) => Promise<Audience>;
|
|
1261
|
+
createSubscriberForAudienceById: (audience_id: string, body?: CreateSubscriberRequestBody) => Promise<Response>;
|
|
1262
|
+
createTenant: (body?: CreateTenantRequestBody) => Promise<Tenant>;
|
|
1263
1263
|
getTenantById: (tenant_id: string, query?: {
|
|
1264
|
-
include?: string
|
|
1265
|
-
}
|
|
1266
|
-
updateTenantById: (tenant_id: string, body?: UpdateTenantRequestBody
|
|
1264
|
+
include?: string;
|
|
1265
|
+
}) => Promise<Tenant>;
|
|
1266
|
+
updateTenantById: (tenant_id: string, body?: UpdateTenantRequestBody) => Promise<Tenant>;
|
|
1267
1267
|
deleteTenantById: (tenant_id: string) => Promise<Response>;
|
|
1268
1268
|
paginateTenantUsersForTenantById: (tenant_id: string, query?: {
|
|
1269
|
-
$select?: string
|
|
1270
|
-
$top?: number
|
|
1271
|
-
$skip?: number
|
|
1272
|
-
$orderby?: string
|
|
1273
|
-
$filter?: string
|
|
1274
|
-
$expand?: string
|
|
1275
|
-
$search?: string
|
|
1276
|
-
}
|
|
1269
|
+
$select?: string;
|
|
1270
|
+
$top?: number;
|
|
1271
|
+
$skip?: number;
|
|
1272
|
+
$orderby?: string;
|
|
1273
|
+
$filter?: string;
|
|
1274
|
+
$expand?: string;
|
|
1275
|
+
$search?: string;
|
|
1276
|
+
}) => Promise<TenantUserCollectionResponse>;
|
|
1277
1277
|
getUserForTenantById: (tenant_id: string, user_id: string) => Promise<TenantUser>;
|
|
1278
|
-
createTenantForUserById: (user_id: string, body?: CreateTenantForUserRequestBody
|
|
1278
|
+
createTenantForUserById: (user_id: string, body?: CreateTenantForUserRequestBody) => Promise<Tenant>;
|
|
1279
1279
|
getTenantsForUserById: (user_id: string) => Promise<TenantListResponse>;
|
|
1280
|
-
createApiKeyForTenantById: (tenant_id: string, body?: CreateApiKeyRequestBody
|
|
1280
|
+
createApiKeyForTenantById: (tenant_id: string, body?: CreateApiKeyRequestBody) => Promise<ApiKeyWithSecretResponse>;
|
|
1281
1281
|
getApiKeysForTenantById: (tenant_id: string) => Promise<ApiKeyCollectionResponse>;
|
|
1282
1282
|
deleteApiKeyForTenantById: (tenant_id: string, api_key_id: string) => Promise<Response>;
|
|
1283
1283
|
getTenantForApiKeyById: (api_key_id: string) => Promise<Tenant>;
|
|
1284
1284
|
getInvitationsForTenantById: (tenant_id: string) => Promise<TenantInvitationListResponse>;
|
|
1285
|
-
createInvitationForTenantById: (tenant_id: string, body?: TenantInvitationRequestBody
|
|
1285
|
+
createInvitationForTenantById: (tenant_id: string, body?: TenantInvitationRequestBody) => Promise<TenantInvitation>;
|
|
1286
1286
|
acceptInvitationByCode: (invitation_code: string) => Promise<TenantInvitation>;
|
|
1287
1287
|
getTeamMembersForTenantById: (tenant_id: string) => Promise<TeamMemberListResponse>;
|
|
1288
1288
|
deleteTeamMemberForTenantById: (tenant_id: string, team_member_id: string) => Promise<Response>;
|
|
1289
1289
|
updateTeamMemberUserForTenantById: (tenant_id: string, team_member_id: string) => Promise<Response>;
|
|
1290
|
-
createAnalyticEventTypeForTenantById: (tenant_id: string, body?: CreateAnalyticEventTypeRequestBody
|
|
1290
|
+
createAnalyticEventTypeForTenantById: (tenant_id: string, body?: CreateAnalyticEventTypeRequestBody) => Promise<AnalyticEventType>;
|
|
1291
1291
|
paginateAnalyticEventTypesForTenantById: (tenant_id: string, query?: {
|
|
1292
|
-
$select?: string
|
|
1293
|
-
$top?: number
|
|
1294
|
-
$skip?: number
|
|
1295
|
-
$orderby?: string
|
|
1296
|
-
$filter?: string
|
|
1297
|
-
$expand?: string
|
|
1298
|
-
$search?: string
|
|
1299
|
-
}
|
|
1292
|
+
$select?: string;
|
|
1293
|
+
$top?: number;
|
|
1294
|
+
$skip?: number;
|
|
1295
|
+
$orderby?: string;
|
|
1296
|
+
$filter?: string;
|
|
1297
|
+
$expand?: string;
|
|
1298
|
+
$search?: string;
|
|
1299
|
+
}) => Promise<AnalyticEventTypeCollectionResponse>;
|
|
1300
1300
|
getAnalyticEventTypeById: (tenant_id: string, analytic_event_type_id: string) => Promise<AnalyticEventType>;
|
|
1301
|
-
updateAnalyticEventTypeById: (tenant_id: string, analytic_event_type_id: string, body?: UpdateAnalyticEventTypeRequestBody
|
|
1301
|
+
updateAnalyticEventTypeById: (tenant_id: string, analytic_event_type_id: string, body?: UpdateAnalyticEventTypeRequestBody) => Promise<AnalyticEventType>;
|
|
1302
1302
|
deleteAnalyticEventTypeById: (tenant_id: string, analytic_event_type_id: string) => Promise<Response>;
|
|
1303
|
-
createAppArea: (tenant_id: string, body?: CreateAppAreaRequestBody
|
|
1303
|
+
createAppArea: (tenant_id: string, body?: CreateAppAreaRequestBody) => Promise<AppArea>;
|
|
1304
1304
|
listAppAreas: (tenant_id: string) => Promise<AppAreaListResponse>;
|
|
1305
1305
|
getAppAreaById: (tenant_id: string, app_area_id: string) => Promise<AppArea>;
|
|
1306
|
-
updateAppAreaById: (tenant_id: string, app_area_id: string, body?: UpdateAppAreaRequestBody
|
|
1306
|
+
updateAppAreaById: (tenant_id: string, app_area_id: string, body?: UpdateAppAreaRequestBody) => Promise<AppArea>;
|
|
1307
1307
|
deleteAppAreaById: (tenant_id: string, app_area_id: string) => Promise<Response>;
|
|
1308
|
-
createCampaign: (tenant_id: string, body?: CreateCampaignRequestBody
|
|
1308
|
+
createCampaign: (tenant_id: string, body?: CreateCampaignRequestBody) => Promise<Campaign>;
|
|
1309
1309
|
paginateCampaignsForTenantById: (tenant_id: string, query?: {
|
|
1310
|
-
$select?: string
|
|
1311
|
-
$top?: number
|
|
1312
|
-
$skip?: number
|
|
1313
|
-
$orderby?: string
|
|
1314
|
-
$filter?: string
|
|
1315
|
-
$expand?: string
|
|
1316
|
-
$search?: string
|
|
1317
|
-
}
|
|
1310
|
+
$select?: string;
|
|
1311
|
+
$top?: number;
|
|
1312
|
+
$skip?: number;
|
|
1313
|
+
$orderby?: string;
|
|
1314
|
+
$filter?: string;
|
|
1315
|
+
$expand?: string;
|
|
1316
|
+
$search?: string;
|
|
1317
|
+
}) => Promise<CampaignCollectionResponse>;
|
|
1318
1318
|
getCampaignById: (tenant_id: string, campaign_id: string, query?: {
|
|
1319
|
-
include?: string
|
|
1320
|
-
}
|
|
1321
|
-
updateCampaignById: (tenant_id: string, campaign_id: string, body?: UpdateCampaignRequestBody
|
|
1319
|
+
include?: string;
|
|
1320
|
+
}) => Promise<Campaign>;
|
|
1321
|
+
updateCampaignById: (tenant_id: string, campaign_id: string, body?: UpdateCampaignRequestBody) => Promise<Campaign>;
|
|
1322
1322
|
deleteCampaignById: (tenant_id: string, campaign_id: string) => Promise<Response>;
|
|
1323
|
-
publishCampaignById: (tenant_id: string, campaign_id: string, body?: UpdateCampaignRequestBody
|
|
1323
|
+
publishCampaignById: (tenant_id: string, campaign_id: string, body?: UpdateCampaignRequestBody) => Promise<Campaign>;
|
|
1324
1324
|
enrollEligibleUsersForCampaignById: (campaign_id: string) => Promise<Response>;
|
|
1325
1325
|
closeCampaignById: (tenant_id: string, campaign_id: string) => Promise<Campaign>;
|
|
1326
1326
|
getCards: (query?: {
|
|
1327
|
-
app_area_id?: string
|
|
1328
|
-
}
|
|
1327
|
+
app_area_id?: string;
|
|
1328
|
+
}) => Promise<CardsResponse>;
|
|
1329
1329
|
paginateFeedbackFormsForTenantById: (tenant_id: string, query?: {
|
|
1330
|
-
$select?: string
|
|
1331
|
-
$top?: number
|
|
1332
|
-
$skip?: number
|
|
1333
|
-
$orderby?: string
|
|
1334
|
-
$filter?: string
|
|
1335
|
-
$expand?: string
|
|
1336
|
-
$search?: string
|
|
1337
|
-
}
|
|
1338
|
-
createFeedbackFormForTenantById: (tenant_id: string, body?: CreateFeedbackFormRequestBody
|
|
1330
|
+
$select?: string;
|
|
1331
|
+
$top?: number;
|
|
1332
|
+
$skip?: number;
|
|
1333
|
+
$orderby?: string;
|
|
1334
|
+
$filter?: string;
|
|
1335
|
+
$expand?: string;
|
|
1336
|
+
$search?: string;
|
|
1337
|
+
}) => Promise<FeedbackFormCollectionResponse>;
|
|
1338
|
+
createFeedbackFormForTenantById: (tenant_id: string, body?: CreateFeedbackFormRequestBody) => Promise<FeedbackFormResponse>;
|
|
1339
1339
|
getFeedbackFormForTenantById: (tenant_id: string, feedback_form_id: string) => Promise<FeedbackFormResponse>;
|
|
1340
|
-
updateFeedbackFormForTenantById: (tenant_id: string, feedback_form_id: string, body?: UpdateFeedbackFormRequestBody
|
|
1340
|
+
updateFeedbackFormForTenantById: (tenant_id: string, feedback_form_id: string, body?: UpdateFeedbackFormRequestBody) => Promise<FeedbackFormResponse>;
|
|
1341
1341
|
deleteFeedbackFormForTenantById: (tenant_id: string, feedback_form_id: string) => Promise<Response>;
|
|
1342
1342
|
paginateFeedbackFormResponsesForTenantById: (tenant_id: string, feedback_form_id: string, query?: {
|
|
1343
|
-
$select?: string
|
|
1344
|
-
$top?: number
|
|
1345
|
-
$skip?: number
|
|
1346
|
-
$orderby?: string
|
|
1347
|
-
$filter?: string
|
|
1348
|
-
$expand?: string
|
|
1349
|
-
$search?: string
|
|
1350
|
-
}
|
|
1343
|
+
$select?: string;
|
|
1344
|
+
$top?: number;
|
|
1345
|
+
$skip?: number;
|
|
1346
|
+
$orderby?: string;
|
|
1347
|
+
$filter?: string;
|
|
1348
|
+
$expand?: string;
|
|
1349
|
+
$search?: string;
|
|
1350
|
+
}) => Promise<FeedbackFormSubmissionCollectionResponse>;
|
|
1351
1351
|
getFormById: (feedback_form_id: string) => Promise<FeedbackFormDataStub>;
|
|
1352
|
-
submitFormById: (feedback_form_id: string, body?: SubmitFeedbackFormResponseBody
|
|
1353
|
-
createQuestion: (body?: CreateQuestionRequestBody
|
|
1352
|
+
submitFormById: (feedback_form_id: string, body?: SubmitFeedbackFormResponseBody) => Promise<Response>;
|
|
1353
|
+
createQuestion: (body?: CreateQuestionRequestBody) => Promise<Question>;
|
|
1354
1354
|
paginateQuestions: (query?: {
|
|
1355
|
-
$select?: string
|
|
1356
|
-
$top?: number
|
|
1357
|
-
$skip?: number
|
|
1358
|
-
$orderby?: string
|
|
1359
|
-
$filter?: string
|
|
1360
|
-
$expand?: string
|
|
1361
|
-
$search?: string
|
|
1362
|
-
}
|
|
1355
|
+
$select?: string;
|
|
1356
|
+
$top?: number;
|
|
1357
|
+
$skip?: number;
|
|
1358
|
+
$orderby?: string;
|
|
1359
|
+
$filter?: string;
|
|
1360
|
+
$expand?: string;
|
|
1361
|
+
$search?: string;
|
|
1362
|
+
}) => Promise<QuestionCollectionResponse>;
|
|
1363
1363
|
getQuestionById: (question_id: string, query?: {
|
|
1364
|
-
campaign_id?: string
|
|
1365
|
-
}
|
|
1366
|
-
updateQuestionById: (question_id: string, body?: UpdateQuestionRequestBody
|
|
1364
|
+
campaign_id?: string;
|
|
1365
|
+
}) => Promise<Question>;
|
|
1366
|
+
updateQuestionById: (question_id: string, body?: UpdateQuestionRequestBody) => Promise<Question>;
|
|
1367
1367
|
deleteQuestionById: (question_id: string) => Promise<Response>;
|
|
1368
|
-
createMetricsForQuestionById: (question_id: string, body?: CreateQuestionMetricsRequestBody
|
|
1369
|
-
answerQuestionById: (question_id: string, body?: AnswerQuestionBody
|
|
1368
|
+
createMetricsForQuestionById: (question_id: string, body?: CreateQuestionMetricsRequestBody) => Promise<QuestionMetrics>;
|
|
1369
|
+
answerQuestionById: (question_id: string, body?: AnswerQuestionBody) => Promise<Response>;
|
|
1370
1370
|
paginateAnswersForQuestionById: (question_id: string, query?: {
|
|
1371
|
-
$select?: string
|
|
1372
|
-
$top?: number
|
|
1373
|
-
$skip?: number
|
|
1374
|
-
$orderby?: string
|
|
1375
|
-
$filter?: string
|
|
1376
|
-
$expand?: string
|
|
1377
|
-
$search?: string
|
|
1378
|
-
}
|
|
1379
|
-
bulkAnswerQuestions: (body?: BulkAnswerQuestionsBody
|
|
1371
|
+
$select?: string;
|
|
1372
|
+
$top?: number;
|
|
1373
|
+
$skip?: number;
|
|
1374
|
+
$orderby?: string;
|
|
1375
|
+
$filter?: string;
|
|
1376
|
+
$expand?: string;
|
|
1377
|
+
$search?: string;
|
|
1378
|
+
}) => Promise<AnswerCollectionResponse>;
|
|
1379
|
+
bulkAnswerQuestions: (body?: BulkAnswerQuestionsBody) => Promise<Response>;
|
|
1380
1380
|
paginateTemplateTags: (query?: {
|
|
1381
|
-
$select?: string
|
|
1382
|
-
$top?: number
|
|
1383
|
-
$skip?: number
|
|
1384
|
-
$orderby?: string
|
|
1385
|
-
$filter?: string
|
|
1386
|
-
$expand?: string
|
|
1387
|
-
$search?: string
|
|
1388
|
-
}
|
|
1381
|
+
$select?: string;
|
|
1382
|
+
$top?: number;
|
|
1383
|
+
$skip?: number;
|
|
1384
|
+
$orderby?: string;
|
|
1385
|
+
$filter?: string;
|
|
1386
|
+
$expand?: string;
|
|
1387
|
+
$search?: string;
|
|
1388
|
+
}) => Promise<TemplateTagCollectionResponse>;
|
|
1389
1389
|
paginateTemplatesForTenantById: (tenant_id: string, query?: {
|
|
1390
|
-
$select?: string
|
|
1391
|
-
$top?: number
|
|
1392
|
-
$skip?: number
|
|
1393
|
-
$orderby?: string
|
|
1394
|
-
$filter?: string
|
|
1395
|
-
$expand?: string
|
|
1396
|
-
$search?: string
|
|
1397
|
-
}
|
|
1398
|
-
createApplicationForTenantById: (tenant_id: string, body?: CreateApplicationRequestBody
|
|
1390
|
+
$select?: string;
|
|
1391
|
+
$top?: number;
|
|
1392
|
+
$skip?: number;
|
|
1393
|
+
$orderby?: string;
|
|
1394
|
+
$filter?: string;
|
|
1395
|
+
$expand?: string;
|
|
1396
|
+
$search?: string;
|
|
1397
|
+
}) => Promise<TemplateCollectionResponse>;
|
|
1398
|
+
createApplicationForTenantById: (tenant_id: string, body?: CreateApplicationRequestBody) => Promise<Application>;
|
|
1399
1399
|
paginateApplicationsForTenantById: (tenant_id: string) => Promise<ApplicationCollectionResponse>;
|
|
1400
1400
|
getApplicationByIdForTenantById: (tenant_id: string, application_id: string, query?: {
|
|
1401
|
-
include?: string
|
|
1402
|
-
}
|
|
1403
|
-
updateApplicationByIdForTenantById: (tenant_id: string, application_id: string, body?: UpdateApplicationRequestBody
|
|
1401
|
+
include?: string;
|
|
1402
|
+
}) => Promise<Application>;
|
|
1403
|
+
updateApplicationByIdForTenantById: (tenant_id: string, application_id: string, body?: UpdateApplicationRequestBody) => Promise<Application>;
|
|
1404
1404
|
deleteApplicationByIdForTenantById: (tenant_id: string, application_id: string) => Promise<Response>;
|
|
1405
|
-
updateApnsConfigurationForTenantApplication: (tenant_id: string, application_id: string, body?: UpdateApnsConfigurationRequestBody
|
|
1405
|
+
updateApnsConfigurationForTenantApplication: (tenant_id: string, application_id: string, body?: UpdateApnsConfigurationRequestBody) => Promise<ApnsConfiguration>;
|
|
1406
1406
|
getInboxItemsForTenantUser: (tenant_id: string, query?: {
|
|
1407
|
-
limit?: number
|
|
1408
|
-
offset?: number
|
|
1409
|
-
segment?: string
|
|
1410
|
-
archived?: boolean
|
|
1411
|
-
}
|
|
1412
|
-
readInboxItemsForTenantUser: (tenant_id: string, body?: ReadInboxItemsRequestBody
|
|
1413
|
-
createNotificationTemplate: (tenant_id: string, body?: CreateNotificationTemplateRequestBody
|
|
1407
|
+
limit?: number;
|
|
1408
|
+
offset?: number;
|
|
1409
|
+
segment?: string;
|
|
1410
|
+
archived?: boolean;
|
|
1411
|
+
}) => Promise<InboxItemCollectionResponse>;
|
|
1412
|
+
readInboxItemsForTenantUser: (tenant_id: string, body?: ReadInboxItemsRequestBody) => Promise<Response>;
|
|
1413
|
+
createNotificationTemplate: (tenant_id: string, body?: CreateNotificationTemplateRequestBody) => Promise<NotificationTemplate>;
|
|
1414
1414
|
paginateNotificationTemplatesForTenantById: (tenant_id: string, query?: {
|
|
1415
|
-
$select?: string
|
|
1416
|
-
$top?: number
|
|
1417
|
-
$skip?: number
|
|
1418
|
-
$orderby?: string
|
|
1419
|
-
$filter?: string
|
|
1420
|
-
$expand?: string
|
|
1421
|
-
$search?: string
|
|
1422
|
-
}
|
|
1415
|
+
$select?: string;
|
|
1416
|
+
$top?: number;
|
|
1417
|
+
$skip?: number;
|
|
1418
|
+
$orderby?: string;
|
|
1419
|
+
$filter?: string;
|
|
1420
|
+
$expand?: string;
|
|
1421
|
+
$search?: string;
|
|
1422
|
+
}) => Promise<NotificationTemplateCollectionResponse>;
|
|
1423
1423
|
getNotificationTemplateById: (tenant_id: string, notification_template_id: string, query?: {
|
|
1424
|
-
include?: string
|
|
1425
|
-
}
|
|
1426
|
-
updateNotificationTemplateById: (tenant_id: string, notification_template_id: string, body?: UpdateNotificationTemplateRequestBody
|
|
1424
|
+
include?: string;
|
|
1425
|
+
}) => Promise<NotificationTemplate>;
|
|
1426
|
+
updateNotificationTemplateById: (tenant_id: string, notification_template_id: string, body?: UpdateNotificationTemplateRequestBody) => Promise<NotificationTemplate>;
|
|
1427
1427
|
deleteNotificationTemplateById: (tenant_id: string, notification_template_id: string) => Promise<Response>;
|
|
1428
|
-
createChannelForNotificationTemplate: (tenant_id: string, notification_template_id: string, body?: CreateChannelRequestBody
|
|
1429
|
-
updateChannelForNotificationTemplate: (tenant_id: string, notification_template_id: string, channel_id: string, body?: UpdateChannelRequestBody
|
|
1428
|
+
createChannelForNotificationTemplate: (tenant_id: string, notification_template_id: string, body?: CreateChannelRequestBody) => Promise<Channel>;
|
|
1429
|
+
updateChannelForNotificationTemplate: (tenant_id: string, notification_template_id: string, channel_id: string, body?: UpdateChannelRequestBody) => Promise<Channel>;
|
|
1430
1430
|
deleteChannelForNotificationTemplate: (tenant_id: string, notification_template_id: string, channel_id: string) => Promise<Response>;
|
|
1431
1431
|
createUser: (body: CreateUserRequestBody) => Promise<UserResponse>;
|
|
1432
1432
|
listUsers: (query?: {
|
|
1433
|
-
$select?: string
|
|
1434
|
-
$top?: number
|
|
1435
|
-
$skip?: number
|
|
1436
|
-
$orderby?: string
|
|
1437
|
-
$filter?: string
|
|
1438
|
-
$expand?: string
|
|
1439
|
-
$search?: string
|
|
1440
|
-
}
|
|
1433
|
+
$select?: string;
|
|
1434
|
+
$top?: number;
|
|
1435
|
+
$skip?: number;
|
|
1436
|
+
$orderby?: string;
|
|
1437
|
+
$filter?: string;
|
|
1438
|
+
$expand?: string;
|
|
1439
|
+
$search?: string;
|
|
1440
|
+
}) => Promise<UserCollectionResponse>;
|
|
1441
1441
|
getUserById: (user_id: string) => Promise<UserResponse>;
|
|
1442
1442
|
updateUserById: (user_id: string, body: UpdateUserRequestBody) => Promise<UserResponse>;
|
|
1443
1443
|
deleteUserById: (user_id: string) => Promise<Response>;
|
|
1444
1444
|
createIdentityForUserById: (user_id: string, body: CreateIdentityRequestBody) => Promise<IdentityResponse>;
|
|
1445
1445
|
listIdentitiesForUserById: (user_id: string) => Promise<Array<IdentityResponse>>;
|
|
1446
1446
|
getUserByProviderAndProviderUserId: (provider: string, provider_user_id: string) => Promise<UserResponse>;
|
|
1447
|
-
checkAuthorization: (body?: CheckAuthorizationRequestBody
|
|
1447
|
+
checkAuthorization: (body?: CheckAuthorizationRequestBody) => Promise<CheckAuthorization>;
|
|
1448
1448
|
getUserInfo: () => Promise<UserInfoResponse>;
|
|
1449
1449
|
getParraAuthToken: () => Promise<AuthToken>;
|
|
1450
1450
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { default as ParraAPI } from './ParraAPI';
|
|
|
3
3
|
export { HTTPRequestBody, HTTPUrlComponent, HTTPResponse, HTTPHeaders, HTTPQuery, HTTPMethod, HTTPLogger, HTTPOptions, HTTPRequest, HTTPRequestWithoutMethod, HTTPClient, HTTPInterceptor, Authorization, AuthFunctionProvider, AuthPromiseProvider, AuthorizationProvider, AuthInterceptor } from '@parra/http-client';
|
|
4
4
|
export * from './ParraAPI';
|
|
5
5
|
export { ParraAPI };
|
|
6
|
-
export
|
|
6
|
+
export type ParraAPIType = typeof ParraAPI;
|
|
7
7
|
export interface ParraAPIOptions {
|
|
8
8
|
authorization: AuthorizationProvider;
|
|
9
9
|
baseUrl?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parra/parra-js-sdk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"author": "Parra",
|
|
19
19
|
"license": "ISC",
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"prettier": "^
|
|
22
|
-
"typescript": "^
|
|
21
|
+
"prettier": "^3.0.3",
|
|
22
|
+
"typescript": "^5.2.2"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@parra/http-client": "0.5.
|
|
25
|
+
"@parra/http-client": "0.5.4"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/dist/AccessToken.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/AccessToken.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var assert_1 = __importDefault(require("assert"));
|
|
7
|
-
var jwt = require('jsonwebtoken');
|
|
8
|
-
var AccessToken = /** @class */ (function () {
|
|
9
|
-
/**
|
|
10
|
-
* @constructor
|
|
11
|
-
* @param {string} tenantId - The account's unique ID to which access is scoped
|
|
12
|
-
* @param {string} apiKeyId - The signing key's unique ID
|
|
13
|
-
* @param {string} apiKeySecret - The apiKeySecret to sign the token with
|
|
14
|
-
* @param {object} options - ...
|
|
15
|
-
* @param {number} [options.ttl=3600] - Time to live in seconds
|
|
16
|
-
* @param {string} [options.identity] - The identity of the first person
|
|
17
|
-
*/
|
|
18
|
-
function AccessToken(options) {
|
|
19
|
-
assert_1.default(options.tenantId, 'tenantId is required');
|
|
20
|
-
assert_1.default(options.apiKeyId, 'apiKeyId is required');
|
|
21
|
-
assert_1.default(options.apiKeySecret, 'apiKeySecret is required');
|
|
22
|
-
this.tenantId = options.tenantId;
|
|
23
|
-
this.apiKeyId = options.apiKeyId;
|
|
24
|
-
this.apiKeySecret = options.apiKeySecret;
|
|
25
|
-
this.ttl = options.ttl || 3600;
|
|
26
|
-
this.identity = String(options.identity);
|
|
27
|
-
this.nbf = options.nbf;
|
|
28
|
-
this.grants = [];
|
|
29
|
-
}
|
|
30
|
-
AccessToken.prototype.addGrant = function (grant) {
|
|
31
|
-
this.grants.push(grant);
|
|
32
|
-
};
|
|
33
|
-
AccessToken.prototype.toJwt = function (algorithm) {
|
|
34
|
-
algorithm = algorithm || AccessToken.DEFAULT_ALGORITHM;
|
|
35
|
-
if (!AccessToken.ALGORITHMS.includes(algorithm)) {
|
|
36
|
-
throw new Error('Algorithm not supported. Allowed values are ' + AccessToken.ALGORITHMS.join(', '));
|
|
37
|
-
}
|
|
38
|
-
var grants = this.grants.reduce(function (acc, grant) {
|
|
39
|
-
acc[grant.key] = grant.toPayload();
|
|
40
|
-
}, { identity: this.identity });
|
|
41
|
-
var now = Math.floor(Date.now() / 1000);
|
|
42
|
-
var payload = {
|
|
43
|
-
jti: this.apiKeyId + '-' + now,
|
|
44
|
-
grants: grants,
|
|
45
|
-
nbf: this.nbf,
|
|
46
|
-
};
|
|
47
|
-
var header = {
|
|
48
|
-
cty: 'parra-fpa;v=1',
|
|
49
|
-
typ: 'JWT',
|
|
50
|
-
};
|
|
51
|
-
return jwt.sign(payload, this.apiKeySecret, {
|
|
52
|
-
header: header,
|
|
53
|
-
algorithm: algorithm,
|
|
54
|
-
issuer: this.apiKeyId,
|
|
55
|
-
subject: this.tenantId,
|
|
56
|
-
expiresIn: this.ttl,
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
AccessToken.DEFAULT_ALGORITHM = 'HS256';
|
|
60
|
-
AccessToken.ALGORITHMS = ['HS256', 'HS384', 'HS512'];
|
|
61
|
-
return AccessToken;
|
|
62
|
-
}());
|
|
63
|
-
module.exports = AccessToken;
|