@pol-studios/db 1.0.0 → 1.0.2

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.
Files changed (49) hide show
  1. package/README.md +434 -0
  2. package/dist/EntityPermissions-DwFt4tUd.d.ts +35 -0
  3. package/dist/FilterConfig-Bt2Ek74z.d.ts +99 -0
  4. package/dist/UserMetadataContext-BYYqA6LI.d.ts +89 -0
  5. package/dist/auth/context.d.ts +47 -0
  6. package/dist/auth/context.js +12791 -0
  7. package/dist/auth/context.js.map +1 -0
  8. package/dist/auth/guards.d.ts +180 -0
  9. package/dist/auth/guards.js +7651 -0
  10. package/dist/auth/guards.js.map +1 -0
  11. package/dist/auth/hooks.d.ts +312 -0
  12. package/dist/auth/hooks.js +10600 -0
  13. package/dist/auth/hooks.js.map +1 -0
  14. package/dist/auth/index.d.ts +10 -0
  15. package/dist/auth/index.js +13035 -0
  16. package/dist/auth/index.js.map +1 -0
  17. package/dist/client/index.d.ts +16 -0
  18. package/dist/core/index.d.ts +508 -0
  19. package/dist/executor-CB4KHyYG.d.ts +507 -0
  20. package/dist/gen/index.d.ts +1099 -0
  21. package/dist/hooks/index.d.ts +83 -0
  22. package/dist/index-DNrSptau.d.ts +8780 -0
  23. package/dist/index.d.ts +338 -0
  24. package/dist/index.js +10320 -7124
  25. package/dist/index.js.map +1 -1
  26. package/dist/index.web.d.ts +318 -0
  27. package/dist/index.web.js +56795 -0
  28. package/dist/index.web.js.map +1 -0
  29. package/dist/mutation/index.d.ts +58 -0
  30. package/dist/mutation/index.js +4581 -76
  31. package/dist/mutation/index.js.map +1 -1
  32. package/dist/parser/index.d.ts +366 -0
  33. package/dist/parser/index.js +26 -26
  34. package/dist/parser/index.js.map +1 -1
  35. package/dist/query/index.d.ts +723 -0
  36. package/dist/query/index.js +13124 -10324
  37. package/dist/query/index.js.map +1 -1
  38. package/dist/realtime/index.d.ts +44 -0
  39. package/dist/realtime/index.js +13217 -9297
  40. package/dist/realtime/index.js.map +1 -1
  41. package/dist/select-query-parser-CLkOKHzc.d.ts +352 -0
  42. package/dist/types/index.d.ts +6 -0
  43. package/dist/types-CKsWM8T3.d.ts +62 -0
  44. package/dist/useBatchUpsert-ooLlpJMg.d.ts +24 -0
  45. package/dist/useDbCount-B5-Va9sg.d.ts +1740 -0
  46. package/dist/useDbQuery-C-TL8jY1.d.ts +19 -0
  47. package/dist/useResolveFeedback-DuGP4Tgb.d.ts +1165 -0
  48. package/dist/useSupabase-pPhUZHcl.d.ts +27 -0
  49. package/package.json +31 -7
