@donotdev/functions 0.0.20 → 0.1.1
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/LICENSE.md +3 -3
- package/guidelines/FUNCTIONS.md +9 -0
- package/guidelines/VERCEL.md +260 -0
- package/lib/firebase/auth/getCustomClaims.d.ts +2 -2
- package/lib/firebase/auth/getUserAuthStatus.d.ts +2 -2
- package/lib/firebase/auth/index.d.ts +1 -1
- package/lib/firebase/auth/removeCustomClaims.d.ts +2 -2
- package/lib/firebase/auth/setCustomClaims.d.ts +2 -2
- package/lib/firebase/baseFunction.d.ts +1 -1
- package/lib/firebase/billing/cancelSubscription.d.ts +1 -1
- package/lib/firebase/billing/changePlan.d.ts +1 -1
- package/lib/firebase/billing/createCheckoutSession.d.ts +10 -13
- package/lib/firebase/billing/createCustomerPortal.d.ts +1 -1
- package/lib/firebase/billing/index.d.ts +1 -1
- package/lib/firebase/billing/refreshSubscriptionStatus.d.ts +2 -2
- package/lib/firebase/config/constants.d.ts +4 -4
- package/lib/firebase/config/index.d.ts +1 -1
- package/lib/firebase/crud/aggregate.d.ts +2 -2
- package/lib/firebase/crud/delete.d.ts +1 -1
- package/lib/firebase/crud/get.d.ts +1 -1
- package/lib/firebase/crud/index.d.ts +1 -1
- package/lib/firebase/crud/update.d.ts +1 -1
- package/lib/firebase/helpers/githubAccessHelper.d.ts +3 -3
- package/lib/firebase/helpers/githubTeamAccessHelper.d.ts +2 -2
- package/lib/firebase/helpers/index.d.ts +1 -1
- package/lib/firebase/index.d.ts +1 -1
- package/lib/firebase/index.js +3 -3
- package/lib/firebase/index.js.map +4 -4
- package/lib/firebase/oauth/disconnect.d.ts +1 -1
- package/lib/firebase/oauth/exchangeToken.d.ts +1 -1
- package/lib/firebase/oauth/getConnections.d.ts +1 -1
- package/lib/firebase/oauth/githubAccess.d.ts +6 -6
- package/lib/firebase/oauth/index.d.ts +1 -1
- package/lib/firebase/oauth/refreshToken.d.ts +1 -1
- package/lib/firebase/scheduled/index.d.ts +1 -1
- package/lib/shared/ai/classifyAIError.d.ts +35 -0
- package/lib/shared/ai/costTracker.d.ts +20 -0
- package/lib/shared/ai/createAIRoute.d.ts +20 -0
- package/lib/shared/ai/index.d.ts +6 -0
- package/lib/shared/ai/resolveModelTier.d.ts +14 -0
- package/lib/shared/billing/createCheckout.d.ts +11 -5
- package/lib/shared/billing/helpers/index.d.ts +1 -1
- package/lib/shared/billing/helpers/subscriptionManagement.d.ts +3 -3
- package/lib/shared/billing/helpers/updateUserSubscription.d.ts +4 -4
- package/lib/shared/billing/idempotency.d.ts +2 -2
- package/lib/shared/billing/index.d.ts +1 -1
- package/lib/shared/billing/webhookHandler.d.ts +1 -1
- package/lib/shared/email/createEmailRoute.d.ts +30 -0
- package/lib/shared/email/index.d.ts +3 -0
- package/lib/shared/email/provider.d.ts +30 -0
- package/lib/shared/email/resendProvider.d.ts +22 -0
- package/lib/shared/errorHandling.d.ts +1 -1
- package/lib/shared/firebase.d.ts +7 -7
- package/lib/shared/github.d.ts +16 -11
- package/lib/shared/index.d.ts +3 -1
- package/lib/shared/index.js +4 -3
- package/lib/shared/index.js.map +4 -4
- package/lib/shared/logger.d.ts +8 -6
- package/lib/shared/metadata.d.ts +3 -3
- package/lib/shared/oauth/exchangeToken.d.ts +3 -2
- package/lib/shared/oauth/grantAccess.d.ts +3 -2
- package/lib/shared/oauth/index.d.ts +1 -1
- package/lib/shared/schema.d.ts +2 -2
- package/lib/shared/utils/detectFirestore.d.ts +3 -3
- package/lib/shared/utils/external/date.d.ts +2 -2
- package/lib/shared/utils/external/index.d.ts +1 -1
- package/lib/shared/utils/external/references.d.ts +1 -1
- package/lib/shared/utils/external/subscription.d.ts +5 -5
- package/lib/shared/utils/firebaseHelpers.d.ts +2 -2
- package/lib/shared/utils/functionWrapper.d.ts +4 -4
- package/lib/shared/utils/index.d.ts +1 -1
- package/lib/shared/utils/internal/auth.d.ts +4 -4
- package/lib/shared/utils/internal/idempotency.d.ts +3 -2
- package/lib/shared/utils/internal/index.d.ts +1 -1
- package/lib/shared/utils/internal/monitoring.d.ts +7 -7
- package/lib/shared/utils/internal/rateLimiter.d.ts +5 -5
- package/lib/shared/utils/internal/validation.d.ts +4 -4
- package/lib/shared/utils/schemaValidation.d.ts +6 -6
- package/lib/shared/utils/validation.d.ts +9 -9
- package/lib/shared/utils/vercelHelpers.d.ts +2 -2
- package/lib/shared/utils.d.ts +19 -19
- package/lib/shared/validation.d.ts +2 -2
- package/lib/supabase/ai/createAIFunction.d.ts +30 -0
- package/lib/supabase/auth/deleteAccount.d.ts +1 -1
- package/lib/supabase/auth/getCustomClaims.d.ts +1 -1
- package/lib/supabase/auth/getUserAuthStatus.d.ts +1 -1
- package/lib/supabase/auth/removeCustomClaims.d.ts +1 -1
- package/lib/supabase/auth/setCustomClaims.d.ts +12 -4
- package/lib/supabase/baseFunction.d.ts +2 -2
- package/lib/supabase/billing/cancelSubscription.d.ts +1 -1
- package/lib/supabase/billing/changePlan.d.ts +2 -2
- package/lib/supabase/billing/createCheckoutSession.d.ts +1 -1
- package/lib/supabase/billing/createCustomerPortal.d.ts +1 -1
- package/lib/supabase/billing/refreshSubscriptionStatus.d.ts +1 -1
- package/lib/supabase/crud/aggregate.d.ts +2 -1
- package/lib/supabase/crud/create.d.ts +2 -1
- package/lib/supabase/crud/delete.d.ts +1 -0
- package/lib/supabase/crud/get.d.ts +2 -1
- package/lib/supabase/crud/index.d.ts +1 -1
- package/lib/supabase/crud/list.d.ts +2 -1
- package/lib/supabase/crud/update.d.ts +2 -1
- package/lib/supabase/edgeFunction.d.ts +56 -0
- package/lib/supabase/email/createEmailFunction.d.ts +31 -0
- package/lib/supabase/helpers/authProvider.d.ts +2 -2
- package/lib/supabase/index.d.ts +11 -2
- package/lib/supabase/index.js +3 -2
- package/lib/supabase/index.js.map +4 -4
- package/lib/supabase/oauth/disconnect.d.ts +13 -0
- package/lib/supabase/oauth/exchangeToken.d.ts +13 -0
- package/lib/supabase/oauth/getConnections.d.ts +13 -0
- package/lib/supabase/oauth/index.d.ts +12 -0
- package/lib/supabase/oauth/refreshToken.d.ts +13 -0
- package/lib/supabase/utils/idempotency.d.ts +1 -1
- package/lib/supabase/utils/monitoring.d.ts +1 -1
- package/lib/supabase/utils/rateLimiter.d.ts +1 -1
- package/lib/vercel/api/ai/chat.d.ts +29 -0
- package/lib/vercel/api/ai/index.d.ts +1 -0
- package/lib/vercel/api/auth/index.d.ts +1 -1
- package/lib/vercel/api/billing/cancel.d.ts +1 -1
- package/lib/vercel/api/billing/change-plan.d.ts +1 -1
- package/lib/vercel/api/billing/create-checkout-session.d.ts +1 -1
- package/lib/vercel/api/billing/index.d.ts +1 -1
- package/lib/vercel/api/billing/refresh-subscription-status.d.ts +1 -1
- package/lib/vercel/api/billing/webhook-handler.d.ts +2 -2
- package/lib/vercel/api/config/constants.d.ts +9 -9
- package/lib/vercel/api/config/firebase-admin.d.ts +2 -2
- package/lib/vercel/api/config/index.d.ts +1 -1
- package/lib/vercel/api/crud/index.d.ts +1 -1
- package/lib/vercel/api/index.d.ts +2 -1
- package/lib/vercel/api/index.js +3 -2
- package/lib/vercel/api/index.js.map +4 -4
- package/lib/vercel/api/oauth/check-github-access.d.ts +1 -1
- package/lib/vercel/api/oauth/grant-github-access.d.ts +1 -1
- package/lib/vercel/api/oauth/index.d.ts +1 -1
- package/lib/vercel/api/oauth/revoke-github-access.d.ts +1 -1
- package/lib/vercel/api/utils/cors.d.ts +4 -4
- package/lib/vercel/baseFunction.d.ts +2 -2
- package/package.json +38 -5
- package/src/firebase/auth/getCustomClaims.ts +3 -3
- package/src/firebase/auth/getUserAuthStatus.ts +3 -3
- package/src/firebase/auth/index.ts +1 -1
- package/src/firebase/auth/removeCustomClaims.ts +3 -3
- package/src/firebase/auth/setCustomClaims.ts +70 -69
- package/src/firebase/baseFunction.ts +2 -2
- package/src/firebase/billing/cancelSubscription.ts +3 -3
- package/src/firebase/billing/changePlan.ts +3 -3
- package/src/firebase/billing/createCheckoutSession.ts +79 -187
- package/src/firebase/billing/createCustomerPortal.ts +1 -1
- package/src/firebase/billing/healthCheck.ts +1 -1
- package/src/firebase/billing/index.d.ts +11 -11
- package/src/firebase/billing/index.ts +1 -1
- package/src/firebase/billing/refreshSubscriptionStatus.ts +3 -3
- package/src/firebase/billing/webhookHandler.ts +1 -1
- package/src/firebase/config/constants.ts +4 -4
- package/src/firebase/config/index.ts +1 -1
- package/src/firebase/config/secrets.ts +1 -1
- package/src/firebase/crud/aggregate.ts +2 -2
- package/src/firebase/crud/create.ts +2 -2
- package/src/firebase/crud/delete.ts +3 -3
- package/src/firebase/crud/get.ts +1 -1
- package/src/firebase/crud/index.ts +1 -1
- package/src/firebase/crud/list.ts +1 -1
- package/src/firebase/crud/update.ts +2 -2
- package/src/firebase/helpers/githubAccessHelper.ts +4 -4
- package/src/firebase/helpers/githubTeamAccessHelper.ts +3 -3
- package/src/firebase/helpers/index.ts +1 -1
- package/src/firebase/index.d.ts +9 -9
- package/src/firebase/index.ts +1 -1
- package/src/firebase/oauth/disconnect.ts +2 -2
- package/src/firebase/oauth/exchangeToken.ts +6 -6
- package/src/firebase/oauth/getConnections.ts +2 -2
- package/src/firebase/oauth/githubAccess.ts +10 -10
- package/src/firebase/oauth/index.ts +1 -1
- package/src/firebase/oauth/refreshToken.ts +6 -6
- package/src/firebase/registerCrudFunctions.ts +1 -1
- package/src/firebase/scheduled/checkExpiredSubscriptions.ts +1 -1
- package/src/firebase/scheduled/index.ts +1 -1
- package/src/shared/__tests__/auth.test.ts +46 -0
- package/src/shared/__tests__/errorHandling.test.ts +66 -1
- package/src/shared/__tests__/firebase.test.ts +293 -0
- package/src/shared/__tests__/internalValidation.test.ts +190 -0
- package/src/shared/__tests__/metadata.test.ts +66 -0
- package/src/shared/__tests__/schema.test.ts +219 -0
- package/src/shared/__tests__/schemaValidation.test.ts +72 -0
- package/src/shared/__tests__/subscription.test.ts +45 -0
- package/src/shared/__tests__/utils.test.ts +281 -0
- package/src/shared/__tests__/validation-env.test.ts +73 -0
- package/src/shared/ai/__tests__/costTracker.test.ts +121 -0
- package/src/shared/ai/classifyAIError.ts +163 -0
- package/src/shared/ai/costTracker.ts +51 -0
- package/src/shared/ai/createAIRoute.ts +397 -0
- package/src/shared/ai/index.ts +8 -0
- package/src/shared/ai/resolveModelTier.ts +58 -0
- package/src/shared/billing/__tests__/createCheckout.test.ts +1 -1
- package/src/shared/billing/__tests__/webhookHandler.test.ts +1 -1
- package/src/shared/billing/createCheckout.ts +156 -11
- package/src/shared/billing/helpers/index.ts +1 -1
- package/src/shared/billing/helpers/subscriptionManagement.ts +13 -4
- package/src/shared/billing/helpers/updateUserSubscription.ts +4 -4
- package/src/shared/billing/idempotency.ts +9 -4
- package/src/shared/billing/index.ts +1 -1
- package/src/shared/billing/webhookHandler.ts +7 -7
- package/src/shared/email/createEmailRoute.ts +81 -0
- package/src/shared/email/index.ts +5 -0
- package/src/shared/email/provider.ts +31 -0
- package/src/shared/email/resendProvider.ts +56 -0
- package/src/shared/errorHandling.ts +12 -6
- package/src/shared/firebase.ts +7 -7
- package/src/shared/github.ts +49 -11
- package/src/shared/index.d.ts +9 -9
- package/src/shared/index.ts +3 -1
- package/src/shared/logger.ts +10 -8
- package/src/shared/metadata.ts +3 -3
- package/src/shared/oauth/__tests__/exchangeToken.test.ts +1 -1
- package/src/shared/oauth/exchangeToken.ts +3 -2
- package/src/shared/oauth/grantAccess.ts +3 -2
- package/src/shared/oauth/index.ts +1 -1
- package/src/shared/schema.ts +4 -4
- package/src/shared/utils/__tests__/functionWrapper.test.ts +1 -1
- package/src/shared/utils/detectFirestore.ts +3 -3
- package/src/shared/utils/external/date.ts +5 -5
- package/src/shared/utils/external/index.ts +1 -1
- package/src/shared/utils/external/references.ts +2 -2
- package/src/shared/utils/external/subscription.ts +5 -5
- package/src/shared/utils/firebaseHelpers.ts +3 -3
- package/src/shared/utils/functionWrapper.ts +4 -4
- package/src/shared/utils/index.ts +1 -1
- package/src/shared/utils/internal/auth.ts +7 -7
- package/src/shared/utils/internal/firebase.ts +1 -1
- package/src/shared/utils/internal/idempotency.ts +4 -3
- package/src/shared/utils/internal/index.ts +1 -1
- package/src/shared/utils/internal/monitoring.ts +8 -8
- package/src/shared/utils/internal/rateLimiter.ts +12 -9
- package/src/shared/utils/internal/validation.ts +5 -5
- package/src/shared/utils/schemaValidation.ts +6 -6
- package/src/shared/utils/validation.ts +10 -10
- package/src/shared/utils/vercelHelpers.ts +3 -3
- package/src/shared/utils.ts +19 -19
- package/src/shared/validation.ts +3 -3
- package/src/supabase/ai/createAIFunction.ts +75 -0
- package/src/supabase/auth/deleteAccount.ts +2 -2
- package/src/supabase/auth/getCustomClaims.ts +2 -2
- package/src/supabase/auth/getUserAuthStatus.ts +2 -2
- package/src/supabase/auth/removeCustomClaims.ts +38 -2
- package/src/supabase/auth/setCustomClaims.ts +66 -5
- package/src/supabase/baseFunction.ts +29 -5
- package/src/supabase/billing/cancelSubscription.ts +2 -2
- package/src/supabase/billing/changePlan.ts +8 -3
- package/src/supabase/billing/createCheckoutSession.ts +18 -4
- package/src/supabase/billing/createCustomerPortal.ts +2 -2
- package/src/supabase/billing/refreshSubscriptionStatus.ts +2 -2
- package/src/supabase/crud/aggregate.ts +2 -1
- package/src/supabase/crud/create.ts +2 -1
- package/src/supabase/crud/delete.ts +2 -1
- package/src/supabase/crud/get.ts +2 -1
- package/src/supabase/crud/index.ts +1 -1
- package/src/supabase/crud/list.ts +2 -1
- package/src/supabase/crud/update.ts +2 -1
- package/src/supabase/edgeFunction.ts +195 -0
- package/src/supabase/email/createEmailFunction.ts +75 -0
- package/src/supabase/helpers/authProvider.ts +2 -2
- package/src/supabase/index.ts +22 -2
- package/src/supabase/oauth/disconnect.ts +104 -0
- package/src/supabase/oauth/exchangeToken.ts +183 -0
- package/src/supabase/oauth/getConnections.ts +85 -0
- package/src/supabase/oauth/index.ts +15 -0
- package/src/supabase/oauth/refreshToken.ts +130 -0
- package/src/supabase/registerCrudFunctions.ts +30 -42
- package/src/supabase/utils/idempotency.ts +7 -3
- package/src/supabase/utils/monitoring.ts +1 -1
- package/src/supabase/utils/rateLimiter.ts +1 -1
- package/src/vercel/api/ai/chat.ts +77 -0
- package/src/vercel/api/ai/index.ts +1 -0
- package/src/vercel/api/auth/get-custom-claims.ts +1 -1
- package/src/vercel/api/auth/get-user-auth-status.ts +1 -1
- package/src/vercel/api/auth/index.ts +1 -1
- package/src/vercel/api/auth/remove-custom-claims.ts +1 -1
- package/src/vercel/api/auth/set-custom-claims.ts +2 -4
- package/src/vercel/api/billing/cancel.ts +3 -3
- package/src/vercel/api/billing/change-plan.ts +3 -3
- package/src/vercel/api/billing/create-checkout-session.ts +30 -7
- package/src/vercel/api/billing/customer-portal.ts +1 -1
- package/src/vercel/api/billing/index.ts +1 -1
- package/src/vercel/api/billing/refresh-subscription-status.ts +1 -1
- package/src/vercel/api/billing/webhook-handler.ts +11 -4
- package/src/vercel/api/config/constants.ts +9 -9
- package/src/vercel/api/config/firebase-admin.ts +3 -3
- package/src/vercel/api/config/index.ts +1 -1
- package/src/vercel/api/crud/create.ts +1 -1
- package/src/vercel/api/crud/delete.ts +1 -1
- package/src/vercel/api/crud/get.ts +1 -1
- package/src/vercel/api/crud/index.ts +1 -1
- package/src/vercel/api/crud/list.ts +1 -1
- package/src/vercel/api/crud/update.ts +1 -1
- package/src/vercel/api/index.d.ts +1 -1
- package/src/vercel/api/index.ts +2 -1
- package/src/vercel/api/oauth/check-github-access.ts +3 -3
- package/src/vercel/api/oauth/exchange-token.ts +25 -2
- package/src/vercel/api/oauth/grant-github-access.ts +3 -3
- package/src/vercel/api/oauth/index.ts +1 -1
- package/src/vercel/api/oauth/revoke-github-access.ts +1 -1
- package/src/vercel/api/utils/cors.ts +10 -4
- package/src/vercel/baseFunction.ts +2 -2
package/lib/shared/logger.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ export declare const logger: {
|
|
|
52
52
|
* @param message - Log message
|
|
53
53
|
* @param context - Additional context data
|
|
54
54
|
*
|
|
55
|
-
* @version 0.0
|
|
55
|
+
* @version 0.1.0
|
|
56
56
|
* @since 0.0.1
|
|
57
57
|
* @author AMBROISE PARK Consulting
|
|
58
58
|
*/
|
|
@@ -62,7 +62,7 @@ export declare const logger: {
|
|
|
62
62
|
* @param message - Log message
|
|
63
63
|
* @param context - Additional context data
|
|
64
64
|
*
|
|
65
|
-
* @version 0.0
|
|
65
|
+
* @version 0.1.0
|
|
66
66
|
* @since 0.0.1
|
|
67
67
|
* @author AMBROISE PARK Consulting
|
|
68
68
|
*/
|
|
@@ -72,7 +72,7 @@ export declare const logger: {
|
|
|
72
72
|
* @param message - Log message
|
|
73
73
|
* @param context - Additional context data
|
|
74
74
|
*
|
|
75
|
-
* @version 0.0
|
|
75
|
+
* @version 0.1.0
|
|
76
76
|
* @since 0.0.1
|
|
77
77
|
* @author AMBROISE PARK Consulting
|
|
78
78
|
*/
|
|
@@ -82,7 +82,7 @@ export declare const logger: {
|
|
|
82
82
|
* @param message - Log message
|
|
83
83
|
* @param context - Additional context data
|
|
84
84
|
*
|
|
85
|
-
* @version 0.0
|
|
85
|
+
* @version 0.1.0
|
|
86
86
|
* @since 0.0.1
|
|
87
87
|
* @author AMBROISE PARK Consulting
|
|
88
88
|
*/
|
|
@@ -92,7 +92,7 @@ export declare const logger: {
|
|
|
92
92
|
* @param message - Log message
|
|
93
93
|
* @param context - Additional context data
|
|
94
94
|
*
|
|
95
|
-
* @version 0.0
|
|
95
|
+
* @version 0.1.0
|
|
96
96
|
* @since 0.0.1
|
|
97
97
|
* @author AMBROISE PARK Consulting
|
|
98
98
|
*/
|
|
@@ -103,7 +103,9 @@ export declare const logger: {
|
|
|
103
103
|
* @param message - Log message
|
|
104
104
|
* @param context - Additional context data
|
|
105
105
|
*
|
|
106
|
-
* @
|
|
106
|
+
* @security Callers MUST NOT pass secrets (tokens, passwords, API keys) in context. Context is logged in plaintext.
|
|
107
|
+
*
|
|
108
|
+
* @version 0.1.0
|
|
107
109
|
* @since 0.0.1
|
|
108
110
|
* @author AMBROISE PARK Consulting
|
|
109
111
|
*/
|
package/lib/shared/metadata.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @fileoverview Document metadata utilities for functions
|
|
3
3
|
* @description Server-safe metadata creation and update utilities
|
|
4
4
|
*
|
|
5
|
-
* @version 0.0
|
|
5
|
+
* @version 0.1.0
|
|
6
6
|
* @since 0.0.1
|
|
7
7
|
* @author AMBROISE PARK Consulting
|
|
8
8
|
*/
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* @param userId - The ID of the user creating the document
|
|
12
12
|
* @returns An object with creation and update timestamps and user IDs
|
|
13
13
|
*
|
|
14
|
-
* @version 0.0
|
|
14
|
+
* @version 0.1.0
|
|
15
15
|
* @since 0.0.1
|
|
16
16
|
* @author AMBROISE PARK Consulting
|
|
17
17
|
*/
|
|
@@ -26,7 +26,7 @@ export declare function createMetadata(userId: string): {
|
|
|
26
26
|
* @param userId - The ID of the user updating the document
|
|
27
27
|
* @returns An object with update timestamp and user ID
|
|
28
28
|
*
|
|
29
|
-
* @version 0.0
|
|
29
|
+
* @version 0.1.0
|
|
30
30
|
* @since 0.0.1
|
|
31
31
|
* @author AMBROISE PARK Consulting
|
|
32
32
|
*/
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
* @fileoverview OAuth Token Exchange Algorithm
|
|
3
3
|
* @description Platform-agnostic algorithm for exchanging OAuth codes for tokens
|
|
4
4
|
*
|
|
5
|
-
* @version 0.0
|
|
5
|
+
* @version 0.1.0
|
|
6
6
|
* @since 0.0.1
|
|
7
7
|
* @author AMBROISE PARK Consulting
|
|
8
8
|
*/
|
|
9
9
|
import type { ExchangeTokenRequest, TokenResponse } from '@donotdev/core/server';
|
|
10
|
+
/** Platform-agnostic provider for exchanging OAuth authorization codes for tokens. */
|
|
10
11
|
export interface OAuthProvider {
|
|
11
12
|
exchangeCodeForToken(params: {
|
|
12
13
|
code: string;
|
|
@@ -17,7 +18,7 @@ export interface OAuthProvider {
|
|
|
17
18
|
/**
|
|
18
19
|
* Exchange OAuth code for token
|
|
19
20
|
*
|
|
20
|
-
* @version 0.0
|
|
21
|
+
* @version 0.1.0
|
|
21
22
|
* @since 0.0.1
|
|
22
23
|
* @author AMBROISE PARK Consulting
|
|
23
24
|
*/
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* @fileoverview Grant OAuth Access Algorithm
|
|
3
3
|
* @description Platform-agnostic algorithm for granting OAuth access
|
|
4
4
|
*
|
|
5
|
-
* @version 0.0
|
|
5
|
+
* @version 0.1.0
|
|
6
6
|
* @since 0.0.1
|
|
7
7
|
* @author AMBROISE PARK Consulting
|
|
8
8
|
*/
|
|
9
|
+
/** Platform-agnostic provider for granting OAuth access to a user. */
|
|
9
10
|
export interface OAuthGrantProvider {
|
|
10
11
|
grantAccess(params: {
|
|
11
12
|
userId: string;
|
|
@@ -20,7 +21,7 @@ export interface OAuthGrantProvider {
|
|
|
20
21
|
/**
|
|
21
22
|
* Grant OAuth access to user
|
|
22
23
|
*
|
|
23
|
-
* @version 0.0
|
|
24
|
+
* @version 0.1.0
|
|
24
25
|
* @since 0.0.1
|
|
25
26
|
* @author AMBROISE PARK Consulting
|
|
26
27
|
*/
|
package/lib/shared/schema.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ type Visibility = 'guest' | 'user' | 'admin' | 'technical' | 'hidden' | 'owner';
|
|
|
19
19
|
* @param isAuthenticated - Whether the current user is authenticated (defaults to true for backward compat).
|
|
20
20
|
* @returns True if the field should be visible, false otherwise.
|
|
21
21
|
*
|
|
22
|
-
* @version 0.0
|
|
22
|
+
* @version 0.1.0
|
|
23
23
|
* @since 0.0.1
|
|
24
24
|
* @author AMBROISE PARK Consulting
|
|
25
25
|
*/
|
|
@@ -33,7 +33,7 @@ export declare function isFieldVisible(key: string, visibility: Visibility | und
|
|
|
33
33
|
* @returns An array of strings, where each string is the name of a visible field.
|
|
34
34
|
* Returns an empty array if the schema is not an object schema or has no entries.
|
|
35
35
|
*
|
|
36
|
-
* @version 0.0
|
|
36
|
+
* @version 0.1.0
|
|
37
37
|
* @since 0.0.1
|
|
38
38
|
* @author AMBROISE PARK Consulting
|
|
39
39
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @fileoverview Firestore Detection Utility
|
|
3
3
|
* @description Detects if Firestore credentials are available
|
|
4
4
|
*
|
|
5
|
-
* @version 0.0
|
|
5
|
+
* @version 0.1.0
|
|
6
6
|
* @since 0.0.1
|
|
7
7
|
* @author AMBROISE PARK Consulting
|
|
8
8
|
*/
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*
|
|
17
17
|
* OR checks if running in Firebase Functions environment
|
|
18
18
|
*
|
|
19
|
-
* @version 0.0
|
|
19
|
+
* @version 0.1.0
|
|
20
20
|
* @since 0.0.1
|
|
21
21
|
* @author AMBROISE PARK Consulting
|
|
22
22
|
*/
|
|
@@ -24,7 +24,7 @@ export declare function isFirestoreConfigured(): boolean;
|
|
|
24
24
|
/**
|
|
25
25
|
* Check if Firestore is actually available (can connect)
|
|
26
26
|
*
|
|
27
|
-
* @version 0.0
|
|
27
|
+
* @version 0.1.0
|
|
28
28
|
* @since 0.0.1
|
|
29
29
|
* @author AMBROISE PARK Consulting
|
|
30
30
|
*/
|
|
@@ -18,7 +18,7 @@ export interface FirestoreTimestamp {
|
|
|
18
18
|
* Converts various date formats to ISO string
|
|
19
19
|
* Handles Date, FirestoreTimestamp, and string inputs
|
|
20
20
|
*
|
|
21
|
-
* @version 0.0
|
|
21
|
+
* @version 0.1.0
|
|
22
22
|
* @since 0.0.1
|
|
23
23
|
* @author AMBROISE PARK Consulting
|
|
24
24
|
*/
|
|
@@ -26,7 +26,7 @@ export declare function toISOString(date: DateValue): string;
|
|
|
26
26
|
/**
|
|
27
27
|
* Calculate subscription end date with proper edge case handling
|
|
28
28
|
*
|
|
29
|
-
* @version 0.0
|
|
29
|
+
* @version 0.1.0
|
|
30
30
|
* @since 0.0.1
|
|
31
31
|
* @author AMBROISE PARK Consulting
|
|
32
32
|
* @param duration - Duration string (e.g., '1month', '3months', '1year', 'lifetime')
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @fileoverview Subscription utility functions
|
|
3
3
|
* @description Functions for managing user subscriptions and billing
|
|
4
4
|
*
|
|
5
|
-
* @version 0.0
|
|
5
|
+
* @version 0.1.0
|
|
6
6
|
* @since 0.0.1
|
|
7
7
|
* @author AMBROISE PARK Consulting
|
|
8
8
|
*/
|
|
@@ -10,7 +10,7 @@ import type { SubscriptionClaims } from '@donotdev/core/server';
|
|
|
10
10
|
/**
|
|
11
11
|
* Maps Stripe price ID to subscription tier
|
|
12
12
|
*
|
|
13
|
-
* @version 0.0
|
|
13
|
+
* @version 0.1.0
|
|
14
14
|
* @since 0.0.1
|
|
15
15
|
* @author AMBROISE PARK Consulting
|
|
16
16
|
*/
|
|
@@ -18,7 +18,7 @@ export declare function getTierFromPriceId(priceId: string): string;
|
|
|
18
18
|
/**
|
|
19
19
|
* Validates subscription status and updates Firebase custom claims
|
|
20
20
|
*
|
|
21
|
-
* @version 0.0
|
|
21
|
+
* @version 0.1.0
|
|
22
22
|
* @since 0.0.1
|
|
23
23
|
* @author AMBROISE PARK Consulting
|
|
24
24
|
*/
|
|
@@ -26,7 +26,7 @@ export declare function updateFirebaseUserSubscription(firebaseUid: string, subs
|
|
|
26
26
|
/**
|
|
27
27
|
* Cancels user subscription and resets to free tier
|
|
28
28
|
*
|
|
29
|
-
* @version 0.0
|
|
29
|
+
* @version 0.1.0
|
|
30
30
|
* @since 0.0.1
|
|
31
31
|
* @author AMBROISE PARK Consulting
|
|
32
32
|
*/
|
|
@@ -34,7 +34,7 @@ export declare function cancelUserSubscription(firebaseUid: string, subscription
|
|
|
34
34
|
/**
|
|
35
35
|
* Gets user's current subscription from Firebase
|
|
36
36
|
*
|
|
37
|
-
* @version 0.0
|
|
37
|
+
* @version 0.1.0
|
|
38
38
|
* @since 0.0.1
|
|
39
39
|
* @author AMBROISE PARK Consulting
|
|
40
40
|
*/
|
|
@@ -3,7 +3,7 @@ import type * as v from 'valibot';
|
|
|
3
3
|
/**
|
|
4
4
|
* Creates a Firebase onCall function with schema validation
|
|
5
5
|
*
|
|
6
|
-
* @version 0.0
|
|
6
|
+
* @version 0.1.0
|
|
7
7
|
* @since 0.0.1
|
|
8
8
|
* @author AMBROISE PARK Consulting
|
|
9
9
|
*/
|
|
@@ -14,7 +14,7 @@ export declare function createFirebaseCallable<TRequest, TResponse>(config: any,
|
|
|
14
14
|
/**
|
|
15
15
|
* Creates both onCall and withSchema exports for a Firebase function
|
|
16
16
|
*
|
|
17
|
-
* @version 0.0
|
|
17
|
+
* @version 0.1.0
|
|
18
18
|
* @since 0.0.1
|
|
19
19
|
* @author AMBROISE PARK Consulting
|
|
20
20
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @fileoverview Simple DRY wrapper for functions with schema validation
|
|
3
3
|
* @description Eliminates duplication by providing a clean pattern for all functions
|
|
4
4
|
*
|
|
5
|
-
* @version 0.0
|
|
5
|
+
* @version 0.1.0
|
|
6
6
|
* @since 0.0.1
|
|
7
7
|
* @author AMBROISE PARK Consulting
|
|
8
8
|
*/
|
|
@@ -13,7 +13,7 @@ import type { NextApiRequest, NextApiResponse } from 'next';
|
|
|
13
13
|
* Simple wrapper that validates data against schema and calls the handler
|
|
14
14
|
* This is the ONLY pattern needed for all functions
|
|
15
15
|
*
|
|
16
|
-
* @version 0.0
|
|
16
|
+
* @version 0.1.0
|
|
17
17
|
* @since 0.0.1
|
|
18
18
|
* @author AMBROISE PARK Consulting
|
|
19
19
|
*/
|
|
@@ -21,7 +21,7 @@ export declare function withValidation<TData, TResponse>(schema: v.BaseSchema<un
|
|
|
21
21
|
/**
|
|
22
22
|
* Firebase function wrapper
|
|
23
23
|
*
|
|
24
|
-
* @version 0.0
|
|
24
|
+
* @version 0.1.0
|
|
25
25
|
* @since 0.0.1
|
|
26
26
|
* @author AMBROISE PARK Consulting
|
|
27
27
|
*/
|
|
@@ -29,7 +29,7 @@ export declare function firebaseFunction<TData, TResponse>(schema: v.BaseSchema<
|
|
|
29
29
|
/**
|
|
30
30
|
* Vercel function wrapper
|
|
31
31
|
*
|
|
32
|
-
* @version 0.0
|
|
32
|
+
* @version 0.1.0
|
|
33
33
|
* @since 0.0.1
|
|
34
34
|
* @author AMBROISE PARK Consulting
|
|
35
35
|
*/
|
|
@@ -4,7 +4,7 @@ export type AuthProvider = 'firebase' | 'supabase';
|
|
|
4
4
|
/**
|
|
5
5
|
* Validates that user is authenticated
|
|
6
6
|
*
|
|
7
|
-
* @version 0.0
|
|
7
|
+
* @version 0.1.0
|
|
8
8
|
* @since 0.0.1
|
|
9
9
|
* @author AMBROISE PARK Consulting
|
|
10
10
|
*/
|
|
@@ -13,7 +13,7 @@ export declare function assertAuthenticated(uid: string): string;
|
|
|
13
13
|
* Validates that user has admin privileges.
|
|
14
14
|
* Uses IServerAuthAdapter when configured, falls back to Firebase Admin SDK.
|
|
15
15
|
*
|
|
16
|
-
* @version 0.0
|
|
16
|
+
* @version 0.1.0
|
|
17
17
|
* @since 0.0.1
|
|
18
18
|
* @author AMBROISE PARK Consulting
|
|
19
19
|
*/
|
|
@@ -31,7 +31,7 @@ export declare function assertAdmin(uid: string): Promise<string>;
|
|
|
31
31
|
* @param provider - Optional explicit auth provider
|
|
32
32
|
* @returns Object with verified user's uid
|
|
33
33
|
*
|
|
34
|
-
* @version 0.0
|
|
34
|
+
* @version 0.1.0
|
|
35
35
|
* @since 0.5.0
|
|
36
36
|
* @author AMBROISE PARK Consulting
|
|
37
37
|
*/
|
|
@@ -46,7 +46,7 @@ export declare function verifyToken(token: string, provider?: AuthProvider): Pro
|
|
|
46
46
|
* @param provider - Optional explicit auth provider ('firebase' | 'supabase')
|
|
47
47
|
* @returns Verified user's uid
|
|
48
48
|
*
|
|
49
|
-
* @version 0.0
|
|
49
|
+
* @version 0.1.0
|
|
50
50
|
* @since 0.0.1
|
|
51
51
|
* @author AMBROISE PARK Consulting
|
|
52
52
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** Stored result of a previously processed idempotent operation. */
|
|
1
2
|
export interface IdempotencyResult<T = any> {
|
|
2
3
|
result: T;
|
|
3
4
|
processedAt: string;
|
|
@@ -6,7 +7,7 @@ export interface IdempotencyResult<T = any> {
|
|
|
6
7
|
/**
|
|
7
8
|
* Check if an operation has already been processed (idempotency check)
|
|
8
9
|
*
|
|
9
|
-
* @version 0.0
|
|
10
|
+
* @version 0.1.0
|
|
10
11
|
* @since 0.0.1
|
|
11
12
|
* @author AMBROISE PARK Consulting
|
|
12
13
|
*/
|
|
@@ -14,7 +15,7 @@ export declare function checkIdempotency<T = any>(key: string, operation: string
|
|
|
14
15
|
/**
|
|
15
16
|
* Store the result of an operation for idempotency
|
|
16
17
|
*
|
|
17
|
-
* @version 0.0
|
|
18
|
+
* @version 0.1.0
|
|
18
19
|
* @since 0.0.1
|
|
19
20
|
* @author AMBROISE PARK Consulting
|
|
20
21
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Payment metrics data structure
|
|
3
3
|
*
|
|
4
|
-
* @version 0.0
|
|
4
|
+
* @version 0.1.0
|
|
5
5
|
* @since 0.0.1
|
|
6
6
|
* @author AMBROISE PARK Consulting
|
|
7
7
|
*/
|
|
@@ -17,7 +17,7 @@ export interface PaymentMetrics {
|
|
|
17
17
|
/**
|
|
18
18
|
* Alert threshold configuration
|
|
19
19
|
*
|
|
20
|
-
* @version 0.0
|
|
20
|
+
* @version 0.1.0
|
|
21
21
|
* @since 0.0.1
|
|
22
22
|
* @author AMBROISE PARK Consulting
|
|
23
23
|
*/
|
|
@@ -29,7 +29,7 @@ export interface AlertThresholds {
|
|
|
29
29
|
/**
|
|
30
30
|
* Record payment metrics for monitoring
|
|
31
31
|
*
|
|
32
|
-
* @version 0.0
|
|
32
|
+
* @version 0.1.0
|
|
33
33
|
* @since 0.0.1
|
|
34
34
|
* @author AMBROISE PARK Consulting
|
|
35
35
|
*/
|
|
@@ -37,7 +37,7 @@ export declare function recordPaymentMetrics(metrics: PaymentMetrics): Promise<v
|
|
|
37
37
|
/**
|
|
38
38
|
* Check payment failure rate and trigger alerts if needed
|
|
39
39
|
*
|
|
40
|
-
* @version 0.0
|
|
40
|
+
* @version 0.1.0
|
|
41
41
|
* @since 0.0.1
|
|
42
42
|
* @author AMBROISE PARK Consulting
|
|
43
43
|
*/
|
|
@@ -48,7 +48,7 @@ export declare function checkPaymentFailureRate(timeWindowHours?: number): Promi
|
|
|
48
48
|
/**
|
|
49
49
|
* Check daily payment volume and trigger alerts if needed
|
|
50
50
|
*
|
|
51
|
-
* @version 0.0
|
|
51
|
+
* @version 0.1.0
|
|
52
52
|
* @since 0.0.1
|
|
53
53
|
* @author AMBROISE PARK Consulting
|
|
54
54
|
*/
|
|
@@ -59,7 +59,7 @@ export declare function checkPaymentVolume(volumeThreshold?: number): Promise<{
|
|
|
59
59
|
/**
|
|
60
60
|
* Get payment metrics summary for a time period
|
|
61
61
|
*
|
|
62
|
-
* @version 0.0
|
|
62
|
+
* @version 0.1.0
|
|
63
63
|
* @since 0.0.1
|
|
64
64
|
* @author AMBROISE PARK Consulting
|
|
65
65
|
*/
|
|
@@ -73,7 +73,7 @@ export declare function getPaymentMetricsSummary(startDate: Date, endDate: Date)
|
|
|
73
73
|
/**
|
|
74
74
|
* Clean up old metrics and alerts (call periodically)
|
|
75
75
|
*
|
|
76
|
-
* @version 0.0
|
|
76
|
+
* @version 0.1.0
|
|
77
77
|
* @since 0.0.1
|
|
78
78
|
* @author AMBROISE PARK Consulting
|
|
79
79
|
*/
|
|
@@ -4,7 +4,7 @@ export type { RateLimitConfig, RateLimitResult };
|
|
|
4
4
|
* Check rate limit for a given key using in-memory storage
|
|
5
5
|
* For production, this should be replaced with Redis or Firestore
|
|
6
6
|
*
|
|
7
|
-
* @version 0.0
|
|
7
|
+
* @version 0.1.0
|
|
8
8
|
* @since 0.0.1
|
|
9
9
|
* @author AMBROISE PARK Consulting
|
|
10
10
|
*/
|
|
@@ -26,7 +26,7 @@ export declare function checkRateLimit(key: string, config: RateLimitConfig): Pr
|
|
|
26
26
|
* For stricter rate limiting (e.g. payment endpoints), consumers can use
|
|
27
27
|
* Redis-backed rate limiters or API gateway-level throttling.
|
|
28
28
|
*
|
|
29
|
-
* @version 0.0
|
|
29
|
+
* @version 0.1.0
|
|
30
30
|
* @since 0.0.1
|
|
31
31
|
* @author AMBROISE PARK Consulting
|
|
32
32
|
*/
|
|
@@ -34,7 +34,7 @@ export declare function checkRateLimitWithFirestore(key: string, config: RateLim
|
|
|
34
34
|
/**
|
|
35
35
|
* Reset rate limit for a given key
|
|
36
36
|
*
|
|
37
|
-
* @version 0.0
|
|
37
|
+
* @version 0.1.0
|
|
38
38
|
* @since 0.0.1
|
|
39
39
|
* @author AMBROISE PARK Consulting
|
|
40
40
|
*/
|
|
@@ -42,7 +42,7 @@ export declare function resetRateLimit(key: string): void;
|
|
|
42
42
|
/**
|
|
43
43
|
* Reset rate limit in Firestore
|
|
44
44
|
*
|
|
45
|
-
* @version 0.0
|
|
45
|
+
* @version 0.1.0
|
|
46
46
|
* @since 0.0.1
|
|
47
47
|
* @author AMBROISE PARK Consulting
|
|
48
48
|
*/
|
|
@@ -50,7 +50,7 @@ export declare function resetRateLimitInFirestore(key: string): Promise<void>;
|
|
|
50
50
|
/**
|
|
51
51
|
* Get rate limit status without consuming an attempt
|
|
52
52
|
*
|
|
53
|
-
* @version 0.0
|
|
53
|
+
* @version 0.1.0
|
|
54
54
|
* @since 0.0.1
|
|
55
55
|
* @author AMBROISE PARK Consulting
|
|
56
56
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Validates environment variables required for Stripe
|
|
3
3
|
*
|
|
4
|
-
* @version 0.0
|
|
4
|
+
* @version 0.1.0
|
|
5
5
|
* @since 0.0.1
|
|
6
6
|
* @author AMBROISE PARK Consulting
|
|
7
7
|
*/
|
|
@@ -9,7 +9,7 @@ export declare function validateStripeEnvironment(): void;
|
|
|
9
9
|
/**
|
|
10
10
|
* Safely parses JSON with error handling
|
|
11
11
|
*
|
|
12
|
-
* @version 0.0
|
|
12
|
+
* @version 0.1.0
|
|
13
13
|
* @since 0.0.1
|
|
14
14
|
* @author AMBROISE PARK Consulting
|
|
15
15
|
*/
|
|
@@ -25,7 +25,7 @@ export declare function safeJsonParse<T = any>(json: string): T | null;
|
|
|
25
25
|
* @param name - Collection name to validate
|
|
26
26
|
* @throws Error if the name is unsafe
|
|
27
27
|
*
|
|
28
|
-
* @version 0.0
|
|
28
|
+
* @version 0.1.0
|
|
29
29
|
* @since 0.0.1
|
|
30
30
|
* @author AMBROISE PARK Consulting
|
|
31
31
|
*/
|
|
@@ -36,7 +36,7 @@ export declare function validateCollectionName(name: string): void;
|
|
|
36
36
|
* W1: Previous stub ignored the schema parameter entirely. Now performs
|
|
37
37
|
* actual schema validation when a schema is provided.
|
|
38
38
|
*
|
|
39
|
-
* @version 0.0
|
|
39
|
+
* @version 0.1.0
|
|
40
40
|
* @since 0.0.1
|
|
41
41
|
* @author AMBROISE PARK Consulting
|
|
42
42
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @fileoverview DRY utilities for schema validation across all functions
|
|
3
3
|
* @description Provides reusable patterns for Firebase and Vercel functions
|
|
4
4
|
*
|
|
5
|
-
* @version 0.0
|
|
5
|
+
* @version 0.1.0
|
|
6
6
|
* @since 0.0.1
|
|
7
7
|
* @author AMBROISE PARK Consulting
|
|
8
8
|
*/
|
|
@@ -12,7 +12,7 @@ import type { NextApiRequest, NextApiResponse } from 'next';
|
|
|
12
12
|
/**
|
|
13
13
|
* Validates request data using a schema with custom override support
|
|
14
14
|
*
|
|
15
|
-
* @version 0.0
|
|
15
|
+
* @version 0.1.0
|
|
16
16
|
* @since 0.0.1
|
|
17
17
|
* @author AMBROISE PARK Consulting
|
|
18
18
|
*/
|
|
@@ -26,7 +26,7 @@ export declare function validateRequestData<T>(data: any, defaultSchema: v.BaseS
|
|
|
26
26
|
/**
|
|
27
27
|
* Firebase function wrapper that adds schema validation
|
|
28
28
|
*
|
|
29
|
-
* @version 0.0
|
|
29
|
+
* @version 0.1.0
|
|
30
30
|
* @since 0.0.1
|
|
31
31
|
* @author AMBROISE PARK Consulting
|
|
32
32
|
*/
|
|
@@ -34,7 +34,7 @@ export declare function withSchemaValidation<TRequest, TResponse>(defaultSchema:
|
|
|
34
34
|
/**
|
|
35
35
|
* Vercel function wrapper that adds schema validation
|
|
36
36
|
*
|
|
37
|
-
* @version 0.0
|
|
37
|
+
* @version 0.1.0
|
|
38
38
|
* @since 0.0.1
|
|
39
39
|
* @author AMBROISE PARK Consulting
|
|
40
40
|
*/
|
|
@@ -42,7 +42,7 @@ export declare function withVercelSchemaValidation<TRequest, TResponse>(defaultS
|
|
|
42
42
|
/**
|
|
43
43
|
* Creates both standard and custom schema versions of a Firebase function
|
|
44
44
|
*
|
|
45
|
-
* @version 0.0
|
|
45
|
+
* @version 0.1.0
|
|
46
46
|
* @since 0.0.1
|
|
47
47
|
* @author AMBROISE PARK Consulting
|
|
48
48
|
*/
|
|
@@ -53,7 +53,7 @@ export declare function createFirebaseFunction<TRequest, TResponse>(defaultSchem
|
|
|
53
53
|
/**
|
|
54
54
|
* Creates a Vercel function with schema validation
|
|
55
55
|
*
|
|
56
|
-
* @version 0.0
|
|
56
|
+
* @version 0.1.0
|
|
57
57
|
* @since 0.0.1
|
|
58
58
|
* @author AMBROISE PARK Consulting
|
|
59
59
|
*/
|
|
@@ -23,7 +23,7 @@ export declare const StripeValidationSchemas: {
|
|
|
23
23
|
/**
|
|
24
24
|
* Validation result interface
|
|
25
25
|
*
|
|
26
|
-
* @version 0.0
|
|
26
|
+
* @version 0.1.0
|
|
27
27
|
* @since 0.0.1
|
|
28
28
|
* @author AMBROISE PARK Consulting
|
|
29
29
|
*/
|
|
@@ -35,7 +35,7 @@ export interface ValidationResult {
|
|
|
35
35
|
/**
|
|
36
36
|
* Validate webhook event
|
|
37
37
|
*
|
|
38
|
-
* @version 0.0
|
|
38
|
+
* @version 0.1.0
|
|
39
39
|
* @since 0.0.1
|
|
40
40
|
* @author AMBROISE PARK Consulting
|
|
41
41
|
*/
|
|
@@ -43,7 +43,7 @@ export declare function validateWebhookEvent(data: any): ValidationResult;
|
|
|
43
43
|
/**
|
|
44
44
|
* Validate purchase request
|
|
45
45
|
*
|
|
46
|
-
* @version 0.0
|
|
46
|
+
* @version 0.1.0
|
|
47
47
|
* @since 0.0.1
|
|
48
48
|
* @author AMBROISE PARK Consulting
|
|
49
49
|
*/
|
|
@@ -51,7 +51,7 @@ export declare function validatePurchaseRequest(data: any): ValidationResult;
|
|
|
51
51
|
/**
|
|
52
52
|
* Validate GitHub username format
|
|
53
53
|
*
|
|
54
|
-
* @version 0.0
|
|
54
|
+
* @version 0.1.0
|
|
55
55
|
* @since 0.0.1
|
|
56
56
|
* @author AMBROISE PARK Consulting
|
|
57
57
|
*/
|
|
@@ -59,7 +59,7 @@ export declare function validateGitHubUsername(username: string): boolean;
|
|
|
59
59
|
/**
|
|
60
60
|
* Validate email format
|
|
61
61
|
*
|
|
62
|
-
* @version 0.0
|
|
62
|
+
* @version 0.1.0
|
|
63
63
|
* @since 0.0.1
|
|
64
64
|
* @author AMBROISE PARK Consulting
|
|
65
65
|
*/
|
|
@@ -67,7 +67,7 @@ export declare function validateEmail(email: string): boolean;
|
|
|
67
67
|
/**
|
|
68
68
|
* Validate price ID format (Stripe price IDs start with 'price_')
|
|
69
69
|
*
|
|
70
|
-
* @version 0.0
|
|
70
|
+
* @version 0.1.0
|
|
71
71
|
* @since 0.0.1
|
|
72
72
|
* @author AMBROISE PARK Consulting
|
|
73
73
|
*/
|
|
@@ -75,7 +75,7 @@ export declare function validateStripePriceId(priceId: string): boolean;
|
|
|
75
75
|
/**
|
|
76
76
|
* Validate session ID format (Stripe session IDs start with 'cs_')
|
|
77
77
|
*
|
|
78
|
-
* @version 0.0
|
|
78
|
+
* @version 0.1.0
|
|
79
79
|
* @since 0.0.1
|
|
80
80
|
* @author AMBROISE PARK Consulting
|
|
81
81
|
*/
|
|
@@ -83,7 +83,7 @@ export declare function validateStripeSessionId(sessionId: string): boolean;
|
|
|
83
83
|
/**
|
|
84
84
|
* Validate URL format
|
|
85
85
|
*
|
|
86
|
-
* @version 0.0
|
|
86
|
+
* @version 0.1.0
|
|
87
87
|
* @since 0.0.1
|
|
88
88
|
* @author AMBROISE PARK Consulting
|
|
89
89
|
*/
|
|
@@ -91,7 +91,7 @@ export declare function validateUrl(url: string, name?: string): string;
|
|
|
91
91
|
/**
|
|
92
92
|
* Validate and sanitize metadata object
|
|
93
93
|
*
|
|
94
|
-
* @version 0.0
|
|
94
|
+
* @version 0.1.0
|
|
95
95
|
* @since 0.0.1
|
|
96
96
|
* @author AMBROISE PARK Consulting
|
|
97
97
|
*/
|