@stackframe/stack 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 +4 -4
|
@@ -172,6 +172,11 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
|
|
|
172
172
|
return await this._interface.getItem({ teamId, itemId }, session);
|
|
173
173
|
}
|
|
174
174
|
);
|
|
175
|
+
this._customItemCache = (0, import_common2.createCacheBySession)(
|
|
176
|
+
async (session, [customCustomerId, itemId]) => {
|
|
177
|
+
return await this._interface.getItem({ customCustomerId, itemId }, session);
|
|
178
|
+
}
|
|
179
|
+
);
|
|
175
180
|
this._anonymousSignUpInProgress = null;
|
|
176
181
|
this._memoryTokenStore = (0, import_common2.createEmptyTokenStore)();
|
|
177
182
|
this._nextServerCookiesTokenStores = /* @__PURE__ */ new WeakMap();
|
|
@@ -1003,11 +1008,29 @@ var __StackClientAppImplIncomplete = class __StackClientAppImplIncomplete {
|
|
|
1003
1008
|
const result = (0, import_common3.useAsyncCache)(cache, [session, userIdOrTeamId, itemId], "team.useItem()");
|
|
1004
1009
|
return app._clientItemFromCrud(result);
|
|
1005
1010
|
},
|
|
1006
|
-
async createCheckoutUrl(
|
|
1007
|
-
return await app._interface.createCheckoutUrl(userIdOrTeamId,
|
|
1011
|
+
async createCheckoutUrl(options) {
|
|
1012
|
+
return await app._interface.createCheckoutUrl(type, userIdOrTeamId, options.offerId, session);
|
|
1008
1013
|
}
|
|
1009
1014
|
};
|
|
1010
1015
|
}
|
|
1016
|
+
async getItem(options) {
|
|
1017
|
+
const session = await this._getSession();
|
|
1018
|
+
let crud;
|
|
1019
|
+
if ("userId" in options) {
|
|
1020
|
+
crud = import_results.Result.orThrow(await this._userItemCache.getOrWait([session, options.userId, options.itemId], "write-only"));
|
|
1021
|
+
} else if ("teamId" in options) {
|
|
1022
|
+
crud = import_results.Result.orThrow(await this._teamItemCache.getOrWait([session, options.teamId, options.itemId], "write-only"));
|
|
1023
|
+
} else {
|
|
1024
|
+
crud = import_results.Result.orThrow(await this._customItemCache.getOrWait([session, options.customCustomerId, options.itemId], "write-only"));
|
|
1025
|
+
}
|
|
1026
|
+
return this._clientItemFromCrud(crud);
|
|
1027
|
+
}
|
|
1028
|
+
useItem(options) {
|
|
1029
|
+
const session = this._useSession();
|
|
1030
|
+
const [cache, ownerId] = "userId" in options ? [this._userItemCache, options.userId] : "teamId" in options ? [this._teamItemCache, options.teamId] : [this._customItemCache, options.customCustomerId];
|
|
1031
|
+
const crud = (0, import_common3.useAsyncCache)(cache, [session, ownerId, options.itemId], "app.useItem()");
|
|
1032
|
+
return this._clientItemFromCrud(crud);
|
|
1033
|
+
}
|
|
1011
1034
|
_currentUserFromCrud(crud, session) {
|
|
1012
1035
|
const currentUser = {
|
|
1013
1036
|
...this._createBaseUser(crud),
|