@parra/parra-js-sdk 0.3.486 → 0.3.488

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.
@@ -1395,6 +1395,131 @@ export interface Reaction {
1395
1395
  user_id: string;
1396
1396
  user: TenantUserNameStub;
1397
1397
  }
1398
+ export interface UpdateCourseRequestBody {
1399
+ title?: string;
1400
+ description?: string | null;
1401
+ }
1402
+ export interface CreateCourseRequestBody {
1403
+ title?: string;
1404
+ description?: string | null;
1405
+ }
1406
+ export declare enum LessonType {
1407
+ youtubeVideo = "youtube_video"
1408
+ }
1409
+ export interface LessonYoutubeVideoContent {
1410
+ youtube_video_id?: string | null;
1411
+ duration: number;
1412
+ }
1413
+ export type LessonContent = LessonYoutubeVideoContent;
1414
+ export interface LessonSection {
1415
+ id: string;
1416
+ created_at: string;
1417
+ updated_at: string;
1418
+ deleted_at?: string | null;
1419
+ title: string;
1420
+ description?: string | null;
1421
+ start_time: number;
1422
+ end_time?: number | null;
1423
+ }
1424
+ export interface Lesson {
1425
+ id: string;
1426
+ created_at: string;
1427
+ updated_at: string;
1428
+ deleted_at?: string | null;
1429
+ tenant_id: string;
1430
+ type: LessonType;
1431
+ title: string;
1432
+ description?: string | null;
1433
+ sort_order: number;
1434
+ is_preview: boolean;
1435
+ content?: LessonContent | null;
1436
+ sections?: Array<LessonSection>;
1437
+ }
1438
+ export interface CourseModule {
1439
+ id: string;
1440
+ created_at: string;
1441
+ updated_at: string;
1442
+ deleted_at?: string | null;
1443
+ title: string;
1444
+ description?: string | null;
1445
+ sort_order: number;
1446
+ is_preview: boolean;
1447
+ lessons?: Array<Lesson>;
1448
+ }
1449
+ export interface CourseStub {
1450
+ id: string;
1451
+ created_at: string;
1452
+ updated_at: string;
1453
+ deleted_at?: string | null;
1454
+ tenant_id: string;
1455
+ title: string;
1456
+ description?: string | null;
1457
+ }
1458
+ export interface Course {
1459
+ id: string;
1460
+ created_at: string;
1461
+ updated_at: string;
1462
+ deleted_at?: string | null;
1463
+ tenant_id: string;
1464
+ title: string;
1465
+ description?: string | null;
1466
+ modules?: Array<CourseModule>;
1467
+ }
1468
+ export interface AppLessonProgress {
1469
+ complete: boolean;
1470
+ progress?: number;
1471
+ }
1472
+ export interface AppLessonSection {
1473
+ id: string;
1474
+ title: string;
1475
+ description?: string | null;
1476
+ start_time: number;
1477
+ end_time?: number | null;
1478
+ }
1479
+ export interface AppLesson {
1480
+ id: string;
1481
+ created_at: string;
1482
+ updated_at: string;
1483
+ deleted_at?: string | null;
1484
+ tenant_id: string;
1485
+ type: LessonType;
1486
+ title: string;
1487
+ description?: string | null;
1488
+ is_preview: boolean;
1489
+ content?: LessonContent;
1490
+ progress?: AppLessonProgress | null;
1491
+ sections?: Array<AppLessonSection>;
1492
+ }
1493
+ export interface AppCourseModule {
1494
+ id: string;
1495
+ created_at: string;
1496
+ updated_at: string;
1497
+ deleted_at?: string | null;
1498
+ title: string;
1499
+ description?: string | null;
1500
+ is_preview: boolean;
1501
+ lessons?: Array<AppLesson>;
1502
+ }
1503
+ export interface AppCourse {
1504
+ id: string;
1505
+ created_at: string;
1506
+ updated_at: string;
1507
+ deleted_at?: string | null;
1508
+ tenant_id: string;
1509
+ title: string;
1510
+ description?: string | null;
1511
+ modules?: Array<AppCourseModule>;
1512
+ }
1513
+ export interface UpdateCourseModuleRequestBody {
1514
+ title?: string;
1515
+ description?: string | null;
1516
+ sort_order?: number;
1517
+ is_preview?: boolean;
1518
+ }
1519
+ export interface ReportLessonProgressRequestBody {
1520
+ complete?: boolean;
1521
+ progress?: number;
1522
+ }
1398
1523
  export interface AppFaq {
1399
1524
  id: string;
1400
1525
  created_at: string;
@@ -3743,6 +3868,10 @@ export interface WebauthnAuthenticateResponseBody {
3743
3868
  message: string;
3744
3869
  token: string;
3745
3870
  }
3871
+ export declare enum ClientType {
3872
+ native = "native",
3873
+ web = "web"
3874
+ }
3746
3875
  export declare enum GrantType {
3747
3876
  authorizationCode = "authorization_code",
3748
3877
  clientCredentials = "client_credentials",
@@ -3792,7 +3921,7 @@ export interface Client {
3792
3921
  created_at: string;
3793
3922
  updated_at: string;
3794
3923
  deleted_at?: string | null;
3795
- type: string;
3924
+ type: ClientType;
3796
3925
  is_first_party: boolean;
3797
3926
  client_id: string;
3798
3927
  client_secret: string;
@@ -4064,7 +4193,9 @@ export declare enum ConnectedAppType {
4064
4193
  youtube = "youtube",
4065
4194
  tiktok = "tiktok",
4066
4195
  instagram = "instagram",
4067
- facebook = "facebook"
4196
+ facebook = "facebook",
4197
+ twitch = "twitch",
4198
+ linkedin = "linkedin"
4068
4199
  }
4069
4200
  export declare enum ConnectedAppConnectionStatus {
4070
4201
  pending = "pending",
@@ -4982,6 +5113,23 @@ declare class ParraAPI {
4982
5113
  flagChatMessage: (tenant_id: string, message_id: string, body?: FlagMessageRequestBody, options?: Options) => Promise<Response>;
4983
5114
  addReactionToChatMessage: (tenant_id: string, message_id: string, body: CreateReactionRequestBody, options?: Options) => Promise<Reaction>;
4984
5115
  removeReactionFromChatMessage: (tenant_id: string, message_id: string, reaction_id: string, options?: Options) => Promise<Response>;
5116
+ createCourse: (tenant_id: string, body: CreateCourseRequestBody, options?: Options) => Promise<Course>;
5117
+ listCourses: (tenant_id: string, options?: Options) => Promise<Array<Course>>;
5118
+ getCourseById: (tenant_id: string, course_id: string, options?: Options) => Promise<Course>;
5119
+ updateCourseById: (tenant_id: string, course_id: string, body?: UpdateCourseRequestBody, options?: Options) => Promise<Course>;
5120
+ deleteCourseById: (tenant_id: string, course_id: string, options?: Options) => Promise<Response>;
5121
+ getAppCourseById: (tenant_id: string, application_id: string, course_id: string, options?: Options) => Promise<AppCourse>;
5122
+ enrollInCourse: (tenant_id: string, course_id: string, options?: Options) => Promise<Course>;
5123
+ createModuleForCourse: (tenant_id: string, course_id: string, body: CreateCourseRequestBody, options?: Options) => Promise<CourseModule>;
5124
+ updateModuleForCourseById: (tenant_id: string, course_id: string, course_module_id: string, body?: UpdateCourseModuleRequestBody, options?: Options) => Promise<CourseModule>;
5125
+ deleteModuleForCourseById: (tenant_id: string, course_id: string, course_module_id: string, options?: Options) => Promise<Response>;
5126
+ createLessonForModule: (tenant_id: string, course_id: string, course_module_id: string, body: CreateCourseRequestBody, options?: Options) => Promise<CourseModule>;
5127
+ updateLessonForCourseById: (tenant_id: string, course_id: string, lesson_id: string, body?: UpdateCourseModuleRequestBody, options?: Options) => Promise<CourseModule>;
5128
+ deleteLessonForCourseById: (tenant_id: string, course_id: string, lesson_id: string, options?: Options) => Promise<Response>;
5129
+ createSectionForLesson: (tenant_id: string, course_id: string, lesson_id: string, body?: UpdateCourseModuleRequestBody, options?: Options) => Promise<CourseModule>;
5130
+ updateSectionForLesson: (tenant_id: string, course_id: string, lesson_id: string, lesson_section_id: string, body?: UpdateCourseModuleRequestBody, options?: Options) => Promise<CourseModule>;
5131
+ deleteSectionForLesson: (tenant_id: string, course_id: string, lesson_id: string, lesson_section_id: string, options?: Options) => Promise<Response>;
5132
+ reportCourseLessonProgress: (tenant_id: string, lesson_id: string, body?: ReportLessonProgressRequestBody, options?: Options) => Promise<Response>;
4985
5133
  listAppFaqs: (tenant_id: string, application_id: string, query?: {
4986
5134
  app_area_id?: string | null;
4987
5135
  }, options?: Options) => Promise<AppFaqView>;
package/dist/ParraAPI.js CHANGED
@@ -11,8 +11,8 @@ var __assign = (this && this.__assign) || function () {
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.BoardType = exports.TemplateType = exports.CampaignStatus = exports.CampaignActionDisplayType = exports.CampaignActionType = exports.CardItemDisplayType = exports.CardItemType = exports.QuestionKind = exports.QuestionType = exports.SubmitCommentReviewStatus = exports.CommentReviewStatus = exports.ReactionType = exports.FeedItemType = exports.SocialAccountType = exports.CreatorUpdateGiveawayCriteria = exports.CreatorUpdateChannelType = exports.CreatorUpdateStatus = exports.CreatorUpdateVisibilityType = exports.CreatorUpdateTopic = exports.AttachmentType = exports.ChannelMemberRole = exports.ChannelMemberType = exports.ChatChannelStatus = exports.ChatChannelType = exports.BillingSourceType = exports.ApplePurchaseType = exports.ApplePurchaseEnvironment = exports.PurchaseEnvironment = exports.PurchasePlatform = exports.PurchaseType = exports.PaywallIapType = exports.AppPaywallType = exports.ShareAssetType = exports.SubscriptionStatus = exports.Interval = exports.Currency = exports.FeedbackFormFieldType = exports.ContentCardActionType = exports.IdentityType = exports.PolicyDocumentType = exports.AppleSsoScope = exports.DomainStatus = exports.DomainType = exports.ApplicationType = exports.ReleaseType = exports.ReleaseStatus = exports.TicketIconType = exports.TicketPriority = exports.TicketStatus = exports.TicketType = void 0;
15
- exports.PolicyDocumentVersionStatus = exports.PolicyDocumentStatus = exports.MailTemplateStatus = exports.MailTemplateVersionStatus = exports.MailTemplateType = exports.TenantUserMetricType = exports.IntegrationScope = exports.IntegrationConnectionStatus = exports.IntegrationType = exports.ConnectedAppConnectionStatus = exports.ConnectedAppType = exports.TenantOnboardingGoal = exports.DashboardChecklistItemStatus = exports.DashboardChecklistItemType = exports.RefreshTokenRotationType = exports.RefreshTokenExpirationType = exports.JwtAlgorithm = exports.GrantType = exports.PasswordlessStrategy = exports.SsoProvider = exports.SettingsItemType = exports.ApnsPushType = exports.ApnsEnvironment = exports.ChannelType = exports.AppVersionStatus = exports.TicketDisplayStatus = exports.UserNoteStatus = exports.TicketLinkType = void 0;
14
+ exports.TemplateType = exports.CampaignStatus = exports.CampaignActionDisplayType = exports.CampaignActionType = exports.CardItemDisplayType = exports.CardItemType = exports.QuestionKind = exports.QuestionType = exports.SubmitCommentReviewStatus = exports.CommentReviewStatus = exports.ReactionType = exports.FeedItemType = exports.SocialAccountType = exports.CreatorUpdateGiveawayCriteria = exports.CreatorUpdateChannelType = exports.CreatorUpdateStatus = exports.CreatorUpdateVisibilityType = exports.CreatorUpdateTopic = exports.LessonType = exports.AttachmentType = exports.ChannelMemberRole = exports.ChannelMemberType = exports.ChatChannelStatus = exports.ChatChannelType = exports.BillingSourceType = exports.ApplePurchaseType = exports.ApplePurchaseEnvironment = exports.PurchaseEnvironment = exports.PurchasePlatform = exports.PurchaseType = exports.PaywallIapType = exports.AppPaywallType = exports.ShareAssetType = exports.SubscriptionStatus = exports.Interval = exports.Currency = exports.FeedbackFormFieldType = exports.ContentCardActionType = exports.IdentityType = exports.PolicyDocumentType = exports.AppleSsoScope = exports.DomainStatus = exports.DomainType = exports.ApplicationType = exports.ReleaseType = exports.ReleaseStatus = exports.TicketIconType = exports.TicketPriority = exports.TicketStatus = exports.TicketType = void 0;
15
+ exports.PolicyDocumentVersionStatus = exports.PolicyDocumentStatus = exports.MailTemplateStatus = exports.MailTemplateVersionStatus = exports.MailTemplateType = exports.TenantUserMetricType = exports.IntegrationScope = exports.IntegrationConnectionStatus = exports.IntegrationType = exports.ConnectedAppConnectionStatus = exports.ConnectedAppType = exports.TenantOnboardingGoal = exports.DashboardChecklistItemStatus = exports.DashboardChecklistItemType = exports.RefreshTokenRotationType = exports.RefreshTokenExpirationType = exports.JwtAlgorithm = exports.GrantType = exports.ClientType = exports.PasswordlessStrategy = exports.SsoProvider = exports.SettingsItemType = exports.ApnsPushType = exports.ApnsEnvironment = exports.ChannelType = exports.AppVersionStatus = exports.TicketDisplayStatus = exports.UserNoteStatus = exports.TicketLinkType = exports.BoardType = void 0;
16
16
  var TicketType;
17
17
  (function (TicketType) {
18
18
  TicketType["bug"] = "bug";
@@ -208,6 +208,10 @@ var AttachmentType;
208
208
  (function (AttachmentType) {
209
209
  AttachmentType["image"] = "image";
210
210
  })(AttachmentType || (exports.AttachmentType = AttachmentType = {}));
211
+ var LessonType;
212
+ (function (LessonType) {
213
+ LessonType["youtubeVideo"] = "youtube_video";
214
+ })(LessonType || (exports.LessonType = LessonType = {}));
211
215
  var CreatorUpdateTopic;
212
216
  (function (CreatorUpdateTopic) {
213
217
  CreatorUpdateTopic["giveaway"] = "giveaway";
@@ -390,6 +394,11 @@ var PasswordlessStrategy;
390
394
  PasswordlessStrategy["sms"] = "sms";
391
395
  PasswordlessStrategy["phone"] = "phone";
392
396
  })(PasswordlessStrategy || (exports.PasswordlessStrategy = PasswordlessStrategy = {}));
397
+ var ClientType;
398
+ (function (ClientType) {
399
+ ClientType["native"] = "native";
400
+ ClientType["web"] = "web";
401
+ })(ClientType || (exports.ClientType = ClientType = {}));
393
402
  var GrantType;
394
403
  (function (GrantType) {
395
404
  GrantType["authorizationCode"] = "authorization_code";
@@ -452,6 +461,8 @@ var ConnectedAppType;
452
461
  ConnectedAppType["tiktok"] = "tiktok";
453
462
  ConnectedAppType["instagram"] = "instagram";
454
463
  ConnectedAppType["facebook"] = "facebook";
464
+ ConnectedAppType["twitch"] = "twitch";
465
+ ConnectedAppType["linkedin"] = "linkedin";
455
466
  })(ConnectedAppType || (exports.ConnectedAppType = ConnectedAppType = {}));
456
467
  var ConnectedAppConnectionStatus;
457
468
  (function (ConnectedAppConnectionStatus) {
@@ -1004,6 +1015,92 @@ var ParraAPI = /** @class */ (function () {
1004
1015
  if (options === void 0) { options = {}; }
1005
1016
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/chat/messages/").concat(message_id, "/reactions/").concat(reaction_id), __assign({ method: "delete" }, options));
1006
1017
  };
1018
+ this.createCourse = function (tenant_id, body, options) {
1019
+ if (options === void 0) { options = {}; }
1020
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/courses"), __assign({ method: "post", body: JSON.stringify(body), headers: {
1021
+ "content-type": "application/json",
1022
+ } }, options));
1023
+ };
1024
+ this.listCourses = function (tenant_id, options) {
1025
+ if (options === void 0) { options = {}; }
1026
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/courses"), __assign({ method: "get" }, options));
1027
+ };
1028
+ this.getCourseById = function (tenant_id, course_id, options) {
1029
+ if (options === void 0) { options = {}; }
1030
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/courses/").concat(course_id), __assign({ method: "get" }, options));
1031
+ };
1032
+ this.updateCourseById = function (tenant_id, course_id, body, options) {
1033
+ if (options === void 0) { options = {}; }
1034
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/courses/").concat(course_id), __assign({ method: "put", body: JSON.stringify(body), headers: {
1035
+ "content-type": "application/json",
1036
+ } }, options));
1037
+ };
1038
+ this.deleteCourseById = function (tenant_id, course_id, options) {
1039
+ if (options === void 0) { options = {}; }
1040
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/courses/").concat(course_id), __assign({ method: "delete" }, options));
1041
+ };
1042
+ this.getAppCourseById = function (tenant_id, application_id, course_id, options) {
1043
+ if (options === void 0) { options = {}; }
1044
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/applications/").concat(application_id, "/courses/").concat(course_id), __assign({ method: "get" }, options));
1045
+ };
1046
+ this.enrollInCourse = function (tenant_id, course_id, options) {
1047
+ if (options === void 0) { options = {}; }
1048
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/courses/").concat(course_id, "/enroll"), __assign({ method: "post" }, options));
1049
+ };
1050
+ this.createModuleForCourse = function (tenant_id, course_id, body, options) {
1051
+ if (options === void 0) { options = {}; }
1052
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/courses/").concat(course_id, "/modules"), __assign({ method: "post", body: JSON.stringify(body), headers: {
1053
+ "content-type": "application/json",
1054
+ } }, options));
1055
+ };
1056
+ this.updateModuleForCourseById = function (tenant_id, course_id, course_module_id, body, options) {
1057
+ if (options === void 0) { options = {}; }
1058
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/courses/").concat(course_id, "/modules/").concat(course_module_id), __assign({ method: "put", body: JSON.stringify(body), headers: {
1059
+ "content-type": "application/json",
1060
+ } }, options));
1061
+ };
1062
+ this.deleteModuleForCourseById = function (tenant_id, course_id, course_module_id, options) {
1063
+ if (options === void 0) { options = {}; }
1064
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/courses/").concat(course_id, "/modules/").concat(course_module_id), __assign({ method: "delete" }, options));
1065
+ };
1066
+ this.createLessonForModule = function (tenant_id, course_id, course_module_id, body, options) {
1067
+ if (options === void 0) { options = {}; }
1068
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/courses/").concat(course_id, "/modules/").concat(course_module_id, "/lessons"), __assign({ method: "post", body: JSON.stringify(body), headers: {
1069
+ "content-type": "application/json",
1070
+ } }, options));
1071
+ };
1072
+ this.updateLessonForCourseById = function (tenant_id, course_id, lesson_id, body, options) {
1073
+ if (options === void 0) { options = {}; }
1074
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/courses/").concat(course_id, "/lessons/").concat(lesson_id), __assign({ method: "put", body: JSON.stringify(body), headers: {
1075
+ "content-type": "application/json",
1076
+ } }, options));
1077
+ };
1078
+ this.deleteLessonForCourseById = function (tenant_id, course_id, lesson_id, options) {
1079
+ if (options === void 0) { options = {}; }
1080
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/courses/").concat(course_id, "/lessons/").concat(lesson_id), __assign({ method: "delete" }, options));
1081
+ };
1082
+ this.createSectionForLesson = function (tenant_id, course_id, lesson_id, body, options) {
1083
+ if (options === void 0) { options = {}; }
1084
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/courses/").concat(course_id, "/lessons/").concat(lesson_id, "/sections"), __assign({ method: "post", body: JSON.stringify(body), headers: {
1085
+ "content-type": "application/json",
1086
+ } }, options));
1087
+ };
1088
+ this.updateSectionForLesson = function (tenant_id, course_id, lesson_id, lesson_section_id, body, options) {
1089
+ if (options === void 0) { options = {}; }
1090
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/courses/").concat(course_id, "/lessons/").concat(lesson_id, "/sections/").concat(lesson_section_id), __assign({ method: "put", body: JSON.stringify(body), headers: {
1091
+ "content-type": "application/json",
1092
+ } }, options));
1093
+ };
1094
+ this.deleteSectionForLesson = function (tenant_id, course_id, lesson_id, lesson_section_id, options) {
1095
+ if (options === void 0) { options = {}; }
1096
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/courses/").concat(course_id, "/lessons/").concat(lesson_id, "/sections/").concat(lesson_section_id), __assign({ method: "delete" }, options));
1097
+ };
1098
+ this.reportCourseLessonProgress = function (tenant_id, lesson_id, body, options) {
1099
+ if (options === void 0) { options = {}; }
1100
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/lessons/").concat(lesson_id, "/progress"), __assign({ method: "post", body: JSON.stringify(body), headers: {
1101
+ "content-type": "application/json",
1102
+ }, raw: true }, options));
1103
+ };
1007
1104
  this.listAppFaqs = function (tenant_id, application_id, query, options) {
1008
1105
  if (options === void 0) { options = {}; }
1009
1106
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/applications/").concat(application_id, "/faqs"), __assign({ method: "get", query: query }, options));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.3.486",
3
+ "version": "0.3.488",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",