@supabase/supabase-js 2.75.1 → 2.75.2-canary.1

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 (63) hide show
  1. package/README.md +30 -8
  2. package/dist/main/SupabaseClient.js +7 -18
  3. package/dist/main/SupabaseClient.js.map +1 -1
  4. package/dist/main/lib/fetch.js +3 -12
  5. package/dist/main/lib/fetch.js.map +1 -1
  6. package/dist/main/lib/helpers.js +1 -10
  7. package/dist/main/lib/helpers.js.map +1 -1
  8. package/dist/main/lib/rest/types/common/common.d.ts +9 -0
  9. package/dist/main/lib/rest/types/common/common.d.ts.map +1 -1
  10. package/dist/main/lib/rest/types/common/common.js +9 -1
  11. package/dist/main/lib/rest/types/common/common.js.map +1 -1
  12. package/dist/main/lib/rest/types/common/rpc.d.ts +9 -0
  13. package/dist/main/lib/rest/types/common/rpc.d.ts.map +1 -1
  14. package/dist/main/lib/rest/types/common/rpc.js +9 -0
  15. package/dist/main/lib/rest/types/common/rpc.js.map +1 -1
  16. package/dist/main/lib/types.d.ts +2 -2
  17. package/dist/main/lib/version.d.ts +1 -1
  18. package/dist/main/lib/version.d.ts.map +1 -1
  19. package/dist/main/lib/version.js +1 -1
  20. package/dist/main/lib/version.js.map +1 -1
  21. package/dist/module/SupabaseClient.js +7 -18
  22. package/dist/module/SupabaseClient.js.map +1 -1
  23. package/dist/module/lib/fetch.js +3 -12
  24. package/dist/module/lib/fetch.js.map +1 -1
  25. package/dist/module/lib/helpers.js +1 -10
  26. package/dist/module/lib/helpers.js.map +1 -1
  27. package/dist/module/lib/rest/types/common/common.d.ts +9 -0
  28. package/dist/module/lib/rest/types/common/common.d.ts.map +1 -1
  29. package/dist/module/lib/rest/types/common/common.js +9 -1
  30. package/dist/module/lib/rest/types/common/common.js.map +1 -1
  31. package/dist/module/lib/rest/types/common/rpc.d.ts +9 -0
  32. package/dist/module/lib/rest/types/common/rpc.d.ts.map +1 -1
  33. package/dist/module/lib/rest/types/common/rpc.js +9 -0
  34. package/dist/module/lib/rest/types/common/rpc.js.map +1 -1
  35. package/dist/module/lib/types.d.ts +2 -2
  36. package/dist/module/lib/version.d.ts +1 -1
  37. package/dist/module/lib/version.d.ts.map +1 -1
  38. package/dist/module/lib/version.js +1 -1
  39. package/dist/module/lib/version.js.map +1 -1
  40. package/dist/umd/supabase.js +1 -1
  41. package/package.json +36 -12
  42. package/src/lib/rest/types/common/common.ts +10 -0
  43. package/src/lib/rest/types/common/rpc.ts +10 -0
  44. package/src/lib/types.ts +2 -2
  45. package/src/lib/version.ts +1 -1
  46. package/dist/main/lib/rest/types/common/common/common.d.ts +0 -46
  47. package/dist/main/lib/rest/types/common/common/common.d.ts.map +0 -1
  48. package/dist/main/lib/rest/types/common/common/common.js +0 -4
  49. package/dist/main/lib/rest/types/common/common/common.js.map +0 -1
  50. package/dist/main/lib/rest/types/common/common/rpc.d.ts +0 -37
  51. package/dist/main/lib/rest/types/common/common/rpc.d.ts.map +0 -1
  52. package/dist/main/lib/rest/types/common/common/rpc.js +0 -3
  53. package/dist/main/lib/rest/types/common/common/rpc.js.map +0 -1
  54. package/dist/module/lib/rest/types/common/common/common.d.ts +0 -46
  55. package/dist/module/lib/rest/types/common/common/common.d.ts.map +0 -1
  56. package/dist/module/lib/rest/types/common/common/common.js +0 -3
  57. package/dist/module/lib/rest/types/common/common/common.js.map +0 -1
  58. package/dist/module/lib/rest/types/common/common/rpc.d.ts +0 -37
  59. package/dist/module/lib/rest/types/common/common/rpc.d.ts.map +0 -1
  60. package/dist/module/lib/rest/types/common/common/rpc.js +0 -2
  61. package/dist/module/lib/rest/types/common/common/rpc.js.map +0 -1
  62. package/src/lib/rest/types/common/common/common.ts +0 -56
  63. package/src/lib/rest/types/common/common/rpc.ts +0 -135
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@supabase/supabase-js",
3
- "version": "2.75.1",
4
- "description": "Isomorphic Javascript client for Supabase",
3
+ "version": "2.75.2-canary.1",
4
+ "description": "Isomorphic Javascript SDK for Supabase",
5
5
  "keywords": [
6
6
  "javascript",
7
7
  "typescript",
@@ -26,12 +26,12 @@
26
26
  },
