arky-sdk 0.3.7 → 0.3.9

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.
@@ -30,138 +30,6 @@ declare function getGalleryThumbnail(gallery: any): any;
30
30
  declare function thumbnailUrl(service: any, storageUrl?: string): string;
31
31
  declare const translateMap: (labels: any, lang: string, fallback?: string) => any;
32
32
 
33
- /**
34
- * Maps currency codes to their display symbols
35
- */
36
- declare function getCurrencySymbol(currency: string): string;
37
- /**
38
- * List of currencies where the symbol appears after the amount
39
- */
40
- declare const SYMBOL_AFTER_CURRENCIES: string[];
41
- /**
42
- * Check if currency symbol should be placed after the amount
43
- */
44
- declare function isSymbolAfterCurrency(currency: string): boolean;
45
-
46
- declare const ERROR_CODES: {
47
- "GENERAL.001": string;
48
- "GENERAL.002": string;
49
- "GENERAL.003": string;
50
- "GENERAL.004": string;
51
- "GENERAL.005": string;
52
- "GENERAL.006": string;
53
- "GOOGLE.001": string;
54
- "GOOGLE.002": string;
55
- "GOOGLE.003": string;
56
- "GOOGLE.004": string;
57
- "GOOGLE.005": string;
58
- "GOOGLE.006": string;
59
- "GOOGLE.007": string;
60
- "USER.001": string;
61
- "USER.002": string;
62
- "USER.003": string;
63
- "USER.004": string;
64
- "USER.005": string;
65
- "USER.006": string;
66
- "BUSINESS.001": string;
67
- "BUSINESS.002": string;
68
- "BUSINESS.003": string;
69
- "BUSINESS.004": string;
70
- "BUSINESS.005": string;
71
- "BUSINESS.006": string;
72
- "BUSINESS.007": string;
73
- "BUSINESS.010": string;
74
- "BUSINESS.011": string;
75
- "PROVIDER.001": string;
76
- "PROVIDER.002": string;
77
- "PROVIDER.003": string;
78
- "PROVIDER.004": string;
79
- "PROVIDER.005": string;
80
- "PROVIDER.006": string;
81
- "PROVIDER.007": string;
82
- "PROVIDER.008": string;
83
- };
84
- declare const ERROR_CONSTANTS: {
85
- GENERAL: {
86
- BAD_REQUEST: string;
87
- VALIDATION_ERROR: string;
88
- FORBIDDEN_ERROR: string;
89
- INTERNAL_SERVER_ERROR: string;
90
- UNAUTHORIZED: string;
91
- UNAUTHENTICATED: string;
92
- };
93
- USER: {
94
- NOT_FOUND: string;
95
- FAILED_TO_CREATE: string;
96
- FAILED_TO_UPDATE: string;
97
- FAILED_TO_DELETE: string;
98
- EMAIL_EXISTS: string;
99
- FAILED_TO_GET_UPLOAD_URL: string;
100
- };
101
- BUSINESS: {
102
- NOT_FOUND: string;
103
- FAILED_TO_CREATE: string;
104
- FAILED_TO_UPDATE: string;
105
- FAILED_TO_DELETE: string;
106
- FAILED_TO_GET_UPLOAD_URL: string;
107
- NAME_REQUIRED: string;
108
- BUSINESS_ID_REQUIRED: string;
109
- DESCRIPTION_REQUIRED: string;
110
- SLUG_INVALID: string;
111
- };
112
- };
113
- type ServerError = {
114
- message: string;
115
- error: string;
116
- statusCode: number;
117
- validationErrors: {
118
- field: string;
119
- error: string;
120
- }[];
121
- };
122
- type ValidationError = {
123
- field: string;
124
- error: string;
125
- };
126
- type RequestError = {
127
- validationErrors: ValidationError[];
128
- };
129
- declare function getErrorMessage(code: string): string;
130
- declare function isErrorCode(code: string): boolean;
131
- declare const transformErrors: (zodError: any) => ValidationError[];
132
- declare const convertServerErrorToRequestError: (serverError: ServerError, renameRules?: {
133
- [key: string]: string;
134
- }) => RequestError;
135
- declare const errors: {
136
- GENERAL: {
137
- BAD_REQUEST: string;
138
- VALIDATION_ERROR: string;
139
- FORBIDDEN_ERROR: string;
140
- INTERNAL_SERVER_ERROR: string;
141
- UNAUTHORIZED: string;
142
- UNAUTHENTICATED: string;
143
- };
144
- USER: {
145
- NOT_FOUND: string;
146
- FAILED_TO_CREATE: string;
147
- FAILED_TO_UPDATE: string;
148
- FAILED_TO_DELETE: string;
149
- EMAIL_EXISTS: string;
150
- FAILED_TO_GET_UPLOAD_URL: string;
151
- };
152
- BUSINESS: {
153
- NOT_FOUND: string;
154
- FAILED_TO_CREATE: string;
155
- FAILED_TO_UPDATE: string;
156
- FAILED_TO_DELETE: string;
157
- FAILED_TO_GET_UPLOAD_URL: string;
158
- NAME_REQUIRED: string;
159
- BUSINESS_ID_REQUIRED: string;
160
- DESCRIPTION_REQUIRED: string;
161
- SLUG_INVALID: string;
162
- };
163
- };
164
-
165
33
  declare function convertToMajor(minorAmount: number): number;
