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.
package/dist/utils.d.ts 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-DEmVFs0E.js';
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-BhIM4HZW.js';
2
2
  import './types.js';
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arky-sdk",
3
- "version": "0.3.7",
3
+ "version": "0.3.9",
4
4
  "description": "Official TypeScript SDK for Arky - All-in-one business platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -11,16 +11,6 @@
11
11
  "types": "./dist/index.d.ts",
12
12
  "import": "./dist/index.js",
13
13
  "require": "./dist/index.cjs"
14
- },
15
- "./utils": {
16
- "types": "./dist/utils.d.ts",
17
- "import": "./dist/utils.js",
18
- "require": "./dist/utils.cjs"
19
- },
20
- "./types": {
21
- "types": "./dist/types.d.ts",
22
- "import": "./dist/types.js",
23
- "require": "./dist/types.cjs"
24
14
  }
25
15
  },
26
16
  "files": [