@devpad/api 2.2.7 → 2.2.8

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.
@@ -34,7 +34,8 @@ var isBadRequestError = (e) => hasKind(e, "bad_request");
34
34
  var isUnauthorizedError = (e) => hasKind(e, "unauthorized");
35
35
  var isScanError = (e) => hasKind(e, "scan_error");
36
36
  var isGithubError = (e) => hasKind(e, "github_error");
37
- var isServiceError = (e) => isNotFoundError(e) || isForbiddenError(e) || isValidationError(e) || isRateLimitedError(e) || isStoreError(e) || isNetworkError(e) || isAuthExpiredError(e) || isApiError(e) || isParseError(e) || isEncryptionError(e) || isDatabaseError(e) || isConflictError(e) || isProtectedError(e) || isBadRequestError(e) || isUnauthorizedError(e) || isScanError(e) || isGithubError(e);
37
+ var isValidationFieldError = (e) => hasKind(e, "validation_error");
38
+ var isServiceError = (e) => isNotFoundError(e) || isForbiddenError(e) || isValidationError(e) || isValidationFieldError(e) || isRateLimitedError(e) || isStoreError(e) || isNetworkError(e) || isAuthExpiredError(e) || isApiError(e) || isParseError(e) || isEncryptionError(e) || isDatabaseError(e) || isConflictError(e) || isProtectedError(e) || isBadRequestError(e) || isUnauthorizedError(e) || isScanError(e) || isGithubError(e);
38
39
  var isRetryableError = (e) => isRateLimitedError(e) || isNetworkError(e);
39
40
  var notFound = (resource, id, ctx) => logAndReturn({ kind: "not_found", resource, ...id && { id } }, ctx);
40
41
  var forbidden = (reason, ctx) => logAndReturn({ kind: "forbidden", ...reason && { reason, message: reason } }, ctx);
@@ -53,6 +54,7 @@ var badRequest = (message, details, ctx) => logAndReturn({ kind: "bad_request",
53
54
  var unauthorized = (message, ctx) => logAndReturn({ kind: "unauthorized", ...message && { message } }, ctx);
54
55
  var scanError = (message, ctx) => logAndReturn({ kind: "scan_error", ...message && { message } }, ctx);
55
56
  var githubError = (message, ctx) => logAndReturn({ kind: "github_error", ...message && { message } }, ctx);
57
+ var validationFieldError = (field, message, ctx) => logAndReturn({ kind: "validation_error", field, ...message && { message } }, ctx);
56
58
  var errors = {
57
59
  notFound,
58
60
  forbidden,
@@ -71,10 +73,12 @@ var errors = {
71
73
  unauthorized,
72
74
  scanError,
73
75
  githubError,
76
+ validationFieldError,
74
77
  is: {
75
78
  notFound: isNotFoundError,
76
79
  forbidden: isForbiddenError,
77
80
  validation: isValidationError,
81
+ validationField: isValidationFieldError,
78
82
  rateLimited: isRateLimitedError,
79
83
  storeError: isStoreError,
80
84
  networkError: isNetworkError,
@@ -113,6 +117,7 @@ export {
113
117
  isUnauthorizedError,
114
118
  isScanError,
115
119
  isGithubError,
120
+ isValidationFieldError,
116
121
  isServiceError,
117
122
  isRetryableError,
118
123
  notFound,
@@ -132,5 +137,6 @@ export {
132
137
  unauthorized,
133
138
  scanError,
134
139
  githubError,
140
+ validationFieldError,
135
141
  errors
136
142
  };