166
34
  declare function convertToMinor(majorAmount: number): number;
167
35
  declare function getCurrencyFromMarket(marketId: string): string;
@@ -193,22 +61,28 @@ declare function createPaymentForCheckout(subtotalMinor: number, marketId: strin
193
61
  promoCodeId?: string;
194
62
  }): Payment;
195
63
 
196
- declare function fetchSvgContent(mediaObject: any): Promise<string | null>;
197
- /**
198
- * Server-side helper for Astro components to fetch SVG content during SSR
199
- *
200
- * @param mediaObject The media object from the CMS
201
- * @returns The SVG content as a string, or empty string on failure
202
- */
203
- declare function getSvgContentForAstro(mediaObject: any): Promise<string>;
204
64
  /**
205
- * Client-side helper to fetch and inject SVG content into DOM elements
206
- *
207
- * @param mediaObject The media object from the CMS
208
- * @param targetElement The DOM element to inject the SVG into
209
- * @param className Optional CSS class to add to the SVG
65
+ * Maps currency codes to their display symbols
210
66
  */
211
- declare function injectSvgIntoElement(mediaObject: any, targetElement: HTMLElement, className?: string): Promise<void>;
67
+ declare function getCurrencySymbol(currency: string): string;
68
+
69
+ interface ValidationResult {
70
+ isValid: boolean;
71
+ error?: string;
72
+ }
73
+ declare function validatePhoneNumber(phone: string): ValidationResult;
74
+ declare function validateEmail(email: string): ValidationResult;
75
+ declare function validateVerificationCode(code: string): ValidationResult;
76
+ declare function validateRequired(value: any, fieldName?: string): ValidationResult;
77
+
78
+ declare const tzGroups: {
79
+ label: string;
80
+ zones: {
81
+ label: string;
82
+ value: string;
83
+ }[];
84
+ }[];
85
+ declare function findTimeZone(groups: typeof tzGroups): string;
212
86
 
213
87
  declare const locales: readonly ["en", "sr-latn"];
214
88
  /**
@@ -235,22 +109,21 @@ declare function categorify(text: string): string;
235
109
  */
236
110
  declare function formatDate(date: string | number | Date, locale: (typeof locales)[number]): string;
237
111
 
238
- declare const tzGroups: {
239
- label: string;
240
- zones: {
241
- label: string;
242
- value: string;
243
- }[];
244
- }[];
245
- declare function findTimeZone(groups: typeof tzGroups): string;
246
-
247
- interface ValidationResult {
248
- isValid: boolean;
249
- error?: string;
250
- }
251
- declare function validatePhoneNumber(phone: string): ValidationResult;
252
- declare function validateEmail(email: string): ValidationResult;
253
- declare function validateVerificationCode(code: string): ValidationResult;
254
- declare function validateRequired(value: any, fieldName?: string): ValidationResult;
112
+ declare function fetchSvgContent(mediaObject: any): Promise<string | null>;
113
+ /**
114
+ * Server-side helper for Astro components to fetch SVG content during SSR
115
+ *
116
+ * @param mediaObject The media object from the CMS
117
+ * @returns The SVG content as a string, or empty string on failure
118
+ */
119
+ declare function getSvgContentForAstro(mediaObject: any): Promise<string>;
120
+ /**
121
+ * Client-side helper to fetch and inject SVG content into DOM elements
122
+ *
123
+ * @param mediaObject The media object from the CMS
124
+ * @param targetElement The DOM element to inject the SVG into
125
+ * @param className Optional CSS class to add to the SVG
126
+ */
127
+ declare function injectSvgIntoElement(mediaObject: any, targetElement: HTMLElement, className?: string): Promise<void>;
255
128
 
