Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Link : https://app.CropWatch.io
- PWA Framework: Svelte, SvelteKit
- UI Components: @cropwatchdevelopment/cwui, bits-ui, @revolist/svelte-datagrid
- Styling: Tailwind CSS, @layerstack/tailwind, @tailwindcss/forms, @tailwindcss/typography
- State & IoC: @stencil/store, inversify
- State Management: @stencil/store
- Data Visualization: D3.js, ApexCharts
- Mapping: Leaflet
- PDF Generation: jspdf, pdfkit, html2canvas
Expand Down
200 changes: 162 additions & 38 deletions database.types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
export type Json = string | number | boolean | null | { [key: string]: Json | undefined } | Json[];

export type Database = {
// Allows to automatically instanciate createClient with right options
// instead of createClient<Database, { PostgrestVersion: 'XX' }>(URL, KEY)
__InternalSupabase: {
PostgrestVersion: '12.2.3 (519615d)';
};
public: {
Tables: {
api_keys: {
Expand Down Expand Up @@ -67,6 +72,7 @@ export type Database = {
created_at: string | null;
email: string | null;
id: string;
name: string | null;
stripe_customer_id: string;
updated_at: string | null;
user_id: string;
Expand All @@ -75,6 +81,7 @@ export type Database = {
created_at?: string | null;
email?: string | null;
id: string;
name?: string | null;
stripe_customer_id: string;
updated_at?: string | null;
user_id: string;
Expand All @@ -83,6 +90,7 @@ export type Database = {
created_at?: string | null;
email?: string | null;
id?: string;
name?: string | null;
stripe_customer_id?: string;
updated_at?: string | null;
user_id?: string;
Expand Down Expand Up @@ -1425,6 +1433,8 @@ export type Database = {
name: string;
operator: string | null;
report_id: string;
user_id: string | null;
value: number | null;
};
Insert: {
created_at?: string;
Expand All @@ -1436,6 +1446,8 @@ export type Database = {
name: string;
operator?: string | null;
report_id: string;
user_id?: string | null;
value?: number | null;
};
Update: {
created_at?: string;
Expand All @@ -1447,6 +1459,8 @@ export type Database = {
name?: string;
operator?: string | null;
report_id?: string;
user_id?: string | null;
value?: number | null;
};
Relationships: [
{
Expand All @@ -1462,23 +1476,29 @@ export type Database = {
Row: {
communication_method: number;
created_at: string;
email: string | null;
id: number;
profile_id: string;
name: string | null;
report_id: string;
user_id: string | null;
};
Insert: {
communication_method: number;
created_at?: string;
email?: string | null;
id?: number;
profile_id: string;
name?: string | null;
report_id: string;
user_id?: string | null;
};
Update: {
communication_method?: number;
created_at?: string;
email?: string | null;
id?: number;
profile_id?: string;
name?: string | null;
report_id?: string;
user_id?: string | null;
};
Relationships: [
{
Expand All @@ -1488,13 +1508,6 @@ export type Database = {
referencedRelation: 'communication_methods';
referencedColumns: ['communication_method_id'];
},
{
foreignKeyName: 'report_recipients_profile_id_fkey';
columns: ['profile_id'];
isOneToOne: false;
referencedRelation: 'profiles';
referencedColumns: ['id'];
},
{
foreignKeyName: 'report_recipients_report_id_fkey';
columns: ['report_id'];
Expand Down Expand Up @@ -1569,20 +1582,23 @@ export type Database = {
id: number;
name: string;
report_id: string;
user_id: string | null;
};
Insert: {
created_at?: string;
dev_eui: string;
id?: number;
name: string;
report_id?: string;
user_id?: string | null;
};
Update: {
created_at?: string;
dev_eui?: string;
id?: number;
name?: string;
report_id?: string;
user_id?: string | null;
};
Relationships: [
{
Expand All @@ -1591,6 +1607,13 @@ export type Database = {
isOneToOne: false;
referencedRelation: 'cw_devices';
referencedColumns: ['dev_eui'];
},
{
foreignKeyName: 'reports_user_id_fkey';
columns: ['user_id'];
isOneToOne: false;
referencedRelation: 'profiles';
referencedColumns: ['id'];
}
];
};
Expand Down Expand Up @@ -1639,6 +1662,93 @@ export type Database = {
}
];
};
stripe_customers: {
Row: {
attrs: Json | null;
created: string | null;
description: string | null;
email: string | null;
id: string | null;
name: string | null;
};
Insert: {
attrs?: Json | null;
created?: string | null;
description?: string | null;
email?: string | null;
id?: string | null;
name?: string | null;
};
Update: {
attrs?: Json | null;
created?: string | null;
description?: string | null;
email?: string | null;
id?: string | null;
name?: string | null;
};
Relationships: [];
};
stripe_products: {
Row: {
active: boolean | null;
attrs: Json | null;
created: string | null;
default_price: string | null;
description: string | null;
id: string | null;
name: string | null;
updated: string | null;
};
Insert: {
active?: boolean | null;
attrs?: Json | null;
created?: string | null;
default_price?: string | null;
description?: string | null;
id?: string | null;
name?: string | null;
updated?: string | null;
};
Update: {
active?: boolean | null;
attrs?: Json | null;
created?: string | null;
default_price?: string | null;
description?: string | null;
id?: string | null;
name?: string | null;
updated?: string | null;
};
Relationships: [];
};
stripe_subscriptions: {
Row: {
attrs: Json | null;
currency: string | null;
current_period_end: string | null;
current_period_start: string | null;
customer: string | null;
id: string | null;
};
Insert: {
attrs?: Json | null;
currency?: string | null;
current_period_end?: string | null;
current_period_start?: string | null;
customer?: string | null;
id?: string | null;
};
Update: {
attrs?: Json | null;
currency?: string | null;
current_period_end?: string | null;
current_period_start?: string | null;
customer?: string | null;
id?: string | null;
};
Relationships: [];
};
subscription_items: {
Row: {
created_at: string | null;
Expand Down Expand Up @@ -1898,21 +2008,25 @@ export type Database = {
};
};

type DefaultSchema = Database[Extract<keyof Database, 'public'>];
type DatabaseWithoutInternals = Omit<Database, '__InternalSupabase'>;

type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, 'public'>];

export type Tables<
DefaultSchemaTableNameOrOptions extends
| keyof (DefaultSchema['Tables'] & DefaultSchema['Views'])
| { schema: keyof Database },
| { schema: keyof DatabaseWithoutInternals },
TableName extends DefaultSchemaTableNameOrOptions extends {
schema: keyof Database;
schema: keyof DatabaseWithoutInternals;
}
? keyof (Database[DefaultSchemaTableNameOrOptions['schema']]['Tables'] &
Database[DefaultSchemaTableNameOrOptions['schema']]['Views'])
? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables'] &
DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Views'])
: never = never
> = DefaultSchemaTableNameOrOptions extends { schema: keyof Database }
? (Database[DefaultSchemaTableNameOrOptions['schema']]['Tables'] &
Database[DefaultSchemaTableNameOrOptions['schema']]['Views'])[TableName] extends {
> = DefaultSchemaTableNameOrOptions extends {
schema: keyof DatabaseWithoutInternals;
}
? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables'] &
DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Views'])[TableName] extends {
Row: infer R;
}
? R
Expand All @@ -1928,14 +2042,16 @@ export type Tables<
export type TablesInsert<
DefaultSchemaTableNameOrOptions extends
| keyof DefaultSchema['Tables']
| { schema: keyof Database },
| { schema: keyof DatabaseWithoutInternals },
TableName extends DefaultSchemaTableNameOrOptions extends {
schema: keyof Database;
schema: keyof DatabaseWithoutInternals;
}
? keyof Database[DefaultSchemaTableNameOrOptions['schema']]['Tables']
? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables']
: never = never
> = DefaultSchemaTableNameOrOptions extends { schema: keyof Database }
? Database[DefaultSchemaTableNameOrOptions['schema']]['Tables'][TableName] extends {
> = DefaultSchemaTableNameOrOptions extends {
schema: keyof DatabaseWithoutInternals;
}
? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables'][TableName] extends {
Insert: infer I;
}
? I
Expand All @@ -1951,14 +2067,16 @@ export type TablesInsert<
export type TablesUpdate<
DefaultSchemaTableNameOrOptions extends
| keyof DefaultSchema['Tables']
| { schema: keyof Database },
| { schema: keyof DatabaseWithoutInternals },
TableName extends DefaultSchemaTableNameOrOptions extends {
schema: keyof Database;
schema: keyof DatabaseWithoutInternals;
}
? keyof Database[DefaultSchemaTableNameOrOptions['schema']]['Tables']
? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables']
: never = never
> = DefaultSchemaTableNameOrOptions extends { schema: keyof Database }
? Database[DefaultSchemaTableNameOrOptions['schema']]['Tables'][TableName] extends {
> = DefaultSchemaTableNameOrOptions extends {
schema: keyof DatabaseWithoutInternals;
}
? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables'][TableName] extends {
Update: infer U;
}
? U
Expand All @@ -1972,29 +2090,35 @@ export type TablesUpdate<
: never;

export type Enums<
DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema['Enums'] | { schema: keyof Database },
DefaultSchemaEnumNameOrOptions extends
| keyof DefaultSchema['Enums']
| { schema: keyof DatabaseWithoutInternals },
EnumName extends DefaultSchemaEnumNameOrOptions extends {
schema: keyof Database;
schema: keyof DatabaseWithoutInternals;
}
? keyof Database[DefaultSchemaEnumNameOrOptions['schema']]['Enums']
? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions['schema']]['Enums']
: never = never
> = DefaultSchemaEnumNameOrOptions extends { schema: keyof Database }
? Database[DefaultSchemaEnumNameOrOptions['schema']]['Enums'][EnumName]
> = DefaultSchemaEnumNameOrOptions extends {
schema: keyof DatabaseWithoutInternals;
}
? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions['schema']]['Enums'][EnumName]
: DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema['Enums']
? DefaultSchema['Enums'][DefaultSchemaEnumNameOrOptions]
: never;

export type CompositeTypes<
PublicCompositeTypeNameOrOptions extends
| keyof DefaultSchema['CompositeTypes']
| { schema: keyof Database },
| { schema: keyof DatabaseWithoutInternals },
CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
schema: keyof Database;
schema: keyof DatabaseWithoutInternals;
}
? keyof Database[PublicCompositeTypeNameOrOptions['schema']]['CompositeTypes']
? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions['schema']]['CompositeTypes']
: never = never
> = PublicCompositeTypeNameOrOptions extends { schema: keyof Database }
? Database[PublicCompositeTypeNameOrOptions['schema']]['CompositeTypes'][CompositeTypeName]
> = PublicCompositeTypeNameOrOptions extends {
schema: keyof DatabaseWithoutInternals;
}
? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions['schema']]['CompositeTypes'][CompositeTypeName]
: PublicCompositeTypeNameOrOptions extends keyof DefaultSchema['CompositeTypes']
? DefaultSchema['CompositeTypes'][PublicCompositeTypeNameOrOptions]
: never;
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,11 @@
"d3-axis": "^3.0.0",
"d3-scale": "^4.0.2",
"d3-selection": "^3.0.0",
"inversify": "7.0.0-alpha.5",
"jspdf": "^3.0.1",
"leaflet": "2.0.0-alpha",
"lodash": "^4.17.21",
"luxon": "^3.6.1",
"pdfkit": "^0.17.1",
"reflect-metadata": "^0.2.2",
"stripe": "^18.3.0",
"svelte-i18n": "^4.0.1",
"svelte-ux": "^1.0.4",
Expand Down
Loading