@stackframe/stack 2.4.4 → 2.4.6
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/components/card-frame.d.mts +1 -1
- package/dist/components/card-frame.d.ts +1 -1
- package/dist/components/user-avatar.js +19 -1
- package/dist/components/user-avatar.js.map +1 -1
- package/dist/components-core/button.js +1 -1
- package/dist/components-core/button.js.map +1 -1
- package/dist/components-core/index.d.mts +4 -4
- package/dist/components-core/index.d.ts +4 -4
- package/dist/esm/components/user-avatar.js +9 -1
- package/dist/esm/components/user-avatar.js.map +1 -1
- package/dist/esm/components-core/button.js +1 -1
- package/dist/esm/components-core/button.js.map +1 -1
- package/dist/esm/lib/stack-app.js +21 -54
- package/dist/esm/lib/stack-app.js.map +1 -1
- package/dist/lib/stack-app.js +21 -54
- package/dist/lib/stack-app.js.map +1 -1
- package/dist/providers/component-provider.d.mts +6 -6
- package/dist/providers/component-provider.d.ts +6 -6
- package/package.json +3 -3
package/dist/lib/stack-app.js
CHANGED
|
@@ -53,6 +53,7 @@ var import_objects = require("@stackframe/stack-shared/dist/utils/objects");
|
|
|
53
53
|
var import_promises = require("@stackframe/stack-shared/dist/utils/promises");
|
|
54
54
|
var import_caches = require("@stackframe/stack-shared/dist/utils/caches");
|
|
55
55
|
var import_react3 = require("@stackframe/stack-shared/dist/utils/react");
|
|
56
|
+
var clientVersion = "js @stackframe/stack@2.4.6";
|
|
56
57
|
function permissionDefinitionScopeToType(scope) {
|
|
57
58
|
return { "any-team": "team", "specific-team": "team", "global": "global" }[scope.type];
|
|
58
59
|
}
|
|
@@ -232,6 +233,7 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
232
233
|
this._interface = new import_stack_shared.StackClientInterface({
|
|
233
234
|
baseUrl: options.baseUrl ?? getDefaultBaseUrl(),
|
|
234
235
|
projectId: options.projectId ?? getDefaultProjectId(),
|
|
236
|
+
clientVersion,
|
|
235
237
|
publishableClientKey: options.publishableClientKey ?? getDefaultPublishableClientKey()
|
|
236
238
|
});
|
|
237
239
|
}
|
|
@@ -345,8 +347,7 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
345
347
|
return permissions.find((p) => p.id === permissionId) ?? null;
|
|
346
348
|
},
|
|
347
349
|
async hasPermission(scope, permissionId) {
|
|
348
|
-
|
|
349
|
-
return permissions.some((p) => p.id === permissionId);
|
|
350
|
+
return await this.getPermission(scope, permissionId) !== null;
|
|
350
351
|
},
|
|
351
352
|
toJson() {
|
|
352
353
|
return json;
|
|
@@ -405,22 +406,6 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
405
406
|
return currentUser;
|
|
406
407
|
}
|
|
407
408
|
}
|
|
408
|
-
_userToJson(user) {
|
|
409
|
-
return {
|
|
410
|
-
projectId: user.projectId,
|
|
411
|
-
id: user.id,
|
|
412
|
-
displayName: user.displayName,
|
|
413
|
-
primaryEmail: user.primaryEmail,
|
|
414
|
-
primaryEmailVerified: user.primaryEmailVerified,
|
|
415
|
-
profileImageUrl: user.profileImageUrl,
|
|
416
|
-
signedUpAtMillis: user.signedUpAt.getTime(),
|
|
417
|
-
clientMetadata: user.clientMetadata,
|
|
418
|
-
authMethod: user.authMethod,
|
|
419
|
-
hasPassword: user.hasPassword,
|
|
420
|
-
authWithEmail: user.authWithEmail,
|
|
421
|
-
oauthProviders: user.oauthProviders
|
|
422
|
-
};
|
|
423
|
-
}
|
|
424
409
|
_projectAdminFromJson(data, adminInterface, onRefresh) {
|
|
425
410
|
if (data.id !== adminInterface.projectId) {
|
|
426
411
|
throw new Error(`The project ID of the provided project JSON (${data.id}) does not match the project ID of the app (${adminInterface.projectId})! This is a Stack bug.`);
|
|
@@ -458,6 +443,7 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
458
443
|
return new import_stack_shared.StackAdminInterface({
|
|
459
444
|
baseUrl: this._interface.options.baseUrl,
|
|
460
445
|
projectId: forProjectId,
|
|
446
|
+
clientVersion,
|
|
461
447
|
projectOwnerTokens: tokenStore
|
|
462
448
|
});
|
|
463
449
|
}
|
|
@@ -792,24 +778,21 @@ var _StackServerAppImpl = class extends _StackClientAppImpl {
|
|
|
792
778
|
return await this._interface.listTeamMemberPermissions({ teamId, userId, type, direct });
|
|
793
779
|
});
|
|
794
780
|
constructor(options) {
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
urls: options.urls ?? {}
|
|
811
|
-
});
|
|
812
|
-
}
|
|
781
|
+
super("interface" in options ? {
|
|
782
|
+
interface: options.interface,
|
|
783
|
+
tokenStore: options.tokenStore,
|
|
784
|
+
urls: options.urls
|
|
785
|
+
} : {
|
|
786
|
+
interface: new import_stack_shared.StackServerInterface({
|
|
787
|
+
baseUrl: options.baseUrl ?? getDefaultBaseUrl(),
|
|
788
|
+
projectId: options.projectId ?? getDefaultProjectId(),
|
|
789
|
+
clientVersion,
|
|
790
|
+
publishableClientKey: options.publishableClientKey ?? getDefaultPublishableClientKey(),
|
|
791
|
+
secretServerKey: options.secretServerKey ?? getDefaultSecretServerKey()
|
|
792
|
+
}),
|
|
793
|
+
tokenStore: options.tokenStore,
|
|
794
|
+
urls: options.urls ?? {}
|
|
795
|
+
});
|
|
813
796
|
}
|
|
814
797
|
_serverUserFromJson(json) {
|
|
815
798
|
if (json === null)
|
|
@@ -893,7 +876,7 @@ var _StackServerAppImpl = class extends _StackClientAppImpl {
|
|
|
893
876
|
return permissions.some((p) => p.id === permissionId);
|
|
894
877
|
},
|
|
895
878
|
toJson() {
|
|
896
|
-
return
|
|
879
|
+
return json;
|
|
897
880
|
}
|
|
898
881
|
};
|
|
899
882
|
}
|
|
@@ -965,23 +948,6 @@ var _StackServerAppImpl = class extends _StackClientAppImpl {
|
|
|
965
948
|
}
|
|
966
949
|
};
|
|
967
950
|
}
|
|
968
|
-
_serverUserToJson(user) {
|
|
969
|
-
return {
|
|
970
|
-
projectId: user.projectId,
|
|
971
|
-
id: user.id,
|
|
972
|
-
displayName: user.displayName,
|
|
973
|
-
primaryEmail: user.primaryEmail,
|
|
974
|
-
primaryEmailVerified: user.primaryEmailVerified,
|
|
975
|
-
profileImageUrl: user.profileImageUrl,
|
|
976
|
-
signedUpAtMillis: user.signedUpAt.getTime(),
|
|
977
|
-
clientMetadata: user.clientMetadata,
|
|
978
|
-
serverMetadata: user.serverMetadata,
|
|
979
|
-
authMethod: user.authMethod,
|
|
980
|
-
hasPassword: user.hasPassword,
|
|
981
|
-
authWithEmail: user.authWithEmail,
|
|
982
|
-
oauthProviders: user.oauthProviders
|
|
983
|
-
};
|
|
984
|
-
}
|
|
985
951
|
_serverTeamFromJson(json) {
|
|
986
952
|
const app = this;
|
|
987
953
|
return {
|
|
@@ -1142,6 +1108,7 @@ var _StackAdminAppImpl = class extends _StackServerAppImpl {
|
|
|
1142
1108
|
interface: new import_stack_shared.StackAdminInterface({
|
|
1143
1109
|
baseUrl: options.baseUrl ?? getDefaultBaseUrl(),
|
|
1144
1110
|
projectId: options.projectId ?? getDefaultProjectId(),
|
|
1111
|
+
clientVersion,
|
|
1145
1112
|
..."projectOwnerTokens" in options ? {
|
|
1146
1113
|
projectOwnerTokens: options.projectOwnerTokens
|
|
1147
1114
|
} : {
|