256
- export { isErrorCode as A, transformErrors as B, type Collection as C, convertServerErrorToRequestError as D, ERROR_CODES as E, errors as F, convertToMajor as G, convertToMinor as H, getCurrencyFromMarket as I, formatCurrencyAmount as J, fetchSvgContent as K, getSvgContentForAstro as L, injectSvgIntoElement as M, slugify as N, humanize as O, categorify as P, formatDate as Q, type RequestError as R, SYMBOL_AFTER_CURRENCIES as S, tzGroups as T, type ValidationResult as U, type ValidationError as V, validateEmail as W, validateVerificationCode as X, validateRequired as Y, type Block as Z, getMarketPrice as a, getPriceAmount as b, formatMinor as c, createPaymentForCheckout as d, getCurrencySymbol as e, formatPayment as f, getGalleryThumbnail as g, findTimeZone as h, type CollectionEntry as i, getBlockLabel as j, formatBlockValue as k, extractBlockValues as l, getBlockTextValue as m, getBlockValue as n, getBlockValues as o, prepareBlocksForSubmission as p, getBlockObjectValues as q, getBlockFromArray as r, getImageUrl as s, thumbnailUrl as t, translateMap as u, validatePhoneNumber as v, isSymbolAfterCurrency as w, ERROR_CONSTANTS as x, type ServerError as y, getErrorMessage as z };
129
+ export { getImageUrl as A, type Block as B, type Collection as C, thumbnailUrl as D, translateMap as E, convertToMajor as F, convertToMinor as G, getCurrencyFromMarket as H, formatCurrencyAmount as I, tzGroups as J, validateEmail as K, validateVerificationCode as L, validateRequired as M, type ValidationResult as V, getBlockLabel as a, getBlockTextValue as b, getMarketPrice as c, getPriceAmount as d, extractBlockValues as e, formatBlockValue as f, getGalleryThumbnail as g, formatPayment as h, formatMinor as i, createPaymentForCheckout as j, getCurrencySymbol as k, findTimeZone as l, humanize as m, categorify as n, formatDate as o, prepareBlocksForSubmission as p, getSvgContentForAstro as q, fetchSvgContent as r, slugify as s, injectSvgIntoElement as t, type CollectionEntry as u, validatePhoneNumber as v, getBlockValue as w, getBlockValues as x, getBlockObjectValues as y, getBlockFromArray as z };
@@ -30,138 +30,6 @@ declare function getGalleryThumbnail(gallery: any): any;
30
30
  declare function thumbnailUrl(service: any, storageUrl?: string): string;
31
31
  declare const translateMap: (labels: any, lang: string, fallback?: string) => any;
32
32
 
