arky-sdk 0.3.7 → 0.3.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.
- package/dist/index.cjs +828 -1277
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -192
- package/dist/index.d.ts +5 -192
- package/dist/index.js +829 -1214
- package/dist/index.js.map +1 -1
- package/dist/timezone-Cnh6zsAn.d.ts +87 -0
- package/dist/timezone-Ctc3v4hK.d.cts +87 -0
- package/dist/utils.d.cts +164 -1
- package/dist/utils.d.ts +164 -1
- package/package.json +1 -11
- package/dist/index-DEmVFs0E.d.ts +0 -256
- package/dist/index-DOEos-hV.d.cts +0 -256
package/dist/index-DEmVFs0E.d.ts
DELETED
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
import { Price, Payment } from './types.js';
|
|
2
|
-
|
|
3
|
-
interface Block {
|
|
4
|
-
id: string;
|
|
5
|
-
key: string;
|
|
6
|
-
type: string;
|
|
7
|
-
properties: any;
|
|
8
|
-
value: any;
|
|
9
|
-
}
|
|
10
|
-
interface Collection {
|
|
11
|
-
id: string;
|
|
12
|
-
blocks: Block[];
|
|
13
|
-
}
|
|
14
|
-
interface CollectionEntry {
|
|
15
|
-
id: string;
|
|
16
|
-
collection_id: string;
|
|
17
|
-
blocks: Block[];
|
|
18
|
-
}
|
|
19
|
-
declare function getBlockLabel(block: any, locale?: string): string;
|
|
20
|
-
declare function formatBlockValue(block: any): string;
|
|
21
|
-
declare function prepareBlocksForSubmission(formData: any): any[];
|
|
22
|
-
declare function extractBlockValues(blocks: any[]): Record<string, any>;
|
|
23
|
-
declare function getBlockTextValue(block: any, locale?: string): string;
|
|
24
|
-
declare const getBlockValue: (entry: any, blockKey: string) => any;
|
|
25
|
-
declare const getBlockValues: (entry: any, blockKey: string) => any;
|
|
26
|
-
declare const getBlockObjectValues: (entry: any, blockKey: string, locale?: string) => any;
|
|
27
|
-
declare const getBlockFromArray: (entry: any, blockKey: string, locale?: string) => any;
|
|
28
|
-
declare const getImageUrl: (imageBlock: any, isBlock?: boolean, storageUrl?: string) => any;
|
|
29
|
-
declare function getGalleryThumbnail(gallery: any): any;
|
|
30
|
-
declare function thumbnailUrl(service: any, storageUrl?: string): string;
|
|
31
|
-
declare const translateMap: (labels: any, lang: string, fallback?: string) => any;
|
|
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
|
-
declare function convertToMajor(minorAmount: number): number;
|
|
166
|
-
declare function convertToMinor(majorAmount: number): number;
|
|
167
|
-
declare function getCurrencyFromMarket(marketId: string): string;
|
|
168
|
-
declare function formatCurrencyAmount(amount: number, currency: string, options?: {
|
|
169
|
-
showSymbols?: boolean;
|
|
170
|
-
decimalPlaces?: number;
|
|
171
|
-
customSymbol?: string;
|
|
172
|
-
}): string;
|
|
173
|
-
declare function formatMinor(amountMinor: number, currency: string, options?: {
|
|
174
|
-
showSymbols?: boolean;
|
|
175
|
-
decimalPlaces?: number;
|
|
176
|
-
customSymbol?: string;
|
|
177
|
-
}): string;
|
|
178
|
-
declare function formatPayment(payment: Payment, options?: {
|
|
179
|
-
showSymbols?: boolean;
|
|
180
|
-
decimalPlaces?: number;
|
|
181
|
-
showBreakdown?: boolean;
|
|
182
|
-
}): string;
|
|
183
|
-
declare function getMarketPrice(prices: Price[], marketId: string, businessMarkets?: any[], options?: {
|
|
184
|
-
showSymbols?: boolean;
|
|
185
|
-
decimalPlaces?: number;
|
|
186
|
-
showCompareAt?: boolean;
|
|
187
|
-
fallbackMarket?: string;
|
|
188
|
-
}): string;
|
|
189
|
-
declare function getPriceAmount(prices: Price[], marketId: string, fallbackMarket?: string): number;
|
|
190
|
-
declare function createPaymentForCheckout(subtotalMinor: number, marketId: string, currency: string, paymentMethod: any, options?: {
|
|
191
|
-
discount?: number;
|
|
192
|
-
tax?: number;
|
|
193
|
-
promoCodeId?: string;
|
|
194
|
-
}): Payment;
|
|
195
|
-
|
|
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
|
-
/**
|
|
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
|
|
210
|
-
*/
|
|
211
|
-
declare function injectSvgIntoElement(mediaObject: any, targetElement: HTMLElement, className?: string): Promise<void>;
|
|
212
|
-
|
|
213
|
-
declare const locales: readonly ["en", "sr-latn"];
|
|
214
|
-
/**
|
|
215
|
-
* * returns "slugified" text.
|
|
216
|
-
* @param text: string - text to slugify
|
|
217
|
-
*/
|
|
218
|
-
declare function slugify(text: string): string;
|
|
219
|
-
/**
|
|
220
|
-
* * returns "humanized" text. runs slugify() and then replaces - with space and upper case first letter of every word, and lower case the rest
|
|
221
|
-
* @param text: string - text to humanize
|
|
222
|
-
*/
|
|
223
|
-
declare function humanize(text: string): string;
|
|
224
|
-
/**
|
|
225
|
-
* * returns "categorified" text. runs slugify() and then replaces - with space and upper cases everything
|
|
226
|
-
* @param text: string - text to categorify
|
|
227
|
-
* @returns string - categorified text
|
|
228
|
-
*/
|
|
229
|
-
declare function categorify(text: string): string;
|
|
230
|
-
/**
|
|
231
|
-
* * returns a nicely formatted string of the date passed
|
|
232
|
-
* @param date: string | number | Date - date to format
|
|
233
|
-
* @param locale: string - locale to format the date in
|
|
234
|
-
* @returns string - formatted date
|
|
235
|
-
*/
|
|
236
|
-
declare function formatDate(date: string | number | Date, locale: (typeof locales)[number]): string;
|
|
237
|
-
|
|
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;
|
|
255
|
-
|
|
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 };
|
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
import { Price, Payment } from './types.cjs';
|
|
2
|
-
|
|
3
|
-
interface Block {
|
|
4
|
-
id: string;
|
|
5
|
-
key: string;
|
|
6
|
-
type: string;
|
|
7
|
-
properties: any;
|
|
8
|
-
value: any;
|
|
9
|
-
}
|
|
10
|
-
interface Collection {
|
|
11
|
-
id: string;
|
|
12
|
-
blocks: Block[];
|
|
13
|
-
}
|
|
14
|
-
interface CollectionEntry {
|
|
15
|
-
id: string;
|
|
16
|
-
collection_id: string;
|
|
17
|
-
blocks: Block[];
|
|
18
|
-
}
|
|
19
|
-
declare function getBlockLabel(block: any, locale?: string): string;
|
|
20
|
-
declare function formatBlockValue(block: any): string;
|
|
21
|
-
declare function prepareBlocksForSubmission(formData: any): any[];
|
|
22
|
-
declare function extractBlockValues(blocks: any[]): Record<string, any>;
|
|
23
|
-
declare function getBlockTextValue(block: any, locale?: string): string;
|
|
24
|
-
declare const getBlockValue: (entry: any, blockKey: string) => any;
|
|
25
|
-
declare const getBlockValues: (entry: any, blockKey: string) => any;
|
|
26
|
-
declare const getBlockObjectValues: (entry: any, blockKey: string, locale?: string) => any;
|
|
27
|
-
declare const getBlockFromArray: (entry: any, blockKey: string, locale?: string) => any;
|
|
28
|
-
declare const getImageUrl: (imageBlock: any, isBlock?: boolean, storageUrl?: string) => any;
|
|
29
|
-
declare function getGalleryThumbnail(gallery: any): any;
|
|
30
|
-
declare function thumbnailUrl(service: any, storageUrl?: string): string;
|
|
31
|
-
declare const translateMap: (labels: any, lang: string, fallback?: string) => any;
|
|
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
|
-
declare function convertToMajor(minorAmount: number): number;
|
|
166
|
-
declare function convertToMinor(majorAmount: number): number;
|
|
167
|
-
declare function getCurrencyFromMarket(marketId: string): string;
|
|
168
|
-
declare function formatCurrencyAmount(amount: number, currency: string, options?: {
|
|
169
|
-
showSymbols?: boolean;
|
|
170
|
-
decimalPlaces?: number;
|
|
171
|
-
customSymbol?: string;
|
|
172
|
-
}): string;
|
|
173
|
-
declare function formatMinor(amountMinor: number, currency: string, options?: {
|
|
174
|
-
showSymbols?: boolean;
|
|
175
|
-
decimalPlaces?: number;
|
|
176
|
-
customSymbol?: string;
|
|
177
|
-
}): string;
|
|
178
|
-
declare function formatPayment(payment: Payment, options?: {
|
|
179
|
-
showSymbols?: boolean;
|
|
180
|
-
decimalPlaces?: number;
|
|
181
|
-
showBreakdown?: boolean;
|
|
182
|
-
}): string;
|
|
183
|
-
declare function getMarketPrice(prices: Price[], marketId: string, businessMarkets?: any[], options?: {
|
|
184
|
-
showSymbols?: boolean;
|
|
185
|
-
decimalPlaces?: number;
|
|
186
|
-
showCompareAt?: boolean;
|
|
187
|
-
fallbackMarket?: string;
|
|
188
|
-
}): string;
|
|
189
|
-
declare function getPriceAmount(prices: Price[], marketId: string, fallbackMarket?: string): number;
|
|
190
|
-
declare function createPaymentForCheckout(subtotalMinor: number, marketId: string, currency: string, paymentMethod: any, options?: {
|
|
191
|
-
discount?: number;
|
|
192
|
-
tax?: number;
|
|
193
|
-
promoCodeId?: string;
|
|
194
|
-
}): Payment;
|
|
195
|
-
|
|
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
|
-
/**
|
|
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
|
|
210
|
-
*/
|
|
211
|
-
declare function injectSvgIntoElement(mediaObject: any, targetElement: HTMLElement, className?: string): Promise<void>;
|
|
212
|
-
|
|
213
|
-
declare const locales: readonly ["en", "sr-latn"];
|
|
214
|
-
/**
|
|
215
|
-
* * returns "slugified" text.
|
|
216
|
-
* @param text: string - text to slugify
|
|
217
|
-
*/
|
|
218
|
-
declare function slugify(text: string): string;
|
|
219
|
-
/**
|
|
220
|
-
* * returns "humanized" text. runs slugify() and then replaces - with space and upper case first letter of every word, and lower case the rest
|
|
221
|
-
* @param text: string - text to humanize
|
|
222
|
-
*/
|
|
223
|
-
declare function humanize(text: string): string;
|
|
224
|
-
/**
|
|
225
|
-
* * returns "categorified" text. runs slugify() and then replaces - with space and upper cases everything
|
|
226
|
-
* @param text: string - text to categorify
|
|
227
|
-
* @returns string - categorified text
|
|
228
|
-
*/
|
|
229
|
-
declare function categorify(text: string): string;
|
|
230
|
-
/**
|
|
231
|
-
* * returns a nicely formatted string of the date passed
|
|
232
|
-
* @param date: string | number | Date - date to format
|
|
233
|
-
* @param locale: string - locale to format the date in
|
|
234
|
-
* @returns string - formatted date
|
|
235
|
-
*/
|
|
236
|
-
declare function formatDate(date: string | number | Date, locale: (typeof locales)[number]): string;
|
|
237
|
-
|
|
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;
|
|
255
|
-
|
|
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 };
|