shred-api-client 1.9.18 → 1.9.20
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/api/Subscription.api.js +3 -1
- package/dist/api/User.api.d.ts +1 -1
- package/dist/api/User.api.js +3 -3
- package/dist/model/Subscription.schema.d.ts +4 -0
- package/dist/model/Subscription.schema.js +4 -0
- package/dist/model/User.schema.d.ts +1 -1
- package/dist/model/User.schema.js +1 -1
- package/package.json +1 -1
|
@@ -34,7 +34,9 @@ class SubscriptionAPI {
|
|
|
34
34
|
return data.success;
|
|
35
35
|
}
|
|
36
36
|
async getProducts(ctx) {
|
|
37
|
-
const endpointInfo =
|
|
37
|
+
const endpointInfo = ctx
|
|
38
|
+
? Subscription_schema_1.SubscriptionEndpoints.GetProductsByUser
|
|
39
|
+
: Subscription_schema_1.SubscriptionEndpoints.GetProducts;
|
|
38
40
|
const data = await this.clientHTTP.makeRequest(this.env, endpointInfo.uri, endpointInfo.method, null, ctx);
|
|
39
41
|
return data;
|
|
40
42
|
}
|
package/dist/api/User.api.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ declare class UserAPI implements UserAPISchema {
|
|
|
14
14
|
update(context: Context, update: Partial<Update>): Promise<boolean>;
|
|
15
15
|
getBindedUsers(context: Context): Promise<User[]>;
|
|
16
16
|
setup(context: Context): Promise<boolean>;
|
|
17
|
-
authenticate(
|
|
17
|
+
authenticate(email: string, password: string, system: System): Promise<string>;
|
|
18
18
|
createUser(email: string, name: string, password: string, passwordConfirmation: string, profession: string | null, invitationCode: string | null): Promise<any>;
|
|
19
19
|
getUserInfo(context: Context): Promise<User>;
|
|
20
20
|
}
|
package/dist/api/User.api.js
CHANGED
|
@@ -55,10 +55,10 @@ class UserAPI {
|
|
|
55
55
|
const data = await this.clientHTTP.makeRequest(this.env, `${endpointData.uri}`, endpointData.method, null, context);
|
|
56
56
|
return data.success;
|
|
57
57
|
}
|
|
58
|
-
async authenticate(
|
|
58
|
+
async authenticate(email, password, system) {
|
|
59
59
|
const endpointData = User_schema_1.UserEndpoints.Authenticate;
|
|
60
|
-
const data = await this.clientHTTP.makeRequest(this.env, `${endpointData.uri}`, endpointData.method, { system
|
|
61
|
-
return data.
|
|
60
|
+
const data = await this.clientHTTP.makeRequest(this.env, `${endpointData.uri}`, endpointData.method, { system, email, password });
|
|
61
|
+
return data.token;
|
|
62
62
|
}
|
|
63
63
|
async createUser(email, name, password, passwordConfirmation, profession, invitationCode) {
|
|
64
64
|
const endpointData = User_schema_1.UserEndpoints.CreateUser;
|
|
@@ -18,6 +18,10 @@ const SubscriptionEndpoints = {
|
|
|
18
18
|
uri: "/subscriptions/products/public/list/",
|
|
19
19
|
method: "GET",
|
|
20
20
|
},
|
|
21
|
+
GetProductsByUser: {
|
|
22
|
+
uri: "/subscriptions/products/list/",
|
|
23
|
+
method: "GET",
|
|
24
|
+
},
|
|
21
25
|
Checkout: {
|
|
22
26
|
uri: "/subscriptions/payment/checkout/",
|
|
23
27
|
method: "POST",
|
|
@@ -7,7 +7,7 @@ interface UserAPISchema {
|
|
|
7
7
|
confirmCode: (email: string, code: number, keepCode?: boolean) => Promise<boolean>;
|
|
8
8
|
changePassword: (email: string, pass: string, passConfirm: string, code: number) => Promise<boolean>;
|
|
9
9
|
changeEmail: (ctx: Context, email: string, code: number) => Promise<boolean>;
|
|
10
|
-
authenticate: (
|
|
10
|
+
authenticate: (email: string, password: string, system: System) => Promise<string>;
|
|
11
11
|
update: (context: Context, update: Partial<Update>) => Promise<boolean>;
|
|
12
12
|
setup: (context: Context) => Promise<boolean>;
|
|
13
13
|
getBindedUsers: (ctx: Context) => Promise<User[]>;
|