33
- /**
34
- * Maps currency codes to their display symbols
35
- */
36
- declare function getCurrencySymbol(currency: string): string;
37
- /**
38
- * List of currencies where the symbol appears after the amount
39
- */
40
- declare const SYMBOL_AFTER_CURRENCIES: string[];
41
- /**
42
- * Check if currency symbol should be placed after the amount
43
- */
44
- declare function isSymbolAfterCurrency(currency: string): boolean;
45
-
46
- declare const ERROR_CODES: {
47
- "GENERAL.001": string;
48
- "GENERAL.002": string;
49
- "GENERAL.003": string;
50
- "GENERAL.004": string;
51
- "GENERAL.005": string;
52
- "GENERAL.006": string;
53
- "GOOGLE.001": string;
54
- "GOOGLE.002": string;
55
- "GOOGLE.003": string;
56
- "GOOGLE.004": string;
57
- "GOOGLE.005": string;
58
- "GOOGLE.006": string;
59
- "GOOGLE.007": string;
60
- "USER.001": string;
61
- "USER.002": string;
62
- "USER.003": string;
63
- "USER.004": string;
64
- "USER.005": string;
65
- "USER.006": string;
66
- "BUSINESS.001": string;
67
- "BUSINESS.002": string;
68
- "BUSINESS.003": string;
69
- "BUSINESS.004": string;
70
- "BUSINESS.005": string;
71
- "BUSINESS.006": string;
72
- "BUSINESS.007": string;
73
- "BUSINESS.010": string;
74
- "BUSINESS.011": string;
75
- "PROVIDER.001": string;
76
- "PROVIDER.002": string;
77
- "PROVIDER.003": string;
78
- "PROVIDER.004": string;
79
- "PROVIDER.005": string;
80
- "PROVIDER.006": string;
81
- "PROVIDER.007": string;
82
- "PROVIDER.008": string;
83
- };
84
- declare const ERROR_CONSTANTS: {
85
- GENERAL: {
86
- BAD_REQUEST: string;
87
- VALIDATION_ERROR: string;
88
- FORBIDDEN_ERROR: string;
89
- INTERNAL_SERVER_ERROR: string;
90
- UNAUTHORIZED: string;
91
- UNAUTHENTICATED: string;
92
- };
93
- USER: {
94
- NOT_FOUND: string;
95
- FAILED_TO_CREATE: string;
96
- FAILED_TO_UPDATE: string;
97
- FAILED_TO_DELETE: string;
98
- EMAIL_EXISTS: string;
99
- FAILED_TO_GET_UPLOAD_URL: string;
100
- };
101
- BUSINESS: {
102
- NOT_FOUND: string;
103
- FAILED_TO_CREATE: string;
104
- FAILED_TO_UPDATE: string;
105
- FAILED_TO_DELETE: string;
106
- FAILED_TO_GET_UPLOAD_URL: string;
107
- NAME_REQUIRED: string;
108
- BUSINESS_ID_REQUIRED: string;
109
- DESCRIPTION_REQUIRED: string;
110
- SLUG_INVALID: string;
111
- };
112
- };
113
- type ServerError = {
114
- message: string;
115
- error: string;
116
- statusCode: number;
117
- validationErrors: {
118
- field: string;
119
- error: string;
120
- }[];
121
- };
122
- type ValidationError = {
123
- field: string;
124
- error: string;
125
- };
126
- type RequestError = {
127
- validationErrors: ValidationError[];
128
- };
129
- declare function getErrorMessage(code: string): string;
130
- declare function isErrorCode(code: string): boolean;
131
- declare const transformErrors: (zodError: any) => ValidationError[];
132
- declare const convertServerErrorToRequestError: (serverError: ServerError, renameRules?: {
133
- [key: string]: string;
134
- }) => RequestError;
135
- declare const errors: {
136
- GENERAL: {
137
- BAD_REQUEST: string;
138
- VALIDATION_ERROR: string;
139
- FORBIDDEN_ERROR: string;
140
- INTERNAL_SERVER_ERROR: string;
141
- UNAUTHORIZED: string;
142
- UNAUTHENTICATED: string;
143
- };
144
- USER: {
145
- NOT_FOUND: string;
146
- FAILED_TO_CREATE: string;
147
- FAILED_TO_UPDATE: string;
148
- FAILED_TO_DELETE: string;
149
- EMAIL_EXISTS: string;
150
- FAILED_TO_GET_UPLOAD_URL: string;
151
- };
152
- BUSINESS: {
153
- NOT_FOUND: string;
154
- FAILED_TO_CREATE: string;
155
- FAILED_TO_UPDATE: string;
156
- FAILED_TO_DELETE: string;
157
- FAILED_TO_GET_UPLOAD_URL: string;
158
- NAME_REQUIRED: string;
159
- BUSINESS_ID_REQUIRED: string;
160
- DESCRIPTION_REQUIRED: string;
161
- SLUG_INVALID: string;
162
- };
163
- };
164
-
165
33
  declare function convertToMajor(minorAmount: number): number;
166
34
  declare function convertToMinor(majorAmount: number): number;
167
35
  declare function getCurrencyFromMarket(marketId: string): string;
@@ -193,22 +61,28 @@ declare function createPaymentForCheckout(subtotalMinor: number, marketId: strin
193
61
  promoCodeId?: string;
194
62
  }): Payment;
195
63
 
