@donotdev/functions 0.1.1 → 0.1.44
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 +21 -242
- package/README.md +4 -4
- package/guidelines/FUNCTIONS.md +0 -0
- package/guidelines/VERCEL.md +27 -1
- package/lib/firebase/auth/getCustomClaims.d.ts +0 -0
- package/lib/firebase/auth/getUserAuthStatus.d.ts +0 -0
- package/lib/firebase/auth/index.d.ts +0 -0
- package/lib/firebase/auth/removeCustomClaims.d.ts +0 -0
- package/lib/firebase/auth/setCustomClaims.d.ts +0 -0
- package/lib/firebase/baseFunction.d.ts +0 -0
- package/lib/firebase/billing/cancelSubscription.d.ts +0 -0
- package/lib/firebase/billing/changePlan.d.ts +0 -0
- package/lib/firebase/billing/createCheckoutSession.d.ts +0 -0
- package/lib/firebase/billing/createCustomerPortal.d.ts +0 -0
- package/lib/firebase/billing/healthCheck.d.ts +0 -0
- package/lib/firebase/billing/index.d.ts +0 -0
- package/lib/firebase/billing/refreshSubscriptionStatus.d.ts +0 -0
- package/lib/firebase/billing/webhookHandler.d.ts +0 -0
- package/lib/firebase/config/constants.d.ts +0 -0
- package/lib/firebase/config/index.d.ts +0 -0
- package/lib/firebase/config/secrets.d.ts +0 -0
- package/lib/firebase/crud/aggregate.d.ts +0 -0
- package/lib/firebase/crud/bulk.d.ts +107 -0
- package/lib/firebase/crud/create.d.ts +1 -1
- package/lib/firebase/crud/delete.d.ts +0 -0
- package/lib/firebase/crud/get.d.ts +0 -0
- package/lib/firebase/crud/index.d.ts +1 -0
- package/lib/firebase/crud/list.d.ts +0 -0
- package/lib/firebase/crud/update.d.ts +0 -0
- package/lib/firebase/helpers/githubAccessHelper.d.ts +0 -0
- package/lib/firebase/helpers/githubTeamAccessHelper.d.ts +0 -0
- package/lib/firebase/helpers/index.d.ts +0 -0
- package/lib/firebase/index.d.ts +0 -0
- package/lib/firebase/index.js +3 -3
- package/lib/firebase/index.js.map +4 -4
- package/lib/firebase/oauth/disconnect.d.ts +0 -0
- package/lib/firebase/oauth/exchangeToken.d.ts +0 -0
- package/lib/firebase/oauth/getConnections.d.ts +0 -0
- package/lib/firebase/oauth/githubAccess.d.ts +0 -0
- package/lib/firebase/oauth/index.d.ts +0 -0
- package/lib/firebase/oauth/refreshToken.d.ts +0 -0
- package/lib/firebase/registerCrudFunctions.d.ts +0 -0
- package/lib/firebase/scheduled/checkExpiredSubscriptions.d.ts +0 -0
- package/lib/firebase/scheduled/index.d.ts +0 -0
- package/lib/shared/ai/classifyAIError.d.ts +0 -0
- package/lib/shared/ai/costTracker.d.ts +0 -0
- package/lib/shared/ai/createAIHandler.d.ts +39 -0
- package/lib/shared/ai/createAIRoute.d.ts +0 -0
- package/lib/shared/ai/index.d.ts +0 -0
- package/lib/shared/ai/providers/anthropic.d.ts +12 -0
- package/lib/shared/ai/providers/google.d.ts +10 -0
- package/lib/shared/ai/providers/index.d.ts +23 -0
- package/lib/shared/ai/providers/openai.d.ts +10 -0
- package/lib/shared/ai/resolveModelTier.d.ts +0 -0
- package/lib/shared/ai/utils/parseSSE.d.ts +22 -0
- package/lib/shared/billing/createCheckout.d.ts +0 -0
- package/lib/shared/billing/helpers/index.d.ts +0 -0
- package/lib/shared/billing/helpers/subscriptionManagement.d.ts +0 -0
- package/lib/shared/billing/helpers/updateUserSubscription.d.ts +0 -0
- package/lib/shared/billing/idempotency.d.ts +0 -0
- package/lib/shared/billing/index.d.ts +0 -0
- package/lib/shared/billing/webhookHandler.d.ts +0 -0
- package/lib/shared/crud/bulkCore.d.ts +211 -0
- package/lib/shared/crud/index.d.ts +13 -0
- package/lib/shared/email/createEmailRoute.d.ts +0 -0
- package/lib/shared/email/index.d.ts +0 -0
- package/lib/shared/email/provider.d.ts +0 -0
- package/lib/shared/email/resendProvider.d.ts +0 -0
- package/lib/shared/errorHandling.d.ts +0 -0
- package/lib/shared/firebase.d.ts +0 -0
- package/lib/shared/github.d.ts +0 -0
- package/lib/shared/index.d.ts +1 -0
- package/lib/shared/index.js +4 -4
- package/lib/shared/index.js.map +4 -4
- package/lib/shared/logger.d.ts +0 -0
- package/lib/shared/metadata.d.ts +6 -6
- package/lib/shared/oauth/exchangeToken.d.ts +0 -0
- package/lib/shared/oauth/grantAccess.d.ts +0 -0
- package/lib/shared/oauth/index.d.ts +0 -0
- package/lib/shared/schema.d.ts +0 -0
- package/lib/shared/utils/detectFirestore.d.ts +0 -0
- package/lib/shared/utils/external/date.d.ts +0 -0
- package/lib/shared/utils/external/index.d.ts +0 -0
- package/lib/shared/utils/external/references.d.ts +0 -0
- package/lib/shared/utils/external/subscription.d.ts +0 -0
- package/lib/shared/utils/firebaseHelpers.d.ts +0 -0
- package/lib/shared/utils/functionWrapper.d.ts +0 -0
- package/lib/shared/utils/index.d.ts +0 -0
- package/lib/shared/utils/internal/auth.d.ts +0 -0
- package/lib/shared/utils/internal/firebase.d.ts +0 -0
- package/lib/shared/utils/internal/idempotency.d.ts +0 -0
- package/lib/shared/utils/internal/index.d.ts +0 -0
- package/lib/shared/utils/internal/monitoring.d.ts +0 -0
- package/lib/shared/utils/internal/rateLimiter.d.ts +0 -0
- package/lib/shared/utils/internal/validation.d.ts +0 -0
- package/lib/shared/utils/schemaValidation.d.ts +0 -0
- package/lib/shared/utils/validation.d.ts +0 -0
- package/lib/shared/utils/vercelHelpers.d.ts +0 -0
- package/lib/shared/utils.d.ts +0 -0
- package/lib/shared/validation.d.ts +0 -0
- package/lib/supabase/ai/createAIFunction.d.ts +0 -0
- package/lib/supabase/auth/deleteAccount.d.ts +0 -0
- package/lib/supabase/auth/getCustomClaims.d.ts +0 -0
- package/lib/supabase/auth/getUserAuthStatus.d.ts +0 -0
- package/lib/supabase/auth/removeCustomClaims.d.ts +0 -0
- package/lib/supabase/auth/setCustomClaims.d.ts +0 -0
- package/lib/supabase/baseFunction.d.ts +0 -0
- package/lib/supabase/billing/cancelSubscription.d.ts +0 -0
- package/lib/supabase/billing/changePlan.d.ts +0 -0
- package/lib/supabase/billing/createCheckoutSession.d.ts +0 -0
- package/lib/supabase/billing/createCustomerPortal.d.ts +0 -0
- package/lib/supabase/billing/refreshSubscriptionStatus.d.ts +0 -0
- package/lib/supabase/crud/aggregate.d.ts +0 -0
- package/lib/supabase/crud/bulk.d.ts +63 -0
- package/lib/supabase/crud/create.d.ts +1 -1
- package/lib/supabase/crud/delete.d.ts +0 -0
- package/lib/supabase/crud/get.d.ts +0 -0
- package/lib/supabase/crud/index.d.ts +2 -0
- package/lib/supabase/crud/list.d.ts +0 -0
- package/lib/supabase/crud/update.d.ts +0 -0
- package/lib/supabase/edgeFunction.d.ts +0 -0
- package/lib/supabase/email/createEmailFunction.d.ts +0 -0
- package/lib/supabase/helpers/authProvider.d.ts +0 -0
- package/lib/supabase/index.d.ts +3 -3
- package/lib/supabase/index.js +3 -3
- package/lib/supabase/index.js.map +4 -4
- package/lib/supabase/oauth/disconnect.d.ts +0 -0
- package/lib/supabase/oauth/exchangeToken.d.ts +0 -0
- package/lib/supabase/oauth/getConnections.d.ts +0 -0
- package/lib/supabase/oauth/index.d.ts +0 -0
- package/lib/supabase/oauth/refreshToken.d.ts +0 -0
- package/lib/supabase/registerCrudFunctions.d.ts +0 -0
- package/lib/supabase/utils/idempotency.d.ts +0 -0
- package/lib/supabase/utils/monitoring.d.ts +0 -0
- package/lib/supabase/utils/rateLimiter.d.ts +0 -0
- package/lib/vercel/api/ai/chat.d.ts +0 -0
- package/lib/vercel/api/ai/index.d.ts +0 -0
- package/lib/vercel/api/auth/get-custom-claims.d.ts +0 -0
- package/lib/vercel/api/auth/get-user-auth-status.d.ts +0 -0
- package/lib/vercel/api/auth/index.d.ts +0 -0
- package/lib/vercel/api/auth/remove-custom-claims.d.ts +0 -0
- package/lib/vercel/api/auth/set-custom-claims.d.ts +0 -0
- package/lib/vercel/api/billing/cancel.d.ts +0 -0
- package/lib/vercel/api/billing/change-plan.d.ts +0 -0
- package/lib/vercel/api/billing/create-checkout-session.d.ts +0 -0
- package/lib/vercel/api/billing/customer-portal.d.ts +0 -0
- package/lib/vercel/api/billing/index.d.ts +0 -0
- package/lib/vercel/api/billing/refresh-subscription-status.d.ts +0 -0
- package/lib/vercel/api/billing/webhook-handler.d.ts +0 -0
- package/lib/vercel/api/config/constants.d.ts +0 -0
- package/lib/vercel/api/config/firebase-admin.d.ts +0 -0
- package/lib/vercel/api/config/index.d.ts +0 -0
- package/lib/vercel/api/crud/bulk.d.ts +31 -0
- package/lib/vercel/api/crud/create.d.ts +0 -0
- package/lib/vercel/api/crud/delete.d.ts +0 -0
- package/lib/vercel/api/crud/get.d.ts +0 -0
- package/lib/vercel/api/crud/index.d.ts +1 -0
- package/lib/vercel/api/crud/list.d.ts +0 -0
- package/lib/vercel/api/crud/update.d.ts +0 -0
- package/lib/vercel/api/index.d.ts +0 -0
- package/lib/vercel/api/index.js +3 -3
- package/lib/vercel/api/index.js.map +4 -4
- package/lib/vercel/api/oauth/check-github-access.d.ts +0 -0
- package/lib/vercel/api/oauth/exchange-token.d.ts +0 -0
- package/lib/vercel/api/oauth/grant-github-access.d.ts +0 -0
- package/lib/vercel/api/oauth/index.d.ts +0 -0
- package/lib/vercel/api/oauth/revoke-github-access.d.ts +0 -0
- package/lib/vercel/api/utils/cors.d.ts +0 -0
- package/lib/vercel/baseFunction.d.ts +0 -0
- package/package.json +6 -6
- package/src/firebase/auth/getCustomClaims.ts +0 -0
- package/src/firebase/auth/getUserAuthStatus.ts +0 -0
- package/src/firebase/auth/index.ts +0 -0
- package/src/firebase/auth/removeCustomClaims.ts +0 -0
- package/src/firebase/auth/setCustomClaims.ts +0 -0
- package/src/firebase/baseFunction.ts +0 -0
- package/src/firebase/billing/cancelSubscription.ts +0 -0
- package/src/firebase/billing/changePlan.ts +0 -0
- package/src/firebase/billing/createCheckoutSession.ts +5 -1
- package/src/firebase/billing/createCustomerPortal.ts +0 -0
- package/src/firebase/billing/healthCheck.ts +0 -0
- package/src/firebase/billing/index.d.ts +0 -0
- package/src/firebase/billing/index.ts +0 -0
- package/src/firebase/billing/refreshSubscriptionStatus.ts +0 -0
- package/src/firebase/billing/webhookHandler.ts +0 -0
- package/src/firebase/config/constants.ts +0 -0
- package/src/firebase/config/index.ts +0 -0
- package/src/firebase/config/secrets.ts +0 -0
- package/src/firebase/crud/__tests__/bulk.test.ts +322 -0
- package/src/firebase/crud/aggregate.ts +0 -0
- package/src/firebase/crud/bulk.ts +272 -0
- package/src/firebase/crud/create.ts +20 -33
- package/src/firebase/crud/delete.ts +0 -0
- package/src/firebase/crud/get.ts +0 -0
- package/src/firebase/crud/index.ts +1 -0
- package/src/firebase/crud/list.ts +0 -0
- package/src/firebase/crud/update.ts +0 -0
- package/src/firebase/helpers/githubAccessHelper.ts +0 -0
- package/src/firebase/helpers/githubTeamAccessHelper.ts +0 -0
- package/src/firebase/helpers/index.ts +0 -0
- package/src/firebase/index.d.ts +0 -0
- package/src/firebase/index.ts +0 -0
- package/src/firebase/oauth/disconnect.ts +0 -0
- package/src/firebase/oauth/exchangeToken.ts +0 -0
- package/src/firebase/oauth/getConnections.ts +0 -0
- package/src/firebase/oauth/githubAccess.ts +0 -0
- package/src/firebase/oauth/index.ts +0 -0
- package/src/firebase/oauth/refreshToken.ts +0 -0
- package/src/firebase/registerCrudFunctions.ts +13 -0
- package/src/firebase/scheduled/checkExpiredSubscriptions.ts +0 -0
- package/src/firebase/scheduled/index.ts +0 -0
- package/src/shared/__tests__/auth.test.ts +0 -0
- package/src/shared/__tests__/bulkCore.test.ts +487 -0
- package/src/shared/__tests__/errorHandling.test.ts +0 -0
- package/src/shared/__tests__/firebase.test.ts +9 -3
- package/src/shared/__tests__/idempotency.test.ts +0 -0
- package/src/shared/__tests__/internalValidation.test.ts +9 -3
- package/src/shared/__tests__/metadata.test.ts +10 -10
- package/src/shared/__tests__/rateLimiter.test.ts +0 -0
- package/src/shared/__tests__/schema.test.ts +0 -0
- package/src/shared/__tests__/schemaValidation.test.ts +0 -0
- package/src/shared/__tests__/subscription.test.ts +0 -0
- package/src/shared/__tests__/utils.test.ts +10 -4
- package/src/shared/__tests__/validation-env.test.ts +9 -3
- package/src/shared/__tests__/validation.test.ts +0 -0
- package/src/shared/ai/__tests__/costTracker.test.ts +25 -13
- package/src/shared/ai/classifyAIError.ts +26 -11
- package/src/shared/ai/costTracker.ts +0 -0
- package/src/shared/ai/createAIRoute.ts +11 -8
- package/src/shared/ai/index.ts +0 -0
- package/src/shared/ai/resolveModelTier.ts +5 -2
- package/src/shared/billing/__tests__/createCheckout.test.ts +0 -0
- package/src/shared/billing/__tests__/webhookHandler.test.ts +0 -0
- package/src/shared/billing/createCheckout.ts +24 -9
- package/src/shared/billing/helpers/index.ts +0 -0
- package/src/shared/billing/helpers/subscriptionManagement.ts +0 -0
- package/src/shared/billing/helpers/updateUserSubscription.ts +0 -0
- package/src/shared/billing/idempotency.ts +0 -0
- package/src/shared/billing/index.ts +0 -0
- package/src/shared/billing/webhookHandler.ts +0 -0
- package/src/shared/crud/bulkCore.ts +483 -0
- package/src/shared/crud/index.ts +23 -0
- package/src/shared/email/createEmailRoute.ts +0 -0
- package/src/shared/email/index.ts +0 -0
- package/src/shared/email/provider.ts +0 -0
- package/src/shared/email/resendProvider.ts +1 -1
- package/src/shared/errorHandling.ts +0 -0
- package/src/shared/firebase.ts +0 -0
- package/src/shared/github.ts +0 -0
- package/src/shared/index.d.ts +9 -0
- package/src/shared/index.ts +1 -0
- package/src/shared/logger.ts +0 -0
- package/src/shared/metadata.ts +6 -6
- package/src/shared/oauth/__tests__/exchangeToken.test.ts +0 -0
- package/src/shared/oauth/__tests__/grantAccess.test.ts +0 -0
- package/src/shared/oauth/exchangeToken.ts +0 -0
- package/src/shared/oauth/grantAccess.ts +0 -0
- package/src/shared/oauth/index.ts +0 -0
- package/src/shared/schema.ts +0 -0
- package/src/shared/utils/__tests__/functionWrapper.test.ts +0 -0
- package/src/shared/utils/detectFirestore.ts +0 -0
- package/src/shared/utils/external/date.ts +0 -0
- package/src/shared/utils/external/index.ts +0 -0
- package/src/shared/utils/external/references.ts +0 -0
- package/src/shared/utils/external/subscription.ts +0 -0
- package/src/shared/utils/firebaseHelpers.ts +0 -0
- package/src/shared/utils/functionWrapper.ts +0 -0
- package/src/shared/utils/index.ts +0 -0
- package/src/shared/utils/internal/auth.ts +0 -0
- package/src/shared/utils/internal/firebase.ts +0 -0
- package/src/shared/utils/internal/idempotency.ts +0 -0
- package/src/shared/utils/internal/index.ts +0 -0
- package/src/shared/utils/internal/monitoring.ts +0 -0
- package/src/shared/utils/internal/rateLimiter.ts +0 -0
- package/src/shared/utils/internal/validation.ts +0 -0
- package/src/shared/utils/schemaValidation.ts +0 -0
- package/src/shared/utils/validation.ts +0 -0
- package/src/shared/utils/vercelHelpers.ts +0 -0
- package/src/shared/utils.ts +0 -0
- package/src/shared/validation.ts +0 -0
- package/src/supabase/__tests__/bulk.test.ts +330 -0
- package/src/supabase/ai/createAIFunction.ts +17 -16
- package/src/supabase/auth/deleteAccount.ts +0 -0
- package/src/supabase/auth/getCustomClaims.ts +0 -0
- package/src/supabase/auth/getUserAuthStatus.ts +0 -0
- package/src/supabase/auth/removeCustomClaims.ts +0 -0
- package/src/supabase/auth/setCustomClaims.ts +1 -3
- package/src/supabase/baseFunction.ts +0 -0
- package/src/supabase/billing/cancelSubscription.ts +0 -0
- package/src/supabase/billing/changePlan.ts +1 -1
- package/src/supabase/billing/createCheckoutSession.ts +0 -0
- package/src/supabase/billing/createCustomerPortal.ts +0 -0
- package/src/supabase/billing/refreshSubscriptionStatus.ts +0 -0
- package/src/supabase/crud/aggregate.ts +0 -0
- package/src/supabase/crud/bulk.ts +244 -0
- package/src/supabase/crud/create.ts +15 -14
- package/src/supabase/crud/delete.ts +0 -0
- package/src/supabase/crud/get.ts +0 -0
- package/src/supabase/crud/index.ts +2 -0
- package/src/supabase/crud/list.ts +0 -0
- package/src/supabase/crud/update.ts +0 -0
- package/src/supabase/edgeFunction.ts +4 -3
- package/src/supabase/email/createEmailFunction.ts +9 -12
- package/src/supabase/helpers/authProvider.ts +0 -0
- package/src/supabase/index.ts +12 -3
- package/src/supabase/oauth/disconnect.ts +1 -2
- package/src/supabase/oauth/exchangeToken.ts +1 -3
- package/src/supabase/oauth/getConnections.ts +1 -4
- package/src/supabase/oauth/index.ts +0 -0
- package/src/supabase/oauth/refreshToken.ts +2 -7
- package/src/supabase/registerCrudFunctions.ts +38 -26
- package/src/supabase/utils/idempotency.ts +0 -0
- package/src/supabase/utils/monitoring.ts +0 -0
- package/src/supabase/utils/rateLimiter.ts +0 -0
- package/src/vercel/__tests__/bulk.test.ts +301 -0
- package/src/vercel/api/ai/chat.ts +0 -0
- package/src/vercel/api/ai/index.ts +2 -0
- package/src/vercel/api/auth/get-custom-claims.ts +0 -0
- package/src/vercel/api/auth/get-user-auth-status.ts +0 -0
- package/src/vercel/api/auth/index.ts +0 -0
- package/src/vercel/api/auth/remove-custom-claims.ts +0 -0
- package/src/vercel/api/auth/set-custom-claims.ts +0 -0
- package/src/vercel/api/billing/cancel.ts +0 -0
- package/src/vercel/api/billing/change-plan.ts +0 -0
- package/src/vercel/api/billing/create-checkout-session.ts +5 -1
- package/src/vercel/api/billing/customer-portal.ts +0 -0
- package/src/vercel/api/billing/index.ts +0 -0
- package/src/vercel/api/billing/refresh-subscription-status.ts +0 -0
- package/src/vercel/api/billing/webhook-handler.ts +0 -0
- package/src/vercel/api/config/constants.ts +0 -0
- package/src/vercel/api/config/firebase-admin.ts +0 -0
- package/src/vercel/api/config/index.ts +0 -0
- package/src/vercel/api/crud/bulk.ts +216 -0
- package/src/vercel/api/crud/create.ts +10 -9
- package/src/vercel/api/crud/delete.ts +0 -0
- package/src/vercel/api/crud/get.ts +0 -0
- package/src/vercel/api/crud/index.ts +1 -0
- package/src/vercel/api/crud/list.ts +0 -0
- package/src/vercel/api/crud/update.ts +0 -0
- package/src/vercel/api/index.d.ts +0 -0
- package/src/vercel/api/index.ts +0 -0
- package/src/vercel/api/oauth/check-github-access.ts +0 -0
- package/src/vercel/api/oauth/exchange-token.ts +4 -1
- package/src/vercel/api/oauth/grant-github-access.ts +0 -0
- package/src/vercel/api/oauth/index.ts +0 -0
- package/src/vercel/api/oauth/revoke-github-access.ts +0 -0
- package/src/vercel/api/utils/cors.ts +3 -1
- package/src/vercel/baseFunction.ts +0 -0
package/LICENSE.md
CHANGED
|
@@ -1,242 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
- Hosted applications operated on behalf of a paying client, regardless of code access
|
|
23
|
-
|
|
24
|
-
**1.6 "Internal Use"** means software applications built using the Framework for your own use or your employer's internal use, including SaaS products you own and operate where end-users have no access to Framework code.
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## 2. LICENSE GRANT
|
|
29
|
-
|
|
30
|
-
**2.1 Developer License**
|
|
31
|
-
|
|
32
|
-
Subject to payment of applicable fees and compliance with this Agreement, Ambroise Park Consulting grants you a non-exclusive, non-transferable, perpetual license to:
|
|
33
|
-
|
|
34
|
-
(a) Install Framework packages from npm
|
|
35
|
-
(b) Use the Framework to develop software applications
|
|
36
|
-
(c) Deploy applications for Internal Use without additional fees
|
|
37
|
-
(d) Incorporate the Framework into applications as compiled/minified code
|
|
38
|
-
|
|
39
|
-
**2.2 Project Deployment License**
|
|
40
|
-
|
|
41
|
-
For each Client Project, you must obtain a Project Deployment License prior to delivery. Each Project Deployment License grants you the right to deliver one Client Project containing the Framework.
|
|
42
|
-
|
|
43
|
-
**2.3 Multi-Developer Projects**
|
|
44
|
-
|
|
45
|
-
When multiple developers collaborate on a project:
|
|
46
|
-
- Each developer must hold a Developer License with their own License Key
|
|
47
|
-
- Only one Project Deployment License is required per Client Project (regardless of team size)
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## 3. LICENSE KEY REQUIREMENT
|
|
52
|
-
|
|
53
|
-
**3.1 License Key Activation**
|
|
54
|
-
|
|
55
|
-
Upon purchasing a Developer License or Project Deployment License, you will receive a License Key. You must configure your applications with this key:
|
|
56
|
-
|
|
57
|
-
```javascript
|
|
58
|
-
// Environment variable (recommended)
|
|
59
|
-
DONOTDEV_LICENSE_KEY=your-license-key-here
|
|
60
|
-
|
|
61
|
-
// Or in code
|
|
62
|
-
globalThis.__DONOTDEV_LICENSE_KEY__ = 'your-license-key-here';
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
**3.2 Watermark Enforcement**
|
|
66
|
-
|
|
67
|
-
Applications running without a valid License Key will display a watermark:
|
|
68
|
-
- "⚠️ Unlicensed DoNotDev Framework - Visit donotdev.com"
|
|
69
|
-
- Console warnings in development mode
|
|
70
|
-
|
|
71
|
-
**3.3 License Key Types**
|
|
72
|
-
|
|
73
|
-
- **Developer License Key:** For Internal Use and development
|
|
74
|
-
- **Project Deployment License Key:** For Client Project deployment (suppresses watermark in production)
|
|
75
|
-
|
|
76
|
-
**3.4 Key Management**
|
|
77
|
-
|
|
78
|
-
- Do not commit License Keys to public repositories
|
|
79
|
-
- Use environment variables or secure secret management for production deployments
|
|
80
|
-
- Each developer uses their own Developer License Key for development
|
|
81
|
-
- Project Deployment Keys are provisioned per client project
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
## 4. PERMITTED USES
|
|
86
|
-
|
|
87
|
-
You may:
|
|
88
|
-
|
|
89
|
-
(a) Build unlimited applications for Internal Use with a Developer License
|
|
90
|
-
(b) Develop SaaS products you own and operate (no Project Deployment License required if clients cannot access Framework code)
|
|
91
|
-
(c) Create internal tools for your organization
|
|
92
|
-
(d) Build applications that include the Framework as compiled dependencies
|
|
93
|
-
(e) Open-source applications built on top of the Framework (provided end-users obtain their own licenses to suppress watermarks)
|
|
94
|
-
|
|
95
|
-
---
|
|
96
|
-
|
|
97
|
-
## 5. RESTRICTIONS
|
|
98
|
-
|
|
99
|
-
You may not:
|
|
100
|
-
|
|
101
|
-
(a) Redistribute Framework packages independently of your applications
|
|
102
|
-
(b) Share, publish, or transfer your License Key to unlicensed parties
|
|
103
|
-
(c) Decompile, reverse engineer, or attempt to extract source code from minified files
|
|
104
|
-
(d) Remove or obscure copyright notices or watermarks from Framework code
|
|
105
|
-
(e) Sublicense, resell, or transfer your Developer License to another individual
|
|
106
|
-
(f) Deliver Client Projects without obtaining a Project Deployment License
|
|
107
|
-
(g) Modify Framework code to bypass license validation or watermark enforcement
|
|
108
|
-
(h) Create derivative frameworks intended for redistribution
|
|
109
|
-
(i) Use a single Project Deployment License for multiple client projects
|
|
110
|
-
|
|
111
|
-
---
|
|
112
|
-
|
|
113
|
-
## 6. LICENSE TYPES & FEES
|
|
114
|
-
|
|
115
|
-
**6.1 Developer License**
|
|
116
|
-
- **Scope:** Per individual developer
|
|
117
|
-
- **Term:** Perpetual (lifetime access)
|
|
118
|
-
- **Fee:** Set forth in purchase agreement or donotdev.com pricing
|
|
119
|
-
- **Entitlements:** Unlimited Internal Use projects; Client Projects require additional Project Deployment Licenses
|
|
120
|
-
- **License Key:** One Developer License Key provided
|
|
121
|
-
|
|
122
|
-
**6.2 Project Deployment License**
|
|
123
|
-
- **Scope:** Per Client Project delivered
|
|
124
|
-
- **Term:** Perpetual for the specific project
|
|
125
|
-
- **Fee:** Set forth in purchase agreement or donotdev.com pricing
|
|
126
|
-
- **Purchaser:** Typically purchased by the developer/agency; client payment arrangements are permitted
|
|
127
|
-
- **License Key:** One Project Deployment Key provided per project
|
|
128
|
-
|
|
129
|
-
**6.3 Volume Licensing**
|
|
130
|
-
|
|
131
|
-
Organizations requiring multiple Developer Licenses may contact Ambroise Park Consulting for volume pricing and enterprise key management.
|
|
132
|
-
|
|
133
|
-
---
|
|
134
|
-
|
|
135
|
-
## 7. PAYMENT & VERIFICATION
|
|
136
|
-
|
|
137
|
-
**7.1 Payment**
|
|
138
|
-
|
|
139
|
-
All fees must be paid in full before License Key issuance. Payment terms and pricing are specified at donotdev.com or in separate purchase agreements.
|
|
140
|
-
|
|
141
|
-
**7.2 Compliance Verification**
|
|
142
|
-
|
|
143
|
-
Ambroise Park Consulting may request reasonable verification of Project Deployment License compliance. You agree to cooperate with such verification requests in good faith.
|
|
144
|
-
|
|
145
|
-
**7.3 Enforcement**
|
|
146
|
-
|
|
147
|
-
License compliance is primarily honor-based. Watermarks serve as technical reminders. Ambroise Park Consulting reserves the right to audit usage and pursue legal remedies for material breaches.
|
|
148
|
-
|
|
149
|
-
---
|
|
150
|
-
|
|
151
|
-
## 8. TERM & TERMINATION
|
|
152
|
-
|
|
153
|
-
**8.1 Perpetual Term**
|
|
154
|
-
|
|
155
|
-
Developer Licenses and Project Deployment Licenses are perpetual and do not expire, subject to Section 8.2.
|
|
156
|
-
|
|
157
|
-
**8.2 Termination for Breach**
|
|
158
|
-
|
|
159
|
-
Ambroise Park Consulting may terminate your license(s) and revoke your License Key(s) if you:
|
|
160
|
-
- Breach any material term of this Agreement
|
|
161
|
-
- Fail to pay applicable fees
|
|
162
|
-
- Engage in unauthorized redistribution or License Key sharing
|
|
163
|
-
- Attempt to bypass license validation mechanisms
|
|
164
|
-
|
|
165
|
-
**8.3 Effect of Termination**
|
|
166
|
-
|
|
167
|
-
Upon termination:
|
|
168
|
-
- Your License Key(s) will be revoked and watermarks will reappear
|
|
169
|
-
- Your right to use the Framework ceases
|
|
170
|
-
- Previously deployed applications may continue to function but will display watermarks
|
|
171
|
-
- You must cease distribution of any Client Projects in development
|
|
172
|
-
- You must remove the Framework from any ongoing projects
|
|
173
|
-
|
|
174
|
-
**8.4 Survival**
|
|
175
|
-
|
|
176
|
-
Sections 5 (Restrictions), 9 (Warranty Disclaimer), 10 (Limitation of Liability), and 11 (General Provisions) survive termination.
|
|
177
|
-
|
|
178
|
-
---
|
|
179
|
-
|
|
180
|
-
## 9. WARRANTY DISCLAIMER
|
|
181
|
-
|
|
182
|
-
THE FRAMEWORK IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
|
183
|
-
|
|
184
|
-
Ambroise Park Consulting does not warrant that the Framework will be error-free, uninterrupted, or meet your specific requirements.
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
|
|
188
|
-
## 10. LIMITATION OF LIABILITY
|
|
189
|
-
|
|
190
|
-
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL AMBROISE PARK CONSULTING BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES (INCLUDING LOSS OF PROFITS, DATA, OR BUSINESS OPPORTUNITIES) ARISING OUT OF OR RELATED TO THIS AGREEMENT OR USE OF THE FRAMEWORK, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
191
|
-
|
|
192
|
-
Ambroise Park Consulting's total cumulative liability under this Agreement shall not exceed the fees you paid for the specific license giving rise to the claim.
|
|
193
|
-
|
|
194
|
-
---
|
|
195
|
-
|
|
196
|
-
## 11. GENERAL PROVISIONS
|
|
197
|
-
|
|
198
|
-
**11.1 Governing Law**
|
|
199
|
-
|
|
200
|
-
This Agreement is governed by the laws of Quebec, Canada, without regard to conflict of law principles. Any disputes arising under this Agreement shall be resolved exclusively in the courts of Quebec, Canada.
|
|
201
|
-
|
|
202
|
-
**11.2 Severability**
|
|
203
|
-
|
|
204
|
-
If any provision of this Agreement is found unenforceable, the remaining provisions continue in full force and effect.
|
|
205
|
-
|
|
206
|
-
**11.3 Assignment**
|
|
207
|
-
|
|
208
|
-
You may not assign or transfer this Agreement or any licenses granted hereunder without prior written consent of Ambroise Park Consulting. Ambroise Park Consulting may assign this Agreement without restriction.
|
|
209
|
-
|
|
210
|
-
**11.4 Entire Agreement**
|
|
211
|
-
|
|
212
|
-
This Agreement, together with any applicable purchase agreements or order forms, constitutes the entire agreement between you and Ambroise Park Consulting regarding the Framework and supersedes all prior agreements and understandings.
|
|
213
|
-
|
|
214
|
-
**11.5 Amendments**
|
|
215
|
-
|
|
216
|
-
Ambroise Park Consulting may update this Agreement from time to time. Updates apply to licenses purchased after the effective date of the update. Existing licenses remain governed by the version in effect at the time of purchase unless you opt-in to updated terms.
|
|
217
|
-
|
|
218
|
-
**11.6 Export Compliance**
|
|
219
|
-
|
|
220
|
-
You agree to comply with all applicable export and import laws and regulations in your use of the Framework.
|
|
221
|
-
|
|
222
|
-
**11.7 Force Majeure**
|
|
223
|
-
|
|
224
|
-
Neither party is liable for failure to perform due to causes beyond reasonable control, including but not limited to acts of God, war, strikes, or third-party service outages.
|
|
225
|
-
|
|
226
|
-
**11.8 No Support Obligation**
|
|
227
|
-
|
|
228
|
-
Ambroise Park Consulting has no obligation to provide support, updates, or maintenance. Any support provided is at sole discretion and may be discontinued without notice.
|
|
229
|
-
|
|
230
|
-
**11.9 Contact**
|
|
231
|
-
|
|
232
|
-
Questions about licensing or compliance:
|
|
233
|
-
|
|
234
|
-
**Email:** contact@donotdev.com
|
|
235
|
-
**Website:** donotdev.com
|
|
236
|
-
|
|
237
|
-
---
|
|
238
|
-
|
|
239
|
-
**END OF LICENSE AGREEMENT**
|
|
240
|
-
|
|
241
|
-
**DoNotDev Framework License v1.0**
|
|
242
|
-
Ambroise Park Consulting – 2025
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AMBROISE PARK Consulting
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -238,7 +238,7 @@ bun run build
|
|
|
238
238
|
**Firebase Functions:**
|
|
239
239
|
|
|
240
240
|
```bash
|
|
241
|
-
STRIPE_SECRET_KEY
|
|
241
|
+
STRIPE_SECRET_KEY=<stripe_secret_key>
|
|
242
242
|
STRIPE_WEBHOOK_SECRET=whsec_...
|
|
243
243
|
STRIPE_API_VERSION=2025-08-27.basil # REQUIRED - No fallback
|
|
244
244
|
```
|
|
@@ -246,10 +246,10 @@ STRIPE_API_VERSION=2025-08-27.basil # REQUIRED - No fallback
|
|
|
246
246
|
**Vercel Functions:**
|
|
247
247
|
|
|
248
248
|
```bash
|
|
249
|
-
STRIPE_SECRET_KEY
|
|
249
|
+
STRIPE_SECRET_KEY=<stripe_secret_key>
|
|
250
250
|
STRIPE_WEBHOOK_SECRET=whsec_...
|
|
251
251
|
STRIPE_API_VERSION=2025-08-27.basil # REQUIRED - No fallback
|
|
252
|
-
FIREBASE_ADMIN_PRIVATE_KEY="
|
|
252
|
+
FIREBASE_ADMIN_PRIVATE_KEY="<firebase_private_key>"
|
|
253
253
|
FIREBASE_PROJECT_ID=your-project-id
|
|
254
254
|
FIREBASE_CLIENT_EMAIL=firebase-adminsdk-...@your-project.iam.gserviceaccount.com
|
|
255
255
|
```
|
|
@@ -426,7 +426,7 @@ const tierMapping: Record<string, SubscriptionTier> = {
|
|
|
426
426
|
1. **Set Environment Variables**:
|
|
427
427
|
|
|
428
428
|
```bash
|
|
429
|
-
firebase functions:config:set stripe.secret_key="
|
|
429
|
+
firebase functions:config:set stripe.secret_key="<stripe_secret_key>"
|
|
430
430
|
firebase functions:config:set stripe.webhook_secret="whsec_..."
|
|
431
431
|
```
|
|
432
432
|
|
package/guidelines/FUNCTIONS.md
CHANGED
|
File without changes
|
package/guidelines/VERCEL.md
CHANGED
|
@@ -80,7 +80,6 @@ In **Vercel Dashboard > Project > Settings > Environment Variables**, add your a
|
|
|
80
80
|
- `VITE_SUPABASE_PUBLIC_KEY`
|
|
81
81
|
|
|
82
82
|
**Common (all backends):**
|
|
83
|
-
- `VITE_DONOTDEV_LICENSE_KEY`
|
|
84
83
|
- `VITE_STRIPE_PUBLISHABLE_KEY` (if using billing)
|
|
85
84
|
|
|
86
85
|
**Server-side (Vercel Functions only):**
|
|
@@ -153,6 +152,33 @@ export default createCheckoutSession(billingConfig);
|
|
|
153
152
|
|
|
154
153
|
Available: auth (claims, status, delete account), billing (checkout, cancel, portal, change plan), OAuth (token exchange, access grants).
|
|
155
154
|
|
|
155
|
+
### Bulk CRUD (`POST /api/crud/:collection/bulk`)
|
|
156
|
+
|
|
157
|
+
Transactional bulk endpoint for the `@donotdev/restcrud` adapter. One HTTP round-trip, one Firestore transaction, atomic across `inserts` / `updates` / `deletes`.
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
// pages/api/crud/[collection]/bulk.ts
|
|
161
|
+
export { default } from '@donotdev/functions/vercel';
|
|
162
|
+
// or, if you only want the bulk handler:
|
|
163
|
+
// export { bulk as default } from '@donotdev/functions/vercel';
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Wire contract (shared with the adapter):
|
|
167
|
+
|
|
168
|
+
| | |
|
|
169
|
+
|---|---|
|
|
170
|
+
| **Method** | `POST` |
|
|
171
|
+
| **Request** | `BulkRequestSchema` — `{ inserts?, updates?, deletes? }` from `@donotdev/schemas` |
|
|
172
|
+
| **Response** | `BulkResponseSchema` — `{ insertedIds, updatedIds, deletedIds }`, each preserves input order |
|
|
173
|
+
|
|
174
|
+
Semantics (non-negotiable — see `BULK_CRUD_TODO.md`):
|
|
175
|
+
|
|
176
|
+
- **Atomic.** Server wraps every write in a single `db.runTransaction`. Any failure rolls back all ops.
|
|
177
|
+
- **Collision rejection.** Same id in `updates` + `deletes`, or `inserts` + `updates`, returns `400 BulkCollisionError` before any read or write.
|
|
178
|
+
- **Empty is no-op.** Body `{}` short-circuits to `{ insertedIds: [], updatedIds: [], deletedIds: [] }` without touching the DB.
|
|
179
|
+
- **Order preserved.** Output arrays mirror the input order of their bucket.
|
|
180
|
+
- **Single audit / rate-limit debit.** One `crud.bulk.${collection}` audit entry, one write rate-limit hit — not N.
|
|
181
|
+
|
|
156
182
|
### When to use Vercel Functions vs Firebase/Supabase functions
|
|
157
183
|
|
|
158
184
|
- **Vercel Functions:** API routes, webhooks, third-party proxies - especially in Next.js apps
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import type { BulkRequest, BulkResponse, UserRole } from '@donotdev/core/server';
|
|
3
|
+
import type { CallableFunction, CallableRequest } from 'firebase-functions/v2/https';
|
|
4
|
+
/**
|
|
5
|
+
* Request type for the bulk endpoint. Identical to the wire schema; kept as a
|
|
6
|
+
* named alias for parity with `CreateEntityRequest`, `UpdateEntityRequest`, etc.
|
|
7
|
+
*/
|
|
8
|
+
export type BulkEntityRequest = BulkRequest;
|
|
9
|
+
/**
|
|
10
|
+
* Per-operation access split. The three write access roles are passed
|
|
11
|
+
* individually so the factory can enforce them independently when a request
|
|
12
|
+
* mixes op kinds (e.g. only the delete bucket fails ACL).
|
|
13
|
+
*/
|
|
14
|
+
interface BulkAccess {
|
|
15
|
+
/** Minimum role to insert into the collection. */
|
|
16
|
+
create: UserRole;
|
|
17
|
+
/** Minimum role to update existing rows. */
|
|
18
|
+
update: UserRole;
|
|
19
|
+
/** Minimum role to delete rows. */
|
|
20
|
+
delete: UserRole;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Build the business-logic function consumed by {@link createBaseFunction}.
|
|
24
|
+
*
|
|
25
|
+
* Exported for unit testing only — the public entry is {@link bulkEntity}
|
|
26
|
+
* which wraps this factory with auth, role, rate-limit, and schema
|
|
27
|
+
* validation at the transport boundary.
|
|
28
|
+
*
|
|
29
|
+
* The logic itself is a pure delegation to {@link executeBulk}; the only
|
|
30
|
+
* Firestore-specific code lives inside the `transact` closure which issues
|
|
31
|
+
* `tx.set / tx.update / tx.delete` on pre-minted `doc()` references.
|
|
32
|
+
*
|
|
33
|
+
* @internal
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* const logic = bulkEntityLogicFactory('cars', createSchema, updateSchema, {
|
|
38
|
+
* create: 'user', update: 'user', delete: 'admin',
|
|
39
|
+
* });
|
|
40
|
+
* await logic({ inserts: [{ name: 'a' }] }, { uid: 'u', userRole: 'user', request: req });
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @version 0.2.0
|
|
44
|
+
* @since 0.2.0
|
|
45
|
+
*/
|
|
46
|
+
export declare function bulkEntityLogicFactory(collection: string, createSchema: v.BaseSchema<unknown, any, v.BaseIssue<unknown>>, draftCreateSchema: v.BaseSchema<unknown, any, v.BaseIssue<unknown>>, updateSchema: v.BaseSchema<unknown, any, v.BaseIssue<unknown>>, access: BulkAccess): (data: BulkEntityRequest, context: {
|
|
47
|
+
uid: string;
|
|
48
|
+
userRole: UserRole;
|
|
49
|
+
request: CallableRequest<any>;
|
|
50
|
+
}) => Promise<BulkResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* Generic function to perform transactional bulk CRUD in any Firestore
|
|
53
|
+
* collection. Auto-registered as `bulk_${collection}` by
|
|
54
|
+
* {@link createCrudFunctions}.
|
|
55
|
+
*
|
|
56
|
+
* **Atomicity contract** — all inserts / updates / deletes succeed or none
|
|
57
|
+
* do. On any failure the entire Firestore transaction is rolled back and the
|
|
58
|
+
* error is surfaced to the caller via `DoNotDevError`.
|
|
59
|
+
*
|
|
60
|
+
* **One of everything** — one HTTP round-trip, one transaction, one audit
|
|
61
|
+
* entry (`crud.bulk.${collection}` with counts), one rate-limit hit (at
|
|
62
|
+
* `createBaseFunction` entry). Collisions and schema validation fail *before*
|
|
63
|
+
* the transaction is opened.
|
|
64
|
+
*
|
|
65
|
+
* @param collection - The Firestore collection name.
|
|
66
|
+
* @param createSchema - Valibot schema to validate each insert payload.
|
|
67
|
+
* @param updateSchema - Valibot schema to validate each update patch.
|
|
68
|
+
* @param access - Required roles split per op kind.
|
|
69
|
+
* @returns Firebase callable function returning a `BulkResponse`.
|
|
70
|
+
*
|
|
71
|
+
* @throws {BulkCollisionError} When the same id appears in `updates`+`deletes`
|
|
72
|
+
* or `inserts`+`updates`. No writes are attempted.
|
|
73
|
+
* @throws {DoNotDevError} `permission-denied` when the caller lacks the
|
|
74
|
+
* per-op role (e.g. includes deletes but has no delete access).
|
|
75
|
+
* @throws {DoNotDevError} `invalid-argument` when any insert fails
|
|
76
|
+
* `createSchema` or any update patch fails `updateSchema`. Transaction is
|
|
77
|
+
* not opened.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```typescript
|
|
81
|
+
* // Usually wired automatically by createCrudFunctions:
|
|
82
|
+
* import { createCrudFunctions } from '@donotdev/functions/firebase';
|
|
83
|
+
* import * as entities from 'entities';
|
|
84
|
+
*
|
|
85
|
+
* export const crud = createCrudFunctions(entities);
|
|
86
|
+
* // → crud.bulk_cars, crud.bulk_orders, etc.
|
|
87
|
+
*
|
|
88
|
+
* // Manual wiring:
|
|
89
|
+
* import { bulkEntity } from '@donotdev/functions/firebase';
|
|
90
|
+
* import { createSchemas } from '@donotdev/core/server';
|
|
91
|
+
* import { carEntity } from './entities/car';
|
|
92
|
+
*
|
|
93
|
+
* const schemas = createSchemas(carEntity);
|
|
94
|
+
* export const bulk_cars = bulkEntity(
|
|
95
|
+
* carEntity.collection,
|
|
96
|
+
* schemas.create,
|
|
97
|
+
* schemas.update,
|
|
98
|
+
* carEntity.access,
|
|
99
|
+
* );
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* @version 0.2.0
|
|
103
|
+
* @since 0.2.0
|
|
104
|
+
* @author AMBROISE PARK Consulting
|
|
105
|
+
*/
|
|
106
|
+
export declare const bulkEntity: (collection: string, createSchema: v.BaseSchema<unknown, any, v.BaseIssue<unknown>>, draftCreateSchema: v.BaseSchema<unknown, any, v.BaseIssue<unknown>>, updateSchema: v.BaseSchema<unknown, any, v.BaseIssue<unknown>>, access: BulkAccess) => CallableFunction<BulkEntityRequest, Promise<BulkResponse>>;
|
|
107
|
+
export {};
|
|
@@ -13,4 +13,4 @@ export type CreateEntityRequest = {
|
|
|
13
13
|
* @param customSchema - Optional custom request schema
|
|
14
14
|
* @returns Firebase callable function
|
|
15
15
|
*/
|
|
16
|
-
export declare const createEntity: (collection: string,
|
|
16
|
+
export declare const createEntity: (collection: string, createDocumentSchema: v.BaseSchema<unknown, any, v.BaseIssue<unknown>>, draftDocumentSchema: v.BaseSchema<unknown, any, v.BaseIssue<unknown>>, requiredRole: UserRole, customSchema?: v.BaseSchema<unknown, any, v.BaseIssue<unknown>>) => CallableFunction<CreateEntityRequest, Promise<any>>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/firebase/index.d.ts
CHANGED
|
File without changes
|