arky-sdk 0.1.0 → 0.1.1
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/dist/config-CPkOgumU.d.cts +16 -0
- package/dist/config-CPkOgumU.d.ts +16 -0
- package/dist/index.cjs +1517 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +268 -0
- package/dist/index.d.ts +268 -26
- package/dist/index.js +1457 -56
- package/dist/index.js.map +1 -0
- package/dist/stores.cjs +2148 -0
- package/dist/stores.cjs.map +1 -0
- package/dist/stores.d.cts +218 -0
- package/dist/stores.d.ts +218 -0
- package/dist/stores.js +2111 -0
- package/dist/stores.js.map +1 -0
- package/dist/types.cjs +13 -0
- package/dist/types.cjs.map +1 -0
- package/dist/{types/index.d.ts → types.d.cts} +25 -24
- package/dist/types.d.ts +245 -0
- package/dist/types.js +11 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.cjs +725 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +9 -0
- package/dist/utils.d.ts +9 -0
- package/dist/utils.js +680 -0
- package/dist/utils.js.map +1 -0
- package/dist/validation-C9UAYKke.d.cts +245 -0
- package/dist/validation-DIvAzYjG.d.ts +245 -0
- package/package.json +17 -11
- package/dist/api/cms.d.ts +0 -19
- package/dist/api/cms.d.ts.map +0 -1
- package/dist/api/cms.js +0 -41
- package/dist/api/eshop.d.ts +0 -89
- package/dist/api/eshop.d.ts.map +0 -1
- package/dist/api/eshop.js +0 -183
- package/dist/api/index.d.ts +0 -6
- package/dist/api/index.d.ts.map +0 -1
- package/dist/api/index.js +0 -5
- package/dist/api/newsletter.d.ts +0 -32
- package/dist/api/newsletter.d.ts.map +0 -1
- package/dist/api/newsletter.js +0 -70
- package/dist/api/reservation.d.ts +0 -84
- package/dist/api/reservation.d.ts.map +0 -1
- package/dist/api/reservation.js +0 -239
- package/dist/config.d.ts +0 -15
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -20
- package/dist/index.d.ts.map +0 -1
- package/dist/services/auth.d.ts +0 -17
- package/dist/services/auth.d.ts.map +0 -1
- package/dist/services/auth.js +0 -62
- package/dist/services/http.d.ts +0 -20
- package/dist/services/http.d.ts.map +0 -1
- package/dist/services/http.js +0 -73
- package/dist/stores/business.d.ts +0 -28
- package/dist/stores/business.d.ts.map +0 -1
- package/dist/stores/business.js +0 -122
- package/dist/stores/cart.d.ts +0 -8
- package/dist/stores/cart.d.ts.map +0 -1
- package/dist/stores/cart.js +0 -20
- package/dist/stores/eshop.d.ts +0 -121
- package/dist/stores/eshop.d.ts.map +0 -1
- package/dist/stores/eshop.js +0 -377
- package/dist/stores/index.d.ts +0 -7
- package/dist/stores/index.d.ts.map +0 -1
- package/dist/stores/index.js +0 -19
- package/dist/stores/reservation.d.ts +0 -237
- package/dist/stores/reservation.d.ts.map +0 -1
- package/dist/stores/reservation.js +0 -853
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -8
- package/dist/utils/blocks.d.ts +0 -30
- package/dist/utils/blocks.d.ts.map +0 -1
- package/dist/utils/blocks.js +0 -237
- package/dist/utils/currency.d.ts +0 -9
- package/dist/utils/currency.d.ts.map +0 -1
- package/dist/utils/currency.js +0 -99
- package/dist/utils/errors.d.ts +0 -121
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/errors.js +0 -114
- package/dist/utils/i18n.d.ts +0 -5
- package/dist/utils/i18n.d.ts.map +0 -1
- package/dist/utils/i18n.js +0 -37
- package/dist/utils/index.d.ts +0 -9
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -10
- package/dist/utils/price.d.ts +0 -33
- package/dist/utils/price.d.ts.map +0 -1
- package/dist/utils/price.js +0 -141
- package/dist/utils/queryParams.d.ts +0 -21
- package/dist/utils/queryParams.d.ts.map +0 -1
- package/dist/utils/queryParams.js +0 -47
- package/dist/utils/svg.d.ts +0 -17
- package/dist/utils/svg.d.ts.map +0 -1
- package/dist/utils/svg.js +0 -62
- package/dist/utils/text.d.ts +0 -26
- package/dist/utils/text.d.ts.map +0 -1
- package/dist/utils/text.js +0 -64
- package/dist/utils/timezone.d.ts +0 -9
- package/dist/utils/timezone.d.ts.map +0 -1
- package/dist/utils/timezone.js +0 -49
- package/dist/utils/validation.d.ts +0 -9
- package/dist/utils/validation.d.ts.map +0 -1
- package/dist/utils/validation.js +0 -44
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,OAAO;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,aAAa,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,oBAAY,aAAa;IACxB,IAAI,SAAS;IACb,UAAU,gBAAgB;IAC1B,IAAI,SAAS;CACb;AAGD,MAAM,WAAW,aAAa;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACd;AAGD,MAAM,WAAW,mBAAmB;IACnC,EAAE,E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Q,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,GAAG,CAAC;IACd,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAG7B,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,aAAa,EAAE;QACd,QAAQ,EAAE,qBAAqB,GAAG,IAAI,CAAC;QACvC,OAAO,EAAE,OAAO,CAAC;KACjB,CAAC;CACF"}
|
package/dist/types/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// Core type definitions
|
|
2
|
-
// All types are exported individually for better tree-shaking
|
|
3
|
-
export var PaymentMethod;
|
|
4
|
-
(function (PaymentMethod) {
|
|
5
|
-
PaymentMethod["Cash"] = "CASH";
|
|
6
|
-
PaymentMethod["CreditCard"] = "CREDIT_CARD";
|
|
7
|
-
PaymentMethod["Free"] = "FREE";
|
|
8
|
-
})(PaymentMethod || (PaymentMethod = {}));
|
package/dist/utils/blocks.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export interface Block {
|
|
2
|
-
id: string;
|
|
3
|
-
key: string;
|
|
4
|
-
type: string;
|
|
5
|
-
properties: any;
|
|
6
|
-
value: any;
|
|
7
|
-
}
|
|
8
|
-
export interface Collection {
|
|
9
|
-
id: string;
|
|
10
|
-
blocks: Block[];
|
|
11
|
-
}
|
|
12
|
-
export interface CollectionEntry {
|
|
13
|
-
id: string;
|
|
14
|
-
collection_id: string;
|
|
15
|
-
blocks: Block[];
|
|
16
|
-
}
|
|
17
|
-
export declare function getBlockLabel(block: any, locale?: string): string;
|
|
18
|
-
export declare function formatBlockValue(block: any): string;
|
|
19
|
-
export declare function prepareBlocksForSubmission(formData: any): any[];
|
|
20
|
-
export declare function extractBlockValues(blocks: any[]): Record<string, any>;
|
|
21
|
-
export declare function getBlockTextValue(block: any, locale?: string): string;
|
|
22
|
-
export declare const getBlockValue: (entry: any, blockKey: string) => any;
|
|
23
|
-
export declare const getBlockValues: (entry: any, blockKey: string) => any;
|
|
24
|
-
export declare const getBlockObjectValues: (entry: any, blockKey: string, locale?: string) => any;
|
|
25
|
-
export declare const getBlockFromArray: (entry: any, blockKey: string, locale?: string) => any;
|
|
26
|
-
export declare const getImageUrl: (imageBlock: any, isBlock?: boolean) => any;
|
|
27
|
-
export declare function getGalleryThumbnail(gallery: any): any;
|
|
28
|
-
export declare function thumbnailUrl(service: any): string;
|
|
29
|
-
export declare const translateMap: (labels: any, lang: string, fallback?: string) => any;
|
|
30
|
-
//# sourceMappingURL=blocks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../src/utils/blocks.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,KAAK;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,GAAG,CAAC;IAChB,KAAK,EAAE,GAAG,CAAC;CACd;AAED,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,KAAK,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,KAAK,EAAE,CAAC;CACnB;AAGD,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,GAAE,MAAa,GAAG,MAAM,CAmBvE;AAGD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CA8BnD;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,GAAG,GAAG,GAAG,EAAE,CAa/D;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAYrE;AAGD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,GAAE,MAAa,GAAG,MAAM,CAgB3E;AAGD,eAAO,MAAM,aAAa,GAAI,OAAO,GAAG,EAAE,UAAU,MAAM,QAQzD,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,GAAG,EAAE,UAAU,MAAM,QAQ1D,CAAC;AAgCF,eAAO,MAAM,oBAAoB,GAAI,OAAO,GAAG,EAAE,UAAU,MAAM,EAAE,eAAa,QAkB/E,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,OAAO,GAAG,EAAE,UAAU,MAAM,EAAE,eAAa,QAW5E,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,YAAY,GAAG,EAAE,iBAAc,QA4D1D,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,GAAG,OAK/C;AAGD,wBAAgB,YAAY,CAAC,OAAO,EAAE,GAAG,UAIxC;AAED,eAAO,MAAM,YAAY,GAAI,QAAQ,GAAG,EAAE,MAAM,MAAM,EAAE,iBAAoB,QAiB3E,CAAC"}
|
package/dist/utils/blocks.js
DELETED
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
// Block utilities (extracted from index.ts)
|
|
2
|
-
import { STORAGE_URL } from '../config';
|
|
3
|
-
export function getBlockLabel(block, locale = 'en') {
|
|
4
|
-
if (!block)
|
|
5
|
-
return "";
|
|
6
|
-
if (block.properties?.label) {
|
|
7
|
-
if (typeof block.properties.label === "object") {
|
|
8
|
-
return (block.properties.label[locale] ||
|
|
9
|
-
block.properties.label.en ||
|
|
10
|
-
Object.values(block.properties.label)[0] ||
|
|
11
|
-
"");
|
|
12
|
-
}
|
|
13
|
-
if (typeof block.properties.label === "string") {
|
|
14
|
-
return block.properties.label;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
// Convert key to readable format
|
|
18
|
-
return block.key?.replace(/_/g, ' ').replace(/\b\w/g, (l) => l.toUpperCase()) || "";
|
|
19
|
-
}
|
|
20
|
-
export function formatBlockValue(block) {
|
|
21
|
-
if (!block || block.value === null || block.value === undefined) {
|
|
22
|
-
return "";
|
|
23
|
-
}
|
|
24
|
-
switch (block.type) {
|
|
25
|
-
case "BOOLEAN":
|
|
26
|
-
return block.value ? "Yes" : "No";
|
|
27
|
-
case "NUMBER":
|
|
28
|
-
// Handle date/datetime variants
|
|
29
|
-
if (block.properties?.variant === "DATE" || block.properties?.variant === "DATE_TIME") {
|
|
30
|
-
try {
|
|
31
|
-
return new Date(block.value).toLocaleDateString();
|
|
32
|
-
}
|
|
33
|
-
catch (e) {
|
|
34
|
-
return String(block.value);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return String(block.value);
|
|
38
|
-
case "RELATIONSHIP":
|
|
39
|
-
if (Array.isArray(block.value) && block.value.length > 0) {
|
|
40
|
-
const firstValue = block.value[0];
|
|
41
|
-
if (firstValue && firstValue.mimeType) {
|
|
42
|
-
return firstValue.name || firstValue.id || "Media";
|
|
43
|
-
}
|
|
44
|
-
return firstValue.title || firstValue.name || firstValue.id || "Entry";
|
|
45
|
-
}
|
|
46
|
-
return String(block.value);
|
|
47
|
-
default:
|
|
48
|
-
return String(block.value);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
export function prepareBlocksForSubmission(formData) {
|
|
52
|
-
const preparedBlocks = [];
|
|
53
|
-
Object.keys(formData).forEach((key) => {
|
|
54
|
-
if (formData[key] !== null && formData[key] !== undefined) {
|
|
55
|
-
preparedBlocks.push({
|
|
56
|
-
key,
|
|
57
|
-
value: [formData[key]],
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
return preparedBlocks;
|
|
62
|
-
}
|
|
63
|
-
export function extractBlockValues(blocks) {
|
|
64
|
-
const values = {};
|
|
65
|
-
blocks.forEach((block) => {
|
|
66
|
-
if (block.value && block.value.length > 0) {
|
|
67
|
-
values[block.key] = block.value[0];
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
values[block.key] = null;
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
return values;
|
|
74
|
-
}
|
|
75
|
-
// Extract localized text value from a block, handling multilingual content
|
|
76
|
-
export function getBlockTextValue(block, locale = 'en') {
|
|
77
|
-
if (!block || !block.value || block.value.length === 0)
|
|
78
|
-
return '';
|
|
79
|
-
const firstValue = block.value[0];
|
|
80
|
-
// Handle multilingual object
|
|
81
|
-
if (typeof firstValue === 'object' && firstValue !== null) {
|
|
82
|
-
// Try specified locale first, then 'en', then first available language
|
|
83
|
-
if (firstValue[locale])
|
|
84
|
-
return firstValue[locale];
|
|
85
|
-
if (firstValue.en)
|
|
86
|
-
return firstValue.en;
|
|
87
|
-
const values = Object.values(firstValue);
|
|
88
|
-
return String(values[0] || '');
|
|
89
|
-
}
|
|
90
|
-
// Handle simple string
|
|
91
|
-
return String(firstValue);
|
|
92
|
-
}
|
|
93
|
-
// Legacy functions for backward compatibility
|
|
94
|
-
export const getBlockValue = (entry, blockKey) => {
|
|
95
|
-
if (!entry || !entry.blocks)
|
|
96
|
-
return null;
|
|
97
|
-
const block = entry.blocks.find((f) => f.key === blockKey);
|
|
98
|
-
if (!block || !block.value || block.value.length === 0)
|
|
99
|
-
return null;
|
|
100
|
-
return block.value[0];
|
|
101
|
-
};
|
|
102
|
-
export const getBlockValues = (entry, blockKey) => {
|
|
103
|
-
if (!entry || !entry.blocks)
|
|
104
|
-
return null;
|
|
105
|
-
const block = entry.blocks.find((f) => f.key === blockKey);
|
|
106
|
-
if (!block || !block.value || block.value.length === 0)
|
|
107
|
-
return null;
|
|
108
|
-
return block.value;
|
|
109
|
-
};
|
|
110
|
-
function unwrapBlock(block, locale) {
|
|
111
|
-
if (!block?.type || block.value === undefined)
|
|
112
|
-
return block;
|
|
113
|
-
// Nested objects / lists → recurse for every child
|
|
114
|
-
if (block.type === "BLOCK") {
|
|
115
|
-
return block.value.map((obj) => {
|
|
116
|
-
const parsed = {};
|
|
117
|
-
for (const [k, v] of Object.entries(obj)) {
|
|
118
|
-
parsed[k] = unwrapBlock(v, locale);
|
|
119
|
-
}
|
|
120
|
-
return parsed;
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
// Primitive leaves (text/number/boolean/media …)
|
|
124
|
-
const isLocalized = block.type === "TEXT";
|
|
125
|
-
const isList = block.properties?.ui === "list" ||
|
|
126
|
-
(block.properties?.maxValues ?? 1) > 1 ||
|
|
127
|
-
block.value.length > 1;
|
|
128
|
-
if (isList) {
|
|
129
|
-
return isLocalized
|
|
130
|
-
? block.value.map((v) => v[locale] || v["en"])
|
|
131
|
-
: [...block.value];
|
|
132
|
-
}
|
|
133
|
-
return isLocalized ? block.value[0][locale] || block.value[0]["en"] : block.value[0];
|
|
134
|
-
}
|
|
135
|
-
export const getBlockObjectValues = (entry, blockKey, locale = "en") => {
|
|
136
|
-
if (!entry) {
|
|
137
|
-
return [];
|
|
138
|
-
}
|
|
139
|
-
const values = getBlockValues(entry, blockKey); // top‑level list
|
|
140
|
-
const parsed = values.map((obj) => {
|
|
141
|
-
const res = obj.value.reduce((acc, current) => {
|
|
142
|
-
acc[current.key] = unwrapBlock(current, locale);
|
|
143
|
-
return acc;
|
|
144
|
-
}, {});
|
|
145
|
-
return res;
|
|
146
|
-
});
|
|
147
|
-
return parsed;
|
|
148
|
-
};
|
|
149
|
-
export const getBlockFromArray = (entry, blockKey, locale = "en") => {
|
|
150
|
-
if (!entry) {
|
|
151
|
-
return [];
|
|
152
|
-
}
|
|
153
|
-
const values = getBlockValues(entry, blockKey); // top‑level list
|
|
154
|
-
return values.reduce((acc, current) => {
|
|
155
|
-
acc[current.key] = unwrapBlock(current, locale);
|
|
156
|
-
return acc;
|
|
157
|
-
});
|
|
158
|
-
};
|
|
159
|
-
export const getImageUrl = (imageBlock, isBlock = true) => {
|
|
160
|
-
if (!imageBlock)
|
|
161
|
-
return null;
|
|
162
|
-
const storageUrl = "https://storage.arky.io/dev"; // STORAGE_URL || "https://storage.arky.io/dev";
|
|
163
|
-
// Helper to check if URL is external
|
|
164
|
-
const isExternalUrl = (url) => {
|
|
165
|
-
return url.startsWith('http://') || url.startsWith('https://');
|
|
166
|
-
};
|
|
167
|
-
// Handle relationship blocks with media
|
|
168
|
-
if (imageBlock.type === 'RELATIONSHIP' && Array.isArray(imageBlock.value)) {
|
|
169
|
-
const mediaValue = imageBlock.value[0];
|
|
170
|
-
if (mediaValue && mediaValue.mimeType) {
|
|
171
|
-
// Handle media with resolutions structure
|
|
172
|
-
if (mediaValue.resolutions && mediaValue.resolutions.original && mediaValue.resolutions.original.url) {
|
|
173
|
-
const url = mediaValue.resolutions.original.url;
|
|
174
|
-
return isExternalUrl(url) ? url : `${storageUrl}/${url}`;
|
|
175
|
-
}
|
|
176
|
-
// Handle direct URL on media
|
|
177
|
-
if (mediaValue.url) {
|
|
178
|
-
return isExternalUrl(mediaValue.url) ? mediaValue.url : `${storageUrl}/${mediaValue.url}`;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
return null;
|
|
182
|
-
}
|
|
183
|
-
if (isBlock) {
|
|
184
|
-
if (typeof imageBlock === "string") {
|
|
185
|
-
// Check if it's already a full URL
|
|
186
|
-
if (isExternalUrl(imageBlock)) {
|
|
187
|
-
return imageBlock;
|
|
188
|
-
}
|
|
189
|
-
return `${storageUrl}/${imageBlock}`;
|
|
190
|
-
}
|
|
191
|
-
if (imageBlock.url) {
|
|
192
|
-
// Check if it's already a full URL
|
|
193
|
-
if (isExternalUrl(imageBlock.url)) {
|
|
194
|
-
return imageBlock.url;
|
|
195
|
-
}
|
|
196
|
-
return `${storageUrl}/${imageBlock.url}`;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
if (imageBlock.resolutions &&
|
|
200
|
-
imageBlock.resolutions.original &&
|
|
201
|
-
imageBlock.resolutions.original.url) {
|
|
202
|
-
const url = imageBlock.resolutions.original.url;
|
|
203
|
-
// Check if it's already a full URL
|
|
204
|
-
if (isExternalUrl(url)) {
|
|
205
|
-
return url;
|
|
206
|
-
}
|
|
207
|
-
return `${storageUrl}/${url}`;
|
|
208
|
-
}
|
|
209
|
-
return null;
|
|
210
|
-
};
|
|
211
|
-
export function getGalleryThumbnail(gallery) {
|
|
212
|
-
if (!gallery?.length)
|
|
213
|
-
return null;
|
|
214
|
-
const item = gallery.find((g) => g.settings.isThumbnail) || gallery[0];
|
|
215
|
-
const res = item.media.resolutions.thumbnail || item.media.resolutions.original;
|
|
216
|
-
return res?.url || null;
|
|
217
|
-
}
|
|
218
|
-
// full URL or null
|
|
219
|
-
export function thumbnailUrl(service) {
|
|
220
|
-
const storageUrl = STORAGE_URL || "";
|
|
221
|
-
const path = getGalleryThumbnail(service.gallery);
|
|
222
|
-
return path ? `${storageUrl}/${path}` : null;
|
|
223
|
-
}
|
|
224
|
-
export const translateMap = (labels, lang, fallback = "unknown") => {
|
|
225
|
-
let parsedLang = "en";
|
|
226
|
-
if (lang === "sr") {
|
|
227
|
-
parsedLang = "bih";
|
|
228
|
-
}
|
|
229
|
-
if (!labels) {
|
|
230
|
-
return fallback;
|
|
231
|
-
}
|
|
232
|
-
const label = labels[parsedLang];
|
|
233
|
-
if (!label) {
|
|
234
|
-
return fallback;
|
|
235
|
-
}
|
|
236
|
-
return label;
|
|
237
|
-
};
|
package/dist/utils/currency.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Maps currency codes to their display symbols
|
|
3
|
-
*/
|
|
4
|
-
export declare function getCurrencySymbol(currency: string): string;
|
|
5
|
-
/**
|
|
6
|
-
* Formats a price with the appropriate currency symbol
|
|
7
|
-
*/
|
|
8
|
-
export declare function formatCurrencyAmount(amount: number, currency: string): string;
|
|
9
|
-
//# sourceMappingURL=currency.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"currency.d.ts","sourceRoot":"","sources":["../../src/utils/currency.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAmF1D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAY7E"}
|
package/dist/utils/currency.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Maps currency codes to their display symbols
|
|
3
|
-
*/
|
|
4
|
-
export function getCurrencySymbol(currency) {
|
|
5
|
-
const currencySymbols = {
|
|
6
|
-
USD: '$',
|
|
7
|
-
EUR: '€',
|
|
8
|
-
GBP: '£',
|
|
9
|
-
CAD: 'C$',
|
|
10
|
-
AUD: 'A$',
|
|
11
|
-
JPY: '¥',
|
|
12
|
-
CHF: 'CHF',
|
|
13
|
-
SEK: 'kr',
|
|
14
|
-
NOK: 'kr',
|
|
15
|
-
DKK: 'kr',
|
|
16
|
-
PLN: 'zł',
|
|
17
|
-
CZK: 'Kč',
|
|
18
|
-
HUF: 'Ft',
|
|
19
|
-
RON: 'lei',
|
|
20
|
-
BGN: 'лв',
|
|
21
|
-
HRK: 'kn',
|
|
22
|
-
RSD: 'дин',
|
|
23
|
-
BAM: 'KM',
|
|
24
|
-
MKD: 'ден',
|
|
25
|
-
ALL: 'L',
|
|
26
|
-
TRY: '₺',
|
|
27
|
-
RUB: '₽',
|
|
28
|
-
UAH: '₴',
|
|
29
|
-
BYN: 'Br',
|
|
30
|
-
CNY: '¥',
|
|
31
|
-
INR: '₹',
|
|
32
|
-
KRW: '₩',
|
|
33
|
-
THB: '฿',
|
|
34
|
-
VND: '₫',
|
|
35
|
-
SGD: 'S$',
|
|
36
|
-
MYR: 'RM',
|
|
37
|
-
IDR: 'Rp',
|
|
38
|
-
PHP: '₱',
|
|
39
|
-
BRL: 'R$',
|
|
40
|
-
ARS: '$',
|
|
41
|
-
CLP: '$',
|
|
42
|
-
COP: '$',
|
|
43
|
-
PEN: 'S/',
|
|
44
|
-
MXN: '$',
|
|
45
|
-
ZAR: 'R',
|
|
46
|
-
EGP: 'E£',
|
|
47
|
-
NGN: '₦',
|
|
48
|
-
KES: 'KSh',
|
|
49
|
-
GHS: '₵',
|
|
50
|
-
MAD: 'DH',
|
|
51
|
-
TND: 'د.ت',
|
|
52
|
-
DZD: 'د.ج',
|
|
53
|
-
LYD: 'ل.د',
|
|
54
|
-
AED: 'د.إ',
|
|
55
|
-
SAR: 'ر.س',
|
|
56
|
-
QAR: 'ر.ق',
|
|
57
|
-
KWD: 'د.ك',
|
|
58
|
-
BHD: 'ب.د',
|
|
59
|
-
OMR: 'ر.ع',
|
|
60
|
-
JOD: 'د.أ',
|
|
61
|
-
LBP: 'ل.ل',
|
|
62
|
-
SYP: 'ل.س',
|
|
63
|
-
IQD: 'ع.د',
|
|
64
|
-
IRR: '﷼',
|
|
65
|
-
AFN: '؋',
|
|
66
|
-
PKR: '₨',
|
|
67
|
-
LKR: '₨',
|
|
68
|
-
NPR: '₨',
|
|
69
|
-
BDT: '৳',
|
|
70
|
-
MMK: 'K',
|
|
71
|
-
LAK: '₭',
|
|
72
|
-
KHR: '៛',
|
|
73
|
-
MNT: '₮',
|
|
74
|
-
KZT: '₸',
|
|
75
|
-
UZS: 'лв',
|
|
76
|
-
KGS: 'лв',
|
|
77
|
-
TJS: 'SM',
|
|
78
|
-
TMT: 'T',
|
|
79
|
-
AZN: '₼',
|
|
80
|
-
GEL: '₾',
|
|
81
|
-
AMD: '֏',
|
|
82
|
-
BYR: 'p.',
|
|
83
|
-
MDL: 'L'
|
|
84
|
-
};
|
|
85
|
-
return currencySymbols[currency.toUpperCase()] || currency;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Formats a price with the appropriate currency symbol
|
|
89
|
-
*/
|
|
90
|
-
export function formatCurrencyAmount(amount, currency) {
|
|
91
|
-
const symbol = getCurrencySymbol(currency);
|
|
92
|
-
const formattedAmount = (amount / 100).toFixed(2);
|
|
93
|
-
// For some currencies, symbol goes after the amount
|
|
94
|
-
const symbolAfterCurrencies = ['SEK', 'NOK', 'DKK', 'PLN', 'CZK', 'HUF', 'RON', 'BGN', 'HRK'];
|
|
95
|
-
if (symbolAfterCurrencies.includes(currency.toUpperCase())) {
|
|
96
|
-
return `${formattedAmount} ${symbol}`;
|
|
97
|
-
}
|
|
98
|
-
return `${symbol}${formattedAmount}`;
|
|
99
|
-
}
|
package/dist/utils/errors.d.ts
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
export declare const ERROR_CODES: {
|
|
2
|
-
"GENERAL.001": string;
|
|
3
|
-
"GENERAL.002": string;
|
|
4
|
-
"GENERAL.003": string;
|
|
5
|
-
"GENERAL.004": string;
|
|
6
|
-
"GENERAL.005": string;
|
|
7
|
-
"GENERAL.006": string;
|
|
8
|
-
"GOOGLE.001": string;
|
|
9
|
-
"GOOGLE.002": string;
|
|
10
|
-
"GOOGLE.003": string;
|
|
11
|
-
"GOOGLE.004": string;
|
|
12
|
-
"GOOGLE.005": string;
|
|
13
|
-
"GOOGLE.006": string;
|
|
14
|
-
"GOOGLE.007": string;
|
|
15
|
-
"USER.001": string;
|
|
16
|
-
"USER.002": string;
|
|
17
|
-
"USER.003": string;
|
|
18
|
-
"USER.004": string;
|
|
19
|
-
"USER.005": string;
|
|
20
|
-
"USER.006": string;
|
|
21
|
-
"BUSINESS.001": string;
|
|
22
|
-
"BUSINESS.002": string;
|
|
23
|
-
"BUSINESS.003": string;
|
|
24
|
-
"BUSINESS.004": string;
|
|
25
|
-
"BUSINESS.005": string;
|
|
26
|
-
"BUSINESS.006": string;
|
|
27
|
-
"BUSINESS.007": string;
|
|
28
|
-
"BUSINESS.010": string;
|
|
29
|
-
"BUSINESS.011": string;
|
|
30
|
-
"PROVIDER.001": string;
|
|
31
|
-
"PROVIDER.002": string;
|
|
32
|
-
"PROVIDER.003": string;
|
|
33
|
-
"PROVIDER.004": string;
|
|
34
|
-
"PROVIDER.005": string;
|
|
35
|
-
"PROVIDER.006": string;
|
|
36
|
-
"PROVIDER.007": string;
|
|
37
|
-
"PROVIDER.008": string;
|
|
38
|
-
};
|
|
39
|
-
export declare const ERROR_CONSTANTS: {
|
|
40
|
-
GENERAL: {
|
|
41
|
-
BAD_REQUEST: string;
|
|
42
|
-
VALIDATION_ERROR: string;
|
|
43
|
-
FORBIDDEN_ERROR: string;
|
|
44
|
-
INTERNAL_SERVER_ERROR: string;
|
|
45
|
-
UNAUTHORIZED: string;
|
|
46
|
-
UNAUTHENTICATED: string;
|
|
47
|
-
};
|
|
48
|
-
USER: {
|
|
49
|
-
NOT_FOUND: string;
|
|
50
|
-
FAILED_TO_CREATE: string;
|
|
51
|
-
FAILED_TO_UPDATE: string;
|
|
52
|
-
FAILED_TO_DELETE: string;
|
|
53
|
-
EMAIL_EXISTS: string;
|
|
54
|
-
FAILED_TO_GET_UPLOAD_URL: string;
|
|
55
|
-
};
|
|
56
|
-
BUSINESS: {
|
|
57
|
-
NOT_FOUND: string;
|
|
58
|
-
FAILED_TO_CREATE: string;
|
|
59
|
-
FAILED_TO_UPDATE: string;
|
|
60
|
-
FAILED_TO_DELETE: string;
|
|
61
|
-
FAILED_TO_GET_UPLOAD_URL: string;
|
|
62
|
-
NAME_REQUIRED: string;
|
|
63
|
-
BUSINESS_ID_REQUIRED: string;
|
|
64
|
-
DESCRIPTION_REQUIRED: string;
|
|
65
|
-
SLUG_INVALID: string;
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
export type ServerError = {
|
|
69
|
-
error: string;
|
|
70
|
-
reason: string;
|
|
71
|
-
code: string;
|
|
72
|
-
statusCode: number;
|
|
73
|
-
validationErrors: {
|
|
74
|
-
field: string;
|
|
75
|
-
code: string;
|
|
76
|
-
}[];
|
|
77
|
-
};
|
|
78
|
-
export type ValidationError = {
|
|
79
|
-
field: string;
|
|
80
|
-
message: string;
|
|
81
|
-
};
|
|
82
|
-
export type RequestError = {
|
|
83
|
-
validationErrors: ValidationError[];
|
|
84
|
-
};
|
|
85
|
-
export declare function getErrorMessage(code: string): string;
|
|
86
|
-
export declare function isErrorCode(code: string): boolean;
|
|
87
|
-
export declare const transformErrors: (zodError: any) => ValidationError[];
|
|
88
|
-
export declare const convertServerErrorToRequestError: (serverError: ServerError, renameRules?: {
|
|
89
|
-
[key: string]: string;
|
|
90
|
-
}) => RequestError;
|
|
91
|
-
export declare const errors: {
|
|
92
|
-
GENERAL: {
|
|
93
|
-
BAD_REQUEST: string;
|
|
94
|
-
VALIDATION_ERROR: string;
|
|
95
|
-
FORBIDDEN_ERROR: string;
|
|
96
|
-
INTERNAL_SERVER_ERROR: string;
|
|
97
|
-
UNAUTHORIZED: string;
|
|
98
|
-
UNAUTHENTICATED: string;
|
|
99
|
-
};
|
|
100
|
-
USER: {
|
|
101
|
-
NOT_FOUND: string;
|
|
102
|
-
FAILED_TO_CREATE: string;
|
|
103
|
-
FAILED_TO_UPDATE: string;
|
|
104
|
-
FAILED_TO_DELETE: string;
|
|
105
|
-
EMAIL_EXISTS: string;
|
|
106
|
-
FAILED_TO_GET_UPLOAD_URL: string;
|
|
107
|
-
};
|
|
108
|
-
BUSINESS: {
|
|
109
|
-
NOT_FOUND: string;
|
|
110
|
-
FAILED_TO_CREATE: string;
|
|
111
|
-
FAILED_TO_UPDATE: string;
|
|
112
|
-
FAILED_TO_DELETE: string;
|
|
113
|
-
FAILED_TO_GET_UPLOAD_URL: string;
|
|
114
|
-
NAME_REQUIRED: string;
|
|
115
|
-
BUSINESS_ID_REQUIRED: string;
|
|
116
|
-
DESCRIPTION_REQUIRED: string;
|
|
117
|
-
SLUG_INVALID: string;
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
export default ERROR_CODES;
|
|
121
|
-
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CvB,CAAC;AAGF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4B3B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE;QACd,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KAChB,EAAE,CAAC;CACP,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACvB,gBAAgB,EAAE,eAAe,EAAE,CAAC;CACvC,CAAC;AAGF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAID,eAAO,MAAM,eAAe,GAAI,UAAU,GAAG,KAAG,eAAe,EAmB9D,CAAC;AAEF,eAAO,MAAM,gCAAgC,GACzC,aAAa,WAAW,EACxB,cAAc;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,KACxC,YAeF,CAAC;AAGF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAkB,CAAC;AACtC,eAAe,WAAW,CAAC"}
|
package/dist/utils/errors.js
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
// Error handling utilities (combined from errorCodes.ts and errorHelpers.ts)
|
|
2
|
-
// Comprehensive error code system with both numeric codes and named constants
|
|
3
|
-
export const ERROR_CODES = {
|
|
4
|
-
// General errors
|
|
5
|
-
"GENERAL.001": "GENERAL.BAD_REQUEST",
|
|
6
|
-
"GENERAL.002": "GENERAL.VALIDATION_ERROR",
|
|
7
|
-
"GENERAL.003": "GENERAL.FORBIDDEN_ERROR",
|
|
8
|
-
"GENERAL.004": "GENERAL.INTERNAL_SERVER_ERROR",
|
|
9
|
-
"GENERAL.005": "GENERAL.UNAUTHORIZED",
|
|
10
|
-
"GENERAL.006": "GENERAL.UNAUTHENTICATED",
|
|
11
|
-
// Google/OAuth errors
|
|
12
|
-
"GOOGLE.001": "GOOGLE.INVALID_ORIGIN_URI",
|
|
13
|
-
"GOOGLE.002": "GOOGLE.INVALID_REDIRECT_URI",
|
|
14
|
-
"GOOGLE.003": "GOOGLE.FAILED_TO_CALL_API",
|
|
15
|
-
"GOOGLE.004": "GOOGLE.FAILED_LOGIN",
|
|
16
|
-
"GOOGLE.005": "GOOGLE.FAILED_LOGOUT",
|
|
17
|
-
"GOOGLE.006": "GOOGLE.FAILED_REFRESH_TOKEN",
|
|
18
|
-
"GOOGLE.007": "GOOGLE.INVALID_PROVIDER_PASSED",
|
|
19
|
-
// User errors
|
|
20
|
-
"USER.001": "USER.NOT_FOUND",
|
|
21
|
-
"USER.002": "USER.FAILED_TO_CREATE",
|
|
22
|
-
"USER.003": "USER.FAILED_TO_UPDATE",
|
|
23
|
-
"USER.004": "USER.FAILED_TO_DELETE",
|
|
24
|
-
"USER.005": "USER.EMAIL_EXISTS",
|
|
25
|
-
"USER.006": "USER.FAILED_TO_GET_UPLOAD_URL",
|
|
26
|
-
// Business errors
|
|
27
|
-
"BUSINESS.001": "BUSINESS.NOT_FOUND",
|
|
28
|
-
"BUSINESS.002": "BUSINESS.FAILED_TO_CREATE",
|
|
29
|
-
"BUSINESS.003": "BUSINESS.FAILED_TO_UPDATE",
|
|
30
|
-
"BUSINESS.004": "BUSINESS.FAILED_TO_DELETE",
|
|
31
|
-
"BUSINESS.005": "BUSINESS.FAILED_TO_GET_UPLOAD_URL",
|
|
32
|
-
"BUSINESS.006": "BUSINESS.NAME_REQUIRED",
|
|
33
|
-
"BUSINESS.007": "BUSINESS.BUSINESS_ID_REQUIRED",
|
|
34
|
-
"BUSINESS.010": "BUSINESS.DESCRIPTION_REQUIRED",
|
|
35
|
-
"BUSINESS.011": "BUSINESS.SLUG_INVALID",
|
|
36
|
-
// Provider errors
|
|
37
|
-
"PROVIDER.001": "PROVIDER.NOT_FOUND",
|
|
38
|
-
"PROVIDER.002": "PROVIDER.FAILED_TO_CREATE",
|
|
39
|
-
"PROVIDER.003": "PROVIDER.FAILED_TO_UPDATE",
|
|
40
|
-
"PROVIDER.004": "PROVIDER.FAILED_TO_DELETE",
|
|
41
|
-
"PROVIDER.005": "PROVIDER.FAILED_TO_GET_UPLOAD_URL",
|
|
42
|
-
"PROVIDER.006": "PROVIDER.NAME_REQUIRED",
|
|
43
|
-
"PROVIDER.007": "PROVIDER.BUSINESS_ID_REQUIRED",
|
|
44
|
-
"PROVIDER.008": "PROVIDER.DESCRIPTION_REQUIRED",
|
|
45
|
-
};
|
|
46
|
-
// Named error constants for direct access
|
|
47
|
-
export const ERROR_CONSTANTS = {
|
|
48
|
-
GENERAL: {
|
|
49
|
-
BAD_REQUEST: "GENERAL.BAD_REQUEST",
|
|
50
|
-
VALIDATION_ERROR: "GENERAL.VALIDATION_ERROR",
|
|
51
|
-
FORBIDDEN_ERROR: "GENERAL.FORBIDDEN_ERROR",
|
|
52
|
-
INTERNAL_SERVER_ERROR: "GENERAL.INTERNAL_SERVER_ERROR",
|
|
53
|
-
UNAUTHORIZED: "GENERAL.UNAUTHORIZED",
|
|
54
|
-
UNAUTHENTICATED: "GENERAL.UNAUTHENTICATED",
|
|
55
|
-
},
|
|
56
|
-
USER: {
|
|
57
|
-
NOT_FOUND: "USER.NOT_FOUND",
|
|
58
|
-
FAILED_TO_CREATE: "USER.FAILED_TO_CREATE",
|
|
59
|
-
FAILED_TO_UPDATE: "USER.FAILED_TO_UPDATE",
|
|
60
|
-
FAILED_TO_DELETE: "USER.FAILED_TO_DELETE",
|
|
61
|
-
EMAIL_EXISTS: "USER.EMAIL_EXISTS",
|
|
62
|
-
FAILED_TO_GET_UPLOAD_URL: "USER.FAILED_TO_GET_UPLOAD_URL",
|
|
63
|
-
},
|
|
64
|
-
BUSINESS: {
|
|
65
|
-
NOT_FOUND: "BUSINESS.NOT_FOUND",
|
|
66
|
-
FAILED_TO_CREATE: "BUSINESS.FAILED_TO_CREATE",
|
|
67
|
-
FAILED_TO_UPDATE: "BUSINESS.FAILED_TO_UPDATE",
|
|
68
|
-
FAILED_TO_DELETE: "BUSINESS.FAILED_TO_DELETE",
|
|
69
|
-
FAILED_TO_GET_UPLOAD_URL: "BUSINESS.FAILED_TO_GET_UPLOAD_URL",
|
|
70
|
-
NAME_REQUIRED: "BUSINESS.NAME_REQUIRED",
|
|
71
|
-
BUSINESS_ID_REQUIRED: "BUSINESS.BUSINESS_ID_REQUIRED",
|
|
72
|
-
DESCRIPTION_REQUIRED: "BUSINESS.DESCRIPTION_REQUIRED",
|
|
73
|
-
SLUG_INVALID: "BUSINESS.SLUG_INVALID",
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
// Utility functions for error handling
|
|
77
|
-
export function getErrorMessage(code) {
|
|
78
|
-
return ERROR_CODES[code] || code;
|
|
79
|
-
}
|
|
80
|
-
export function isErrorCode(code) {
|
|
81
|
-
return code in ERROR_CODES;
|
|
82
|
-
}
|
|
83
|
-
// Note: transformErrors requires zod which is not a dependency
|
|
84
|
-
// If you need zod validation, add it to package.json dependencies
|
|
85
|
-
export const transformErrors = (zodError) => {
|
|
86
|
-
const customErrors = [];
|
|
87
|
-
if (!zodError.issues)
|
|
88
|
-
return customErrors;
|
|
89
|
-
zodError.issues.forEach((issue) => {
|
|
90
|
-
const field = issue.path.join(".");
|
|
91
|
-
const message = issue.message;
|
|
92
|
-
if (!customErrors.some((customError) => customError.field === field && customError.message === message)) {
|
|
93
|
-
customErrors.push({ field, message });
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
return customErrors;
|
|
97
|
-
};
|
|
98
|
-
export const convertServerErrorToRequestError = (serverError, renameRules) => {
|
|
99
|
-
return {
|
|
100
|
-
...serverError,
|
|
101
|
-
validationErrors: serverError.validationErrors.map((validationError) => {
|
|
102
|
-
const field = renameRules && renameRules[validationError.field]
|
|
103
|
-
? renameRules[validationError.field]
|
|
104
|
-
: validationError.field;
|
|
105
|
-
return {
|
|
106
|
-
field: field,
|
|
107
|
-
message: ERROR_CODES[validationError.code] || "Unknown error",
|
|
108
|
-
};
|
|
109
|
-
}),
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
// Export for backward compatibility
|
|
113
|
-
export const errors = ERROR_CONSTANTS;
|
|
114
|
-
export default ERROR_CODES;
|
package/dist/utils/i18n.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare function setDefaultLocale(locale: string): void;
|
|
2
|
-
export declare function getLocale(): string;
|
|
3
|
-
export declare function getLocaleFromUrl(url: URL): string;
|
|
4
|
-
export declare function getLocalizedString(value: any, locale?: string): string;
|
|
5
|
-
//# sourceMappingURL=i18n.d.ts.map
|
package/dist/utils/i18n.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/utils/i18n.ts"],"names":[],"mappings":"AAKA,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAErD;AAED,wBAAgB,SAAS,IAAI,MAAM,CAMlC;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAajD;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAatE"}
|