27
27
  "scripts": {
28
28
  "clean": "rimraf dist docs/v2",
29
- "build": "npm run clean && npx nx build:main supabase-js && npx nx build:module supabase-js && npx nx build:umd supabase-js",
29
+ "build": "npm run clean && npm run build:main && npm run build:module && npm run build:umd",
30
30
  "build:main": "tsc -p tsconfig.json",
31
31
  "build:module": "tsc -p tsconfig.module.json",
32
32
  "build:umd": "webpack --env mode=production",
33
- "test": "npx nx test:types supabase-js && npx nx test:run supabase-js",
34
- "test:all": "npx nx test:types supabase-js && npx nx test:run supabase-js && npx nx test:integration supabase-js && npx nx test:integration:browser supabase-js",
33
+ "test": "npm run test:types && npm run test:run",
34
+ "test:all": "npm run test:types && npm run test:run && npm run test:integration && npm run test:integration:browser",
35
35
  "test:run": "jest --runInBand --detectOpenHandles",
36
36
  "test:unit": "jest --runInBand --detectOpenHandles test/unit",
37
37
  "test:coverage": "jest --runInBand --coverage --testPathIgnorePatterns=\"test/integration|test/deno\"",
@@ -41,7 +41,7 @@
41
41
  "test:watch": "jest --watch --verbose false --silent false",
42
42
  "test:node:playwright": "cd test/integration/node-browser && npm install && cp ../../../dist/umd/supabase.js . && npm run test",
43
43
  "test:bun": "cd test/integration/bun && bun install && bun test",
44
- "test:types": "npx nx build:module supabase-js && tsd --files test/types/*.test-d.ts && jsr publish --dry-run --allow-dirty",
44
+ "test:types": "tsd --files test/types/*.test-d.ts && jsr publish --dry-run --allow-dirty",
45
45
  "docs": "typedoc --entryPoints src/index.ts --out docs/v2",
46
46
  "docs:json": "typedoc --entryPoints src/index.ts --json docs/v2/spec.json --excludeExternals",
47
47
  "serve:coverage": "npx nx test:coverage supabase-js && serve test/coverage",
@@ -52,11 +52,11 @@
52
52
  "update:test-deps:bun": "npx nx build supabase-js && npm pack && cp supabase-supabase-js-*.tgz test/integration/bun/supabase-supabase-js-0.0.0-automated.tgz && cd test/integration/bun && bun install"
53
53
  },
54
54
  "dependencies": {
55
- "@supabase/auth-js": "2.75.1",
56
- "@supabase/functions-js": "2.75.1",
57
- "@supabase/postgrest-js": "2.75.1",
58
- "@supabase/realtime-js": "2.75.1",
59
- "@supabase/storage-js": "2.75.1",
55
+ "@supabase/auth-js": "2.75.2-canary.1",
56
+ "@supabase/functions-js": "2.75.2-canary.1",
57
+ "@supabase/postgrest-js": "2.75.2-canary.1",
58
+ "@supabase/realtime-js": "2.75.2-canary.1",
59
+ "@supabase/storage-js": "2.75.2-canary.1",
60
60
  "@supabase/node-fetch": "2.6.15"
61
61
  },
62
62
  "devDependencies": {
@@ -73,5 +73,29 @@
73
73
  "webpack-cli": "^4.9.2"
74
74
  },
75
75
  "jsdelivr": "dist/umd/supabase.js",
76
- "unpkg": "dist/umd/supabase.js"
76
+ "unpkg": "dist/umd/supabase.js",
77
+ "nx": {
78
+ "targets": {
79
+ "test:integration:browser": {
80
+ "dependsOn": [
81
+ {
82
+ "projects": [
83
+ "storage-js"
84
+ ],
85
+ "target": "build"
86
+ }
87
+ ]
88
+ },
89
+ "test:edge-functions": {
90
+ "dependsOn": [
91
+ {
92
+ "projects": [
93
+ "storage-js"
94
+ ],
95
+ "target": "build"
96
+ }
97
+ ]
98
+ }
99
+ }
100
+ }
77
101
  }
