arky-sdk 0.3.83 → 0.3.85
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 +109 -245
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -60
- package/dist/index.d.ts +20 -60
- package/dist/index.js +109 -245
- package/dist/index.js.map +1 -1
- package/dist/time-DAeZRwPk.d.ts +266 -0
- package/dist/time-DPOc8E1C.d.cts +266 -0
- package/dist/utils.cjs +170 -0
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +157 -1
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/svg-3F_m7296.d.cts +0 -133
- package/dist/svg-4hIdMU6f.d.ts +0 -133
package/dist/svg-4hIdMU6f.d.ts
DELETED
|
@@ -1,133 +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) => any;
|
|
29
|
-
declare const translateMap: (labels: any, lang: string, fallback?: string) => any;
|
|
30
|
-
|
|
31
|
-
declare function convertToMajor(minorAmount: number): number;
|
|
32
|
-
declare function convertToMinor(majorAmount: number): number;
|
|
33
|
-
declare function getCurrencyFromMarket(marketId: string): string;
|
|
34
|
-
declare function formatCurrencyAmount(amount: number, currency: string, options?: {
|
|
35
|
-
showSymbols?: boolean;
|
|
36
|
-
decimalPlaces?: number;
|
|
37
|
-
customSymbol?: string;
|
|
38
|
-
}): string;
|
|
39
|
-
declare function formatMinor(amountMinor: number, currency: string, options?: {
|
|
40
|
-
showSymbols?: boolean;
|
|
41
|
-
decimalPlaces?: number;
|
|
42
|
-
customSymbol?: string;
|
|
43
|
-
}): string;
|
|
44
|
-
declare function formatPayment(payment: Payment, options?: {
|
|
45
|
-
showSymbols?: boolean;
|
|
46
|
-
decimalPlaces?: number;
|
|
47
|
-
showBreakdown?: boolean;
|
|
48
|
-
}): string;
|
|
49
|
-
declare function getMarketPrice(prices: Price[], marketId: string, businessMarkets?: any[], options?: {
|
|
50
|
-
showSymbols?: boolean;
|
|
51
|
-
decimalPlaces?: number;
|
|
52
|
-
showCompareAt?: boolean;
|
|
53
|
-
fallbackMarket?: string;
|
|
54
|
-
}): string;
|
|
55
|
-
declare function getPriceAmount(prices: Price[], marketId: string, fallbackMarket?: string): number;
|
|
56
|
-
declare function createPaymentForCheckout(subtotalMinor: number, marketId: string, currency: string, paymentMethod: any, options?: {
|
|
57
|
-
discount?: number;
|
|
58
|
-
taxAmount?: number;
|
|
59
|
-
taxRateBps?: number;
|
|
60
|
-
promoCode?: {
|
|
61
|
-
id: string;
|
|
62
|
-
code: string;
|
|
63
|
-
type: string;
|
|
64
|
-
value: number;
|
|
65
|
-
};
|
|
66
|
-
}): Payment;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Maps currency codes to their display symbols
|
|
70
|
-
*/
|
|
71
|
-
declare function getCurrencySymbol(currency: string): string;
|
|
72
|
-
|
|
73
|
-
interface ValidationResult {
|
|
74
|
-
isValid: boolean;
|
|
75
|
-
error?: string;
|
|
76
|
-
}
|
|
77
|
-
declare function validatePhoneNumber(phone: string): ValidationResult;
|
|
78
|
-
declare function validateEmail(email: string): ValidationResult;
|
|
79
|
-
declare function validateVerificationCode(code: string): ValidationResult;
|
|
80
|
-
declare function validateRequired(value: any, fieldName?: string): ValidationResult;
|
|
81
|
-
|
|
82
|
-
declare const tzGroups: {
|
|
83
|
-
label: string;
|
|
84
|
-
zones: {
|
|
85
|
-
label: string;
|
|
86
|
-
value: string;
|
|
87
|
-
}[];
|
|
88
|
-
}[];
|
|
89
|
-
declare function findTimeZone(groups: typeof tzGroups): string;
|
|
90
|
-
|
|
91
|
-
declare const locales: readonly ["en", "sr-latn"];
|
|
92
|
-
/**
|
|
93
|
-
* * returns "slugified" text.
|
|
94
|
-
* @param text: string - text to slugify
|
|
95
|
-
*/
|
|
96
|
-
declare function slugify(text: string): string;
|
|
97
|
-
/**
|
|
98
|
-
* * returns "humanized" text. runs slugify() and then replaces - with space and upper case first letter of every word, and lower case the rest
|
|
99
|
-
* @param text: string - text to humanize
|
|
100
|
-
*/
|
|
101
|
-
declare function humanize(text: string): string;
|
|
102
|
-
/**
|
|
103
|
-
* * returns "categorified" text. runs slugify() and then replaces - with space and upper cases everything
|
|
104
|
-
* @param text: string - text to categorify
|
|
105
|
-
* @returns string - categorified text
|
|
106
|
-
*/
|
|
107
|
-
declare function categorify(text: string): string;
|
|
108
|
-
/**
|
|
109
|
-
* * returns a nicely formatted string of the date passed
|
|
110
|
-
* @param date: string | number | Date - date to format
|
|
111
|
-
* @param locale: string - locale to format the date in
|
|
112
|
-
* @returns string - formatted date
|
|
113
|
-
*/
|
|
114
|
-
declare function formatDate(date: string | number | Date, locale: (typeof locales)[number]): string;
|
|
115
|
-
|
|
116
|
-
declare function fetchSvgContent(mediaObject: any): Promise<string | null>;
|
|
117
|
-
/**
|
|
118
|
-
* Server-side helper for Astro components to fetch SVG content during SSR
|
|
119
|
-
*
|
|
120
|
-
* @param mediaObject The media object from the CMS
|
|
121
|
-
* @returns The SVG content as a string, or empty string on failure
|
|
122
|
-
*/
|
|
123
|
-
declare function getSvgContentForAstro(mediaObject: any): Promise<string>;
|
|
124
|
-
/**
|
|
125
|
-
* Client-side helper to fetch and inject SVG content into DOM elements
|
|
126
|
-
*
|
|
127
|
-
* @param mediaObject The media object from the CMS
|
|
128
|
-
* @param targetElement The DOM element to inject the SVG into
|
|
129
|
-
* @param className Optional CSS class to add to the SVG
|
|
130
|
-
*/
|
|
131
|
-
declare function injectSvgIntoElement(mediaObject: any, targetElement: HTMLElement, className?: string): Promise<void>;
|
|
132
|
-
|
|
133
|
-
export { translateMap as A, type Block as B, type Collection as C, convertToMajor as D, convertToMinor as E, getCurrencyFromMarket as F, formatCurrencyAmount as G, tzGroups as H, validateEmail as I, validateVerificationCode as J, validateRequired as K, type ValidationResult as V, getBlockTextValue as a, getMarketPrice as b, getPriceAmount as c, formatPayment as d, extractBlockValues as e, formatBlockValue as f, getBlockLabel as g, formatMinor as h, createPaymentForCheckout as i, getCurrencySymbol as j, findTimeZone as k, humanize as l, categorify as m, formatDate as n, getSvgContentForAstro as o, prepareBlocksForSubmission as p, fetchSvgContent as q, injectSvgIntoElement as r, slugify as s, type CollectionEntry as t, getBlockValue as u, validatePhoneNumber as v, getBlockValues as w, getBlockObjectValues as x, getBlockFromArray as y, getImageUrl as z };
|