196
- declare function fetchSvgContent(mediaObject: any): Promise<string | null>;
197
- /**
198
- * Server-side helper for Astro components to fetch SVG content during SSR
199
- *
200
- * @param mediaObject The media object from the CMS
201
- * @returns The SVG content as a string, or empty string on failure
202
- */
203
- declare function getSvgContentForAstro(mediaObject: any): Promise<string>;
204
64
  /**
205
- * Client-side helper to fetch and inject SVG content into DOM elements
206
- *
207
- * @param mediaObject The media object from the CMS
208
- * @param targetElement The DOM element to inject the SVG into
209
- * @param className Optional CSS class to add to the SVG
65
+ * Maps currency codes to their display symbols
210
66
  */
211
- declare function injectSvgIntoElement(mediaObject: any, targetElement: HTMLElement, className?: string): Promise<void>;
67
+ declare function getCurrencySymbol(currency: string): string;
68
+
69
+ interface ValidationResult {
70
+ isValid: boolean;
71
+ error?: string;
72
+ }
73
+ declare function validatePhoneNumber(phone: string): ValidationResult;
74
+ declare function validateEmail(email: string): ValidationResult;
75
+ declare function validateVerificationCode(code: string): ValidationResult;
76
+ declare function validateRequired(value: any, fieldName?: string): ValidationResult;
77
+
78
+ declare const tzGroups: {
79
+ label: string;
80
+ zones: {
81
+ label: string;
82
+ value: string;
83
+ }[];
84
+ }[];
85
+ declare function findTimeZone(groups: typeof tzGroups): string;
212
86
 
213
87
  declare const locales: readonly ["en", "sr-latn"];
214
88
  /**
@@ -235,22 +109,21 @@ declare function categorify(text: string): string;
235
109
  */
236
110
  declare function formatDate(date: string | number | Date, locale: (typeof locales)[number]): string;
237
111
 
238
- declare const tzGroups: {
239
- label: string;
240
- zones: {
241
- label: string;
242
- value: string;
243
- }[];
244
- }[];
245
- declare function findTimeZone(groups: typeof tzGroups): string;
246
-
247
- interface ValidationResult {
248
- isValid: boolean;
249
- error?: string;
250
- }
251
- declare function validatePhoneNumber(phone: string): ValidationResult;
252
- declare function validateEmail(email: string): ValidationResult;
253
- declare function validateVerificationCode(code: string): ValidationResult;
254
- declare function validateRequired(value: any, fieldName?: string): ValidationResult;
112
+ declare function fetchSvgContent(mediaObject: any): Promise<string | null>;
113
+ /**
114
+ * Server-side helper for Astro components to fetch SVG content during SSR
115
+ *
116
+ * @param mediaObject The media object from the CMS
117
+ * @returns The SVG content as a string, or empty string on failure
118
+ */
119
+ declare function getSvgContentForAstro(mediaObject: any): Promise<string>;
120
+ /**
121
+ * Client-side helper to fetch and inject SVG content into DOM elements
122
+ *
123
+ * @param mediaObject The media object from the CMS
124
+ * @param targetElement The DOM element to inject the SVG into
125
+ * @param className Optional CSS class to add to the SVG
126
+ */
127
+ declare function injectSvgIntoElement(mediaObject: any, targetElement: HTMLElement, className?: string): Promise<void>;
255
128
 
