@ekomerc/storefront 0.1.2 → 0.1.3

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.
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Base class for all Storefront SDK errors
3
+ */
4
+ declare class StorefrontError extends Error {
5
+ readonly code: string;
6
+ constructor(message: string, code: string, options?: {
7
+ cause?: Error;
8
+ });
9
+ }
10
+ /**
11
+ * Network error - fetch failed, connection issues
12
+ */
13
+ declare class NetworkError extends StorefrontError {
14
+ constructor(message: string, options?: {
15
+ cause?: Error;
16
+ });
17
+ }
18
+ /**
19
+ * Authentication error - invalid/revoked API key, 401/403 responses
20
+ */
21
+ declare class AuthError extends StorefrontError {
22
+ constructor(message: string, options?: {
23
+ cause?: Error;
24
+ });
25
+ }
26
+ /**
27
+ * Validation error - userErrors from mutations
28
+ */
29
+ declare class ValidationError extends StorefrontError {
30
+ readonly userErrors: Array<{
31
+ field: string | null;
32
+ message: string;
33
+ }>;
34
+ constructor(message: string, userErrors: Array<{
35
+ field: string | null;
36
+ message: string;
37
+ }>, options?: {
38
+ cause?: Error;
39
+ });
40
+ }
41
+ /**
42
+ * Not found error - resource doesn't exist
43
+ */
44
+ declare class NotFoundError extends StorefrontError {
45
+ constructor(message: string, options?: {
46
+ cause?: Error;
47
+ });
48
+ }
49
+ /**
50
+ * State error - invalid cart state transition
51
+ */
52
+ declare class StateError extends StorefrontError {
53
+ readonly state: string;
54
+ constructor(message: string, state: string, options?: {
55
+ cause?: Error;
56
+ });
57
+ }
58
+ /**
59
+ * GraphQL error - unexpected GraphQL errors
60
+ */
61
+ declare class GraphQLError extends StorefrontError {
62
+ readonly graphqlErrors: Array<{
63
+ message: string;
64
+ path?: readonly (string | number)[];
65
+ }>;
66
+ constructor(message: string, graphqlErrors: Array<{
67
+ message: string;
68
+ path?: readonly (string | number)[];
69
+ }>, options?: {
70
+ cause?: Error;
71
+ });
72
+ }
73
+
74
+ export { AuthError, GraphQLError, NetworkError, NotFoundError, StateError, StorefrontError, ValidationError };
package/dist/errors.d.ts CHANGED
@@ -1,80 +1,74 @@
1
- /**
2
- * Authentication error - invalid/revoked API key, 401/403 responses
3
- */
4
- export declare class AuthError extends StorefrontError {
5
- constructor(message: string, options?: {
6
- cause?: Error;
7
- });
8
- }
9
-
10
- /**
11
- * GraphQL error - unexpected GraphQL errors
12
- */
13
- export declare class GraphQLError extends StorefrontError {
14
- readonly graphqlErrors: Array<{
15
- message: string;
16
- path?: readonly (string | number)[];
17
- }>;
18
- constructor(message: string, graphqlErrors: Array<{
19
- message: string;
20
- path?: readonly (string | number)[];
21
- }>, options?: {
22
- cause?: Error;
23
- });
24
- }
25
-
26
- /**
27
- * Network error - fetch failed, connection issues
28
- */
29
- export declare class NetworkError extends StorefrontError {
30
- constructor(message: string, options?: {
31
- cause?: Error;
32
- });
33
- }
34
-
35
- /**
36
- * Not found error - resource doesn't exist
37
- */
38
- export declare class NotFoundError extends StorefrontError {
39
- constructor(message: string, options?: {
40
- cause?: Error;
41
- });
42
- }
43
-
44
- /**
45
- * State error - invalid cart state transition
46
- */
47
- export declare class StateError extends StorefrontError {
48
- readonly state: string;
49
- constructor(message: string, state: string, options?: {
50
- cause?: Error;
51
- });
52
- }
53
-
54
- /**
55
- * Base class for all Storefront SDK errors
56
- */
57
- export declare class StorefrontError extends Error {
58
- readonly code: string;
59
- constructor(message: string, code: string, options?: {
60
- cause?: Error;
61
- });
62
- }
63
-
64
- /**
65
- * Validation error - userErrors from mutations
66
- */
67
- export declare class ValidationError extends StorefrontError {
68
- readonly userErrors: Array<{
69
- field: string | null;
70
- message: string;
71
- }>;
72
- constructor(message: string, userErrors: Array<{
73
- field: string | null;
74
- message: string;
75
- }>, options?: {
76
- cause?: Error;
77
- });
78
- }
79
-
80
- export { }
1
+ /**
2
+ * Base class for all Storefront SDK errors
3
+ */
4
+ declare class StorefrontError extends Error {
5
+ readonly code: string;
6
+ constructor(message: string, code: string, options?: {
7
+ cause?: Error;
8
+ });
9
+ }
10
+ /**
11
+ * Network error - fetch failed, connection issues
12
+ */
13
+ declare class NetworkError extends StorefrontError {
14
+ constructor(message: string, options?: {
15
+ cause?: Error;
16
+ });
17
+ }
18
+ /**
19
+ * Authentication error - invalid/revoked API key, 401/403 responses
20
+ */
21
+ declare class AuthError extends StorefrontError {
22
+ constructor(message: string, options?: {
23
+ cause?: Error;
24
+ });
25
+ }
26
+ /**
27
+ * Validation error - userErrors from mutations
28
+ */
29
+ declare class ValidationError extends StorefrontError {
30
+ readonly userErrors: Array<{
31
+ field: string | null;
32
+ message: string;
33
+ }>;
34
+ constructor(message: string, userErrors: Array<{
35
+ field: string | null;
36
+ message: string;
37
+ }>, options?: {
38
+ cause?: Error;
39
+ });
40
+ }
41
+ /**
42
+ * Not found error - resource doesn't exist
43
+ */
44
+ declare class NotFoundError extends StorefrontError {
45
+ constructor(message: string, options?: {
46
+ cause?: Error;
47
+ });
48
+ }
49
+ /**
50
+ * State error - invalid cart state transition
51
+ */
52
+ declare class StateError extends StorefrontError {
53
+ readonly state: string;
54
+ constructor(message: string, state: string, options?: {
55
+ cause?: Error;
56
+ });
57
+ }
58
+ /**
59
+ * GraphQL error - unexpected GraphQL errors
60
+ */
61
+ declare class GraphQLError extends StorefrontError {
62
+ readonly graphqlErrors: Array<{
63
+ message: string;
64
+ path?: readonly (string | number)[];
65
+ }>;
66
+ constructor(message: string, graphqlErrors: Array<{
67
+ message: string;
68
+ path?: readonly (string | number)[];
69
+ }>, options?: {
70
+ cause?: Error;
71
+ });
72
+ }
73
+
74
+ export { AuthError, GraphQLError, NetworkError, NotFoundError, StateError, StorefrontError, ValidationError };