@moneybar.online/moneybar 5.0.0 → 5.0.3
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.bundle.js +1 -1
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -3
- package/dist/types.d.ts.map +1 -1
- package/example-template.html +56 -54
- package/moneybar-config-template.js +42 -86
- package/package.json +1 -2
- package/src/index.ts +0 -3428
- package/src/types.ts +0 -180
package/src/types.ts
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
export interface MoneyBarConfig {
|
|
2
|
-
/** Unique identifier for your app (e.g., 'gif-maker', 'pdf-creator') */
|
|
3
|
-
appId: string;
|
|
4
|
-
|
|
5
|
-
/** Security key for domain-based authentication (REQUIRED) */
|
|
6
|
-
security_key: string;
|
|
7
|
-
|
|
8
|
-
/** Number of free attempts allowed before paywall */
|
|
9
|
-
freeAttemptLimit: number;
|
|
10
|
-
|
|
11
|
-
/** Supabase configuration */
|
|
12
|
-
supabase: {
|
|
13
|
-
url: string;
|
|
14
|
-
anonKey: string;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
/** Payment configuration - extensible for multiple providers */
|
|
18
|
-
payment?: Array<{
|
|
19
|
-
provider: 'dodo' | 'stripe' | 'paypal' | 'square' | 'paddle'; // Extensible for future providers
|
|
20
|
-
productId: string;
|
|
21
|
-
mode?: 'test' | 'live';
|
|
22
|
-
apiKey?: string; // For providers that need API keys
|
|
23
|
-
publishableKey?: string; // For client-side keys (Stripe, etc.)
|
|
24
|
-
}>;
|
|
25
|
-
|
|
26
|
-
/** Optional: Feedback form configuration */
|
|
27
|
-
feedback?: {
|
|
28
|
-
form: {
|
|
29
|
-
title: string;
|
|
30
|
-
description: string;
|
|
31
|
-
option1: string;
|
|
32
|
-
option2: string;
|
|
33
|
-
option3: string;
|
|
34
|
-
};
|
|
35
|
-
email: Array<{
|
|
36
|
-
provider: 'resend' | 'sendgrid' | 'mailgun' | 'ses'; // Extensible for future providers
|
|
37
|
-
apiKey: string;
|
|
38
|
-
fromEmail: string;
|
|
39
|
-
}>;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
/** @deprecated Use feedback.email instead - Email service configuration (for feedback and notifications) */
|
|
43
|
-
email?: {
|
|
44
|
-
resendApiKey: string;
|
|
45
|
-
fromEmail: string;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/** Callback functions for UI integration (optional when using attachToButton/attachToButtons) */
|
|
49
|
-
callbacks?: {
|
|
50
|
-
/** Called when download is allowed - trigger your actual download here */
|
|
51
|
-
onDownloadAllowed: () => void | Promise<void>;
|
|
52
|
-
|
|
53
|
-
/** Called when limit is reached - show your paywall here */
|
|
54
|
-
onLimitReached: (currentCount: number, limit: number) => void;
|
|
55
|
-
|
|
56
|
-
/** Called when premium user downloads - no limits apply */
|
|
57
|
-
onPremiumDownload: () => void | Promise<void>;
|
|
58
|
-
|
|
59
|
-
/** Called when authentication is required */
|
|
60
|
-
onAuthRequired: () => void;
|
|
61
|
-
|
|
62
|
-
/** Optional: Called on errors for custom error handling */
|
|
63
|
-
onError?: (error: Error) => void;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
/** Optional: Custom styling/behavior options */
|
|
67
|
-
options?: {
|
|
68
|
-
/** Show debug logs in console */
|
|
69
|
-
debug?: boolean;
|
|
70
|
-
|
|
71
|
-
/** Fallback to localStorage when server unavailable */
|
|
72
|
-
fallbackToLocal?: boolean;
|
|
73
|
-
|
|
74
|
-
/** Auto-retry failed requests */
|
|
75
|
-
autoRetry?: boolean;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
/** Optional: UI Theme configuration */
|
|
79
|
-
theme?: {
|
|
80
|
-
/** DaisyUI theme name */
|
|
81
|
-
name?: string;
|
|
82
|
-
|
|
83
|
-
/** Primary color for theming */
|
|
84
|
-
primaryColor?: string;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
/** Optional: Title bar configuration */
|
|
88
|
-
titleBar?: {
|
|
89
|
-
/** Title text or image URL */
|
|
90
|
-
title?: string;
|
|
91
|
-
|
|
92
|
-
/** Image URL for title (if provided, overrides title text) */
|
|
93
|
-
titleImage?: string;
|
|
94
|
-
|
|
95
|
-
/** Array of navigation links */
|
|
96
|
-
links?: Array<{
|
|
97
|
-
text: string;
|
|
98
|
-
url: string;
|
|
99
|
-
target?: '_blank' | '_self';
|
|
100
|
-
}>;
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
/** Optional: Success message configuration */
|
|
104
|
-
successMessage?: {
|
|
105
|
-
/** Whether to show success modal (default: true) */
|
|
106
|
-
enabled?: boolean;
|
|
107
|
-
|
|
108
|
-
/** Success modal title */
|
|
109
|
-
title?: string;
|
|
110
|
-
|
|
111
|
-
/** Success modal message */
|
|
112
|
-
message?: string;
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export interface DownloadStatus {
|
|
117
|
-
/** Current download count for this app */
|
|
118
|
-
currentCount: number;
|
|
119
|
-
|
|
120
|
-
/** Maximum downloads allowed */
|
|
121
|
-
limit: number;
|
|
122
|
-
|
|
123
|
-
/** Whether user has premium access */
|
|
124
|
-
isPremium: boolean;
|
|
125
|
-
|
|
126
|
-
/** Whether user is authenticated */
|
|
127
|
-
isAuthenticated: boolean;
|
|
128
|
-
|
|
129
|
-
/** Downloads remaining before paywall */
|
|
130
|
-
remaining: number;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export interface PaymentInfo {
|
|
134
|
-
email: string;
|
|
135
|
-
status: 'created' | 'completed' | 'failed';
|
|
136
|
-
productAmount?: number;
|
|
137
|
-
paidAmount?: number;
|
|
138
|
-
currency?: string;
|
|
139
|
-
paidCurrency?: string;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export interface UserContext {
|
|
143
|
-
/** Whether user has premium access */
|
|
144
|
-
isPremium: boolean;
|
|
145
|
-
|
|
146
|
-
/** Whether user is authenticated */
|
|
147
|
-
isAuthenticated: boolean;
|
|
148
|
-
|
|
149
|
-
/** User's email address (if authenticated) */
|
|
150
|
-
email?: string;
|
|
151
|
-
|
|
152
|
-
/** User's display name (if available) */
|
|
153
|
-
name?: string;
|
|
154
|
-
|
|
155
|
-
/** Current download count for this app */
|
|
156
|
-
currentCount: number;
|
|
157
|
-
|
|
158
|
-
/** Downloads remaining before paywall */
|
|
159
|
-
remaining: number;
|
|
160
|
-
|
|
161
|
-
/** Maximum downloads allowed */
|
|
162
|
-
limit: number;
|
|
163
|
-
|
|
164
|
-
/** Full user object from Supabase (if authenticated) */
|
|
165
|
-
user?: any;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
export interface MoneyBarEvents {
|
|
169
|
-
/** Fired when download count changes */
|
|
170
|
-
countChanged: { count: number; limit: number };
|
|
171
|
-
|
|
172
|
-
/** Fired when user authentication state changes */
|
|
173
|
-
authChanged: { user: any | null; isPremium: boolean };
|
|
174
|
-
|
|
175
|
-
/** Fired when payment status changes */
|
|
176
|
-
paymentChanged: PaymentInfo;
|
|
177
|
-
|
|
178
|
-
/** Fired on errors */
|
|
179
|
-
error: Error;
|
|
180
|
-
}
|