@rebasepro/types 0.17.3 → 0.18.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 (71) hide show
  1. package/README.md +4 -0
  2. package/dist/call_context.d.ts +20 -0
  3. package/dist/controllers/client.d.ts +36 -4
  4. package/dist/controllers/data.d.ts +120 -10
  5. package/dist/errors.d.ts +83 -4
  6. package/dist/index.es.js +522 -160
  7. package/dist/index.es.js.map +1 -1
  8. package/dist/types/admin_block.d.ts +2 -2
  9. package/dist/types/auth_adapter.d.ts +41 -6
  10. package/dist/types/backend.d.ts +48 -0
  11. package/dist/types/collections.d.ts +25 -1
  12. package/dist/types/cron.d.ts +34 -0
  13. package/dist/types/database_adapter.d.ts +39 -0
  14. package/dist/types/entity_callbacks.d.ts +14 -1
  15. package/dist/types/filter-operators.d.ts +24 -1
  16. package/dist/types/policy.d.ts +29 -1
  17. package/dist/types/properties.d.ts +216 -3
  18. package/dist/types/relations.d.ts +65 -7
  19. package/dist/types/resource_kinds.d.ts +173 -17
  20. package/dist/types/resources.d.ts +108 -7
  21. package/dist/types/rls-functions.d.ts +11 -0
  22. package/dist/types/storage_source.d.ts +12 -23
  23. package/package.json +24 -23
  24. package/src/call_context.ts +0 -120
  25. package/src/controllers/auth_state.ts +0 -24
  26. package/src/controllers/client.ts +0 -494
  27. package/src/controllers/collection_registry.ts +0 -62
  28. package/src/controllers/data.ts +0 -1012
  29. package/src/controllers/data_driver.ts +0 -576
  30. package/src/controllers/effective_role.ts +0 -4
  31. package/src/controllers/email.ts +0 -91
  32. package/src/controllers/index.ts +0 -11
  33. package/src/controllers/storage.ts +0 -252
  34. package/src/errors.ts +0 -119
  35. package/src/index.ts +0 -5
  36. package/src/types/admin_block.ts +0 -209
  37. package/src/types/api_keys.ts +0 -108
  38. package/src/types/auth_adapter.ts +0 -580
  39. package/src/types/backend.ts +0 -987
  40. package/src/types/backup.ts +0 -26
  41. package/src/types/channel_bus.ts +0 -202
  42. package/src/types/chips.ts +0 -34
  43. package/src/types/collection_contract.ts +0 -278
  44. package/src/types/collections.ts +0 -763
  45. package/src/types/component_ref.ts +0 -92
  46. package/src/types/cron.ts +0 -213
  47. package/src/types/data_source.ts +0 -357
  48. package/src/types/database_adapter.ts +0 -267
  49. package/src/types/entities.ts +0 -226
  50. package/src/types/entity_callbacks.ts +0 -229
  51. package/src/types/filter-operators.ts +0 -444
  52. package/src/types/history.ts +0 -66
  53. package/src/types/index.ts +0 -36
  54. package/src/types/indexes.ts +0 -180
  55. package/src/types/policy.ts +0 -328
  56. package/src/types/postgres_introspection.ts +0 -101
  57. package/src/types/project_manifest.ts +0 -598
  58. package/src/types/properties.ts +0 -1368
  59. package/src/types/relations.ts +0 -417
  60. package/src/types/resource_kinds.ts +0 -390
  61. package/src/types/resources.ts +0 -368
  62. package/src/types/rls-functions.ts +0 -98
  63. package/src/types/schema_editing.ts +0 -157
  64. package/src/types/schema_version.ts +0 -112
  65. package/src/types/search.ts +0 -247
  66. package/src/types/security_rules.ts +0 -344
  67. package/src/types/storage_authorize.ts +0 -77
  68. package/src/types/storage_source.ts +0 -248
  69. package/src/types/websockets.ts +0 -117
  70. package/src/users/index.ts +0 -2
  71. package/src/users/user.ts +0 -69
