@rjromeoent/ein-supabase 0.1.1 → 0.1.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.
- package/README.md +33 -0
- package/dist/db-enums.d.ts +10 -0
- package/dist/db-enums.js +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,6 +5,7 @@ Shared Supabase contract package for EIN-connected apps.
|
|
|
5
5
|
This package is the canonical home for:
|
|
6
6
|
|
|
7
7
|
- Generated Supabase database types across EIN schemas.
|
|
8
|
+
- Type aliases for canonical database-owned enums.
|
|
8
9
|
- Registered app slugs and the `x-ein-app` header helper.
|
|
9
10
|
- Shared org-role helpers for `core.app_organization_memberships`.
|
|
10
11
|
- Typed schema-client helpers.
|
|
@@ -106,6 +107,38 @@ These represent the actual EIN database contract. Every connected app should
|
|
|
106
107
|
compile against the same source of truth instead of copying partial generated
|
|
107
108
|
types.
|
|
108
109
|
|
|
110
|
+
#### Database-Owned Enum Aliases
|
|
111
|
+
|
|
112
|
+
Examples:
|
|
113
|
+
|
|
114
|
+
- `CoreArtistGenre`
|
|
115
|
+
- `RadDbAvailabilityStatus`
|
|
116
|
+
- `RadDbAssignmentState`
|
|
117
|
+
- `RadDbDecisionType`
|
|
118
|
+
- `BookingOfferStatus`
|
|
119
|
+
|
|
120
|
+
Why:
|
|
121
|
+
|
|
122
|
+
These are type aliases over generated Supabase enum types. They give apps a
|
|
123
|
+
stable import name for canonical database-owned values without copying enum
|
|
124
|
+
strings into each app.
|
|
125
|
+
|
|
126
|
+
Use these aliases at API, adapter, and database-boundary layers when the value
|
|
127
|
+
is the raw backend contract:
|
|
128
|
+
|
|
129
|
+
```ts
|
|
130
|
+
import type { RadDbDecisionType } from "@rjromeoent/ein-supabase";
|
|
131
|
+
|
|
132
|
+
interface DecisionRow {
|
|
133
|
+
decision_type: RadDbDecisionType | null;
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Do not use these aliases for app-specific display buckets or UI commands. For
|
|
138
|
+
example, RAD's dashboard label `"Available"` and command action `"shortlist"`
|
|
139
|
+
are app vocabulary, while database values like `available` and `shortlisted`
|
|
140
|
+
are backend vocabulary.
|
|
141
|
+
|
|
109
142
|
#### App Registry And Request Context
|
|
110
143
|
|
|
111
144
|
Examples:
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Database } from "./generated/database.types.js";
|
|
2
|
+
export type CoreArtistGenre = Database["core"]["Enums"]["artist_genre"];
|
|
3
|
+
export type RadDbAssignmentState = Database["rad"]["Enums"]["assignment_state"];
|
|
4
|
+
export type RadDbAssignmentStatus = Database["rad"]["Enums"]["assignment_status"];
|
|
5
|
+
export type RadDbAvailabilityStatus = Database["rad"]["Enums"]["availability_status"];
|
|
6
|
+
export type RadDbDecisionActorType = Database["rad"]["Enums"]["decision_actor_type"];
|
|
7
|
+
export type RadDbDecisionType = Database["rad"]["Enums"]["decision_type"];
|
|
8
|
+
export type RadDbOfferLinkStatus = Database["rad"]["Enums"]["offer_link_status"];
|
|
9
|
+
export type BookingHoldLevel = Database["booking_engine"]["Enums"]["hold_level"];
|
|
10
|
+
export type BookingOfferStatus = Database["booking_engine"]["Enums"]["offer_status"];
|
package/dist/db-enums.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./app-context.js";
|
|
2
2
|
export * from "./auth.js";
|
|
3
|
+
export type * from "./db-enums.js";
|
|
3
4
|
export * from "./json.js";
|
|
4
5
|
export * from "./schema-client.js";
|
|
5
6
|
export type { Constants, Database, Enums, Json, Tables, TablesInsert, TablesUpdate, } from "./generated/database.types.js";
|