@settlemint/sdk-utils 2.3.13-pr8f704556 → 2.3.14-main8c09034e
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 +78 -78
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -113,7 +113,7 @@ The SettleMint Utils SDK provides a collection of shared utilities and helper fu
|
|
|
113
113
|
|
|
114
114
|
> **ascii**(): `void`
|
|
115
115
|
|
|
116
|
-
Defined in: [sdk/utils/src/terminal/ascii.ts:14](https://github.com/settlemint/sdk/blob/v2.3.
|
|
116
|
+
Defined in: [sdk/utils/src/terminal/ascii.ts:14](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/terminal/ascii.ts#L14)
|
|
117
117
|
|
|
118
118
|
Prints the SettleMint ASCII art logo to the console in magenta color.
|
|
119
119
|
Used for CLI branding and visual identification.
|
|
@@ -137,7 +137,7 @@ ascii();
|
|
|
137
137
|
|
|
138
138
|
> **camelCaseToWords**(`s`): `string`
|
|
139
139
|
|
|
140
|
-
Defined in: [sdk/utils/src/string.ts:29](https://github.com/settlemint/sdk/blob/v2.3.
|
|
140
|
+
Defined in: [sdk/utils/src/string.ts:29](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/string.ts#L29)
|
|
141
141
|
|
|
142
142
|
Converts a camelCase string to a human-readable string.
|
|
143
143
|
|
|
@@ -168,7 +168,7 @@ const words = camelCaseToWords("camelCaseString");
|
|
|
168
168
|
|
|
169
169
|
> **cancel**(`msg`): `never`
|
|
170
170
|
|
|
171
|
-
Defined in: [sdk/utils/src/terminal/cancel.ts:23](https://github.com/settlemint/sdk/blob/v2.3.
|
|
171
|
+
Defined in: [sdk/utils/src/terminal/cancel.ts:23](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/terminal/cancel.ts#L23)
|
|
172
172
|
|
|
173
173
|
Displays an error message in red inverse text and throws a CancelError.
|
|
174
174
|
Used to terminate execution with a visible error message.
|
|
@@ -201,7 +201,7 @@ cancel("An error occurred");
|
|
|
201
201
|
|
|
202
202
|
> **capitalizeFirstLetter**(`val`): `string`
|
|
203
203
|
|
|
204
|
-
Defined in: [sdk/utils/src/string.ts:13](https://github.com/settlemint/sdk/blob/v2.3.
|
|
204
|
+
Defined in: [sdk/utils/src/string.ts:13](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/string.ts#L13)
|
|
205
205
|
|
|
206
206
|
Capitalizes the first letter of a string.
|
|
207
207
|
|
|
@@ -232,7 +232,7 @@ const capitalized = capitalizeFirstLetter("hello");
|
|
|
232
232
|
|
|
233
233
|
> **createLogger**(`options`): [`Logger`](#logger)
|
|
234
234
|
|
|
235
|
-
Defined in: [sdk/utils/src/logging/logger.ts:50](https://github.com/settlemint/sdk/blob/v2.3.
|
|
235
|
+
Defined in: [sdk/utils/src/logging/logger.ts:50](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/logging/logger.ts#L50)
|
|
236
236
|
|
|
237
237
|
Creates a simple logger with configurable log level
|
|
238
238
|
|
|
@@ -265,7 +265,7 @@ logger.error('Operation failed', new Error('Connection timeout'));
|
|
|
265
265
|
|
|
266
266
|
> **emptyDir**(`dir`): `Promise`\<`void`\>
|
|
267
267
|
|
|
268
|
-
Defined in: [sdk/utils/src/package-manager/download-and-extract.ts:45](https://github.com/settlemint/sdk/blob/v2.3.
|
|
268
|
+
Defined in: [sdk/utils/src/package-manager/download-and-extract.ts:45](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/package-manager/download-and-extract.ts#L45)
|
|
269
269
|
|
|
270
270
|
Removes all contents of a directory except the .git folder
|
|
271
271
|
|
|
@@ -293,7 +293,7 @@ await emptyDir("/path/to/dir"); // Removes all contents except .git
|
|
|
293
293
|
|
|
294
294
|
> **ensureBrowser**(): `void`
|
|
295
295
|
|
|
296
|
-
Defined in: [sdk/utils/src/runtime/ensure-server.ts:31](https://github.com/settlemint/sdk/blob/v2.3.
|
|
296
|
+
Defined in: [sdk/utils/src/runtime/ensure-server.ts:31](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/runtime/ensure-server.ts#L31)
|
|
297
297
|
|
|
298
298
|
Ensures that code is running in a browser environment and not on the server.
|
|
299
299
|
|
|
@@ -320,7 +320,7 @@ ensureBrowser();
|
|
|
320
320
|
|
|
321
321
|
> **ensureServer**(): `void`
|
|
322
322
|
|
|
323
|
-
Defined in: [sdk/utils/src/runtime/ensure-server.ts:13](https://github.com/settlemint/sdk/blob/v2.3.
|
|
323
|
+
Defined in: [sdk/utils/src/runtime/ensure-server.ts:13](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/runtime/ensure-server.ts#L13)
|
|
324
324
|
|
|
325
325
|
Ensures that code is running on the server and not in a browser environment.
|
|
326
326
|
|
|
@@ -347,7 +347,7 @@ ensureServer();
|
|
|
347
347
|
|
|
348
348
|
> **executeCommand**(`command`, `args`, `options?`): `Promise`\<`string`[]\>
|
|
349
349
|
|
|
350
|
-
Defined in: [sdk/utils/src/terminal/execute-command.ts:51](https://github.com/settlemint/sdk/blob/v2.3.
|
|
350
|
+
Defined in: [sdk/utils/src/terminal/execute-command.ts:51](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/terminal/execute-command.ts#L51)
|
|
351
351
|
|
|
352
352
|
Executes a command with the given arguments in a child process.
|
|
353
353
|
Pipes stdin to the child process and captures stdout/stderr output.
|
|
@@ -389,7 +389,7 @@ await executeCommand("npm", ["install"], { silent: true });
|
|
|
389
389
|
|
|
390
390
|
> **exists**(`path`): `Promise`\<`boolean`\>
|
|
391
391
|
|
|
392
|
-
Defined in: [sdk/utils/src/filesystem/exists.ts:17](https://github.com/settlemint/sdk/blob/v2.3.
|
|
392
|
+
Defined in: [sdk/utils/src/filesystem/exists.ts:17](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/filesystem/exists.ts#L17)
|
|
393
393
|
|
|
394
394
|
Checks if a file or directory exists at the given path
|
|
395
395
|
|
|
@@ -422,7 +422,7 @@ if (await exists('/path/to/file.txt')) {
|
|
|
422
422
|
|
|
423
423
|
> **extractBaseUrlBeforeSegment**(`baseUrl`, `pathSegment`): `string`
|
|
424
424
|
|
|
425
|
-
Defined in: [sdk/utils/src/url.ts:15](https://github.com/settlemint/sdk/blob/v2.3.
|
|
425
|
+
Defined in: [sdk/utils/src/url.ts:15](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/url.ts#L15)
|
|
426
426
|
|
|
427
427
|
Extracts the base URL before a specific segment in a URL.
|
|
428
428
|
|
|
@@ -454,7 +454,7 @@ const baseUrl = extractBaseUrlBeforeSegment("https://example.com/api/v1/subgraph
|
|
|
454
454
|
|
|
455
455
|
> **extractJsonObject**\<`T`\>(`value`): `null` \| `T`
|
|
456
456
|
|
|
457
|
-
Defined in: [sdk/utils/src/json.ts:50](https://github.com/settlemint/sdk/blob/v2.3.
|
|
457
|
+
Defined in: [sdk/utils/src/json.ts:50](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/json.ts#L50)
|
|
458
458
|
|
|
459
459
|
Extracts a JSON object from a string.
|
|
460
460
|
|
|
@@ -497,7 +497,7 @@ const json = extractJsonObject<{ port: number }>(
|
|
|
497
497
|
|
|
498
498
|
> **fetchWithRetry**(`input`, `init?`, `maxRetries?`, `initialSleepTime?`): `Promise`\<`Response`\>
|
|
499
499
|
|
|
500
|
-
Defined in: [sdk/utils/src/http/fetch-with-retry.ts:18](https://github.com/settlemint/sdk/blob/v2.3.
|
|
500
|
+
Defined in: [sdk/utils/src/http/fetch-with-retry.ts:18](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/http/fetch-with-retry.ts#L18)
|
|
501
501
|
|
|
502
502
|
Retry an HTTP request with exponential backoff and jitter.
|
|
503
503
|
Only retries on server errors (5xx), rate limits (429), timeouts (408), and network errors.
|
|
@@ -535,7 +535,7 @@ const response = await fetchWithRetry("https://api.example.com/data");
|
|
|
535
535
|
|
|
536
536
|
> **findMonoRepoPackages**(`projectDir`): `Promise`\<`string`[]\>
|
|
537
537
|
|
|
538
|
-
Defined in: [sdk/utils/src/filesystem/mono-repo.ts:59](https://github.com/settlemint/sdk/blob/v2.3.
|
|
538
|
+
Defined in: [sdk/utils/src/filesystem/mono-repo.ts:59](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/filesystem/mono-repo.ts#L59)
|
|
539
539
|
|
|
540
540
|
Finds all packages in a monorepo
|
|
541
541
|
|
|
@@ -566,7 +566,7 @@ console.log(packages); // Output: ["/path/to/your/project/packages/core", "/path
|
|
|
566
566
|
|
|
567
567
|
> **findMonoRepoRoot**(`startDir`): `Promise`\<`null` \| `string`\>
|
|
568
568
|
|
|
569
|
-
Defined in: [sdk/utils/src/filesystem/mono-repo.ts:19](https://github.com/settlemint/sdk/blob/v2.3.
|
|
569
|
+
Defined in: [sdk/utils/src/filesystem/mono-repo.ts:19](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/filesystem/mono-repo.ts#L19)
|
|
570
570
|
|
|
571
571
|
Finds the root directory of a monorepo
|
|
572
572
|
|
|
@@ -597,7 +597,7 @@ console.log(root); // Output: /path/to/your/project/packages/core
|
|
|
597
597
|
|
|
598
598
|
> **formatTargetDir**(`targetDir`): `string`
|
|
599
599
|
|
|
600
|
-
Defined in: [sdk/utils/src/package-manager/download-and-extract.ts:15](https://github.com/settlemint/sdk/blob/v2.3.
|
|
600
|
+
Defined in: [sdk/utils/src/package-manager/download-and-extract.ts:15](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/package-manager/download-and-extract.ts#L15)
|
|
601
601
|
|
|
602
602
|
Formats a directory path by removing trailing slashes and whitespace
|
|
603
603
|
|
|
@@ -627,7 +627,7 @@ const formatted = formatTargetDir("/path/to/dir/ "); // "/path/to/dir"
|
|
|
627
627
|
|
|
628
628
|
> **getPackageManager**(`targetDir?`): `Promise`\<`AgentName`\>
|
|
629
629
|
|
|
630
|
-
Defined in: [sdk/utils/src/package-manager/get-package-manager.ts:15](https://github.com/settlemint/sdk/blob/v2.3.
|
|
630
|
+
Defined in: [sdk/utils/src/package-manager/get-package-manager.ts:15](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/package-manager/get-package-manager.ts#L15)
|
|
631
631
|
|
|
632
632
|
Detects the package manager used in the current project
|
|
633
633
|
|
|
@@ -658,7 +658,7 @@ console.log(`Using ${packageManager}`);
|
|
|
658
658
|
|
|
659
659
|
> **getPackageManagerExecutable**(`targetDir?`): `Promise`\<\{ `args`: `string`[]; `command`: `string`; \}\>
|
|
660
660
|
|
|
661
|
-
Defined in: [sdk/utils/src/package-manager/get-package-manager-executable.ts:14](https://github.com/settlemint/sdk/blob/v2.3.
|
|
661
|
+
Defined in: [sdk/utils/src/package-manager/get-package-manager-executable.ts:14](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/package-manager/get-package-manager-executable.ts#L14)
|
|
662
662
|
|
|
663
663
|
Retrieves the executable command and arguments for the package manager
|
|
664
664
|
|
|
@@ -689,7 +689,7 @@ console.log(`Using ${command} with args: ${args.join(" ")}`);
|
|
|
689
689
|
|
|
690
690
|
> **graphqlFetchWithRetry**\<`Data`\>(`input`, `init?`, `maxRetries?`, `initialSleepTime?`): `Promise`\<`Data`\>
|
|
691
691
|
|
|
692
|
-
Defined in: [sdk/utils/src/http/graphql-fetch-with-retry.ts:34](https://github.com/settlemint/sdk/blob/v2.3.
|
|
692
|
+
Defined in: [sdk/utils/src/http/graphql-fetch-with-retry.ts:34](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/http/graphql-fetch-with-retry.ts#L34)
|
|
693
693
|
|
|
694
694
|
Executes a GraphQL request with automatic retries using exponential backoff and jitter.
|
|
695
695
|
Only retries on server errors (5xx), rate limits (429), timeouts (408), and network errors.
|
|
@@ -748,7 +748,7 @@ const data = await graphqlFetchWithRetry<{ user: { id: string } }>(
|
|
|
748
748
|
|
|
749
749
|
> **installDependencies**(`pkgs`, `cwd?`): `Promise`\<`void`\>
|
|
750
750
|
|
|
751
|
-
Defined in: [sdk/utils/src/package-manager/install-dependencies.ts:20](https://github.com/settlemint/sdk/blob/v2.3.
|
|
751
|
+
Defined in: [sdk/utils/src/package-manager/install-dependencies.ts:20](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/package-manager/install-dependencies.ts#L20)
|
|
752
752
|
|
|
753
753
|
Installs one or more packages as dependencies using the detected package manager
|
|
754
754
|
|
|
@@ -787,7 +787,7 @@ await installDependencies(["express", "cors"]);
|
|
|
787
787
|
|
|
788
788
|
> **intro**(`msg`): `void`
|
|
789
789
|
|
|
790
|
-
Defined in: [sdk/utils/src/terminal/intro.ts:16](https://github.com/settlemint/sdk/blob/v2.3.
|
|
790
|
+
Defined in: [sdk/utils/src/terminal/intro.ts:16](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/terminal/intro.ts#L16)
|
|
791
791
|
|
|
792
792
|
Displays an introductory message in magenta text with padding.
|
|
793
793
|
Any sensitive tokens in the message are masked before display.
|
|
@@ -817,7 +817,7 @@ intro("Starting deployment...");
|
|
|
817
817
|
|
|
818
818
|
> **isEmpty**(`path`): `Promise`\<`boolean`\>
|
|
819
819
|
|
|
820
|
-
Defined in: [sdk/utils/src/package-manager/download-and-extract.ts:31](https://github.com/settlemint/sdk/blob/v2.3.
|
|
820
|
+
Defined in: [sdk/utils/src/package-manager/download-and-extract.ts:31](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/package-manager/download-and-extract.ts#L31)
|
|
821
821
|
|
|
822
822
|
Checks if a directory is empty or contains only a .git folder
|
|
823
823
|
|
|
@@ -849,7 +849,7 @@ if (await isEmpty("/path/to/dir")) {
|
|
|
849
849
|
|
|
850
850
|
> **isPackageInstalled**(`name`, `path?`): `Promise`\<`boolean`\>
|
|
851
851
|
|
|
852
|
-
Defined in: [sdk/utils/src/package-manager/is-package-installed.ts:17](https://github.com/settlemint/sdk/blob/v2.3.
|
|
852
|
+
Defined in: [sdk/utils/src/package-manager/is-package-installed.ts:17](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/package-manager/is-package-installed.ts#L17)
|
|
853
853
|
|
|
854
854
|
Checks if a package is installed in the project's dependencies, devDependencies, or peerDependencies.
|
|
855
855
|
|
|
@@ -885,7 +885,7 @@ console.log(`@settlemint/sdk-utils is installed: ${isInstalled}`);
|
|
|
885
885
|
|
|
886
886
|
> **list**(`title`, `items`): `void`
|
|
887
887
|
|
|
888
|
-
Defined in: [sdk/utils/src/terminal/list.ts:23](https://github.com/settlemint/sdk/blob/v2.3.
|
|
888
|
+
Defined in: [sdk/utils/src/terminal/list.ts:23](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/terminal/list.ts#L23)
|
|
889
889
|
|
|
890
890
|
Displays a list of items in a formatted manner, supporting nested items.
|
|
891
891
|
|
|
@@ -925,7 +925,7 @@ list("Providers", [
|
|
|
925
925
|
|
|
926
926
|
> **loadEnv**\<`T`\>(`validateEnv`, `prod`, `path`): `Promise`\<`T` *extends* `true` ? `object` : `object`\>
|
|
927
927
|
|
|
928
|
-
Defined in: [sdk/utils/src/environment/load-env.ts:25](https://github.com/settlemint/sdk/blob/v2.3.
|
|
928
|
+
Defined in: [sdk/utils/src/environment/load-env.ts:25](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/environment/load-env.ts#L25)
|
|
929
929
|
|
|
930
930
|
Loads environment variables from .env files.
|
|
931
931
|
To enable encryption with dotenvx (https://www.dotenvx.com/docs) run `bunx dotenvx encrypt`
|
|
@@ -973,7 +973,7 @@ const rawEnv = await loadEnv(false, false);
|
|
|
973
973
|
|
|
974
974
|
> **makeJsonStringifiable**\<`T`\>(`value`): `T`
|
|
975
975
|
|
|
976
|
-
Defined in: [sdk/utils/src/json.ts:73](https://github.com/settlemint/sdk/blob/v2.3.
|
|
976
|
+
Defined in: [sdk/utils/src/json.ts:73](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/json.ts#L73)
|
|
977
977
|
|
|
978
978
|
Converts a value to a JSON stringifiable format.
|
|
979
979
|
|
|
@@ -1010,7 +1010,7 @@ const json = makeJsonStringifiable<{ amount: bigint }>({ amount: BigInt(1000) })
|
|
|
1010
1010
|
|
|
1011
1011
|
> **maskTokens**(`output`): `string`
|
|
1012
1012
|
|
|
1013
|
-
Defined in: [sdk/utils/src/logging/mask-tokens.ts:13](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1013
|
+
Defined in: [sdk/utils/src/logging/mask-tokens.ts:13](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/logging/mask-tokens.ts#L13)
|
|
1014
1014
|
|
|
1015
1015
|
Masks sensitive SettleMint tokens in output text by replacing them with asterisks.
|
|
1016
1016
|
Handles personal access tokens (PAT), application access tokens (AAT), and service account tokens (SAT).
|
|
@@ -1042,7 +1042,7 @@ const masked = maskTokens("Token: sm_pat_****"); // "Token: ***"
|
|
|
1042
1042
|
|
|
1043
1043
|
> **note**(`message`, `level`): `void`
|
|
1044
1044
|
|
|
1045
|
-
Defined in: [sdk/utils/src/terminal/note.ts:21](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1045
|
+
Defined in: [sdk/utils/src/terminal/note.ts:21](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/terminal/note.ts#L21)
|
|
1046
1046
|
|
|
1047
1047
|
Displays a note message with optional warning level formatting.
|
|
1048
1048
|
Regular notes are displayed in normal text, while warnings are shown in yellow.
|
|
@@ -1077,7 +1077,7 @@ note("Low disk space remaining", "warn");
|
|
|
1077
1077
|
|
|
1078
1078
|
> **outro**(`msg`): `void`
|
|
1079
1079
|
|
|
1080
|
-
Defined in: [sdk/utils/src/terminal/outro.ts:16](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1080
|
+
Defined in: [sdk/utils/src/terminal/outro.ts:16](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/terminal/outro.ts#L16)
|
|
1081
1081
|
|
|
1082
1082
|
Displays a closing message in green inverted text with padding.
|
|
1083
1083
|
Any sensitive tokens in the message are masked before display.
|
|
@@ -1107,7 +1107,7 @@ outro("Deployment completed successfully!");
|
|
|
1107
1107
|
|
|
1108
1108
|
> **projectRoot**(`fallbackToCwd`, `cwd?`): `Promise`\<`string`\>
|
|
1109
1109
|
|
|
1110
|
-
Defined in: [sdk/utils/src/filesystem/project-root.ts:18](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1110
|
+
Defined in: [sdk/utils/src/filesystem/project-root.ts:18](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/filesystem/project-root.ts#L18)
|
|
1111
1111
|
|
|
1112
1112
|
Finds the root directory of the current project by locating the nearest package.json file
|
|
1113
1113
|
|
|
@@ -1144,7 +1144,7 @@ console.log(`Project root is at: ${rootDir}`);
|
|
|
1144
1144
|
|
|
1145
1145
|
> **replaceUnderscoresAndHyphensWithSpaces**(`s`): `string`
|
|
1146
1146
|
|
|
1147
|
-
Defined in: [sdk/utils/src/string.ts:48](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1147
|
+
Defined in: [sdk/utils/src/string.ts:48](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/string.ts#L48)
|
|
1148
1148
|
|
|
1149
1149
|
Replaces underscores and hyphens with spaces.
|
|
1150
1150
|
|
|
@@ -1175,7 +1175,7 @@ const result = replaceUnderscoresAndHyphensWithSpaces("Already_Spaced-Second");
|
|
|
1175
1175
|
|
|
1176
1176
|
> **requestLogger**(`logger`, `name`, `fn`): (...`args`) => `Promise`\<`Response`\>
|
|
1177
1177
|
|
|
1178
|
-
Defined in: [sdk/utils/src/logging/request-logger.ts:14](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1178
|
+
Defined in: [sdk/utils/src/logging/request-logger.ts:14](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/logging/request-logger.ts#L14)
|
|
1179
1179
|
|
|
1180
1180
|
Logs the request and duration of a fetch call (> 500ms is logged as warn, otherwise info)
|
|
1181
1181
|
|
|
@@ -1209,7 +1209,7 @@ The fetch function
|
|
|
1209
1209
|
|
|
1210
1210
|
> **retryWhenFailed**\<`T`\>(`fn`, `maxRetries`, `initialSleepTime`, `stopOnError?`): `Promise`\<`T`\>
|
|
1211
1211
|
|
|
1212
|
-
Defined in: [sdk/utils/src/retry.ts:16](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1212
|
+
Defined in: [sdk/utils/src/retry.ts:16](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/retry.ts#L16)
|
|
1213
1213
|
|
|
1214
1214
|
Retry a function when it fails.
|
|
1215
1215
|
|
|
@@ -1249,7 +1249,7 @@ const result = await retryWhenFailed(() => readFile("/path/to/file.txt"), 3, 1_0
|
|
|
1249
1249
|
|
|
1250
1250
|
> **setName**(`name`, `path?`): `Promise`\<`void`\>
|
|
1251
1251
|
|
|
1252
|
-
Defined in: [sdk/utils/src/package-manager/set-name.ts:16](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1252
|
+
Defined in: [sdk/utils/src/package-manager/set-name.ts:16](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/package-manager/set-name.ts#L16)
|
|
1253
1253
|
|
|
1254
1254
|
Sets the name field in the package.json file
|
|
1255
1255
|
|
|
@@ -1284,7 +1284,7 @@ await setName("my-new-project-name");
|
|
|
1284
1284
|
|
|
1285
1285
|
> **spinner**\<`R`\>(`options`): `Promise`\<`R`\>
|
|
1286
1286
|
|
|
1287
|
-
Defined in: [sdk/utils/src/terminal/spinner.ts:55](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1287
|
+
Defined in: [sdk/utils/src/terminal/spinner.ts:55](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/terminal/spinner.ts#L55)
|
|
1288
1288
|
|
|
1289
1289
|
Displays a loading spinner while executing an async task.
|
|
1290
1290
|
Shows progress with start/stop messages and handles errors.
|
|
@@ -1334,7 +1334,7 @@ const result = await spinner({
|
|
|
1334
1334
|
|
|
1335
1335
|
> **table**(`title`, `data`): `void`
|
|
1336
1336
|
|
|
1337
|
-
Defined in: [sdk/utils/src/terminal/table.ts:21](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1337
|
+
Defined in: [sdk/utils/src/terminal/table.ts:21](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/terminal/table.ts#L21)
|
|
1338
1338
|
|
|
1339
1339
|
Displays data in a formatted table in the terminal.
|
|
1340
1340
|
|
|
@@ -1368,7 +1368,7 @@ table("My Table", data);
|
|
|
1368
1368
|
|
|
1369
1369
|
> **truncate**(`value`, `maxLength`): `string`
|
|
1370
1370
|
|
|
1371
|
-
Defined in: [sdk/utils/src/string.ts:65](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1371
|
+
Defined in: [sdk/utils/src/string.ts:65](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/string.ts#L65)
|
|
1372
1372
|
|
|
1373
1373
|
Truncates a string to a maximum length and appends "..." if it is longer.
|
|
1374
1374
|
|
|
@@ -1400,7 +1400,7 @@ const truncated = truncate("Hello, world!", 10);
|
|
|
1400
1400
|
|
|
1401
1401
|
> **tryParseJson**\<`T`\>(`value`, `defaultValue`): `null` \| `T`
|
|
1402
1402
|
|
|
1403
|
-
Defined in: [sdk/utils/src/json.ts:23](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1403
|
+
Defined in: [sdk/utils/src/json.ts:23](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/json.ts#L23)
|
|
1404
1404
|
|
|
1405
1405
|
Attempts to parse a JSON string into a typed value, returning a default value if parsing fails.
|
|
1406
1406
|
|
|
@@ -1447,7 +1447,7 @@ const invalid = tryParseJson<string[]>(
|
|
|
1447
1447
|
|
|
1448
1448
|
> **validate**\<`T`\>(`schema`, `value`): `T`\[`"_output"`\]
|
|
1449
1449
|
|
|
1450
|
-
Defined in: [sdk/utils/src/validation/validate.ts:16](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1450
|
+
Defined in: [sdk/utils/src/validation/validate.ts:16](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/validation/validate.ts#L16)
|
|
1451
1451
|
|
|
1452
1452
|
Validates a value against a given Zod schema.
|
|
1453
1453
|
|
|
@@ -1488,7 +1488,7 @@ const validatedId = validate(IdSchema, "550e8400-e29b-41d4-a716-446655440000");
|
|
|
1488
1488
|
|
|
1489
1489
|
> **writeEnv**(`options`): `Promise`\<`void`\>
|
|
1490
1490
|
|
|
1491
|
-
Defined in: [sdk/utils/src/environment/write-env.ts:41](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1491
|
+
Defined in: [sdk/utils/src/environment/write-env.ts:41](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/environment/write-env.ts#L41)
|
|
1492
1492
|
|
|
1493
1493
|
Writes environment variables to .env files across a project or monorepo
|
|
1494
1494
|
|
|
@@ -1540,7 +1540,7 @@ await writeEnv({
|
|
|
1540
1540
|
|
|
1541
1541
|
#### CancelError
|
|
1542
1542
|
|
|
1543
|
-
Defined in: [sdk/utils/src/terminal/cancel.ts:8](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1543
|
+
Defined in: [sdk/utils/src/terminal/cancel.ts:8](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/terminal/cancel.ts#L8)
|
|
1544
1544
|
|
|
1545
1545
|
Error class used to indicate that the operation was cancelled.
|
|
1546
1546
|
This error is used to signal that the operation should be aborted.
|
|
@@ -1553,7 +1553,7 @@ This error is used to signal that the operation should be aborted.
|
|
|
1553
1553
|
|
|
1554
1554
|
#### CommandError
|
|
1555
1555
|
|
|
1556
|
-
Defined in: [sdk/utils/src/terminal/execute-command.ts:16](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1556
|
+
Defined in: [sdk/utils/src/terminal/execute-command.ts:16](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/terminal/execute-command.ts#L16)
|
|
1557
1557
|
|
|
1558
1558
|
Error class for command execution errors
|
|
1559
1559
|
|
|
@@ -1567,7 +1567,7 @@ Error class for command execution errors
|
|
|
1567
1567
|
|
|
1568
1568
|
> **new CommandError**(`message`, `code`, `output`): [`CommandError`](#commanderror)
|
|
1569
1569
|
|
|
1570
|
-
Defined in: [sdk/utils/src/terminal/execute-command.ts:23](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1570
|
+
Defined in: [sdk/utils/src/terminal/execute-command.ts:23](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/terminal/execute-command.ts#L23)
|
|
1571
1571
|
|
|
1572
1572
|
Constructs a new CommandError
|
|
1573
1573
|
|
|
@@ -1593,7 +1593,7 @@ Constructs a new CommandError
|
|
|
1593
1593
|
|
|
1594
1594
|
> `readonly` **code**: `number`
|
|
1595
1595
|
|
|
1596
|
-
Defined in: [sdk/utils/src/terminal/execute-command.ts:25](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1596
|
+
Defined in: [sdk/utils/src/terminal/execute-command.ts:25](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/terminal/execute-command.ts#L25)
|
|
1597
1597
|
|
|
1598
1598
|
The exit code of the command
|
|
1599
1599
|
|
|
@@ -1601,7 +1601,7 @@ The exit code of the command
|
|
|
1601
1601
|
|
|
1602
1602
|
> `readonly` **output**: `string`[]
|
|
1603
1603
|
|
|
1604
|
-
Defined in: [sdk/utils/src/terminal/execute-command.ts:26](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1604
|
+
Defined in: [sdk/utils/src/terminal/execute-command.ts:26](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/terminal/execute-command.ts#L26)
|
|
1605
1605
|
|
|
1606
1606
|
The output of the command
|
|
1607
1607
|
|
|
@@ -1609,7 +1609,7 @@ The output of the command
|
|
|
1609
1609
|
|
|
1610
1610
|
#### SpinnerError
|
|
1611
1611
|
|
|
1612
|
-
Defined in: [sdk/utils/src/terminal/spinner.ts:12](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1612
|
+
Defined in: [sdk/utils/src/terminal/spinner.ts:12](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/terminal/spinner.ts#L12)
|
|
1613
1613
|
|
|
1614
1614
|
Error class used to indicate that the spinner operation failed.
|
|
1615
1615
|
This error is used to signal that the operation should be aborted.
|
|
@@ -1622,7 +1622,7 @@ This error is used to signal that the operation should be aborted.
|
|
|
1622
1622
|
|
|
1623
1623
|
#### ExecuteCommandOptions
|
|
1624
1624
|
|
|
1625
|
-
Defined in: [sdk/utils/src/terminal/execute-command.ts:7](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1625
|
+
Defined in: [sdk/utils/src/terminal/execute-command.ts:7](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/terminal/execute-command.ts#L7)
|
|
1626
1626
|
|
|
1627
1627
|
Options for executing a command, extending SpawnOptionsWithoutStdio
|
|
1628
1628
|
|
|
@@ -1634,13 +1634,13 @@ Options for executing a command, extending SpawnOptionsWithoutStdio
|
|
|
1634
1634
|
|
|
1635
1635
|
| Property | Type | Description | Defined in |
|
|
1636
1636
|
| ------ | ------ | ------ | ------ |
|
|
1637
|
-
| <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.3.
|
|
1637
|
+
| <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.3.14/sdk/utils/src/terminal/execute-command.ts#L9) |
|
|
1638
1638
|
|
|
1639
1639
|
***
|
|
1640
1640
|
|
|
1641
1641
|
#### Logger
|
|
1642
1642
|
|
|
1643
|
-
Defined in: [sdk/utils/src/logging/logger.ts:23](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1643
|
+
Defined in: [sdk/utils/src/logging/logger.ts:23](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/logging/logger.ts#L23)
|
|
1644
1644
|
|
|
1645
1645
|
Simple logger interface with basic logging methods
|
|
1646
1646
|
Logger
|
|
@@ -1649,16 +1649,16 @@ Simple logger interface with basic logging methods
|
|
|
1649
1649
|
|
|
1650
1650
|
| Property | Type | Description | Defined in |
|
|
1651
1651
|
| ------ | ------ | ------ | ------ |
|
|
1652
|
-
| <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.3.
|
|
1653
|
-
| <a id="error"></a> `error` | (`message`, ...`args`) => `void` | Log errors | [sdk/utils/src/logging/logger.ts:31](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1654
|
-
| <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.3.
|
|
1655
|
-
| <a id="warn"></a> `warn` | (`message`, ...`args`) => `void` | Log warnings | [sdk/utils/src/logging/logger.ts:29](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1652
|
+
| <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.3.14/sdk/utils/src/logging/logger.ts#L25) |
|
|
1653
|
+
| <a id="error"></a> `error` | (`message`, ...`args`) => `void` | Log errors | [sdk/utils/src/logging/logger.ts:31](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/logging/logger.ts#L31) |
|
|
1654
|
+
| <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.3.14/sdk/utils/src/logging/logger.ts#L27) |
|
|
1655
|
+
| <a id="warn"></a> `warn` | (`message`, ...`args`) => `void` | Log warnings | [sdk/utils/src/logging/logger.ts:29](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/logging/logger.ts#L29) |
|
|
1656
1656
|
|
|
1657
1657
|
***
|
|
1658
1658
|
|
|
1659
1659
|
#### LoggerOptions
|
|
1660
1660
|
|
|
1661
|
-
Defined in: [sdk/utils/src/logging/logger.ts:12](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1661
|
+
Defined in: [sdk/utils/src/logging/logger.ts:12](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/logging/logger.ts#L12)
|
|
1662
1662
|
|
|
1663
1663
|
Configuration options for the logger
|
|
1664
1664
|
LoggerOptions
|
|
@@ -1667,14 +1667,14 @@ Configuration options for the logger
|
|
|
1667
1667
|
|
|
1668
1668
|
| Property | Type | Description | Defined in |
|
|
1669
1669
|
| ------ | ------ | ------ | ------ |
|
|
1670
|
-
| <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.3.
|
|
1671
|
-
| <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.3.
|
|
1670
|
+
| <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.3.14/sdk/utils/src/logging/logger.ts#L14) |
|
|
1671
|
+
| <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.3.14/sdk/utils/src/logging/logger.ts#L16) |
|
|
1672
1672
|
|
|
1673
1673
|
***
|
|
1674
1674
|
|
|
1675
1675
|
#### SpinnerOptions\<R\>
|
|
1676
1676
|
|
|
1677
|
-
Defined in: [sdk/utils/src/terminal/spinner.ts:25](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1677
|
+
Defined in: [sdk/utils/src/terminal/spinner.ts:25](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/terminal/spinner.ts#L25)
|
|
1678
1678
|
|
|
1679
1679
|
Options for configuring the spinner behavior
|
|
1680
1680
|
|
|
@@ -1688,9 +1688,9 @@ Options for configuring the spinner behavior
|
|
|
1688
1688
|
|
|
1689
1689
|
| Property | Type | Description | Defined in |
|
|
1690
1690
|
| ------ | ------ | ------ | ------ |
|
|
1691
|
-
| <a id="startmessage"></a> `startMessage` | `string` | Message to display when spinner starts | [sdk/utils/src/terminal/spinner.ts:27](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1692
|
-
| <a id="stopmessage"></a> `stopMessage` | `string` | Message to display when spinner completes successfully | [sdk/utils/src/terminal/spinner.ts:31](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1693
|
-
| <a id="task"></a> `task` | (`spinner?`) => `Promise`\<`R`\> | Async task to execute while spinner is active | [sdk/utils/src/terminal/spinner.ts:29](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1691
|
+
| <a id="startmessage"></a> `startMessage` | `string` | Message to display when spinner starts | [sdk/utils/src/terminal/spinner.ts:27](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/terminal/spinner.ts#L27) |
|
|
1692
|
+
| <a id="stopmessage"></a> `stopMessage` | `string` | Message to display when spinner completes successfully | [sdk/utils/src/terminal/spinner.ts:31](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/terminal/spinner.ts#L31) |
|
|
1693
|
+
| <a id="task"></a> `task` | (`spinner?`) => `Promise`\<`R`\> | Async task to execute while spinner is active | [sdk/utils/src/terminal/spinner.ts:29](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/terminal/spinner.ts#L29) |
|
|
1694
1694
|
|
|
1695
1695
|
### Type Aliases
|
|
1696
1696
|
|
|
@@ -1698,7 +1698,7 @@ Options for configuring the spinner behavior
|
|
|
1698
1698
|
|
|
1699
1699
|
> **DotEnv** = `z.infer`\<*typeof* [`DotEnvSchema`](#dotenvschema)\>
|
|
1700
1700
|
|
|
1701
|
-
Defined in: [sdk/utils/src/validation/dot-env.schema.ts:112](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1701
|
+
Defined in: [sdk/utils/src/validation/dot-env.schema.ts:112](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/validation/dot-env.schema.ts#L112)
|
|
1702
1702
|
|
|
1703
1703
|
Type definition for the environment variables schema.
|
|
1704
1704
|
|
|
@@ -1708,7 +1708,7 @@ Type definition for the environment variables schema.
|
|
|
1708
1708
|
|
|
1709
1709
|
> **DotEnvPartial** = `z.infer`\<*typeof* [`DotEnvSchemaPartial`](#dotenvschemapartial)\>
|
|
1710
1710
|
|
|
1711
|
-
Defined in: [sdk/utils/src/validation/dot-env.schema.ts:123](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1711
|
+
Defined in: [sdk/utils/src/validation/dot-env.schema.ts:123](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/validation/dot-env.schema.ts#L123)
|
|
1712
1712
|
|
|
1713
1713
|
Type definition for the partial environment variables schema.
|
|
1714
1714
|
|
|
@@ -1718,7 +1718,7 @@ Type definition for the partial environment variables schema.
|
|
|
1718
1718
|
|
|
1719
1719
|
> **Id** = `z.infer`\<*typeof* [`IdSchema`](#idschema)\>
|
|
1720
1720
|
|
|
1721
|
-
Defined in: [sdk/utils/src/validation/id.schema.ts:30](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1721
|
+
Defined in: [sdk/utils/src/validation/id.schema.ts:30](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/validation/id.schema.ts#L30)
|
|
1722
1722
|
|
|
1723
1723
|
Type definition for database IDs, inferred from IdSchema.
|
|
1724
1724
|
Can be either a PostgreSQL UUID string or MongoDB ObjectID string.
|
|
@@ -1729,7 +1729,7 @@ Can be either a PostgreSQL UUID string or MongoDB ObjectID string.
|
|
|
1729
1729
|
|
|
1730
1730
|
> **LogLevel** = `"debug"` \| `"info"` \| `"warn"` \| `"error"` \| `"none"`
|
|
1731
1731
|
|
|
1732
|
-
Defined in: [sdk/utils/src/logging/logger.ts:6](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1732
|
+
Defined in: [sdk/utils/src/logging/logger.ts:6](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/logging/logger.ts#L6)
|
|
1733
1733
|
|
|
1734
1734
|
Log levels supported by the logger
|
|
1735
1735
|
|
|
@@ -1739,7 +1739,7 @@ Log levels supported by the logger
|
|
|
1739
1739
|
|
|
1740
1740
|
> `const` **AccessTokenSchema**: `ZodString`
|
|
1741
1741
|
|
|
1742
|
-
Defined in: [sdk/utils/src/validation/access-token.schema.ts:21](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1742
|
+
Defined in: [sdk/utils/src/validation/access-token.schema.ts:21](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/validation/access-token.schema.ts#L21)
|
|
1743
1743
|
|
|
1744
1744
|
Schema for validating both application and personal access tokens.
|
|
1745
1745
|
Accepts tokens starting with either 'sm_pat_' or 'sm_aat_' prefix.
|
|
@@ -1750,7 +1750,7 @@ Accepts tokens starting with either 'sm_pat_' or 'sm_aat_' prefix.
|
|
|
1750
1750
|
|
|
1751
1751
|
> `const` **ApplicationAccessTokenSchema**: `ZodString`
|
|
1752
1752
|
|
|
1753
|
-
Defined in: [sdk/utils/src/validation/access-token.schema.ts:7](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1753
|
+
Defined in: [sdk/utils/src/validation/access-token.schema.ts:7](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/validation/access-token.schema.ts#L7)
|
|
1754
1754
|
|
|
1755
1755
|
Schema for validating application access tokens.
|
|
1756
1756
|
Application access tokens start with 'sm_aat_' prefix.
|
|
@@ -1761,7 +1761,7 @@ Application access tokens start with 'sm_aat_' prefix.
|
|
|
1761
1761
|
|
|
1762
1762
|
> `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_NETWORK_CHAIN_ID`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_BLOCKCHAIN_NODE`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT`: `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_HD_PRIVATE_KEY_FORWARDER_ADDRESS`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_INSTANCE`: `ZodDefault`\<`ZodUnion`\<readonly \[`ZodString`, `ZodLiteral`\<`"standalone"`\>, `ZodLiteral`\<`"local"`\>\]\>\>; `SETTLEMINT_IPFS`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_IPFS_API_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_IPFS_GATEWAY_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_IPFS_PINNING_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_LOG_LEVEL`: `ZodDefault`\<`ZodEnum`\<\{ `debug`: `"debug"`; `error`: `"error"`; `info`: `"info"`; `none`: `"none"`; `warn`: `"warn"`; \}\>\>; `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_PORTAL_WS_ENDPOINT`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_THEGRAPH`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH`: `ZodOptional`\<`ZodString`\>; `SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS`: `ZodPipe`\<`ZodTransform`\<`null` \| `never`[], `unknown`\>, `ZodOptional`\<`ZodArray`\<`ZodString`\>\>\>; `SETTLEMINT_WORKSPACE`: `ZodOptional`\<`ZodString`\>; \}, `$strip`\>
|
|
1763
1763
|
|
|
1764
|
-
Defined in: [sdk/utils/src/validation/dot-env.schema.ts:21](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1764
|
+
Defined in: [sdk/utils/src/validation/dot-env.schema.ts:21](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/validation/dot-env.schema.ts#L21)
|
|
1765
1765
|
|
|
1766
1766
|
Schema for validating environment variables used by the SettleMint SDK.
|
|
1767
1767
|
Defines validation rules and types for configuration values like URLs,
|
|
@@ -1773,7 +1773,7 @@ access tokens, workspace names, and service endpoints.
|
|
|
1773
1773
|
|
|
1774
1774
|
> `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_NETWORK_CHAIN_ID`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_BLOCKCHAIN_NODE`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT`: `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_HD_PRIVATE_KEY_FORWARDER_ADDRESS`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_INSTANCE`: `ZodOptional`\<`ZodDefault`\<`ZodUnion`\<readonly \[`ZodString`, `ZodLiteral`\<`"standalone"`\>, `ZodLiteral`\<`"local"`\>\]\>\>\>; `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_LOG_LEVEL`: `ZodOptional`\<`ZodDefault`\<`ZodEnum`\<\{ `debug`: `"debug"`; `error`: `"error"`; `info`: `"info"`; `none`: `"none"`; `warn`: `"warn"`; \}\>\>\>; `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_PORTAL_WS_ENDPOINT`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_THEGRAPH`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; `SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS`: `ZodOptional`\<`ZodPipe`\<`ZodTransform`\<`null` \| `never`[], `unknown`\>, `ZodOptional`\<`ZodArray`\<`ZodString`\>\>\>\>; `SETTLEMINT_WORKSPACE`: `ZodOptional`\<`ZodOptional`\<`ZodString`\>\>; \}, `$strip`\>
|
|
1775
1775
|
|
|
1776
|
-
Defined in: [sdk/utils/src/validation/dot-env.schema.ts:118](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1776
|
+
Defined in: [sdk/utils/src/validation/dot-env.schema.ts:118](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/validation/dot-env.schema.ts#L118)
|
|
1777
1777
|
|
|
1778
1778
|
Partial version of the environment variables schema where all fields are optional.
|
|
1779
1779
|
Useful for validating incomplete configurations during development or build time.
|
|
@@ -1784,7 +1784,7 @@ Useful for validating incomplete configurations during development or build time
|
|
|
1784
1784
|
|
|
1785
1785
|
> `const` **IdSchema**: `ZodUnion`\<readonly \[`ZodString`, `ZodString`\]\>
|
|
1786
1786
|
|
|
1787
|
-
Defined in: [sdk/utils/src/validation/id.schema.ts:17](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1787
|
+
Defined in: [sdk/utils/src/validation/id.schema.ts:17](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/validation/id.schema.ts#L17)
|
|
1788
1788
|
|
|
1789
1789
|
Schema for validating database IDs. Accepts both PostgreSQL UUIDs and MongoDB ObjectIDs.
|
|
1790
1790
|
PostgreSQL UUIDs are 32 hexadecimal characters with hyphens (e.g. 123e4567-e89b-12d3-a456-426614174000).
|
|
@@ -1808,7 +1808,7 @@ const isValidObjectId = IdSchema.safeParse("507f1f77bcf86cd799439011").success;
|
|
|
1808
1808
|
|
|
1809
1809
|
> `const` **LOCAL\_INSTANCE**: `"local"` = `"local"`
|
|
1810
1810
|
|
|
1811
|
-
Defined in: [sdk/utils/src/validation/dot-env.schema.ts:14](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1811
|
+
Defined in: [sdk/utils/src/validation/dot-env.schema.ts:14](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/validation/dot-env.schema.ts#L14)
|
|
1812
1812
|
|
|
1813
1813
|
Use this value to indicate that the resources are not part of the SettleMint platform.
|
|
1814
1814
|
|
|
@@ -1818,7 +1818,7 @@ Use this value to indicate that the resources are not part of the SettleMint pla
|
|
|
1818
1818
|
|
|
1819
1819
|
> `const` **PersonalAccessTokenSchema**: `ZodString`
|
|
1820
1820
|
|
|
1821
|
-
Defined in: [sdk/utils/src/validation/access-token.schema.ts:14](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1821
|
+
Defined in: [sdk/utils/src/validation/access-token.schema.ts:14](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/validation/access-token.schema.ts#L14)
|
|
1822
1822
|
|
|
1823
1823
|
Schema for validating personal access tokens.
|
|
1824
1824
|
Personal access tokens start with 'sm_pat_' prefix.
|
|
@@ -1829,7 +1829,7 @@ Personal access tokens start with 'sm_pat_' prefix.
|
|
|
1829
1829
|
|
|
1830
1830
|
> `const` **runsInBrowser**: `boolean` = `isBrowser`
|
|
1831
1831
|
|
|
1832
|
-
Defined in: [sdk/utils/src/runtime/ensure-server.ts:40](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1832
|
+
Defined in: [sdk/utils/src/runtime/ensure-server.ts:40](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/runtime/ensure-server.ts#L40)
|
|
1833
1833
|
|
|
1834
1834
|
Boolean indicating if code is currently running in a browser environment
|
|
1835
1835
|
|
|
@@ -1839,7 +1839,7 @@ Boolean indicating if code is currently running in a browser environment
|
|
|
1839
1839
|
|
|
1840
1840
|
> `const` **runsOnServer**: `boolean` = `!isBrowser`
|
|
1841
1841
|
|
|
1842
|
-
Defined in: [sdk/utils/src/runtime/ensure-server.ts:45](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1842
|
+
Defined in: [sdk/utils/src/runtime/ensure-server.ts:45](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/runtime/ensure-server.ts#L45)
|
|
1843
1843
|
|
|
1844
1844
|
Boolean indicating if code is currently running in a server environment
|
|
1845
1845
|
|
|
@@ -1849,7 +1849,7 @@ Boolean indicating if code is currently running in a server environment
|
|
|
1849
1849
|
|
|
1850
1850
|
> `const` **STANDALONE\_INSTANCE**: `"standalone"` = `"standalone"`
|
|
1851
1851
|
|
|
1852
|
-
Defined in: [sdk/utils/src/validation/dot-env.schema.ts:10](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1852
|
+
Defined in: [sdk/utils/src/validation/dot-env.schema.ts:10](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/validation/dot-env.schema.ts#L10)
|
|
1853
1853
|
|
|
1854
1854
|
Use this value to indicate that the resources are not part of the SettleMint platform.
|
|
1855
1855
|
|
|
@@ -1859,7 +1859,7 @@ Use this value to indicate that the resources are not part of the SettleMint pla
|
|
|
1859
1859
|
|
|
1860
1860
|
> `const` **UniqueNameSchema**: `ZodString`
|
|
1861
1861
|
|
|
1862
|
-
Defined in: [sdk/utils/src/validation/unique-name.schema.ts:19](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1862
|
+
Defined in: [sdk/utils/src/validation/unique-name.schema.ts:19](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/validation/unique-name.schema.ts#L19)
|
|
1863
1863
|
|
|
1864
1864
|
Schema for validating unique names used across the SettleMint platform.
|
|
1865
1865
|
Only accepts lowercase alphanumeric characters and hyphens.
|
|
@@ -1885,7 +1885,7 @@ const isInvalidName = UniqueNameSchema.safeParse("My Workspace!").success;
|
|
|
1885
1885
|
|
|
1886
1886
|
> `const` **UrlOrPathSchema**: `ZodUnion`\<readonly \[`ZodString`, `ZodString`\]\>
|
|
1887
1887
|
|
|
1888
|
-
Defined in: [sdk/utils/src/validation/url.schema.ts:54](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1888
|
+
Defined in: [sdk/utils/src/validation/url.schema.ts:54](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/validation/url.schema.ts#L54)
|
|
1889
1889
|
|
|
1890
1890
|
Schema that accepts either a full URL or a URL path.
|
|
1891
1891
|
|
|
@@ -1909,7 +1909,7 @@ const isValidPath = UrlOrPathSchema.safeParse("/api/v1/users").success;
|
|
|
1909
1909
|
|
|
1910
1910
|
> `const` **UrlPathSchema**: `ZodString`
|
|
1911
1911
|
|
|
1912
|
-
Defined in: [sdk/utils/src/validation/url.schema.ts:34](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1912
|
+
Defined in: [sdk/utils/src/validation/url.schema.ts:34](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/validation/url.schema.ts#L34)
|
|
1913
1913
|
|
|
1914
1914
|
Schema for validating URL paths.
|
|
1915
1915
|
|
|
@@ -1933,7 +1933,7 @@ const isInvalidPath = UrlPathSchema.safeParse("not-a-path").success;
|
|
|
1933
1933
|
|
|
1934
1934
|
> `const` **UrlSchema**: `ZodString`
|
|
1935
1935
|
|
|
1936
|
-
Defined in: [sdk/utils/src/validation/url.schema.ts:17](https://github.com/settlemint/sdk/blob/v2.3.
|
|
1936
|
+
Defined in: [sdk/utils/src/validation/url.schema.ts:17](https://github.com/settlemint/sdk/blob/v2.3.14/sdk/utils/src/validation/url.schema.ts#L17)
|
|
1937
1937
|
|
|
1938
1938
|
Schema for validating URLs.
|
|
1939
1939
|
|
package/package.json
CHANGED