@getmicdrop/venue-calendar 3.3.1 → 3.3.2

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.
Files changed (49) hide show
  1. package/dist/{VenueCalendar-Xppig0q_.js → VenueCalendar-BMSfRl2d.js} +10 -13
  2. package/dist/{VenueCalendar-Xppig0q_.js.map → VenueCalendar-BMSfRl2d.js.map} +1 -1
  3. package/dist/api/api.cjs +2 -0
  4. package/dist/api/api.cjs.map +1 -0
  5. package/dist/api/api.mjs +787 -0
  6. package/dist/api/api.mjs.map +1 -0
  7. package/dist/api/client.d.ts +46 -0
  8. package/dist/api/events.d.ts +102 -0
  9. package/dist/api/index.d.ts +38 -0
  10. package/dist/api/orders.d.ts +104 -0
  11. package/dist/api/promo.d.ts +45 -0
  12. package/dist/api/transformers/event.d.ts +86 -0
  13. package/dist/api/transformers/index.d.ts +9 -0
  14. package/dist/api/transformers/order.d.ts +105 -0
  15. package/dist/api/transformers/venue.d.ts +48 -0
  16. package/dist/api/venues.d.ts +33 -0
  17. package/dist/{index-BjErG0CG.js → index-CoJaem3n.js} +2 -2
  18. package/dist/{index-BjErG0CG.js.map → index-CoJaem3n.js.map} +1 -1
  19. package/dist/venue-calendar.css +1 -1
  20. package/dist/venue-calendar.es.js +1 -1
  21. package/dist/venue-calendar.iife.js +4 -4
  22. package/dist/venue-calendar.iife.js.map +1 -1
  23. package/dist/venue-calendar.umd.js +4 -4
  24. package/dist/venue-calendar.umd.js.map +1 -1
  25. package/package.json +96 -94
  26. package/src/lib/api/client.ts +0 -210
  27. package/src/lib/api/events.ts +0 -358
  28. package/src/lib/api/index.ts +0 -182
  29. package/src/lib/api/orders.ts +0 -390
  30. package/src/lib/api/promo.ts +0 -164
  31. package/src/lib/api/transformers/event.ts +0 -248
  32. package/src/lib/api/transformers/index.ts +0 -29
  33. package/src/lib/api/transformers/order.ts +0 -207
  34. package/src/lib/api/transformers/venue.ts +0 -118
  35. package/src/lib/api/venues.ts +0 -100
  36. package/src/lib/utils/api.js +0 -790
  37. package/src/lib/utils/api.test.js +0 -1284
  38. package/src/lib/utils/constants.js +0 -8
  39. package/src/lib/utils/constants.test.js +0 -39
  40. package/src/lib/utils/datetime.js +0 -266
  41. package/src/lib/utils/datetime.test.js +0 -340
  42. package/src/lib/utils/event-transform.js +0 -464
  43. package/src/lib/utils/event-transform.test.js +0 -413
  44. package/src/lib/utils/logger.js +0 -105
  45. package/src/lib/utils/timezone.js +0 -109
  46. package/src/lib/utils/timezone.test.js +0 -222
  47. package/src/lib/utils/utils.js +0 -806
  48. package/src/lib/utils/utils.test.js +0 -959
  49. /package/{src/lib/api/types.ts → dist/api/types.d.ts} +0 -0