256
- export { isErrorCode as A, transformErrors as B, type Collection as C, convertServerErrorToRequestError as D, ERROR_CODES as E, errors as F, convertToMajor as G, convertToMinor as H, getCurrencyFromMarket as I, formatCurrencyAmount as J, fetchSvgContent as K, getSvgContentForAstro as L, injectSvgIntoElement as M, slugify as N, humanize as O, categorify as P, formatDate as Q, type RequestError as R, SYMBOL_AFTER_CURRENCIES as S, tzGroups as T, type ValidationResult as U, type ValidationError as V, validateEmail as W, validateVerificationCode as X, validateRequired as Y, type Block as Z, getMarketPrice as a, getPriceAmount as b, formatMinor as c, createPaymentForCheckout as d, getCurrencySymbol as e, formatPayment as f, getGalleryThumbnail as g, findTimeZone as h, type CollectionEntry as i, getBlockLabel as j, formatBlockValue as k, extractBlockValues as l, getBlockTextValue as m, getBlockValue as n, getBlockValues as o, prepareBlocksForSubmission as p, getBlockObjectValues as q, getBlockFromArray as r, getImageUrl as s, thumbnailUrl as t, translateMap as u, validatePhoneNumber as v, isSymbolAfterCurrency as w, ERROR_CONSTANTS as x, type ServerError as y, getErrorMessage as z };
129
+ export { getImageUrl as A, type Block as B, type Collection as C, thumbnailUrl as D, translateMap as E, convertToMajor as F, convertToMinor as G, getCurrencyFromMarket as H, formatCurrencyAmount as I, tzGroups as J, validateEmail as K, validateVerificationCode as L, validateRequired as M, type ValidationResult as V, getBlockLabel as a, getBlockTextValue as b, getMarketPrice as c, getPriceAmount as d, extractBlockValues as e, formatBlockValue as f, getGalleryThumbnail as g, formatPayment as h, formatMinor as i, createPaymentForCheckout as j, getCurrencySymbol as k, findTimeZone as l, humanize as m, categorify as n, formatDate as o, prepareBlocksForSubmission as p, getSvgContentForAstro as q, fetchSvgContent as r, slugify as s, injectSvgIntoElement as t, type CollectionEntry as u, validatePhoneNumber as v, getBlockValue as w, getBlockValues as x, getBlockObjectValues as y, getBlockFromArray as z };
package/dist/utils.d.cts CHANGED
@@ -1,2 +1,123 @@
1
- export { Z as Block, C as Collection, i as CollectionEntry, E as ERROR_CODES, x as ERROR_CONSTANTS, R as RequestError, y as ServerError, V as ValidationError, U as ValidationResult, P as categorify, D as convertServerErrorToRequestError, G as convertToMajor, H as convertToMinor, d as createPaymentForCheckout, F as errors, l as extractBlockValues, K as fetchSvgContent, h as findTimeZone, k as formatBlockValue, J as formatCurrencyAmount, Q as formatDate, c as formatMinor, f as formatPayment, r as getBlockFromArray, j as getBlockLabel, q as getBlockObjectValues, m as getBlockTextValue, n as getBlockValue, o as getBlockValues, I as getCurrencyFromMarket, e as getCurrencySymbol, z as getErrorMessage, g as getGalleryThumbnail, s as getImageUrl, a as getMarketPrice, b as getPriceAmount, L as getSvgContentForAstro, O as humanize, M as injectSvgIntoElement, A as isErrorCode, p as prepareBlocksForSubmission, N as slugify, t as thumbnailUrl, B as transformErrors, u as translateMap, T as tzGroups, W as validateEmail, v as validatePhoneNumber, Y as validateRequired, X as validateVerificationCode } from './index-DOEos-hV.cjs';
1
+ export { B as Block, C as Collection, u as CollectionEntry, V as ValidationResult, n as categorify, F as convertToMajor, G as convertToMinor, j as createPaymentForCheckout, e as extractBlockValues, r as fetchSvgContent, l as findTimeZone, f as formatBlockValue, I as formatCurrencyAmount, o as formatDate, i as formatMinor, h as formatPayment, z as getBlockFromArray, a as getBlockLabel, y as getBlockObjectValues, b as getBlockTextValue, w as getBlockValue, x as getBlockValues, H as getCurrencyFromMarket, k as getCurrencySymbol, g as getGalleryThumbnail, A as getImageUrl, c as getMarketPrice, d as getPriceAmount, q as getSvgContentForAstro, m as humanize, t as injectSvgIntoElement, p as prepareBlocksForSubmission, s as slugify, D as thumbnailUrl, E as translateMap, J as tzGroups, K as validateEmail, v as validatePhoneNumber, M as validateRequired, L as validateVerificationCode } from './svg-CFjyTGXu.cjs';
2
2
  import './types.cjs';
