@settlemint/sdk-utils 2.0.0 → 2.1.1
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 +235 -86
- package/dist/environment.cjs +4 -2
- package/dist/environment.cjs.map +1 -1
- package/dist/environment.d.cts +7 -0
- package/dist/environment.d.ts +7 -0
- package/dist/environment.mjs +4 -2
- package/dist/environment.mjs.map +1 -1
- package/dist/index.cjs +8 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.mjs +7 -0
- package/dist/index.mjs.map +1 -1
- package/dist/logging.cjs +152 -0
- package/dist/logging.cjs.map +1 -0
- package/dist/logging.d.cts +70 -0
- package/dist/logging.d.ts +70 -0
- package/dist/logging.mjs +123 -0
- package/dist/logging.mjs.map +1 -0
- package/dist/package-manager.cjs +1 -1
- package/dist/package-manager.cjs.map +1 -1
- package/dist/package-manager.mjs +1 -1
- package/dist/package-manager.mjs.map +1 -1
- package/dist/terminal.cjs +1 -1
- package/dist/terminal.cjs.map +1 -1
- package/dist/terminal.d.cts +14 -14
- package/dist/terminal.d.ts +14 -14
- package/dist/terminal.mjs +1 -1
- package/dist/terminal.mjs.map +1 -1
- package/dist/validation.cjs +3 -1
- package/dist/validation.cjs.map +1 -1
- package/dist/validation.d.cts +7 -0
- package/dist/validation.d.ts +7 -0
- package/dist/validation.mjs +3 -1
- package/dist/validation.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
- [camelCaseToWords()](#camelcasetowords)
|
|
34
34
|
- [cancel()](#cancel)
|
|
35
35
|
- [capitalizeFirstLetter()](#capitalizefirstletter)
|
|
36
|
+
- [createLogger()](#createlogger)
|
|
36
37
|
- [emptyDir()](#emptydir)
|
|
37
38
|
- [ensureBrowser()](#ensurebrowser)
|
|
38
39
|
- [ensureServer()](#ensureserver)
|
|
@@ -56,10 +57,12 @@
|
|
|
56
57
|
- [outro()](#outro)
|
|
57
58
|
- [projectRoot()](#projectroot)
|
|
58
59
|
- [replaceUnderscoresAndHyphensWithSpaces()](#replaceunderscoresandhyphenswithspaces)
|
|
60
|
+
- [requestLogger()](#requestlogger)
|
|
59
61
|
- [retryWhenFailed()](#retrywhenfailed)
|
|
60
62
|
- [setName()](#setname)
|
|
61
63
|
- [spinner()](#spinner)
|
|
62
64
|
- [table()](#table)
|
|
65
|
+
- [truncate()](#truncate)
|
|
63
66
|
- [tryParseJson()](#tryparsejson)
|
|
64
67
|
- [validate()](#validate)
|
|
65
68
|
- [writeEnv()](#writeenv)
|
|
@@ -68,11 +71,14 @@
|
|
|
68
71
|
- [SpinnerError](#spinnererror)
|
|
69
72
|
- [Interfaces](#interfaces)
|
|
70
73
|
- [ExecuteCommandOptions](#executecommandoptions)
|
|
74
|
+
- [Logger](#logger)
|
|
75
|
+
- [LoggerOptions](#loggeroptions)
|
|
71
76
|
- [SpinnerOptions\<R\>](#spinneroptionsr)
|
|
72
77
|
- [Type Aliases](#type-aliases)
|
|
73
78
|
- [DotEnv](#dotenv)
|
|
74
79
|
- [DotEnvPartial](#dotenvpartial)
|
|
75
80
|
- [Id](#id)
|
|
81
|
+
- [LogLevel](#loglevel)
|
|
76
82
|
- [Variables](#variables)
|
|
77
83
|
- [AccessTokenSchema](#accesstokenschema)
|
|
78
84
|
- [ApplicationAccessTokenSchema](#applicationaccesstokenschema)
|
|
@@ -101,7 +107,7 @@ The SettleMint Utils SDK provides a collection of shared utilities and helper fu
|
|
|
101
107
|
|
|
102
108
|
> **ascii**(): `void`
|
|
103
109
|
|
|
104
|
-
Defined in: [sdk/utils/src/terminal/ascii.ts:13](https://github.com/settlemint/sdk/blob/v2.
|
|
110
|
+
Defined in: [sdk/utils/src/terminal/ascii.ts:13](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/terminal/ascii.ts#L13)
|
|
105
111
|
|
|
106
112
|
Prints the SettleMint ASCII art logo to the console in magenta color.
|
|
107
113
|
Used for CLI branding and visual identification.
|
|
@@ -125,7 +131,7 @@ ascii();
|
|
|
125
131
|
|
|
126
132
|
> **camelCaseToWords**(`s`): `string`
|
|
127
133
|
|
|
128
|
-
Defined in: [sdk/utils/src/string.ts:29](https://github.com/settlemint/sdk/blob/v2.
|
|
134
|
+
Defined in: [sdk/utils/src/string.ts:29](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/string.ts#L29)
|
|
129
135
|
|
|
130
136
|
Converts a camelCase string to a human-readable string.
|
|
131
137
|
|
|
@@ -156,7 +162,7 @@ const words = camelCaseToWords("camelCaseString");
|
|
|
156
162
|
|
|
157
163
|
> **cancel**(`msg`): `never`
|
|
158
164
|
|
|
159
|
-
Defined in: [sdk/utils/src/terminal/cancel.ts:23](https://github.com/settlemint/sdk/blob/v2.
|
|
165
|
+
Defined in: [sdk/utils/src/terminal/cancel.ts:23](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/terminal/cancel.ts#L23)
|
|
160
166
|
|
|
161
167
|
Displays an error message in red inverse text and throws a CancelError.
|
|
162
168
|
Used to terminate execution with a visible error message.
|
|
@@ -189,7 +195,7 @@ cancel("An error occurred");
|
|
|
189
195
|
|
|
190
196
|
> **capitalizeFirstLetter**(`val`): `string`
|
|
191
197
|
|
|
192
|
-
Defined in: [sdk/utils/src/string.ts:13](https://github.com/settlemint/sdk/blob/v2.
|
|
198
|
+
Defined in: [sdk/utils/src/string.ts:13](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/string.ts#L13)
|
|
193
199
|
|
|
194
200
|
Capitalizes the first letter of a string.
|
|
195
201
|
|
|
@@ -216,11 +222,44 @@ const capitalized = capitalizeFirstLetter("hello");
|
|
|
216
222
|
|
|
217
223
|
***
|
|
218
224
|
|
|
225
|
+
#### createLogger()
|
|
226
|
+
|
|
227
|
+
> **createLogger**(`options`): [`Logger`](#logger)
|
|
228
|
+
|
|
229
|
+
Defined in: [sdk/utils/src/logging/logger.ts:50](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/logging/logger.ts#L50)
|
|
230
|
+
|
|
231
|
+
Creates a simple logger with configurable log level
|
|
232
|
+
|
|
233
|
+
##### Parameters
|
|
234
|
+
|
|
235
|
+
| Parameter | Type | Description |
|
|
236
|
+
| ------ | ------ | ------ |
|
|
237
|
+
| `options` | [`LoggerOptions`](#loggeroptions) | Configuration options for the logger |
|
|
238
|
+
|
|
239
|
+
##### Returns
|
|
240
|
+
|
|
241
|
+
[`Logger`](#logger)
|
|
242
|
+
|
|
243
|
+
A logger instance with debug, info, warn, and error methods
|
|
244
|
+
|
|
245
|
+
##### Example
|
|
246
|
+
|
|
247
|
+
```ts
|
|
248
|
+
import { createLogger } from "@/utils/logging/logger";
|
|
249
|
+
|
|
250
|
+
const logger = createLogger({ level: 'info' });
|
|
251
|
+
|
|
252
|
+
logger.info('User logged in', { userId: '123' });
|
|
253
|
+
logger.error('Operation failed', new Error('Connection timeout'));
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
***
|
|
257
|
+
|
|
219
258
|
#### emptyDir()
|
|
220
259
|
|
|
221
260
|
> **emptyDir**(`dir`): `Promise`\<`void`\>
|
|
222
261
|
|
|
223
|
-
Defined in: [sdk/utils/src/package-manager/download-and-extract.ts:45](https://github.com/settlemint/sdk/blob/v2.
|
|
262
|
+
Defined in: [sdk/utils/src/package-manager/download-and-extract.ts:45](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/package-manager/download-and-extract.ts#L45)
|
|
224
263
|
|
|
225
264
|
Removes all contents of a directory except the .git folder
|
|
226
265
|
|
|
@@ -248,7 +287,7 @@ await emptyDir("/path/to/dir"); // Removes all contents except .git
|
|
|
248
287
|
|
|
249
288
|
> **ensureBrowser**(): `void`
|
|
250
289
|
|
|
251
|
-
Defined in: [sdk/utils/src/runtime/ensure-server.ts:31](https://github.com/settlemint/sdk/blob/v2.
|
|
290
|
+
Defined in: [sdk/utils/src/runtime/ensure-server.ts:31](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/runtime/ensure-server.ts#L31)
|
|
252
291
|
|
|
253
292
|
Ensures that code is running in a browser environment and not on the server.
|
|
254
293
|
|
|
@@ -275,7 +314,7 @@ ensureBrowser();
|
|
|
275
314
|
|
|
276
315
|
> **ensureServer**(): `void`
|
|
277
316
|
|
|
278
|
-
Defined in: [sdk/utils/src/runtime/ensure-server.ts:13](https://github.com/settlemint/sdk/blob/v2.
|
|
317
|
+
Defined in: [sdk/utils/src/runtime/ensure-server.ts:13](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/runtime/ensure-server.ts#L13)
|
|
279
318
|
|
|
280
319
|
Ensures that code is running on the server and not in a browser environment.
|
|
281
320
|
|
|
@@ -300,9 +339,9 @@ ensureServer();
|
|
|
300
339
|
|
|
301
340
|
#### executeCommand()
|
|
302
341
|
|
|
303
|
-
> **executeCommand**(`command`, `args`, `options
|
|
342
|
+
> **executeCommand**(`command`, `args`, `options?`): `Promise`\<`string`[]\>
|
|
304
343
|
|
|
305
|
-
Defined in: [sdk/utils/src/terminal/execute-command.ts:31](https://github.com/settlemint/sdk/blob/v2.
|
|
344
|
+
Defined in: [sdk/utils/src/terminal/execute-command.ts:31](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/terminal/execute-command.ts#L31)
|
|
306
345
|
|
|
307
346
|
Executes a command with the given arguments in a child process.
|
|
308
347
|
Pipes stdin to the child process and captures stdout/stderr output.
|
|
@@ -314,7 +353,7 @@ Masks any sensitive tokens in the output before displaying or returning.
|
|
|
314
353
|
| ------ | ------ | ------ |
|
|
315
354
|
| `command` | `string` | The command to execute |
|
|
316
355
|
| `args` | `string`[] | Array of arguments to pass to the command |
|
|
317
|
-
| `options
|
|
356
|
+
| `options?` | [`ExecuteCommandOptions`](#executecommandoptions) | Options for customizing command execution |
|
|
318
357
|
|
|
319
358
|
##### Returns
|
|
320
359
|
|
|
@@ -344,7 +383,7 @@ await executeCommand("npm", ["install"], { silent: true });
|
|
|
344
383
|
|
|
345
384
|
> **exists**(`path`): `Promise`\<`boolean`\>
|
|
346
385
|
|
|
347
|
-
Defined in: [sdk/utils/src/filesystem/exists.ts:17](https://github.com/settlemint/sdk/blob/v2.
|
|
386
|
+
Defined in: [sdk/utils/src/filesystem/exists.ts:17](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/filesystem/exists.ts#L17)
|
|
348
387
|
|
|
349
388
|
Checks if a file or directory exists at the given path
|
|
350
389
|
|
|
@@ -375,9 +414,9 @@ if (await exists('/path/to/file.txt')) {
|
|
|
375
414
|
|
|
376
415
|
#### fetchWithRetry()
|
|
377
416
|
|
|
378
|
-
> **fetchWithRetry**(`input`, `init
|
|
417
|
+
> **fetchWithRetry**(`input`, `init?`, `maxRetries?`, `initialSleepTime?`): `Promise`\<`Response`\>
|
|
379
418
|
|
|
380
|
-
Defined in: [sdk/utils/src/http/fetch-with-retry.ts:18](https://github.com/settlemint/sdk/blob/v2.
|
|
419
|
+
Defined in: [sdk/utils/src/http/fetch-with-retry.ts:18](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/http/fetch-with-retry.ts#L18)
|
|
381
420
|
|
|
382
421
|
Retry an HTTP request with exponential backoff and jitter.
|
|
383
422
|
Only retries on server errors (5xx), rate limits (429), timeouts (408), and network errors.
|
|
@@ -387,9 +426,9 @@ Only retries on server errors (5xx), rate limits (429), timeouts (408), and netw
|
|
|
387
426
|
| Parameter | Type | Default value | Description |
|
|
388
427
|
| ------ | ------ | ------ | ------ |
|
|
389
428
|
| `input` | `URL` \| `RequestInfo` | `undefined` | The URL or Request object to fetch |
|
|
390
|
-
| `init
|
|
391
|
-
| `maxRetries
|
|
392
|
-
| `initialSleepTime
|
|
429
|
+
| `init?` | `RequestInit` | `undefined` | The fetch init options |
|
|
430
|
+
| `maxRetries?` | `number` | `5` | Maximum number of retry attempts |
|
|
431
|
+
| `initialSleepTime?` | `number` | `3_000` | Initial sleep time between retries in ms |
|
|
393
432
|
|
|
394
433
|
##### Returns
|
|
395
434
|
|
|
@@ -415,7 +454,7 @@ const response = await fetchWithRetry("https://api.example.com/data");
|
|
|
415
454
|
|
|
416
455
|
> **findMonoRepoPackages**(`projectDir`): `Promise`\<`string`[]\>
|
|
417
456
|
|
|
418
|
-
Defined in: [sdk/utils/src/filesystem/mono-repo.ts:59](https://github.com/settlemint/sdk/blob/v2.
|
|
457
|
+
Defined in: [sdk/utils/src/filesystem/mono-repo.ts:59](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/filesystem/mono-repo.ts#L59)
|
|
419
458
|
|
|
420
459
|
Finds all packages in a monorepo
|
|
421
460
|
|
|
@@ -446,7 +485,7 @@ console.log(packages); // Output: ["/path/to/your/project/packages/core", "/path
|
|
|
446
485
|
|
|
447
486
|
> **findMonoRepoRoot**(`startDir`): `Promise`\<`null` \| `string`\>
|
|
448
487
|
|
|
449
|
-
Defined in: [sdk/utils/src/filesystem/mono-repo.ts:19](https://github.com/settlemint/sdk/blob/v2.
|
|
488
|
+
Defined in: [sdk/utils/src/filesystem/mono-repo.ts:19](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/filesystem/mono-repo.ts#L19)
|
|
450
489
|
|
|
451
490
|
Finds the root directory of a monorepo
|
|
452
491
|
|
|
@@ -477,7 +516,7 @@ console.log(root); // Output: /path/to/your/project/packages/core
|
|
|
477
516
|
|
|
478
517
|
> **formatTargetDir**(`targetDir`): `string`
|
|
479
518
|
|
|
480
|
-
Defined in: [sdk/utils/src/package-manager/download-and-extract.ts:15](https://github.com/settlemint/sdk/blob/v2.
|
|
519
|
+
Defined in: [sdk/utils/src/package-manager/download-and-extract.ts:15](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/package-manager/download-and-extract.ts#L15)
|
|
481
520
|
|
|
482
521
|
Formats a directory path by removing trailing slashes and whitespace
|
|
483
522
|
|
|
@@ -505,9 +544,9 @@ const formatted = formatTargetDir("/path/to/dir/ "); // "/path/to/dir"
|
|
|
505
544
|
|
|
506
545
|
#### getPackageManager()
|
|
507
546
|
|
|
508
|
-
> **getPackageManager**(`targetDir
|
|
547
|
+
> **getPackageManager**(`targetDir?`): `Promise`\<`AgentName`\>
|
|
509
548
|
|
|
510
|
-
Defined in: [sdk/utils/src/package-manager/get-package-manager.ts:15](https://github.com/settlemint/sdk/blob/v2.
|
|
549
|
+
Defined in: [sdk/utils/src/package-manager/get-package-manager.ts:15](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/package-manager/get-package-manager.ts#L15)
|
|
511
550
|
|
|
512
551
|
Detects the package manager used in the current project
|
|
513
552
|
|
|
@@ -515,7 +554,7 @@ Detects the package manager used in the current project
|
|
|
515
554
|
|
|
516
555
|
| Parameter | Type | Description |
|
|
517
556
|
| ------ | ------ | ------ |
|
|
518
|
-
| `targetDir
|
|
557
|
+
| `targetDir?` | `string` | The directory to check for package manager (optional, defaults to process.cwd()) |
|
|
519
558
|
|
|
520
559
|
##### Returns
|
|
521
560
|
|
|
@@ -536,9 +575,9 @@ console.log(`Using ${packageManager}`);
|
|
|
536
575
|
|
|
537
576
|
#### getPackageManagerExecutable()
|
|
538
577
|
|
|
539
|
-
> **getPackageManagerExecutable**(`targetDir
|
|
578
|
+
> **getPackageManagerExecutable**(`targetDir?`): `Promise`\<\{ `args`: `string`[]; `command`: `string`; \}\>
|
|
540
579
|
|
|
541
|
-
Defined in: [sdk/utils/src/package-manager/get-package-manager-executable.ts:14](https://github.com/settlemint/sdk/blob/v2.
|
|
580
|
+
Defined in: [sdk/utils/src/package-manager/get-package-manager-executable.ts:14](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/package-manager/get-package-manager-executable.ts#L14)
|
|
542
581
|
|
|
543
582
|
Retrieves the executable command and arguments for the package manager
|
|
544
583
|
|
|
@@ -546,7 +585,7 @@ Retrieves the executable command and arguments for the package manager
|
|
|
546
585
|
|
|
547
586
|
| Parameter | Type | Description |
|
|
548
587
|
| ------ | ------ | ------ |
|
|
549
|
-
| `targetDir
|
|
588
|
+
| `targetDir?` | `string` | The directory to check for package manager (optional, defaults to process.cwd()) |
|
|
550
589
|
|
|
551
590
|
##### Returns
|
|
552
591
|
|
|
@@ -567,9 +606,9 @@ console.log(`Using ${command} with args: ${args.join(" ")}`);
|
|
|
567
606
|
|
|
568
607
|
#### graphqlFetchWithRetry()
|
|
569
608
|
|
|
570
|
-
> **graphqlFetchWithRetry**\<`Data`\>(`input`, `init
|
|
609
|
+
> **graphqlFetchWithRetry**\<`Data`\>(`input`, `init?`, `maxRetries?`, `initialSleepTime?`): `Promise`\<`Data`\>
|
|
571
610
|
|
|
572
|
-
Defined in: [sdk/utils/src/http/graphql-fetch-with-retry.ts:34](https://github.com/settlemint/sdk/blob/v2.
|
|
611
|
+
Defined in: [sdk/utils/src/http/graphql-fetch-with-retry.ts:34](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/http/graphql-fetch-with-retry.ts#L34)
|
|
573
612
|
|
|
574
613
|
Executes a GraphQL request with automatic retries using exponential backoff and jitter.
|
|
575
614
|
Only retries on server errors (5xx), rate limits (429), timeouts (408), and network errors.
|
|
@@ -586,9 +625,9 @@ Will also retry if the GraphQL response contains errors.
|
|
|
586
625
|
| Parameter | Type | Default value | Description |
|
|
587
626
|
| ------ | ------ | ------ | ------ |
|
|
588
627
|
| `input` | `URL` \| `RequestInfo` | `undefined` | The URL or Request object for the GraphQL endpoint |
|
|
589
|
-
| `init
|
|
590
|
-
| `maxRetries
|
|
591
|
-
| `initialSleepTime
|
|
628
|
+
| `init?` | `RequestInit` | `undefined` | Optional fetch configuration options |
|
|
629
|
+
| `maxRetries?` | `number` | `5` | Maximum retry attempts before failing (default: 5) |
|
|
630
|
+
| `initialSleepTime?` | `number` | `3_000` | Initial delay between retries in milliseconds (default: 3000) |
|
|
592
631
|
|
|
593
632
|
##### Returns
|
|
594
633
|
|
|
@@ -626,9 +665,9 @@ const data = await graphqlFetchWithRetry<{ user: { id: string } }>(
|
|
|
626
665
|
|
|
627
666
|
#### installDependencies()
|
|
628
667
|
|
|
629
|
-
> **installDependencies**(`pkgs`, `cwd
|
|
668
|
+
> **installDependencies**(`pkgs`, `cwd?`): `Promise`\<`void`\>
|
|
630
669
|
|
|
631
|
-
Defined in: [sdk/utils/src/package-manager/install-dependencies.ts:20](https://github.com/settlemint/sdk/blob/v2.
|
|
670
|
+
Defined in: [sdk/utils/src/package-manager/install-dependencies.ts:20](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/package-manager/install-dependencies.ts#L20)
|
|
632
671
|
|
|
633
672
|
Installs one or more packages as dependencies using the detected package manager
|
|
634
673
|
|
|
@@ -637,7 +676,7 @@ Installs one or more packages as dependencies using the detected package manager
|
|
|
637
676
|
| Parameter | Type | Description |
|
|
638
677
|
| ------ | ------ | ------ |
|
|
639
678
|
| `pkgs` | `string` \| `string`[] | A single package name or array of package names to install |
|
|
640
|
-
| `cwd
|
|
679
|
+
| `cwd?` | `string` | The directory to run the installation in |
|
|
641
680
|
|
|
642
681
|
##### Returns
|
|
643
682
|
|
|
@@ -667,7 +706,7 @@ await installDependencies(["express", "cors"]);
|
|
|
667
706
|
|
|
668
707
|
> **intro**(`msg`): `void`
|
|
669
708
|
|
|
670
|
-
Defined in: [sdk/utils/src/terminal/intro.ts:15](https://github.com/settlemint/sdk/blob/v2.
|
|
709
|
+
Defined in: [sdk/utils/src/terminal/intro.ts:15](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/terminal/intro.ts#L15)
|
|
671
710
|
|
|
672
711
|
Displays an introductory message in magenta text with padding.
|
|
673
712
|
Any sensitive tokens in the message are masked before display.
|
|
@@ -697,7 +736,7 @@ intro("Starting deployment...");
|
|
|
697
736
|
|
|
698
737
|
> **isEmpty**(`path`): `Promise`\<`boolean`\>
|
|
699
738
|
|
|
700
|
-
Defined in: [sdk/utils/src/package-manager/download-and-extract.ts:31](https://github.com/settlemint/sdk/blob/v2.
|
|
739
|
+
Defined in: [sdk/utils/src/package-manager/download-and-extract.ts:31](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/package-manager/download-and-extract.ts#L31)
|
|
701
740
|
|
|
702
741
|
Checks if a directory is empty or contains only a .git folder
|
|
703
742
|
|
|
@@ -727,9 +766,9 @@ if (await isEmpty("/path/to/dir")) {
|
|
|
727
766
|
|
|
728
767
|
#### isPackageInstalled()
|
|
729
768
|
|
|
730
|
-
> **isPackageInstalled**(`name`, `path
|
|
769
|
+
> **isPackageInstalled**(`name`, `path?`): `Promise`\<`boolean`\>
|
|
731
770
|
|
|
732
|
-
Defined in: [sdk/utils/src/package-manager/is-package-installed.ts:17](https://github.com/settlemint/sdk/blob/v2.
|
|
771
|
+
Defined in: [sdk/utils/src/package-manager/is-package-installed.ts:17](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/package-manager/is-package-installed.ts#L17)
|
|
733
772
|
|
|
734
773
|
Checks if a package is installed in the project's dependencies, devDependencies, or peerDependencies.
|
|
735
774
|
|
|
@@ -738,7 +777,7 @@ Checks if a package is installed in the project's dependencies, devDependencies,
|
|
|
738
777
|
| Parameter | Type | Description |
|
|
739
778
|
| ------ | ------ | ------ |
|
|
740
779
|
| `name` | `string` | The name of the package to check |
|
|
741
|
-
| `path
|
|
780
|
+
| `path?` | `string` | The path to the project root directory. If not provided, will be automatically determined |
|
|
742
781
|
|
|
743
782
|
##### Returns
|
|
744
783
|
|
|
@@ -765,7 +804,7 @@ console.log(`@settlemint/sdk-utils is installed: ${isInstalled}`);
|
|
|
765
804
|
|
|
766
805
|
> **list**(`title`, `items`): `void`
|
|
767
806
|
|
|
768
|
-
Defined in: [sdk/utils/src/terminal/list.ts:23](https://github.com/settlemint/sdk/blob/v2.
|
|
807
|
+
Defined in: [sdk/utils/src/terminal/list.ts:23](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/terminal/list.ts#L23)
|
|
769
808
|
|
|
770
809
|
Displays a list of items in a formatted manner, supporting nested items.
|
|
771
810
|
|
|
@@ -805,7 +844,7 @@ list("Providers", [
|
|
|
805
844
|
|
|
806
845
|
> **loadEnv**\<`T`\>(`validateEnv`, `prod`, `path`): `Promise`\<`T` *extends* `true` ? `object` : `object`\>
|
|
807
846
|
|
|
808
|
-
Defined in: [sdk/utils/src/environment/load-env.ts:25](https://github.com/settlemint/sdk/blob/v2.
|
|
847
|
+
Defined in: [sdk/utils/src/environment/load-env.ts:25](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/environment/load-env.ts#L25)
|
|
809
848
|
|
|
810
849
|
Loads environment variables from .env files.
|
|
811
850
|
To enable encryption with dotenvx (https://www.dotenvx.com/docs) run `bunx dotenvx encrypt`
|
|
@@ -853,7 +892,7 @@ const rawEnv = await loadEnv(false, false);
|
|
|
853
892
|
|
|
854
893
|
> **maskTokens**(`output`): `string`
|
|
855
894
|
|
|
856
|
-
Defined in: [sdk/utils/src/
|
|
895
|
+
Defined in: [sdk/utils/src/logging/mask-tokens.ts:13](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/logging/mask-tokens.ts#L13)
|
|
857
896
|
|
|
858
897
|
Masks sensitive SettleMint tokens in output text by replacing them with asterisks.
|
|
859
898
|
Handles personal access tokens (PAT), application access tokens (AAT), and service account tokens (SAT).
|
|
@@ -885,7 +924,7 @@ const masked = maskTokens("Token: sm_pat_****"); // "Token: ***"
|
|
|
885
924
|
|
|
886
925
|
> **note**(`message`, `level`): `void`
|
|
887
926
|
|
|
888
|
-
Defined in: [sdk/utils/src/terminal/note.ts:20](https://github.com/settlemint/sdk/blob/v2.
|
|
927
|
+
Defined in: [sdk/utils/src/terminal/note.ts:20](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/terminal/note.ts#L20)
|
|
889
928
|
|
|
890
929
|
Displays a note message with optional warning level formatting.
|
|
891
930
|
Regular notes are displayed in normal text, while warnings are shown in yellow.
|
|
@@ -920,7 +959,7 @@ note("Low disk space remaining", "warn");
|
|
|
920
959
|
|
|
921
960
|
> **outro**(`msg`): `void`
|
|
922
961
|
|
|
923
|
-
Defined in: [sdk/utils/src/terminal/outro.ts:15](https://github.com/settlemint/sdk/blob/v2.
|
|
962
|
+
Defined in: [sdk/utils/src/terminal/outro.ts:15](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/terminal/outro.ts#L15)
|
|
924
963
|
|
|
925
964
|
Displays a closing message in green inverted text with padding.
|
|
926
965
|
Any sensitive tokens in the message are masked before display.
|
|
@@ -948,9 +987,9 @@ outro("Deployment completed successfully!");
|
|
|
948
987
|
|
|
949
988
|
#### projectRoot()
|
|
950
989
|
|
|
951
|
-
> **projectRoot**(`fallbackToCwd`, `cwd
|
|
990
|
+
> **projectRoot**(`fallbackToCwd`, `cwd?`): `Promise`\<`string`\>
|
|
952
991
|
|
|
953
|
-
Defined in: [sdk/utils/src/filesystem/project-root.ts:18](https://github.com/settlemint/sdk/blob/v2.
|
|
992
|
+
Defined in: [sdk/utils/src/filesystem/project-root.ts:18](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/filesystem/project-root.ts#L18)
|
|
954
993
|
|
|
955
994
|
Finds the root directory of the current project by locating the nearest package.json file
|
|
956
995
|
|
|
@@ -959,7 +998,7 @@ Finds the root directory of the current project by locating the nearest package.
|
|
|
959
998
|
| Parameter | Type | Default value | Description |
|
|
960
999
|
| ------ | ------ | ------ | ------ |
|
|
961
1000
|
| `fallbackToCwd` | `boolean` | `false` | If true, will return the current working directory if no package.json is found |
|
|
962
|
-
| `cwd
|
|
1001
|
+
| `cwd?` | `string` | `undefined` | The directory to start searching for the package.json file from (defaults to process.cwd()) |
|
|
963
1002
|
|
|
964
1003
|
##### Returns
|
|
965
1004
|
|
|
@@ -987,7 +1026,7 @@ console.log(`Project root is at: ${rootDir}`);
|
|
|
987
1026
|
|
|
988
1027
|
> **replaceUnderscoresAndHyphensWithSpaces**(`s`): `string`
|
|
989
1028
|
|
|
990
|
-
Defined in: [sdk/utils/src/string.ts:48](https://github.com/settlemint/sdk/blob/v2.
|
|
1029
|
+
Defined in: [sdk/utils/src/string.ts:48](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/string.ts#L48)
|
|
991
1030
|
|
|
992
1031
|
Replaces underscores and hyphens with spaces.
|
|
993
1032
|
|
|
@@ -1014,11 +1053,45 @@ const result = replaceUnderscoresAndHyphensWithSpaces("Already_Spaced-Second");
|
|
|
1014
1053
|
|
|
1015
1054
|
***
|
|
1016
1055
|
|
|
1056
|
+
#### requestLogger()
|
|
1057
|
+
|
|
1058
|
+
> **requestLogger**(`logger`, `name`, `fn`): (...`args`) => `Promise`\<`Response`\>
|
|
1059
|
+
|
|
1060
|
+
Defined in: [sdk/utils/src/logging/request-logger.ts:14](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/logging/request-logger.ts#L14)
|
|
1061
|
+
|
|
1062
|
+
Logs the request and duration of a fetch call (> 500ms is logged as warn, otherwise info)
|
|
1063
|
+
|
|
1064
|
+
##### Parameters
|
|
1065
|
+
|
|
1066
|
+
| Parameter | Type | Description |
|
|
1067
|
+
| ------ | ------ | ------ |
|
|
1068
|
+
| `logger` | [`Logger`](#logger) | The logger to use |
|
|
1069
|
+
| `name` | `string` | The name of the request |
|
|
1070
|
+
| `fn` | *typeof* `fetch` | The fetch function to use |
|
|
1071
|
+
|
|
1072
|
+
##### Returns
|
|
1073
|
+
|
|
1074
|
+
The fetch function
|
|
1075
|
+
|
|
1076
|
+
> (...`args`): `Promise`\<`Response`\>
|
|
1077
|
+
|
|
1078
|
+
###### Parameters
|
|
1079
|
+
|
|
1080
|
+
| Parameter | Type |
|
|
1081
|
+
| ------ | ------ |
|
|
1082
|
+
| ...`args` | \[`string` \| `URL` \| `Request`, `RequestInit`\] |
|
|
1083
|
+
|
|
1084
|
+
###### Returns
|
|
1085
|
+
|
|
1086
|
+
`Promise`\<`Response`\>
|
|
1087
|
+
|
|
1088
|
+
***
|
|
1089
|
+
|
|
1017
1090
|
#### retryWhenFailed()
|
|
1018
1091
|
|
|
1019
|
-
> **retryWhenFailed**\<`T`\>(`fn`, `maxRetries`, `initialSleepTime`, `stopOnError
|
|
1092
|
+
> **retryWhenFailed**\<`T`\>(`fn`, `maxRetries`, `initialSleepTime`, `stopOnError?`): `Promise`\<`T`\>
|
|
1020
1093
|
|
|
1021
|
-
Defined in: [sdk/utils/src/retry.ts:14](https://github.com/settlemint/sdk/blob/v2.
|
|
1094
|
+
Defined in: [sdk/utils/src/retry.ts:14](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/retry.ts#L14)
|
|
1022
1095
|
|
|
1023
1096
|
Retry a function when it fails.
|
|
1024
1097
|
|
|
@@ -1035,7 +1108,7 @@ Retry a function when it fails.
|
|
|
1035
1108
|
| `fn` | () => `Promise`\<`T`\> | `undefined` | The function to retry. |
|
|
1036
1109
|
| `maxRetries` | `number` | `5` | The maximum number of retries. |
|
|
1037
1110
|
| `initialSleepTime` | `number` | `1_000` | The initial time to sleep between exponential backoff retries. |
|
|
1038
|
-
| `stopOnError
|
|
1111
|
+
| `stopOnError?` | (`error`) => `boolean` | `undefined` | The function to stop on error. |
|
|
1039
1112
|
|
|
1040
1113
|
##### Returns
|
|
1041
1114
|
|
|
@@ -1056,9 +1129,9 @@ const result = await retryWhenFailed(() => readFile("/path/to/file.txt"), 3, 1_0
|
|
|
1056
1129
|
|
|
1057
1130
|
#### setName()
|
|
1058
1131
|
|
|
1059
|
-
> **setName**(`name`, `path
|
|
1132
|
+
> **setName**(`name`, `path?`): `Promise`\<`void`\>
|
|
1060
1133
|
|
|
1061
|
-
Defined in: [sdk/utils/src/package-manager/set-name.ts:16](https://github.com/settlemint/sdk/blob/v2.
|
|
1134
|
+
Defined in: [sdk/utils/src/package-manager/set-name.ts:16](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/package-manager/set-name.ts#L16)
|
|
1062
1135
|
|
|
1063
1136
|
Sets the name field in the package.json file
|
|
1064
1137
|
|
|
@@ -1067,7 +1140,7 @@ Sets the name field in the package.json file
|
|
|
1067
1140
|
| Parameter | Type | Description |
|
|
1068
1141
|
| ------ | ------ | ------ |
|
|
1069
1142
|
| `name` | `string` | The new name to set in the package.json file |
|
|
1070
|
-
| `path
|
|
1143
|
+
| `path?` | `string` | The path to the project root directory. If not provided, will be automatically determined |
|
|
1071
1144
|
|
|
1072
1145
|
##### Returns
|
|
1073
1146
|
|
|
@@ -1093,7 +1166,7 @@ await setName("my-new-project-name");
|
|
|
1093
1166
|
|
|
1094
1167
|
> **spinner**\<`R`\>(`options`): `Promise`\<`R`\>
|
|
1095
1168
|
|
|
1096
|
-
Defined in: [sdk/utils/src/terminal/spinner.ts:54](https://github.com/settlemint/sdk/blob/v2.
|
|
1169
|
+
Defined in: [sdk/utils/src/terminal/spinner.ts:54](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/terminal/spinner.ts#L54)
|
|
1097
1170
|
|
|
1098
1171
|
Displays a loading spinner while executing an async task.
|
|
1099
1172
|
Shows progress with start/stop messages and handles errors.
|
|
@@ -1143,7 +1216,7 @@ const result = await spinner({
|
|
|
1143
1216
|
|
|
1144
1217
|
> **table**(`title`, `data`): `void`
|
|
1145
1218
|
|
|
1146
|
-
Defined in: [sdk/utils/src/terminal/table.ts:20](https://github.com/settlemint/sdk/blob/v2.
|
|
1219
|
+
Defined in: [sdk/utils/src/terminal/table.ts:20](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/terminal/table.ts#L20)
|
|
1147
1220
|
|
|
1148
1221
|
Displays data in a formatted table in the terminal.
|
|
1149
1222
|
|
|
@@ -1173,11 +1246,43 @@ table("My Table", data);
|
|
|
1173
1246
|
|
|
1174
1247
|
***
|
|
1175
1248
|
|
|
1249
|
+
#### truncate()
|
|
1250
|
+
|
|
1251
|
+
> **truncate**(`value`, `maxLength`): `string`
|
|
1252
|
+
|
|
1253
|
+
Defined in: [sdk/utils/src/string.ts:65](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/string.ts#L65)
|
|
1254
|
+
|
|
1255
|
+
Truncates a string to a maximum length and appends "..." if it is longer.
|
|
1256
|
+
|
|
1257
|
+
##### Parameters
|
|
1258
|
+
|
|
1259
|
+
| Parameter | Type | Description |
|
|
1260
|
+
| ------ | ------ | ------ |
|
|
1261
|
+
| `value` | `string` | The string to truncate |
|
|
1262
|
+
| `maxLength` | `number` | The maximum length of the string |
|
|
1263
|
+
|
|
1264
|
+
##### Returns
|
|
1265
|
+
|
|
1266
|
+
`string`
|
|
1267
|
+
|
|
1268
|
+
The truncated string or the original string if it is shorter than the maximum length
|
|
1269
|
+
|
|
1270
|
+
##### Example
|
|
1271
|
+
|
|
1272
|
+
```ts
|
|
1273
|
+
import { truncate } from "@settlemint/sdk-utils";
|
|
1274
|
+
|
|
1275
|
+
const truncated = truncate("Hello, world!", 10);
|
|
1276
|
+
// Returns: "Hello, wor..."
|
|
1277
|
+
```
|
|
1278
|
+
|
|
1279
|
+
***
|
|
1280
|
+
|
|
1176
1281
|
#### tryParseJson()
|
|
1177
1282
|
|
|
1178
1283
|
> **tryParseJson**\<`T`\>(`value`, `defaultValue`): `null` \| `T`
|
|
1179
1284
|
|
|
1180
|
-
Defined in: [sdk/utils/src/json.ts:23](https://github.com/settlemint/sdk/blob/v2.
|
|
1285
|
+
Defined in: [sdk/utils/src/json.ts:23](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/json.ts#L23)
|
|
1181
1286
|
|
|
1182
1287
|
Attempts to parse a JSON string into a typed value, returning a default value if parsing fails.
|
|
1183
1288
|
|
|
@@ -1224,7 +1329,7 @@ const invalid = tryParseJson<string[]>(
|
|
|
1224
1329
|
|
|
1225
1330
|
> **validate**\<`T`\>(`schema`, `value`): `T`\[`"_output"`\]
|
|
1226
1331
|
|
|
1227
|
-
Defined in: [sdk/utils/src/validation/validate.ts:16](https://github.com/settlemint/sdk/blob/v2.
|
|
1332
|
+
Defined in: [sdk/utils/src/validation/validate.ts:16](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/validation/validate.ts#L16)
|
|
1228
1333
|
|
|
1229
1334
|
Validates a value against a given Zod schema.
|
|
1230
1335
|
|
|
@@ -1265,7 +1370,7 @@ const validatedId = validate(IdSchema, "550e8400-e29b-41d4-a716-446655440000");
|
|
|
1265
1370
|
|
|
1266
1371
|
> **writeEnv**(`options`): `Promise`\<`void`\>
|
|
1267
1372
|
|
|
1268
|
-
Defined in: [sdk/utils/src/environment/write-env.ts:41](https://github.com/settlemint/sdk/blob/v2.
|
|
1373
|
+
Defined in: [sdk/utils/src/environment/write-env.ts:41](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/environment/write-env.ts#L41)
|
|
1269
1374
|
|
|
1270
1375
|
Writes environment variables to .env files across a project or monorepo
|
|
1271
1376
|
|
|
@@ -1273,9 +1378,9 @@ Writes environment variables to .env files across a project or monorepo
|
|
|
1273
1378
|
|
|
1274
1379
|
| Parameter | Type | Description |
|
|
1275
1380
|
| ------ | ------ | ------ |
|
|
1276
|
-
| `options` | \{ `cwd`: `string`; `env`: `Partial`\<\{ `SETTLEMINT_ACCESS_TOKEN`: `string`; `SETTLEMINT_ACCESSIBLE_PRIVATE_KEY`: `string`; `SETTLEMINT_APPLICATION`: `string`; `SETTLEMINT_BLOCKCHAIN_NETWORK`: `string`; `SETTLEMINT_BLOCKCHAIN_NODE`: `string`; `SETTLEMINT_BLOCKSCOUT`: `string`; `SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT`: `string`; `SETTLEMINT_HASURA`: `string`; `SETTLEMINT_HASURA_ADMIN_SECRET`: `string`; `SETTLEMINT_HASURA_DATABASE_URL`: `string`; `SETTLEMINT_HASURA_ENDPOINT`: `string`; `SETTLEMINT_HD_PRIVATE_KEY`: `string`; `SETTLEMINT_INSTANCE`: `string`; `SETTLEMINT_IPFS`: `string`; `SETTLEMINT_IPFS_API_ENDPOINT`: `string`; `SETTLEMINT_IPFS_GATEWAY_ENDPOINT`: `string`; `SETTLEMINT_IPFS_PINNING_ENDPOINT`: `string`; `SETTLEMINT_LOAD_BALANCER`: `string`; `SETTLEMINT_MINIO`: `string`; `SETTLEMINT_MINIO_ACCESS_KEY`: `string`; `SETTLEMINT_MINIO_ENDPOINT`: `string`; `SETTLEMINT_MINIO_SECRET_KEY`: `string`; `SETTLEMINT_NEW_PROJECT_NAME`: `string`; `SETTLEMINT_PORTAL`: `string`; `SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_PORTAL_REST_ENDPOINT`: `string`; `SETTLEMINT_THEGRAPH`: `string`; `SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH`: `string`; `SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS`: `string`[]; `SETTLEMINT_WORKSPACE`: `string`; \}\>; `prod`: `boolean`; `secrets`: `boolean`; \} | The options for writing the environment variables |
|
|
1277
|
-
| `options.cwd
|
|
1278
|
-
| `options.env` | `Partial`\<\{ `SETTLEMINT_ACCESS_TOKEN`: `string`; `SETTLEMINT_ACCESSIBLE_PRIVATE_KEY`: `string`; `SETTLEMINT_APPLICATION`: `string`; `SETTLEMINT_BLOCKCHAIN_NETWORK`: `string`; `SETTLEMINT_BLOCKCHAIN_NODE`: `string`; `SETTLEMINT_BLOCKSCOUT`: `string`; `SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT`: `string`; `SETTLEMINT_HASURA`: `string`; `SETTLEMINT_HASURA_ADMIN_SECRET`: `string`; `SETTLEMINT_HASURA_DATABASE_URL`: `string`; `SETTLEMINT_HASURA_ENDPOINT`: `string`; `SETTLEMINT_HD_PRIVATE_KEY`: `string`; `SETTLEMINT_INSTANCE`: `string`; `SETTLEMINT_IPFS`: `string`; `SETTLEMINT_IPFS_API_ENDPOINT`: `string`; `SETTLEMINT_IPFS_GATEWAY_ENDPOINT`: `string`; `SETTLEMINT_IPFS_PINNING_ENDPOINT`: `string`; `SETTLEMINT_LOAD_BALANCER`: `string`; `SETTLEMINT_MINIO`: `string`; `SETTLEMINT_MINIO_ACCESS_KEY`: `string`; `SETTLEMINT_MINIO_ENDPOINT`: `string`; `SETTLEMINT_MINIO_SECRET_KEY`: `string`; `SETTLEMINT_NEW_PROJECT_NAME`: `string`; `SETTLEMINT_PORTAL`: `string`; `SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_PORTAL_REST_ENDPOINT`: `string`; `SETTLEMINT_THEGRAPH`: `string`; `SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH`: `string`; `SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS`: `string`[]; `SETTLEMINT_WORKSPACE`: `string`; \}\> | The environment variables to write |
|
|
1381
|
+
| `options` | \{ `cwd`: `string`; `env`: `Partial`\<\{ `SETTLEMINT_ACCESS_TOKEN`: `string`; `SETTLEMINT_ACCESSIBLE_PRIVATE_KEY`: `string`; `SETTLEMINT_APPLICATION`: `string`; `SETTLEMINT_BLOCKCHAIN_NETWORK`: `string`; `SETTLEMINT_BLOCKCHAIN_NODE`: `string`; `SETTLEMINT_BLOCKSCOUT`: `string`; `SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT`: `string`; `SETTLEMINT_HASURA`: `string`; `SETTLEMINT_HASURA_ADMIN_SECRET`: `string`; `SETTLEMINT_HASURA_DATABASE_URL`: `string`; `SETTLEMINT_HASURA_ENDPOINT`: `string`; `SETTLEMINT_HD_PRIVATE_KEY`: `string`; `SETTLEMINT_INSTANCE`: `string`; `SETTLEMINT_IPFS`: `string`; `SETTLEMINT_IPFS_API_ENDPOINT`: `string`; `SETTLEMINT_IPFS_GATEWAY_ENDPOINT`: `string`; `SETTLEMINT_IPFS_PINNING_ENDPOINT`: `string`; `SETTLEMINT_LOAD_BALANCER`: `string`; `SETTLEMINT_LOG_LEVEL`: `"error"` \| `"info"` \| `"warn"` \| `"debug"` \| `"none"`; `SETTLEMINT_MINIO`: `string`; `SETTLEMINT_MINIO_ACCESS_KEY`: `string`; `SETTLEMINT_MINIO_ENDPOINT`: `string`; `SETTLEMINT_MINIO_SECRET_KEY`: `string`; `SETTLEMINT_NEW_PROJECT_NAME`: `string`; `SETTLEMINT_PORTAL`: `string`; `SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_PORTAL_REST_ENDPOINT`: `string`; `SETTLEMINT_THEGRAPH`: `string`; `SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH`: `string`; `SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS`: `string`[]; `SETTLEMINT_WORKSPACE`: `string`; \}\>; `prod`: `boolean`; `secrets`: `boolean`; \} | The options for writing the environment variables |
|
|
1382
|
+
| `options.cwd?` | `string` | The directory to start searching for the package.json file from (defaults to process.cwd()) |
|
|
1383
|
+
| `options.env` | `Partial`\<\{ `SETTLEMINT_ACCESS_TOKEN`: `string`; `SETTLEMINT_ACCESSIBLE_PRIVATE_KEY`: `string`; `SETTLEMINT_APPLICATION`: `string`; `SETTLEMINT_BLOCKCHAIN_NETWORK`: `string`; `SETTLEMINT_BLOCKCHAIN_NODE`: `string`; `SETTLEMINT_BLOCKSCOUT`: `string`; `SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT`: `string`; `SETTLEMINT_HASURA`: `string`; `SETTLEMINT_HASURA_ADMIN_SECRET`: `string`; `SETTLEMINT_HASURA_DATABASE_URL`: `string`; `SETTLEMINT_HASURA_ENDPOINT`: `string`; `SETTLEMINT_HD_PRIVATE_KEY`: `string`; `SETTLEMINT_INSTANCE`: `string`; `SETTLEMINT_IPFS`: `string`; `SETTLEMINT_IPFS_API_ENDPOINT`: `string`; `SETTLEMINT_IPFS_GATEWAY_ENDPOINT`: `string`; `SETTLEMINT_IPFS_PINNING_ENDPOINT`: `string`; `SETTLEMINT_LOAD_BALANCER`: `string`; `SETTLEMINT_LOG_LEVEL`: `"error"` \| `"info"` \| `"warn"` \| `"debug"` \| `"none"`; `SETTLEMINT_MINIO`: `string`; `SETTLEMINT_MINIO_ACCESS_KEY`: `string`; `SETTLEMINT_MINIO_ENDPOINT`: `string`; `SETTLEMINT_MINIO_SECRET_KEY`: `string`; `SETTLEMINT_NEW_PROJECT_NAME`: `string`; `SETTLEMINT_PORTAL`: `string`; `SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_PORTAL_REST_ENDPOINT`: `string`; `SETTLEMINT_THEGRAPH`: `string`; `SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH`: `string`; `SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS`: `string`[]; `SETTLEMINT_WORKSPACE`: `string`; \}\> | The environment variables to write |
|
|
1279
1384
|
| `options.prod` | `boolean` | Whether to write production environment variables |
|
|
1280
1385
|
| `options.secrets` | `boolean` | Whether to write to .env.local files for secrets |
|
|
1281
1386
|
|
|
@@ -1317,7 +1422,7 @@ await writeEnv({
|
|
|
1317
1422
|
|
|
1318
1423
|
#### CancelError
|
|
1319
1424
|
|
|
1320
|
-
Defined in: [sdk/utils/src/terminal/cancel.ts:8](https://github.com/settlemint/sdk/blob/v2.
|
|
1425
|
+
Defined in: [sdk/utils/src/terminal/cancel.ts:8](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/terminal/cancel.ts#L8)
|
|
1321
1426
|
|
|
1322
1427
|
Error class used to indicate that the operation was cancelled.
|
|
1323
1428
|
This error is used to signal that the operation should be aborted.
|
|
@@ -1330,7 +1435,7 @@ This error is used to signal that the operation should be aborted.
|
|
|
1330
1435
|
|
|
1331
1436
|
#### SpinnerError
|
|
1332
1437
|
|
|
1333
|
-
Defined in: [sdk/utils/src/terminal/spinner.ts:11](https://github.com/settlemint/sdk/blob/v2.
|
|
1438
|
+
Defined in: [sdk/utils/src/terminal/spinner.ts:11](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/terminal/spinner.ts#L11)
|
|
1334
1439
|
|
|
1335
1440
|
Error class used to indicate that the spinner operation failed.
|
|
1336
1441
|
This error is used to signal that the operation should be aborted.
|
|
@@ -1343,7 +1448,7 @@ This error is used to signal that the operation should be aborted.
|
|
|
1343
1448
|
|
|
1344
1449
|
#### ExecuteCommandOptions
|
|
1345
1450
|
|
|
1346
|
-
Defined in: [sdk/utils/src/terminal/execute-command.ts:7](https://github.com/settlemint/sdk/blob/v2.
|
|
1451
|
+
Defined in: [sdk/utils/src/terminal/execute-command.ts:7](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/terminal/execute-command.ts#L7)
|
|
1347
1452
|
|
|
1348
1453
|
Options for executing a command, extending SpawnOptionsWithoutStdio
|
|
1349
1454
|
|
|
@@ -1355,13 +1460,47 @@ Options for executing a command, extending SpawnOptionsWithoutStdio
|
|
|
1355
1460
|
|
|
1356
1461
|
| Property | Type | Description | Defined in |
|
|
1357
1462
|
| ------ | ------ | ------ | ------ |
|
|
1358
|
-
| <a id="silent"></a> `silent?` | `boolean` | Whether to suppress output to stdout/stderr | [sdk/utils/src/terminal/execute-command.ts:9](https://github.com/settlemint/sdk/blob/v2.
|
|
1463
|
+
| <a id="silent"></a> `silent?` | `boolean` | Whether to suppress output to stdout/stderr | [sdk/utils/src/terminal/execute-command.ts:9](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/terminal/execute-command.ts#L9) |
|
|
1464
|
+
|
|
1465
|
+
***
|
|
1466
|
+
|
|
1467
|
+
#### Logger
|
|
1468
|
+
|
|
1469
|
+
Defined in: [sdk/utils/src/logging/logger.ts:23](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/logging/logger.ts#L23)
|
|
1470
|
+
|
|
1471
|
+
Simple logger interface with basic logging methods
|
|
1472
|
+
Logger
|
|
1473
|
+
|
|
1474
|
+
##### Properties
|
|
1475
|
+
|
|
1476
|
+
| Property | Type | Description | Defined in |
|
|
1477
|
+
| ------ | ------ | ------ | ------ |
|
|
1478
|
+
| <a id="debug"></a> `debug` | (`message`, ...`args`) => `void` | Log debug information | [sdk/utils/src/logging/logger.ts:25](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/logging/logger.ts#L25) |
|
|
1479
|
+
| <a id="error"></a> `error` | (`message`, ...`args`) => `void` | Log errors | [sdk/utils/src/logging/logger.ts:31](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/logging/logger.ts#L31) |
|
|
1480
|
+
| <a id="info"></a> `info` | (`message`, ...`args`) => `void` | Log general information | [sdk/utils/src/logging/logger.ts:27](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/logging/logger.ts#L27) |
|
|
1481
|
+
| <a id="warn"></a> `warn` | (`message`, ...`args`) => `void` | Log warnings | [sdk/utils/src/logging/logger.ts:29](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/logging/logger.ts#L29) |
|
|
1482
|
+
|
|
1483
|
+
***
|
|
1484
|
+
|
|
1485
|
+
#### LoggerOptions
|
|
1486
|
+
|
|
1487
|
+
Defined in: [sdk/utils/src/logging/logger.ts:12](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/logging/logger.ts#L12)
|
|
1488
|
+
|
|
1489
|
+
Configuration options for the logger
|
|
1490
|
+
LoggerOptions
|
|
1491
|
+
|
|
1492
|
+
##### Properties
|
|
1493
|
+
|
|
1494
|
+
| Property | Type | Description | Defined in |
|
|
1495
|
+
| ------ | ------ | ------ | ------ |
|
|
1496
|
+
| <a id="level"></a> `level?` | [`LogLevel`](#loglevel) | The minimum log level to output | [sdk/utils/src/logging/logger.ts:14](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/logging/logger.ts#L14) |
|
|
1497
|
+
| <a id="prefix"></a> `prefix?` | `string` | The prefix to add to the log message | [sdk/utils/src/logging/logger.ts:16](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/logging/logger.ts#L16) |
|
|
1359
1498
|
|
|
1360
1499
|
***
|
|
1361
1500
|
|
|
1362
1501
|
#### SpinnerOptions\<R\>
|
|
1363
1502
|
|
|
1364
|
-
Defined in: [sdk/utils/src/terminal/spinner.ts:24](https://github.com/settlemint/sdk/blob/v2.
|
|
1503
|
+
Defined in: [sdk/utils/src/terminal/spinner.ts:24](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/terminal/spinner.ts#L24)
|
|
1365
1504
|
|
|
1366
1505
|
Options for configuring the spinner behavior
|
|
1367
1506
|
|
|
@@ -1375,9 +1514,9 @@ Options for configuring the spinner behavior
|
|
|
1375
1514
|
|
|
1376
1515
|
| Property | Type | Description | Defined in |
|
|
1377
1516
|
| ------ | ------ | ------ | ------ |
|
|
1378
|
-
| <a id="startmessage"></a> `startMessage` | `string` | Message to display when spinner starts | [sdk/utils/src/terminal/spinner.ts:26](https://github.com/settlemint/sdk/blob/v2.
|
|
1379
|
-
| <a id="stopmessage"></a> `stopMessage` | `string` | Message to display when spinner completes successfully | [sdk/utils/src/terminal/spinner.ts:30](https://github.com/settlemint/sdk/blob/v2.
|
|
1380
|
-
| <a id="task"></a> `task` | (`spinner
|
|
1517
|
+
| <a id="startmessage"></a> `startMessage` | `string` | Message to display when spinner starts | [sdk/utils/src/terminal/spinner.ts:26](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/terminal/spinner.ts#L26) |
|
|
1518
|
+
| <a id="stopmessage"></a> `stopMessage` | `string` | Message to display when spinner completes successfully | [sdk/utils/src/terminal/spinner.ts:30](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/terminal/spinner.ts#L30) |
|
|
1519
|
+
| <a id="task"></a> `task` | (`spinner?`) => `Promise`\<`R`\> | Async task to execute while spinner is active | [sdk/utils/src/terminal/spinner.ts:28](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/terminal/spinner.ts#L28) |
|
|
1381
1520
|
|
|
1382
1521
|
### Type Aliases
|
|
1383
1522
|
|
|
@@ -1385,7 +1524,7 @@ Options for configuring the spinner behavior
|
|
|
1385
1524
|
|
|
1386
1525
|
> **DotEnv** = `z.infer`\<*typeof* [`DotEnvSchema`](#dotenvschema)\>
|
|
1387
1526
|
|
|
1388
|
-
Defined in: [sdk/utils/src/validation/dot-env.schema.ts:
|
|
1527
|
+
Defined in: [sdk/utils/src/validation/dot-env.schema.ts:91](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/validation/dot-env.schema.ts#L91)
|
|
1389
1528
|
|
|
1390
1529
|
Type definition for the environment variables schema.
|
|
1391
1530
|
|
|
@@ -1395,7 +1534,7 @@ Type definition for the environment variables schema.
|
|
|
1395
1534
|
|
|
1396
1535
|
> **DotEnvPartial** = `z.infer`\<*typeof* [`DotEnvSchemaPartial`](#dotenvschemapartial)\>
|
|
1397
1536
|
|
|
1398
|
-
Defined in: [sdk/utils/src/validation/dot-env.schema.ts:
|
|
1537
|
+
Defined in: [sdk/utils/src/validation/dot-env.schema.ts:102](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/validation/dot-env.schema.ts#L102)
|
|
1399
1538
|
|
|
1400
1539
|
Type definition for the partial environment variables schema.
|
|
1401
1540
|
|
|
@@ -1405,18 +1544,28 @@ Type definition for the partial environment variables schema.
|
|
|
1405
1544
|
|
|
1406
1545
|
> **Id** = `z.infer`\<*typeof* [`IdSchema`](#idschema)\>
|
|
1407
1546
|
|
|
1408
|
-
Defined in: [sdk/utils/src/validation/id.schema.ts:30](https://github.com/settlemint/sdk/blob/v2.
|
|
1547
|
+
Defined in: [sdk/utils/src/validation/id.schema.ts:30](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/validation/id.schema.ts#L30)
|
|
1409
1548
|
|
|
1410
1549
|
Type definition for database IDs, inferred from IdSchema.
|
|
1411
1550
|
Can be either a PostgreSQL UUID string or MongoDB ObjectID string.
|
|
1412
1551
|
|
|
1552
|
+
***
|
|
1553
|
+
|
|
1554
|
+
#### LogLevel
|
|
1555
|
+
|
|
1556
|
+
> **LogLevel** = `"debug"` \| `"info"` \| `"warn"` \| `"error"` \| `"none"`
|
|
1557
|
+
|
|
1558
|
+
Defined in: [sdk/utils/src/logging/logger.ts:6](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/logging/logger.ts#L6)
|
|
1559
|
+
|
|
1560
|
+
Log levels supported by the logger
|
|
1561
|
+
|
|
1413
1562
|
### Variables
|
|
1414
1563
|
|
|
1415
1564
|
#### AccessTokenSchema
|
|
1416
1565
|
|
|
1417
1566
|
> `const` **AccessTokenSchema**: `ZodString`
|
|
1418
1567
|
|
|
1419
|
-
Defined in: [sdk/utils/src/validation/access-token.schema.ts:21](https://github.com/settlemint/sdk/blob/v2.
|
|
1568
|
+
Defined in: [sdk/utils/src/validation/access-token.schema.ts:21](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/validation/access-token.schema.ts#L21)
|
|
1420
1569
|
|
|
1421
1570
|
Schema for validating both application and personal access tokens.
|
|
1422
1571
|
Accepts tokens starting with either 'sm_pat_' or 'sm_aat_' prefix.
|
|
@@ -1427,7 +1576,7 @@ Accepts tokens starting with either 'sm_pat_' or 'sm_aat_' prefix.
|
|
|
1427
1576
|
|
|
1428
1577
|
> `const` **ApplicationAccessTokenSchema**: `ZodString`
|
|
1429
1578
|
|
|
1430
|
-
Defined in: [sdk/utils/src/validation/access-token.schema.ts:7](https://github.com/settlemint/sdk/blob/v2.
|
|
1579
|
+
Defined in: [sdk/utils/src/validation/access-token.schema.ts:7](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/validation/access-token.schema.ts#L7)
|
|
1431
1580
|
|
|
1432
1581
|
Schema for validating application access tokens.
|
|
1433
1582
|
Application access tokens start with 'sm_aat_' prefix.
|
|
@@ -1436,9 +1585,9 @@ Application access tokens start with 'sm_aat_' prefix.
|
|
|
1436
1585
|
|
|
1437
1586
|
#### DotEnvSchema
|
|
1438
1587
|
|
|
1439
|
-
> `const` **DotEnvSchema**: `ZodObject`\<\{ `SETTLEMINT_ACCESS_TOKEN`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_ACCESSIBLE_PRIVATE_KEY`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_APPLICATION`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_BLOCKCHAIN_NETWORK`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_BLOCKCHAIN_NODE`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_BLOCKSCOUT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_CUSTOM_DEPLOYMENT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_HASURA`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_HASURA_ADMIN_SECRET`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_HASURA_DATABASE_URL`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_HASURA_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_HD_PRIVATE_KEY`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_INSTANCE`: `ZodDefault`\<`ZodString`\>; `SETTLEMINT_IPFS`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_IPFS_API_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_IPFS_GATEWAY_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_IPFS_PINNING_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_LOAD_BALANCER`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_MINIO`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_MINIO_ACCESS_KEY`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_MINIO_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_MINIO_SECRET_KEY`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_NEW_PROJECT_NAME`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_PORTAL`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_PORTAL_REST_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_THEGRAPH`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS`: `ZodEffects`\<`ZodOptional`\<`ZodArray`\<`ZodString`, `"many"`\>\>, `undefined` \| `string`[], `unknown`\>; `SETTLEMINT_WORKSPACE`: `ZodOptional`\<`ZodString`\>; \}, `"strip"`, `ZodTypeAny`, \{ `SETTLEMINT_ACCESS_TOKEN`: `string`; `SETTLEMINT_ACCESSIBLE_PRIVATE_KEY`: `string`; `SETTLEMINT_APPLICATION`: `string`; `SETTLEMINT_BLOCKCHAIN_NETWORK`: `string`; `SETTLEMINT_BLOCKCHAIN_NODE`: `string`; `SETTLEMINT_BLOCKSCOUT`: `string`; `SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT`: `string`; `SETTLEMINT_HASURA`: `string`; `SETTLEMINT_HASURA_ADMIN_SECRET`: `string`; `SETTLEMINT_HASURA_DATABASE_URL`: `string`; `SETTLEMINT_HASURA_ENDPOINT`: `string`; `SETTLEMINT_HD_PRIVATE_KEY`: `string`; `SETTLEMINT_INSTANCE`: `string`; `SETTLEMINT_IPFS`: `string`; `SETTLEMINT_IPFS_API_ENDPOINT`: `string`; `SETTLEMINT_IPFS_GATEWAY_ENDPOINT`: `string`; `SETTLEMINT_IPFS_PINNING_ENDPOINT`: `string`; `SETTLEMINT_LOAD_BALANCER`: `string`; `SETTLEMINT_MINIO`: `string`; `SETTLEMINT_MINIO_ACCESS_KEY`: `string`; `SETTLEMINT_MINIO_ENDPOINT`: `string`; `SETTLEMINT_MINIO_SECRET_KEY`: `string`; `SETTLEMINT_NEW_PROJECT_NAME`: `string`; `SETTLEMINT_PORTAL`: `string`; `SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_PORTAL_REST_ENDPOINT`: `string`; `SETTLEMINT_THEGRAPH`: `string`; `SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH`: `string`; `SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS`: `string`[]; `SETTLEMINT_WORKSPACE`: `string`; \}, \{ `SETTLEMINT_ACCESS_TOKEN`: `string`; `SETTLEMINT_ACCESSIBLE_PRIVATE_KEY`: `string`; `SETTLEMINT_APPLICATION`: `string`; `SETTLEMINT_BLOCKCHAIN_NETWORK`: `string`; `SETTLEMINT_BLOCKCHAIN_NODE`: `string`; `SETTLEMINT_BLOCKSCOUT`: `string`; `SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT`: `string`; `SETTLEMINT_HASURA`: `string`; `SETTLEMINT_HASURA_ADMIN_SECRET`: `string`; `SETTLEMINT_HASURA_DATABASE_URL`: `string`; `SETTLEMINT_HASURA_ENDPOINT`: `string`; `SETTLEMINT_HD_PRIVATE_KEY`: `string`; `SETTLEMINT_INSTANCE`: `string`; `SETTLEMINT_IPFS`: `string`; `SETTLEMINT_IPFS_API_ENDPOINT`: `string`; `SETTLEMINT_IPFS_GATEWAY_ENDPOINT`: `string`; `SETTLEMINT_IPFS_PINNING_ENDPOINT`: `string`; `SETTLEMINT_LOAD_BALANCER`: `string`; `SETTLEMINT_MINIO`: `string`; `SETTLEMINT_MINIO_ACCESS_KEY`: `string`; `SETTLEMINT_MINIO_ENDPOINT`: `string`; `SETTLEMINT_MINIO_SECRET_KEY`: `string`; `SETTLEMINT_NEW_PROJECT_NAME`: `string`; `SETTLEMINT_PORTAL`: `string`; `SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_PORTAL_REST_ENDPOINT`: `string`; `SETTLEMINT_THEGRAPH`: `string`; `SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH`: `string`; `SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS`: `unknown`; `SETTLEMINT_WORKSPACE`: `string`; \}\>
|
|
1588
|
+
> `const` **DotEnvSchema**: `ZodObject`\<\{ `SETTLEMINT_ACCESS_TOKEN`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_ACCESSIBLE_PRIVATE_KEY`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_APPLICATION`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_BLOCKCHAIN_NETWORK`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_BLOCKCHAIN_NODE`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_BLOCKSCOUT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_CUSTOM_DEPLOYMENT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_HASURA`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_HASURA_ADMIN_SECRET`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_HASURA_DATABASE_URL`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_HASURA_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_HD_PRIVATE_KEY`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_INSTANCE`: `ZodDefault`\<`ZodString`\>; `SETTLEMINT_IPFS`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_IPFS_API_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_IPFS_GATEWAY_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_IPFS_PINNING_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_LOAD_BALANCER`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_LOG_LEVEL`: `ZodDefault`\<`ZodEnum`\<\[`"debug"`, `"info"`, `"warn"`, `"error"`, `"none"`\]\>\>; `SETTLEMINT_MINIO`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_MINIO_ACCESS_KEY`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_MINIO_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_MINIO_SECRET_KEY`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_NEW_PROJECT_NAME`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_PORTAL`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_PORTAL_REST_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_THEGRAPH`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS`: `ZodEffects`\<`ZodOptional`\<`ZodArray`\<`ZodString`, `"many"`\>\>, `undefined` \| `string`[], `unknown`\>; `SETTLEMINT_WORKSPACE`: `ZodOptional`\<`ZodString`\>; \}, `"strip"`, `ZodTypeAny`, \{ `SETTLEMINT_ACCESS_TOKEN`: `string`; `SETTLEMINT_ACCESSIBLE_PRIVATE_KEY`: `string`; `SETTLEMINT_APPLICATION`: `string`; `SETTLEMINT_BLOCKCHAIN_NETWORK`: `string`; `SETTLEMINT_BLOCKCHAIN_NODE`: `string`; `SETTLEMINT_BLOCKSCOUT`: `string`; `SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT`: `string`; `SETTLEMINT_HASURA`: `string`; `SETTLEMINT_HASURA_ADMIN_SECRET`: `string`; `SETTLEMINT_HASURA_DATABASE_URL`: `string`; `SETTLEMINT_HASURA_ENDPOINT`: `string`; `SETTLEMINT_HD_PRIVATE_KEY`: `string`; `SETTLEMINT_INSTANCE`: `string`; `SETTLEMINT_IPFS`: `string`; `SETTLEMINT_IPFS_API_ENDPOINT`: `string`; `SETTLEMINT_IPFS_GATEWAY_ENDPOINT`: `string`; `SETTLEMINT_IPFS_PINNING_ENDPOINT`: `string`; `SETTLEMINT_LOAD_BALANCER`: `string`; `SETTLEMINT_LOG_LEVEL`: `"error"` \| `"info"` \| `"warn"` \| `"debug"` \| `"none"`; `SETTLEMINT_MINIO`: `string`; `SETTLEMINT_MINIO_ACCESS_KEY`: `string`; `SETTLEMINT_MINIO_ENDPOINT`: `string`; `SETTLEMINT_MINIO_SECRET_KEY`: `string`; `SETTLEMINT_NEW_PROJECT_NAME`: `string`; `SETTLEMINT_PORTAL`: `string`; `SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_PORTAL_REST_ENDPOINT`: `string`; `SETTLEMINT_THEGRAPH`: `string`; `SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH`: `string`; `SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS`: `string`[]; `SETTLEMINT_WORKSPACE`: `string`; \}, \{ `SETTLEMINT_ACCESS_TOKEN`: `string`; `SETTLEMINT_ACCESSIBLE_PRIVATE_KEY`: `string`; `SETTLEMINT_APPLICATION`: `string`; `SETTLEMINT_BLOCKCHAIN_NETWORK`: `string`; `SETTLEMINT_BLOCKCHAIN_NODE`: `string`; `SETTLEMINT_BLOCKSCOUT`: `string`; `SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT`: `string`; `SETTLEMINT_HASURA`: `string`; `SETTLEMINT_HASURA_ADMIN_SECRET`: `string`; `SETTLEMINT_HASURA_DATABASE_URL`: `string`; `SETTLEMINT_HASURA_ENDPOINT`: `string`; `SETTLEMINT_HD_PRIVATE_KEY`: `string`; `SETTLEMINT_INSTANCE`: `string`; `SETTLEMINT_IPFS`: `string`; `SETTLEMINT_IPFS_API_ENDPOINT`: `string`; `SETTLEMINT_IPFS_GATEWAY_ENDPOINT`: `string`; `SETTLEMINT_IPFS_PINNING_ENDPOINT`: `string`; `SETTLEMINT_LOAD_BALANCER`: `string`; `SETTLEMINT_LOG_LEVEL`: `"error"` \| `"info"` \| `"warn"` \| `"debug"` \| `"none"`; `SETTLEMINT_MINIO`: `string`; `SETTLEMINT_MINIO_ACCESS_KEY`: `string`; `SETTLEMINT_MINIO_ENDPOINT`: `string`; `SETTLEMINT_MINIO_SECRET_KEY`: `string`; `SETTLEMINT_NEW_PROJECT_NAME`: `string`; `SETTLEMINT_PORTAL`: `string`; `SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_PORTAL_REST_ENDPOINT`: `string`; `SETTLEMINT_THEGRAPH`: `string`; `SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH`: `string`; `SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS`: `unknown`; `SETTLEMINT_WORKSPACE`: `string`; \}\>
|
|
1440
1589
|
|
|
1441
|
-
Defined in: [sdk/utils/src/validation/dot-env.schema.ts:12](https://github.com/settlemint/sdk/blob/v2.
|
|
1590
|
+
Defined in: [sdk/utils/src/validation/dot-env.schema.ts:12](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/validation/dot-env.schema.ts#L12)
|
|
1442
1591
|
|
|
1443
1592
|
Schema for validating environment variables used by the SettleMint SDK.
|
|
1444
1593
|
Defines validation rules and types for configuration values like URLs,
|
|
@@ -1448,9 +1597,9 @@ access tokens, workspace names, and service endpoints.
|
|
|
1448
1597
|
|
|
1449
1598
|
#### DotEnvSchemaPartial
|
|
1450
1599
|
|
|
1451
|
-
> `const` **DotEnvSchemaPartial**: `ZodObject`\<\{ `SETTLEMINT_ACCESS_TOKEN`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_ACCESSIBLE_PRIVATE_KEY`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_APPLICATION`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_BLOCKCHAIN_NETWORK`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_BLOCKCHAIN_NODE`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_BLOCKSCOUT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_CUSTOM_DEPLOYMENT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_HASURA`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_HASURA_ADMIN_SECRET`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_HASURA_DATABASE_URL`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_HASURA_ENDPOINT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_HD_PRIVATE_KEY`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_INSTANCE`: `ZodOptional`\<`ZodDefault`\<`ZodString`\>\>; `SETTLEMINT_IPFS`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_IPFS_API_ENDPOINT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_IPFS_GATEWAY_ENDPOINT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_IPFS_PINNING_ENDPOINT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_LOAD_BALANCER`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_MINIO`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_MINIO_ACCESS_KEY`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_MINIO_ENDPOINT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_MINIO_SECRET_KEY`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_NEW_PROJECT_NAME`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_PORTAL`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_PORTAL_REST_ENDPOINT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_THEGRAPH`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS`: `ZodOptional`\<`ZodEffects`\<`ZodOptional`\<`ZodArray`\<`ZodString`, `"many"`\>\>, `undefined` \| `string`[], `unknown`\>\>; `SETTLEMINT_WORKSPACE`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; \}, `"strip"`, `ZodTypeAny`, \{ `SETTLEMINT_ACCESS_TOKEN`: `string`; `SETTLEMINT_ACCESSIBLE_PRIVATE_KEY`: `string`; `SETTLEMINT_APPLICATION`: `string`; `SETTLEMINT_BLOCKCHAIN_NETWORK`: `string`; `SETTLEMINT_BLOCKCHAIN_NODE`: `string`; `SETTLEMINT_BLOCKSCOUT`: `string`; `SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT`: `string`; `SETTLEMINT_HASURA`: `string`; `SETTLEMINT_HASURA_ADMIN_SECRET`: `string`; `SETTLEMINT_HASURA_DATABASE_URL`: `string`; `SETTLEMINT_HASURA_ENDPOINT`: `string`; `SETTLEMINT_HD_PRIVATE_KEY`: `string`; `SETTLEMINT_INSTANCE`: `string`; `SETTLEMINT_IPFS`: `string`; `SETTLEMINT_IPFS_API_ENDPOINT`: `string`; `SETTLEMINT_IPFS_GATEWAY_ENDPOINT`: `string`; `SETTLEMINT_IPFS_PINNING_ENDPOINT`: `string`; `SETTLEMINT_LOAD_BALANCER`: `string`; `SETTLEMINT_MINIO`: `string`; `SETTLEMINT_MINIO_ACCESS_KEY`: `string`; `SETTLEMINT_MINIO_ENDPOINT`: `string`; `SETTLEMINT_MINIO_SECRET_KEY`: `string`; `SETTLEMINT_NEW_PROJECT_NAME`: `string`; `SETTLEMINT_PORTAL`: `string`; `SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_PORTAL_REST_ENDPOINT`: `string`; `SETTLEMINT_THEGRAPH`: `string`; `SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH`: `string`; `SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS`: `string`[]; `SETTLEMINT_WORKSPACE`: `string`; \}, \{ `SETTLEMINT_ACCESS_TOKEN`: `string`; `SETTLEMINT_ACCESSIBLE_PRIVATE_KEY`: `string`; `SETTLEMINT_APPLICATION`: `string`; `SETTLEMINT_BLOCKCHAIN_NETWORK`: `string`; `SETTLEMINT_BLOCKCHAIN_NODE`: `string`; `SETTLEMINT_BLOCKSCOUT`: `string`; `SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT`: `string`; `SETTLEMINT_HASURA`: `string`; `SETTLEMINT_HASURA_ADMIN_SECRET`: `string`; `SETTLEMINT_HASURA_DATABASE_URL`: `string`; `SETTLEMINT_HASURA_ENDPOINT`: `string`; `SETTLEMINT_HD_PRIVATE_KEY`: `string`; `SETTLEMINT_INSTANCE`: `string`; `SETTLEMINT_IPFS`: `string`; `SETTLEMINT_IPFS_API_ENDPOINT`: `string`; `SETTLEMINT_IPFS_GATEWAY_ENDPOINT`: `string`; `SETTLEMINT_IPFS_PINNING_ENDPOINT`: `string`; `SETTLEMINT_LOAD_BALANCER`: `string`; `SETTLEMINT_MINIO`: `string`; `SETTLEMINT_MINIO_ACCESS_KEY`: `string`; `SETTLEMINT_MINIO_ENDPOINT`: `string`; `SETTLEMINT_MINIO_SECRET_KEY`: `string`; `SETTLEMINT_NEW_PROJECT_NAME`: `string`; `SETTLEMINT_PORTAL`: `string`; `SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_PORTAL_REST_ENDPOINT`: `string`; `SETTLEMINT_THEGRAPH`: `string`; `SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH`: `string`; `SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS`: `unknown`; `SETTLEMINT_WORKSPACE`: `string`; \}\>
|
|
1600
|
+
> `const` **DotEnvSchemaPartial**: `ZodObject`\<\{ `SETTLEMINT_ACCESS_TOKEN`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_ACCESSIBLE_PRIVATE_KEY`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_APPLICATION`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_BLOCKCHAIN_NETWORK`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_BLOCKCHAIN_NODE`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_BLOCKSCOUT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_CUSTOM_DEPLOYMENT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_HASURA`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_HASURA_ADMIN_SECRET`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_HASURA_DATABASE_URL`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_HASURA_ENDPOINT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_HD_PRIVATE_KEY`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_INSTANCE`: `ZodOptional`\<`ZodDefault`\<`ZodString`\>\>; `SETTLEMINT_IPFS`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_IPFS_API_ENDPOINT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_IPFS_GATEWAY_ENDPOINT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_IPFS_PINNING_ENDPOINT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_LOAD_BALANCER`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_LOG_LEVEL`: `ZodOptional`\<`ZodDefault`\<`ZodEnum`\<\[`"debug"`, `"info"`, `"warn"`, `"error"`, `"none"`\]\>\>\>; `SETTLEMINT_MINIO`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_MINIO_ACCESS_KEY`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_MINIO_ENDPOINT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_MINIO_SECRET_KEY`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_NEW_PROJECT_NAME`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_PORTAL`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_PORTAL_REST_ENDPOINT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_THEGRAPH`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS`: `ZodOptional`\<`ZodEffects`\<`ZodOptional`\<`ZodArray`\<`ZodString`, `"many"`\>\>, `undefined` \| `string`[], `unknown`\>\>; `SETTLEMINT_WORKSPACE`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; \}, `"strip"`, `ZodTypeAny`, \{ `SETTLEMINT_ACCESS_TOKEN`: `string`; `SETTLEMINT_ACCESSIBLE_PRIVATE_KEY`: `string`; `SETTLEMINT_APPLICATION`: `string`; `SETTLEMINT_BLOCKCHAIN_NETWORK`: `string`; `SETTLEMINT_BLOCKCHAIN_NODE`: `string`; `SETTLEMINT_BLOCKSCOUT`: `string`; `SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT`: `string`; `SETTLEMINT_HASURA`: `string`; `SETTLEMINT_HASURA_ADMIN_SECRET`: `string`; `SETTLEMINT_HASURA_DATABASE_URL`: `string`; `SETTLEMINT_HASURA_ENDPOINT`: `string`; `SETTLEMINT_HD_PRIVATE_KEY`: `string`; `SETTLEMINT_INSTANCE`: `string`; `SETTLEMINT_IPFS`: `string`; `SETTLEMINT_IPFS_API_ENDPOINT`: `string`; `SETTLEMINT_IPFS_GATEWAY_ENDPOINT`: `string`; `SETTLEMINT_IPFS_PINNING_ENDPOINT`: `string`; `SETTLEMINT_LOAD_BALANCER`: `string`; `SETTLEMINT_LOG_LEVEL`: `"error"` \| `"info"` \| `"warn"` \| `"debug"` \| `"none"`; `SETTLEMINT_MINIO`: `string`; `SETTLEMINT_MINIO_ACCESS_KEY`: `string`; `SETTLEMINT_MINIO_ENDPOINT`: `string`; `SETTLEMINT_MINIO_SECRET_KEY`: `string`; `SETTLEMINT_NEW_PROJECT_NAME`: `string`; `SETTLEMINT_PORTAL`: `string`; `SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_PORTAL_REST_ENDPOINT`: `string`; `SETTLEMINT_THEGRAPH`: `string`; `SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH`: `string`; `SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS`: `string`[]; `SETTLEMINT_WORKSPACE`: `string`; \}, \{ `SETTLEMINT_ACCESS_TOKEN`: `string`; `SETTLEMINT_ACCESSIBLE_PRIVATE_KEY`: `string`; `SETTLEMINT_APPLICATION`: `string`; `SETTLEMINT_BLOCKCHAIN_NETWORK`: `string`; `SETTLEMINT_BLOCKCHAIN_NODE`: `string`; `SETTLEMINT_BLOCKSCOUT`: `string`; `SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT`: `string`; `SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT`: `string`; `SETTLEMINT_HASURA`: `string`; `SETTLEMINT_HASURA_ADMIN_SECRET`: `string`; `SETTLEMINT_HASURA_DATABASE_URL`: `string`; `SETTLEMINT_HASURA_ENDPOINT`: `string`; `SETTLEMINT_HD_PRIVATE_KEY`: `string`; `SETTLEMINT_INSTANCE`: `string`; `SETTLEMINT_IPFS`: `string`; `SETTLEMINT_IPFS_API_ENDPOINT`: `string`; `SETTLEMINT_IPFS_GATEWAY_ENDPOINT`: `string`; `SETTLEMINT_IPFS_PINNING_ENDPOINT`: `string`; `SETTLEMINT_LOAD_BALANCER`: `string`; `SETTLEMINT_LOG_LEVEL`: `"error"` \| `"info"` \| `"warn"` \| `"debug"` \| `"none"`; `SETTLEMINT_MINIO`: `string`; `SETTLEMINT_MINIO_ACCESS_KEY`: `string`; `SETTLEMINT_MINIO_ENDPOINT`: `string`; `SETTLEMINT_MINIO_SECRET_KEY`: `string`; `SETTLEMINT_NEW_PROJECT_NAME`: `string`; `SETTLEMINT_PORTAL`: `string`; `SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT`: `string`; `SETTLEMINT_PORTAL_REST_ENDPOINT`: `string`; `SETTLEMINT_THEGRAPH`: `string`; `SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH`: `string`; `SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS`: `unknown`; `SETTLEMINT_WORKSPACE`: `string`; \}\>
|
|
1452
1601
|
|
|
1453
|
-
Defined in: [sdk/utils/src/validation/dot-env.schema.ts:
|
|
1602
|
+
Defined in: [sdk/utils/src/validation/dot-env.schema.ts:97](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/validation/dot-env.schema.ts#L97)
|
|
1454
1603
|
|
|
1455
1604
|
Partial version of the environment variables schema where all fields are optional.
|
|
1456
1605
|
Useful for validating incomplete configurations during development or build time.
|
|
@@ -1461,7 +1610,7 @@ Useful for validating incomplete configurations during development or build time
|
|
|
1461
1610
|
|
|
1462
1611
|
> `const` **IdSchema**: `ZodUnion`\<\[`ZodString`, `ZodString`\]\>
|
|
1463
1612
|
|
|
1464
|
-
Defined in: [sdk/utils/src/validation/id.schema.ts:17](https://github.com/settlemint/sdk/blob/v2.
|
|
1613
|
+
Defined in: [sdk/utils/src/validation/id.schema.ts:17](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/validation/id.schema.ts#L17)
|
|
1465
1614
|
|
|
1466
1615
|
Schema for validating database IDs. Accepts both PostgreSQL UUIDs and MongoDB ObjectIDs.
|
|
1467
1616
|
PostgreSQL UUIDs are 32 hexadecimal characters with hyphens (e.g. 123e4567-e89b-12d3-a456-426614174000).
|
|
@@ -1485,7 +1634,7 @@ const isValidObjectId = IdSchema.safeParse("507f1f77bcf86cd799439011").success;
|
|
|
1485
1634
|
|
|
1486
1635
|
> `const` **PersonalAccessTokenSchema**: `ZodString`
|
|
1487
1636
|
|
|
1488
|
-
Defined in: [sdk/utils/src/validation/access-token.schema.ts:14](https://github.com/settlemint/sdk/blob/v2.
|
|
1637
|
+
Defined in: [sdk/utils/src/validation/access-token.schema.ts:14](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/validation/access-token.schema.ts#L14)
|
|
1489
1638
|
|
|
1490
1639
|
Schema for validating personal access tokens.
|
|
1491
1640
|
Personal access tokens start with 'sm_pat_' prefix.
|
|
@@ -1496,7 +1645,7 @@ Personal access tokens start with 'sm_pat_' prefix.
|
|
|
1496
1645
|
|
|
1497
1646
|
> `const` **runsInBrowser**: `boolean` = `isBrowser`
|
|
1498
1647
|
|
|
1499
|
-
Defined in: [sdk/utils/src/runtime/ensure-server.ts:40](https://github.com/settlemint/sdk/blob/v2.
|
|
1648
|
+
Defined in: [sdk/utils/src/runtime/ensure-server.ts:40](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/runtime/ensure-server.ts#L40)
|
|
1500
1649
|
|
|
1501
1650
|
Boolean indicating if code is currently running in a browser environment
|
|
1502
1651
|
|
|
@@ -1506,7 +1655,7 @@ Boolean indicating if code is currently running in a browser environment
|
|
|
1506
1655
|
|
|
1507
1656
|
> `const` **runsOnServer**: `boolean` = `!isBrowser`
|
|
1508
1657
|
|
|
1509
|
-
Defined in: [sdk/utils/src/runtime/ensure-server.ts:45](https://github.com/settlemint/sdk/blob/v2.
|
|
1658
|
+
Defined in: [sdk/utils/src/runtime/ensure-server.ts:45](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/runtime/ensure-server.ts#L45)
|
|
1510
1659
|
|
|
1511
1660
|
Boolean indicating if code is currently running in a server environment
|
|
1512
1661
|
|
|
@@ -1516,7 +1665,7 @@ Boolean indicating if code is currently running in a server environment
|
|
|
1516
1665
|
|
|
1517
1666
|
> `const` **UniqueNameSchema**: `ZodString`
|
|
1518
1667
|
|
|
1519
|
-
Defined in: [sdk/utils/src/validation/unique-name.schema.ts:19](https://github.com/settlemint/sdk/blob/v2.
|
|
1668
|
+
Defined in: [sdk/utils/src/validation/unique-name.schema.ts:19](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/validation/unique-name.schema.ts#L19)
|
|
1520
1669
|
|
|
1521
1670
|
Schema for validating unique names used across the SettleMint platform.
|
|
1522
1671
|
Only accepts lowercase alphanumeric characters and hyphens.
|
|
@@ -1542,7 +1691,7 @@ const isInvalidName = UniqueNameSchema.safeParse("My Workspace!").success;
|
|
|
1542
1691
|
|
|
1543
1692
|
> `const` **UrlOrPathSchema**: `ZodUnion`\<\[`ZodString`, `ZodString`\]\>
|
|
1544
1693
|
|
|
1545
|
-
Defined in: [sdk/utils/src/validation/url.schema.ts:54](https://github.com/settlemint/sdk/blob/v2.
|
|
1694
|
+
Defined in: [sdk/utils/src/validation/url.schema.ts:54](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/validation/url.schema.ts#L54)
|
|
1546
1695
|
|
|
1547
1696
|
Schema that accepts either a full URL or a URL path.
|
|
1548
1697
|
|
|
@@ -1566,7 +1715,7 @@ const isValidPath = UrlOrPathSchema.safeParse("/api/v1/users").success;
|
|
|
1566
1715
|
|
|
1567
1716
|
> `const` **UrlPathSchema**: `ZodString`
|
|
1568
1717
|
|
|
1569
|
-
Defined in: [sdk/utils/src/validation/url.schema.ts:34](https://github.com/settlemint/sdk/blob/v2.
|
|
1718
|
+
Defined in: [sdk/utils/src/validation/url.schema.ts:34](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/validation/url.schema.ts#L34)
|
|
1570
1719
|
|
|
1571
1720
|
Schema for validating URL paths.
|
|
1572
1721
|
|
|
@@ -1590,7 +1739,7 @@ const isInvalidPath = UrlPathSchema.safeParse("not-a-path").success;
|
|
|
1590
1739
|
|
|
1591
1740
|
> `const` **UrlSchema**: `ZodString`
|
|
1592
1741
|
|
|
1593
|
-
Defined in: [sdk/utils/src/validation/url.schema.ts:17](https://github.com/settlemint/sdk/blob/v2.
|
|
1742
|
+
Defined in: [sdk/utils/src/validation/url.schema.ts:17](https://github.com/settlemint/sdk/blob/v2.1.1/sdk/utils/src/validation/url.schema.ts#L17)
|
|
1594
1743
|
|
|
1595
1744
|
Schema for validating URLs.
|
|
1596
1745
|
|