@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.
@@ -144,7 +144,7 @@ export interface CreateAuthTokenRequestBody {
144
144
  }
145
145
  export interface Entitlement {
146
146
  }
147
- export declare type UpdateEntitlementsRequestBody = Array<Entitlement>;
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 declare type TenantListResponse = Array<Tenant>;
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 declare type TenantInvitationListResponse = Array<TenantInvitation>;
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 declare type TeamMemberListResponse = Array<TeamMember>;
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 declare type AnalyticEventTypeListResponse = Array<AnalyticEventType>;
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 declare type AppAreaListResponse = Array<AppArea>;
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 declare type CampaignListResponse = Array<Campaign>;
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 declare type UpdateCampaignTriggerList = Array<UpdateCampaignTriggerRequestBody>;
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 declare type CampaignTriggerList = Array<CampaignTrigger>;
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 declare type UpdateCampaignActionList = Array<UpdateCampaignActionRequestBody>;
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 declare type CampaignActionList = Array<CampaignAction>;
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 declare type FeedbackFormFieldData = FeedbackFormTextFieldData | FeedbackFormSelectFieldData | FeedbackFormInputFieldData;
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 declare type BulkAnswerQuestionsBody = Array<BulkAnswerQuestionBody>;
594
- export declare type CardItemData = Question;
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 declare type MutableQuestionData = MutableChoiceQuestionBody | MutableCheckboxQuestionBody | MutableImageQuestionBody | MutableRatingQuestionBody | MutableStarQuestionBody | MutableShortTextQuestionBody | MutableLongTextQuestionBody | MutableBooleanQuestionBody;
757
- export declare type QuestionData = ChoiceQuestionBody | CheckboxQuestionBody | ImageQuestionBody | RatingQuestionBody | StarQuestionBody | ShortTextQuestionBody | LongTextQuestionBody | BooleanQuestionBody;
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 declare type QuestionMetricsData = ChoiceQuestionMetricsBody | CheckboxQuestionMetricsBody | InageQuestionMetricsBody | RatingQuestionMetricsBody | StarQuestionMetricsBody | LongTextQuestionMetricsBody | ShortTextQuestionMetricsBody | BooleanQuestionMetricsBody;
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 declare type TemplateResponse = Array<Template>;
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 declare type ApplicationListResponse = Array<Application>;
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 declare type NotificationTemplateListResponse = Array<NotificationTemplate>;
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 | undefined) => Promise<ImageAsset>;
1255
- createCustomer: (body?: CreateCustomerRequestBody | undefined) => Promise<Customer>;
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 | undefined) => Promise<CheckoutSession>;
1258
+ createCheckoutSession: (body?: CreateCheckoutSessionRequestBody) => Promise<CheckoutSession>;
1259
1259
  getPlansForTenantById: (tenant_id: string) => Promise<TenantPlansResponse>;
1260
- createAudience: (body?: CreateAudienceRequestBody | undefined) => Promise<Audience>;
1261
- createSubscriberForAudienceById: (audience_id: string, body?: CreateSubscriberRequestBody | undefined) => Promise<Response>;
1262
- createTenant: (body?: CreateTenantRequestBody | undefined) => Promise<Tenant>;
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 | undefined;
1265
- } | undefined) => Promise<Tenant>;
1266
- updateTenantById: (tenant_id: string, body?: UpdateTenantRequestBody | undefined) => Promise<Tenant>;
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 | undefined;
1270
- $top?: number | undefined;
1271
- $skip?: number | undefined;
1272
- $orderby?: string | undefined;
1273
- $filter?: string | undefined;
1274
- $expand?: string | undefined;
1275
- $search?: string | undefined;
1276
- } | undefined) => Promise<TenantUserCollectionResponse>;
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 | undefined) => Promise<Tenant>;
1278
+ createTenantForUserById: (user_id: string, body?: CreateTenantForUserRequestBody) => Promise<Tenant>;
1279
1279
  getTenantsForUserById: (user_id: string) => Promise<TenantListResponse>;
