@gorth-io/structure 0.0.0-alpha.10
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 +21 -0
- package/README.md +83 -0
- package/dist/cores/ably/ai-transport/index.cjs +1 -0
- package/dist/cores/ably/ai-transport/index.d.cts +1 -0
- package/dist/cores/ably/ai-transport/index.d.ts +1 -0
- package/dist/cores/ably/ai-transport/index.js +1 -0
- package/dist/cores/ably/ai-transport/react/index.cjs +1 -0
- package/dist/cores/ably/ai-transport/react/index.d.cts +1 -0
- package/dist/cores/ably/ai-transport/react/index.d.ts +1 -0
- package/dist/cores/ably/ai-transport/react/index.js +1 -0
- package/dist/cores/ably/chat/index.cjs +1 -0
- package/dist/cores/ably/chat/index.d.cts +1 -0
- package/dist/cores/ably/chat/index.d.ts +1 -0
- package/dist/cores/ably/chat/index.js +1 -0
- package/dist/cores/ably/chat/react/index.cjs +1 -0
- package/dist/cores/ably/chat/react/index.d.cts +1 -0
- package/dist/cores/ably/chat/react/index.d.ts +1 -0
- package/dist/cores/ably/chat/react/index.js +1 -0
- package/dist/cores/ably/index.cjs +1 -0
- package/dist/cores/ably/index.d.cts +1 -0
- package/dist/cores/ably/index.d.ts +1 -0
- package/dist/cores/ably/index.js +1 -0
- package/dist/cores/ably/liveobjects/index.cjs +1 -0
- package/dist/cores/ably/liveobjects/index.d.cts +1 -0
- package/dist/cores/ably/liveobjects/index.d.ts +1 -0
- package/dist/cores/ably/liveobjects/index.js +1 -0
- package/dist/cores/ably/liveobjects/react/index.cjs +1 -0
- package/dist/cores/ably/liveobjects/react/index.d.cts +1 -0
- package/dist/cores/ably/liveobjects/react/index.d.ts +1 -0
- package/dist/cores/ably/liveobjects/react/index.js +1 -0
- package/dist/cores/ably/modular/index.cjs +1 -0
- package/dist/cores/ably/modular/index.d.cts +1 -0
- package/dist/cores/ably/modular/index.d.ts +1 -0
- package/dist/cores/ably/modular/index.js +1 -0
- package/dist/cores/ably/push/index.cjs +1 -0
- package/dist/cores/ably/push/index.d.cts +2 -0
- package/dist/cores/ably/push/index.d.ts +2 -0
- package/dist/cores/ably/push/index.js +1 -0
- package/dist/cores/ably/react/index.cjs +1 -0
- package/dist/cores/ably/react/index.d.cts +1 -0
- package/dist/cores/ably/react/index.d.ts +1 -0
- package/dist/cores/ably/react/index.js +1 -0
- package/dist/cores/ably/spaces/index.cjs +1 -0
- package/dist/cores/ably/spaces/index.d.cts +1 -0
- package/dist/cores/ably/spaces/index.d.ts +1 -0
- package/dist/cores/ably/spaces/index.js +1 -0
- package/dist/cores/axios.cjs +1 -0
- package/dist/cores/axios.d.cts +3 -0
- package/dist/cores/axios.d.ts +3 -0
- package/dist/cores/axios.js +1 -0
- package/dist/cores/graphql/index.cjs +1 -0
- package/dist/cores/graphql/index.d.cts +1 -0
- package/dist/cores/graphql/index.d.ts +1 -0
- package/dist/cores/graphql/index.js +1 -0
- package/dist/cores/graphql/request.cjs +1 -0
- package/dist/cores/graphql/request.d.cts +1 -0
- package/dist/cores/graphql/request.d.ts +1 -0
- package/dist/cores/graphql/request.js +1 -0
- package/dist/cores/graphql/tag.cjs +1 -0
- package/dist/cores/graphql/tag.d.cts +1 -0
- package/dist/cores/graphql/tag.d.ts +1 -0
- package/dist/cores/graphql/tag.js +1 -0
- package/dist/cores/index.cjs +0 -0
- package/dist/cores/index.d.cts +1 -0
- package/dist/cores/index.d.ts +1 -0
- package/dist/cores/index.js +1 -0
- package/dist/cores/jose.cjs +1 -0
- package/dist/cores/jose.d.cts +1 -0
- package/dist/cores/jose.d.ts +1 -0
- package/dist/cores/jose.js +1 -0
- package/dist/cores/pg.cjs +1 -0
- package/dist/cores/pg.d.cts +3 -0
- package/dist/cores/pg.d.ts +3 -0
- package/dist/cores/pg.js +2 -0
- package/dist/cores/pg.js.map +1 -0
- package/dist/cores/postgres.cjs +1 -0
- package/dist/cores/postgres.d.cts +2 -0
- package/dist/cores/postgres.d.ts +2 -0
- package/dist/cores/postgres.js +2 -0
- package/dist/cores/postgres.js.map +1 -0
- package/dist/cores/supabase/index.cjs +1 -0
- package/dist/cores/supabase/index.d.cts +1 -0
- package/dist/cores/supabase/index.d.ts +1 -0
- package/dist/cores/supabase/index.js +1 -0
- package/dist/cores/supabase/postgrest.cjs +1 -0
- package/dist/cores/supabase/postgrest.d.cts +1 -0
- package/dist/cores/supabase/postgrest.d.ts +1 -0
- package/dist/cores/supabase/postgrest.js +1 -0
- package/dist/cores/supabase/server.cjs +1 -0
- package/dist/cores/supabase/server.d.cts +1 -0
- package/dist/cores/supabase/server.d.ts +1 -0
- package/dist/cores/supabase/server.js +1 -0
- package/dist/cores/supabase/ssr.cjs +1 -0
- package/dist/cores/supabase/ssr.d.cts +1 -0
- package/dist/cores/supabase/ssr.d.ts +1 -0
- package/dist/cores/supabase/ssr.js +1 -0
- package/dist/cores/uuid.cjs +1 -0
- package/dist/cores/uuid.d.cts +1 -0
- package/dist/cores/uuid.d.ts +1 -0
- package/dist/cores/uuid.js +1 -0
- package/dist/cores/zod.cjs +1 -0
- package/dist/cores/zod.d.cts +3 -0
- package/dist/cores/zod.d.ts +3 -0
- package/dist/cores/zod.js +1 -0
- package/dist/formatter-vjbCoK9k.d.ts +12 -0
- package/dist/formatter-vjbCoK9k.d.ts.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1 -0
- package/dist/interface-BFsLlmGy.d.ts +1 -0
- package/dist/interface-ii8DV63k.d.cts +283 -0
- package/dist/interface-ii8DV63k.d.cts.map +1 -0
- package/dist/interface-ii8DV63k.d.ts +283 -0
- package/dist/interface-ii8DV63k.d.ts.map +1 -0
- package/dist/lib/permission.cjs +0 -0
- package/dist/lib/permission.d.cts +1 -0
- package/dist/lib/permission.d.ts +1 -0
- package/dist/lib/permission.js +1 -0
- package/dist/modules/auth/client/index.cjs +1 -0
- package/dist/modules/auth/client/index.d.cts +6 -0
- package/dist/modules/auth/client/index.d.ts +6 -0
- package/dist/modules/auth/client/index.js +1 -0
- package/dist/modules/auth/client/retry.cjs +1 -0
- package/dist/modules/auth/client/retry.d.cts +11 -0
- package/dist/modules/auth/client/retry.d.cts.map +1 -0
- package/dist/modules/auth/client/retry.d.ts +11 -0
- package/dist/modules/auth/client/retry.d.ts.map +1 -0
- package/dist/modules/auth/client/retry.js +2 -0
- package/dist/modules/auth/client/retry.js.map +1 -0
- package/dist/modules/auth/interface.cjs +1 -0
- package/dist/modules/auth/interface.d.cts +8 -0
- package/dist/modules/auth/interface.d.cts.map +1 -0
- package/dist/modules/auth/interface.d.ts +8 -0
- package/dist/modules/auth/interface.d.ts.map +1 -0
- package/dist/modules/auth/interface.js +2 -0
- package/dist/modules/auth/interface.js.map +1 -0
- package/dist/modules/auth/policy.cjs +1 -0
- package/dist/modules/auth/policy.d.cts +15 -0
- package/dist/modules/auth/policy.d.cts.map +1 -0
- package/dist/modules/auth/policy.d.ts +15 -0
- package/dist/modules/auth/policy.d.ts.map +1 -0
- package/dist/modules/auth/policy.js +2 -0
- package/dist/modules/auth/policy.js.map +1 -0
- package/dist/modules/auth/server/bearer.cjs +1 -0
- package/dist/modules/auth/server/bearer.d.cts +25 -0
- package/dist/modules/auth/server/bearer.d.cts.map +1 -0
- package/dist/modules/auth/server/bearer.d.ts +25 -0
- package/dist/modules/auth/server/bearer.d.ts.map +1 -0
- package/dist/modules/auth/server/bearer.js +2 -0
- package/dist/modules/auth/server/bearer.js.map +1 -0
- package/dist/modules/auth/server/claims.cjs +1 -0
- package/dist/modules/auth/server/claims.d.cts +37 -0
- package/dist/modules/auth/server/claims.d.cts.map +1 -0
- package/dist/modules/auth/server/claims.d.ts +37 -0
- package/dist/modules/auth/server/claims.d.ts.map +1 -0
- package/dist/modules/auth/server/claims.js +2 -0
- package/dist/modules/auth/server/claims.js.map +1 -0
- package/dist/modules/auth/server/crypto.cjs +1 -0
- package/dist/modules/auth/server/crypto.d.cts +3 -0
- package/dist/modules/auth/server/crypto.d.cts.map +1 -0
- package/dist/modules/auth/server/crypto.d.ts +3 -0
- package/dist/modules/auth/server/crypto.d.ts.map +1 -0
- package/dist/modules/auth/server/crypto.js +2 -0
- package/dist/modules/auth/server/crypto.js.map +1 -0
- package/dist/modules/auth/server/grant-guard.cjs +1 -0
- package/dist/modules/auth/server/grant-guard.d.cts +6 -0
- package/dist/modules/auth/server/grant-guard.d.cts.map +1 -0
- package/dist/modules/auth/server/grant-guard.d.ts +6 -0
- package/dist/modules/auth/server/grant-guard.d.ts.map +1 -0
- package/dist/modules/auth/server/grant-guard.js +2 -0
- package/dist/modules/auth/server/grant-guard.js.map +1 -0
- package/dist/modules/auth/server/identity-cache.cjs +1 -0
- package/dist/modules/auth/server/identity-cache.d.cts +8 -0
- package/dist/modules/auth/server/identity-cache.d.cts.map +1 -0
- package/dist/modules/auth/server/identity-cache.d.ts +8 -0
- package/dist/modules/auth/server/identity-cache.d.ts.map +1 -0
- package/dist/modules/auth/server/identity-cache.js +2 -0
- package/dist/modules/auth/server/identity-cache.js.map +1 -0
- package/dist/modules/auth/server/identity.cjs +1 -0
- package/dist/modules/auth/server/identity.d.cts +5 -0
- package/dist/modules/auth/server/identity.d.cts.map +1 -0
- package/dist/modules/auth/server/identity.d.ts +5 -0
- package/dist/modules/auth/server/identity.d.ts.map +1 -0
- package/dist/modules/auth/server/identity.js +2 -0
- package/dist/modules/auth/server/identity.js.map +1 -0
- package/dist/modules/auth/server/index.cjs +1 -0
- package/dist/modules/auth/server/index.d.cts +17 -0
- package/dist/modules/auth/server/index.d.ts +17 -0
- package/dist/modules/auth/server/index.js +1 -0
- package/dist/modules/auth/server/interface.cjs +0 -0
- package/dist/modules/auth/server/interface.d.cts +2 -0
- package/dist/modules/auth/server/interface.d.ts +3 -0
- package/dist/modules/auth/server/interface.js +1 -0
- package/dist/modules/auth/server/logout.cjs +1 -0
- package/dist/modules/auth/server/logout.d.cts +10 -0
- package/dist/modules/auth/server/logout.d.cts.map +1 -0
- package/dist/modules/auth/server/logout.d.ts +10 -0
- package/dist/modules/auth/server/logout.d.ts.map +1 -0
- package/dist/modules/auth/server/logout.js +2 -0
- package/dist/modules/auth/server/logout.js.map +1 -0
- package/dist/modules/auth/server/machine.cjs +1 -0
- package/dist/modules/auth/server/machine.d.cts +28 -0
- package/dist/modules/auth/server/machine.d.cts.map +1 -0
- package/dist/modules/auth/server/machine.d.ts +28 -0
- package/dist/modules/auth/server/machine.d.ts.map +1 -0
- package/dist/modules/auth/server/machine.js +2 -0
- package/dist/modules/auth/server/machine.js.map +1 -0
- package/dist/modules/auth/server/proof.cjs +1 -0
- package/dist/modules/auth/server/proof.d.cts +23 -0
- package/dist/modules/auth/server/proof.d.cts.map +1 -0
- package/dist/modules/auth/server/proof.d.ts +23 -0
- package/dist/modules/auth/server/proof.d.ts.map +1 -0
- package/dist/modules/auth/server/proof.js +2 -0
- package/dist/modules/auth/server/proof.js.map +1 -0
- package/dist/modules/auth/server/provider.cjs +1 -0
- package/dist/modules/auth/server/provider.d.cts +9 -0
- package/dist/modules/auth/server/provider.d.cts.map +1 -0
- package/dist/modules/auth/server/provider.d.ts +9 -0
- package/dist/modules/auth/server/provider.d.ts.map +1 -0
- package/dist/modules/auth/server/provider.js +2 -0
- package/dist/modules/auth/server/provider.js.map +1 -0
- package/dist/modules/auth/server/resource.cjs +1 -0
- package/dist/modules/auth/server/resource.d.cts +10 -0
- package/dist/modules/auth/server/resource.d.cts.map +1 -0
- package/dist/modules/auth/server/resource.d.ts +10 -0
- package/dist/modules/auth/server/resource.d.ts.map +1 -0
- package/dist/modules/auth/server/resource.js +2 -0
- package/dist/modules/auth/server/resource.js.map +1 -0
- package/dist/modules/auth/server/revocation.cjs +1 -0
- package/dist/modules/auth/server/revocation.d.cts +4 -0
- package/dist/modules/auth/server/revocation.d.cts.map +1 -0
- package/dist/modules/auth/server/revocation.d.ts +4 -0
- package/dist/modules/auth/server/revocation.d.ts.map +1 -0
- package/dist/modules/auth/server/revocation.js +2 -0
- package/dist/modules/auth/server/revocation.js.map +1 -0
- package/dist/modules/auth/server/user-info.cjs +1 -0
- package/dist/modules/auth/server/user-info.d.cts +19 -0
- package/dist/modules/auth/server/user-info.d.cts.map +1 -0
- package/dist/modules/auth/server/user-info.d.ts +19 -0
- package/dist/modules/auth/server/user-info.d.ts.map +1 -0
- package/dist/modules/auth/server/user-info.js +2 -0
- package/dist/modules/auth/server/user-info.js.map +1 -0
- package/dist/modules/common/admin.cjs +1 -0
- package/dist/modules/common/admin.d.cts +4 -0
- package/dist/modules/common/admin.d.cts.map +1 -0
- package/dist/modules/common/admin.d.ts +4 -0
- package/dist/modules/common/admin.d.ts.map +1 -0
- package/dist/modules/common/admin.js +2 -0
- package/dist/modules/common/admin.js.map +1 -0
- package/dist/modules/common/client.cjs +1 -0
- package/dist/modules/common/client.d.cts +118 -0
- package/dist/modules/common/client.d.cts.map +1 -0
- package/dist/modules/common/client.d.ts +118 -0
- package/dist/modules/common/client.d.ts.map +1 -0
- package/dist/modules/common/client.js +2 -0
- package/dist/modules/common/client.js.map +1 -0
- package/dist/modules/common/index.cjs +1 -0
- package/dist/modules/common/index.d.cts +6 -0
- package/dist/modules/common/index.d.ts +6 -0
- package/dist/modules/common/index.js +1 -0
- package/dist/modules/common/realtime.cjs +0 -0
- package/dist/modules/common/realtime.d.cts +2 -0
- package/dist/modules/common/realtime.d.ts +2 -0
- package/dist/modules/common/realtime.js +1 -0
- package/dist/modules/common/upload.cjs +1 -0
- package/dist/modules/common/upload.d.cts +4 -0
- package/dist/modules/common/upload.d.cts.map +1 -0
- package/dist/modules/common/upload.d.ts +4 -0
- package/dist/modules/common/upload.d.ts.map +1 -0
- package/dist/modules/common/upload.js +2 -0
- package/dist/modules/common/upload.js.map +1 -0
- package/dist/modules/database/index.cjs +1 -0
- package/dist/modules/database/index.d.cts +18 -0
- package/dist/modules/database/index.d.cts.map +1 -0
- package/dist/modules/database/index.d.ts +18 -0
- package/dist/modules/database/index.d.ts.map +1 -0
- package/dist/modules/database/index.js +2 -0
- package/dist/modules/database/index.js.map +1 -0
- package/dist/modules/database/postgres.cjs +1 -0
- package/dist/modules/database/postgres.d.cts +5 -0
- package/dist/modules/database/postgres.d.cts.map +1 -0
- package/dist/modules/database/postgres.d.ts +5 -0
- package/dist/modules/database/postgres.d.ts.map +1 -0
- package/dist/modules/database/postgres.js +2 -0
- package/dist/modules/database/postgres.js.map +1 -0
- package/dist/modules/desktop/index.cjs +1 -0
- package/dist/modules/desktop/index.d.cts +8 -0
- package/dist/modules/desktop/index.d.ts +8 -0
- package/dist/modules/desktop/index.js +1 -0
- package/dist/modules/desktop/interface.cjs +0 -0
- package/dist/modules/desktop/interface.d.cts +2 -0
- package/dist/modules/desktop/interface.d.ts +2 -0
- package/dist/modules/desktop/interface.js +1 -0
- package/dist/modules/desktop/proxy.cjs +1 -0
- package/dist/modules/desktop/proxy.d.cts +22 -0
- package/dist/modules/desktop/proxy.d.cts.map +1 -0
- package/dist/modules/desktop/proxy.d.ts +22 -0
- package/dist/modules/desktop/proxy.d.ts.map +1 -0
- package/dist/modules/desktop/proxy.js +2 -0
- package/dist/modules/desktop/proxy.js.map +1 -0
- package/dist/modules/desktop/release.cjs +1 -0
- package/dist/modules/desktop/release.d.cts +5 -0
- package/dist/modules/desktop/release.d.cts.map +1 -0
- package/dist/modules/desktop/release.d.ts +5 -0
- package/dist/modules/desktop/release.d.ts.map +1 -0
- package/dist/modules/desktop/release.js +2 -0
- package/dist/modules/desktop/release.js.map +1 -0
- package/dist/modules/desktop/rpc.cjs +1 -0
- package/dist/modules/desktop/rpc.d.cts +14 -0
- package/dist/modules/desktop/rpc.d.cts.map +1 -0
- package/dist/modules/desktop/rpc.d.ts +14 -0
- package/dist/modules/desktop/rpc.d.ts.map +1 -0
- package/dist/modules/desktop/rpc.js +2 -0
- package/dist/modules/desktop/rpc.js.map +1 -0
- package/dist/modules/desktop/shortcut.cjs +1 -0
- package/dist/modules/desktop/shortcut.d.cts +6 -0
- package/dist/modules/desktop/shortcut.d.cts.map +1 -0
- package/dist/modules/desktop/shortcut.d.ts +6 -0
- package/dist/modules/desktop/shortcut.d.ts.map +1 -0
- package/dist/modules/desktop/shortcut.js +2 -0
- package/dist/modules/desktop/shortcut.js.map +1 -0
- package/dist/modules/http/caller.cjs +1 -0
- package/dist/modules/http/caller.d.cts +18 -0
- package/dist/modules/http/caller.d.cts.map +1 -0
- package/dist/modules/http/caller.d.ts +18 -0
- package/dist/modules/http/caller.d.ts.map +1 -0
- package/dist/modules/http/caller.js +2 -0
- package/dist/modules/http/caller.js.map +1 -0
- package/dist/modules/http/error.cjs +1 -0
- package/dist/modules/http/error.d.cts +2 -0
- package/dist/modules/http/error.d.ts +2 -0
- package/dist/modules/http/error.js +2 -0
- package/dist/modules/http/error.js.map +1 -0
- package/dist/modules/http/failure.cjs +1 -0
- package/dist/modules/http/failure.d.cts +14 -0
- package/dist/modules/http/failure.d.cts.map +1 -0
- package/dist/modules/http/failure.d.ts +14 -0
- package/dist/modules/http/failure.d.ts.map +1 -0
- package/dist/modules/http/failure.js +2 -0
- package/dist/modules/http/failure.js.map +1 -0
- package/dist/modules/http/fetcher.cjs +1 -0
- package/dist/modules/http/fetcher.d.cts +6 -0
- package/dist/modules/http/fetcher.d.cts.map +1 -0
- package/dist/modules/http/fetcher.d.ts +6 -0
- package/dist/modules/http/fetcher.d.ts.map +1 -0
- package/dist/modules/http/fetcher.js +2 -0
- package/dist/modules/http/fetcher.js.map +1 -0
- package/dist/modules/http/index.cjs +1 -0
- package/dist/modules/http/index.d.cts +6 -0
- package/dist/modules/http/index.d.ts +6 -0
- package/dist/modules/http/index.js +1 -0
- package/dist/modules/http/response.cjs +1 -0
- package/dist/modules/http/response.d.cts +6 -0
- package/dist/modules/http/response.d.cts.map +1 -0
- package/dist/modules/http/response.d.ts +6 -0
- package/dist/modules/http/response.d.ts.map +1 -0
- package/dist/modules/http/response.js +2 -0
- package/dist/modules/http/response.js.map +1 -0
- package/dist/modules/supabase/express/client.cjs +1 -0
- package/dist/modules/supabase/express/client.d.cts +3 -0
- package/dist/modules/supabase/express/client.d.cts.map +1 -0
- package/dist/modules/supabase/express/client.d.ts +3 -0
- package/dist/modules/supabase/express/client.d.ts.map +1 -0
- package/dist/modules/supabase/express/client.js +2 -0
- package/dist/modules/supabase/express/client.js.map +1 -0
- package/dist/modules/supabase/express/index.cjs +1 -0
- package/dist/modules/supabase/express/index.d.cts +3 -0
- package/dist/modules/supabase/express/index.d.ts +3 -0
- package/dist/modules/supabase/express/index.js +1 -0
- package/dist/modules/supabase/express/server.cjs +1 -0
- package/dist/modules/supabase/express/server.d.cts +2 -0
- package/dist/modules/supabase/express/server.d.ts +2 -0
- package/dist/modules/supabase/express/server.js +1 -0
- package/dist/modules/supabase/next/client.cjs +1 -0
- package/dist/modules/supabase/next/client.d.cts +60 -0
- package/dist/modules/supabase/next/client.d.cts.map +1 -0
- package/dist/modules/supabase/next/client.d.ts +60 -0
- package/dist/modules/supabase/next/client.d.ts.map +1 -0
- package/dist/modules/supabase/next/client.js +2 -0
- package/dist/modules/supabase/next/client.js.map +1 -0
- package/dist/modules/supabase/next/index.cjs +1 -0
- package/dist/modules/supabase/next/index.d.cts +5 -0
- package/dist/modules/supabase/next/index.d.ts +5 -0
- package/dist/modules/supabase/next/index.js +1 -0
- package/dist/modules/supabase/next/middleware.cjs +1 -0
- package/dist/modules/supabase/next/middleware.d.cts +2 -0
- package/dist/modules/supabase/next/middleware.d.cts.map +1 -0
- package/dist/modules/supabase/next/middleware.d.ts +2 -0
- package/dist/modules/supabase/next/middleware.d.ts.map +1 -0
- package/dist/modules/supabase/next/middleware.js +2 -0
- package/dist/modules/supabase/next/middleware.js.map +1 -0
- package/dist/modules/supabase/next/server.cjs +1 -0
- package/dist/modules/supabase/next/server.d.cts +61 -0
- package/dist/modules/supabase/next/server.d.cts.map +1 -0
- package/dist/modules/supabase/next/server.d.ts +61 -0
- package/dist/modules/supabase/next/server.d.ts.map +1 -0
- package/dist/modules/supabase/next/server.js +2 -0
- package/dist/modules/supabase/next/server.js.map +1 -0
- package/dist/rolldown-runtime-BocRIvOZ.cjs +1 -0
- package/dist/utils/formatter.cjs +1 -0
- package/dist/utils/formatter.d.cts +11 -0
- package/dist/utils/formatter.d.cts.map +1 -0
- package/dist/utils/formatter.d.ts +2 -0
- package/dist/utils/formatter.js +2 -0
- package/dist/utils/formatter.js.map +1 -0
- package/dist/utils/interface.cjs +0 -0
- package/dist/utils/interface.d.cts +2 -0
- package/dist/utils/interface.d.ts +2 -0
- package/dist/utils/interface.js +1 -0
- package/dist/utils/normalization.cjs +1 -0
- package/dist/utils/normalization.d.cts +10 -0
- package/dist/utils/normalization.d.cts.map +1 -0
- package/dist/utils/normalization.d.ts +10 -0
- package/dist/utils/normalization.d.ts.map +1 -0
- package/dist/utils/normalization.js +2 -0
- package/dist/utils/normalization.js.map +1 -0
- package/docs/auth.md +189 -0
- package/docs/modules.md +100 -0
- package/package.json +198 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../auth/client/retry.cjs"),t=require("../../utils/formatter.cjs");let n=require("zod");function r(e={}){let t=e.origin??`https://desktop.invalid`,n=e.endpoint??`/trpc`,r=e.maxUrlLength??2e6,i=e.maxBodyBytes??8e6,a=e.maxResponseBytes??8e6,o=new URL(t);if(o.origin!==t||o.protocol!==`https:`||!/^\/[a-zA-Z][a-zA-Z0-9/-]*$/.test(n)||n.endsWith(`/`)||![r,i,a].every(e=>Number.isSafeInteger(e)&&e>0&&e<=16e6))throw TypeError(`Invalid desktop RPC policy`);return{origin:t,endpoint:n,maxUrlLength:r,maxBodyBytes:i,maxResponseBytes:a}}function i(e){return n.z.object({url:n.z.string().max(e.maxUrlLength).refine(t=>{try{let n=new URL(t),r=n.pathname.slice(e.endpoint.length+1);return n.origin===e.origin&&n.pathname.startsWith(e.endpoint+`/`)&&/^[a-zA-Z][a-zA-Z0-9.]*$/.test(r)&&!n.username&&!n.password&&!n.hash}catch{return!1}}),method:n.z.enum([`GET`,`POST`]),body:n.z.string().max(e.maxBodyBytes).optional()}).strict().refine(t=>(t.method!==`GET`||t.body===void 0)&&(t.body===void 0||new TextEncoder().encode(t.body).length<=e.maxBodyBytes))}function a(e){let n=r(e),a=i(n);return async function(r){let i=a.safeParse(r);if(!i.success)return t.formatRpcFailure(400,`Invalid desktop RPC request.`,-32600,`BAD_REQUEST`);try{let t=await e.handle(new Request(i.data.url,{method:i.data.method,body:i.data.body,headers:{"content-type":`application/json`}})),r=await o(t,n.maxResponseBytes);if(t.status<200||t.status>599)throw Error();return{status:t.status,body:r}}catch{return t.formatRpcFailure(500,`Desktop RPC unavailable.`,-32603,`INTERNAL_SERVER_ERROR`)}}}async function o(e,t){if(!e.body)return``;let n=e.body.getReader(),r=[],i=0;try{for(;;){let e=await n.read();if(e.done)break;if(i+=e.value.byteLength,i>t)throw await n.cancel(),Error(`RPC response too large`);r.push(e.value)}}finally{n.releaseLock()}let a=new Uint8Array(i),o=0;for(let e of r)a.set(e,o),o+=e.length;return new TextDecoder().decode(a)}function s(t){let n=r(t),a=i(n);return async function(r,i){let s=i?.signal??(r instanceof Request?r.signal:void 0);s?.throwIfAborted();let c=(i?.method??(r instanceof Request?r.method:`GET`)).toUpperCase(),l=i?.body??(r instanceof Request&&c===`POST`?await o(new Response(r.body),n.maxBodyBytes):void 0);if(l!==void 0&&typeof l!=`string`)throw TypeError(`Desktop RPC body must be text`);let u=a.parse({url:r instanceof Request?r.url:String(r),method:c,...l===void 0?{}:{body:l}});s?.throwIfAborted();let d=await e.waitForAuthOperation(t.request(u,s??void 0),s??void 0);if(s?.throwIfAborted(),!Number.isInteger(d.status)||d.status<200||d.status>599||typeof d.body!=`string`||new TextEncoder().encode(d.body).length>n.maxResponseBytes)throw TypeError(`Invalid desktop RPC response`);return new Response([204,205,304].includes(d.status)?null:d.body,{status:d.status,headers:{"content-type":`application/json`}})}}exports.createDesktopRpcHandler=a,exports.createDesktopRpcTransport=s,exports.resolveDesktopRpcPolicy=r;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "./interface.cjs";
|
|
2
|
+
import { S as DesktopRpcPolicy, T as DesktopRpcTransportOptions, w as DesktopRpcResponse, x as DesktopRpcHandlerOptions } from "../../interface-ii8DV63k.cjs";
|
|
3
|
+
export declare function resolveDesktopRpcPolicy(options?: DesktopRpcPolicy): {
|
|
4
|
+
origin: string;
|
|
5
|
+
endpoint: string;
|
|
6
|
+
maxUrlLength: number;
|
|
7
|
+
maxBodyBytes: number;
|
|
8
|
+
maxResponseBytes: number;
|
|
9
|
+
};
|
|
10
|
+
/** Main-process packet validation. Supply tRPC's fetchRequestHandler as handle. */
|
|
11
|
+
export declare function createDesktopRpcHandler(options: DesktopRpcHandlerOptions): (input: unknown) => Promise<DesktopRpcResponse>;
|
|
12
|
+
/** No network request: URL is protocol metadata passed to app-owned trusted IPC. */
|
|
13
|
+
export declare function createDesktopRpcTransport(options: DesktopRpcTransportOptions): (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
14
|
+
//# sourceMappingURL=rpc.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc.d.cts","names":[],"sources":["../../../src/modules/desktop/rpc.ts"],"mappings":";;wBASgB,wBAAwB,UAAS;;;;;;;;wBAsDjC,wBAAwB,SAAS,4BAGR,mBAAiB,QAAQ;;wBA2DlD,0BAA0B,SAAS,8BAI/C,gBAAgB,MAAM,SACtB,OAAO,gBACN,QAAQ"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "./interface.js";
|
|
2
|
+
import { S as DesktopRpcPolicy, T as DesktopRpcTransportOptions, w as DesktopRpcResponse, x as DesktopRpcHandlerOptions } from "../../interface-ii8DV63k.js";
|
|
3
|
+
export declare function resolveDesktopRpcPolicy(options?: DesktopRpcPolicy): {
|
|
4
|
+
origin: string;
|
|
5
|
+
endpoint: string;
|
|
6
|
+
maxUrlLength: number;
|
|
7
|
+
maxBodyBytes: number;
|
|
8
|
+
maxResponseBytes: number;
|
|
9
|
+
};
|
|
10
|
+
/** Main-process packet validation. Supply tRPC's fetchRequestHandler as handle. */
|
|
11
|
+
export declare function createDesktopRpcHandler(options: DesktopRpcHandlerOptions): (input: unknown) => Promise<DesktopRpcResponse>;
|
|
12
|
+
/** No network request: URL is protocol metadata passed to app-owned trusted IPC. */
|
|
13
|
+
export declare function createDesktopRpcTransport(options: DesktopRpcTransportOptions): (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
14
|
+
//# sourceMappingURL=rpc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc.d.ts","names":[],"sources":["../../../src/modules/desktop/rpc.ts"],"mappings":";;wBASgB,wBAAwB,UAAS;;;;;;;;wBAsDjC,wBAAwB,SAAS,4BAGR,mBAAiB,QAAQ;;wBA2DlD,0BAA0B,SAAS,8BAI/C,gBAAgB,MAAM,SACtB,OAAO,gBACN,QAAQ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{waitForAuthOperation as e}from"../auth/client/retry.js";import{formatRpcFailure as t}from"../../utils/formatter.js";import{z as n}from"zod";function r(e={}){let t=e.origin??`https://desktop.invalid`,n=e.endpoint??`/trpc`,r=e.maxUrlLength??2e6,i=e.maxBodyBytes??8e6,a=e.maxResponseBytes??8e6,o=new URL(t);if(o.origin!==t||o.protocol!==`https:`||!/^\/[a-zA-Z][a-zA-Z0-9/-]*$/.test(n)||n.endsWith(`/`)||![r,i,a].every(e=>Number.isSafeInteger(e)&&e>0&&e<=16e6))throw TypeError(`Invalid desktop RPC policy`);return{origin:t,endpoint:n,maxUrlLength:r,maxBodyBytes:i,maxResponseBytes:a}}function i(e){return n.object({url:n.string().max(e.maxUrlLength).refine(t=>{try{let n=new URL(t),r=n.pathname.slice(e.endpoint.length+1);return n.origin===e.origin&&n.pathname.startsWith(e.endpoint+`/`)&&/^[a-zA-Z][a-zA-Z0-9.]*$/.test(r)&&!n.username&&!n.password&&!n.hash}catch{return!1}}),method:n.enum([`GET`,`POST`]),body:n.string().max(e.maxBodyBytes).optional()}).strict().refine(t=>(t.method!==`GET`||t.body===void 0)&&(t.body===void 0||new TextEncoder().encode(t.body).length<=e.maxBodyBytes))}function a(e){let n=r(e),a=i(n);return async function(r){let i=a.safeParse(r);if(!i.success)return t(400,`Invalid desktop RPC request.`,-32600,`BAD_REQUEST`);try{let t=await e.handle(new Request(i.data.url,{method:i.data.method,body:i.data.body,headers:{"content-type":`application/json`}})),r=await o(t,n.maxResponseBytes);if(t.status<200||t.status>599)throw Error();return{status:t.status,body:r}}catch{return t(500,`Desktop RPC unavailable.`,-32603,`INTERNAL_SERVER_ERROR`)}}}async function o(e,t){if(!e.body)return``;let n=e.body.getReader(),r=[],i=0;try{for(;;){let e=await n.read();if(e.done)break;if(i+=e.value.byteLength,i>t)throw await n.cancel(),Error(`RPC response too large`);r.push(e.value)}}finally{n.releaseLock()}let a=new Uint8Array(i),o=0;for(let e of r)a.set(e,o),o+=e.length;return new TextDecoder().decode(a)}function s(t){let n=r(t),a=i(n);return async function(r,i){let s=i?.signal??(r instanceof Request?r.signal:void 0);s?.throwIfAborted();let c=(i?.method??(r instanceof Request?r.method:`GET`)).toUpperCase(),l=i?.body??(r instanceof Request&&c===`POST`?await o(new Response(r.body),n.maxBodyBytes):void 0);if(l!==void 0&&typeof l!=`string`)throw TypeError(`Desktop RPC body must be text`);let u=a.parse({url:r instanceof Request?r.url:String(r),method:c,...l===void 0?{}:{body:l}});s?.throwIfAborted();let d=await e(t.request(u,s??void 0),s??void 0);if(s?.throwIfAborted(),!Number.isInteger(d.status)||d.status<200||d.status>599||typeof d.body!=`string`||new TextEncoder().encode(d.body).length>n.maxResponseBytes)throw TypeError(`Invalid desktop RPC response`);return new Response([204,205,304].includes(d.status)?null:d.body,{status:d.status,headers:{"content-type":`application/json`}})}}export{a as createDesktopRpcHandler,s as createDesktopRpcTransport,r as resolveDesktopRpcPolicy};
|
|
2
|
+
//# sourceMappingURL=rpc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc.js","names":["resolveDesktopRpcPolicy","origin","options","endpoint","maxUrlLength","maxBodyBytes","maxResponseBytes","url","value","requestSchema","z","policy","path","input","createDesktopRpcHandler","schema","parsed","formatRpcFailure","response","body","boundedResponseText","reader","chunks","size","next","limit","bytes","offset","chunk","createDesktopRpcTransport","signal","init","method","result","waitForAuthOperation"],"sources":["../../../src/modules/desktop/rpc.ts"],"sourcesContent":["import { waitForAuthOperation } from \"@/modules/auth/client/retry\";\nimport type { DesktopRpcPolicy, DesktopRpcResponse } from \"@/modules/desktop/interface\";\nimport { formatRpcFailure } from \"@/utils/formatter\";\nimport type {\n DesktopRpcHandlerOptions,\n DesktopRpcTransportOptions,\n} from \"@/utils/interface\";\nimport { z } from \"zod\";\n\nexport function resolveDesktopRpcPolicy(options: DesktopRpcPolicy = {}) {\n const origin = options.origin ?? \"https://desktop.invalid\";\n const endpoint = options.endpoint ?? \"/trpc\";\n const maxUrlLength = options.maxUrlLength ?? 2_000_000;\n const maxBodyBytes = options.maxBodyBytes ?? 8_000_000;\n const maxResponseBytes = options.maxResponseBytes ?? 8_000_000;\n const url = new URL(origin);\n if (\n url.origin !== origin ||\n url.protocol !== \"https:\" ||\n !/^\\/[a-zA-Z][a-zA-Z0-9/-]*$/.test(endpoint) ||\n endpoint.endsWith(\"/\") ||\n ![maxUrlLength, maxBodyBytes, maxResponseBytes].every(\n (value) => Number.isSafeInteger(value) && value > 0 && value <= 16_000_000,\n )\n )\n throw new TypeError(\"Invalid desktop RPC policy\");\n return { origin, endpoint, maxUrlLength, maxBodyBytes, maxResponseBytes };\n}\nfunction requestSchema(policy: ReturnType<typeof resolveDesktopRpcPolicy>) {\n return z\n .object({\n url: z\n .string()\n .max(policy.maxUrlLength)\n .refine((value) => {\n try {\n const url = new URL(value);\n const path = url.pathname.slice(policy.endpoint.length + 1);\n return (\n url.origin === policy.origin &&\n url.pathname.startsWith(policy.endpoint + \"/\") &&\n /^[a-zA-Z][a-zA-Z0-9.]*$/.test(path) &&\n !url.username &&\n !url.password &&\n !url.hash\n );\n } catch {\n return false;\n }\n }),\n method: z.enum([\"GET\", \"POST\"]),\n body: z.string().max(policy.maxBodyBytes).optional(),\n })\n .strict()\n .refine(\n (input) =>\n (input.method !== \"GET\" || input.body === undefined) &&\n (input.body === undefined ||\n new TextEncoder().encode(input.body).length <= policy.maxBodyBytes),\n );\n}\n\n/** Main-process packet validation. Supply tRPC's fetchRequestHandler as handle. */\nexport function createDesktopRpcHandler(options: DesktopRpcHandlerOptions) {\n const policy = resolveDesktopRpcPolicy(options);\n const schema = requestSchema(policy);\n return async function handleRpcRequest(input: unknown): Promise<DesktopRpcResponse> {\n const parsed = schema.safeParse(input);\n if (!parsed.success)\n return formatRpcFailure(\n 400,\n \"Invalid desktop RPC request.\",\n -32600,\n \"BAD_REQUEST\",\n );\n try {\n const response = await options.handle(\n new Request(parsed.data.url, {\n method: parsed.data.method,\n body: parsed.data.body,\n headers: { \"content-type\": \"application/json\" },\n }),\n );\n const body = await boundedResponseText(response, policy.maxResponseBytes);\n if (response.status < 200 || response.status > 599) throw new Error();\n return { status: response.status, body };\n } catch {\n return formatRpcFailure(\n 500,\n \"Desktop RPC unavailable.\",\n -32603,\n \"INTERNAL_SERVER_ERROR\",\n );\n }\n };\n}\nasync function boundedResponseText(response: Response, limit: number) {\n if (!response.body) return \"\";\n const reader = response.body.getReader();\n const chunks: Uint8Array[] = [];\n let size = 0;\n try {\n for (;;) {\n const next = await reader.read();\n if (next.done) break;\n size += next.value.byteLength;\n if (size > limit) {\n await reader.cancel();\n throw new Error(\"RPC response too large\");\n }\n chunks.push(next.value);\n }\n } finally {\n reader.releaseLock();\n }\n const bytes = new Uint8Array(size);\n let offset = 0;\n for (const chunk of chunks) {\n bytes.set(chunk, offset);\n offset += chunk.length;\n }\n return new TextDecoder().decode(bytes);\n}\n\n/** No network request: URL is protocol metadata passed to app-owned trusted IPC. */\nexport function createDesktopRpcTransport(options: DesktopRpcTransportOptions) {\n const policy = resolveDesktopRpcPolicy(options);\n const schema = requestSchema(policy);\n return async function rpcFetch(\n input: string | URL | Request,\n init?: RequestInit,\n ): Promise<Response> {\n const signal =\n init?.signal ?? (input instanceof Request ? input.signal : undefined);\n signal?.throwIfAborted();\n const method = (\n init?.method ?? (input instanceof Request ? input.method : \"GET\")\n ).toUpperCase();\n const body =\n init?.body ??\n (input instanceof Request && method === \"POST\"\n ? await boundedResponseText(new Response(input.body), policy.maxBodyBytes)\n : undefined);\n if (body !== undefined && typeof body !== \"string\")\n throw new TypeError(\"Desktop RPC body must be text\");\n const parsed = schema.parse({\n url: input instanceof Request ? input.url : String(input),\n method,\n ...(body === undefined ? {} : { body }),\n });\n signal?.throwIfAborted();\n const result = await waitForAuthOperation(\n options.request(parsed, signal ?? undefined),\n signal ?? undefined,\n );\n signal?.throwIfAborted();\n if (\n !Number.isInteger(result.status) ||\n result.status < 200 ||\n result.status > 599 ||\n typeof result.body !== \"string\" ||\n new TextEncoder().encode(result.body).length > policy.maxResponseBytes\n )\n throw new TypeError(\"Invalid desktop RPC response\");\n return new Response([204, 205, 304].includes(result.status) ? null : result.body, {\n status: result.status,\n headers: { \"content-type\": \"application/json\" },\n });\n };\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../utils/formatter.cjs");function t(t){let n=new Set(t.reserved.map(n=>e.shortcutIdentity(e.normalizeAccelerator(n),t.isMac)));return function(r,i,a){if(!r.some(e=>e.id===i))throw Error(`Unknown shortcut.`);let o=e.normalizeAccelerator(a),s=e.shortcutIdentity(o,t.isMac),c=s.split(`+`);if(new Set(c).size!==c.length)throw Error(`Duplicate shortcut modifier.`);if(o&&r.some(n=>n.id!==i&&e.shortcutIdentity(e.normalizeAccelerator(n.accelerator),t.isMac)===s))throw Error(`This shortcut is already assigned.`);if(o&&n.has(s))throw Error(`This shortcut is reserved by the application or operating system.`);return o}}exports.createShortcutValidator=t,exports.normalizeAccelerator=e.normalizeAccelerator,exports.shortcutIdentity=e.shortcutIdentity;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import "./interface.cjs";
|
|
2
|
+
import { L as Shortcut, z as ShortcutPolicy } from "../../interface-ii8DV63k.cjs";
|
|
3
|
+
import { normalizeAccelerator, shortcutIdentity } from "../../utils/formatter.cjs";
|
|
4
|
+
export declare function createShortcutValidator(policy: ShortcutPolicy): (shortcuts: readonly Shortcut[], id: string, value: string) => string;
|
|
5
|
+
export { type ShortcutPolicy, normalizeAccelerator, shortcutIdentity };
|
|
6
|
+
//# sourceMappingURL=shortcut.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shortcut.d.cts","names":[],"sources":["../../../src/modules/desktop/shortcut.ts"],"mappings":";;;wBAIgB,wBAAwB,QAAQ,kBAO5C,oBAAoB,YACpB,YACA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import "./interface.js";
|
|
2
|
+
import { L as Shortcut, z as ShortcutPolicy } from "../../interface-ii8DV63k.js";
|
|
3
|
+
import { o as normalizeAccelerator, s as shortcutIdentity } from "../../formatter-vjbCoK9k.js";
|
|
4
|
+
export declare function createShortcutValidator(policy: ShortcutPolicy): (shortcuts: readonly Shortcut[], id: string, value: string) => string;
|
|
5
|
+
export { type ShortcutPolicy, normalizeAccelerator, shortcutIdentity };
|
|
6
|
+
//# sourceMappingURL=shortcut.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shortcut.d.ts","names":[],"sources":["../../../src/modules/desktop/shortcut.ts"],"mappings":";;;wBAIgB,wBAAwB,QAAQ,kBAO5C,oBAAoB,YACpB,YACA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{normalizeAccelerator as e,shortcutIdentity as t}from"../../utils/formatter.js";function n(n){let r=new Set(n.reserved.map(r=>t(e(r),n.isMac)));return function(i,a,o){if(!i.some(e=>e.id===a))throw Error(`Unknown shortcut.`);let s=e(o),c=t(s,n.isMac),l=c.split(`+`);if(new Set(l).size!==l.length)throw Error(`Duplicate shortcut modifier.`);if(s&&i.some(r=>r.id!==a&&t(e(r.accelerator),n.isMac)===c))throw Error(`This shortcut is already assigned.`);if(s&&r.has(c))throw Error(`This shortcut is reserved by the application or operating system.`);return s}}export{n as createShortcutValidator,e as normalizeAccelerator,t as shortcutIdentity};
|
|
2
|
+
//# sourceMappingURL=shortcut.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shortcut.js","names":["createShortcutValidator","reserved","policy","shortcutIdentity","normalizeAccelerator","value","shortcuts","shortcut","id","accelerator","identity","parts"],"sources":["../../../src/modules/desktop/shortcut.ts"],"sourcesContent":["import type { Shortcut } from \"@/modules/desktop/interface\";\nimport { normalizeAccelerator, shortcutIdentity } from \"@/utils/formatter\";\nimport type { ShortcutPolicy } from \"@/utils/interface\";\n\nexport function createShortcutValidator(policy: ShortcutPolicy) {\n const reserved = new Set(\n policy.reserved.map((value) =>\n shortcutIdentity(normalizeAccelerator(value), policy.isMac),\n ),\n );\n return function validateShortcutChange(\n shortcuts: readonly Shortcut[],\n id: string,\n value: string,\n ) {\n if (!shortcuts.some((shortcut) => shortcut.id === id))\n throw new Error(\"Unknown shortcut.\");\n const accelerator = normalizeAccelerator(value);\n const identity = shortcutIdentity(accelerator, policy.isMac);\n const parts = identity.split(\"+\");\n if (new Set(parts).size !== parts.length)\n throw new Error(\"Duplicate shortcut modifier.\");\n if (\n accelerator &&\n shortcuts.some(\n (shortcut) =>\n shortcut.id !== id &&\n shortcutIdentity(\n normalizeAccelerator(shortcut.accelerator),\n policy.isMac,\n ) === identity,\n )\n )\n throw new Error(\"This shortcut is already assigned.\");\n if (accelerator && reserved.has(identity))\n throw new Error(\n \"This shortcut is reserved by the application or operating system.\",\n );\n return accelerator;\n };\n}\n\nexport type { ShortcutPolicy } from \"@/utils/interface\";\n\nexport { normalizeAccelerator, shortcutIdentity } from \"@/utils/formatter\";\n"],"mappings":"A,sFAIA,SAAgBA,EAAwB,EAAwB,CAC9D,IAAMC,EAAW,IAAI,IACnBC,EAAO,SAAS,IAAK,GACnBC,EAAiBC,EAAqBC,CAAK,EAAGH,EAAO,KAAK,CAC5D,CACF,EACA,OAAO,SACL,EACA,EACA,EACA,CACA,GAAI,CAACI,EAAU,KAAM,GAAaC,EAAS,KAAOC,CAAE,EAClD,MAAU,MAAM,mBAAmB,EACrC,IAAMC,EAAcL,EAAqBC,CAAK,EACxCK,EAAWP,EAAiBM,EAAaP,EAAO,KAAK,EACrDS,EAAQD,EAAS,MAAM,GAAG,EAChC,GAAI,IAAI,IAAIC,CAAK,CAAC,CAAC,OAASA,EAAM,OAChC,MAAU,MAAM,8BAA8B,EAChD,GACEF,GACAH,EAAU,KACP,GACCC,EAAS,KAAOC,GAChBL,EACEC,EAAqBG,EAAS,WAAW,EACzCL,EAAO,KACT,IAAMQ,CACV,EAEA,MAAU,MAAM,oCAAoC,EACtD,GAAID,GAAeR,EAAS,IAAIS,CAAQ,EACtC,MAAU,MACR,mEACF,EACF,OAAOD,CACT,CACF,C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../auth/client/retry.cjs"),t=require("./error.cjs"),n=require("./fetcher.cjs");let r=require("axios");function i(i){let a=n.createFetcher(i.client),o=i.refresh?e.createAuthRetry({refresh:i.refresh,getStatus:e=>(0,r.isAxiosError)(e)?e.response?.status:void 0}):void 0;function s(e,t,n){if(t===!1||!i.notify)return;let r=typeof t==`object`?t[e]:void 0,a=typeof r==`function`?r(n):r??(e===`error`?n.message:void 0);if(a)try{i.notify(e,a)}catch{}}async function c(e){let{url:n,method:c=`GET`,body:l,params:u,query:d,baseURL:f,auth:p=!0,unwrapData:m=!0,schema:h,responseHandler:g,toast:_,onSuccess:v,onError:y,retryUnsafe:b,...x}=e,S=c.toUpperCase(),C=()=>a({...x,url:n,method:c,body:l,params:d??u,baseURL:f===null?``:f,responseType:x.responseType??(typeof g==`string`&&g!==`content-type`?g===`arrayBuffer`?`arraybuffer`:g:void 0)});try{x.signal?.throwIfAborted();let e=x.signal,t=o?await o.withAuthRetry(C,{signal:e,enabled:p&&(i.canRetry?.(n)??!/(?:^|\/)auth(?:\/|\?|$)/.test(n))&&([`GET`,`HEAD`,`OPTIONS`].includes(S)||b===!0)}):await C(),r=t.status===204||S===`HEAD`?null:typeof g==`function`?await g(t):m&&t.data!==null&&typeof t.data==`object`&&`data`in t.data?t.data.data:t.data;h&&(r=await h.parseAsync(r));let a=r;return await v?.(a),s(`success`,_,a),a}catch(e){let n=t.normalizeCallerError(e);throw i.mapError&&(n=i.mapError(n,(0,r.isAxiosError)(e)?e.response?.data:void 0)),await y?.(n),n.code!==`ERR_CANCELED`&&s(`error`,_,n),n}}return{caller:c,http:{request:c,get(e,t={}){return c({...t,url:e,method:`GET`})},post(e,t,n={}){return c({...n,url:e,method:`POST`,body:t})},put(e,t,n={}){return c({...n,url:e,method:`PUT`,body:t})},patch(e,t,n={}){return c({...n,url:e,method:`PATCH`,body:t})},delete(e,t={}){return c({...t,url:e,method:`DELETE`})},head(e,t={}){return c({...t,url:e,method:`HEAD`})},options(e,t={}){return c({...t,url:e,method:`OPTIONS`})}},reset:()=>o?.reset(),dispose:()=>o?.dispose()}}exports.createCaller=i;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { _ as CallerToastOptions, g as CallerResponseHandler, h as CallerRequestOptions, m as CallerOptions, p as CallerMethodOptions } from "../../interface-ii8DV63k.cjs";
|
|
2
|
+
export declare function createCaller(options: CallerOptions): {
|
|
3
|
+
caller: <Data = unknown, Body = unknown, Params = Record<string, unknown>>(input: CallerRequestOptions<Data, Body, Params>) => Promise<Data>;
|
|
4
|
+
http: {
|
|
5
|
+
request: <Data = unknown, Body = unknown, Params = Record<string, unknown>>(input: CallerRequestOptions<Data, Body, Params>) => Promise<Data>;
|
|
6
|
+
get<Data = unknown, Params = Record<string, unknown>>(url: string, input?: CallerMethodOptions<Data, never, Params>): Promise<Data>;
|
|
7
|
+
post<Data = unknown, Body = unknown, Params = Record<string, unknown>>(url: string, body?: Body, input?: CallerMethodOptions<Data, Body, Params>): Promise<Data>;
|
|
8
|
+
put<Data = unknown, Body = unknown, Params = Record<string, unknown>>(url: string, body?: Body, input?: CallerMethodOptions<Data, Body, Params>): Promise<Data>;
|
|
9
|
+
patch<Data = unknown, Body = unknown, Params = Record<string, unknown>>(url: string, body?: Body, input?: CallerMethodOptions<Data, Body, Params>): Promise<Data>;
|
|
10
|
+
delete<Data = unknown, Body = unknown, Params = Record<string, unknown>>(url: string, input?: Omit<CallerRequestOptions<Data, Body, Params>, "url" | "method">): Promise<Data>;
|
|
11
|
+
head<Data = unknown, Params = Record<string, unknown>>(url: string, input?: CallerMethodOptions<Data, never, Params>): Promise<Data>;
|
|
12
|
+
options<Data = unknown, Body = unknown, Params = Record<string, unknown>>(url: string, input?: Omit<CallerRequestOptions<Data, Body, Params>, "url" | "method">): Promise<Data>;
|
|
13
|
+
};
|
|
14
|
+
reset: () => void | undefined;
|
|
15
|
+
dispose: () => void | undefined;
|
|
16
|
+
};
|
|
17
|
+
export type { CallerOptions, CallerRequestOptions, CallerResponseHandler, CallerToastOptions };
|
|
18
|
+
//# sourceMappingURL=caller.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caller.d.cts","names":[],"sources":["../../../src/modules/http/caller.ts"],"mappings":";wBAUgB,aAAa,SAAS;EAgClC,SAAA,gBACA,gBACA,SAAM,yBAAA,OACC,qBAAqB,MAAM,MAAM,YAAU,QAAQ;;IAH1D,UAAA,gBACA,gBACA,SAAM,yBAAA,OACC,qBAAqB,MAAM,MAAM,YAAU,QAAQ;IAmFtD,IAAA,gBAAgB,SAAM,yBAAA,aACb,QACJ,oBAAoB,aAAa,UAAO,QAAA;IAI5C,KAAA,gBAAgB,gBAAgB,SAAM,yBAAA,aAC9B,OACJ,MAAI,QACJ,oBAAoB,MAAM,MAAM,UAAO,QAAA;IAS5C,IAAA,gBAAgB,gBAAgB,SAAM,yBAAA,aAC7B,OACJ,MAAI,QACJ,oBAAoB,MAAM,MAAM,UAAO,QAAA;IAI1C,MAAA,gBAAgB,gBAAgB,SAAM,yBAAA,aAC/B,OACJ,MAAI,QACJ,oBAAoB,MAAM,MAAM,UAAO,QAAA;IASzC,OAAA,gBAAgB,gBAAgB,SAAM,yBAAA,aAChC,QACJ,KACL,qBAAqB,MAAM,MAAM,6BAElC,QAAA;IAIE,KAAA,gBAAgB,SAAM,yBAAA,aACd,QACJ,oBAAoB,aAAa,UAAO,QAAA;IAIzC,QAAA,gBAAgB,gBAAgB,SAAM,yBAAA,aACjC,QACJ,KACL,qBAAqB,MAAM,MAAM,6BAElC,QAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { _ as CallerToastOptions, g as CallerResponseHandler, h as CallerRequestOptions, m as CallerOptions, p as CallerMethodOptions } from "../../interface-ii8DV63k.js";
|
|
2
|
+
export declare function createCaller(options: CallerOptions): {
|
|
3
|
+
caller: <Data = unknown, Body = unknown, Params = Record<string, unknown>>(input: CallerRequestOptions<Data, Body, Params>) => Promise<Data>;
|
|
4
|
+
http: {
|
|
5
|
+
request: <Data = unknown, Body = unknown, Params = Record<string, unknown>>(input: CallerRequestOptions<Data, Body, Params>) => Promise<Data>;
|
|
6
|
+
get<Data = unknown, Params = Record<string, unknown>>(url: string, input?: CallerMethodOptions<Data, never, Params>): Promise<Data>;
|
|
7
|
+
post<Data = unknown, Body = unknown, Params = Record<string, unknown>>(url: string, body?: Body, input?: CallerMethodOptions<Data, Body, Params>): Promise<Data>;
|
|
8
|
+
put<Data = unknown, Body = unknown, Params = Record<string, unknown>>(url: string, body?: Body, input?: CallerMethodOptions<Data, Body, Params>): Promise<Data>;
|
|
9
|
+
patch<Data = unknown, Body = unknown, Params = Record<string, unknown>>(url: string, body?: Body, input?: CallerMethodOptions<Data, Body, Params>): Promise<Data>;
|
|
10
|
+
delete<Data = unknown, Body = unknown, Params = Record<string, unknown>>(url: string, input?: Omit<CallerRequestOptions<Data, Body, Params>, "url" | "method">): Promise<Data>;
|
|
11
|
+
head<Data = unknown, Params = Record<string, unknown>>(url: string, input?: CallerMethodOptions<Data, never, Params>): Promise<Data>;
|
|
12
|
+
options<Data = unknown, Body = unknown, Params = Record<string, unknown>>(url: string, input?: Omit<CallerRequestOptions<Data, Body, Params>, "url" | "method">): Promise<Data>;
|
|
13
|
+
};
|
|
14
|
+
reset: () => void | undefined;
|
|
15
|
+
dispose: () => void | undefined;
|
|
16
|
+
};
|
|
17
|
+
export type { CallerOptions, CallerRequestOptions, CallerResponseHandler, CallerToastOptions };
|
|
18
|
+
//# sourceMappingURL=caller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caller.d.ts","names":[],"sources":["../../../src/modules/http/caller.ts"],"mappings":";wBAUgB,aAAa,SAAS;EAgClC,SAAA,gBACA,gBACA,SAAM,yBAAA,OACC,qBAAqB,MAAM,MAAM,YAAU,QAAQ;;IAH1D,UAAA,gBACA,gBACA,SAAM,yBAAA,OACC,qBAAqB,MAAM,MAAM,YAAU,QAAQ;IAmFtD,IAAA,gBAAgB,SAAM,yBAAA,aACb,QACJ,oBAAoB,aAAa,UAAO,QAAA;IAI5C,KAAA,gBAAgB,gBAAgB,SAAM,yBAAA,aAC9B,OACJ,MAAI,QACJ,oBAAoB,MAAM,MAAM,UAAO,QAAA;IAS5C,IAAA,gBAAgB,gBAAgB,SAAM,yBAAA,aAC7B,OACJ,MAAI,QACJ,oBAAoB,MAAM,MAAM,UAAO,QAAA;IAI1C,MAAA,gBAAgB,gBAAgB,SAAM,yBAAA,aAC/B,OACJ,MAAI,QACJ,oBAAoB,MAAM,MAAM,UAAO,QAAA;IASzC,OAAA,gBAAgB,gBAAgB,SAAM,yBAAA,aAChC,QACJ,KACL,qBAAqB,MAAM,MAAM,6BAElC,QAAA;IAIE,KAAA,gBAAgB,SAAM,yBAAA,aACd,QACJ,oBAAoB,aAAa,UAAO,QAAA;IAIzC,QAAA,gBAAgB,gBAAgB,SAAM,yBAAA,aACjC,QACJ,KACL,qBAAqB,MAAM,MAAM,6BAElC,QAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createAuthRetry as e}from"../auth/client/retry.js";import{normalizeCallerError as t}from"./error.js";import{createFetcher as n}from"./fetcher.js";import{isAxiosError as r}from"axios";function i(i){let a=n(i.client),o=i.refresh?e({refresh:i.refresh,getStatus:e=>r(e)?e.response?.status:void 0}):void 0;function s(e,t,n){if(t===!1||!i.notify)return;let r=typeof t==`object`?t[e]:void 0,a=typeof r==`function`?r(n):r??(e===`error`?n.message:void 0);if(a)try{i.notify(e,a)}catch{}}async function c(e){let{url:n,method:c=`GET`,body:l,params:u,query:d,baseURL:f,auth:p=!0,unwrapData:m=!0,schema:h,responseHandler:g,toast:_,onSuccess:v,onError:y,retryUnsafe:b,...x}=e,S=c.toUpperCase(),C=()=>a({...x,url:n,method:c,body:l,params:d??u,baseURL:f===null?``:f,responseType:x.responseType??(typeof g==`string`&&g!==`content-type`?g===`arrayBuffer`?`arraybuffer`:g:void 0)});try{x.signal?.throwIfAborted();let e=x.signal,t=o?await o.withAuthRetry(C,{signal:e,enabled:p&&(i.canRetry?.(n)??!/(?:^|\/)auth(?:\/|\?|$)/.test(n))&&([`GET`,`HEAD`,`OPTIONS`].includes(S)||b===!0)}):await C(),r=t.status===204||S===`HEAD`?null:typeof g==`function`?await g(t):m&&t.data!==null&&typeof t.data==`object`&&`data`in t.data?t.data.data:t.data;h&&(r=await h.parseAsync(r));let a=r;return await v?.(a),s(`success`,_,a),a}catch(e){let n=t(e);throw i.mapError&&(n=i.mapError(n,r(e)?e.response?.data:void 0)),await y?.(n),n.code!==`ERR_CANCELED`&&s(`error`,_,n),n}}return{caller:c,http:{request:c,get(e,t={}){return c({...t,url:e,method:`GET`})},post(e,t,n={}){return c({...n,url:e,method:`POST`,body:t})},put(e,t,n={}){return c({...n,url:e,method:`PUT`,body:t})},patch(e,t,n={}){return c({...n,url:e,method:`PATCH`,body:t})},delete(e,t={}){return c({...t,url:e,method:`DELETE`})},head(e,t={}){return c({...t,url:e,method:`HEAD`})},options(e,t={}){return c({...t,url:e,method:`OPTIONS`})}},reset:()=>o?.reset(),dispose:()=>o?.dispose()}}export{i as createCaller};
|
|
2
|
+
//# sourceMappingURL=caller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caller.js","names":["createCaller","fetcher","createFetcher","options","retry","createAuthRetry","isAxiosError","error","notify","setting","configured","kind","message","value","caller","config","input","upperMethod","method","request","query","params","baseURL","responseHandler","signal","response","auth","url","retryUnsafe","data","unwrapData","schema","result","onSuccess","toast","normalized","normalizeCallerError","onError"],"sources":["../../../src/modules/http/caller.ts"],"sourcesContent":["import { createAuthRetry } from \"@/modules/auth/client/retry\";\nimport { CallerError, normalizeCallerError } from \"@/modules/http/error\";\nimport { createFetcher } from \"@/modules/http/fetcher\";\nimport type {\n CallerMethodOptions,\n CallerOptions,\n CallerRequestOptions,\n} from \"@/utils/interface\";\nimport { isAxiosError, type ResponseType } from \"axios\";\n\nexport function createCaller(options: CallerOptions) {\n const fetcher = createFetcher(options.client);\n const retry = options.refresh\n ? createAuthRetry({\n refresh: options.refresh,\n getStatus: (error) =>\n isAxiosError(error) ? error.response?.status : undefined,\n })\n : undefined;\n\n function notify<Data>(\n kind: \"success\" | \"error\",\n setting: CallerRequestOptions<Data>[\"toast\"],\n value: Data | CallerError,\n ) {\n if (setting === false || !options.notify) return;\n const configured = typeof setting === \"object\" ? setting[kind] : undefined;\n const message =\n typeof configured === \"function\"\n ? (configured as (value: Data | CallerError) => string)(value)\n : (configured ??\n (kind === \"error\" ? (value as CallerError).message : undefined));\n if (message) {\n try {\n options.notify(kind, message);\n } catch {\n /* UI observers cannot change request outcome. */\n }\n }\n }\n\n async function caller<\n Data = unknown,\n Body = unknown,\n Params = Record<string, unknown>,\n >(input: CallerRequestOptions<Data, Body, Params>): Promise<Data> {\n const {\n url,\n method = \"GET\",\n body,\n params,\n query,\n baseURL,\n auth = true,\n unwrapData = true,\n schema,\n responseHandler,\n toast,\n onSuccess,\n onError,\n retryUnsafe,\n ...config\n } = input;\n const upperMethod = method.toUpperCase();\n const request = () =>\n fetcher<unknown, Body, Params>({\n ...config,\n url,\n method,\n body,\n params: query ?? params,\n // null deliberately bypasses an instance's configured baseURL.\n baseURL: baseURL === null ? \"\" : baseURL,\n responseType:\n config.responseType ??\n (typeof responseHandler === \"string\" &&\n responseHandler !== \"content-type\"\n ? responseHandler === \"arrayBuffer\"\n ? \"arraybuffer\"\n : (responseHandler as ResponseType)\n : undefined),\n });\n try {\n config.signal?.throwIfAborted();\n const signal = config.signal as AbortSignal | undefined;\n const response = retry\n ? await retry.withAuthRetry(request, {\n signal,\n enabled:\n auth &&\n (options.canRetry?.(url) ??\n !/(?:^|\\/)auth(?:\\/|\\?|$)/.test(url)) &&\n ([\"GET\", \"HEAD\", \"OPTIONS\"].includes(upperMethod) ||\n retryUnsafe === true),\n })\n : await request();\n let data: unknown =\n response.status === 204 || upperMethod === \"HEAD\"\n ? null\n : typeof responseHandler === \"function\"\n ? await responseHandler(response)\n : unwrapData &&\n response.data !== null &&\n typeof response.data === \"object\" &&\n \"data\" in response.data\n ? response.data.data\n : response.data;\n if (schema) data = await schema.parseAsync(data);\n const result = data as Data;\n await onSuccess?.(result);\n notify(\"success\", toast, result);\n return result;\n } catch (error) {\n let normalized = normalizeCallerError(error);\n if (options.mapError)\n normalized = options.mapError(\n normalized,\n isAxiosError(error) ? error.response?.data : undefined,\n );\n await onError?.(normalized);\n if (normalized.code !== \"ERR_CANCELED\")\n notify(\"error\", toast, normalized);\n throw normalized;\n }\n }\n\n const http = {\n request: caller,\n get<Data = unknown, Params = Record<string, unknown>>(\n url: string,\n input: CallerMethodOptions<Data, never, Params> = {},\n ) {\n return caller<Data, never, Params>({ ...input, url, method: \"GET\" });\n },\n post<Data = unknown, Body = unknown, Params = Record<string, unknown>>(\n url: string,\n body?: Body,\n input: CallerMethodOptions<Data, Body, Params> = {},\n ) {\n return caller<Data, Body, Params>({\n ...input,\n url,\n method: \"POST\",\n body,\n });\n },\n put<Data = unknown, Body = unknown, Params = Record<string, unknown>>(\n url: string,\n body?: Body,\n input: CallerMethodOptions<Data, Body, Params> = {},\n ) {\n return caller<Data, Body, Params>({ ...input, url, method: \"PUT\", body });\n },\n patch<Data = unknown, Body = unknown, Params = Record<string, unknown>>(\n url: string,\n body?: Body,\n input: CallerMethodOptions<Data, Body, Params> = {},\n ) {\n return caller<Data, Body, Params>({\n ...input,\n url,\n method: \"PATCH\",\n body,\n });\n },\n delete<Data = unknown, Body = unknown, Params = Record<string, unknown>>(\n url: string,\n input: Omit<\n CallerRequestOptions<Data, Body, Params>,\n \"url\" | \"method\"\n > = {},\n ) {\n return caller<Data, Body, Params>({ ...input, url, method: \"DELETE\" });\n },\n head<Data = unknown, Params = Record<string, unknown>>(\n url: string,\n input: CallerMethodOptions<Data, never, Params> = {},\n ) {\n return caller<Data, never, Params>({ ...input, url, method: \"HEAD\" });\n },\n options<Data = unknown, Body = unknown, Params = Record<string, unknown>>(\n url: string,\n input: Omit<\n CallerRequestOptions<Data, Body, Params>,\n \"url\" | \"method\"\n > = {},\n ) {\n return caller<Data, Body, Params>({ ...input, url, method: \"OPTIONS\" });\n },\n };\n return {\n caller,\n http,\n reset: () => retry?.reset(),\n dispose: () => retry?.dispose(),\n };\n}\n\nexport type {\n CallerOptions,\n CallerRequestOptions,\n CallerResponseHandler,\n CallerToastOptions,\n} from \"@/utils/interface\";\n"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("axios");var t=class extends Error{status;code;details;constructor(e,t={}){super(e),this.name=`CallerError`,this.status=t.status,this.code=t.code,this.details=t.details}};function n(n){return n instanceof t?n:(0,e.isAxiosError)(n)?new t(n.code===`ERR_CANCELED`?`Request cancelled`:`Request failed`,{status:n.response?.status,code:n.code}):n instanceof DOMException&&n.name===`AbortError`?new t(`Request cancelled`,{code:`ERR_CANCELED`}):new t(`Request failed`)}exports.CallerError=t,exports.normalizeCallerError=n;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{isAxiosError as e}from"axios";var t=class extends Error{status;code;details;constructor(e,t={}){super(e),this.name=`CallerError`,this.status=t.status,this.code=t.code,this.details=t.details}};function n(n){return n instanceof t?n:e(n)?new t(n.code===`ERR_CANCELED`?`Request cancelled`:`Request failed`,{status:n.response?.status,code:n.code}):n instanceof DOMException&&n.name===`AbortError`?new t(`Request cancelled`,{code:`ERR_CANCELED`}):new t(`Request failed`)}export{t as CallerError,n as normalizeCallerError};
|
|
2
|
+
//# sourceMappingURL=error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.js","names":["CallerError","message","options","normalizeCallerError","error","isAxiosError"],"sources":["../../../src/modules/http/error.ts"],"sourcesContent":["import type { CallerErrorOptions } from \"@/utils/interface\";\nimport { isAxiosError } from \"axios\";\n\nexport class CallerError extends Error {\n readonly status?: number;\n readonly code?: string;\n readonly details?: unknown;\n constructor(message: string, options: CallerErrorOptions = {}) {\n super(message);\n this.name = \"CallerError\";\n this.status = options.status;\n this.code = options.code;\n this.details = options.details;\n }\n}\n\n/** Do not propagate raw Axios errors (which contain credentials and request bodies). */\nexport function normalizeCallerError(error: unknown): CallerError {\n if (error instanceof CallerError) return error;\n if (isAxiosError(error)) {\n return new CallerError(\n error.code === \"ERR_CANCELED\" ? \"Request cancelled\" : \"Request failed\",\n {\n status: error.response?.status,\n code: error.code,\n },\n );\n }\n if (error instanceof DOMException && error.name === \"AbortError\")\n return new CallerError(\"Request cancelled\", { code: \"ERR_CANCELED\" });\n return new CallerError(\"Request failed\");\n}\n\nexport type { CallerErrorOptions } from \"@/utils/interface\";\n"],"mappings":"A,qCAGA,IAAaA,EAAb,cAAiC,KAAM,CACrC,OACA,KACA,QACA,YAAY,EAAiB,EAA8B,CAAC,EAAG,CAC7D,MAAMC,CAAO,EACb,KAAK,KAAO,cACZ,KAAK,OAASC,EAAQ,OACtB,KAAK,KAAOA,EAAQ,KACpB,KAAK,QAAUA,EAAQ,OACzB,CACF,EAGA,SAAgBC,EAAqB,EAA6B,CAahE,OAZIC,aAAiBJ,EAAoBI,EACrCC,EAAaD,CAAK,EACb,IAAIJ,EACTI,EAAM,OAAS,eAAiB,oBAAsB,iBACtD,CACE,OAAQA,EAAM,UAAU,OACxB,KAAMA,EAAM,IACd,CACF,EAEEA,aAAiB,cAAgBA,EAAM,OAAS,aAC3C,IAAIJ,EAAY,oBAAqB,CAAE,KAAM,cAAe,CAAC,EAC/D,IAAIA,EAAY,gBAAgB,CACzC,C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("zod");var t=class extends Error{code;status;constructor(e,t=500){if(!/^[a-z][a-z0-9_]{0,127}$/.test(e)||!Number.isInteger(t)||t<400||t>599)throw TypeError(`Invalid service error contract`);super(e),this.code=e,this.status=t,this.name=`ServiceError`}};function n(n){if(n instanceof t)return{status:n.status,code:n.code};if(n instanceof e.ZodError)return{status:400,code:`validation_error`,details:{issues:n.issues.map(e=>({code:e.code,path:e.path}))}}}exports.ServiceError=t,exports.serviceFailure=n;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ServiceFailure {
|
|
2
|
+
status: number;
|
|
3
|
+
code: string;
|
|
4
|
+
headers?: HeadersInit;
|
|
5
|
+
details?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
/** Only public codes belong here; never pass provider messages or credentials. */
|
|
8
|
+
export declare class ServiceError extends Error {
|
|
9
|
+
readonly code: string;
|
|
10
|
+
readonly status: number;
|
|
11
|
+
constructor(code: string, status?: number);
|
|
12
|
+
}
|
|
13
|
+
export declare function serviceFailure(error: unknown): ServiceFailure | undefined;
|
|
14
|
+
//# sourceMappingURL=failure.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failure.d.cts","names":[],"sources":["../../../src/modules/http/failure.ts"],"mappings":"A,iBAEiB;EACf;EACA;EACA,UAAU;EACV,UAAU;;;qBAIC,qBAAqB;WAEd;WACA;EADA,YAAA,cACA;;wBAcJ,eAAe,iBAAiB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ServiceFailure {
|
|
2
|
+
status: number;
|
|
3
|
+
code: string;
|
|
4
|
+
headers?: HeadersInit;
|
|
5
|
+
details?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
/** Only public codes belong here; never pass provider messages or credentials. */
|
|
8
|
+
export declare class ServiceError extends Error {
|
|
9
|
+
readonly code: string;
|
|
10
|
+
readonly status: number;
|
|
11
|
+
constructor(code: string, status?: number);
|
|
12
|
+
}
|
|
13
|
+
export declare function serviceFailure(error: unknown): ServiceFailure | undefined;
|
|
14
|
+
//# sourceMappingURL=failure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failure.d.ts","names":[],"sources":["../../../src/modules/http/failure.ts"],"mappings":"A,iBAEiB;EACf;EACA;EACA,UAAU;EACV,UAAU;;;qBAIC,qBAAqB;WAEd;WACA;EADA,YAAA,cACA;;wBAcJ,eAAe,iBAAiB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ZodError as e}from"zod";var t=class extends Error{code;status;constructor(e,t=500){if(!/^[a-z][a-z0-9_]{0,127}$/.test(e)||!Number.isInteger(t)||t<400||t>599)throw TypeError(`Invalid service error contract`);super(e),this.code=e,this.status=t,this.name=`ServiceError`}};function n(n){if(n instanceof t)return{status:n.status,code:n.code};if(n instanceof e)return{status:400,code:`validation_error`,details:{issues:n.issues.map(e=>({code:e.code,path:e.path}))}}}export{t as ServiceError,n as serviceFailure};
|
|
2
|
+
//# sourceMappingURL=failure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failure.js","names":["ServiceError","code","status","serviceFailure","error","ZodError","issue"],"sources":["../../../src/modules/http/failure.ts"],"sourcesContent":["import { ZodError } from \"zod\";\n\nexport interface ServiceFailure {\n status: number;\n code: string;\n headers?: HeadersInit;\n details?: Record<string, unknown>;\n}\n\n/** Only public codes belong here; never pass provider messages or credentials. */\nexport class ServiceError extends Error {\n constructor(\n public readonly code: string,\n public readonly status = 500,\n ) {\n if (\n !/^[a-z][a-z0-9_]{0,127}$/.test(code) ||\n !Number.isInteger(status) ||\n status < 400 ||\n status > 599\n )\n throw new TypeError(\"Invalid service error contract\");\n super(code);\n this.name = \"ServiceError\";\n }\n}\n\nexport function serviceFailure(error: unknown): ServiceFailure | undefined {\n if (error instanceof ServiceError) return { status: error.status, code: error.code };\n if (error instanceof ZodError)\n return {\n status: 400,\n code: \"validation_error\",\n details: {\n // Do not return custom messages, inputs or schema internals by default.\n issues: error.issues.map((issue) => ({ code: issue.code, path: issue.path })),\n },\n };\n}\n"],"mappings":"A,+BAUA,IAAaA,EAAb,cAAkC,KAAM,CAEpB,KACA,OAFlB,YACE,EACA,EAAyB,IACzB,CACA,GACE,CAAC,0BAA0B,KAAKC,CAAI,GACpC,CAAC,OAAO,UAAUC,CAAM,GACxBA,EAAS,KACTA,EAAS,IAET,MAAU,UAAU,gCAAgC,EACtD,MAAMD,CAAI,EAVM,KAAA,KAAAA,EACA,KAAA,OAAAC,EAUhB,KAAK,KAAO,cACd,CACF,EAEA,SAAgBC,EAAe,EAA4C,CACzE,GAAIC,aAAiBJ,EAAc,MAAO,CAAE,OAAQI,EAAM,OAAQ,KAAMA,EAAM,IAAK,EACnF,GAAIA,aAAiBC,EACnB,MAAO,CACL,OAAQ,IACR,KAAM,mBACN,QAAS,CAEP,OAAQD,EAAM,OAAO,IAAK,IAAW,CAAE,KAAME,EAAM,KAAM,KAAMA,EAAM,IAAK,EAAE,CAC9E,CACF,CACJ,C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("axios");function t(t){return async function(n){let{url:r,method:i,body:a,params:o,headers:s,cache:c,credentials:l,redirect:u,maxRedirects:d,...f}=n,p=new e.AxiosHeaders(s);c===`no-store`?p.set(`Cache-Control`,`no-store`,!1):(c===`no-cache`||c===`reload`)&&p.set(`Cache-Control`,`no-cache`,!1);let m=await t.request({...f,url:String(r),method:i,data:a,params:o,headers:p,maxRedirects:u===`manual`||u===`error`?0:d,...l===void 0?{}:{withCredentials:l===`include`}});if(u===`error`&&m.status>=300&&m.status<400)throw Error(`Redirect refused`);return m}}exports.createFetcher=t;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { E as FetcherOptions } from "../../interface-ii8DV63k.cjs";
|
|
2
|
+
import { AxiosInstance, AxiosResponse } from "axios";
|
|
3
|
+
/** App owns instance setup, adapter selection, authentication and destination policy. */
|
|
4
|
+
export declare function createFetcher(client: Pick<AxiosInstance, "request">): <Data = unknown, Body = unknown, Params = Record<string, unknown>>(options: FetcherOptions<Body, Params>) => Promise<AxiosResponse<Data, Body>>;
|
|
5
|
+
export type { FetcherOptions };
|
|
6
|
+
//# sourceMappingURL=fetcher.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetcher.d.cts","names":[],"sources":["../../../src/modules/http/fetcher.ts"],"mappings":";;;wBASgB,cAAc,QAAQ,KAAK,6BAEvC,gBACA,gBACA,SAAS,yBACT,SAAS,eAAe,MAAM,YAAU,QAAQ,cAAc,MAAM"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { E as FetcherOptions } from "../../interface-ii8DV63k.js";
|
|
2
|
+
import { AxiosInstance, AxiosResponse } from "axios";
|
|
3
|
+
/** App owns instance setup, adapter selection, authentication and destination policy. */
|
|
4
|
+
export declare function createFetcher(client: Pick<AxiosInstance, "request">): <Data = unknown, Body = unknown, Params = Record<string, unknown>>(options: FetcherOptions<Body, Params>) => Promise<AxiosResponse<Data, Body>>;
|
|
5
|
+
export type { FetcherOptions };
|
|
6
|
+
//# sourceMappingURL=fetcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetcher.d.ts","names":[],"sources":["../../../src/modules/http/fetcher.ts"],"mappings":";;;wBASgB,cAAc,QAAQ,KAAK,6BAEvC,gBACA,gBACA,SAAS,yBACT,SAAS,eAAe,MAAM,YAAU,QAAQ,cAAc,MAAM"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{AxiosHeaders as e}from"axios";function t(t){return async function(n){let{url:r,method:i,body:a,params:o,headers:s,cache:c,credentials:l,redirect:u,maxRedirects:d,...f}=n,p=new e(s);c===`no-store`?p.set(`Cache-Control`,`no-store`,!1):(c===`no-cache`||c===`reload`)&&p.set(`Cache-Control`,`no-cache`,!1);let m=await t.request({...f,url:String(r),method:i,data:a,params:o,headers:p,maxRedirects:u===`manual`||u===`error`?0:d,...l===void 0?{}:{withCredentials:l===`include`}});if(u===`error`&&m.status>=300&&m.status<400)throw Error(`Redirect refused`);return m}}export{t as createFetcher};
|
|
2
|
+
//# sourceMappingURL=fetcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetcher.js","names":["createFetcher","config","options","nextHeaders","AxiosHeaders","headers","cache","response","client","url","body","redirect","maxRedirects","credentials"],"sources":["../../../src/modules/http/fetcher.ts"],"sourcesContent":["import type { FetcherOptions } from \"@/utils/interface\";\nimport {\n AxiosHeaders,\n type AxiosInstance,\n type AxiosResponse,\n type RawAxiosHeaders,\n} from \"axios\";\n\n/** App owns instance setup, adapter selection, authentication and destination policy. */\nexport function createFetcher(client: Pick<AxiosInstance, \"request\">) {\n return async function fetcher<\n Data = unknown,\n Body = unknown,\n Params = Record<string, unknown>,\n >(options: FetcherOptions<Body, Params>): Promise<AxiosResponse<Data, Body>> {\n const {\n url,\n method,\n body,\n params,\n headers,\n cache,\n credentials,\n redirect,\n maxRedirects,\n ...config\n } = options;\n const nextHeaders = new AxiosHeaders(\n headers as RawAxiosHeaders | AxiosHeaders | undefined,\n );\n if (cache === \"no-store\")\n nextHeaders.set(\"Cache-Control\", \"no-store\", false);\n else if (cache === \"no-cache\" || cache === \"reload\")\n nextHeaders.set(\"Cache-Control\", \"no-cache\", false);\n const response = await client.request<\n Data,\n AxiosResponse<Data, Body>,\n Body\n >({\n ...config,\n url: String(url),\n method,\n data: body,\n params,\n headers: nextHeaders,\n maxRedirects:\n redirect === \"manual\" || redirect === \"error\" ? 0 : maxRedirects,\n ...(credentials === undefined\n ? {}\n : { withCredentials: credentials === \"include\" }),\n });\n if (redirect === \"error\" && response.status >= 300 && response.status < 400)\n throw new Error(\"Redirect refused\");\n return response;\n };\n}\n\nexport type { FetcherOptions } from \"@/utils/interface\";\n"],"mappings":"A,qCASA,SAAgBA,EAAc,EAAwC,CACpE,OAAO,eAIL,EAA2E,CAC3E,GAAM,CACJ,MACA,SACA,OACA,SACA,UACA,QACA,cACA,WACA,eACA,GAAGC,GACDC,EACEC,EAAc,IAAIC,EACtBC,CACF,EACIC,IAAU,WACZH,EAAY,IAAI,gBAAiB,WAAY,EAAK,GAC3CG,IAAU,YAAcA,IAAU,WACzCH,EAAY,IAAI,gBAAiB,WAAY,EAAK,EACpD,IAAMI,EAAW,MAAMC,EAAO,QAI5B,CACA,GAAGP,EACH,IAAK,OAAOQ,CAAG,EACf,SACA,KAAMC,EACN,SACA,QAASP,EACT,aACEQ,IAAa,UAAYA,IAAa,QAAU,EAAIC,EACtD,GAAIC,IAAgB,IAAA,GAChB,CAAC,EACD,CAAE,gBAAiBA,IAAgB,SAAU,CACnD,CAAC,EACD,GAAIF,IAAa,SAAWJ,EAAS,QAAU,KAAOA,EAAS,OAAS,IACtE,MAAU,MAAM,kBAAkB,EACpC,OAAOA,CACT,CACF,C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./caller.cjs"),t=require("./error.cjs"),n=require("./fetcher.cjs"),r=require("./response.cjs"),i=require("./failure.cjs");exports.CallerError=t.CallerError,exports.ServiceError=i.ServiceError,exports.createCaller=e.createCaller,exports.createFetcher=n.createFetcher,exports.normalizeCallerError=t.normalizeCallerError,exports.serviceFailure=i.serviceFailure,exports.toWebResponse=r.toWebResponse;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createCaller } from "./caller.cjs";
|
|
2
|
+
import { E as FetcherOptions, G as CallerError, K as normalizeCallerError, W as WebResponseOptions, _ as CallerToastOptions, f as CallerErrorOptions, g as CallerResponseHandler, h as CallerRequestOptions, m as CallerOptions } from "../../interface-ii8DV63k.cjs";
|
|
3
|
+
import { createFetcher } from "./fetcher.cjs";
|
|
4
|
+
import { toWebResponse } from "./response.cjs";
|
|
5
|
+
import { ServiceError, ServiceFailure, serviceFailure } from "./failure.cjs";
|
|
6
|
+
export { CallerError, type CallerErrorOptions, type CallerOptions, type CallerRequestOptions, type CallerResponseHandler, type CallerToastOptions, type FetcherOptions, ServiceError, type ServiceFailure, type WebResponseOptions, createCaller, createFetcher, normalizeCallerError, serviceFailure, toWebResponse };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createCaller } from "./caller.js";
|
|
2
|
+
import { E as FetcherOptions, G as CallerError, K as normalizeCallerError, W as WebResponseOptions, _ as CallerToastOptions, f as CallerErrorOptions, g as CallerResponseHandler, h as CallerRequestOptions, m as CallerOptions } from "../../interface-ii8DV63k.js";
|
|
3
|
+
import { createFetcher } from "./fetcher.js";
|
|
4
|
+
import { toWebResponse } from "./response.js";
|
|
5
|
+
import { ServiceError, ServiceFailure, serviceFailure } from "./failure.js";
|
|
6
|
+
export { CallerError, type CallerErrorOptions, type CallerOptions, type CallerRequestOptions, type CallerResponseHandler, type CallerToastOptions, type FetcherOptions, ServiceError, type ServiceFailure, type WebResponseOptions, createCaller, createFetcher, normalizeCallerError, serviceFailure, toWebResponse };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createCaller as e}from"./caller.js";import{CallerError as t,normalizeCallerError as n}from"./error.js";import{createFetcher as r}from"./fetcher.js";import{toWebResponse as i}from"./response.js";import{ServiceError as a,serviceFailure as o}from"./failure.js";export{t as CallerError,a as ServiceError,e as createCaller,r as createFetcher,n as normalizeCallerError,o as serviceFailure,i as toWebResponse};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../utils/formatter.cjs");function t(t,n={}){let r=e.formatResponseHeaders(t),i=n.emptyBody||[204,205,304].includes(t.status)?null:n.mapBody?n.mapBody(t.data):e.formatResponseBody(t.data,r);return new Response(i,{status:t.status,statusText:t.statusText,headers:r})}exports.toWebResponse=t;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { W as WebResponseOptions } from "../../interface-ii8DV63k.cjs";
|
|
2
|
+
import { AxiosResponse } from "axios";
|
|
3
|
+
/** Preserves multiple Set-Cookie values and JSON null; 204/205/304 have no body. */
|
|
4
|
+
export declare function toWebResponse<Data>(response: AxiosResponse<Data>, options?: WebResponseOptions): Response;
|
|
5
|
+
export type { WebResponseOptions };
|
|
6
|
+
//# sourceMappingURL=response.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.d.cts","names":[],"sources":["../../../src/modules/http/response.ts"],"mappings":";;;wBAKgB,cAAc,MAC5B,UAAU,cAAc,OACxB,UAAS,qBACR"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { W as WebResponseOptions } from "../../interface-ii8DV63k.js";
|
|
2
|
+
import { AxiosResponse } from "axios";
|
|
3
|
+
/** Preserves multiple Set-Cookie values and JSON null; 204/205/304 have no body. */
|
|
4
|
+
export declare function toWebResponse<Data>(response: AxiosResponse<Data>, options?: WebResponseOptions): Response;
|
|
5
|
+
export type { WebResponseOptions };
|
|
6
|
+
//# sourceMappingURL=response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.d.ts","names":[],"sources":["../../../src/modules/http/response.ts"],"mappings":";;;wBAKgB,cAAc,MAC5B,UAAU,cAAc,OACxB,UAAS,qBACR"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{formatResponseBody as e,formatResponseHeaders as t}from"../../utils/formatter.js";function n(n,r={}){let i=t(n),a=r.emptyBody||[204,205,304].includes(n.status)?null:r.mapBody?r.mapBody(n.data):e(n.data,i);return new Response(a,{status:n.status,statusText:n.statusText,headers:i})}export{n as toWebResponse};
|
|
2
|
+
//# sourceMappingURL=response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","names":["toWebResponse","headers","formatResponseHeaders","response","body","options","formatResponseBody"],"sources":["../../../src/modules/http/response.ts"],"sourcesContent":["import { formatResponseBody, formatResponseHeaders } from \"@/utils/formatter\";\nimport type { WebResponseOptions } from \"@/utils/interface\";\nimport type { AxiosResponse } from \"axios\";\n\n/** Preserves multiple Set-Cookie values and JSON null; 204/205/304 have no body. */\nexport function toWebResponse<Data>(\n response: AxiosResponse<Data>,\n options: WebResponseOptions = {},\n): Response {\n const headers = formatResponseHeaders(response);\n const body =\n options.emptyBody || [204, 205, 304].includes(response.status)\n ? null\n : options.mapBody\n ? options.mapBody(response.data)\n : formatResponseBody(response.data, headers);\n return new Response(body, {\n status: response.status,\n statusText: response.statusText,\n headers,\n });\n}\n\nexport type { WebResponseOptions } from \"@/utils/interface\";\n"],"mappings":"A,yFAKA,SAAgBA,EACd,EACA,EAA8B,CAAC,EACrB,CACV,IAAMC,EAAUC,EAAsBC,CAAQ,EACxCC,EACJC,EAAQ,WAAa,CAAC,IAAK,IAAK,GAAG,CAAC,CAAC,SAASF,EAAS,MAAM,EACzD,KACAE,EAAQ,QACNA,EAAQ,QAAQF,EAAS,IAAI,EAC7BG,EAAmBH,EAAS,KAAMF,CAAO,EACjD,OAAO,IAAI,SAASG,EAAM,CACxB,OAAQD,EAAS,OACjB,WAAYA,EAAS,WACrB,SACF,CAAC,CACH,C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../common/admin.cjs");function t(t,n,r){return e.createCommonPublicClient(t,n,r)}exports.createExpressClient=t;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { SupabaseClientOptions } from "@supabase/supabase-js";
|
|
2
|
+
export declare function createExpressClient(url: string, anonOrPublishableKey: string, options?: SupabaseClientOptions<"public">): import("@supabase/supabase-js").SupabaseClient<any, "public", "public", any, any>;
|
|
3
|
+
//# sourceMappingURL=client.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.cts","names":[],"sources":["../../../../src/modules/supabase/express/client.ts"],"mappings":";wBAGgB,oBACd,aACA,8BACA,UAAU,kEAA+B"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { SupabaseClientOptions } from "@supabase/supabase-js";
|
|
2
|
+
export declare function createExpressClient(url: string, anonOrPublishableKey: string, options?: SupabaseClientOptions<"public">): import("@supabase/supabase-js").SupabaseClient<any, "public", "public", any, any>;
|
|
3
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","names":[],"sources":["../../../../src/modules/supabase/express/client.ts"],"mappings":";wBAGgB,oBACd,aACA,8BACA,UAAU,kEAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","names":["createExpressClient","createCommonPublicClient","url","anonOrPublishableKey","options"],"sources":["../../../../src/modules/supabase/express/client.ts"],"sourcesContent":["import { createCommonPublicClient } from \"@/modules/common/admin\";\nimport type { SupabaseClientOptions } from \"@supabase/supabase-js\";\n\nexport function createExpressClient(\n url: string,\n anonOrPublishableKey: string,\n options?: SupabaseClientOptions<\"public\">,\n) {\n return createCommonPublicClient(url, anonOrPublishableKey, options);\n}\n"],"mappings":"A,iEAGA,SAAgBA,EACd,EACA,EACA,EACA,CACA,OAAOC,EAAyBC,EAAKC,EAAsBC,CAAO,CACpE,C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./client.cjs");require("./server.cjs"),exports.createExpressClient=e.createExpressClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{createExpressClient}from"./client.js";import"./server.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./client.cjs");exports.createExpressClient=e.createExpressClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{createExpressClient}from"./client.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@supabase/ssr");function t(t,n,r){return(0,e.createBrowserClient)(t,n,r)}exports.createNextClient=t;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { b as DefaultSchema, y as DatabaseSchema } from "../../../interface-ii8DV63k.cjs";
|
|
2
|
+
import { SupabaseClientOptions } from "@supabase/supabase-js";
|
|
3
|
+
export declare function createNextClient<Database = any, SchemaName extends DatabaseSchema<Database> = DefaultSchema<Database>>(url: string, publishableKey: string, options?: SupabaseClientOptions<SchemaName>): import("@supabase/supabase-js").SupabaseClient<Database, SchemaName, SchemaName extends string & Exclude<keyof Database, "__InternalSupabase"> ? SchemaName : "public" extends Exclude<keyof Database, "__InternalSupabase"> ? Exclude<keyof Database, "__InternalSupabase"> & "public" : string & Exclude<Exclude<keyof Database, "__InternalSupabase">, "__InternalSupabase">, Omit<Database, "__InternalSupabase">[SchemaName extends string & Exclude<keyof Database, "__InternalSupabase"> ? SchemaName : "public" extends Exclude<keyof Database, "__InternalSupabase"> ? Exclude<keyof Database, "__InternalSupabase"> & "public" : string & Exclude<Exclude<keyof Database, "__InternalSupabase">, "__InternalSupabase">] extends {
|
|
4
|
+
Tables: Record<string, {
|
|
5
|
+
Row: Record<string, unknown>;
|
|
6
|
+
Insert: Record<string, unknown>;
|
|
7
|
+
Update: Record<string, unknown>;
|
|
8
|
+
Relationships: {
|
|
9
|
+
foreignKeyName: string;
|
|
10
|
+
columns: string[];
|
|
11
|
+
isOneToOne?: boolean;
|
|
12
|
+
referencedRelation: string;
|
|
13
|
+
referencedColumns: string[];
|
|
14
|
+
}[];
|
|
15
|
+
ComputedFields?: string;
|
|
16
|
+
}>;
|
|
17
|
+
Views: Record<string, {
|
|
18
|
+
Row: Record<string, unknown>;
|
|
19
|
+
Insert: Record<string, unknown>;
|
|
20
|
+
Update: Record<string, unknown>;
|
|
21
|
+
Relationships: {
|
|
22
|
+
foreignKeyName: string;
|
|
23
|
+
columns: string[];
|
|
24
|
+
isOneToOne?: boolean;
|
|
25
|
+
referencedRelation: string;
|
|
26
|
+
referencedColumns: string[];
|
|
27
|
+
}[];
|
|
28
|
+
ComputedFields?: string;
|
|
29
|
+
} | {
|
|
30
|
+
Row: Record<string, unknown>;
|
|
31
|
+
Relationships: {
|
|
32
|
+
foreignKeyName: string;
|
|
33
|
+
columns: string[];
|
|
34
|
+
isOneToOne?: boolean;
|
|
35
|
+
referencedRelation: string;
|
|
36
|
+
referencedColumns: string[];
|
|
37
|
+
}[];
|
|
38
|
+
ComputedFields?: string;
|
|
39
|
+
}>;
|
|
40
|
+
Functions: Record<string, {
|
|
41
|
+
Args: Record<string, unknown> | never;
|
|
42
|
+
Returns: unknown;
|
|
43
|
+
SetofOptions?: {
|
|
44
|
+
isSetofReturn?: boolean | undefined;
|
|
45
|
+
isOneToOne?: boolean | undefined;
|
|
46
|
+
isNotNullable?: boolean | undefined;
|
|
47
|
+
to: string;
|
|
48
|
+
from: string;
|
|
49
|
+
};
|
|
50
|
+
}>;
|
|
51
|
+
} ? Omit<Database, "__InternalSupabase">[SchemaName extends string & Exclude<keyof Database, "__InternalSupabase"> ? SchemaName : "public" extends Exclude<keyof Database, "__InternalSupabase"> ? Exclude<keyof Database, "__InternalSupabase"> & "public" : string & Exclude<Exclude<keyof Database, "__InternalSupabase">, "__InternalSupabase">] : never, SchemaName extends string & Exclude<keyof Database, "__InternalSupabase"> ? Database extends {
|
|
52
|
+
__InternalSupabase: {
|
|
53
|
+
PostgrestVersion: string;
|
|
54
|
+
};
|
|
55
|
+
} ? Database["__InternalSupabase"] : {
|
|
56
|
+
PostgrestVersion: "12";
|
|
57
|
+
} : SchemaName extends {
|
|
58
|
+
PostgrestVersion: string;
|
|
59
|
+
} ? SchemaName : never>;
|
|
60
|
+
//# sourceMappingURL=client.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.cts","names":[],"sources":["../../../../src/modules/supabase/next/client.ts"],"mappings":";;wBAIgB,iBACd,gBACA,mBAAmB,eAAe,YAAY,cAAc,WAE5D,aACA,wBACA,UAAU,sBAAsB,8CAAW,eAAA,UAAA,YAAA,4BAAA,cAAA,kCAAA,8BAAA,cAAA,kCAAA,cAAA,sDAAA,QAAA,cAAA,wDAAA,KAAA,gCAAA,4BAAA,cAAA,kCAAA,8BAAA,cAAA,kCAAA,cAAA,sDAAA,QAAA,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAO5C"}
|