@donotdev/functions 0.0.20 → 0.1.0
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/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/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 +2 -2
- 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/billing/createCheckout.d.ts +4 -4
- 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/errorHandling.d.ts +1 -1
- package/lib/shared/firebase.d.ts +7 -7
- package/lib/shared/github.d.ts +11 -11
- package/lib/shared/index.d.ts +1 -1
- package/lib/shared/index.js +3 -3
- package/lib/shared/index.js.map +2 -2
- package/lib/shared/logger.d.ts +6 -6
- package/lib/shared/metadata.d.ts +3 -3
- package/lib/shared/oauth/exchangeToken.d.ts +2 -2
- package/lib/shared/oauth/grantAccess.d.ts +2 -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 +2 -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/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 +1 -1
- package/lib/supabase/baseFunction.d.ts +2 -2
- package/lib/supabase/billing/cancelSubscription.d.ts +1 -1
- package/lib/supabase/billing/changePlan.d.ts +1 -1
- 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 +1 -1
- package/lib/supabase/crud/create.d.ts +1 -1
- package/lib/supabase/crud/get.d.ts +1 -1
- package/lib/supabase/crud/index.d.ts +1 -1
- package/lib/supabase/crud/list.d.ts +1 -1
- package/lib/supabase/crud/update.d.ts +1 -1
- package/lib/supabase/helpers/authProvider.d.ts +2 -2
- package/lib/supabase/index.d.ts +3 -2
- package/lib/supabase/index.js +2 -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/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 +1 -1
- package/lib/vercel/api/index.js +2 -2
- package/lib/vercel/api/index.js.map +2 -2
- 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 +4 -4
- 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 +1 -1
- 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 +2 -2
- 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 +2 -2
- 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/billing/__tests__/createCheckout.test.ts +1 -1
- package/src/shared/billing/__tests__/webhookHandler.test.ts +1 -1
- package/src/shared/billing/createCheckout.ts +4 -4
- package/src/shared/billing/helpers/index.ts +1 -1
- package/src/shared/billing/helpers/subscriptionManagement.ts +4 -4
- package/src/shared/billing/helpers/updateUserSubscription.ts +4 -4
- package/src/shared/billing/idempotency.ts +4 -4
- package/src/shared/billing/index.ts +1 -1
- package/src/shared/billing/webhookHandler.ts +7 -7
- package/src/shared/errorHandling.ts +2 -2
- package/src/shared/firebase.ts +7 -7
- package/src/shared/github.ts +11 -11
- package/src/shared/index.d.ts +9 -9
- package/src/shared/index.ts +1 -1
- package/src/shared/logger.ts +8 -8
- package/src/shared/metadata.ts +3 -3
- package/src/shared/oauth/__tests__/exchangeToken.test.ts +1 -1
- package/src/shared/oauth/exchangeToken.ts +2 -2
- package/src/shared/oauth/grantAccess.ts +2 -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 +3 -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 +6 -6
- 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 +2 -2
- 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 +2 -2
- package/src/supabase/auth/setCustomClaims.ts +2 -2
- package/src/supabase/baseFunction.ts +3 -3
- package/src/supabase/billing/cancelSubscription.ts +2 -2
- package/src/supabase/billing/changePlan.ts +2 -2
- package/src/supabase/billing/createCheckoutSession.ts +2 -2
- package/src/supabase/billing/createCustomerPortal.ts +2 -2
- package/src/supabase/billing/refreshSubscriptionStatus.ts +2 -2
- package/src/supabase/crud/aggregate.ts +1 -1
- package/src/supabase/crud/create.ts +1 -1
- package/src/supabase/crud/delete.ts +1 -1
- package/src/supabase/crud/get.ts +1 -1
- package/src/supabase/crud/index.ts +1 -1
- package/src/supabase/crud/list.ts +1 -1
- package/src/supabase/crud/update.ts +1 -1
- package/src/supabase/helpers/authProvider.ts +2 -2
- package/src/supabase/index.ts +10 -2
- package/src/supabase/oauth/disconnect.ts +104 -0
- package/src/supabase/oauth/exchangeToken.ts +152 -0
- package/src/supabase/oauth/getConnections.ts +85 -0
- package/src/supabase/oauth/index.ts +15 -0
- package/src/supabase/oauth/refreshToken.ts +131 -0
- package/src/supabase/registerCrudFunctions.ts +1 -1
- package/src/supabase/utils/idempotency.ts +1 -1
- package/src/supabase/utils/monitoring.ts +1 -1
- package/src/supabase/utils/rateLimiter.ts +1 -1
- 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 +3 -3
- 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 +3 -3
- 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 +1 -1
- package/src/vercel/api/oauth/check-github-access.ts +3 -3
- package/src/vercel/api/oauth/exchange-token.ts +1 -1
- 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 +4 -4
- package/src/vercel/baseFunction.ts +2 -2
|
@@ -5,7 +5,7 @@ import type { CallableFunction } from 'firebase-functions/v2/https';
|
|
|
5
5
|
/**
|
|
6
6
|
* Grant GitHub repository access to a user
|
|
7
7
|
*
|
|
8
|
-
* @version 0.0
|
|
8
|
+
* @version 0.1.0
|
|
9
9
|
* @since 0.0.1
|
|
10
10
|
* @author AMBROISE PARK Consulting
|
|
11
11
|
*/
|
|
@@ -13,7 +13,7 @@ export declare const grantGitHubAccess: CallableFunction<GrantGitHubAccessReques
|
|
|
13
13
|
/**
|
|
14
14
|
* Grant GitHub repository access with custom validation schema
|
|
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 grantGitHubAccessWithSchema(request: CallableRequest<Gra
|
|
|
31
31
|
/**
|
|
32
32
|
* Revoke GitHub repository access from a user
|
|
33
33
|
*
|
|
34
|
-
* @version 0.0
|
|
34
|
+
* @version 0.1.0
|
|
35
35
|
* @since 0.0.1
|
|
36
36
|
* @author AMBROISE PARK Consulting
|
|
37
37
|
*/
|
|
@@ -39,7 +39,7 @@ export declare const revokeGitHubAccess: CallableFunction<RevokeGitHubAccessRequ
|
|
|
39
39
|
/**
|
|
40
40
|
* Revoke GitHub repository access with custom validation schema
|
|
41
41
|
*
|
|
42
|
-
* @version 0.0
|
|
42
|
+
* @version 0.1.0
|
|
43
43
|
* @since 0.0.1
|
|
44
44
|
* @author AMBROISE PARK Consulting
|
|
45
45
|
*/
|
|
@@ -56,7 +56,7 @@ export declare function revokeGitHubAccessWithSchema(request: CallableRequest<Re
|
|
|
56
56
|
/**
|
|
57
57
|
* Check GitHub repository access for a user
|
|
58
58
|
*
|
|
59
|
-
* @version 0.0
|
|
59
|
+
* @version 0.1.0
|
|
60
60
|
* @since 0.0.1
|
|
61
61
|
* @author AMBROISE PARK Consulting
|
|
62
62
|
*/
|
|
@@ -64,7 +64,7 @@ export declare const checkGitHubAccess: CallableFunction<CheckGitHubAccessReques
|
|
|
64
64
|
/**
|
|
65
65
|
* Check GitHub repository access with custom validation schema
|
|
66
66
|
*
|
|
67
|
-
* @version 0.0
|
|
67
|
+
* @version 0.1.0
|
|
68
68
|
* @since 0.0.1
|
|
69
69
|
* @author AMBROISE PARK Consulting
|
|
70
70
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @fileoverview Create Checkout Session Algorithm
|
|
3
3
|
* @description Platform-agnostic algorithm for creating Stripe checkout sessions
|
|
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 { CreateCheckoutSessionRequest, CreateCheckoutSessionResponse, Strip
|
|
|
10
10
|
/**
|
|
11
11
|
* Provider interface for Stripe checkout operations
|
|
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
|
*/
|
|
@@ -31,7 +31,7 @@ export interface StripeCheckoutProvider {
|
|
|
31
31
|
/**
|
|
32
32
|
* Provider interface for authentication operations
|
|
33
33
|
*
|
|
34
|
-
* @version 0.0
|
|
34
|
+
* @version 0.1.0
|
|
35
35
|
* @since 0.0.1
|
|
36
36
|
* @author AMBROISE PARK Consulting
|
|
37
37
|
*/
|
|
@@ -43,7 +43,7 @@ export interface AuthCheckoutProvider {
|
|
|
43
43
|
/**
|
|
44
44
|
* Create checkout session algorithm
|
|
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
|
*/
|
|
@@ -2,7 +2,7 @@ import { type AuthProvider } from './updateUserSubscription.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Cancel user subscription at period end
|
|
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 @@ export declare function cancelUserSubscription(userId: string, authProvider: Aut
|
|
|
13
13
|
/**
|
|
14
14
|
* Change user subscription plan
|
|
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
|
*/
|
|
@@ -25,7 +25,7 @@ export declare function changeUserPlan(userId: string, newPriceId: string, billi
|
|
|
25
25
|
/**
|
|
26
26
|
* Create Stripe Customer Portal session
|
|
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
|
*/
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* @fileoverview User subscription update utilities
|
|
3
3
|
* @description Functions for updating user subscription data
|
|
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
|
/**
|
|
10
10
|
* Subscription data structure
|
|
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
|
*/
|
|
@@ -24,7 +24,7 @@ export interface SubscriptionData {
|
|
|
24
24
|
/**
|
|
25
25
|
* Platform-agnostic auth provider interface
|
|
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
|
*/
|
|
@@ -38,7 +38,7 @@ export interface AuthProvider {
|
|
|
38
38
|
* Platform-agnostic subscription update using dependency injection
|
|
39
39
|
* Works on Firebase Functions, Vercel, AWS Lambda, etc.
|
|
40
40
|
*
|
|
41
|
-
* @version 0.0
|
|
41
|
+
* @version 0.1.0
|
|
42
42
|
* @since 0.0.1
|
|
43
43
|
* @author AMBROISE PARK Consulting
|
|
44
44
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Idempotency store interface
|
|
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
|
*/
|
|
@@ -15,7 +15,7 @@ export declare function createIdempotencyStore(): IdempotencyStore;
|
|
|
15
15
|
/**
|
|
16
16
|
* Reset cached store (for testing only)
|
|
17
17
|
*
|
|
18
|
-
* @version 0.0
|
|
18
|
+
* @version 0.1.0
|
|
19
19
|
* @since 0.0.1
|
|
20
20
|
* @author AMBROISE PARK Consulting
|
|
21
21
|
*/
|
|
@@ -23,7 +23,7 @@ export type UpdateSubscriptionFn = (userId: string, data: SubscriptionData, auth
|
|
|
23
23
|
* @param billingConfig - Billing configuration
|
|
24
24
|
* @param updateSubscription - Function to update user subscription
|
|
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
|
*/
|
package/lib/shared/firebase.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @fileoverview Firebase data transformation utilities for functions
|
|
3
3
|
* @description Server-safe functions for converting data between Firebase and application formats
|
|
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 { FirestoreTimestamp } from '@donotdev/core/server';
|
|
|
12
12
|
* @param date - The Date object to convert
|
|
13
13
|
* @returns A representation of the timestamp
|
|
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
|
*/
|
|
@@ -23,7 +23,7 @@ export declare function createTimestamp(date: Date): FirestoreTimestamp;
|
|
|
23
23
|
* @returns The Firestore Timestamp
|
|
24
24
|
* @throws Error if the date is invalid
|
|
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
|
*/
|
|
@@ -33,7 +33,7 @@ export declare function toTimestamp(date: string | Date): FirestoreTimestamp;
|
|
|
33
33
|
* @param timestamp - The Firestore Timestamp
|
|
34
34
|
* @returns The ISO string representation
|
|
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
|
*/
|
|
@@ -43,7 +43,7 @@ export declare function toISOString(timestamp: FirestoreTimestamp): string;
|
|
|
43
43
|
* @param value - The value to check
|
|
44
44
|
* @returns True if the value is a Timestamp
|
|
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
|
*/
|
|
@@ -54,7 +54,7 @@ export declare function isTimestamp(value: any): value is FirestoreTimestamp;
|
|
|
54
54
|
* @param includeDocumentIds - Whether to include document IDs
|
|
55
55
|
* @returns The transformed data
|
|
56
56
|
*
|
|
57
|
-
* @version 0.0
|
|
57
|
+
* @version 0.1.0
|
|
58
58
|
* @since 0.0.1
|
|
59
59
|
* @author AMBROISE PARK Consulting
|
|
60
60
|
*/
|
|
@@ -66,7 +66,7 @@ export declare function transformFirestoreData<T = any>(data: T, includeDocument
|
|
|
66
66
|
* @param removeFields - Optional array of field names to remove
|
|
67
67
|
* @returns The prepared data
|
|
68
68
|
*
|
|
69
|
-
* @version 0.0
|
|
69
|
+
* @version 0.1.0
|
|
70
70
|
* @since 0.0.1
|
|
71
71
|
* @author AMBROISE PARK Consulting
|
|
72
72
|
*/
|
package/lib/shared/github.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @fileoverview GitHub API Service for functions
|
|
3
3
|
* @description Server-safe GitHub API utilities for repository management
|
|
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
|
*/
|
|
@@ -41,7 +41,7 @@ export interface GitHubApiError {
|
|
|
41
41
|
/**
|
|
42
42
|
* GitHub API Service for server-side operations
|
|
43
43
|
*
|
|
44
|
-
* @version 0.0
|
|
44
|
+
* @version 0.1.0
|
|
45
45
|
* @since 0.0.1
|
|
46
46
|
* @author AMBROISE PARK Consulting
|
|
47
47
|
*/
|
|
@@ -51,7 +51,7 @@ export declare class GitHubApiService {
|
|
|
51
51
|
/**
|
|
52
52
|
* Get the current authenticated user
|
|
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 class GitHubApiService {
|
|
|
59
59
|
/**
|
|
60
60
|
* Get user repositories
|
|
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 class GitHubApiService {
|
|
|
67
67
|
/**
|
|
68
68
|
* Add a collaborator to a repository
|
|
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
|
*/
|
|
@@ -76,7 +76,7 @@ export declare class GitHubApiService {
|
|
|
76
76
|
* Check if a user is a collaborator on a repository
|
|
77
77
|
* Uses GitHub's direct API endpoint for efficiency
|
|
78
78
|
*
|
|
79
|
-
* @version 0.0
|
|
79
|
+
* @version 0.1.0
|
|
80
80
|
* @since 0.0.1
|
|
81
81
|
* @author AMBROISE PARK Consulting
|
|
82
82
|
*/
|
|
@@ -84,7 +84,7 @@ export declare class GitHubApiService {
|
|
|
84
84
|
/**
|
|
85
85
|
* Remove a collaborator from a repository
|
|
86
86
|
*
|
|
87
|
-
* @version 0.0
|
|
87
|
+
* @version 0.1.0
|
|
88
88
|
* @since 0.0.1
|
|
89
89
|
* @author AMBROISE PARK Consulting
|
|
90
90
|
*/
|
|
@@ -92,7 +92,7 @@ export declare class GitHubApiService {
|
|
|
92
92
|
/**
|
|
93
93
|
* Add a user to an organization team
|
|
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
|
*/
|
|
@@ -100,7 +100,7 @@ export declare class GitHubApiService {
|
|
|
100
100
|
/**
|
|
101
101
|
* Remove a user from an organization team
|
|
102
102
|
*
|
|
103
|
-
* @version 0.0
|
|
103
|
+
* @version 0.1.0
|
|
104
104
|
* @since 0.0.1
|
|
105
105
|
* @author AMBROISE PARK Consulting
|
|
106
106
|
*/
|
|
@@ -108,7 +108,7 @@ export declare class GitHubApiService {
|
|
|
108
108
|
/**
|
|
109
109
|
* Check if a user is a member of an organization team
|
|
110
110
|
*
|
|
111
|
-
* @version 0.0
|
|
111
|
+
* @version 0.1.0
|
|
112
112
|
* @since 0.0.1
|
|
113
113
|
* @author AMBROISE PARK Consulting
|
|
114
114
|
*/
|
|
@@ -116,7 +116,7 @@ export declare class GitHubApiService {
|
|
|
116
116
|
/**
|
|
117
117
|
* Make an authenticated request to the GitHub API
|
|
118
118
|
*
|
|
119
|
-
* @version 0.0
|
|
119
|
+
* @version 0.1.0
|
|
120
120
|
* @since 0.0.1
|
|
121
121
|
* @author AMBROISE PARK Consulting
|
|
122
122
|
*/
|