@@ -1,101 +0,0 @@
1
- /**
2
- * Shapes returned by Postgres introspection queries.
3
- *
4
- * These are **not** driver-agnostic and they are not a model of anything — each
5
- * one is the projection of a specific `SELECT` against `information_schema` or
6
- * `pg_policies`, which is why the fields are snake_cased and why `is_nullable`
7
- * is a string rather than a boolean. They describe rows, not concepts.
8
- *
9
- * They were spread across three places that had nothing to do with each other:
10
- * the `Table*` shapes sat in `websockets.ts`, next to the WebSocket frame types
11
- * they share no relationship with, and `PostgresPolicy` was declared twice — in
12
- * `@rebasepro/cms`'s RLS tab and again in `@rebasepro/studio`'s RLS editor,
13
- * the second with a comment explaining it was inline "to avoid depending on
14
- * @rebasepro/studio". Neither had to: this package is already a dependency of
15
- * both.
16
- *
17
- * Producer: `@rebasepro/server-postgres`. Consumers: the collection editor, the
18
- * studio schema browser, the RLS editors.
19
- */
20
-
21
- /**
22
- * A column, as `information_schema.columns` reports it.
23
- * @group Models
24
- */
25
- export interface TableColumnInfo {
26
- column_name: string;
27
- data_type: string;
28
- udt_name: string;
29
- /** `"YES"` or `"NO"` — `information_schema` reports this as text. */
30
- is_nullable: string;
31
- column_default: string | null;
32
- character_maximum_length: number | null;
33
- /** Enum values, populated for USER-DEFINED (enum) columns */
34
- enum_values?: string[];
35
- }
36
-
37
- /** @group Models */
38
- export interface TableForeignKeyInfo {
39
- column_name: string;
40
- foreign_table_name: string;
41
- foreign_column_name: string;
42
- }
43
-
44
- /** @group Models */
45
- export interface TableJunctionInfo {
46
- junction_table_name: string;
47
- source_column_name: string;
48
- target_table_name: string;
49
- target_column_name: string;
50
- }
51
-
52
- /**
53
- * A policy as the *table metadata* query projects it.
54
- *
55
- * Distinct from {@link PostgresPolicy}, which is the RLS editor's fuller
56
- * projection of `pg_policies` — this one carries only what the collection
57
- * editor needs to show that a table is protected.
58
- *
59
- * @group Models
60
- */
61
- export interface TablePolicyInfo {
62
- policy_name: string;
63
- roles: string[];
64
- cmd: string;
65
- qual?: string;
66
- with_check?: string;
67
- }
68
-
69
- /** @group Models */
70
- export interface TableMetadata {
71
- columns: TableColumnInfo[];
72
- foreignKeys: TableForeignKeyInfo[];
73
- junctions: TableJunctionInfo[];
74
- policies: TablePolicyInfo[];
75
- }
76
-
77
- /**
78
- * A row of `pg_policies`, as the RLS editors read it.
79
- *
80
- * Note the unseparated column names (`policyname`, `tablename`) — those are
81
- * Postgres's, not ours. See {@link TablePolicyInfo} for the narrower projection
82
- * the collection editor uses.
83
- *
84
- * @group Models
85
- */
86
- export interface PostgresPolicy {
87
- policyname: string;
88
- tablename: string;
89
- permissive: "PERMISSIVE" | "RESTRICTIVE";
90
- roles: string[];
91
- cmd: "SELECT" | "INSERT" | "UPDATE" | "DELETE" | "ALL";
92
- /** The `USING` clause. */
93
- qual: string | null;
94
- /** The `WITH CHECK` clause. */
95
- with_check: string | null;
96
- /**
97
- * Whether this policy exists in the live database, in the collection's
98
- * `securityRules`, or both. Computed by the editor, not by Postgres.
99
- */
100
- status?: "live" | "code_only" | "both";
101
- }