@settlemint/sdk-utils 2.3.5 → 2.3.8-main9d094739

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.
@@ -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>;
@@ -118,7 +108,7 @@ type DotEnv = z.infer<typeof DotEnvSchema>;
118
108
  * Useful for validating incomplete configurations during development or build time.
119
109
  */
120
110
  declare const DotEnvSchemaPartial: z.ZodObject<{
121
- 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">]>>>;
122
112
  SETTLEMINT_ACCESS_TOKEN: z.ZodOptional<z.ZodOptional<z.ZodString>>;
123
113
  SETTLEMINT_PERSONAL_ACCESS_TOKEN: z.ZodOptional<z.ZodOptional<z.ZodString>>;
124
114
  SETTLEMINT_WORKSPACE: z.ZodOptional<z.ZodOptional<z.ZodString>>;
@@ -169,7 +159,6 @@ declare const DotEnvSchemaPartial: z.ZodObject<{
169
159
  * Type definition for the partial environment variables schema.
170
160
  */
171
161
  type DotEnvPartial = z.infer<typeof DotEnvSchemaPartial>;
172
-
173
162
  //#endregion
174
163
  //#region src/validation/id.schema.d.ts
175
164
  /**
@@ -192,7 +181,6 @@ declare const IdSchema: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
192
181
  * Can be either a PostgreSQL UUID string or MongoDB ObjectID string.
193
182
  */
194
183
  type Id = z.infer<typeof IdSchema>;
195
-
196
184
  //#endregion
197
185
  //#region src/validation/unique-name.schema.d.ts
198
186
  /**
@@ -216,7 +204,6 @@ declare const UniqueNameSchema: z.ZodString;
216
204
  * Type definition for unique names, inferred from UniqueNameSchema.
217
205
  */
218
206
  type UniqueName = z.infer<typeof UniqueNameSchema>;
219
-
220
207
  //#endregion
221
208
  //#region src/validation/url.schema.d.ts
222
209
  /**
@@ -267,7 +254,6 @@ type UrlPath = z.infer<typeof UrlPathSchema>;
267
254
  */
268
255
  declare const UrlOrPathSchema: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
269
256
  type UrlOrPath = z.infer<typeof UrlOrPathSchema>;
270
-
271
257
  //#endregion
272
- 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 };
273
259
  //# sourceMappingURL=validation.d.cts.map
@@ -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>;
@@ -118,7 +108,7 @@ type DotEnv = z.infer<typeof DotEnvSchema>;
118
108
  * Useful for validating incomplete configurations during development or build time.
119
109
  */
120
110
  declare const DotEnvSchemaPartial: z.ZodObject<{
121
- 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">]>>>;
122
112
  SETTLEMINT_ACCESS_TOKEN: z.ZodOptional<z.ZodOptional<z.ZodString>>;
123
113
  SETTLEMINT_PERSONAL_ACCESS_TOKEN: z.ZodOptional<z.ZodOptional<z.ZodString>>;
124
114
  SETTLEMINT_WORKSPACE: z.ZodOptional<z.ZodOptional<z.ZodString>>;
@@ -169,7 +159,6 @@ declare const DotEnvSchemaPartial: z.ZodObject<{
169
159
  * Type definition for the partial environment variables schema.
170
160
  */
171
161
  type DotEnvPartial = z.infer<typeof DotEnvSchemaPartial>;
172
-
173
162
  //#endregion
174
163
  //#region src/validation/id.schema.d.ts
175
164
  /**
@@ -192,7 +181,6 @@ declare const IdSchema: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
192
181
  * Can be either a PostgreSQL UUID string or MongoDB ObjectID string.
193
182
  */
194
183
  type Id = z.infer<typeof IdSchema>;
195
-
196
184
  //#endregion
197
185
  //#region src/validation/unique-name.schema.d.ts
198
186
  /**
@@ -216,7 +204,6 @@ declare const UniqueNameSchema: z.ZodString;
216
204
  * Type definition for unique names, inferred from UniqueNameSchema.
217
205
  */
218
206
  type UniqueName = z.infer<typeof UniqueNameSchema>;
219
-
220
207
  //#endregion
221
208
  //#region src/validation/url.schema.d.ts
222
209
  /**
@@ -267,7 +254,6 @@ type UrlPath = z.infer<typeof UrlPathSchema>;
267
254
  */
268
255
  declare const UrlOrPathSchema: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
269
256
  type UrlOrPath = z.infer<typeof UrlOrPathSchema>;
270
-
271
257
  //#endregion
272
- 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 };
273
259
  //# sourceMappingURL=validation.d.ts.map