@@ -0,0 +1,27 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as _supabase_supabase_js_dist_module_lib_types_js from '@supabase/supabase-js/dist/module/lib/types.js';
3
+ import { ReactNode } from 'react';
4
+ import { SupabaseClient, SupabaseClientOptions } from '@supabase/supabase-js';
5
+
6
+ interface SupabaseDatabaseTypes {
7
+ }
8
+ type Database = SupabaseDatabaseTypes extends {
9
+ Database: infer D;
10
+ } ? D : any;
11
+ type TypedSupabaseClient = SupabaseClient<Database>;
12
+ declare const UserSessionId: string;
13
+ declare function createNewSupabaseClient<SchemaName extends string & keyof Database = "public" extends keyof Database ? "public" : string & keyof Database>(options?: SupabaseClientOptions<SchemaName>): SupabaseClient<any, SchemaName, SchemaName extends string ? SchemaName : "public", Omit<any, "__InternalSupabase">[SchemaName extends string ? SchemaName : "public"] extends _supabase_supabase_js_dist_module_lib_types_js.GenericSchema ? Omit<any, "__InternalSupabase">[SchemaName extends string ? SchemaName : "public"] : never, SchemaName extends string ? any : SchemaName extends {
14
+ PostgrestVersion: string;
15
+ } ? SchemaName : never>;
16
+ declare function onSupabaseInitialized(afterInitialize: (supabase: SupabaseClient) => any): void;
17
+ declare function setDefaultOptions(options: SupabaseClientOptions<string & keyof Database>): void;
18
+ declare let typedSupabase: SupabaseClient<Database>;
19
+ declare function useSupabase(): SupabaseClient<any, "public", "public", any, any>;
20
+ declare function SupabaseProvider({ children, options, afterInitialize, supabaseClient: supabaseClientProp, }: {
21
+ children: ReactNode;
22
+ options?: SupabaseClientOptions<string & keyof Database>;
23
+ afterInitialize?: (supabase: SupabaseClient<Database>) => any;
24
+ supabaseClient?: SupabaseClient<Database>;
25
+ }): react_jsx_runtime.JSX.Element;
26
+
27
+ export { type Database as D, type SupabaseDatabaseTypes as S, type TypedSupabaseClient as T, UserSessionId as U, SupabaseProvider as a, createNewSupabaseClient as c, onSupabaseInitialized as o, setDefaultOptions as s, typedSupabase as t, useSupabase as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pol-studios/db",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Database layer for React applications with Supabase and PowerSync support",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -8,8 +8,18 @@
8
8
  "types": "./dist/index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
- "import": "./dist/index.js",
12
- "types": "./dist/index.d.ts"
11
+ "react-native": {
12
+ "import": "./dist/index.js",
13
+ "types": "./dist/index.d.ts"
14
+ },
15
+ "browser": {
16
+ "import": "./dist/index.web.js",
17
+ "types": "./dist/index.web.d.ts"
18
+ },
19
+ "default": {
20
+ "import": "./dist/index.js",
21
+ "types": "./dist/index.d.ts"
22
+ }
13
23
  },
14
24
  "./client": {
15
25
  "import": "./dist/client/index.js",
@@ -46,6 +56,22 @@
46
56
  "./gen": {
47
57
  "import": "./dist/gen/index.js",
48
58
  "types": "./dist/gen/index.d.ts"
59
+ },
60
+ "./auth": {
61
+ "import": "./dist/auth/index.js",
62
+ "types": "./dist/auth/index.d.ts"
63
+ },
64
+ "./auth/context": {
65
+ "import": "./dist/auth/context.js",
66
+ "types": "./dist/auth/context.d.ts"
67
+ },
68
+ "./auth/hooks": {
69
+ "import": "./dist/auth/hooks.js",
70
+ "types": "./dist/auth/hooks.d.ts"
71
+ },
72
+ "./auth/guards": {
73
+ "import": "./dist/auth/guards.js",
74
+ "types": "./dist/auth/guards.d.ts"
49
75
  }
50
76
  },
51
77
  "files": [
@@ -67,7 +93,6 @@
67
93
  "prepublishOnly": "pnpm build"
68
94
  },
69
95
  "peerDependencies": {
70
- "@pol-studios/auth": ">=1.0.0",
71
96
  "@pol-studios/hooks": ">=1.0.0",
72
97
  "@powersync/react-native": ">=1.0.0",
73
98
  "@react-native-community/netinfo": ">=9.0.0",
@@ -88,14 +113,13 @@
88
113
  }
89
114
  },
90
115
  "dependencies": {
91
- "@supabase-cache-helpers/postgrest-core": "^0.12.3",
92
- "@supabase-cache-helpers/postgrest-react-query": "^1.0.0",
93
116
  "@supabase/postgrest-js": "^2.87.1"
94
117
  },
95
118
  "devDependencies": {
96
- "@pol-studios/auth": "workspace:*",
97
119
  "@pol-studios/hooks": "workspace:*",
98
120
  "@pol-studios/utils": "workspace:*",
121
+ "@supabase-cache-helpers/postgrest-core": "^0.12.3",
122
+ "@supabase-cache-helpers/postgrest-react-query": "^1.0.0",
99
123
  "@types/flat": "^5.0.5",
100
124
  "tsup": "^8.0.0",
101
125
  "typescript": "^5.0.0"