@hexclave/js 1.0.0 → 1.0.2
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/README.md +7 -23
- package/dist/dev-tool/dev-tool-core.d.ts.map +1 -1
- package/dist/dev-tool/dev-tool-core.js +23 -23
- package/dist/dev-tool/dev-tool-core.js.map +1 -1
- package/dist/dev-tool/index.js +6 -6
- package/dist/dev-tool/index.js.map +1 -1
- package/dist/esm/dev-tool/dev-tool-core.d.ts.map +1 -1
- package/dist/esm/dev-tool/dev-tool-core.js +2 -2
- package/dist/esm/dev-tool/dev-tool-core.js.map +1 -1
- package/dist/esm/dev-tool/index.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -2
- package/dist/esm/integrations/convex.js.map +1 -1
- package/dist/esm/lib/auth.js.map +1 -1
- package/dist/esm/lib/auth.test.js.map +1 -1
- package/dist/esm/lib/cookie.js.map +1 -1
- package/dist/esm/lib/stack-app/api-keys/index.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/admin-app-impl.d.ts +11 -11
- package/dist/esm/lib/stack-app/apps/implementations/admin-app-impl.d.ts.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/admin-app-impl.js +3 -1
- 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.cross-domain.test.js +67 -1
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.cross-domain.test.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.d.ts +4 -3
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.d.ts.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js +18 -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.d.ts.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/event-tracker.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/event-tracker.test.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/index.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/redirect-page-urls.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/server-app-impl.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/session-replay.d.ts.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/session-replay.js +3 -2
- package/dist/esm/lib/stack-app/apps/implementations/session-replay.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/interfaces/admin-app.d.ts +4 -0
- package/dist/esm/lib/stack-app/apps/interfaces/admin-app.d.ts.map +1 -1
- package/dist/esm/lib/stack-app/apps/interfaces/admin-app.js +1 -0
- package/dist/esm/lib/stack-app/apps/interfaces/admin-app.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/interfaces/client-app.d.ts +5 -0
- package/dist/esm/lib/stack-app/apps/interfaces/client-app.d.ts.map +1 -1
- package/dist/esm/lib/stack-app/apps/interfaces/client-app.js +1 -0
- package/dist/esm/lib/stack-app/apps/interfaces/client-app.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/interfaces/server-app.d.ts +4 -0
- package/dist/esm/lib/stack-app/apps/interfaces/server-app.d.ts.map +1 -1
- package/dist/esm/lib/stack-app/apps/interfaces/server-app.js +1 -0
- package/dist/esm/lib/stack-app/apps/interfaces/server-app.js.map +1 -1
- package/dist/esm/lib/stack-app/common.js.map +1 -1
- package/dist/esm/lib/stack-app/contact-channels/index.js.map +1 -1
- package/dist/esm/lib/stack-app/email-templates/index.js.map +1 -1
- package/dist/esm/lib/stack-app/internal-api-keys/index.js.map +1 -1
- package/dist/esm/lib/stack-app/permissions/index.js.map +1 -1
- package/dist/esm/lib/stack-app/projects/index.js.map +1 -1
- package/dist/esm/lib/stack-app/teams/index.js.map +1 -1
- package/dist/esm/lib/stack-app/url-targets.js.map +1 -1
- package/dist/esm/lib/stack-app/url-targets.test.js +1 -1
- package/dist/esm/lib/stack-app/url-targets.test.js.map +1 -1
- package/dist/esm/lib/stack-app/users/index.js.map +1 -1
- package/dist/esm/utils/url.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -4
- package/dist/integrations/convex.js +5 -5
- package/dist/integrations/convex.js.map +1 -1
- package/dist/lib/auth.js +12 -12
- package/dist/lib/auth.js.map +1 -1
- package/dist/lib/auth.test.js +2 -2
- package/dist/lib/auth.test.js.map +1 -1
- package/dist/lib/cookie.js +9 -9
- package/dist/lib/cookie.js.map +1 -1
- package/dist/lib/stack-app/api-keys/index.js +2 -2
- package/dist/lib/stack-app/api-keys/index.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.d.ts +11 -11
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.d.ts.map +1 -1
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.js +38 -36
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/client-app-impl.cross-domain.test.js +66 -0
- package/dist/lib/stack-app/apps/implementations/client-app-impl.cross-domain.test.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/client-app-impl.d.ts +4 -3
- package/dist/lib/stack-app/apps/implementations/client-app-impl.d.ts.map +1 -1
- package/dist/lib/stack-app/apps/implementations/client-app-impl.js +210 -194
- package/dist/lib/stack-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/common.d.ts.map +1 -1
- package/dist/lib/stack-app/apps/implementations/common.js +25 -25
- package/dist/lib/stack-app/apps/implementations/common.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/event-tracker.js +7 -7
- package/dist/lib/stack-app/apps/implementations/event-tracker.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/event-tracker.test.js +3 -3
- package/dist/lib/stack-app/apps/implementations/event-tracker.test.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/index.js +4 -4
- package/dist/lib/stack-app/apps/implementations/index.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/redirect-page-urls.js +8 -8
- package/dist/lib/stack-app/apps/implementations/redirect-page-urls.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/server-app-impl.js +59 -59
- package/dist/lib/stack-app/apps/implementations/server-app-impl.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/session-replay.d.ts.map +1 -1
- package/dist/lib/stack-app/apps/implementations/session-replay.js +13 -12
- package/dist/lib/stack-app/apps/implementations/session-replay.js.map +1 -1
- package/dist/lib/stack-app/apps/interfaces/admin-app.d.ts +4 -0
- package/dist/lib/stack-app/apps/interfaces/admin-app.d.ts.map +1 -1
- package/dist/lib/stack-app/apps/interfaces/admin-app.js +1 -0
- package/dist/lib/stack-app/apps/interfaces/admin-app.js.map +1 -1
- package/dist/lib/stack-app/apps/interfaces/client-app.d.ts +5 -0
- package/dist/lib/stack-app/apps/interfaces/client-app.d.ts.map +1 -1
- package/dist/lib/stack-app/apps/interfaces/client-app.js +1 -0
- package/dist/lib/stack-app/apps/interfaces/client-app.js.map +1 -1
- package/dist/lib/stack-app/apps/interfaces/server-app.d.ts +4 -0
- package/dist/lib/stack-app/apps/interfaces/server-app.d.ts.map +1 -1
- package/dist/lib/stack-app/apps/interfaces/server-app.js +1 -0
- package/dist/lib/stack-app/apps/interfaces/server-app.js.map +1 -1
- package/dist/lib/stack-app/common.js.map +1 -1
- package/dist/lib/stack-app/contact-channels/index.js.map +1 -1
- package/dist/lib/stack-app/email-templates/index.js.map +1 -1
- package/dist/lib/stack-app/internal-api-keys/index.js.map +1 -1
- package/dist/lib/stack-app/permissions/index.js.map +1 -1
- package/dist/lib/stack-app/projects/index.js.map +1 -1
- package/dist/lib/stack-app/teams/index.js.map +1 -1
- package/dist/lib/stack-app/url-targets.js +6 -6
- package/dist/lib/stack-app/url-targets.js.map +1 -1
- package/dist/lib/stack-app/url-targets.test.js +1 -1
- package/dist/lib/stack-app/url-targets.test.js.map +1 -1
- package/dist/lib/stack-app/users/index.js +3 -3
- package/dist/lib/stack-app/users/index.js.map +1 -1
- package/dist/utils/url.js +2 -2
- package/dist/utils/url.js.map +1 -1
- package/package.json +3 -3
- package/dist/esm/internal/deprecation-warning.d.ts +0 -1
- package/dist/esm/internal/deprecation-warning.js +0 -24
- package/dist/esm/internal/deprecation-warning.js.map +0 -1
- package/dist/internal/deprecation-warning.d.ts +0 -1
- package/dist/internal/deprecation-warning.js +0 -24
- package/dist/internal/deprecation-warning.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_chunk = require('../../../chunk-BE-pF4vm.js');
|
|
3
|
-
let
|
|
3
|
+
let _hexclave_shared_dist_utils_objects = require("@hexclave/shared/dist/utils/objects");
|
|
4
4
|
|
|
5
5
|
//#region src/lib/stack-app/api-keys/index.ts
|
|
6
6
|
async function apiKeyCreationOptionsToCrud(type, userIdOrTeamId, options) {
|
|
@@ -12,7 +12,7 @@ async function apiKeyCreationOptionsToCrud(type, userIdOrTeamId, options) {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
async function apiKeyUpdateOptionsToCrud(type, options) {
|
|
15
|
-
return (0,
|
|
15
|
+
return (0, _hexclave_shared_dist_utils_objects.filterUndefined)({
|
|
16
16
|
description: options.description,
|
|
17
17
|
expires_at_millis: options.expiresAt == null ? options.expiresAt : options.expiresAt.getTime(),
|
|
18
18
|
revoked: options.revoked
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/lib/stack-app/api-keys/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { TeamApiKeysCrud, UserApiKeysCrud, teamApiKeysCreateInputSchema, userApiKeysCreateInputSchema } from \"@
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/lib/stack-app/api-keys/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { TeamApiKeysCrud, UserApiKeysCrud, teamApiKeysCreateInputSchema, userApiKeysCreateInputSchema } from \"@hexclave/shared/dist/interface/crud/project-api-keys\";\nimport { filterUndefined } from \"@hexclave/shared/dist/utils/objects\";\nimport { IfAndOnlyIf, PrettifyType } from \"@hexclave/shared/dist/utils/types\";\nimport type * as yup from \"yup\";\n\nexport type ApiKeyType = \"user\" | \"team\";\n\nexport type ApiKey<Type extends ApiKeyType = ApiKeyType, IsFirstView extends boolean = false> =\n & {\n id: string,\n description: string,\n expiresAt?: Date,\n manuallyRevokedAt?: Date | null,\n createdAt: Date,\n value: IfAndOnlyIf<IsFirstView, true, string, { lastFour: string }>,\n update(options: ApiKeyUpdateOptions<Type>): Promise<void>,\n revoke: () => Promise<void>,\n isValid: () => boolean,\n whyInvalid: () => \"manually-revoked\" | \"expired\" | null,\n }\n & (\n | (\"user\" extends Type ? { type: \"user\", userId: string } : never)\n | (\"team\" extends Type ? { type: \"team\", teamId: string } : never)\n );\n\nexport type UserApiKeyFirstView = PrettifyType<ApiKey<\"user\", true>>;\nexport type UserApiKey = PrettifyType<ApiKey<\"user\", false>>;\n\nexport type TeamApiKeyFirstView = PrettifyType<ApiKey<\"team\", true>>;\nexport type TeamApiKey = PrettifyType<ApiKey<\"team\", false>>;\n\nexport type ApiKeyCreationOptions<Type extends ApiKeyType = ApiKeyType> =\n & {\n description: string,\n expiresAt: Date | null,\n /**\n * Whether the API key should be considered public. A public API key will not be detected by the secret scanner, which\n * automatically revokes API keys when it detects that they may have been exposed to the public.\n */\n isPublic?: boolean,\n };\nexport function apiKeyCreationOptionsToCrud(type: \"user\", userId: string, options: ApiKeyCreationOptions<\"user\">): Promise<yup.InferType<typeof userApiKeysCreateInputSchema>>;\nexport function apiKeyCreationOptionsToCrud(type: \"team\", teamId: string, options: ApiKeyCreationOptions<\"team\">): Promise<yup.InferType<typeof teamApiKeysCreateInputSchema>>;\nexport function apiKeyCreationOptionsToCrud(type: ApiKeyType, userIdOrTeamId: string, options: ApiKeyCreationOptions): Promise<yup.InferType<typeof userApiKeysCreateInputSchema> | yup.InferType<typeof teamApiKeysCreateInputSchema>>;\nexport async function apiKeyCreationOptionsToCrud(type: ApiKeyType, userIdOrTeamId: string, options: ApiKeyCreationOptions): Promise<yup.InferType<typeof userApiKeysCreateInputSchema> | yup.InferType<typeof teamApiKeysCreateInputSchema>> {\n return {\n description: options.description,\n expires_at_millis: options.expiresAt == null ? options.expiresAt : options.expiresAt.getTime(),\n is_public: options.isPublic,\n ...(type === \"user\" ? { user_id: userIdOrTeamId } : { team_id: userIdOrTeamId }),\n };\n}\n\n\nexport type ApiKeyUpdateOptions<Type extends ApiKeyType = ApiKeyType> = {\n description?: string,\n expiresAt?: Date | null,\n revoked?: boolean,\n};\nexport function apiKeyUpdateOptionsToCrud(type: \"user\", options: ApiKeyUpdateOptions<\"user\">): Promise<UserApiKeysCrud[\"Client\"][\"Update\"]>;\nexport function apiKeyUpdateOptionsToCrud(type: \"team\", options: ApiKeyUpdateOptions<\"team\">): Promise<TeamApiKeysCrud[\"Client\"][\"Update\"]>;\nexport function apiKeyUpdateOptionsToCrud(type: ApiKeyType, options: ApiKeyUpdateOptions): Promise<UserApiKeysCrud[\"Client\"][\"Update\"] | TeamApiKeysCrud[\"Client\"][\"Update\"]>;\nexport async function apiKeyUpdateOptionsToCrud(type: ApiKeyType, options: ApiKeyUpdateOptions): Promise<UserApiKeysCrud[\"Client\"][\"Update\"] | TeamApiKeysCrud[\"Client\"][\"Update\"]> {\n return filterUndefined({\n description: options.description,\n expires_at_millis: options.expiresAt == null ? options.expiresAt : options.expiresAt.getTime(),\n revoked: options.revoked,\n });\n}\n"],"mappings":";;;;;AAgDA,eAAsB,4BAA4B,MAAkB,gBAAwB,SAAkJ;AAC5O,QAAO;EACL,aAAa,QAAQ;EACrB,mBAAmB,QAAQ,aAAa,OAAO,QAAQ,YAAY,QAAQ,UAAU,SAAS;EAC9F,WAAW,QAAQ;EACnB,GAAI,SAAS,SAAS,EAAE,SAAS,gBAAgB,GAAG,EAAE,SAAS,gBAAgB;EAChF;;AAYH,eAAsB,0BAA0B,MAAkB,SAAkH;AAClL,iEAAuB;EACrB,aAAa,QAAQ;EACrB,mBAAmB,QAAQ,aAAa,OAAO,QAAQ,YAAY,QAAQ,UAAU,SAAS;EAC9F,SAAS,QAAQ;EAClB,CAAC"}
|
|
@@ -10,17 +10,17 @@ import { StackClientApp } from "../interfaces/client-app.js";
|
|
|
10
10
|
import { AdminEmailTemplate } from "../../email-templates/index.js";
|
|
11
11
|
import { _StackServerAppImplIncomplete } from "./server-app-impl.js";
|
|
12
12
|
import { HexclaveAdminInterface } from "@hexclave/shared";
|
|
13
|
-
import * as
|
|
13
|
+
import * as _hexclave_shared_dist_interface_crud_current_user0 from "@hexclave/shared/dist/interface/crud/current-user";
|
|
14
14
|
import { Result } from "@hexclave/shared/dist/utils/results";
|
|
15
|
-
import * as
|
|
16
|
-
import * as
|
|
15
|
+
import * as _hexclave_shared_dist_interface_handler_urls0 from "@hexclave/shared/dist/interface/handler-urls";
|
|
16
|
+
import * as _hexclave_shared_dist_interface_client_interface0 from "@hexclave/shared/dist/interface/client-interface";
|
|
17
17
|
import { RestrictedReason } from "@hexclave/shared/dist/schema-fields";
|
|
18
18
|
import { ProjectsCrud } from "@hexclave/shared/dist/interface/crud/projects";
|
|
19
19
|
import { CompleteConfig } from "@hexclave/shared/dist/config/schema";
|
|
20
20
|
import { AnalyticsQueryOptions, AnalyticsQueryResponse } from "@hexclave/shared/dist/interface/crud/analytics";
|
|
21
21
|
import { AdminGetSessionReplayChunkEventsResponse } from "@hexclave/shared/dist/interface/crud/session-replays";
|
|
22
22
|
import { Transaction, TransactionType } from "@hexclave/shared/dist/interface/crud/transactions";
|
|
23
|
-
import * as
|
|
23
|
+
import * as _hexclave_shared_dist_sessions0 from "@hexclave/shared/dist/sessions";
|
|
24
24
|
import { MoneyAmount } from "@hexclave/shared/dist/utils/currency-constants";
|
|
25
25
|
import { InternalApiKeyCreateCrudResponse } from "@hexclave/shared/dist/interface/admin-interface";
|
|
26
26
|
import { InternalApiKeysCrud } from "@hexclave/shared/dist/interface/crud/internal-api-keys";
|
|
@@ -109,7 +109,7 @@ declare class _StackAdminAppImplIncomplete<HasTokenStore extends boolean, Projec
|
|
|
109
109
|
extraRequestHeaders?: Record<string, string>;
|
|
110
110
|
projectId?: ProjectId | undefined;
|
|
111
111
|
publishableClientKey?: string;
|
|
112
|
-
urls?:
|
|
112
|
+
urls?: _hexclave_shared_dist_interface_handler_urls0.HandlerUrlOptions;
|
|
113
113
|
oauthScopesOnSignIn?: Partial<OAuthScopesOnSignIn>;
|
|
114
114
|
tokenStore?: TokenStoreInit<HasTokenStore> | undefined;
|
|
115
115
|
redirectMethod?: RedirectMethod;
|
|
@@ -128,7 +128,7 @@ declare class _StackAdminAppImplIncomplete<HasTokenStore extends boolean, Projec
|
|
|
128
128
|
} & {
|
|
129
129
|
uniqueIdentifier: string;
|
|
130
130
|
};
|
|
131
|
-
setCurrentUser: (userJsonPromise: Promise<
|
|
131
|
+
setCurrentUser: (userJsonPromise: Promise<_hexclave_shared_dist_interface_crud_current_user0.CurrentUserCrud["Client"]["Read"] | null>) => void;
|
|
132
132
|
getConstructorOptions: () => {
|
|
133
133
|
baseUrl?: string | {
|
|
134
134
|
browser: string;
|
|
@@ -137,7 +137,7 @@ declare class _StackAdminAppImplIncomplete<HasTokenStore extends boolean, Projec
|
|
|
137
137
|
extraRequestHeaders?: Record<string, string>;
|
|
138
138
|
projectId?: ProjectId | undefined;
|
|
139
139
|
publishableClientKey?: string;
|
|
140
|
-
urls?:
|
|
140
|
+
urls?: _hexclave_shared_dist_interface_handler_urls0.HandlerUrlOptions;
|
|
141
141
|
oauthScopesOnSignIn?: Partial<OAuthScopesOnSignIn>;
|
|
142
142
|
tokenStore?: TokenStoreInit<HasTokenStore> | undefined;
|
|
143
143
|
redirectMethod?: RedirectMethod;
|
|
@@ -160,18 +160,18 @@ declare class _StackAdminAppImplIncomplete<HasTokenStore extends boolean, Projec
|
|
|
160
160
|
sendAnalyticsEventBatch: (body: string, options: {
|
|
161
161
|
keepalive: boolean;
|
|
162
162
|
}) => Promise<Result<Response, Error>>;
|
|
163
|
-
addRequestListener: (listener:
|
|
163
|
+
addRequestListener: (listener: _hexclave_shared_dist_interface_client_interface0.RequestListener) => () => void;
|
|
164
164
|
sendRequest: (path: string, requestOptions: RequestInit, requestType?: "client" | "server" | "admin") => Promise<Response & {
|
|
165
165
|
usedTokens: {
|
|
166
|
-
accessToken:
|
|
167
|
-
refreshToken:
|
|
166
|
+
accessToken: _hexclave_shared_dist_sessions0.AccessToken;
|
|
167
|
+
refreshToken: _hexclave_shared_dist_sessions0.RefreshToken | null;
|
|
168
168
|
} | null;
|
|
169
169
|
}>;
|
|
170
170
|
getRedirectMethod: () => RedirectMethod;
|
|
171
171
|
redirectToUrl: (url: string | URL, options?: {
|
|
172
172
|
replace?: boolean;
|
|
173
173
|
} | undefined) => Promise<void>;
|
|
174
|
-
redirectToHandler: (handlerName: keyof
|
|
174
|
+
redirectToHandler: (handlerName: keyof _hexclave_shared_dist_interface_handler_urls0.HandlerUrls, options?: RedirectToOptions) => Promise<void>;
|
|
175
175
|
refreshOwnedProjects: () => Promise<void>;
|
|
176
176
|
signInWithTokens: (tokens: {
|
|
177
177
|
accessToken: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-app-impl.d.ts","names":[],"sources":["../../../../../src/lib/stack-app/apps/implementations/admin-app-impl.ts"],"mappings":";;;;;;;;;;;;;;;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
|
2
2
|
const require_chunk = require('../../../../chunk-BE-pF4vm.js');
|
|
3
|
-
let
|
|
4
|
-
let
|
|
5
|
-
let
|
|
3
|
+
let _hexclave_shared_dist_utils_errors = require("@hexclave/shared/dist/utils/errors");
|
|
4
|
+
let _hexclave_shared = require("@hexclave/shared");
|
|
5
|
+
let _hexclave_shared_dist_utils_results = require("@hexclave/shared/dist/utils/results");
|
|
6
6
|
let __common_js = require("./common.js");
|
|
7
|
-
let
|
|
8
|
-
let
|
|
7
|
+
let _hexclave_shared_dist_utils_objects = require("@hexclave/shared/dist/utils/objects");
|
|
8
|
+
let _hexclave_shared_dist_helpers_production_mode = require("@hexclave/shared/dist/helpers/production-mode");
|
|
9
9
|
let ______common_js = require("../../common.js");
|
|
10
10
|
let ______internal_api_keys_index_js = require("../../internal-api-keys/index.js");
|
|
11
11
|
let ______permissions_index_js = require("../../permissions/index.js");
|
|
@@ -51,7 +51,7 @@ var _StackAdminAppImplIncomplete = class extends __server_app_impl_js._StackServ
|
|
|
51
51
|
...extraOptions,
|
|
52
52
|
interface: extraOptions?.interface ?? (() => {
|
|
53
53
|
const apiUrls = (0, __common_js.resolveApiUrls)(resolvedOptions.baseUrl);
|
|
54
|
-
return new
|
|
54
|
+
return new _hexclave_shared.HexclaveAdminInterface({
|
|
55
55
|
getBaseUrl: () => apiUrls()[0],
|
|
56
56
|
getApiUrls: apiUrls,
|
|
57
57
|
projectId: resolvedOptions.projectId ?? (0, __common_js.getDefaultProjectId)(),
|
|
@@ -144,14 +144,14 @@ var _StackAdminAppImplIncomplete = class extends __server_app_impl_js._StackServ
|
|
|
144
144
|
return JSON.parse(data.config_string);
|
|
145
145
|
}
|
|
146
146
|
_adminOwnedProjectFromCrud(data, onRefresh) {
|
|
147
|
-
if (this._tokenStoreInit !== null) throw new
|
|
147
|
+
if (this._tokenStoreInit !== null) throw new _hexclave_shared_dist_utils_errors.HexclaveAssertionError("Owned apps must always have tokenStore === null — did you not create this project with app._createOwnedApp()?");
|
|
148
148
|
return {
|
|
149
149
|
...this._adminProjectFromCrud(data, onRefresh),
|
|
150
150
|
app: this
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
153
|
_adminProjectFromCrud(data, onRefresh) {
|
|
154
|
-
if (data.id !== this.projectId) throw new
|
|
154
|
+
if (data.id !== this.projectId) throw new _hexclave_shared_dist_utils_errors.HexclaveAssertionError(`The project ID of the provided project JSON (${data.id}) does not match the project ID of the app (${this.projectId})!`);
|
|
155
155
|
const app = this;
|
|
156
156
|
return {
|
|
157
157
|
id: data.id,
|
|
@@ -183,20 +183,20 @@ var _StackAdminAppImplIncomplete = class extends __server_app_impl_js._StackServ
|
|
|
183
183
|
} : {
|
|
184
184
|
id: p.id,
|
|
185
185
|
type: "standard",
|
|
186
|
-
clientId: p.client_id ?? (0,
|
|
187
|
-
clientSecret: p.client_secret ?? (0,
|
|
186
|
+
clientId: p.client_id ?? (0, _hexclave_shared_dist_utils_errors.throwErr)("Client ID is missing"),
|
|
187
|
+
clientSecret: p.client_secret ?? (0, _hexclave_shared_dist_utils_errors.throwErr)("Client secret is missing"),
|
|
188
188
|
facebookConfigId: p.facebook_config_id,
|
|
189
189
|
microsoftTenantId: p.microsoft_tenant_id,
|
|
190
190
|
appleBundleIds: p.apple_bundle_ids
|
|
191
191
|
}),
|
|
192
192
|
emailConfig: data.config.email_config.type === "shared" ? { type: "shared" } : {
|
|
193
193
|
type: "standard",
|
|
194
|
-
host: data.config.email_config.host ?? (0,
|
|
195
|
-
port: data.config.email_config.port ?? (0,
|
|
196
|
-
username: data.config.email_config.username ?? (0,
|
|
197
|
-
password: data.config.email_config.password ?? (0,
|
|
198
|
-
senderName: data.config.email_config.sender_name ?? (0,
|
|
199
|
-
senderEmail: data.config.email_config.sender_email ?? (0,
|
|
194
|
+
host: data.config.email_config.host ?? (0, _hexclave_shared_dist_utils_errors.throwErr)("Email host is missing"),
|
|
195
|
+
port: data.config.email_config.port ?? (0, _hexclave_shared_dist_utils_errors.throwErr)("Email port is missing"),
|
|
196
|
+
username: data.config.email_config.username ?? (0, _hexclave_shared_dist_utils_errors.throwErr)("Email username is missing"),
|
|
197
|
+
password: data.config.email_config.password ?? (0, _hexclave_shared_dist_utils_errors.throwErr)("Email password is missing"),
|
|
198
|
+
senderName: data.config.email_config.sender_name ?? (0, _hexclave_shared_dist_utils_errors.throwErr)("Email sender name is missing"),
|
|
199
|
+
senderEmail: data.config.email_config.sender_email ?? (0, _hexclave_shared_dist_utils_errors.throwErr)("Email sender email is missing")
|
|
200
200
|
},
|
|
201
201
|
emailTheme: data.config.email_theme,
|
|
202
202
|
domains: data.config.domains.map((d) => ({
|
|
@@ -248,8 +248,8 @@ var _StackAdminAppImplIncomplete = class extends __server_app_impl_js._StackServ
|
|
|
248
248
|
async update(update) {
|
|
249
249
|
const { requirePublishableClientKey, ...projectUpdate } = update;
|
|
250
250
|
const updateOptions = (0, ______projects_index_js.adminProjectUpdateOptionsToCrud)(projectUpdate);
|
|
251
|
-
const hasConfigUpdate = !!updateOptions.config && (0,
|
|
252
|
-
if ((0,
|
|
251
|
+
const hasConfigUpdate = !!updateOptions.config && (0, _hexclave_shared_dist_utils_objects.typedValues)(updateOptions.config).some((value) => value !== void 0);
|
|
252
|
+
if ((0, _hexclave_shared_dist_utils_objects.typedEntries)(updateOptions).some(([key, value]) => {
|
|
253
253
|
if (key === "config") return hasConfigUpdate;
|
|
254
254
|
return value !== void 0;
|
|
255
255
|
})) {
|
|
@@ -265,7 +265,7 @@ var _StackAdminAppImplIncomplete = class extends __server_app_impl_js._StackServ
|
|
|
265
265
|
await app._interface.deleteProject();
|
|
266
266
|
},
|
|
267
267
|
async getProductionModeErrors() {
|
|
268
|
-
return (0,
|
|
268
|
+
return (0, _hexclave_shared_dist_helpers_production_mode.getProductionModeErrors)(data);
|
|
269
269
|
}
|
|
270
270
|
};
|
|
271
271
|
}
|
|
@@ -278,7 +278,7 @@ var _StackAdminAppImplIncomplete = class extends __server_app_impl_js._StackServ
|
|
|
278
278
|
};
|
|
279
279
|
}
|
|
280
280
|
async getProject() {
|
|
281
|
-
return this._adminProjectFromCrud(
|
|
281
|
+
return this._adminProjectFromCrud(_hexclave_shared_dist_utils_results.Result.orThrow(await this._adminProjectCache.getOrWait([], "write-only")), () => this._refreshProject());
|
|
282
282
|
}
|
|
283
283
|
_createInternalApiKeyBaseFromCrud(data) {
|
|
284
284
|
const app = this;
|
|
@@ -320,7 +320,7 @@ var _StackAdminAppImplIncomplete = class extends __server_app_impl_js._StackServ
|
|
|
320
320
|
};
|
|
321
321
|
}
|
|
322
322
|
async listInternalApiKeys() {
|
|
323
|
-
return
|
|
323
|
+
return _hexclave_shared_dist_utils_results.Result.orThrow(await this._internalApiKeysCache.getOrWait([], "write-only")).map((j) => this._createInternalApiKeyFromCrud(j));
|
|
324
324
|
}
|
|
325
325
|
async createInternalApiKey(options) {
|
|
326
326
|
const crud = await this._interface.createInternalApiKey((0, ______internal_api_keys_index_js.internalApiKeyCreateOptionsToCrud)(options));
|
|
@@ -328,13 +328,13 @@ var _StackAdminAppImplIncomplete = class extends __server_app_impl_js._StackServ
|
|
|
328
328
|
return this._createInternalApiKeyFirstViewFromCrud(crud);
|
|
329
329
|
}
|
|
330
330
|
async listEmailThemes() {
|
|
331
|
-
return
|
|
331
|
+
return _hexclave_shared_dist_utils_results.Result.orThrow(await this._adminEmailThemesCache.getOrWait([], "write-only")).map((theme) => ({
|
|
332
332
|
id: theme.id,
|
|
333
333
|
displayName: theme.display_name
|
|
334
334
|
}));
|
|
335
335
|
}
|
|
336
336
|
async listEmailTemplates() {
|
|
337
|
-
return
|
|
337
|
+
return _hexclave_shared_dist_utils_results.Result.orThrow(await this._adminEmailTemplatesCache.getOrWait([], "write-only")).map((template) => ({
|
|
338
338
|
id: template.id,
|
|
339
339
|
displayName: template.display_name,
|
|
340
340
|
themeId: template.theme_id,
|
|
@@ -342,7 +342,7 @@ var _StackAdminAppImplIncomplete = class extends __server_app_impl_js._StackServ
|
|
|
342
342
|
}));
|
|
343
343
|
}
|
|
344
344
|
async listEmailDrafts() {
|
|
345
|
-
return
|
|
345
|
+
return _hexclave_shared_dist_utils_results.Result.orThrow(await this._adminEmailDraftsCache.getOrWait([], "write-only")).map((draft) => ({
|
|
346
346
|
id: draft.id,
|
|
347
347
|
displayName: draft.display_name,
|
|
348
348
|
themeId: draft.theme_id,
|
|
@@ -364,7 +364,7 @@ var _StackAdminAppImplIncomplete = class extends __server_app_impl_js._StackServ
|
|
|
364
364
|
await this._adminTeamPermissionDefinitionsCache.refresh([]);
|
|
365
365
|
}
|
|
366
366
|
async listTeamPermissionDefinitions() {
|
|
367
|
-
return
|
|
367
|
+
return _hexclave_shared_dist_utils_results.Result.orThrow(await this._adminTeamPermissionDefinitionsCache.getOrWait([], "write-only")).map((p) => this._serverTeamPermissionDefinitionFromCrud(p));
|
|
368
368
|
}
|
|
369
369
|
async listTeamPermissionDefinitionsPaginated(options) {
|
|
370
370
|
const result = await this._interface.listTeamPermissionDefinitionsPaginated(options);
|
|
@@ -387,7 +387,7 @@ var _StackAdminAppImplIncomplete = class extends __server_app_impl_js._StackServ
|
|
|
387
387
|
await this._adminProjectPermissionDefinitionsCache.refresh([]);
|
|
388
388
|
}
|
|
389
389
|
async listProjectPermissionDefinitions() {
|
|
390
|
-
return
|
|
390
|
+
return _hexclave_shared_dist_utils_results.Result.orThrow(await this._adminProjectPermissionDefinitionsCache.getOrWait([], "write-only")).map((p) => this._serverProjectPermissionDefinitionFromCrud(p));
|
|
391
391
|
}
|
|
392
392
|
async _refreshProject() {
|
|
393
393
|
await Promise.all([super._refreshProject(), this._adminProjectCache.refresh([])]);
|
|
@@ -415,7 +415,7 @@ var _StackAdminAppImplIncomplete = class extends __server_app_impl_js._StackServ
|
|
|
415
415
|
response = await this._interface.sendTestEmail({
|
|
416
416
|
recipient_email: options.recipientEmail,
|
|
417
417
|
email_config: {
|
|
418
|
-
...(0,
|
|
418
|
+
...(0, _hexclave_shared_dist_utils_objects.pick)(options.emailConfig, [
|
|
419
419
|
"host",
|
|
420
420
|
"port",
|
|
421
421
|
"username",
|
|
@@ -426,16 +426,16 @@ var _StackAdminAppImplIncomplete = class extends __server_app_impl_js._StackServ
|
|
|
426
426
|
}
|
|
427
427
|
});
|
|
428
428
|
} catch (error) {
|
|
429
|
-
if (error instanceof
|
|
429
|
+
if (error instanceof _hexclave_shared.KnownErrors.ItemQuantityInsufficientAmount) return _hexclave_shared_dist_utils_results.Result.error({ errorMessage: "Monthly email sending limit exceeded for your plan. Please upgrade your plan or wait until next month before sending more test emails." });
|
|
430
430
|
throw error;
|
|
431
431
|
}
|
|
432
|
-
if (response.success) return
|
|
433
|
-
else return
|
|
432
|
+
if (response.success) return _hexclave_shared_dist_utils_results.Result.ok(void 0);
|
|
433
|
+
else return _hexclave_shared_dist_utils_results.Result.error({ errorMessage: response.error_message ?? (0, _hexclave_shared_dist_utils_errors.throwErr)("Email test error not specified") });
|
|
434
434
|
}
|
|
435
435
|
async sendTestWebhook(options) {
|
|
436
436
|
const response = await this._interface.sendTestWebhook({ endpoint_id: options.endpointId });
|
|
437
|
-
if (response.success) return
|
|
438
|
-
else return
|
|
437
|
+
if (response.success) return _hexclave_shared_dist_utils_results.Result.ok(void 0);
|
|
438
|
+
else return _hexclave_shared_dist_utils_results.Result.error({ errorMessage: response.error_message ?? (0, _hexclave_shared_dist_utils_errors.throwErr)("Webhook test error not specified") });
|
|
439
439
|
}
|
|
440
440
|
async listSentEmails() {
|
|
441
441
|
return (await this._interface.listSentEmails()).items.map((email) => ({
|
|
@@ -516,7 +516,7 @@ var _StackAdminAppImplIncomplete = class extends __server_app_impl_js._StackServ
|
|
|
516
516
|
async deleteEmailDraft(id) {
|
|
517
517
|
await this._interface.deleteEmailDraft(id);
|
|
518
518
|
const current = this._adminEmailDraftsCache.getIfCached([]);
|
|
519
|
-
if (current.status === "ok" && current.data.status === "ok") this._adminEmailDraftsCache.forceSetCachedValue([],
|
|
519
|
+
if (current.status === "ok" && current.data.status === "ok") this._adminEmailDraftsCache.forceSetCachedValue([], _hexclave_shared_dist_utils_results.Result.ok(current.data.data.filter((d) => d.id !== id)));
|
|
520
520
|
await this._adminEmailDraftsCache.refresh([]);
|
|
521
521
|
}
|
|
522
522
|
async refreshEmailDrafts() {
|
|
@@ -566,7 +566,9 @@ var _StackAdminAppImplIncomplete = class extends __server_app_impl_js._StackServ
|
|
|
566
566
|
return { renderedHtml: result.rendered_html };
|
|
567
567
|
}
|
|
568
568
|
async setupPayments() {
|
|
569
|
-
|
|
569
|
+
const result = await this._interface.setupPayments();
|
|
570
|
+
await this._stripeAccountInfoCache.refresh([]);
|
|
571
|
+
return result;
|
|
570
572
|
}
|
|
571
573
|
async createStripeWidgetAccountSession() {
|
|
572
574
|
return await this._interface.createStripeWidgetAccountSession();
|
|
@@ -600,7 +602,7 @@ var _StackAdminAppImplIncomplete = class extends __server_app_impl_js._StackServ
|
|
|
600
602
|
return { refundTransactionId: result.refundTransactionId };
|
|
601
603
|
}
|
|
602
604
|
async listTransactions(params) {
|
|
603
|
-
return
|
|
605
|
+
return _hexclave_shared_dist_utils_results.Result.orThrow(await this._transactionsCache.getOrWait([
|
|
604
606
|
params.cursor,
|
|
605
607
|
params.limit,
|
|
606
608
|
params.type,
|
|
@@ -777,7 +779,7 @@ var _StackAdminAppImplIncomplete = class extends __server_app_impl_js._StackServ
|
|
|
777
779
|
markedAsSpamAt: new Date(crud.marked_as_spam_at_millis),
|
|
778
780
|
canHaveDeliveryInfo: true
|
|
779
781
|
};
|
|
780
|
-
default: throw new
|
|
782
|
+
default: throw new _hexclave_shared_dist_utils_errors.HexclaveAssertionError(`Unknown email outbox status: ${crud.status}`, { status: crud.status });
|
|
781
783
|
}
|
|
782
784
|
})();
|
|
783
785
|
}
|