shred-api-client 1.5.1 → 1.5.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/api/Tenant.api.d.ts +3 -0
- package/dist/api/Tenant.api.js +15 -0
- package/dist/api/User.api.d.ts +2 -0
- package/dist/api/User.api.js +10 -0
- package/dist/model/Tenant.schema.d.ts +15 -0
- package/dist/model/Tenant.schema.js +12 -0
- package/dist/model/User.schema.d.ts +10 -0
- package/dist/model/User.schema.js +8 -0
- package/package.json +1 -1
package/dist/api/Tenant.api.d.ts
CHANGED
|
@@ -6,5 +6,8 @@ declare class TenantAPI implements TenantAPISchema {
|
|
|
6
6
|
private clientHTTP;
|
|
7
7
|
constructor(env: Environment);
|
|
8
8
|
getByInviteCode(inviteCode: string, context?: Context): Promise<Tenant | null>;
|
|
9
|
+
create(tenantId: string, name: string, context: Context): Promise<boolean>;
|
|
10
|
+
list(context: Context): Promise<Tenant[]>;
|
|
11
|
+
update(tenantId: string, updateData: Pick<Tenant, "preferences">, context: Context): Promise<boolean>;
|
|
9
12
|
}
|
|
10
13
|
export default TenantAPI;
|
package/dist/api/Tenant.api.js
CHANGED
|
@@ -15,5 +15,20 @@ class TenantAPI {
|
|
|
15
15
|
const data = await this.clientHTTP.makeRequest(this.env, `${endpointInfo.uri}/${inviteCode}`, endpointInfo.method, null, context);
|
|
16
16
|
return data;
|
|
17
17
|
}
|
|
18
|
+
async create(tenantId, name, context) {
|
|
19
|
+
const endpointInfo = Tenant_schema_1.TenantEndpoints.CreateTenant;
|
|
20
|
+
const data = await this.clientHTTP.makeRequest(this.env, `${endpointInfo.uri}`, endpointInfo.method, { tenantId, name }, context);
|
|
21
|
+
return data;
|
|
22
|
+
}
|
|
23
|
+
async list(context) {
|
|
24
|
+
const endpointInfo = Tenant_schema_1.TenantEndpoints.ListAll;
|
|
25
|
+
const data = await this.clientHTTP.makeRequest(this.env, `${endpointInfo.uri}`, endpointInfo.method, null, context);
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
async update(tenantId, updateData, context) {
|
|
29
|
+
const endpointInfo = Tenant_schema_1.TenantEndpoints.UpdateTenant;
|
|
30
|
+
const data = await this.clientHTTP.makeRequest(this.env, `${endpointInfo.uri}`, endpointInfo.method, { tenantId, data: updateData }, context);
|
|
31
|
+
return data;
|
|
32
|
+
}
|
|
18
33
|
}
|
|
19
34
|
exports.default = TenantAPI;
|
package/dist/api/User.api.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ declare class UserAPI implements UserAPISchema {
|
|
|
5
5
|
private env;
|
|
6
6
|
private clientHTTP;
|
|
7
7
|
constructor(env: Environment);
|
|
8
|
+
sendValidationCode(email: string): Promise<boolean>;
|
|
9
|
+
confirmCode(email: string, code: number): Promise<boolean>;
|
|
8
10
|
isEmailAvaliable(email: string): Promise<boolean>;
|
|
9
11
|
authenticate(context: Context, system: System): Promise<string>;
|
|
10
12
|
createUser(email: string, name: string, newPassword: string, newPasswordConfirmation: string, profession: string | null, invitationCode: string | null): Promise<any>;
|
package/dist/api/User.api.js
CHANGED
|
@@ -10,6 +10,16 @@ class UserAPI {
|
|
|
10
10
|
this.env = env;
|
|
11
11
|
this.clientHTTP = new HTTPClient_1.default();
|
|
12
12
|
}
|
|
13
|
+
async sendValidationCode(email) {
|
|
14
|
+
const endpointData = User_schema_1.UserEndpoints.SendValidationCode;
|
|
15
|
+
const data = await this.clientHTTP.makeRequest(this.env, `${endpointData.uri}?email=${email}`, endpointData.method);
|
|
16
|
+
return data.success;
|
|
17
|
+
}
|
|
18
|
+
async confirmCode(email, code) {
|
|
19
|
+
const endpointData = User_schema_1.UserEndpoints.ConfirmCode;
|
|
20
|
+
const data = await this.clientHTTP.makeRequest(this.env, `${endpointData.uri}?email=${email}&code=${code}`, endpointData.method);
|
|
21
|
+
return data.success;
|
|
22
|
+
}
|
|
13
23
|
async isEmailAvaliable(email) {
|
|
14
24
|
const endpointData = User_schema_1.UserEndpoints.IsEmailAvaliable;
|
|
15
25
|
const data = await this.clientHTTP.makeRequest(this.env, `${endpointData.uri}?email=${email}`, endpointData.method);
|
|
@@ -2,12 +2,27 @@ import { Subscription } from "./Subscription.schema";
|
|
|
2
2
|
import Context from "./Context";
|
|
3
3
|
interface TenantAPISchema {
|
|
4
4
|
getByInviteCode: (code: string, context?: Context) => Promise<Tenant | null>;
|
|
5
|
+
create: (tenantId: string, name: string, context: Context) => Promise<boolean>;
|
|
6
|
+
list: (context: Context) => Promise<Tenant[]>;
|
|
7
|
+
update: (tenantId: string, data: Pick<Tenant, "preferences">, context: Context) => Promise<boolean>;
|
|
5
8
|
}
|
|
6
9
|
declare const TenantEndpoints: {
|
|
7
10
|
GetByInviteCode: {
|
|
8
11
|
uri: string;
|
|
9
12
|
method: string;
|
|
10
13
|
};
|
|
14
|
+
CreateTenant: {
|
|
15
|
+
uri: string;
|
|
16
|
+
method: string;
|
|
17
|
+
};
|
|
18
|
+
UpdateTenant: {
|
|
19
|
+
uri: string;
|
|
20
|
+
method: string;
|
|
21
|
+
};
|
|
22
|
+
ListAll: {
|
|
23
|
+
uri: string;
|
|
24
|
+
method: string;
|
|
25
|
+
};
|
|
11
26
|
};
|
|
12
27
|
type Preferences = {
|
|
13
28
|
iconUrl: string;
|
|
@@ -6,5 +6,17 @@ const TenantEndpoints = {
|
|
|
6
6
|
uri: "/tenants/public/invitation/",
|
|
7
7
|
method: "GET",
|
|
8
8
|
},
|
|
9
|
+
CreateTenant: {
|
|
10
|
+
uri: "/tenants/create",
|
|
11
|
+
method: "PUT",
|
|
12
|
+
},
|
|
13
|
+
UpdateTenant: {
|
|
14
|
+
uri: "/tenants/update",
|
|
15
|
+
method: "POST",
|
|
16
|
+
},
|
|
17
|
+
ListAll: {
|
|
18
|
+
uri: "/tenants/list",
|
|
19
|
+
method: "GET",
|
|
20
|
+
},
|
|
9
21
|
};
|
|
10
22
|
exports.TenantEndpoints = TenantEndpoints;
|
|
@@ -4,6 +4,8 @@ import { Tenant } from "./Tenant.schema";
|
|
|
4
4
|
interface UserAPISchema {
|
|
5
5
|
getUserInfo: (context: Context) => Promise<User>;
|
|
6
6
|
isEmailAvaliable: (email: string) => Promise<boolean>;
|
|
7
|
+
sendValidationCode: (email: string) => Promise<boolean>;
|
|
8
|
+
confirmCode: (email: string, code: number) => Promise<boolean>;
|
|
7
9
|
authenticate: (context: Context, system: System) => Promise<string>;
|
|
8
10
|
createUser: (email: string, name: string, newPassword: string, newPasswordConfirmation: string, profession: string | null, invitationCode: string | null) => Promise<User>;
|
|
9
11
|
}
|
|
@@ -20,6 +22,14 @@ declare const UserEndpoints: {
|
|
|
20
22
|
uri: string;
|
|
21
23
|
method: string;
|
|
22
24
|
};
|
|
25
|
+
ConfirmCode: {
|
|
26
|
+
uri: string;
|
|
27
|
+
method: string;
|
|
28
|
+
};
|
|
29
|
+
SendValidationCode: {
|
|
30
|
+
uri: string;
|
|
31
|
+
method: string;
|
|
32
|
+
};
|
|
23
33
|
Authenticate: {
|
|
24
34
|
uri: string;
|
|
25
35
|
method: string;
|
|
@@ -14,6 +14,14 @@ const UserEndpoints = {
|
|
|
14
14
|
uri: "/accounts/public/email/avaliable",
|
|
15
15
|
method: "GET",
|
|
16
16
|
},
|
|
17
|
+
ConfirmCode: {
|
|
18
|
+
uri: "/accounts/public/email/validate",
|
|
19
|
+
method: "POST",
|
|
20
|
+
},
|
|
21
|
+
SendValidationCode: {
|
|
22
|
+
uri: "/accounts/public/email/send",
|
|
23
|
+
method: "POST",
|
|
24
|
+
},
|
|
17
25
|
Authenticate: {
|
|
18
26
|
uri: "/accounts/authenticate",
|
|
19
27
|
method: "POST",
|