@settlemint/sdk-utils
Advanced tools
Comparing version 0.4.34-prfcf304a to 0.5.0-main33853af
declare function ensureFolder(path: string): void; | ||
export { ensureFolder }; | ||
declare function projectRoot(): Promise<string>; | ||
export { ensureFolder, projectRoot }; |
import { z, ZodSchema } from 'zod'; | ||
import { DotenvParseOutput } from 'dotenv'; | ||
declare function ensureFolder(path: string): void; | ||
declare function getPackageManager(targetDir: string): Promise<"yarn" | "pnpm" | "bun" | "npm">; | ||
declare function ensureServer(): void; | ||
/** | ||
@@ -16,2 +11,56 @@ * Schema for validating access tokens. | ||
/** | ||
* Schema for validating access tokens. | ||
*/ | ||
declare const DotEnvSchema: z.ZodObject<{ | ||
SETTLEMINT_ENVIRONMENT: z.ZodString; | ||
SETTLEMINT_INSTANCE: z.ZodString; | ||
SETTLEMINT_ACCESS_TOKEN: z.ZodString; | ||
SETTLEMINT_WORKSPACE: z.ZodUnion<[z.ZodString, z.ZodString]>; | ||
SETTLEMINT_APPLICATION: z.ZodUnion<[z.ZodString, z.ZodString]>; | ||
SETTLEMINT_HASURA: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>; | ||
SETTLEMINT_HASURA_ENDPOINT: z.ZodOptional<z.ZodString>; | ||
SETTLEMINT_HASURA_ADMIN_SECRET: z.ZodOptional<z.ZodString>; | ||
SETTLEMINT_THEGRAPH: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>; | ||
SETTLEMINT_THEGRAPH_SUBGRAPH_ENDPOINT: z.ZodOptional<z.ZodString>; | ||
SETTLEMINT_THEGRAPH_SUBGRAPH_ENDPOINT_FALLBACK: z.ZodOptional<z.ZodString>; | ||
SETTLEMINT_PORTAL: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>; | ||
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: z.ZodOptional<z.ZodString>; | ||
SETTLEMINT_PORTAL_REST_ENDPOINT: z.ZodOptional<z.ZodString>; | ||
SETTLEMINT_HD_PRIVATE_KEY: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
SETTLEMINT_ENVIRONMENT: string; | ||
SETTLEMINT_INSTANCE: string; | ||
SETTLEMINT_ACCESS_TOKEN: string; | ||
SETTLEMINT_WORKSPACE: string; | ||
SETTLEMINT_APPLICATION: string; | ||
SETTLEMINT_HASURA?: string | undefined; | ||
SETTLEMINT_HASURA_ENDPOINT?: string | undefined; | ||
SETTLEMINT_HASURA_ADMIN_SECRET?: string | undefined; | ||
SETTLEMINT_THEGRAPH?: string | undefined; | ||
SETTLEMINT_THEGRAPH_SUBGRAPH_ENDPOINT?: string | undefined; | ||
SETTLEMINT_THEGRAPH_SUBGRAPH_ENDPOINT_FALLBACK?: string | undefined; | ||
SETTLEMINT_PORTAL?: string | undefined; | ||
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT?: string | undefined; | ||
SETTLEMINT_PORTAL_REST_ENDPOINT?: string | undefined; | ||
SETTLEMINT_HD_PRIVATE_KEY?: string | undefined; | ||
}, { | ||
SETTLEMINT_ENVIRONMENT: string; | ||
SETTLEMINT_INSTANCE: string; | ||
SETTLEMINT_ACCESS_TOKEN: string; | ||
SETTLEMINT_WORKSPACE: string; | ||
SETTLEMINT_APPLICATION: string; | ||
SETTLEMINT_HASURA?: string | undefined; | ||
SETTLEMINT_HASURA_ENDPOINT?: string | undefined; | ||
SETTLEMINT_HASURA_ADMIN_SECRET?: string | undefined; | ||
SETTLEMINT_THEGRAPH?: string | undefined; | ||
SETTLEMINT_THEGRAPH_SUBGRAPH_ENDPOINT?: string | undefined; | ||
SETTLEMINT_THEGRAPH_SUBGRAPH_ENDPOINT_FALLBACK?: string | undefined; | ||
SETTLEMINT_PORTAL?: string | undefined; | ||
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT?: string | undefined; | ||
SETTLEMINT_PORTAL_REST_ENDPOINT?: string | undefined; | ||
SETTLEMINT_HD_PRIVATE_KEY?: string | undefined; | ||
}>; | ||
type DotEnv = z.infer<typeof DotEnvSchema>; | ||
/** | ||
* Schema for validating IDs. Accepts both PostgreSQL UUIDs and MongoDB ObjectIDs. | ||
@@ -44,2 +93,25 @@ */ | ||
export { type AccessToken, AccessTokenSchema, type Id, IdSchema, type Url, UrlSchema, ensureFolder, ensureServer, getPackageManager, validate }; | ||
/** | ||
* Loads environment variables from .env files. | ||
* To enable encryption with dotenvx (https://www.dotenvx.com/docs) run `bunx dotenvx encrypt` | ||
* | ||
* @returns A promise that resolves to the validated environment variables. | ||
* @throws Will throw an error if validation fails. | ||
* | ||
* @example | ||
* const env = await loadEnv(); | ||
* console.log(env.SETTLEMINT_INSTANCE); | ||
*/ | ||
declare function loadEnv<T extends boolean = true>(validateEnv?: T): Promise<T extends true ? DotEnv : DotenvParseOutput>; | ||
declare function writeEnv(env: Partial<DotEnv>, secrets: boolean): Promise<void>; | ||
declare function ensureFolder(path: string): void; | ||
declare function projectRoot(): Promise<string>; | ||
declare function getPackageManager(targetDir: string): Promise<"yarn" | "pnpm" | "bun" | "npm">; | ||
declare function ensureServer(): void; | ||
export { type AccessToken, AccessTokenSchema, type DotEnv, DotEnvSchema, type Id, IdSchema, type Url, UrlSchema, ensureFolder, ensureServer, getPackageManager, loadEnv, projectRoot, validate, writeEnv }; |
@@ -10,2 +10,56 @@ import { z, ZodSchema } from 'zod'; | ||
/** | ||
* Schema for validating access tokens. | ||
*/ | ||
declare const DotEnvSchema: z.ZodObject<{ | ||
SETTLEMINT_ENVIRONMENT: z.ZodString; | ||
SETTLEMINT_INSTANCE: z.ZodString; | ||
SETTLEMINT_ACCESS_TOKEN: z.ZodString; | ||
SETTLEMINT_WORKSPACE: z.ZodUnion<[z.ZodString, z.ZodString]>; | ||
SETTLEMINT_APPLICATION: z.ZodUnion<[z.ZodString, z.ZodString]>; | ||
SETTLEMINT_HASURA: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>; | ||
SETTLEMINT_HASURA_ENDPOINT: z.ZodOptional<z.ZodString>; | ||
SETTLEMINT_HASURA_ADMIN_SECRET: z.ZodOptional<z.ZodString>; | ||
SETTLEMINT_THEGRAPH: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>; | ||
SETTLEMINT_THEGRAPH_SUBGRAPH_ENDPOINT: z.ZodOptional<z.ZodString>; | ||
SETTLEMINT_THEGRAPH_SUBGRAPH_ENDPOINT_FALLBACK: z.ZodOptional<z.ZodString>; | ||
SETTLEMINT_PORTAL: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>; | ||
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: z.ZodOptional<z.ZodString>; | ||
SETTLEMINT_PORTAL_REST_ENDPOINT: z.ZodOptional<z.ZodString>; | ||
SETTLEMINT_HD_PRIVATE_KEY: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
SETTLEMINT_ENVIRONMENT: string; | ||
SETTLEMINT_INSTANCE: string; | ||
SETTLEMINT_ACCESS_TOKEN: string; | ||
SETTLEMINT_WORKSPACE: string; | ||
SETTLEMINT_APPLICATION: string; | ||
SETTLEMINT_HASURA?: string | undefined; | ||
SETTLEMINT_HASURA_ENDPOINT?: string | undefined; | ||
SETTLEMINT_HASURA_ADMIN_SECRET?: string | undefined; | ||
SETTLEMINT_THEGRAPH?: string | undefined; | ||
SETTLEMINT_THEGRAPH_SUBGRAPH_ENDPOINT?: string | undefined; | ||
SETTLEMINT_THEGRAPH_SUBGRAPH_ENDPOINT_FALLBACK?: string | undefined; | ||
SETTLEMINT_PORTAL?: string | undefined; | ||
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT?: string | undefined; | ||
SETTLEMINT_PORTAL_REST_ENDPOINT?: string | undefined; | ||
SETTLEMINT_HD_PRIVATE_KEY?: string | undefined; | ||
}, { | ||
SETTLEMINT_ENVIRONMENT: string; | ||
SETTLEMINT_INSTANCE: string; | ||
SETTLEMINT_ACCESS_TOKEN: string; | ||
SETTLEMINT_WORKSPACE: string; | ||
SETTLEMINT_APPLICATION: string; | ||
SETTLEMINT_HASURA?: string | undefined; | ||
SETTLEMINT_HASURA_ENDPOINT?: string | undefined; | ||
SETTLEMINT_HASURA_ADMIN_SECRET?: string | undefined; | ||
SETTLEMINT_THEGRAPH?: string | undefined; | ||
SETTLEMINT_THEGRAPH_SUBGRAPH_ENDPOINT?: string | undefined; | ||
SETTLEMINT_THEGRAPH_SUBGRAPH_ENDPOINT_FALLBACK?: string | undefined; | ||
SETTLEMINT_PORTAL?: string | undefined; | ||
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT?: string | undefined; | ||
SETTLEMINT_PORTAL_REST_ENDPOINT?: string | undefined; | ||
SETTLEMINT_HD_PRIVATE_KEY?: string | undefined; | ||
}>; | ||
type DotEnv = z.infer<typeof DotEnvSchema>; | ||
/** | ||
* Schema for validating IDs. Accepts both PostgreSQL UUIDs and MongoDB ObjectIDs. | ||
@@ -38,2 +92,2 @@ */ | ||
export { type AccessToken, AccessTokenSchema, type Id, IdSchema, type Url, UrlSchema, validate }; | ||
export { type AccessToken, AccessTokenSchema, type DotEnv, DotEnvSchema, type Id, IdSchema, type Url, UrlSchema, validate }; |
{ | ||
"name": "@settlemint/sdk-utils", | ||
"description": "SettleMint SDK, integrate SettleMint into your application with ease.", | ||
"version": "0.4.34-prfcf304a", | ||
"version": "0.5.0-main33853af", | ||
"type": "module", | ||
@@ -61,3 +61,10 @@ "private": false, | ||
"dependencies": { | ||
"@antfu/ni": "^0.23.0" | ||
"@antfu/ni": "^0.23", | ||
"@dotenvx/dotenvx": "^1", | ||
"deepmerge-ts": "^7", | ||
"environment": "^1", | ||
"find-up": "^7", | ||
"nano-spawn": "^0.1.0", | ||
"yocto-spinner": "^0.1", | ||
"yoctocolors": "^2" | ||
}, | ||
@@ -64,0 +71,0 @@ "peerDependencies": {}, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
161365
45
1560
8
13
1
+ Added@dotenvx/dotenvx@^1
+ Addeddeepmerge-ts@^7
+ Addedenvironment@^1
+ Addedfind-up@^7
+ Addednano-spawn@^0.1.0
+ Addedyocto-spinner@^0.1
+ Addedyoctocolors@^2
+ Added@dotenvx/dotenvx@1.31.0(transitive)
+ Added@ecies/ciphers@0.2.2(transitive)
+ Added@noble/ciphers@1.1.3(transitive)
+ Added@noble/curves@1.7.0(transitive)
+ Added@noble/hashes@1.6.01.6.1(transitive)
+ Addedcommander@11.1.0(transitive)
+ Addedcross-spawn@7.0.6(transitive)
+ Addeddeepmerge-ts@7.1.3(transitive)
+ Addeddotenv@16.4.7(transitive)
+ Addedeciesjs@0.4.12(transitive)
+ Addedenvironment@1.1.0(transitive)
+ Addedexeca@5.1.1(transitive)
+ Addedfdir@6.4.2(transitive)
+ Addedfind-up@7.0.0(transitive)
+ Addedget-stream@6.0.1(transitive)
+ Addedhuman-signals@2.1.0(transitive)
+ Addedignore@5.3.2(transitive)
+ Addedis-stream@2.0.1(transitive)
+ Addedisexe@2.0.03.1.1(transitive)
+ Addedlocate-path@7.2.0(transitive)
+ Addedmerge-stream@2.0.0(transitive)
+ Addedmimic-fn@2.1.0(transitive)
+ Addednano-spawn@0.1.0(transitive)
+ Addednpm-run-path@4.0.1(transitive)
+ Addedobject-treeify@1.1.33(transitive)
+ Addedonetime@5.1.2(transitive)
+ Addedp-limit@4.0.0(transitive)
+ Addedp-locate@6.0.0(transitive)
+ Addedpath-exists@5.0.0(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpicomatch@4.0.2(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedstrip-final-newline@2.0.0(transitive)
+ Addedunicorn-magic@0.1.0(transitive)
+ Addedwhich@2.0.24.0.0(transitive)
+ Addedyocto-queue@1.1.1(transitive)
+ Addedyocto-spinner@0.1.2(transitive)
+ Addedyoctocolors@2.1.1(transitive)
Updated@antfu/ni@^0.23