whio-api-sdk 1.0.226-beta-staging → 1.0.227-beta-staging
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/src/sdk/sdk.js +7 -3
- package/package.json +1 -1
- package/src/sdk/sdk.ts +8 -3
package/dist/src/sdk/sdk.js
CHANGED
|
@@ -55,6 +55,10 @@ export class ApiSDK extends BaseClient {
|
|
|
55
55
|
this.workflows, this.logs, this.debug, this.externalIntegrations,
|
|
56
56
|
this.websocket, this.reports, this.patients
|
|
57
57
|
];
|
|
58
|
+
// Auto-initialize the SDK
|
|
59
|
+
this.initialize().catch(error => {
|
|
60
|
+
console.error('Failed to initialize SDK:', error);
|
|
61
|
+
});
|
|
58
62
|
}
|
|
59
63
|
initialize() {
|
|
60
64
|
const _super = Object.create(null, {
|
|
@@ -105,7 +109,7 @@ export class ApiSDK extends BaseClient {
|
|
|
105
109
|
return __awaiter(this, void 0, void 0, function* () {
|
|
106
110
|
const result = yield this.auth.login(...args);
|
|
107
111
|
// Sync user state across all modules after successful login
|
|
108
|
-
yield this.
|
|
112
|
+
yield this.syncUserState(result.user, result.access_token, result.refresh_token);
|
|
109
113
|
return result;
|
|
110
114
|
});
|
|
111
115
|
}
|
|
@@ -113,7 +117,7 @@ export class ApiSDK extends BaseClient {
|
|
|
113
117
|
return __awaiter(this, void 0, void 0, function* () {
|
|
114
118
|
const result = yield this.auth.logout(...args);
|
|
115
119
|
// Sync cleared state across all modules after logout
|
|
116
|
-
yield this.
|
|
120
|
+
yield this.syncUserState(null, null, null);
|
|
117
121
|
return result;
|
|
118
122
|
});
|
|
119
123
|
}
|
|
@@ -141,7 +145,7 @@ export class ApiSDK extends BaseClient {
|
|
|
141
145
|
return __awaiter(this, void 0, void 0, function* () {
|
|
142
146
|
const result = yield this.auth.loginWithCode(...args);
|
|
143
147
|
// Sync user state across all modules after successful login
|
|
144
|
-
yield this.
|
|
148
|
+
yield this.syncUserState(result.user, result.access_token, result.refresh_token);
|
|
145
149
|
return result;
|
|
146
150
|
});
|
|
147
151
|
}
|
package/package.json
CHANGED
package/src/sdk/sdk.ts
CHANGED
|
@@ -70,6 +70,11 @@ export class ApiSDK extends BaseClient {
|
|
|
70
70
|
this.workflows, this.logs, this.debug, this.externalIntegrations,
|
|
71
71
|
this.websocket, this.reports, this.patients
|
|
72
72
|
];
|
|
73
|
+
|
|
74
|
+
// Auto-initialize the SDK
|
|
75
|
+
this.initialize().catch(error => {
|
|
76
|
+
console.error('Failed to initialize SDK:', error);
|
|
77
|
+
});
|
|
73
78
|
}
|
|
74
79
|
|
|
75
80
|
public async initialize(): Promise<void> {
|
|
@@ -127,14 +132,14 @@ export class ApiSDK extends BaseClient {
|
|
|
127
132
|
public async login(...args: Parameters<AuthModule['login']>) {
|
|
128
133
|
const result = await this.auth.login(...args);
|
|
129
134
|
// Sync user state across all modules after successful login
|
|
130
|
-
await this.
|
|
135
|
+
await this.syncUserState(result.user, result.access_token, result.refresh_token);
|
|
131
136
|
return result;
|
|
132
137
|
}
|
|
133
138
|
|
|
134
139
|
public async logout(...args: Parameters<AuthModule['logout']>) {
|
|
135
140
|
const result = await this.auth.logout(...args);
|
|
136
141
|
// Sync cleared state across all modules after logout
|
|
137
|
-
await this.
|
|
142
|
+
await this.syncUserState(null, null, null);
|
|
138
143
|
return result;
|
|
139
144
|
}
|
|
140
145
|
|
|
@@ -157,7 +162,7 @@ export class ApiSDK extends BaseClient {
|
|
|
157
162
|
public async loginWithCode(...args: Parameters<AuthModule['loginWithCode']>) {
|
|
158
163
|
const result = await this.auth.loginWithCode(...args);
|
|
159
164
|
// Sync user state across all modules after successful login
|
|
160
|
-
await this.
|
|
165
|
+
await this.syncUserState(result.user, result.access_token, result.refresh_token);
|
|
161
166
|
return result;
|
|
162
167
|
}
|
|
163
168
|
|