3
+
4
+ declare const ERROR_CODES: {
5
+ "GENERAL.001": string;
6
+ "GENERAL.002": string;
7
+ "GENERAL.003": string;
8
+ "GENERAL.004": string;
9
+ "GENERAL.005": string;
10
+ "GENERAL.006": string;
11
+ "GOOGLE.001": string;
12
+ "GOOGLE.002": string;
13
+ "GOOGLE.003": string;
14
+ "GOOGLE.004": string;
15
+ "GOOGLE.005": string;
16
+ "GOOGLE.006": string;
17
+ "GOOGLE.007": string;
18
+ "USER.001": string;
19
+ "USER.002": string;
20
+ "USER.003": string;
21
+ "USER.004": string;
22
+ "USER.005": string;
23
+ "USER.006": string;
24
+ "BUSINESS.001": string;
25
+ "BUSINESS.002": string;
26
+ "BUSINESS.003": string;
27
+ "BUSINESS.004": string;
28
+ "BUSINESS.005": string;
29
+ "BUSINESS.006": string;
30
+ "BUSINESS.007": string;
31
+ "BUSINESS.010": string;
32
+ "BUSINESS.011": string;
33
+ "PROVIDER.001": string;
34
+ "PROVIDER.002": string;
35
+ "PROVIDER.003": string;
36
+ "PROVIDER.004": string;
37
+ "PROVIDER.005": string;
38
+ "PROVIDER.006": string;
39
+ "PROVIDER.007": string;
40
+ "PROVIDER.008": string;
41
+ };
42
+ declare const ERROR_CONSTANTS: {
43
+ GENERAL: {
44
+ BAD_REQUEST: string;
45
+ VALIDATION_ERROR: string;
46
+ FORBIDDEN_ERROR: string;
47
+ INTERNAL_SERVER_ERROR: string;
48
+ UNAUTHORIZED: string;
49
+ UNAUTHENTICATED: string;
50
+ };
51
+ USER: {
52
+ NOT_FOUND: string;
53
+ FAILED_TO_CREATE: string;
54
+ FAILED_TO_UPDATE: string;
55
+ FAILED_TO_DELETE: string;
56
+ EMAIL_EXISTS: string;
57
+ FAILED_TO_GET_UPLOAD_URL: string;
58
+ };
59
+ BUSINESS: {
60
+ NOT_FOUND: string;
61
+ FAILED_TO_CREATE: string;
62
+ FAILED_TO_UPDATE: string;
63
+ FAILED_TO_DELETE: string;
64
+ FAILED_TO_GET_UPLOAD_URL: string;
65
+ NAME_REQUIRED: string;
66
+ BUSINESS_ID_REQUIRED: string;
67
+ DESCRIPTION_REQUIRED: string;
68
+ SLUG_INVALID: string;
69
+ };
70
+ };
71
+ type ServerError = {
72
+ message: string;
73
+ error: string;
74
+ statusCode: number;
75
+ validationErrors: {
76
+ field: string;
77
+ error: string;
78
+ }[];
79
+ };
80
+ type ValidationError = {
81
+ field: string;
82
+ error: string;
83
+ };
84
+ type RequestError = {
85
+ validationErrors: ValidationError[];
86
+ };
87
+ declare function getErrorMessage(code: string): string;
88
+ declare function isErrorCode(code: string): boolean;
89
+ declare const transformErrors: (zodError: any) => ValidationError[];
90
+ declare const convertServerErrorToRequestError: (serverError: ServerError, renameRules?: {
91
+ [key: string]: string;
92
+ }) => RequestError;
93
+ declare const errors: {
94
+ GENERAL: {
95
+ BAD_REQUEST: string;
96
+ VALIDATION_ERROR: string;
97
+ FORBIDDEN_ERROR: string;
98
+ INTERNAL_SERVER_ERROR: string;
99
+ UNAUTHORIZED: string;
100
+ UNAUTHENTICATED: string;
101
+ };
102
+ USER: {
103
+ NOT_FOUND: string;
104
+ FAILED_TO_CREATE: string;
105
+ FAILED_TO_UPDATE: string;
106
+ FAILED_TO_DELETE: string;
107
+ EMAIL_EXISTS: string;
108
+ FAILED_TO_GET_UPLOAD_URL: string;
109
+ };
110
+ BUSINESS: {
111
+ NOT_FOUND: string;
112
+ FAILED_TO_CREATE: string;
113
+ FAILED_TO_UPDATE: string;
114
+ FAILED_TO_DELETE: string;
115
+ FAILED_TO_GET_UPLOAD_URL: string;
116
+ NAME_REQUIRED: string;
117
+ BUSINESS_ID_REQUIRED: string;
118
+ DESCRIPTION_REQUIRED: string;
119
+ SLUG_INVALID: string;
120
+ };
121
+ };
122
+
123
+ export { ERROR_CODES, ERROR_CONSTANTS, type RequestError, type ServerError, type ValidationError, convertServerErrorToRequestError, errors, getErrorMessage, isErrorCode, transformErrors };