1280
- createApiKeyForTenantById: (tenant_id: string, body?: CreateApiKeyRequestBody | undefined) => Promise<ApiKeyWithSecretResponse>;
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 | undefined) => Promise<TenantInvitation>;
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 | undefined) => Promise<AnalyticEventType>;
1290
+ createAnalyticEventTypeForTenantById: (tenant_id: string, body?: CreateAnalyticEventTypeRequestBody) => Promise<AnalyticEventType>;
1291
1291
  paginateAnalyticEventTypesForTenantById: (tenant_id: string, query?: {
1292
- $select?: string | undefined;
1293
- $top?: number | undefined;
1294
- $skip?: number | undefined;
1295
- $orderby?: string | undefined;
1296
- $filter?: string | undefined;
1297
- $expand?: string | undefined;
1298
- $search?: string | undefined;
1299
- } | undefined) => Promise<AnalyticEventTypeCollectionResponse>;
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 | undefined) => Promise<AnalyticEventType>;
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 | undefined) => Promise<AppArea>;
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 | undefined) => Promise<AppArea>;
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 | undefined) => Promise<Campaign>;
1308
+ createCampaign: (tenant_id: string, body?: CreateCampaignRequestBody) => Promise<Campaign>;
1309
1309
  paginateCampaignsForTenantById: (tenant_id: string, query?: {
1310
- $select?: string | undefined;
1311
- $top?: number | undefined;
1312
- $skip?: number | undefined;
1313
- $orderby?: string | undefined;
1314
- $filter?: string | undefined;
1315
- $expand?: string | undefined;
1316
- $search?: string | undefined;
1317
- } | undefined) => Promise<CampaignCollectionResponse>;
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 | undefined;
1320
- } | undefined) => Promise<Campaign>;
1321
- updateCampaignById: (tenant_id: string, campaign_id: string, body?: UpdateCampaignRequestBody | undefined) => Promise<Campaign>;
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 | undefined) => Promise<Campaign>;
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 | undefined;
1328
- } | undefined) => Promise<CardsResponse>;
1327
+ app_area_id?: string;
1328
+ }) => Promise<CardsResponse>;
1329
1329
  paginateFeedbackFormsForTenantById: (tenant_id: string, query?: {
1330
- $select?: string | undefined;
1331
- $top?: number | undefined;
1332
- $skip?: number | undefined;
1333
- $orderby?: string | undefined;
1334
- $filter?: string | undefined;
1335
- $expand?: string | undefined;
1336
- $search?: string | undefined;
1337
- } | undefined) => Promise<FeedbackFormCollectionResponse>;
1338
- createFeedbackFormForTenantById: (tenant_id: string, body?: CreateFeedbackFormRequestBody | undefined) => Promise<FeedbackFormResponse>;
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 | undefined) => Promise<FeedbackFormResponse>;
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 | undefined;
1344
- $top?: number | undefined;
1345
- $skip?: number | undefined;
1346
- $orderby?: string | undefined;
1347
- $filter?: string | undefined;
1348
- $expand?: string | undefined;
1349
- $search?: string | undefined;
1350
- } | undefined) => Promise<FeedbackFormSubmissionCollectionResponse>;
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 | undefined) => Promise<Response>;
1353
- createQuestion: (body?: CreateQuestionRequestBody | undefined) => Promise<Question>;
1352
+ submitFormById: (feedback_form_id: string, body?: SubmitFeedbackFormResponseBody) => Promise<Response>;
1353
+ createQuestion: (body?: CreateQuestionRequestBody) => Promise<Question>;
1354
1354
  paginateQuestions: (query?: {
1355
- $select?: string | undefined;
1356
- $top?: number | undefined;
1357
- $skip?: number | undefined;
1358
- $orderby?: string | undefined;
1359
- $filter?: string | undefined;
1360
- $expand?: string | undefined;
1361
- $search?: string | undefined;
1362
- } | undefined) => Promise<QuestionCollectionResponse>;
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 | undefined;
1365
- } | undefined) => Promise<Question>;
1366
- updateQuestionById: (question_id: string, body?: UpdateQuestionRequestBody | undefined) => Promise<Question>;
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 | undefined) => Promise<QuestionMetrics>;
1369
- answerQuestionById: (question_id: string, body?: AnswerQuestionBody | undefined) => Promise<Response>;
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 | undefined;
1372
- $top?: number | undefined;
1373
- $skip?: number | undefined;
1374
- $orderby?: string | undefined;
1375
- $filter?: string | undefined;
1376
- $expand?: string | undefined;
1377
- $search?: string | undefined;
1378
- } | undefined) => Promise<AnswerCollectionResponse>;
1379
- bulkAnswerQuestions: (body?: BulkAnswerQuestionsBody | undefined) => Promise<Response>;
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 | undefined;
1382
- $top?: number | undefined;
1383
- $skip?: number | undefined;
1384
- $orderby?: string | undefined;
1385
- $filter?: string | undefined;
1386
- $expand?: string | undefined;
1387
- $search?: string | undefined;
1388
- } | undefined) => Promise<TemplateTagCollectionResponse>;
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 | undefined;
1391
- $top?: number | undefined;
1392
- $skip?: number | undefined;
1393
- $orderby?: string | undefined;
1394
- $filter?: string | undefined;
1395
- $expand?: string | undefined;
1396
- $search?: string | undefined;
1397
- } | undefined) => Promise<TemplateCollectionResponse>;
1398
- createApplicationForTenantById: (tenant_id: string, body?: CreateApplicationRequestBody | undefined) => Promise<Application>;
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 | undefined;
1402
- } | undefined) => Promise<Application>;
1403
- updateApplicationByIdForTenantById: (tenant_id: string, application_id: string, body?: UpdateApplicationRequestBody | undefined) => Promise<Application>;
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 | undefined) => Promise<ApnsConfiguration>;
1405
+ updateApnsConfigurationForTenantApplication: (tenant_id: string, application_id: string, body?: UpdateApnsConfigurationRequestBody) => Promise<ApnsConfiguration>;
1406
1406
  getInboxItemsForTenantUser: (tenant_id: string, query?: {
1407
- limit?: number | undefined;
1408
- offset?: number | undefined;
1409
- segment?: string | undefined;
1410
- archived?: boolean | undefined;
1411
- } | undefined) => Promise<InboxItemCollectionResponse>;
1412
- readInboxItemsForTenantUser: (tenant_id: string, body?: ReadInboxItemsRequestBody | undefined) => Promise<Response>;
1413
- createNotificationTemplate: (tenant_id: string, body?: CreateNotificationTemplateRequestBody | undefined) => Promise<NotificationTemplate>;
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 | undefined;
1416
- $top?: number | undefined;
1417
- $skip?: number | undefined;
1418
- $orderby?: string | undefined;
1419
- $filter?: string | undefined;
1420
- $expand?: string | undefined;
1421
- $search?: string | undefined;
1422
- } | undefined) => Promise<NotificationTemplateCollectionResponse>;
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 | undefined;
1425
- } | undefined) => Promise<NotificationTemplate>;
1426
- updateNotificationTemplateById: (tenant_id: string, notification_template_id: string, body?: UpdateNotificationTemplateRequestBody | undefined) => Promise<NotificationTemplate>;
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 | undefined) => Promise<Channel>;
1429
- updateChannelForNotificationTemplate: (tenant_id: string, notification_template_id: string, channel_id: string, body?: UpdateChannelRequestBody | undefined) => Promise<Channel>;
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 | undefined;
1434
- $top?: number | undefined;
1435
- $skip?: number | undefined;
1436
- $orderby?: string | undefined;
1437
- $filter?: string | undefined;
1438
- $expand?: string | undefined;
1439
- $search?: string | undefined;
1440
- } | undefined) => Promise<UserCollectionResponse>;
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 | undefined) => Promise<CheckAuthorization>;
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 declare type ParraAPIType = typeof ParraAPI;
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.1",
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": "^2.6.2",
22
- "typescript": "^4.6.4"
21
+ "prettier": "^3.0.3",
22
+ "typescript": "^5.2.2"
23
23
  },
24
24
  "dependencies": {
25
- "@parra/http-client": "0.5.1"
25
+ "@parra/http-client": "0.5.4"
26
26
  }
27
27
  }
@@ -1 +0,0 @@
1
- export {};
@@ -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;