@settlemint/sdk-utils 2.3.8 → 2.3.11
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 +91 -80
- package/dist/environment.cjs +4501 -3924
- package/dist/environment.cjs.map +1 -1
- package/dist/environment.d.cts +7 -31
- package/dist/environment.d.ts +7 -31
- package/dist/environment.js +4501 -3924
- package/dist/environment.js.map +1 -1
- package/dist/filesystem.d.cts +1 -17
- package/dist/filesystem.d.ts +1 -17
- package/dist/http.d.cts +0 -4
- package/dist/http.d.ts +0 -4
- package/dist/index.d.cts +0 -4
- package/dist/index.d.ts +0 -4
- package/dist/json.d.cts +0 -1
- package/dist/json.d.ts +0 -1
- package/dist/logging.d.cts +2 -3
- package/dist/logging.d.ts +2 -3
- package/dist/package-manager.d.cts +1 -16
- package/dist/package-manager.d.ts +1 -16
- package/dist/retry.d.cts +0 -1
- package/dist/retry.d.ts +0 -1
- package/dist/runtime.d.cts +0 -1
- package/dist/runtime.d.ts +0 -1
- package/dist/string.d.cts +0 -1
- package/dist/string.d.ts +0 -1
- package/dist/terminal.d.cts +1 -20
- package/dist/terminal.d.ts +1 -20
- package/dist/url.d.cts +0 -1
- package/dist/url.d.ts +0 -1
- package/dist/validation.cjs +4503 -3925
- package/dist/validation.cjs.map +1 -1
- package/dist/validation.d.cts +8 -30
- package/dist/validation.d.ts +8 -30
- package/dist/validation.js +4503 -3926
- package/dist/validation.js.map +1 -1
- package/package.json +4 -2
package/dist/validation.d.cts
CHANGED
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
import { ZodString, ZodType, z } from "zod/v4";
|
|
2
2
|
|
|
3
3
|
//#region src/validation/validate.d.ts
|
|
4
|
-
|
|
5
|
-
* Validates a value against a given Zod schema.
|
|
6
|
-
*
|
|
7
|
-
* @param schema - The Zod schema to validate against.
|
|
8
|
-
* @param value - The value to validate.
|
|
9
|
-
* @returns The validated and parsed value.
|
|
10
|
-
* @throws Will throw an error if validation fails, with formatted error messages.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* import { validate } from "@settlemint/sdk-utils/validation";
|
|
14
|
-
*
|
|
15
|
-
* const validatedId = validate(IdSchema, "550e8400-e29b-41d4-a716-446655440000");
|
|
16
|
-
*/
|
|
4
|
+
|
|
17
5
|
/**
|
|
18
6
|
* Validates a value against a given Zod schema.
|
|
19
7
|
*
|
|
@@ -28,7 +16,6 @@ import { ZodString, ZodType, z } from "zod/v4";
|
|
|
28
16
|
* const validatedId = validate(IdSchema, "550e8400-e29b-41d4-a716-446655440000");
|
|
29
17
|
*/
|
|
30
18
|
declare function validate<T extends ZodType>(schema: T, value: unknown): T["_output"];
|
|
31
|
-
|
|
32
19
|
//#endregion
|
|
33
20
|
//#region src/validation/access-token.schema.d.ts
|
|
34
21
|
/**
|
|
@@ -49,20 +36,23 @@ type PersonalAccessToken = z.infer<typeof PersonalAccessTokenSchema>;
|
|
|
49
36
|
*/
|
|
50
37
|
declare const AccessTokenSchema: ZodString;
|
|
51
38
|
type AccessToken = z.infer<typeof AccessTokenSchema>;
|
|
52
|
-
|
|
53
39
|
//#endregion
|
|
54
40
|
//#region src/validation/dot-env.schema.d.ts
|
|
55
41
|
/**
|
|
56
42
|
* Use this value to indicate that the resources are not part of the SettleMint platform.
|
|
57
43
|
*/
|
|
58
44
|
declare const STANDALONE_INSTANCE = "standalone";
|
|
45
|
+
/**
|
|
46
|
+
* Use this value to indicate that the resources are not part of the SettleMint platform.
|
|
47
|
+
*/
|
|
48
|
+
declare const LOCAL_INSTANCE = "local";
|
|
59
49
|
/**
|
|
60
50
|
* Schema for validating environment variables used by the SettleMint SDK.
|
|
61
51
|
* Defines validation rules and types for configuration values like URLs,
|
|
62
52
|
* access tokens, workspace names, and service endpoints.
|
|
63
53
|
*/
|
|
64
54
|
declare const DotEnvSchema: z.ZodObject<{
|
|
65
|
-
SETTLEMINT_INSTANCE: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"standalone">]>>;
|
|
55
|
+
SETTLEMINT_INSTANCE: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"standalone">, z.ZodLiteral<"local">]>>;
|
|
66
56
|
SETTLEMINT_ACCESS_TOKEN: z.ZodOptional<z.ZodString>;
|
|
67
57
|
SETTLEMINT_PERSONAL_ACCESS_TOKEN: z.ZodOptional<z.ZodString>;
|
|
68
58
|
SETTLEMINT_WORKSPACE: z.ZodOptional<z.ZodString>;
|
|
@@ -108,10 +98,6 @@ declare const DotEnvSchema: z.ZodObject<{
|
|
|
108
98
|
warn: "warn";
|
|
109
99
|
none: "none";
|
|
110
100
|
}>>;
|
|
111
|
-
NODE_TLS_REJECT_UNAUTHORIZED: z.ZodOptional<z.ZodEnum<{
|
|
112
|
-
1: "1";
|
|
113
|
-
0: "0";
|
|
114
|
-
}>>;
|
|
115
101
|
}, z.core.$strip>;
|
|
116
102
|
/**
|
|
117
103
|
* Type definition for the environment variables schema.
|
|
@@ -122,7 +108,7 @@ type DotEnv = z.infer<typeof DotEnvSchema>;
|
|
|
122
108
|
* Useful for validating incomplete configurations during development or build time.
|
|
123
109
|
*/
|
|
124
110
|
declare const DotEnvSchemaPartial: z.ZodObject<{
|
|
125
|
-
SETTLEMINT_INSTANCE: z.ZodOptional<z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"standalone">]>>>;
|
|
111
|
+
SETTLEMINT_INSTANCE: z.ZodOptional<z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"standalone">, z.ZodLiteral<"local">]>>>;
|
|
126
112
|
SETTLEMINT_ACCESS_TOKEN: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
127
113
|
SETTLEMINT_PERSONAL_ACCESS_TOKEN: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
128
114
|
SETTLEMINT_WORKSPACE: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
@@ -168,16 +154,11 @@ declare const DotEnvSchemaPartial: z.ZodObject<{
|
|
|
168
154
|
warn: "warn";
|
|
169
155
|
none: "none";
|
|
170
156
|
}>>>;
|
|
171
|
-
NODE_TLS_REJECT_UNAUTHORIZED: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
|
|
172
|
-
1: "1";
|
|
173
|
-
0: "0";
|
|
174
|
-
}>>>;
|
|
175
157
|
}, z.core.$strip>;
|
|
176
158
|
/**
|
|
177
159
|
* Type definition for the partial environment variables schema.
|
|
178
160
|
*/
|
|
179
161
|
type DotEnvPartial = z.infer<typeof DotEnvSchemaPartial>;
|
|
180
|
-
|
|
181
162
|
//#endregion
|
|
182
163
|
//#region src/validation/id.schema.d.ts
|
|
183
164
|
/**
|
|
@@ -200,7 +181,6 @@ declare const IdSchema: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
|
200
181
|
* Can be either a PostgreSQL UUID string or MongoDB ObjectID string.
|
|
201
182
|
*/
|
|
202
183
|
type Id = z.infer<typeof IdSchema>;
|
|
203
|
-
|
|
204
184
|
//#endregion
|
|
205
185
|
//#region src/validation/unique-name.schema.d.ts
|
|
206
186
|
/**
|
|
@@ -224,7 +204,6 @@ declare const UniqueNameSchema: z.ZodString;
|
|
|
224
204
|
* Type definition for unique names, inferred from UniqueNameSchema.
|
|
225
205
|
*/
|
|
226
206
|
type UniqueName = z.infer<typeof UniqueNameSchema>;
|
|
227
|
-
|
|
228
207
|
//#endregion
|
|
229
208
|
//#region src/validation/url.schema.d.ts
|
|
230
209
|
/**
|
|
@@ -275,7 +254,6 @@ type UrlPath = z.infer<typeof UrlPathSchema>;
|
|
|
275
254
|
*/
|
|
276
255
|
declare const UrlOrPathSchema: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
277
256
|
type UrlOrPath = z.infer<typeof UrlOrPathSchema>;
|
|
278
|
-
|
|
279
257
|
//#endregion
|
|
280
|
-
export { AccessToken, AccessTokenSchema, ApplicationAccessToken, ApplicationAccessTokenSchema, DotEnv, DotEnvPartial, DotEnvSchema, DotEnvSchemaPartial, Id, IdSchema, PersonalAccessToken, PersonalAccessTokenSchema, STANDALONE_INSTANCE, UniqueNameSchema, Url, UrlOrPath, UrlOrPathSchema, UrlPath, UrlPathSchema, UrlSchema, validate };
|
|
258
|
+
export { AccessToken, AccessTokenSchema, ApplicationAccessToken, ApplicationAccessTokenSchema, DotEnv, DotEnvPartial, DotEnvSchema, DotEnvSchemaPartial, Id, IdSchema, LOCAL_INSTANCE, PersonalAccessToken, PersonalAccessTokenSchema, STANDALONE_INSTANCE, UniqueNameSchema, Url, UrlOrPath, UrlOrPathSchema, UrlPath, UrlPathSchema, UrlSchema, validate };
|
|
281
259
|
//# sourceMappingURL=validation.d.cts.map
|
package/dist/validation.d.ts
CHANGED
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
import { ZodString, ZodType, z } from "zod/v4";
|
|
2
2
|
|
|
3
3
|
//#region src/validation/validate.d.ts
|
|
4
|
-
|
|
5
|
-
* Validates a value against a given Zod schema.
|
|
6
|
-
*
|
|
7
|
-
* @param schema - The Zod schema to validate against.
|
|
8
|
-
* @param value - The value to validate.
|
|
9
|
-
* @returns The validated and parsed value.
|
|
10
|
-
* @throws Will throw an error if validation fails, with formatted error messages.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* import { validate } from "@settlemint/sdk-utils/validation";
|
|
14
|
-
*
|
|
15
|
-
* const validatedId = validate(IdSchema, "550e8400-e29b-41d4-a716-446655440000");
|
|
16
|
-
*/
|
|
4
|
+
|
|
17
5
|
/**
|
|
18
6
|
* Validates a value against a given Zod schema.
|
|
19
7
|
*
|
|
@@ -28,7 +16,6 @@ import { ZodString, ZodType, z } from "zod/v4";
|
|
|
28
16
|
* const validatedId = validate(IdSchema, "550e8400-e29b-41d4-a716-446655440000");
|
|
29
17
|
*/
|
|
30
18
|
declare function validate<T extends ZodType>(schema: T, value: unknown): T["_output"];
|
|
31
|
-
|
|
32
19
|
//#endregion
|
|
33
20
|
//#region src/validation/access-token.schema.d.ts
|
|
34
21
|
/**
|
|
@@ -49,20 +36,23 @@ type PersonalAccessToken = z.infer<typeof PersonalAccessTokenSchema>;
|
|
|
49
36
|
*/
|
|
50
37
|
declare const AccessTokenSchema: ZodString;
|
|
51
38
|
type AccessToken = z.infer<typeof AccessTokenSchema>;
|
|
52
|
-
|
|
53
39
|
//#endregion
|
|
54
40
|
//#region src/validation/dot-env.schema.d.ts
|
|
55
41
|
/**
|
|
56
42
|
* Use this value to indicate that the resources are not part of the SettleMint platform.
|
|
57
43
|
*/
|
|
58
44
|
declare const STANDALONE_INSTANCE = "standalone";
|
|
45
|
+
/**
|
|
46
|
+
* Use this value to indicate that the resources are not part of the SettleMint platform.
|
|
47
|
+
*/
|
|
48
|
+
declare const LOCAL_INSTANCE = "local";
|
|
59
49
|
/**
|
|
60
50
|
* Schema for validating environment variables used by the SettleMint SDK.
|
|
61
51
|
* Defines validation rules and types for configuration values like URLs,
|
|
62
52
|
* access tokens, workspace names, and service endpoints.
|
|
63
53
|
*/
|
|
64
54
|
declare const DotEnvSchema: z.ZodObject<{
|
|
65
|
-
SETTLEMINT_INSTANCE: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"standalone">]>>;
|
|
55
|
+
SETTLEMINT_INSTANCE: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"standalone">, z.ZodLiteral<"local">]>>;
|
|
66
56
|
SETTLEMINT_ACCESS_TOKEN: z.ZodOptional<z.ZodString>;
|
|
67
57
|
SETTLEMINT_PERSONAL_ACCESS_TOKEN: z.ZodOptional<z.ZodString>;
|
|
68
58
|
SETTLEMINT_WORKSPACE: z.ZodOptional<z.ZodString>;
|
|
@@ -108,10 +98,6 @@ declare const DotEnvSchema: z.ZodObject<{
|
|
|
108
98
|
warn: "warn";
|
|
109
99
|
none: "none";
|
|
110
100
|
}>>;
|
|
111
|
-
NODE_TLS_REJECT_UNAUTHORIZED: z.ZodOptional<z.ZodEnum<{
|
|
112
|
-
1: "1";
|
|
113
|
-
0: "0";
|
|
114
|
-
}>>;
|
|
115
101
|
}, z.core.$strip>;
|
|
116
102
|
/**
|
|
117
103
|
* Type definition for the environment variables schema.
|
|
@@ -122,7 +108,7 @@ type DotEnv = z.infer<typeof DotEnvSchema>;
|
|
|
122
108
|
* Useful for validating incomplete configurations during development or build time.
|
|
123
109
|
*/
|
|
124
110
|
declare const DotEnvSchemaPartial: z.ZodObject<{
|
|
125
|
-
SETTLEMINT_INSTANCE: z.ZodOptional<z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"standalone">]>>>;
|
|
111
|
+
SETTLEMINT_INSTANCE: z.ZodOptional<z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"standalone">, z.ZodLiteral<"local">]>>>;
|
|
126
112
|
SETTLEMINT_ACCESS_TOKEN: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
127
113
|
SETTLEMINT_PERSONAL_ACCESS_TOKEN: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
128
114
|
SETTLEMINT_WORKSPACE: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
@@ -168,16 +154,11 @@ declare const DotEnvSchemaPartial: z.ZodObject<{
|
|
|
168
154
|
warn: "warn";
|
|
169
155
|
none: "none";
|
|
170
156
|
}>>>;
|
|
171
|
-
NODE_TLS_REJECT_UNAUTHORIZED: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
|
|
172
|
-
1: "1";
|
|
173
|
-
0: "0";
|
|
174
|
-
}>>>;
|
|
175
157
|
}, z.core.$strip>;
|
|
176
158
|
/**
|
|
177
159
|
* Type definition for the partial environment variables schema.
|
|
178
160
|
*/
|
|
179
161
|
type DotEnvPartial = z.infer<typeof DotEnvSchemaPartial>;
|
|
180
|
-
|
|
181
162
|
//#endregion
|
|
182
163
|
//#region src/validation/id.schema.d.ts
|
|
183
164
|
/**
|
|
@@ -200,7 +181,6 @@ declare const IdSchema: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
|
200
181
|
* Can be either a PostgreSQL UUID string or MongoDB ObjectID string.
|
|
201
182
|
*/
|
|
202
183
|
type Id = z.infer<typeof IdSchema>;
|
|
203
|
-
|
|
204
184
|
//#endregion
|
|
205
185
|
//#region src/validation/unique-name.schema.d.ts
|
|
206
186
|
/**
|
|
@@ -224,7 +204,6 @@ declare const UniqueNameSchema: z.ZodString;
|
|
|
224
204
|
* Type definition for unique names, inferred from UniqueNameSchema.
|
|
225
205
|
*/
|
|
226
206
|
type UniqueName = z.infer<typeof UniqueNameSchema>;
|
|
227
|
-
|
|
228
207
|
//#endregion
|
|
229
208
|
//#region src/validation/url.schema.d.ts
|
|
230
209
|
/**
|
|
@@ -275,7 +254,6 @@ type UrlPath = z.infer<typeof UrlPathSchema>;
|
|
|
275
254
|
*/
|
|
276
255
|
declare const UrlOrPathSchema: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
277
256
|
type UrlOrPath = z.infer<typeof UrlOrPathSchema>;
|
|
278
|
-
|
|
279
257
|
//#endregion
|
|
280
|
-
export { AccessToken, AccessTokenSchema, ApplicationAccessToken, ApplicationAccessTokenSchema, DotEnv, DotEnvPartial, DotEnvSchema, DotEnvSchemaPartial, Id, IdSchema, PersonalAccessToken, PersonalAccessTokenSchema, STANDALONE_INSTANCE, UniqueNameSchema, Url, UrlOrPath, UrlOrPathSchema, UrlPath, UrlPathSchema, UrlSchema, validate };
|
|
258
|
+
export { AccessToken, AccessTokenSchema, ApplicationAccessToken, ApplicationAccessTokenSchema, DotEnv, DotEnvPartial, DotEnvSchema, DotEnvSchemaPartial, Id, IdSchema, LOCAL_INSTANCE, PersonalAccessToken, PersonalAccessTokenSchema, STANDALONE_INSTANCE, UniqueNameSchema, Url, UrlOrPath, UrlOrPathSchema, UrlPath, UrlPathSchema, UrlSchema, validate };
|
|
281
259
|
//# sourceMappingURL=validation.d.ts.map
|