shred-api-client 1.5.3 → 1.6.0

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.
@@ -6,7 +6,7 @@ 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>;
9
+ create(t: Tenant, context: Context): Promise<boolean>;
10
10
  list(context: Context): Promise<Tenant[]>;
11
11
  update(tenantId: string, updateData: Pick<Tenant, "preferences">, context: Context): Promise<boolean>;
12
12
  }
@@ -15,9 +15,9 @@ 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) {
18
+ async create(t, context) {
19
19
  const endpointInfo = Tenant_schema_1.TenantEndpoints.CreateTenant;
20
- const data = await this.clientHTTP.makeRequest(this.env, `${endpointInfo.uri}`, endpointInfo.method, { tenantId, name }, context);
20
+ const data = await this.clientHTTP.makeRequest(this.env, `${endpointInfo.uri}`, endpointInfo.method, Object.assign({}, t), context);
21
21
  return data;
22
22
  }
23
23
  async list(context) {
@@ -2,7 +2,7 @@ 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>;
5
+ create: (tenant: Tenant, context: Context) => Promise<boolean>;
6
6
  list: (context: Context) => Promise<Tenant[]>;
7
7
  update: (tenantId: string, data: Pick<Tenant, "preferences">, context: Context) => Promise<boolean>;
8
8
  }
@@ -1,6 +1,4 @@
1
1
  import Context from "./Context";
2
- import { Subscription } from "./Subscription.schema";
3
- import { Tenant } from "./Tenant.schema";
4
2
  interface UserAPISchema {
5
3
  getUserInfo: (context: Context) => Promise<User>;
6
4
  isEmailAvaliable: (email: string) => Promise<boolean>;
@@ -64,19 +62,14 @@ type User = {
64
62
  name: string;
65
63
  email: string;
66
64
  fcmToken?: string;
67
- registeredAt: number;
68
65
  profession?: string;
69
66
  photoUrl?: string;
70
67
  preferences?: Preferences;
71
- tenant?: Tenant;
68
+ tenantId?: string;
69
+ editorId?: string;
72
70
  customerId: string;
73
- registered: boolean;
74
- subscription?: Subscription;
75
71
  invitationCode?: string;
76
- canCreateFreeProject: boolean;
77
- phone?: string;
78
- role?: Role;
79
- bindedAccounts?: string[];
80
- isEnabled?: boolean;
72
+ canCreateFreeProject?: boolean;
73
+ role: Role;
81
74
  };
82
75
  export { User, UserAPISchema, UserEndpoints, Role, System };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shred-api-client",
3
- "version": "1.5.3",
3
+ "version": "1.6.0",
4
4
  "description": "API Client for Shred",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",