@stackframe/react 2.8.34 → 2.8.36
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/CHANGELOG.md +20 -0
- package/dist/esm/generated/global-css.js +1 -1
- package/dist/esm/generated/global-css.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/admin-app-impl.js +21 -8
- package/dist/esm/lib/stack-app/apps/implementations/admin-app-impl.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js +25 -2
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/common.js +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/common.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/server-app-impl.js +94 -15
- package/dist/esm/lib/stack-app/apps/implementations/server-app-impl.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/interfaces/admin-app.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/interfaces/client-app.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/interfaces/server-app.js.map +1 -1
- package/dist/esm/lib/stack-app/data-vault/index.js +1 -0
- package/dist/esm/lib/stack-app/data-vault/index.js.map +1 -0
- package/dist/esm/providers/theme-provider.js +2 -1
- package/dist/esm/providers/theme-provider.js.map +1 -1
- package/dist/generated/global-css.js +1 -1
- package/dist/generated/global-css.js.map +1 -1
- package/dist/index.d.mts +98 -45
- package/dist/index.d.ts +98 -45
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.js +21 -8
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/client-app-impl.js +25 -2
- package/dist/lib/stack-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/common.js +1 -1
- package/dist/lib/stack-app/apps/implementations/common.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/server-app-impl.js +94 -15
- package/dist/lib/stack-app/apps/implementations/server-app-impl.js.map +1 -1
- package/dist/lib/stack-app/apps/interfaces/admin-app.js.map +1 -1
- package/dist/lib/stack-app/apps/interfaces/client-app.js.map +1 -1
- package/dist/lib/stack-app/apps/interfaces/server-app.js.map +1 -1
- package/dist/lib/stack-app/customers/index.js.map +1 -1
- package/dist/lib/stack-app/data-vault/index.js +19 -0
- package/dist/lib/stack-app/data-vault/index.js.map +1 -0
- package/dist/providers/theme-provider.js +2 -1
- package/dist/providers/theme-provider.js.map +1 -1
- package/package.json +3 -3
|
@@ -167,6 +167,11 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
|
|
|
167
167
|
return await this._interface.getItem({ teamId, itemId }, session);
|
|
168
168
|
}
|
|
169
169
|
);
|
|
170
|
+
this._customItemCache = (0, import_common2.createCacheBySession)(
|
|
171
|
+
async (session, [customCustomerId, itemId]) => {
|
|
172
|
+
return await this._interface.getItem({ customCustomerId, itemId }, session);
|
|
173
|
+
}
|
|
174
|
+
);
|
|
170
175
|
this._anonymousSignUpInProgress = null;
|
|
171
176
|
this._memoryTokenStore = (0, import_common2.createEmptyTokenStore)();
|
|
172
177
|
this._nextServerCookiesTokenStores = /* @__PURE__ */ new WeakMap();
|
|
@@ -996,11 +1001,29 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
|
|
|
996
1001
|
const result = (0, import_common3.useAsyncCache)(cache, [session, userIdOrTeamId, itemId], "team.useItem()");
|
|
997
1002
|
return app._clientItemFromCrud(result);
|
|
998
1003
|
},
|
|
999
|
-
async createCheckoutUrl(
|
|
1000
|
-
return await app._interface.createCheckoutUrl(userIdOrTeamId,
|
|
1004
|
+
async createCheckoutUrl(options) {
|
|
1005
|
+
return await app._interface.createCheckoutUrl(type, userIdOrTeamId, options.offerId, session);
|
|
1001
1006
|
}
|
|
1002
1007
|
};
|
|
1003
1008
|
}
|
|
1009
|
+
async getItem(options) {
|
|
1010
|
+
const session = await this._getSession();
|
|
1011
|
+
let crud;
|
|
1012
|
+
if ("userId" in options) {
|
|
1013
|
+
crud = import_results.Result.orThrow(await this._userItemCache.getOrWait([session, options.userId, options.itemId], "write-only"));
|
|
1014
|
+
} else if ("teamId" in options) {
|
|
1015
|
+
crud = import_results.Result.orThrow(await this._teamItemCache.getOrWait([session, options.teamId, options.itemId], "write-only"));
|
|
1016
|
+
} else {
|
|
1017
|
+
crud = import_results.Result.orThrow(await this._customItemCache.getOrWait([session, options.customCustomerId, options.itemId], "write-only"));
|
|
1018
|
+
}
|
|
1019
|
+
return this._clientItemFromCrud(crud);
|
|
1020
|
+
}
|
|
1021
|
+
useItem(options) {
|
|
1022
|
+
const session = this._useSession();
|
|
1023
|
+
const [cache, ownerId] = "userId" in options ? [this._userItemCache, options.userId] : "teamId" in options ? [this._teamItemCache, options.teamId] : [this._customItemCache, options.customCustomerId];
|
|
1024
|
+
const crud = (0, import_common3.useAsyncCache)(cache, [session, ownerId, options.itemId], "app.useItem()");
|
|
1025
|
+
return this._clientItemFromCrud(crud);
|
|
1026
|
+
}
|
|
1004
1027
|
_currentUserFromCrud(crud, session) {
|
|
1005
1028
|
const currentUser = {
|
|
1006
1029
|
...this._createBaseUser(crud),
|