package/package.json CHANGED
@@ -1,94 +1,96 @@
1
- {
2
- "name": "@getmicdrop/venue-calendar",
3
- "version": "3.3.1",
4
- "description": "A customizable Svelte calendar component for displaying comedy events",
5
- "type": "module",
6
- "types": "./dist/types/index.d.ts",
7
- "main": "./dist/venue-calendar.umd.js",
8
- "module": "./dist/venue-calendar.es.js",
9
- "exports": {
10
- ".": {
11
- "types": "./dist/types/index.d.ts",
12
- "import": "./dist/venue-calendar.es.js",
13
- "require": "./dist/venue-calendar.umd.js",
14
- "default": "./dist/venue-calendar.es.js"
15
- },
16
- "./api": {
17
- "types": "./src/lib/api/index.ts",
18
- "import": "./src/lib/api/index.ts",
19
- "default": "./src/lib/api/index.ts"
20
- },
21
- "./theme": {
22
- "import": "./src/lib/theme.js",
23
- "default": "./src/lib/theme.js"
24
- },
25
- "./dist/venue-calendar.css": "./dist/venue-calendar.css"
26
- },
27
- "files": [
28
- "dist",
29
- "src/lib/api",
30
- "src/lib/utils",
31
- "src/lib/theme.js",
32
- "README.md"
33
- ],
34
- "scripts": {
35
- "dev": "vite dev",
36
- "build": "vite build",
37
- "build:lib": "vite build --config vite.config.lib.js",
38
- "preview": "vite preview",
39
- "prepare": "svelte-kit sync || echo ''",
40
- "prepublishOnly": "npm run build:lib",
41
- "check": "svelte-check --diagnostic-sources \"js,svelte\"",
42
- "check:all": "svelte-check",
43
- "test": "vitest run",
44
- "test:watch": "vitest",
45
- "test:ui": "vitest --ui"
46
- },
47
- "keywords": [
48
- "svelte",
49
- "calendar",
50
- "events",
51
- "comedy",
52
- "venue",
53
- "component",
54
- "micdrop"
55
- ],
56
- "author": "MicDrop",
57
- "license": "MIT",
58
- "repository": {
59
- "type": "git",
60
- "url": "git+https://github.com/get-micdrop/venue-calendar.git"
61
- },
62
- "bugs": {
63
- "url": "https://github.com/get-micdrop/venue-calendar/issues"
64
- },
65
- "homepage": "https://github.com/get-micdrop/venue-calendar#readme",
66
- "peerDependencies": {
67
- "svelte": "^5.0.0"
68
- },
69
- "devDependencies": {
70
- "@sveltejs/adapter-auto": "^6.1.0",
71
- "@sveltejs/kit": "^2.49.4",
72
- "@sveltejs/vite-plugin-svelte": "^6.2.4",
73
- "@tailwindcss/vite": "^4.0.0",
74
- "@testing-library/jest-dom": "^6.9.1",
75
- "@testing-library/svelte": "^5.3.1",
76
- "@vitest/coverage-v8": "^4.0.16",
77
- "baseline-browser-mapping": "^2.9.11",
78
- "jsdom": "^27.4.0",
79
- "svelte": "^5.46.1",
80
- "svelte-check": "^4.3.5",
81
- "tailwindcss": "^4.0.0",
82
- "typescript": "^5.9.3",
83
- "vite": "^7.0.0",
84
- "vitest": "^4.0.16"
85
- },
86
- "dependencies": {
87
- "@getmicdrop/svelte-components": "^5.8.3",
88
- "@stripe/stripe-js": "^4.0.0",
89
- "carbon-icons-svelte": "^13.7.0",
90
- "esbuild": "^0.27.2",
91
- "js-cookie": "^3.0.5",
92
- "svelte-stripe": "^1.4.0"
93
- }
94
- }
1
+ {
2
+ "name": "@getmicdrop/venue-calendar",
3
+ "version": "3.3.2",
4
+ "description": "A customizable Svelte calendar component for displaying comedy events",
5
+ "type": "module",
6
+ "types": "./dist/types/index.d.ts",
7
+ "main": "./dist/venue-calendar.umd.js",
8
+ "module": "./dist/venue-calendar.es.js",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/types/index.d.ts",
12
+ "import": "./dist/venue-calendar.es.js",
13
+ "require": "./dist/venue-calendar.umd.js",
14
+ "default": "./dist/venue-calendar.es.js"
15
+ },
16
+ "./api": {
17
+ "types": "./dist/api/index.d.ts",
18
+ "import": "./dist/api/api.mjs",
19
+ "require": "./dist/api/api.cjs",
20
+ "default": "./dist/api/api.mjs"
21
+ },
22
+ "./theme": {
23
+ "import": "./src/lib/theme.js",
24
+ "default": "./src/lib/theme.js"
25
+ },
26
+ "./dist/venue-calendar.css": "./dist/venue-calendar.css"
27
+ },
28
+ "files": [
29
+ "dist",
30
+ "src/lib/theme.js",
31
+ "README.md"
32
+ ],
33
+ "scripts": {
34
+ "dev": "vite dev",
35
+ "build": "vite build",
36
+ "build:lib": "vite build --config vite.config.lib.js",
37
+ "build:api": "vite build --config vite.config.api.js",
38
+ "build:all": "npm run build:lib && npm run build:api",
39
+ "preview": "vite preview",
40
+ "prepare": "svelte-kit sync || echo ''",
41
+ "prepublishOnly": "npm run build:all",
42
+ "check": "svelte-check --diagnostic-sources \"js,svelte\"",
43
+ "check:all": "svelte-check",
44
+ "test": "vitest run",
45
+ "test:watch": "vitest",
46
+ "test:ui": "vitest --ui"
47
+ },
48
+ "keywords": [
49
+ "svelte",
50
+ "calendar",
51
+ "events",
52
+ "comedy",
53
+ "venue",
54
+ "component",
55
+ "micdrop"
56
+ ],
57
+ "author": "MicDrop",
58
+ "license": "MIT",
59
+ "repository": {
60
+ "type": "git",
61
+ "url": "git+https://github.com/get-micdrop/venue-calendar.git"
62
+ },
63
+ "bugs": {
64
+ "url": "https://github.com/get-micdrop/venue-calendar/issues"
65
+ },
66
+ "homepage": "https://github.com/get-micdrop/venue-calendar#readme",
67
+ "peerDependencies": {
68
+ "svelte": "^5.0.0"
69
+ },
70
+ "devDependencies": {
71
+ "vite-plugin-dts": "^4.5.0",
72
+ "@sveltejs/adapter-auto": "^6.1.0",
73
+ "@sveltejs/kit": "^2.49.4",
74
+ "@sveltejs/vite-plugin-svelte": "^6.2.4",
75
+ "@tailwindcss/vite": "^4.0.0",
76
+ "@testing-library/jest-dom": "^6.9.1",
77
+ "@testing-library/svelte": "^5.3.1",
78
+ "@vitest/coverage-v8": "^4.0.16",
79
+ "baseline-browser-mapping": "^2.9.11",
80
+ "jsdom": "^27.4.0",
81
+ "svelte": "^5.46.1",
82
+ "svelte-check": "^4.3.5",
83
+ "tailwindcss": "^4.0.0",
84
+ "typescript": "^5.9.3",
85
+ "vite": "^7.0.0",
86
+ "vitest": "^4.0.16"
87
+ },
88
+ "dependencies": {
89
+ "@getmicdrop/svelte-components": "^5.8.3",
90
+ "@stripe/stripe-js": "^4.0.0",
91
+ "carbon-icons-svelte": "^13.7.0",
92
+ "esbuild": "^0.27.2",
93
+ "js-cookie": "^3.0.5",
94
+ "svelte-stripe": "^1.4.0"
95
+ }
96
+ }
@@ -1,210 +0,0 @@
1
- /**
2
- * API Client for MicDrop Public Checkout API
3
- *
4
- * Provides a centralized HTTP client with:
5
- * - Configurable base URL
6
- * - Error handling and logging
7
- * - Request/response typing
8
- * - IP address capture for payment intents
9
- */
10
-
11
- import { logger } from '../utils/logger.js';
12
- import type { ApiConfig, ApiResponse } from './types.js';
13
-
14
- // Default API configuration
15
- const DEFAULT_CONFIG: Required<ApiConfig> = {
16
- baseUrl: 'https://get-micdrop.com',
17
- timeout: 30000,
18
- onError: (error: Error) => logger.error('API Error:', error),
19
- };
20
-
21
- // Global configuration (can be overridden)
22
- let globalConfig: Required<ApiConfig> = { ...DEFAULT_CONFIG };
23
-
24
- /**
25
- * Configure the API client
26
- */
27
- export function configureApi(config: Partial<ApiConfig>): void {
28
- globalConfig = { ...globalConfig, ...config };
29
- }
30
-
31
- /**
32
- * Get the current API configuration
33
- */
34
- export function getApiConfig(): Required<ApiConfig> {
35
- return { ...globalConfig };
36
- }
37
-
38
- /**
39
- * Get the public API base URL for v2 endpoints
40
- */
41
- export function getPublicBaseUrl(): string {
42
- return `${globalConfig.baseUrl}/api/v2/public`;
43
- }
44
-
45
- /**
46
- * Get the legacy public API base URL
47
- */
48
- export function getLegacyPublicUrl(): string {
49
- return `${globalConfig.baseUrl}/api/public`;
50
- }
51
-
52
- /**
53
- * Get the orders API base URL
54
- */
55
- export function getOrdersPublicUrl(): string {
56
- return `${globalConfig.baseUrl}/api/orders/public`;
57
- }
58
-
59
- /**
60
- * Get the user's IP address for payment intents
61
- */
62
- export async function getClientIP(): Promise<string> {
63
- try {
64
- const response = await fetch('https://api.ipify.org?format=json');
65
- const data = await response.json();
66
- return data.ip || '';
67
- } catch (error) {
68
- logger.warn('Could not fetch client IP:', error);
69
- return '';
70
- }
71
- }
72
-
73
- /**
74
- * Make a GET request to the API
75
- */
76
- export async function apiGet<T>(
77
- endpoint: string,
78
- options?: RequestInit
79
- ): Promise<ApiResponse<T>> {
80
- return apiRequest<T>('GET', endpoint, undefined, options);
81
- }
82
-
83
- /**
84
- * Make a POST request to the API
85
- */
86
- export async function apiPost<T>(
87
- endpoint: string,
88
- body?: unknown,
89
- options?: RequestInit
90
- ): Promise<ApiResponse<T>> {
91
- return apiRequest<T>('POST', endpoint, body, options);
92
- }
93
-
94
- /**
95
- * Make a PUT request to the API
96
- */
97
- export async function apiPut<T>(
98
- endpoint: string,
99
- body?: unknown,
100
- options?: RequestInit
101
- ): Promise<ApiResponse<T>> {
102
- return apiRequest<T>('PUT', endpoint, body, options);
103
- }
104
-
105
- /**
106
- * Make a DELETE request to the API
107
- */
108
- export async function apiDelete<T>(
109
- endpoint: string,
110
- options?: RequestInit
111
- ): Promise<ApiResponse<T>> {
112
- return apiRequest<T>('DELETE', endpoint, undefined, options);
113
- }
114
-
115
- /**
116
- * Core API request function
117
- */
118
- async function apiRequest<T>(
119
- method: string,
120
- endpoint: string,
121
- body?: unknown,
122
- options?: RequestInit
123
- ): Promise<ApiResponse<T>> {
124
- const url = endpoint.startsWith('http')
125
- ? endpoint
126
- : `${getPublicBaseUrl()}${endpoint}`;
127
-
128
- const controller = new AbortController();
129
- const timeoutId = setTimeout(() => controller.abort(), globalConfig.timeout);
130
-
131
- try {
132
- const response = await fetch(url, {
133
- method,
134
- headers: {
135
- 'Content-Type': 'application/json',
136
- ...options?.headers,
137
- },
138
- body: body ? JSON.stringify(body) : undefined,
139
- credentials: 'include',
140
- signal: controller.signal,
141
- ...options,
142
- });
143
-
144
- clearTimeout(timeoutId);
145
-
146
- if (!response.ok) {
147
- const errorData = await response.json().catch(() => ({}));
148
- const error = new Error(
149
- errorData.error || errorData.message || `HTTP ${response.status}`
150
- );
151
- globalConfig.onError(error);
152
-
153
- return {
154
- success: false,
155
- error: errorData.error || errorData.message || `HTTP ${response.status}`,
156
- statusCode: response.status,
157
- };
158
- }
159
-
160
- const data = await response.json();
161
- return {
162
- success: true,
163
- data: data as T,
164
- statusCode: response.status,
165
- };
166
- } catch (error) {
167
- clearTimeout(timeoutId);
168
-
169
- const errorMessage =
170
- error instanceof Error
171
- ? error.name === 'AbortError'
172
- ? 'Request timed out'
173
- : error.message
174
- : 'Unknown error';
175
-
176
- globalConfig.onError(error instanceof Error ? error : new Error(errorMessage));
177
-
178
- return {
179
- success: false,
180
- error: errorMessage,
181
- };
182
- }
183
- }
184
-
185
- /**
186
- * Simple fetch wrapper for backwards compatibility
187
- * Returns data directly or null on error
188
- */
189
- export async function simpleFetch<T>(
190
- url: string,
191
- options?: RequestInit
192
- ): Promise<T | null> {
193
- try {
194
- const response = await fetch(url, {
195
- credentials: 'include',
196
- ...options,
197
- });
198
-
199
- if (!response.ok) {
200
- const errorData = await response.json().catch(() => ({}));
201
- logger.error(`API request failed: ${response.status}`, errorData);
202
- return null;
203
- }
204
-
205
- return response.json();
206
- } catch (error) {
207
- logger.error('API request error:', error);
208
- return null;
209
- }
210
- }