@appconda/nextjs 1.0.12
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/.github/workflows/autoclose.yml +11 -0
- package/.github/workflows/publish.yml +42 -0
- package/.travis.yml +32 -0
- package/CHANGELOG.md +1 -0
- package/LICENSE +12 -0
- package/README.md +0 -0
- package/dist/cjs/sdk.js +10608 -0
- package/dist/cjs/sdk.js.map +1 -0
- package/dist/esm/sdk.js +10589 -0
- package/dist/esm/sdk.js.map +1 -0
- package/dist/iife/sdk.js +10609 -0
- package/docs/examples/account/create-anonymous-session.md +11 -0
- package/docs/examples/account/create-email-password-session.md +14 -0
- package/docs/examples/account/create-email-token.md +15 -0
- package/docs/examples/account/create-j-w-t.md +11 -0
- package/docs/examples/account/create-magic-u-r-l-token.md +16 -0
- package/docs/examples/account/create-mfa-authenticator.md +13 -0
- package/docs/examples/account/create-mfa-challenge.md +13 -0
- package/docs/examples/account/create-mfa-recovery-codes.md +11 -0
- package/docs/examples/account/create-o-auth2session.md +15 -0
- package/docs/examples/account/create-o-auth2token.md +15 -0
- package/docs/examples/account/create-phone-token.md +14 -0
- package/docs/examples/account/create-phone-verification.md +11 -0
- package/docs/examples/account/create-push-target.md +15 -0
- package/docs/examples/account/create-recovery.md +14 -0
- package/docs/examples/account/create-session.md +14 -0
- package/docs/examples/account/create-verification.md +13 -0
- package/docs/examples/account/create.md +16 -0
- package/docs/examples/account/delete-identity.md +13 -0
- package/docs/examples/account/delete-mfa-authenticator.md +13 -0
- package/docs/examples/account/delete-push-target.md +13 -0
- package/docs/examples/account/delete-session.md +13 -0
- package/docs/examples/account/delete-sessions.md +11 -0
- package/docs/examples/account/delete.md +11 -0
- package/docs/examples/account/get-mfa-recovery-codes.md +11 -0
- package/docs/examples/account/get-prefs.md +11 -0
- package/docs/examples/account/get-session.md +13 -0
- package/docs/examples/account/get.md +11 -0
- package/docs/examples/account/list-identities.md +13 -0
- package/docs/examples/account/list-logs.md +13 -0
- package/docs/examples/account/list-mfa-factors.md +11 -0
- package/docs/examples/account/list-sessions.md +11 -0
- package/docs/examples/account/update-email.md +14 -0
- package/docs/examples/account/update-m-f-a.md +13 -0
- package/docs/examples/account/update-magic-u-r-l-session.md +14 -0
- package/docs/examples/account/update-mfa-authenticator.md +14 -0
- package/docs/examples/account/update-mfa-challenge.md +14 -0
- package/docs/examples/account/update-mfa-recovery-codes.md +11 -0
- package/docs/examples/account/update-name.md +13 -0
- package/docs/examples/account/update-password.md +14 -0
- package/docs/examples/account/update-phone-session.md +14 -0
- package/docs/examples/account/update-phone-verification.md +14 -0
- package/docs/examples/account/update-phone.md +14 -0
- package/docs/examples/account/update-prefs.md +13 -0
- package/docs/examples/account/update-push-target.md +14 -0
- package/docs/examples/account/update-recovery.md +15 -0
- package/docs/examples/account/update-session.md +13 -0
- package/docs/examples/account/update-status.md +11 -0
- package/docs/examples/account/update-verification.md +14 -0
- package/docs/examples/assistant/chat.md +13 -0
- package/docs/examples/avatars/get-browser.md +16 -0
- package/docs/examples/avatars/get-credit-card.md +16 -0
- package/docs/examples/avatars/get-favicon.md +13 -0
- package/docs/examples/avatars/get-flag.md +16 -0
- package/docs/examples/avatars/get-image.md +15 -0
- package/docs/examples/avatars/get-initials.md +16 -0
- package/docs/examples/avatars/get-q-r.md +16 -0
- package/docs/examples/console/variables.md +11 -0
- package/docs/examples/databases/create-boolean-attribute.md +18 -0
- package/docs/examples/databases/create-collection.md +18 -0
- package/docs/examples/databases/create-datetime-attribute.md +18 -0
- package/docs/examples/databases/create-document.md +17 -0
- package/docs/examples/databases/create-email-attribute.md +18 -0
- package/docs/examples/databases/create-enum-attribute.md +19 -0
- package/docs/examples/databases/create-float-attribute.md +20 -0
- package/docs/examples/databases/create-index.md +18 -0
- package/docs/examples/databases/create-integer-attribute.md +20 -0
- package/docs/examples/databases/create-ip-attribute.md +18 -0
- package/docs/examples/databases/create-relationship-attribute.md +20 -0
- package/docs/examples/databases/create-string-attribute.md +20 -0
- package/docs/examples/databases/create-url-attribute.md +18 -0
- package/docs/examples/databases/create.md +15 -0
- package/docs/examples/databases/delete-attribute.md +15 -0
- package/docs/examples/databases/delete-collection.md +14 -0
- package/docs/examples/databases/delete-document.md +15 -0
- package/docs/examples/databases/delete-index.md +15 -0
- package/docs/examples/databases/delete.md +13 -0
- package/docs/examples/databases/get-attribute.md +15 -0
- package/docs/examples/databases/get-collection-usage.md +15 -0
- package/docs/examples/databases/get-collection.md +14 -0
- package/docs/examples/databases/get-database-usage.md +14 -0
- package/docs/examples/databases/get-document.md +16 -0
- package/docs/examples/databases/get-index.md +15 -0
- package/docs/examples/databases/get-usage.md +13 -0
- package/docs/examples/databases/get.md +13 -0
- package/docs/examples/databases/list-attributes.md +15 -0
- package/docs/examples/databases/list-collection-logs.md +15 -0
- package/docs/examples/databases/list-collections.md +15 -0
- package/docs/examples/databases/list-document-logs.md +16 -0
- package/docs/examples/databases/list-documents.md +15 -0
- package/docs/examples/databases/list-indexes.md +15 -0
- package/docs/examples/databases/list-logs.md +14 -0
- package/docs/examples/databases/list.md +14 -0
- package/docs/examples/databases/update-boolean-attribute.md +17 -0
- package/docs/examples/databases/update-collection.md +18 -0
- package/docs/examples/databases/update-datetime-attribute.md +17 -0
- package/docs/examples/databases/update-document.md +17 -0
- package/docs/examples/databases/update-email-attribute.md +17 -0
- package/docs/examples/databases/update-enum-attribute.md +18 -0
- package/docs/examples/databases/update-float-attribute.md +19 -0
- package/docs/examples/databases/update-integer-attribute.md +19 -0
- package/docs/examples/databases/update-ip-attribute.md +17 -0
- package/docs/examples/databases/update-relationship-attribute.md +16 -0
- package/docs/examples/databases/update-string-attribute.md +17 -0
- package/docs/examples/databases/update-url-attribute.md +17 -0
- package/docs/examples/databases/update.md +15 -0
- package/docs/examples/functions/create-build.md +15 -0
- package/docs/examples/functions/create-deployment.md +17 -0
- package/docs/examples/functions/create-execution.md +19 -0
- package/docs/examples/functions/create-variable.md +15 -0
- package/docs/examples/functions/create.md +34 -0
- package/docs/examples/functions/delete-deployment.md +14 -0
- package/docs/examples/functions/delete-execution.md +14 -0
- package/docs/examples/functions/delete-variable.md +14 -0
- package/docs/examples/functions/delete.md +13 -0
- package/docs/examples/functions/get-deployment-download.md +14 -0
- package/docs/examples/functions/get-deployment.md +14 -0
- package/docs/examples/functions/get-execution.md +14 -0
- package/docs/examples/functions/get-function-usage.md +14 -0
- package/docs/examples/functions/get-template.md +13 -0
- package/docs/examples/functions/get-usage.md +13 -0
- package/docs/examples/functions/get-variable.md +14 -0
- package/docs/examples/functions/get.md +13 -0
- package/docs/examples/functions/list-deployments.md +15 -0
- package/docs/examples/functions/list-executions.md +15 -0
- package/docs/examples/functions/list-runtimes.md +11 -0
- package/docs/examples/functions/list-specifications.md +11 -0
- package/docs/examples/functions/list-templates.md +16 -0
- package/docs/examples/functions/list-variables.md +13 -0
- package/docs/examples/functions/list.md +14 -0
- package/docs/examples/functions/update-deployment-build.md +14 -0
- package/docs/examples/functions/update-deployment.md +14 -0
- package/docs/examples/functions/update-variable.md +16 -0
- package/docs/examples/functions/update.md +30 -0
- package/docs/examples/graphql/mutation.md +13 -0
- package/docs/examples/graphql/query.md +13 -0
- package/docs/examples/health/get-antivirus.md +11 -0
- package/docs/examples/health/get-cache.md +11 -0
- package/docs/examples/health/get-certificate.md +13 -0
- package/docs/examples/health/get-d-b.md +11 -0
- package/docs/examples/health/get-failed-jobs.md +14 -0
- package/docs/examples/health/get-pub-sub.md +11 -0
- package/docs/examples/health/get-queue-builds.md +13 -0
- package/docs/examples/health/get-queue-certificates.md +13 -0
- package/docs/examples/health/get-queue-databases.md +14 -0
- package/docs/examples/health/get-queue-deletes.md +13 -0
- package/docs/examples/health/get-queue-functions.md +13 -0
- package/docs/examples/health/get-queue-logs.md +13 -0
- package/docs/examples/health/get-queue-mails.md +13 -0
- package/docs/examples/health/get-queue-messaging.md +13 -0
- package/docs/examples/health/get-queue-migrations.md +13 -0
- package/docs/examples/health/get-queue-usage-dump.md +13 -0
- package/docs/examples/health/get-queue-usage.md +13 -0
- package/docs/examples/health/get-queue-webhooks.md +13 -0
- package/docs/examples/health/get-queue.md +11 -0
- package/docs/examples/health/get-storage-local.md +11 -0
- package/docs/examples/health/get-storage.md +11 -0
- package/docs/examples/health/get-time.md +11 -0
- package/docs/examples/health/get.md +11 -0
- package/docs/examples/locale/get.md +11 -0
- package/docs/examples/locale/list-codes.md +11 -0
- package/docs/examples/locale/list-continents.md +11 -0
- package/docs/examples/locale/list-countries-e-u.md +11 -0
- package/docs/examples/locale/list-countries-phones.md +11 -0
- package/docs/examples/locale/list-countries.md +11 -0
- package/docs/examples/locale/list-currencies.md +11 -0
- package/docs/examples/locale/list-languages.md +11 -0
- package/docs/examples/messaging/create-apns-provider.md +20 -0
- package/docs/examples/messaging/create-email.md +24 -0
- package/docs/examples/messaging/create-fcm-provider.md +16 -0
- package/docs/examples/messaging/create-mailgun-provider.md +22 -0
- package/docs/examples/messaging/create-msg91provider.md +18 -0
- package/docs/examples/messaging/create-push.md +28 -0
- package/docs/examples/messaging/create-sendgrid-provider.md +20 -0
- package/docs/examples/messaging/create-sms.md +19 -0
- package/docs/examples/messaging/create-smtp-provider.md +26 -0
- package/docs/examples/messaging/create-subscriber.md +15 -0
- package/docs/examples/messaging/create-telesign-provider.md +18 -0
- package/docs/examples/messaging/create-textmagic-provider.md +18 -0
- package/docs/examples/messaging/create-topic.md +15 -0
- package/docs/examples/messaging/create-twilio-provider.md +18 -0
- package/docs/examples/messaging/create-vonage-provider.md +18 -0
- package/docs/examples/messaging/delete-provider.md +13 -0
- package/docs/examples/messaging/delete-subscriber.md +14 -0
- package/docs/examples/messaging/delete-topic.md +13 -0
- package/docs/examples/messaging/delete.md +13 -0
- package/docs/examples/messaging/get-message.md +13 -0
- package/docs/examples/messaging/get-provider.md +13 -0
- package/docs/examples/messaging/get-subscriber.md +14 -0
- package/docs/examples/messaging/get-topic.md +13 -0
- package/docs/examples/messaging/list-message-logs.md +14 -0
- package/docs/examples/messaging/list-messages.md +14 -0
- package/docs/examples/messaging/list-provider-logs.md +14 -0
- package/docs/examples/messaging/list-providers.md +14 -0
- package/docs/examples/messaging/list-subscriber-logs.md +14 -0
- package/docs/examples/messaging/list-subscribers.md +15 -0
- package/docs/examples/messaging/list-targets.md +14 -0
- package/docs/examples/messaging/list-topic-logs.md +14 -0
- package/docs/examples/messaging/list-topics.md +14 -0
- package/docs/examples/messaging/update-apns-provider.md +20 -0
- package/docs/examples/messaging/update-email.md +24 -0
- package/docs/examples/messaging/update-fcm-provider.md +16 -0
- package/docs/examples/messaging/update-mailgun-provider.md +22 -0
- package/docs/examples/messaging/update-msg91provider.md +18 -0
- package/docs/examples/messaging/update-push.md +28 -0
- package/docs/examples/messaging/update-sendgrid-provider.md +20 -0
- package/docs/examples/messaging/update-sms.md +19 -0
- package/docs/examples/messaging/update-smtp-provider.md +26 -0
- package/docs/examples/messaging/update-telesign-provider.md +18 -0
- package/docs/examples/messaging/update-textmagic-provider.md +18 -0
- package/docs/examples/messaging/update-topic.md +15 -0
- package/docs/examples/messaging/update-twilio-provider.md +18 -0
- package/docs/examples/messaging/update-vonage-provider.md +18 -0
- package/docs/examples/migrations/create-appwrite-migration.md +16 -0
- package/docs/examples/migrations/create-firebase-migration.md +14 -0
- package/docs/examples/migrations/create-firebase-o-auth-migration.md +14 -0
- package/docs/examples/migrations/create-n-host-migration.md +20 -0
- package/docs/examples/migrations/create-supabase-migration.md +19 -0
- package/docs/examples/migrations/delete-firebase-auth.md +11 -0
- package/docs/examples/migrations/delete.md +13 -0
- package/docs/examples/migrations/get-appwrite-report.md +16 -0
- package/docs/examples/migrations/get-firebase-report-o-auth.md +14 -0
- package/docs/examples/migrations/get-firebase-report.md +14 -0
- package/docs/examples/migrations/get-n-host-report.md +20 -0
- package/docs/examples/migrations/get-supabase-report.md +19 -0
- package/docs/examples/migrations/get.md +13 -0
- package/docs/examples/migrations/list-firebase-projects.md +11 -0
- package/docs/examples/migrations/list.md +14 -0
- package/docs/examples/migrations/retry.md +13 -0
- package/docs/examples/project/create-variable.md +14 -0
- package/docs/examples/project/delete-variable.md +13 -0
- package/docs/examples/project/get-usage.md +15 -0
- package/docs/examples/project/get-variable.md +13 -0
- package/docs/examples/project/list-variables.md +11 -0
- package/docs/examples/project/update-variable.md +15 -0
- package/docs/examples/projects/create-j-w-t.md +15 -0
- package/docs/examples/projects/create-key.md +16 -0
- package/docs/examples/projects/create-platform.md +18 -0
- package/docs/examples/projects/create-smtp-test.md +22 -0
- package/docs/examples/projects/create-webhook.md +20 -0
- package/docs/examples/projects/create.md +25 -0
- package/docs/examples/projects/delete-email-template.md +15 -0
- package/docs/examples/projects/delete-key.md +14 -0
- package/docs/examples/projects/delete-platform.md +14 -0
- package/docs/examples/projects/delete-sms-template.md +15 -0
- package/docs/examples/projects/delete-webhook.md +14 -0
- package/docs/examples/projects/delete.md +13 -0
- package/docs/examples/projects/get-email-template.md +15 -0
- package/docs/examples/projects/get-key.md +14 -0
- package/docs/examples/projects/get-platform.md +14 -0
- package/docs/examples/projects/get-sms-template.md +15 -0
- package/docs/examples/projects/get-webhook.md +14 -0
- package/docs/examples/projects/get.md +13 -0
- package/docs/examples/projects/list-keys.md +13 -0
- package/docs/examples/projects/list-platforms.md +13 -0
- package/docs/examples/projects/list-webhooks.md +13 -0
- package/docs/examples/projects/list.md +14 -0
- package/docs/examples/projects/update-api-status-all.md +14 -0
- package/docs/examples/projects/update-api-status.md +15 -0
- package/docs/examples/projects/update-auth-duration.md +14 -0
- package/docs/examples/projects/update-auth-limit.md +14 -0
- package/docs/examples/projects/update-auth-password-dictionary.md +14 -0
- package/docs/examples/projects/update-auth-password-history.md +14 -0
- package/docs/examples/projects/update-auth-sessions-limit.md +14 -0
- package/docs/examples/projects/update-auth-status.md +15 -0
- package/docs/examples/projects/update-email-template.md +20 -0
- package/docs/examples/projects/update-key.md +17 -0
- package/docs/examples/projects/update-mock-numbers.md +14 -0
- package/docs/examples/projects/update-o-auth2.md +17 -0
- package/docs/examples/projects/update-personal-data-check.md +14 -0
- package/docs/examples/projects/update-platform.md +18 -0
- package/docs/examples/projects/update-service-status-all.md +14 -0
- package/docs/examples/projects/update-service-status.md +15 -0
- package/docs/examples/projects/update-session-alerts.md +14 -0
- package/docs/examples/projects/update-sms-template.md +16 -0
- package/docs/examples/projects/update-smtp.md +22 -0
- package/docs/examples/projects/update-team.md +14 -0
- package/docs/examples/projects/update-webhook-signature.md +14 -0
- package/docs/examples/projects/update-webhook.md +21 -0
- package/docs/examples/projects/update.md +23 -0
- package/docs/examples/proxy/create-rule.md +15 -0
- package/docs/examples/proxy/delete-rule.md +13 -0
- package/docs/examples/proxy/get-rule.md +13 -0
- package/docs/examples/proxy/list-rules.md +14 -0
- package/docs/examples/proxy/update-rule-verification.md +13 -0
- package/docs/examples/storage/create-bucket.md +22 -0
- package/docs/examples/storage/create-file.md +16 -0
- package/docs/examples/storage/delete-bucket.md +13 -0
- package/docs/examples/storage/delete-file.md +14 -0
- package/docs/examples/storage/get-bucket-usage.md +14 -0
- package/docs/examples/storage/get-bucket.md +13 -0
- package/docs/examples/storage/get-file-download.md +14 -0
- package/docs/examples/storage/get-file-preview.md +25 -0
- package/docs/examples/storage/get-file-view.md +14 -0
- package/docs/examples/storage/get-file.md +14 -0
- package/docs/examples/storage/get-usage.md +13 -0
- package/docs/examples/storage/list-buckets.md +14 -0
- package/docs/examples/storage/list-files.md +15 -0
- package/docs/examples/storage/update-bucket.md +22 -0
- package/docs/examples/storage/update-file.md +16 -0
- package/docs/examples/teams/create-membership.md +19 -0
- package/docs/examples/teams/create.md +15 -0
- package/docs/examples/teams/delete-membership.md +14 -0
- package/docs/examples/teams/delete.md +13 -0
- package/docs/examples/teams/get-membership.md +14 -0
- package/docs/examples/teams/get-prefs.md +13 -0
- package/docs/examples/teams/get.md +13 -0
- package/docs/examples/teams/list-logs.md +14 -0
- package/docs/examples/teams/list-memberships.md +15 -0
- package/docs/examples/teams/list.md +14 -0
- package/docs/examples/teams/update-membership-status.md +16 -0
- package/docs/examples/teams/update-membership.md +15 -0
- package/docs/examples/teams/update-name.md +14 -0
- package/docs/examples/teams/update-prefs.md +14 -0
- package/docs/examples/users/create-argon2user.md +16 -0
- package/docs/examples/users/create-bcrypt-user.md +16 -0
- package/docs/examples/users/create-j-w-t.md +15 -0
- package/docs/examples/users/create-m-d5user.md +16 -0
- package/docs/examples/users/create-mfa-recovery-codes.md +13 -0
- package/docs/examples/users/create-p-h-pass-user.md +16 -0
- package/docs/examples/users/create-s-h-a-user.md +17 -0
- package/docs/examples/users/create-scrypt-modified-user.md +19 -0
- package/docs/examples/users/create-scrypt-user.md +21 -0
- package/docs/examples/users/create-session.md +13 -0
- package/docs/examples/users/create-target.md +18 -0
- package/docs/examples/users/create-token.md +15 -0
- package/docs/examples/users/create.md +17 -0
- package/docs/examples/users/delete-identity.md +13 -0
- package/docs/examples/users/delete-mfa-authenticator.md +14 -0
- package/docs/examples/users/delete-session.md +14 -0
- package/docs/examples/users/delete-sessions.md +13 -0
- package/docs/examples/users/delete-target.md +14 -0
- package/docs/examples/users/delete.md +13 -0
- package/docs/examples/users/get-mfa-recovery-codes.md +13 -0
- package/docs/examples/users/get-prefs.md +13 -0
- package/docs/examples/users/get-target.md +14 -0
- package/docs/examples/users/get-usage.md +13 -0
- package/docs/examples/users/get.md +13 -0
- package/docs/examples/users/list-identities.md +14 -0
- package/docs/examples/users/list-logs.md +14 -0
- package/docs/examples/users/list-memberships.md +13 -0
- package/docs/examples/users/list-mfa-factors.md +13 -0
- package/docs/examples/users/list-sessions.md +13 -0
- package/docs/examples/users/list-targets.md +14 -0
- package/docs/examples/users/list.md +14 -0
- package/docs/examples/users/update-email-verification.md +14 -0
- package/docs/examples/users/update-email.md +14 -0
- package/docs/examples/users/update-labels.md +14 -0
- package/docs/examples/users/update-mfa-recovery-codes.md +13 -0
- package/docs/examples/users/update-mfa.md +14 -0
- package/docs/examples/users/update-name.md +14 -0
- package/docs/examples/users/update-password.md +14 -0
- package/docs/examples/users/update-phone-verification.md +14 -0
- package/docs/examples/users/update-phone.md +14 -0
- package/docs/examples/users/update-prefs.md +14 -0
- package/docs/examples/users/update-status.md +14 -0
- package/docs/examples/users/update-target.md +17 -0
- package/docs/examples/vcs/create-repository-detection.md +15 -0
- package/docs/examples/vcs/create-repository.md +15 -0
- package/docs/examples/vcs/delete-installation.md +13 -0
- package/docs/examples/vcs/get-installation.md +13 -0
- package/docs/examples/vcs/get-repository-contents.md +15 -0
- package/docs/examples/vcs/get-repository.md +14 -0
- package/docs/examples/vcs/list-installations.md +14 -0
- package/docs/examples/vcs/list-repositories.md +14 -0
- package/docs/examples/vcs/list-repository-branches.md +14 -0
- package/docs/examples/vcs/update-external-deployments.md +15 -0
- package/package.json +42 -0
- package/publish.sh +4 -0
- package/rollup.config.js +27 -0
- package/src/Cache/Adapter.ts +11 -0
- package/src/Cache/Adapters/Filesystem.ts +126 -0
- package/src/Cache/Adapters/Memory.ts +57 -0
- package/src/Cache/Adapters/None.ts +36 -0
- package/src/Cache/Adapters/Redis.ts +106 -0
- package/src/Cache/Adapters/Sharding.ts +87 -0
- package/src/Cache/Cache.ts +75 -0
- package/src/Cache/index.ts +5 -0
- package/src/Cache/test.ts +0 -0
- package/src/Services.ts +41 -0
- package/src/client.ts +397 -0
- package/src/decorators/Cache.ts +102 -0
- package/src/decorators/CacheKey.ts +9 -0
- package/src/decorators/Invalidate.ts +68 -0
- package/src/enums/api-service.ts +13 -0
- package/src/enums/api.ts +5 -0
- package/src/enums/auth-method.ts +9 -0
- package/src/enums/authentication-factor.ts +6 -0
- package/src/enums/authenticator-type.ts +3 -0
- package/src/enums/browser.ts +16 -0
- package/src/enums/compression.ts +5 -0
- package/src/enums/credit-card.ts +18 -0
- package/src/enums/database-usage-range.ts +5 -0
- package/src/enums/email-template-locale.ts +133 -0
- package/src/enums/email-template-type.ts +9 -0
- package/src/enums/entities/EntityLimitType.ts +4 -0
- package/src/enums/entities/PropertyAttributeName.ts +27 -0
- package/src/enums/entities/PropertyCondition.ts +8 -0
- package/src/enums/entities/PropertyType.ts +16 -0
- package/src/enums/entities/PropertyValueType.ts +6 -0
- package/src/enums/entities/RowAccess.ts +2 -0
- package/src/enums/entities/ViewFilterCondition.ts +12 -0
- package/src/enums/execution-method.ts +8 -0
- package/src/enums/flag.ts +197 -0
- package/src/enums/function-usage-range.ts +5 -0
- package/src/enums/image-format.ts +7 -0
- package/src/enums/image-gravity.ts +11 -0
- package/src/enums/index-type.ts +5 -0
- package/src/enums/messaging-provider-type.ts +5 -0
- package/src/enums/name.ts +14 -0
- package/src/enums/o-auth-provider copy.ts +41 -0
- package/src/enums/o-auth-provider.ts +41 -0
- package/src/enums/password-hash.ts +13 -0
- package/src/enums/platform-type.ts +17 -0
- package/src/enums/project-usage-range.ts +4 -0
- package/src/enums/region.ts +4 -0
- package/src/enums/relation-mutate.ts +5 -0
- package/src/enums/relationship-type.ts +6 -0
- package/src/enums/resource-type.ts +4 -0
- package/src/enums/runtime.ts +48 -0
- package/src/enums/s-m-t-p-secure.ts +3 -0
- package/src/enums/shared/ApplicationLayout.ts +4 -0
- package/src/enums/shared/Colors.ts +24 -0
- package/src/enums/shared/InputType.ts +6 -0
- package/src/enums/shared/Periodicity.ts +7 -0
- package/src/enums/shared/SvgIcon.ts +37 -0
- package/src/enums/shared/Theme.ts +4 -0
- package/src/enums/sms-template-locale.ts +133 -0
- package/src/enums/sms-template-type.ts +6 -0
- package/src/enums/smtp-encryption.ts +5 -0
- package/src/enums/storage-usage-range.ts +5 -0
- package/src/enums/subscriptions/PricingModel.ts +14 -0
- package/src/enums/subscriptions/SubscriptionBillingPeriod.ts +15 -0
- package/src/enums/subscriptions/SubscriptionFeatureLimitType.ts +16 -0
- package/src/enums/subscriptions/SubscriptionPriceType.ts +10 -0
- package/src/enums/tenants/LinkedAccountStatus.ts +5 -0
- package/src/enums/tenants/TenantUserJoined.ts +6 -0
- package/src/enums/tenants/TenantUserStatus.ts +6 -0
- package/src/enums/tenants/TenantUserType.ts +5 -0
- package/src/enums/user-usage-range.ts +5 -0
- package/src/id.ts +47 -0
- package/src/index.ts +36 -0
- package/src/inputFile.ts +23 -0
- package/src/lib/Registry/Registry.ts +66 -0
- package/src/lib/Registry/index.ts +1 -0
- package/src/models.ts +3339 -0
- package/src/permission.ts +57 -0
- package/src/query.ts +261 -0
- package/src/role.ts +100 -0
- package/src/service-client.ts +29 -0
- package/src/service.ts +30 -0
- package/src/services/account.ts +1643 -0
- package/src/services/applets.ts +75 -0
- package/src/services/avatars.ts +314 -0
- package/src/services/community.ts +102 -0
- package/src/services/configuration.ts +15 -0
- package/src/services/databases.ts +2037 -0
- package/src/services/functions.ts +986 -0
- package/src/services/graphql.ts +75 -0
- package/src/services/health.ts +629 -0
- package/src/services/locale.ts +205 -0
- package/src/services/messaging.ts +2247 -0
- package/src/services/node.ts +15 -0
- package/src/services/permissions.ts +131 -0
- package/src/services/pricing.ts +30 -0
- package/src/services/projects.ts +1901 -0
- package/src/services/roles.ts +101 -0
- package/src/services/schema.ts +65 -0
- package/src/services/storage.ts +576 -0
- package/src/services/subscription.ts +40 -0
- package/src/services/teams.ts +490 -0
- package/src/services/tenant-subscription.ts +93 -0
- package/src/services/tenant.ts +194 -0
- package/src/services/users.ts +1584 -0
- package/tsconfig.json +29 -0
- package/types/Cache/Adapter.d.ts +10 -0
- package/types/Cache/Adapters/Filesystem.d.ts +16 -0
- package/types/Cache/Adapters/Memory.d.ts +18 -0
- package/types/Cache/Adapters/None.d.ts +12 -0
- package/types/Cache/Adapters/Redis.d.ts +14 -0
- package/types/Cache/Adapters/Sharding.d.ts +17 -0
- package/types/Cache/Cache.d.ts +16 -0
- package/types/Cache/index.d.ts +5 -0
- package/types/Cache/test.d.ts +0 -0
- package/types/Services.d.ts +6 -0
- package/types/client.d.ts +141 -0
- package/types/decorators/Cache.d.ts +1 -0
- package/types/decorators/CacheKey.d.ts +1 -0
- package/types/decorators/Invalidate.d.ts +1 -0
- package/types/enums/api-service.d.ts +13 -0
- package/types/enums/api.d.ts +5 -0
- package/types/enums/auth-method.d.ts +9 -0
- package/types/enums/authentication-factor.d.ts +6 -0
- package/types/enums/authenticator-type.d.ts +3 -0
- package/types/enums/browser.d.ts +16 -0
- package/types/enums/compression.d.ts +5 -0
- package/types/enums/credit-card.d.ts +18 -0
- package/types/enums/database-usage-range.d.ts +5 -0
- package/types/enums/email-template-locale.d.ts +133 -0
- package/types/enums/email-template-type.d.ts +9 -0
- package/types/enums/entities/EntityLimitType.d.ts +4 -0
- package/types/enums/entities/PropertyAttributeName.d.ts +27 -0
- package/types/enums/entities/PropertyCondition.d.ts +7 -0
- package/types/enums/entities/PropertyType.d.ts +12 -0
- package/types/enums/entities/PropertyValueType.d.ts +6 -0
- package/types/enums/entities/RowAccess.d.ts +2 -0
- package/types/enums/entities/ViewFilterCondition.d.ts +12 -0
- package/types/enums/execution-method.d.ts +8 -0
- package/types/enums/flag.d.ts +197 -0
- package/types/enums/function-usage-range.d.ts +5 -0
- package/types/enums/image-format.d.ts +7 -0
- package/types/enums/image-gravity.d.ts +11 -0
- package/types/enums/index-type.d.ts +5 -0
- package/types/enums/messaging-provider-type.d.ts +5 -0
- package/types/enums/name.d.ts +14 -0
- package/types/enums/o-auth-provider copy.d.ts +41 -0
- package/types/enums/o-auth-provider.d.ts +41 -0
- package/types/enums/password-hash.d.ts +13 -0
- package/types/enums/platform-type.d.ts +17 -0
- package/types/enums/project-usage-range.d.ts +4 -0
- package/types/enums/region.d.ts +4 -0
- package/types/enums/relation-mutate.d.ts +5 -0
- package/types/enums/relationship-type.d.ts +6 -0
- package/types/enums/resource-type.d.ts +4 -0
- package/types/enums/runtime.d.ts +48 -0
- package/types/enums/s-m-t-p-secure.d.ts +3 -0
- package/types/enums/shared/ApplicationLayout.d.ts +4 -0
- package/types/enums/shared/Colors.d.ts +24 -0
- package/types/enums/shared/InputType.d.ts +6 -0
- package/types/enums/shared/Periodicity.d.ts +7 -0
- package/types/enums/shared/SvgIcon.d.ts +37 -0
- package/types/enums/shared/Theme.d.ts +4 -0
- package/types/enums/sms-template-locale.d.ts +133 -0
- package/types/enums/sms-template-type.d.ts +6 -0
- package/types/enums/smtp-encryption.d.ts +5 -0
- package/types/enums/storage-usage-range.d.ts +5 -0
- package/types/enums/subscriptions/PricingModel.d.ts +11 -0
- package/types/enums/subscriptions/SubscriptionBillingPeriod.d.ts +10 -0
- package/types/enums/subscriptions/SubscriptionFeatureLimitType.d.ts +10 -0
- package/types/enums/subscriptions/SubscriptionPriceType.d.ts +7 -0
- package/types/enums/tenants/LinkedAccountStatus.d.ts +5 -0
- package/types/enums/tenants/TenantUserJoined.d.ts +6 -0
- package/types/enums/tenants/TenantUserStatus.d.ts +6 -0
- package/types/enums/tenants/TenantUserType.d.ts +5 -0
- package/types/enums/user-usage-range.d.ts +5 -0
- package/types/id.d.ts +20 -0
- package/types/index.d.ts +36 -0
- package/types/inputFile.d.ts +6 -0
- package/types/lib/Registry/Registry.d.ts +38 -0
- package/types/lib/Registry/index.d.ts +1 -0
- package/types/models.d.ts +3272 -0
- package/types/permission.d.ts +43 -0
- package/types/query.d.ts +194 -0
- package/types/role.d.ts +70 -0
- package/types/service-client.d.ts +7 -0
- package/types/service.d.ts +11 -0
- package/types/services/account.d.ts +530 -0
- package/types/services/acl.d.ts +28 -0
- package/types/services/applets.d.ts +9 -0
- package/types/services/assistant.d.ts +14 -0
- package/types/services/avatars.d.ts +115 -0
- package/types/services/community.d.ts +19 -0
- package/types/services/configuration.d.ts +5 -0
- package/types/services/console.d.ts +15 -0
- package/types/services/databases.d.ts +613 -0
- package/types/services/functions.d.ts +319 -0
- package/types/services/graphql.d.ts +25 -0
- package/types/services/health.d.ts +231 -0
- package/types/services/locale.d.ts +80 -0
- package/types/services/messaging.d.ts +685 -0
- package/types/services/migrations.d.ts +185 -0
- package/types/services/node.d.ts +5 -0
- package/types/services/permissions.d.ts +20 -0
- package/types/services/pricing.d.ts +15 -0
- package/types/services/project.d.ts +70 -0
- package/types/services/projects.d.ts +542 -0
- package/types/services/proxy.d.ts +59 -0
- package/types/services/roles.d.ts +19 -0
- package/types/services/schema.d.ts +17 -0
- package/types/services/storage.d.ts +189 -0
- package/types/services/subscription-product.d.ts +77 -0
- package/types/services/subscription.d.ts +15 -0
- package/types/services/teams.d.ts +167 -0
- package/types/services/tenant-subscription.d.ts +12 -0
- package/types/services/tenant.d.ts +32 -0
- package/types/services/users.d.ts +499 -0
- package/types/services/vcs.d.ts +108 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Client, Users } from "@appconda.io/console";
|
2
|
+
|
3
|
+
const client = new Client()
|
4
|
+
.setEndpoint('https://cloud.appconda.io/v1') // Your API Endpoint
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
6
|
+
|
7
|
+
const users = new Users(client);
|
8
|
+
|
9
|
+
const result = await users.updatePhoneVerification(
|
10
|
+
'<USER_ID>', // userId
|
11
|
+
false // phoneVerification
|
12
|
+
);
|
13
|
+
|
14
|
+
console.log(result);
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Client, Users } from "@appconda.io/console";
|
2
|
+
|
3
|
+
const client = new Client()
|
4
|
+
.setEndpoint('https://cloud.appconda.io/v1') // Your API Endpoint
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
6
|
+
|
7
|
+
const users = new Users(client);
|
8
|
+
|
9
|
+
const result = await users.updatePhone(
|
10
|
+
'<USER_ID>', // userId
|
11
|
+
'+12065550100' // number
|
12
|
+
);
|
13
|
+
|
14
|
+
console.log(result);
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Client, Users } from "@appconda.io/console";
|
2
|
+
|
3
|
+
const client = new Client()
|
4
|
+
.setEndpoint('https://cloud.appconda.io/v1') // Your API Endpoint
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
6
|
+
|
7
|
+
const users = new Users(client);
|
8
|
+
|
9
|
+
const result = await users.updatePrefs(
|
10
|
+
'<USER_ID>', // userId
|
11
|
+
{} // prefs
|
12
|
+
);
|
13
|
+
|
14
|
+
console.log(result);
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Client, Users } from "@appconda.io/console";
|
2
|
+
|
3
|
+
const client = new Client()
|
4
|
+
.setEndpoint('https://cloud.appconda.io/v1') // Your API Endpoint
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
6
|
+
|
7
|
+
const users = new Users(client);
|
8
|
+
|
9
|
+
const result = await users.updateStatus(
|
10
|
+
'<USER_ID>', // userId
|
11
|
+
false // status
|
12
|
+
);
|
13
|
+
|
14
|
+
console.log(result);
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { Client, Users } from "@appconda.io/console";
|
2
|
+
|
3
|
+
const client = new Client()
|
4
|
+
.setEndpoint('https://cloud.appconda.io/v1') // Your API Endpoint
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
6
|
+
|
7
|
+
const users = new Users(client);
|
8
|
+
|
9
|
+
const result = await users.updateTarget(
|
10
|
+
'<USER_ID>', // userId
|
11
|
+
'<TARGET_ID>', // targetId
|
12
|
+
'<IDENTIFIER>', // identifier (optional)
|
13
|
+
'<PROVIDER_ID>', // providerId (optional)
|
14
|
+
'<NAME>' // name (optional)
|
15
|
+
);
|
16
|
+
|
17
|
+
console.log(result);
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { Client, Vcs } from "@appconda.io/console";
|
2
|
+
|
3
|
+
const client = new Client()
|
4
|
+
.setEndpoint('https://cloud.appconda.io/v1') // Your API Endpoint
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
6
|
+
|
7
|
+
const vcs = new Vcs(client);
|
8
|
+
|
9
|
+
const result = await vcs.createRepositoryDetection(
|
10
|
+
'<INSTALLATION_ID>', // installationId
|
11
|
+
'<PROVIDER_REPOSITORY_ID>', // providerRepositoryId
|
12
|
+
'<PROVIDER_ROOT_DIRECTORY>' // providerRootDirectory (optional)
|
13
|
+
);
|
14
|
+
|
15
|
+
console.log(result);
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { Client, Vcs } from "@appconda.io/console";
|
2
|
+
|
3
|
+
const client = new Client()
|
4
|
+
.setEndpoint('https://cloud.appconda.io/v1') // Your API Endpoint
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
6
|
+
|
7
|
+
const vcs = new Vcs(client);
|
8
|
+
|
9
|
+
const result = await vcs.createRepository(
|
10
|
+
'<INSTALLATION_ID>', // installationId
|
11
|
+
'<NAME>', // name
|
12
|
+
false // private
|
13
|
+
);
|
14
|
+
|
15
|
+
console.log(result);
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { Client, Vcs } from "@appconda.io/console";
|
2
|
+
|
3
|
+
const client = new Client()
|
4
|
+
.setEndpoint('https://cloud.appconda.io/v1') // Your API Endpoint
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
6
|
+
|
7
|
+
const vcs = new Vcs(client);
|
8
|
+
|
9
|
+
const result = await vcs.deleteInstallation(
|
10
|
+
'<INSTALLATION_ID>' // installationId
|
11
|
+
);
|
12
|
+
|
13
|
+
console.log(result);
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { Client, Vcs } from "@appconda.io/console";
|
2
|
+
|
3
|
+
const client = new Client()
|
4
|
+
.setEndpoint('https://cloud.appconda.io/v1') // Your API Endpoint
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
6
|
+
|
7
|
+
const vcs = new Vcs(client);
|
8
|
+
|
9
|
+
const result = await vcs.getInstallation(
|
10
|
+
'<INSTALLATION_ID>' // installationId
|
11
|
+
);
|
12
|
+
|
13
|
+
console.log(result);
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { Client, Vcs } from "@appconda.io/console";
|
2
|
+
|
3
|
+
const client = new Client()
|
4
|
+
.setEndpoint('https://cloud.appconda.io/v1') // Your API Endpoint
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
6
|
+
|
7
|
+
const vcs = new Vcs(client);
|
8
|
+
|
9
|
+
const result = await vcs.getRepositoryContents(
|
10
|
+
'<INSTALLATION_ID>', // installationId
|
11
|
+
'<PROVIDER_REPOSITORY_ID>', // providerRepositoryId
|
12
|
+
'<PROVIDER_ROOT_DIRECTORY>' // providerRootDirectory (optional)
|
13
|
+
);
|
14
|
+
|
15
|
+
console.log(result);
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Client, Vcs } from "@appconda.io/console";
|
2
|
+
|
3
|
+
const client = new Client()
|
4
|
+
.setEndpoint('https://cloud.appconda.io/v1') // Your API Endpoint
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
6
|
+
|
7
|
+
const vcs = new Vcs(client);
|
8
|
+
|
9
|
+
const result = await vcs.getRepository(
|
10
|
+
'<INSTALLATION_ID>', // installationId
|
11
|
+
'<PROVIDER_REPOSITORY_ID>' // providerRepositoryId
|
12
|
+
);
|
13
|
+
|
14
|
+
console.log(result);
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Client, Vcs } from "@appconda.io/console";
|
2
|
+
|
3
|
+
const client = new Client()
|
4
|
+
.setEndpoint('https://cloud.appconda.io/v1') // Your API Endpoint
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
6
|
+
|
7
|
+
const vcs = new Vcs(client);
|
8
|
+
|
9
|
+
const result = await vcs.listInstallations(
|
10
|
+
[], // queries (optional)
|
11
|
+
'<SEARCH>' // search (optional)
|
12
|
+
);
|
13
|
+
|
14
|
+
console.log(result);
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Client, Vcs } from "@appconda.io/console";
|
2
|
+
|
3
|
+
const client = new Client()
|
4
|
+
.setEndpoint('https://cloud.appconda.io/v1') // Your API Endpoint
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
6
|
+
|
7
|
+
const vcs = new Vcs(client);
|
8
|
+
|
9
|
+
const result = await vcs.listRepositories(
|
10
|
+
'<INSTALLATION_ID>', // installationId
|
11
|
+
'<SEARCH>' // search (optional)
|
12
|
+
);
|
13
|
+
|
14
|
+
console.log(result);
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Client, Vcs } from "@appconda.io/console";
|
2
|
+
|
3
|
+
const client = new Client()
|
4
|
+
.setEndpoint('https://cloud.appconda.io/v1') // Your API Endpoint
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
6
|
+
|
7
|
+
const vcs = new Vcs(client);
|
8
|
+
|
9
|
+
const result = await vcs.listRepositoryBranches(
|
10
|
+
'<INSTALLATION_ID>', // installationId
|
11
|
+
'<PROVIDER_REPOSITORY_ID>' // providerRepositoryId
|
12
|
+
);
|
13
|
+
|
14
|
+
console.log(result);
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { Client, Vcs } from "@appconda.io/console";
|
2
|
+
|
3
|
+
const client = new Client()
|
4
|
+
.setEndpoint('https://cloud.appconda.io/v1') // Your API Endpoint
|
5
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
6
|
+
|
7
|
+
const vcs = new Vcs(client);
|
8
|
+
|
9
|
+
const result = await vcs.updateExternalDeployments(
|
10
|
+
'<INSTALLATION_ID>', // installationId
|
11
|
+
'<REPOSITORY_ID>', // repositoryId
|
12
|
+
'<PROVIDER_PULL_REQUEST_ID>' // providerPullRequestId
|
13
|
+
);
|
14
|
+
|
15
|
+
console.log(result);
|
package/package.json
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
{
|
2
|
+
"name": "@appconda/nextjs",
|
3
|
+
"homepage": "https://appconda.io/support",
|
4
|
+
"description": "Appconda is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
|
5
|
+
"version": "1.0.12",
|
6
|
+
"license": "BSD-3-Clause",
|
7
|
+
"main": "dist/cjs/sdk.js",
|
8
|
+
"exports": {
|
9
|
+
".": {
|
10
|
+
"import": "./dist/esm/sdk.js",
|
11
|
+
"require": "./dist/cjs/sdk.js",
|
12
|
+
"types": "./types/index.d.ts"
|
13
|
+
},
|
14
|
+
"./package.json": "./package.json"
|
15
|
+
},
|
16
|
+
"module": "dist/esm/sdk.js",
|
17
|
+
"types": "types/index.d.ts",
|
18
|
+
"repository": {
|
19
|
+
"type": "git",
|
20
|
+
"url": "https://github.com/appconda/sdk-for-console"
|
21
|
+
},
|
22
|
+
"scripts": {
|
23
|
+
"build": "npm run build:types && npm run build:libs",
|
24
|
+
"build:types": "tsc --declaration --emitDeclarationOnly --outDir types",
|
25
|
+
"build:libs": "rollup -c"
|
26
|
+
},
|
27
|
+
"devDependencies": {
|
28
|
+
"@rollup/plugin-typescript": "8.3.2",
|
29
|
+
"playwright": "1.15.0",
|
30
|
+
"rollup": "2.75.4",
|
31
|
+
"serve-handler": "6.1.0",
|
32
|
+
"tslib": "2.4.0",
|
33
|
+
"typescript": "^5.6.3"
|
34
|
+
},
|
35
|
+
"jsdelivr": "dist/iife/sdk.js",
|
36
|
+
"unpkg": "dist/iife/sdk.js",
|
37
|
+
"dependencies": {
|
38
|
+
"node-fetch-native-with-agent": "^1.7.2",
|
39
|
+
"redis": "^4.7.0",
|
40
|
+
"zod": "^3.24.2"
|
41
|
+
}
|
42
|
+
}
|
package/publish.sh
ADDED
package/rollup.config.js
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
import pkg from "./package.json";
|
2
|
+
import typescript from "@rollup/plugin-typescript";
|
3
|
+
|
4
|
+
export default {
|
5
|
+
external: Object.keys(pkg.dependencies ?? {}),
|
6
|
+
input: "src/index.ts",
|
7
|
+
plugins: [typescript()],
|
8
|
+
output: [
|
9
|
+
{
|
10
|
+
format: "cjs",
|
11
|
+
file: pkg.main,
|
12
|
+
esModule: false,
|
13
|
+
sourcemap: true,
|
14
|
+
},
|
15
|
+
{
|
16
|
+
format: "es",
|
17
|
+
file: pkg.module,
|
18
|
+
sourcemap: true,
|
19
|
+
},
|
20
|
+
{
|
21
|
+
format: "iife",
|
22
|
+
file: pkg.jsdelivr,
|
23
|
+
name: "Appconda",
|
24
|
+
extend: true,
|
25
|
+
},
|
26
|
+
],
|
27
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
|
2
|
+
export interface Adapter {
|
3
|
+
load(key: string, ttl: number, hash?: string): Promise<any>;
|
4
|
+
save(key: string, data: any, hash?: string): Promise<boolean | string | any[]>;
|
5
|
+
list(key: string): Promise<string[]>;
|
6
|
+
purge(key: string, hash?: string): Promise<boolean>;
|
7
|
+
flush(): Promise<boolean>;
|
8
|
+
ping(): Promise<boolean>;
|
9
|
+
getSize(): Promise<number>;
|
10
|
+
delWithStart(pattern: string): Promise<number>;
|
11
|
+
}
|
@@ -0,0 +1,126 @@
|
|
1
|
+
import { Adapter } from "../Adapter";
|
2
|
+
const fs = require('fs');
|
3
|
+
const path = require('path');
|
4
|
+
const glob = require('glob');
|
5
|
+
|
6
|
+
export class Filesystem implements Adapter {
|
7
|
+
protected path: string = '';
|
8
|
+
|
9
|
+
constructor(path: string) {
|
10
|
+
this.path = path;
|
11
|
+
}
|
12
|
+
delWithStart(pattern: string): Promise<number> {
|
13
|
+
throw new Error("Method not implemented.");
|
14
|
+
}
|
15
|
+
|
16
|
+
async load(key: string, ttl: number, hash: string = ''): Promise<any> {
|
17
|
+
const file = this.getPath(key);
|
18
|
+
|
19
|
+
if (fs.existsSync(file) && (fs.statSync(file).mtime.getTime() + ttl * 1000 > Date.now())) {
|
20
|
+
return fs.readFileSync(file, 'utf8');
|
21
|
+
}
|
22
|
+
|
23
|
+
return false;
|
24
|
+
}
|
25
|
+
|
26
|
+
async save(key: string, data: any, hash: string = ''): Promise<boolean | string | any[]> {
|
27
|
+
if (!data) {
|
28
|
+
return false;
|
29
|
+
}
|
30
|
+
|
31
|
+
const file = this.getPath(key);
|
32
|
+
const dir = path.dirname(file);
|
33
|
+
|
34
|
+
try {
|
35
|
+
if (!fs.existsSync(dir)) {
|
36
|
+
fs.mkdirSync(dir, { recursive: true });
|
37
|
+
}
|
38
|
+
|
39
|
+
fs.writeFileSync(file, data, { flag: 'w' });
|
40
|
+
return data;
|
41
|
+
} catch (e: any) {
|
42
|
+
throw new Error(e.message);
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
async list(key: string): Promise<string[]> {
|
47
|
+
return [];
|
48
|
+
}
|
49
|
+
|
50
|
+
async purge(key: string, hash: string = ''): Promise<boolean> {
|
51
|
+
const file = this.getPath(key);
|
52
|
+
|
53
|
+
if (fs.existsSync(file)) {
|
54
|
+
fs.unlinkSync(file);
|
55
|
+
return true;
|
56
|
+
}
|
57
|
+
|
58
|
+
return false;
|
59
|
+
}
|
60
|
+
|
61
|
+
async flush(): Promise<boolean> {
|
62
|
+
return this.deleteDirectory(this.path);
|
63
|
+
}
|
64
|
+
|
65
|
+
async ping(): Promise<boolean> {
|
66
|
+
return fs.existsSync(this.path) && fs.accessSync(this.path, fs.constants.W_OK | fs.constants.R_OK);
|
67
|
+
}
|
68
|
+
|
69
|
+
async getSize(): Promise<number> {
|
70
|
+
try {
|
71
|
+
return this.getDirectorySize(path.dirname(this.path));
|
72
|
+
} catch {
|
73
|
+
return 0;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
private getDirectorySize(dir: string): number {
|
78
|
+
let size = 0;
|
79
|
+
const normalizedPath = path.join(dir, '*');
|
80
|
+
|
81
|
+
const paths = glob.sync(normalizedPath, { nodir: false });
|
82
|
+
if (!paths) {
|
83
|
+
return size;
|
84
|
+
}
|
85
|
+
|
86
|
+
for (const p of paths) {
|
87
|
+
if (fs.statSync(p).isFile()) {
|
88
|
+
size += fs.statSync(p).size;
|
89
|
+
} else if (fs.statSync(p).isDirectory()) {
|
90
|
+
size += this.getDirectorySize(p);
|
91
|
+
}
|
92
|
+
}
|
93
|
+
|
94
|
+
return size;
|
95
|
+
}
|
96
|
+
|
97
|
+
getPath(filename: string): string {
|
98
|
+
return path.join(this.path, filename);
|
99
|
+
}
|
100
|
+
|
101
|
+
protected deleteDirectory(dirPath: string): boolean {
|
102
|
+
if (!fs.statSync(dirPath).isDirectory()) {
|
103
|
+
throw new Error(`${dirPath} must be a directory`);
|
104
|
+
}
|
105
|
+
|
106
|
+
if (!dirPath.endsWith('/')) {
|
107
|
+
dirPath += '/';
|
108
|
+
}
|
109
|
+
|
110
|
+
const files = glob.sync(dirPath + '*', { mark: true });
|
111
|
+
|
112
|
+
if (!files) {
|
113
|
+
throw new Error('Error happened during glob');
|
114
|
+
}
|
115
|
+
|
116
|
+
for (const file of files) {
|
117
|
+
if (fs.statSync(file).isDirectory()) {
|
118
|
+
this.deleteDirectory(file);
|
119
|
+
} else {
|
120
|
+
fs.unlinkSync(file);
|
121
|
+
}
|
122
|
+
}
|
123
|
+
|
124
|
+
return fs.rmdirSync(dirPath);
|
125
|
+
}
|
126
|
+
}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import { Adapter } from "../Adapter";
|
2
|
+
|
3
|
+
export class Memory implements Adapter {
|
4
|
+
public store: { [key: string]: { time: number, data: any } } = {};
|
5
|
+
|
6
|
+
constructor() {}
|
7
|
+
delWithStart(pattern: string): Promise<number> {
|
8
|
+
throw new Error("Method not implemented.");
|
9
|
+
}
|
10
|
+
|
11
|
+
async load(key: string, ttl: number, hash: string = ''): Promise<any> {
|
12
|
+
if (key && this.store[key]) {
|
13
|
+
const saved = this.store[key];
|
14
|
+
return (saved.time + ttl > Date.now() / 1000) ? saved.data : false;
|
15
|
+
}
|
16
|
+
return false;
|
17
|
+
}
|
18
|
+
|
19
|
+
async save(key: string, data: any, hash: string = ''): Promise<boolean | string | any[]> {
|
20
|
+
if (!key || !data) {
|
21
|
+
return false;
|
22
|
+
}
|
23
|
+
|
24
|
+
const saved = {
|
25
|
+
time: Date.now() / 1000,
|
26
|
+
data: data,
|
27
|
+
};
|
28
|
+
|
29
|
+
this.store[key] = saved;
|
30
|
+
return data;
|
31
|
+
}
|
32
|
+
|
33
|
+
async list(key: string): Promise<string[]> {
|
34
|
+
return [];
|
35
|
+
}
|
36
|
+
|
37
|
+
async purge(key: string, hash: string = ''): Promise<boolean> {
|
38
|
+
if (key && this.store[key]) {
|
39
|
+
delete this.store[key];
|
40
|
+
return true;
|
41
|
+
}
|
42
|
+
return false;
|
43
|
+
}
|
44
|
+
|
45
|
+
async flush(): Promise<boolean> {
|
46
|
+
this.store = {};
|
47
|
+
return true;
|
48
|
+
}
|
49
|
+
|
50
|
+
async ping(): Promise<boolean> {
|
51
|
+
return true;
|
52
|
+
}
|
53
|
+
|
54
|
+
async getSize(): Promise<number> {
|
55
|
+
return Object.keys(this.store).length;
|
56
|
+
}
|
57
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { Adapter } from "../Adapter";
|
2
|
+
|
3
|
+
export class None implements Adapter {
|
4
|
+
constructor() {}
|
5
|
+
delWithStart(pattern: string): Promise<number> {
|
6
|
+
throw new Error("Method not implemented.");
|
7
|
+
}
|
8
|
+
|
9
|
+
async load(key: string, ttl: number, hash: string = ''): Promise<any> {
|
10
|
+
return false;
|
11
|
+
}
|
12
|
+
|
13
|
+
async save(key: string, data: any, hash: string = ''): Promise<boolean | string | any[]> {
|
14
|
+
return false;
|
15
|
+
}
|
16
|
+
|
17
|
+
async list(key: string): Promise<string[]> {
|
18
|
+
return [];
|
19
|
+
}
|
20
|
+
|
21
|
+
async purge(key: string, hash: string = ''): Promise<boolean> {
|
22
|
+
return true;
|
23
|
+
}
|
24
|
+
|
25
|
+
async flush(): Promise<boolean> {
|
26
|
+
return true;
|
27
|
+
}
|
28
|
+
|
29
|
+
async ping(): Promise<boolean> {
|
30
|
+
return true;
|
31
|
+
}
|
32
|
+
|
33
|
+
async getSize(): Promise<number> {
|
34
|
+
return 0;
|
35
|
+
}
|
36
|
+
}
|
@@ -0,0 +1,106 @@
|
|
1
|
+
import { RedisClientType, } from 'redis';
|
2
|
+
import { Adapter } from "../Adapter";
|
3
|
+
|
4
|
+
|
5
|
+
export class Redis implements Adapter {
|
6
|
+
protected redis: RedisClientType;
|
7
|
+
|
8
|
+
constructor(redis: RedisClientType) {
|
9
|
+
this.redis = redis;
|
10
|
+
}
|
11
|
+
|
12
|
+
async load(key: string, ttl: number, hash: string = ''): Promise<any> {
|
13
|
+
if (!hash) {
|
14
|
+
hash = key;
|
15
|
+
}
|
16
|
+
|
17
|
+
return new Promise((resolve) => {
|
18
|
+
try {
|
19
|
+
this.redis.get(key).then((redisString) => {
|
20
|
+
if (!redisString) {
|
21
|
+
resolve(null);
|
22
|
+
}
|
23
|
+
|
24
|
+
const cache = JSON.parse(redisString);
|
25
|
+
if (cache != null && cache.time + ttl > Date.now() / 1000) {
|
26
|
+
resolve(cache.data);
|
27
|
+
} else {
|
28
|
+
resolve(null);
|
29
|
+
}
|
30
|
+
})
|
31
|
+
.catch((e) => {
|
32
|
+
console.error('redis error');
|
33
|
+
})
|
34
|
+
}
|
35
|
+
catch (e) {
|
36
|
+
console.error('redis error');
|
37
|
+
}
|
38
|
+
})
|
39
|
+
}
|
40
|
+
|
41
|
+
async save(key: string, data: any, hash: string = ''): Promise<boolean | string | any[]> {
|
42
|
+
if (!key || !data) {
|
43
|
+
return Promise.resolve(false);
|
44
|
+
}
|
45
|
+
|
46
|
+
if (!hash) {
|
47
|
+
hash = key;
|
48
|
+
}
|
49
|
+
|
50
|
+
const value = JSON.stringify({
|
51
|
+
time: Date.now() / 1000,
|
52
|
+
data: data,
|
53
|
+
});
|
54
|
+
|
55
|
+
return this.redis.set(key, value).then(() => data).catch(() => false);
|
56
|
+
}
|
57
|
+
|
58
|
+
list(key: string): Promise<string[]> {
|
59
|
+
|
60
|
+
return this.redis.hKeys(key).then((keys) => keys || []);
|
61
|
+
}
|
62
|
+
|
63
|
+
async purge(key: string, hash: string = ''): Promise<boolean> {
|
64
|
+
if (hash) {
|
65
|
+
return this.redis.del(key).then((result) => !!result);
|
66
|
+
}
|
67
|
+
|
68
|
+
const result = await this.redis.del(key);
|
69
|
+
|
70
|
+
return !!result;
|
71
|
+
}
|
72
|
+
|
73
|
+
flush(): Promise<boolean> {
|
74
|
+
//@ts-ignore
|
75
|
+
return this.redis.flushall().then(() => true);
|
76
|
+
}
|
77
|
+
|
78
|
+
ping(): Promise<boolean> {
|
79
|
+
return this.redis.ping().then(() => true).catch(() => false);
|
80
|
+
}
|
81
|
+
|
82
|
+
getSize(): Promise<number> {
|
83
|
+
//@ts-ignore
|
84
|
+
return this.redis.dbsize();
|
85
|
+
}
|
86
|
+
|
87
|
+
async delWithStart(pattern: string): Promise<number> {
|
88
|
+
|
89
|
+
let cur = 0;
|
90
|
+
let totalDeleted = 0;
|
91
|
+
|
92
|
+
do {
|
93
|
+
const {cursor, keys} = await this.redis.scan(cur, {
|
94
|
+
MATCH: `${pattern}:*`,
|
95
|
+
COUNT: 100, // Her taramada maksimum 100 anahtar döndür
|
96
|
+
}) as any;
|
97
|
+
|
98
|
+
|
99
|
+
cur = Number(cursor);
|
100
|
+
|
101
|
+
await Promise.all(keys.map ((key: string) => this.redis.del(key)))
|
102
|
+
} while (cur !== 0);
|
103
|
+
|
104
|
+
return totalDeleted;
|
105
|
+
}
|
106
|
+
}
|