@crossmint/cli 1.1.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 +111 -0
- package/build-pkg.js +13 -0
- package/dist/bin/crossmint.d.ts +3 -0
- package/dist/bin/crossmint.d.ts.map +1 -0
- package/dist/bin/crossmint.js +18 -0
- package/dist/commands/keys/create.d.ts +2 -0
- package/dist/commands/keys/create.d.ts.map +1 -0
- package/dist/commands/keys/create.js +2 -0
- package/dist/commands/keys/create.test.d.ts +2 -0
- package/dist/commands/keys/create.test.d.ts.map +1 -0
- package/dist/commands/keys/delete.d.ts +2 -0
- package/dist/commands/keys/delete.d.ts.map +1 -0
- package/dist/commands/keys/delete.js +1 -0
- package/dist/commands/keys/delete.test.d.ts +2 -0
- package/dist/commands/keys/delete.test.d.ts.map +1 -0
- package/dist/commands/keys/edit.d.ts +2 -0
- package/dist/commands/keys/edit.d.ts.map +1 -0
- package/dist/commands/keys/edit.js +2 -0
- package/dist/commands/keys/edit.test.d.ts +2 -0
- package/dist/commands/keys/edit.test.d.ts.map +1 -0
- package/dist/commands/keys/index.d.ts +5 -0
- package/dist/commands/keys/index.d.ts.map +1 -0
- package/dist/commands/keys/index.js +11 -0
- package/dist/commands/keys/list.d.ts +3 -0
- package/dist/commands/keys/list.d.ts.map +1 -0
- package/dist/commands/keys/list.js +10 -0
- package/dist/commands/keys/list.test.d.ts +2 -0
- package/dist/commands/keys/list.test.d.ts.map +1 -0
- package/dist/commands/login.d.ts +2 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +1 -0
- package/dist/commands/login.test.d.ts +2 -0
- package/dist/commands/login.test.d.ts.map +1 -0
- package/dist/commands/logout.d.ts +2 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/logout.js +1 -0
- package/dist/commands/projects/create.d.ts +6 -0
- package/dist/commands/projects/create.d.ts.map +1 -0
- package/dist/commands/projects/create.js +6 -0
- package/dist/commands/projects/create.test.d.ts +2 -0
- package/dist/commands/projects/create.test.d.ts.map +1 -0
- package/dist/commands/projects/details.d.ts +2 -0
- package/dist/commands/projects/details.d.ts.map +1 -0
- package/dist/commands/projects/details.js +2 -0
- package/dist/commands/projects/details.test.d.ts +2 -0
- package/dist/commands/projects/details.test.d.ts.map +1 -0
- package/dist/commands/projects/index.d.ts +4 -0
- package/dist/commands/projects/index.d.ts.map +1 -0
- package/dist/commands/projects/index.js +7 -0
- package/dist/commands/projects/select.d.ts +2 -0
- package/dist/commands/projects/select.d.ts.map +1 -0
- package/dist/commands/projects/select.js +1 -0
- package/dist/commands/projects/select.test.d.ts +2 -0
- package/dist/commands/projects/select.test.d.ts.map +1 -0
- package/dist/commands/whoami.d.ts +2 -0
- package/dist/commands/whoami.d.ts.map +1 -0
- package/dist/commands/whoami.js +1 -0
- package/dist/types/keys.d.ts +11 -0
- package/dist/types/keys.d.ts.map +1 -0
- package/dist/types/keys.js +0 -0
- package/dist/utils/Pager.d.ts +9 -0
- package/dist/utils/Pager.d.ts.map +1 -0
- package/dist/utils/Pager.js +2 -0
- package/dist/utils/Pager.test.d.ts +2 -0
- package/dist/utils/Pager.test.d.ts.map +1 -0
- package/dist/utils/fetch.d.ts +5 -0
- package/dist/utils/fetch.d.ts.map +1 -0
- package/dist/utils/fetch.js +1 -0
- package/dist/utils/getProject.d.ts +4 -0
- package/dist/utils/getProject.d.ts.map +1 -0
- package/dist/utils/getProject.js +1 -0
- package/dist/utils/getWhitelistedOriginsAndAppIdentifiersPrompt.d.ts +6 -0
- package/dist/utils/getWhitelistedOriginsAndAppIdentifiersPrompt.d.ts.map +1 -0
- package/dist/utils/getWhitelistedOriginsAndAppIdentifiersPrompt.js +2 -0
- package/dist/utils/keytar.d.ts +4 -0
- package/dist/utils/keytar.d.ts.map +1 -0
- package/dist/utils/keytar.js +1 -0
- package/dist/utils/oauth/codeChallenge.d.ts +3 -0
- package/dist/utils/oauth/codeChallenge.d.ts.map +1 -0
- package/dist/utils/oauth/codeChallenge.js +1 -0
- package/dist/utils/oauth/getStytchConfig.d.ts +6 -0
- package/dist/utils/oauth/getStytchConfig.d.ts.map +1 -0
- package/dist/utils/oauth/getStytchConfig.js +1 -0
- package/dist/utils/oauth/server.d.ts +3 -0
- package/dist/utils/oauth/server.d.ts.map +1 -0
- package/dist/utils/oauth/server.js +1 -0
- package/dist/utils/scopes.d.ts +14 -0
- package/dist/utils/scopes.d.ts.map +1 -0
- package/dist/utils/scopes.js +1 -0
- package/dist/utils/spinner.d.ts +6 -0
- package/dist/utils/spinner.d.ts.map +1 -0
- package/dist/utils/spinner.js +1 -0
- package/dist/utils/store.d.ts +11 -0
- package/dist/utils/store.d.ts.map +1 -0
- package/dist/utils/store.js +1 -0
- package/dist/utils/urls.d.ts +9 -0
- package/dist/utils/urls.d.ts.map +1 -0
- package/dist/utils/urls.js +1 -0
- package/package.json +50 -0
- package/shims/prelude.js +33 -0
- package/src/bin/crossmint.ts +34 -0
- package/src/commands/keys/create.test.ts +230 -0
- package/src/commands/keys/create.ts +96 -0
- package/src/commands/keys/delete.test.ts +87 -0
- package/src/commands/keys/delete.ts +36 -0
- package/src/commands/keys/edit.test.ts +159 -0
- package/src/commands/keys/edit.ts +98 -0
- package/src/commands/keys/index.ts +4 -0
- package/src/commands/keys/list.test.ts +123 -0
- package/src/commands/keys/list.ts +83 -0
- package/src/commands/login.test.ts +87 -0
- package/src/commands/login.ts +59 -0
- package/src/commands/logout.ts +9 -0
- package/src/commands/projects/create.test.ts +82 -0
- package/src/commands/projects/create.ts +45 -0
- package/src/commands/projects/details.test.ts +64 -0
- package/src/commands/projects/details.ts +36 -0
- package/src/commands/projects/index.ts +3 -0
- package/src/commands/projects/select.test.ts +86 -0
- package/src/commands/projects/select.ts +50 -0
- package/src/commands/whoami.ts +19 -0
- package/src/types/keys.ts +13 -0
- package/src/utils/Pager.test.ts +70 -0
- package/src/utils/Pager.ts +34 -0
- package/src/utils/fetch.ts +63 -0
- package/src/utils/getProject.ts +10 -0
- package/src/utils/getWhitelistedOriginsAndAppIdentifiersPrompt.ts +52 -0
- package/src/utils/keytar.ts +15 -0
- package/src/utils/oauth/codeChallenge.ts +18 -0
- package/src/utils/oauth/getStytchConfig.ts +28 -0
- package/src/utils/oauth/server.ts +66 -0
- package/src/utils/scopes.ts +66 -0
- package/src/utils/spinner.ts +20 -0
- package/src/utils/store.ts +38 -0
- package/src/utils/urls.ts +11 -0
- package/tsconfig.json +35 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/tsup.config.ts +11 -0
- package/vitest.config.ts +9 -0
- package/vitest.setup.ts +8 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { input } from "@inquirer/prompts";
|
|
2
|
+
import { ClientPlatform } from "@/types/keys";
|
|
3
|
+
|
|
4
|
+
function isValidUrl(url: string) {
|
|
5
|
+
try {
|
|
6
|
+
new URL(url);
|
|
7
|
+
return true;
|
|
8
|
+
} catch (e) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export async function getWhitelistedOriginsAndAppIdentifiersPrompt(clientPlatform: ClientPlatform, values?: string[]) {
|
|
14
|
+
const whitelistedOrigins: string[] = [];
|
|
15
|
+
const whitelistedAppIdentifiers: string[] = [];
|
|
16
|
+
|
|
17
|
+
const instructions = values ? "\nPress [tab] to edit or [enter] to confirm current value" : "";
|
|
18
|
+
|
|
19
|
+
if (clientPlatform === "web") {
|
|
20
|
+
const domains = await input({
|
|
21
|
+
default: values?.join(","),
|
|
22
|
+
message: `Enter whitelisted domain or localhost (e.g., https://www.yourdomain.com) (separate multiple domains with a comma):${instructions}`,
|
|
23
|
+
validate: (input) => {
|
|
24
|
+
const domains = input.split(",");
|
|
25
|
+
for (const domain of domains) {
|
|
26
|
+
if (!isValidUrl(domain)) {
|
|
27
|
+
return `Invalid domain: ${domain}. Please enter a valid URL (e.g., https://www.yourdomain.com)`;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return true;
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
whitelistedOrigins.push(...domains.split(",").map((domain) => domain.trim()));
|
|
34
|
+
} else if (clientPlatform === "mobile") {
|
|
35
|
+
const appIdentifiers = await input({
|
|
36
|
+
default: values?.join(","),
|
|
37
|
+
message: `Enter iOS bundle ID or Android package name (e.g., com.company.appname) (separate multiple domains with a comma):${instructions}`,
|
|
38
|
+
validate: (input) => {
|
|
39
|
+
const appIdentifiers = input.split(",");
|
|
40
|
+
for (const appIdentifier of appIdentifiers) {
|
|
41
|
+
if (appIdentifier.trim().length === 0) {
|
|
42
|
+
return "App identifier cannot be empty";
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
whitelistedAppIdentifiers.push(...appIdentifiers.split(",").map((identifier) => identifier.trim()));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return { whitelistedOrigins, whitelistedAppIdentifiers };
|
|
52
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import keytar from "keytar";
|
|
2
|
+
|
|
3
|
+
const SERVICE_NAME = process.env.NODE_ENV === "development" ? "crossmint-cli-dev" : "crossmint-cli";
|
|
4
|
+
|
|
5
|
+
export async function set(property: string, value: string) {
|
|
6
|
+
return keytar.setPassword(SERVICE_NAME, property, value);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export async function get(property: string) {
|
|
10
|
+
return keytar.getPassword(SERVICE_NAME, property);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export async function del(property: string) {
|
|
14
|
+
return keytar.deletePassword(SERVICE_NAME, property);
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import crypto from "crypto";
|
|
2
|
+
import * as storage from "../keytar";
|
|
3
|
+
|
|
4
|
+
export async function generateCodeChallenge(): Promise<string> {
|
|
5
|
+
const buffer = crypto.randomBytes(32);
|
|
6
|
+
const codeVerifier = buffer.toString("base64url");
|
|
7
|
+
|
|
8
|
+
const hash = crypto.createHash("sha256").update(codeVerifier).digest();
|
|
9
|
+
const codeChallenge = hash.toString("base64url");
|
|
10
|
+
|
|
11
|
+
await storage.set("pkceCodeVerifier", codeVerifier);
|
|
12
|
+
|
|
13
|
+
return codeChallenge;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export async function getCodeVerifier(): Promise<string | null> {
|
|
17
|
+
return await storage.get("pkceCodeVerifier");
|
|
18
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { getEnvironment } from "../store";
|
|
2
|
+
|
|
3
|
+
export async function getStytchConfig() {
|
|
4
|
+
const environment = await getEnvironment();
|
|
5
|
+
if (!environment) {
|
|
6
|
+
console.error("❌ Environment not found");
|
|
7
|
+
process.exit(1);
|
|
8
|
+
}
|
|
9
|
+
if (environment === "local") {
|
|
10
|
+
return {
|
|
11
|
+
uri: "test.stytch.com",
|
|
12
|
+
projectId: "project-test-8eb55d3d-949f-4e0f-aea6-c9ba740f7813",
|
|
13
|
+
clientId: "connected-app-test-4d27d6d8-3491-45c8-9bb0-b05f89cb7a1a",
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
if (environment === "staging") {
|
|
17
|
+
return {
|
|
18
|
+
uri: "api.stytch.com",
|
|
19
|
+
projectId: "project-live-b7c564af-0c0d-4662-bfc0-72bed1049cfe",
|
|
20
|
+
clientId: "connected-app-live-47cd5bf1-c155-42c1-9f36-5d35853b34a7",
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
uri: "api.stytch.com",
|
|
25
|
+
projectId: "project-live-7a1cb98d-b8b7-4471-aaf6-f8af67a0df94",
|
|
26
|
+
clientId: "connected-app-live-a72edd7e-6ff3-4002-a13a-e7ca66354bd1",
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import http from "http";
|
|
2
|
+
import { Environment, getCrossmintUrl } from "../urls";
|
|
3
|
+
import { getCodeVerifier } from "./codeChallenge";
|
|
4
|
+
import { setSessionToken } from "../store";
|
|
5
|
+
import { fetchJSON, fetchUnauthenticated } from "../fetch";
|
|
6
|
+
import { HttpMethods } from "@crossmint/common-consts";
|
|
7
|
+
import { routes } from "@crossmint/common-consts";
|
|
8
|
+
import { getStytchConfig } from "./getStytchConfig";
|
|
9
|
+
|
|
10
|
+
export default async function server(environment: Environment) {
|
|
11
|
+
return new Promise((resolve, reject) => {
|
|
12
|
+
const server = http.createServer(async (req, res) => {
|
|
13
|
+
try {
|
|
14
|
+
const url = new URL(req.url || "", `http://${req.headers.host}`);
|
|
15
|
+
const code = url.searchParams.get("code");
|
|
16
|
+
|
|
17
|
+
if (!code) {
|
|
18
|
+
res.writeHead(400, { "Content-Type": "text/plain" });
|
|
19
|
+
res.end("No code provided");
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const stytchConfig = await getStytchConfig();
|
|
24
|
+
|
|
25
|
+
// Exchange the code with Stytch's token endpoint
|
|
26
|
+
const tokenResponse = await fetchJSON(
|
|
27
|
+
`https://${stytchConfig.uri}/v1/public/${stytchConfig.projectId}/oauth2/token`,
|
|
28
|
+
HttpMethods.POST,
|
|
29
|
+
{
|
|
30
|
+
grant_type: "authorization_code",
|
|
31
|
+
code,
|
|
32
|
+
client_id: stytchConfig.clientId,
|
|
33
|
+
redirect_uri: "http://127.0.0.1:3456/callback",
|
|
34
|
+
code_verifier: await getCodeVerifier(),
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const sessionResponse = await fetchUnauthenticated(
|
|
39
|
+
routes.authentication.exchangeAccessToken,
|
|
40
|
+
HttpMethods.POST,
|
|
41
|
+
{
|
|
42
|
+
accessToken: tokenResponse.access_token,
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
await setSessionToken(sessionResponse.sessionToken);
|
|
47
|
+
|
|
48
|
+
res.writeHead(302, {
|
|
49
|
+
Location: `${getCrossmintUrl(environment)}${routes.console.authorizeDevice.success}`,
|
|
50
|
+
});
|
|
51
|
+
res.end();
|
|
52
|
+
|
|
53
|
+
server.close();
|
|
54
|
+
resolve(tokenResponse);
|
|
55
|
+
} catch (error) {
|
|
56
|
+
res.writeHead(500, { "Content-Type": "text/plain" });
|
|
57
|
+
res.end("Error during authentication");
|
|
58
|
+
server.close();
|
|
59
|
+
reject(error);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const port = 3456;
|
|
64
|
+
server.listen(port);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Separator } from "@inquirer/prompts";
|
|
2
|
+
import {
|
|
3
|
+
APIKeyScopeDetails,
|
|
4
|
+
APIKeyScopes,
|
|
5
|
+
APIKeyUsageOrigin,
|
|
6
|
+
CLIENT_API_KEY_PUBLIC_SCOPES,
|
|
7
|
+
SERVER_API_KEY_PUBLIC_SCOPES,
|
|
8
|
+
APIKeyCategories,
|
|
9
|
+
APIKeyCategoryNames,
|
|
10
|
+
} from "@crossmint/products-console-types";
|
|
11
|
+
import { Environment } from "./urls";
|
|
12
|
+
import { DeveloperProject } from "@crossmint/common-types";
|
|
13
|
+
import { PrimitiveProperties } from "@crossmint/data-dbs-types";
|
|
14
|
+
|
|
15
|
+
type ScopeChoice = {
|
|
16
|
+
name: string;
|
|
17
|
+
value: APIKeyScopes;
|
|
18
|
+
description: string;
|
|
19
|
+
checked: boolean;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
type ScopesByCategory = Record<APIKeyCategories, ScopeChoice[]>;
|
|
23
|
+
|
|
24
|
+
export function getScopeChoices(
|
|
25
|
+
keyType: APIKeyUsageOrigin,
|
|
26
|
+
enviornment: Environment,
|
|
27
|
+
activeProject: PrimitiveProperties<DeveloperProject>,
|
|
28
|
+
keyScopes: APIKeyScopes[] = []
|
|
29
|
+
) {
|
|
30
|
+
const scopesMap: APIKeyScopeDetails<APIKeyScopes>[] =
|
|
31
|
+
keyType === "server" ? SERVER_API_KEY_PUBLIC_SCOPES : CLIENT_API_KEY_PUBLIC_SCOPES;
|
|
32
|
+
|
|
33
|
+
const scopesByCategory = scopesMap.reduce<ScopesByCategory>((memo, item) => {
|
|
34
|
+
const { title, description, value, category } = item;
|
|
35
|
+
|
|
36
|
+
if (!memo[category]) {
|
|
37
|
+
memo[category] = [];
|
|
38
|
+
}
|
|
39
|
+
if (!isScopeDisabled(item, enviornment, activeProject)) {
|
|
40
|
+
memo[category].push({
|
|
41
|
+
name: `${title} (${value})`,
|
|
42
|
+
value,
|
|
43
|
+
description,
|
|
44
|
+
checked: keyScopes.includes(value),
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return memo;
|
|
48
|
+
}, {} as ScopesByCategory);
|
|
49
|
+
|
|
50
|
+
return Object.entries(scopesByCategory).flatMap(([category, scopes]) => {
|
|
51
|
+
return [new Separator(APIKeyCategoryNames[category as APIKeyCategories]), ...scopes];
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function isScopeDisabled(
|
|
56
|
+
scope: APIKeyScopeDetails<APIKeyScopes>,
|
|
57
|
+
enviornment: Environment,
|
|
58
|
+
activeProject: PrimitiveProperties<DeveloperProject>
|
|
59
|
+
) {
|
|
60
|
+
return (
|
|
61
|
+
enviornment === "production" &&
|
|
62
|
+
scope.projectPermission != null &&
|
|
63
|
+
activeProject?.addons != null &&
|
|
64
|
+
!activeProject.addons[scope.projectPermission]
|
|
65
|
+
);
|
|
66
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createSpinner as createNanoSpinner } from "nanospinner";
|
|
2
|
+
|
|
3
|
+
export function createSpinner(initialMessage?: string) {
|
|
4
|
+
const nanoSpinner = createNanoSpinner(initialMessage);
|
|
5
|
+
const spinner = {
|
|
6
|
+
start: (message?: string) => {
|
|
7
|
+
nanoSpinner.start({ text: message });
|
|
8
|
+
return spinner;
|
|
9
|
+
},
|
|
10
|
+
succeed: (message: string) => {
|
|
11
|
+
nanoSpinner.success({ text: message });
|
|
12
|
+
return spinner;
|
|
13
|
+
},
|
|
14
|
+
fail: (message: string) => {
|
|
15
|
+
nanoSpinner.error({ text: message });
|
|
16
|
+
return spinner;
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
return spinner;
|
|
20
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Environment } from "./urls";
|
|
2
|
+
import * as storage from "./keytar";
|
|
3
|
+
|
|
4
|
+
export function setEnvironment(environment: Environment) {
|
|
5
|
+
return storage.set("environment", environment);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export async function getEnvironment() {
|
|
9
|
+
return storage.get("environment") as Promise<Environment | null>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export async function deleteEnvironment() {
|
|
13
|
+
return storage.del("environment");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function setSessionToken(sessionToken: string) {
|
|
17
|
+
return storage.set("sessionToken", sessionToken);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export async function getSessionToken() {
|
|
21
|
+
return storage.get("sessionToken") as Promise<string | null>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export async function deleteSessionToken() {
|
|
25
|
+
return storage.del("sessionToken");
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function setProjectId(projectId: string) {
|
|
29
|
+
return storage.set("projectId", projectId);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export async function getProjectId() {
|
|
33
|
+
return storage.get("projectId") as Promise<string | null>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export async function deleteProjectId() {
|
|
37
|
+
return storage.del("projectId");
|
|
38
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const crossmintUrls = {
|
|
2
|
+
production: "https://www.crossmint.com",
|
|
3
|
+
staging: "https://staging.crossmint.com",
|
|
4
|
+
local: "http://localhost:3000",
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export type Environment = keyof typeof crossmintUrls;
|
|
8
|
+
|
|
9
|
+
export function getCrossmintUrl(environment: Environment) {
|
|
10
|
+
return crossmintUrls[environment];
|
|
11
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@crossmint/tsconfig/base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"composite": true,
|
|
5
|
+
"paths": {
|
|
6
|
+
"@/*": ["./src/*"]
|
|
7
|
+
},
|
|
8
|
+
"outDir": "dist",
|
|
9
|
+
"rootDir": "src"
|
|
10
|
+
},
|
|
11
|
+
"include": ["src"],
|
|
12
|
+
"references": [
|
|
13
|
+
{
|
|
14
|
+
"path": "../../libraries/common/consts"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"path": "../../libraries/common/string-utils"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"path": "../../libraries/common/types"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"path": "../../libraries/datasources/databases/types"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"path": "../../libraries/infra-configs/tsup"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"path": "../../libraries/infra-configs/vitest"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"path": "../../libraries/products/console/types"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|