@parra/parra-js-sdk 0.3.505 → 0.3.507
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 +22 -3
- package/dist/ParraAPI.js +6 -0
- package/package.json +1 -1
package/dist/ParraAPI.d.ts
CHANGED
@@ -1078,6 +1078,16 @@ export interface ApplePurchase {
|
|
1078
1078
|
environment: ApplePurchaseEnvironment;
|
1079
1079
|
type: ApplePurchaseType;
|
1080
1080
|
}
|
1081
|
+
export interface StripePurchase {
|
1082
|
+
checkout_session_id?: string | null;
|
1083
|
+
payment_intent_id?: string | null;
|
1084
|
+
livemode?: boolean | null;
|
1085
|
+
}
|
1086
|
+
export interface LineItem {
|
1087
|
+
product?: ProductStub;
|
1088
|
+
quantity?: number;
|
1089
|
+
price?: Price;
|
1090
|
+
}
|
1081
1091
|
export interface UserPurchase {
|
1082
1092
|
id: string;
|
1083
1093
|
created_at: string;
|
@@ -1096,6 +1106,8 @@ export interface UserPurchase {
|
|
1096
1106
|
title?: string;
|
1097
1107
|
description?: string | null;
|
1098
1108
|
apple?: ApplePurchase | null;
|
1109
|
+
stripe?: StripePurchase | null;
|
1110
|
+
line_items?: Array<LineItem> | null;
|
1099
1111
|
entitlements?: Array<UserEntitlement> | null;
|
1100
1112
|
}
|
1101
1113
|
export declare enum BillingSourceType {
|
@@ -1103,15 +1115,14 @@ export declare enum BillingSourceType {
|
|
1103
1115
|
parra = "parra"
|
1104
1116
|
}
|
1105
1117
|
export interface CreateBillingSourceAppleData {
|
1106
|
-
app_store_connect_api_connection_id: string;
|
1107
1118
|
}
|
1108
|
-
export type
|
1119
|
+
export type CreateBillingSourceData = CreateBillingSourceAppleData;
|
1109
1120
|
export interface CreateBillingSourceRequestBody {
|
1110
1121
|
title: string;
|
1111
1122
|
type: BillingSourceType;
|
1112
1123
|
description?: string | null;
|
1113
1124
|
application_id: string;
|
1114
|
-
data:
|
1125
|
+
data: CreateBillingSourceData;
|
1115
1126
|
}
|
1116
1127
|
export interface AppleSubscriptionGroup {
|
1117
1128
|
id: string;
|
@@ -1505,6 +1516,13 @@ export interface Course {
|
|
1505
1516
|
header_image?: ImageAssetStub | null;
|
1506
1517
|
modules?: Array<CourseModule>;
|
1507
1518
|
}
|
1519
|
+
export interface CreateCourseCheckoutSessionRequestBody {
|
1520
|
+
success_url: string;
|
1521
|
+
return_url: string;
|
1522
|
+
}
|
1523
|
+
export interface AppCheckoutSession {
|
1524
|
+
url: string;
|
1525
|
+
}
|
1508
1526
|
export interface AppLessonProgress {
|
1509
1527
|
complete: boolean;
|
1510
1528
|
progress?: number;
|
@@ -5167,6 +5185,7 @@ declare class ParraAPI {
|
|
5167
5185
|
removeReactionFromChatMessage: (tenant_id: string, message_id: string, reaction_id: string, options?: Options) => Promise<Response>;
|
5168
5186
|
createCourse: (tenant_id: string, body: CreateCourseRequestBody, options?: Options) => Promise<Course>;
|
5169
5187
|
listCourses: (tenant_id: string, options?: Options) => Promise<Array<Course>>;
|
5188
|
+
createCheckoutSessionForCourse: (tenant_id: string, course_id: string, body: CreateCourseCheckoutSessionRequestBody, options?: Options) => Promise<AppCheckoutSession>;
|
5170
5189
|
getCourseById: (tenant_id: string, course_id: string, query?: {
|
5171
5190
|
include?: string;
|
5172
5191
|
}, options?: Options) => Promise<Course>;
|
package/dist/ParraAPI.js
CHANGED
@@ -1020,6 +1020,12 @@ var ParraAPI = /** @class */ (function () {
|
|
1020
1020
|
if (options === void 0) { options = {}; }
|
1021
1021
|
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/courses"), __assign({ method: "get" }, options));
|
1022
1022
|
};
|
1023
|
+
this.createCheckoutSessionForCourse = function (tenant_id, course_id, body, options) {
|
1024
|
+
if (options === void 0) { options = {}; }
|
1025
|
+
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/courses/").concat(course_id, "/checkout/sessions"), __assign({ method: "post", body: JSON.stringify(body), headers: {
|
1026
|
+
"content-type": "application/json",
|
1027
|
+
} }, options));
|
1028
|
+
};
|
1023
1029
|
this.getCourseById = function (tenant_id, course_id, query, options) {
|
1024
1030
|
if (options === void 0) { options = {}; }
|
1025
1031
|
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/courses/").concat(course_id), __assign({ method: "get", query: query }, options));
|