@@ -1,3 +1,13 @@
1
+ /**
2
+ * AUTO-GENERATED FILE - DO NOT EDIT
3
+ *
4
+ * This file is automatically synchronized from @supabase/postgrest-js
5
+ * Source: packages/core/postgrest-js/src/types/common/
6
+ *
7
+ * To update this file, modify the source in postgrest-js and run:
8
+ * npm run codegen
9
+ */
10
+
1
11
  // Types that are shared between supabase-js and postgrest-js
2
12
 
3
13
  export type Fetch = typeof fetch
@@ -1,3 +1,13 @@
1
+ /**
2
+ * AUTO-GENERATED FILE - DO NOT EDIT
3
+ *
4
+ * This file is automatically synchronized from @supabase/postgrest-js
5
+ * Source: packages/core/postgrest-js/src/types/common/
6
+ *
7
+ * To update this file, modify the source in postgrest-js and run:
8
+ * npm run codegen
9
+ */
10
+
1
11
  import type { GenericFunction, GenericSchema, GenericSetofOption } from './common'
2
12
 
3
13
  // Functions matching utils
package/src/lib/types.ts CHANGED
@@ -97,9 +97,9 @@ export type SupabaseClientOptions<SchemaName> = {
97
97
  /**
98
98
  * Optional function for using a third-party authentication system with
99
99
  * Supabase. The function should return an access token or ID token (JWT) by
100
- * obtaining it from the third-party auth client library. Note that this
100
+ * obtaining it from the third-party auth SDK. Note that this
101
101
  * function may be called concurrently and many times. Use memoization and
102
- * locking techniques if this is not supported by the client libraries.
102
+ * locking techniques if this is not supported by the SDKs.
103
103
  *
104
104
  * When set, the `auth` namespace of the Supabase client cannot be used.
105
105
  * Create another client if you wish to use Supabase Auth and third-party
@@ -4,4 +4,4 @@
4
4
  // - Debugging and support (identifying which version is running)
5
5
  // - Telemetry and logging (version reporting in errors/analytics)
6
6
  // - Ensuring build artifacts match the published package version
7
- export const version = '2.75.1'
7
+ export const version = '2.75.2-canary.1'
@@ -1,46 +0,0 @@
1
- export type Fetch = typeof fetch;
2
- export type GenericRelationship = {
3
- foreignKeyName: string;
4
- columns: string[];
5
- isOneToOne?: boolean;
6
- referencedRelation: string;
7
- referencedColumns: string[];
8
- };
9
- export type GenericTable = {
10
- Row: Record<string, unknown>;
11
- Insert: Record<string, unknown>;
12
- Update: Record<string, unknown>;
13
- Relationships: GenericRelationship[];
14
- };
15
- export type GenericUpdatableView = {
16
- Row: Record<string, unknown>;
17
- Insert: Record<string, unknown>;
18
- Update: Record<string, unknown>;
19
- Relationships: GenericRelationship[];
20
- };
21
- export type GenericNonUpdatableView = {
22
- Row: Record<string, unknown>;
23
- Relationships: GenericRelationship[];
24
- };
25
- export type GenericView = GenericUpdatableView | GenericNonUpdatableView;
26
- export type GenericSetofOption = {
27
- isSetofReturn?: boolean | undefined;
28
- isOneToOne?: boolean | undefined;
29
- isNotNullable?: boolean | undefined;
30
- to: string;
31
- from: string;
32
- };
33
- export type GenericFunction = {
34
- Args: Record<string, unknown> | never;
35
- Returns: unknown;
36
- SetofOptions?: GenericSetofOption;
37
- };
38
- export type GenericSchema = {
39
- Tables: Record<string, GenericTable>;
40
- Views: Record<string, GenericView>;
41
- Functions: Record<string, GenericFunction>;
42
- };
43
- export type ClientServerOptions = {
44
- PostgrestVersion?: string;
45
- };
46
- //# sourceMappingURL=common.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/rest/types/common/common/common.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAA;AAEhC,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,EAAE,MAAM,CAAA;IACtB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,iBAAiB,EAAE,MAAM,EAAE,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,aAAa,EAAE,mBAAmB,EAAE,CAAA;CACrC,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,aAAa,EAAE,mBAAmB,EAAE,CAAA;CACrC,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5B,aAAa,EAAE,mBAAmB,EAAE,CAAA;CACrC,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,oBAAoB,GAAG,uBAAuB,CAAA;AAExE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACnC,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAChC,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACnC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,KAAK,CAAA;IACrC,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,CAAC,EAAE,kBAAkB,CAAA;CAClC,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IACpC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IAClC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;CAC3C,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA"}
@@ -1,4 +0,0 @@
1
- "use strict";
2
- // Types that are shared between supabase-js and postgrest-js
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=common.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../../../src/lib/rest/types/common/common/common.ts"],"names":[],"mappings":";AAAA,6DAA6D"}
@@ -1,37 +0,0 @@
1
- import type { GenericFunction, GenericSchema, GenericSetofOption } from './common';
2
- type IsMatchingArgs<FnArgs extends GenericFunction['Args'], PassedArgs extends GenericFunction['Args']> = [FnArgs] extends [Record<PropertyKey, never>] ? PassedArgs extends Record<PropertyKey, never> ? true : false : keyof PassedArgs extends keyof FnArgs ? PassedArgs extends FnArgs ? true : false : false;
3
- type MatchingFunctionArgs<Fn extends GenericFunction, Args extends GenericFunction['Args']> = Fn extends {
4
- Args: infer A extends GenericFunction['Args'];
5
- } ? IsMatchingArgs<A, Args> extends true ? Fn : never : false;
6
- type FindMatchingFunctionByArgs<FnUnion, Args extends GenericFunction['Args']> = FnUnion extends infer Fn extends GenericFunction ? MatchingFunctionArgs<Fn, Args> : false;
7
- type TablesAndViews<Schema extends GenericSchema> = Schema['Tables'] & Exclude<Schema['Views'], ''>;
8
- type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
9
- type LastOf<T> = UnionToIntersection<T extends any ? () => T : never> extends () => infer R ? R : never;
10
- type IsAny<T> = 0 extends 1 & T ? true : false;
11
- type ExactMatch<T, S> = [T] extends [S] ? ([S] extends [T] ? true : false) : false;
12
- type ExtractExactFunction<Fns, Args> = Fns extends infer F ? F extends GenericFunction ? ExactMatch<F['Args'], Args> extends true ? F : never : never : never;
13
- type IsNever<T> = [T] extends [never] ? true : false;
14
- type RpcFunctionNotFound<FnName> = {
15
- Row: any;
16
- Result: {
17
- error: true;
18
- } & "Couldn't infer function definition matching provided arguments";
19
- RelationName: FnName;
20
- Relationships: null;
21
- };
22
- export type GetRpcFunctionFilterBuilderByArgs<Schema extends GenericSchema, FnName extends string & keyof Schema['Functions'], Args> = {
23
- 0: Schema['Functions'][FnName];
24
- 1: IsAny<Schema> extends true ? any : IsNever<Args> extends true ? IsNever<ExtractExactFunction<Schema['Functions'][FnName], Args>> extends true ? LastOf<Schema['Functions'][FnName]> : ExtractExactFunction<Schema['Functions'][FnName], Args> : Args extends Record<PropertyKey, never> ? LastOf<Schema['Functions'][FnName]> : Args extends GenericFunction['Args'] ? IsNever<LastOf<FindMatchingFunctionByArgs<Schema['Functions'][FnName], Args>>> extends true ? LastOf<Schema['Functions'][FnName]> : LastOf<FindMatchingFunctionByArgs<Schema['Functions'][FnName], Args>> : ExtractExactFunction<Schema['Functions'][FnName], Args> extends GenericFunction ? ExtractExactFunction<Schema['Functions'][FnName], Args> : any;
25
- }[1] extends infer Fn ? IsAny<Fn> extends true ? {
26
- Row: any;
27
- Result: any;
28
- RelationName: FnName;
29
- Relationships: null;
30
- } : Fn extends GenericFunction ? {
31
- Row: Fn['SetofOptions'] extends GenericSetofOption ? Fn['SetofOptions']['isSetofReturn'] extends true ? TablesAndViews<Schema>[Fn['SetofOptions']['to']]['Row'] : TablesAndViews<Schema>[Fn['SetofOptions']['to']]['Row'] : Fn['Returns'] extends any[] ? Fn['Returns'][number] extends Record<string, unknown> ? Fn['Returns'][number] : never : Fn['Returns'] extends Record<string, unknown> ? Fn['Returns'] : never;
32
- Result: Fn['SetofOptions'] extends GenericSetofOption ? Fn['SetofOptions']['isSetofReturn'] extends true ? Fn['SetofOptions']['isOneToOne'] extends true ? Fn['Returns'][] : Fn['Returns'] : Fn['Returns'] : Fn['Returns'];
33
- RelationName: Fn['SetofOptions'] extends GenericSetofOption ? Fn['SetofOptions']['to'] : FnName;
34
- Relationships: Fn['SetofOptions'] extends GenericSetofOption ? Fn['SetofOptions']['to'] extends keyof Schema['Tables'] ? Schema['Tables'][Fn['SetofOptions']['to']]['Relationships'] : Schema['Views'][Fn['SetofOptions']['to']]['Relationships'] : null;
35
- } : Fn extends false ? RpcFunctionNotFound<FnName> : RpcFunctionNotFound<FnName> : RpcFunctionNotFound<FnName>;
36
- export {};
37
- //# sourceMappingURL=rpc.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/rest/types/common/common/rpc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAGlF,KAAK,cAAc,CACjB,MAAM,SAAS,eAAe,CAAC,MAAM,CAAC,EACtC,UA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AC,CAAC,CAAC,eAAe,CAAC,GAC5D,IAAI,CAAA;CACT,GAED,EAAE,SAAS,KAAK,GACd,mBAAmB,CAAC,MAAM,CAAC,GAC3B,mBAAmB,CAAC,MAAM,CAAC,GACjC,mBAAmB,CAAC,MAAM,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=rpc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rpc.js","sourceRoot":"","sources":["../../../../../../../src/lib/rest/types/common/common/rpc.ts"],"names":[],"mappings":""}
@@ -1,46 +0,0 @@
1
- export type Fetch = typeof fetch;
2
- export type GenericRelationship = {
3
- foreignKeyName: string;
4
- columns: string[];
5
- isOneToOne?: boolean;
6
- referencedRelation: string;
7
- referencedColumns: string[];
8
- };
9
- export type GenericTable = {
10
- Row: Record<string, unknown>;
11
- Insert: Record<string, unknown>;
12
- Update: Record<string, unknown>;
13
- Relationships: GenericRelationship[];
14
- };
15
- export type GenericUpdatableView = {
16
- Row: Record<string, unknown>;
17
- Insert: Record<string, unknown>;
18
- Update: Record<string, unknown>;
19
- Relationships: GenericRelationship[];
20
- };
21
- export type GenericNonUpdatableView = {
22
- Row: Record<string, unknown>;
23
- Relationships: GenericRelationship[];
24
- };
25
- export type GenericView = GenericUpdatableView | GenericNonUpdatableView;
26
- export type GenericSetofOption = {
27
- isSetofReturn?: boolean | undefined;
28
- isOneToOne?: boolean | undefined;
29
- isNotNullable?: boolean | undefined;
30
- to: string;
31
- from: string;
32
- };
33
- export type GenericFunction = {
34
- Args: Record<string, unknown> | never;
35
- Returns: unknown;
36
- SetofOptions?: GenericSetofOption;
37
- };
38
- export type GenericSchema = {
39
- Tables: Record<string, GenericTable>;
40
- Views: Record<string, GenericView>;
41
- Functions: Record<string, GenericFunction>;
42
- };
43
- export type ClientServerOptions = {
44
- PostgrestVersion?: string;
45
- };
46
- //# sourceMappingURL=common.d.ts.map
@@ -1 +0,0 @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AC,EAAE,OAAO,GAAG,SAAS,CAAA;IACnC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,KAAK,CAAA;IACrC,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,CAAC,EAAE,kBAAkB,CAAA;CAClC,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IACpC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IAClC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;CAC3C,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA"}
@@ -1,3 +0,0 @@
1
- // Types that are shared between supabase-js and postgrest-js
2
- export {};
3
- //# sourceMappingURL=common.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../../../src/lib/rest/types/common/common/common.ts"],"names":[],"mappings":"AAAA,6DAA6D"}
@@ -1,37 +0,0 @@
1
- import type { GenericFunction, GenericSchema, GenericSetofOption } from './common';
2
- type IsMatchingArgs<FnArgs extends GenericFunction['Args'], PassedArgs extends GenericFunction['Args']> = [FnArgs] extends [Record<PropertyKey, never>] ? PassedArgs extends Record<PropertyKey, never> ? true : false : keyof PassedArgs extends keyof FnArgs ? PassedArgs extends FnArgs ? true : false : false;
3
- type MatchingFunctionArgs<Fn extends GenericFunction, Args extends GenericFunction['Args']> = Fn extends {
4
- Args: infer A extends GenericFunction['Args'];
5
- } ? IsMatchingArgs<A, Args> extends true ? Fn : never : false;
6
- type FindMatchingFunctionByArgs<FnUnion, Args extends GenericFunction['Args']> = FnUnion extends infer Fn extends GenericFunction ? MatchingFunctionArgs<Fn, Args> : false;
7
- type TablesAndViews<Schema extends GenericSchema> = Schema['Tables'] & Exclude<Schema['Views'], ''>;
8
- type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
9
- type LastOf<T> = UnionToIntersection<T extends any ? () => T : never> extends () => infer R ? R : never;
10
- type IsAny<T> = 0 extends 1 & T ? true : false;
11
- type ExactMatch<T, S> = [T] extends [S] ? ([S] extends [T] ? true : false) : false;
12
- type ExtractExactFunction<Fns, Args> = Fns extends infer F ? F extends GenericFunction ? ExactMatch<F['Args'], Args> extends true ? F : never : never : never;
13
- type IsNever<T> = [T] extends [never] ? true : false;
14
- type RpcFunctionNotFound<FnName> = {
15
- Row: any;
16
- Result: {
17
- error: true;
18
- } & "Couldn't infer function definition matching provided arguments";
19
- RelationName: FnName;
20
- Relationships: null;
21
- };
22
- export type GetRpcFunctionFilterBuilderByArgs<Schema extends GenericSchema, FnName extends string & keyof Schema['Functions'], Args> = {
23
- 0: Schema['Functions'][FnName];
24
- 1: IsAny<Schema> extends true ? any : IsNever<Args> extends true ? IsNever<ExtractExactFunction<Schema['Functions'][FnName], Args>> extends true ? LastOf<Schema['Functions'][FnName]> : ExtractExactFunction<Schema['Functions'][FnName], Args> : Args extends Record<PropertyKey, never> ? LastOf<Schema['Functions'][FnName]> : Args extends GenericFunction['Args'] ? IsNever<LastOf<FindMatchingFunctionByArgs<Schema['Functions'][FnName], Args>>> extends true ? LastOf<Schema['Functions'][FnName]> : LastOf<FindMatchingFunctionByArgs<Schema['Functions'][FnName], Args>> : ExtractExactFunction<Schema['Functions'][FnName], Args> extends GenericFunction ? ExtractExactFunction<Schema['Functions'][FnName], Args> : any;
25
- }[1] extends infer Fn ? IsAny<Fn> extends true ? {
26
- Row: any;
27
- Result: any;
28
- RelationName: FnName;
29
- Relationships: null;
30
- } : Fn extends GenericFunction ? {
31
- Row: Fn['SetofOptions'] extends GenericSetofOption ? Fn['SetofOptions']['isSetofReturn'] extends true ? TablesAndViews<Schema>[Fn['SetofOptions']['to']]['Row'] : TablesAndViews<Schema>[Fn['SetofOptions']['to']]['Row'] : Fn['Returns'] extends any[] ? Fn['Returns'][number] extends Record<string, unknown> ? Fn['Returns'][number] : never : Fn['Returns'] extends Record<string, unknown> ? Fn['Returns'] : never;
32
- Result: Fn['SetofOptions'] extends GenericSetofOption ? Fn['SetofOptions']['isSetofReturn'] extends true ? Fn['SetofOptions']['isOneToOne'] extends true ? Fn['Returns'][] : Fn['Returns'] : Fn['Returns'] : Fn['Returns'];
33
- RelationName: Fn['SetofOptions'] extends GenericSetofOption ? Fn['SetofOptions']['to'] : FnName;
34
- Relationships: Fn['SetofOptions'] extends GenericSetofOption ? Fn['SetofOptions']['to'] extends keyof Schema['Tables'] ? Schema['Tables'][Fn['SetofOptions']['to']]['Relationships'] : Schema['Views'][Fn['SetofOptions']['to']]['Relationships'] : null;
35
- } : Fn extends false ? RpcFunctionNotFound<FnName> : RpcFunctionNotFound<FnName> : RpcFunctionNotFound<FnName>;
36
- export {};
37
- //# sourceMappingURL=rpc.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/rest/types/common/common/rpc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAGlF,KAAK,cAAc,CACjB,MAAM,SAAS,eAAe,CAAC,MAAM,CAAC,EACtC,UAAU,SAAS,eAAe,CAAC,MAAM,CAAC,IACxC,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,GAC7C,UAAU,SAAS,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,GAC3C,IAAI,GACJ,KAAK,GACP,MAAM,UAAU,SAAS,MAAM,MAAM,GACnC,UAAU,SAAS,MAAM,GACvB,IAAI,GACJ,KAAK,GACP,KAAK,CAAA;AA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../../../src/lib/rest/types/common/common/rpc.ts"],"names":[],"mappings":""}
@@ -1,56 +0,0 @@
1
- // Types that are shared between supabase-js and postgrest-js
2
-
3
- export type Fetch = typeof fetch
4
-
5
- export type GenericRelationship = {
6
- foreignKeyName: string
7
- columns: string[]
8
- isOneToOne?: boolean
9
- referencedRelation: string
10
- referencedColumns: string[]
11
- }
12
-
13
- export type GenericTable = {
14
- Row: Record<string, unknown>
15
- Insert: Record<string, unknown>
16
- Update: Record<string, unknown>
17
- Relationships: GenericRelationship[]
18
- }
19
-
20
- export type GenericUpdatableView = {
21
- Row: Record<string, unknown>
22
- Insert: Record<string, unknown>
23
- Update: Record<string, unknown>
24
- Relationships: GenericRelationship[]
25
- }
26
-
27
- export type GenericNonUpdatableView = {
28
- Row: Record<string, unknown>
29
- Relationships: GenericRelationship[]
30
- }
31
-
32
- export type GenericView = GenericUpdatableView | GenericNonUpdatableView
33
-
34
- export type GenericSetofOption = {
35
- isSetofReturn?: boolean | undefined
36
- isOneToOne?: boolean | undefined
37
- isNotNullable?: boolean | undefined
38
- to: string
39
- from: string
40
- }
41
-
42
- export type GenericFunction = {
43
- Args: Record<string, unknown> | never
44
- Returns: unknown
45
- SetofOptions?: GenericSetofOption
46
- }
47
-
48
- export type GenericSchema = {
49
- Tables: Record<string, GenericTable>
50
- Views: Record<string, GenericView>
51
- Functions: Record<string, GenericFunction>
52
- }
53
-
54
- export type ClientServerOptions = {
55
- PostgrestVersion?: string
56
- }
@@ -1,135 +0,0 @@
1
- import type { GenericFunction, GenericSchema, GenericSetofOption } from './common'
2
-
3
- // Functions matching utils
4
- type IsMatchingArgs<
5
- FnArgs extends GenericFunction['Args'],
6
- PassedArgs extends GenericFunction['Args'],
7
- > = [FnArgs] extends [Record<PropertyKey, never>]
8
- ? PassedArgs extends Record<PropertyKey, never>
9
- ? true
10
- : false
11
- : keyof PassedArgs extends keyof FnArgs
12
- ? PassedArgs extends FnArgs
13
- ? true
14
- : false
15
- : false
16
-
17
- type MatchingFunctionArgs<
18
- Fn extends GenericFunction,
19
- Args extends GenericFunction['Args'],
20
- > = Fn extends { Args: infer A extends GenericFunction['Args'] }
21
- ? IsMatchingArgs<A, Args> extends true
22
- ? Fn
23
- : never
24
- : false
25
-
26
- type FindMatchingFunctionByArgs<
27
- FnUnion,
28
- Args extends GenericFunction['Args'],
29
- > = FnUnion extends infer Fn extends GenericFunction ? MatchingFunctionArgs<Fn, Args> : false
30
-
31
- // Types for working with database schemas
32
- type TablesAndViews<Schema extends GenericSchema> = Schema['Tables'] & Exclude<Schema['Views'], ''>
33
-
34
- // Utility types for working with unions
35
- type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void
36
- ? I
37
- : never
38
-
39
- type LastOf<T> =
40
- UnionToIntersection<T extends any ? () => T : never> extends () => infer R ? R : never
41
-
42
- type IsAny<T> = 0 extends 1 & T ? true : false
43
-
44
- type ExactMatch<T, S> = [T] extends [S] ? ([S] extends [T] ? true : false) : false
45
-
46
- type ExtractExactFunction<Fns, Args> = Fns extends infer F
47
- ? F extends GenericFunction
48
- ? ExactMatch<F['Args'], Args> extends true
49
- ? F
50
- : never
51
- : never
52
- : never
53
-
54
- type IsNever<T> = [T] extends [never] ? true : false
55
-
56
- type RpcFunctionNotFound<FnName> = {
57
- Row: any
58
- Result: {
59
- error: true
60
- } & "Couldn't infer function definition matching provided arguments"
61
- RelationName: FnName
62
- Relationships: null
63
- }
64
-
65
- export type GetRpcFunctionFilterBuilderByArgs<
66
- Schema extends GenericSchema,
67
- FnName extends string & keyof Schema['Functions'],
68
- Args,
69
- > = {
70
- 0: Schema['Functions'][FnName]
71
- // If the Args is exactly never (function call without any params)
72
- 1: IsAny<Schema> extends true
73
- ? any
74
- : IsNever<Args> extends true
75
- ? // This is for retro compatibility, if the funcition is defined with an single return and an union of Args
76
- // we fallback to the last function definition matched by name
77
- IsNever<ExtractExactFunction<Schema['Functions'][FnName], Args>> extends true
78
- ? LastOf<Schema['Functions'][FnName]>
79
- : ExtractExactFunction<Schema['Functions'][FnName], Args>
80
- : Args extends Record<PropertyKey, never>
81
- ? LastOf<Schema['Functions'][FnName]>
82
- : // Otherwise, we attempt to match with one of the function definition in the union based
83
- // on the function arguments provided
84
- Args extends GenericFunction['Args']
85
- ? // This is for retro compatibility, if the funcition is defined with an single return and an union of Args
86
- // we fallback to the last function definition matched by name
87
- IsNever<
88
- LastOf<FindMatchingFunctionByArgs<Schema['Functions'][FnName], Args>>
89
- > extends true
90
- ? LastOf<Schema['Functions'][FnName]>
91
- : // Otherwise, we use the arguments based function definition narrowing to get the right value
92
- LastOf<FindMatchingFunctionByArgs<Schema['Functions'][FnName], Args>>
93
- : // If we can't find a matching function by args, we try to find one by function name
94
- ExtractExactFunction<Schema['Functions'][FnName], Args> extends GenericFunction
95
- ? ExtractExactFunction<Schema['Functions'][FnName], Args>
96
- : any
97
- }[1] extends infer Fn
98
- ? // If we are dealing with an non-typed client everything is any
99
- IsAny<Fn> extends true
100
- ? { Row: any; Result: any; RelationName: FnName; Relationships: null }
101
- : // Otherwise, we use the arguments based function definition narrowing to get the rigt value
102
- Fn extends GenericFunction
103
- ? {
104
- Row: Fn['SetofOptions'] extends GenericSetofOption
105
- ? Fn['SetofOptions']['isSetofReturn'] extends true
106
- ? TablesAndViews<Schema>[Fn['SetofOptions']['to']]['Row']
107
- : TablesAndViews<Schema>[Fn['SetofOptions']['to']]['Row']
108
- : Fn['Returns'] extends any[]
109
- ? Fn['Returns'][number] extends Record<string, unknown>
110
- ? Fn['Returns'][number]
111
- : never
112
- : Fn['Returns'] extends Record<string, unknown>
113
- ? Fn['Returns']
114
- : never
115
- Result: Fn['SetofOptions'] extends GenericSetofOption
116
- ? Fn['SetofOptions']['isSetofReturn'] extends true
117
- ? Fn['SetofOptions']['isOneToOne'] extends true
118
- ? Fn['Returns'][]
119
- : Fn['Returns']
120
- : Fn['Returns']
121
- : Fn['Returns']
122
- RelationName: Fn['SetofOptions'] extends GenericSetofOption
123
- ? Fn['SetofOptions']['to']
124
- : FnName
125
- Relationships: Fn['SetofOptions'] extends GenericSetofOption
126
- ? Fn['SetofOptions']['to'] extends keyof Schema['Tables']
127
- ? Schema['Tables'][Fn['SetofOptions']['to']]['Relationships']
128
- : Schema['Views'][Fn['SetofOptions']['to']]['Relationships']
129
- : null
130
- }
131
- : // If we failed to find the function by argument, we still pass with any but also add an overridable
132
- Fn extends false
133
- ? RpcFunctionNotFound<FnName>
134
- : RpcFunctionNotFound<FnName>
135
- : RpcFunctionNotFound<FnName>