@startsoft/lumina 0.0.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.
@@ -0,0 +1,145 @@
1
+ /**
2
+ * TypeScript type definitions for @rhino/client
3
+ */
4
+ /**
5
+ * Pagination metadata extracted from API response headers
6
+ */
7
+ export interface PaginationMeta {
8
+ currentPage: number;
9
+ lastPage: number;
10
+ perPage: number;
11
+ total: number;
12
+ }
13
+ /**
14
+ * Query options for model index/list operations
15
+ */
16
+ export interface ModelQueryOptions {
17
+ /** Filter by field values */
18
+ filters?: Record<string, any>;
19
+ /** Eager load relationships */
20
+ includes?: string[];
21
+ /** Sort field (prefix with - for descending) */
22
+ sort?: string;
23
+ /** Select specific fields */
24
+ fields?: string[];
25
+ /** Full-text search query */
26
+ search?: string;
27
+ /** Page number */
28
+ page?: number;
29
+ /** Items per page */
30
+ perPage?: number;
31
+ /** Items per page (alternative name) */
32
+ per_page?: number;
33
+ }
34
+ /**
35
+ * Nested operation for multi-model transactions
36
+ */
37
+ export interface NestedOperation {
38
+ /** Operation type */
39
+ action: 'create' | 'update' | 'delete';
40
+ /** Model name */
41
+ model: string;
42
+ /** Resource ID (for update/delete) */
43
+ id?: string | number;
44
+ /** Data payload (for create/update) */
45
+ data?: Record<string, any>;
46
+ }
47
+ /**
48
+ * Audit log entry
49
+ */
50
+ export interface AuditLog {
51
+ id: number;
52
+ /** Action performed (created, updated, deleted, etc.) */
53
+ action: string;
54
+ /** User who performed the action */
55
+ user_id: number;
56
+ /** Model type */
57
+ model_type: string;
58
+ /** Model ID */
59
+ model_id: number;
60
+ /** Previous values before change */
61
+ old_values?: Record<string, any>;
62
+ /** New values after change */
63
+ new_values?: Record<string, any>;
64
+ /** Timestamp */
65
+ created_at: string;
66
+ }
67
+ /**
68
+ * Login result from authentication
69
+ */
70
+ export interface LoginResult {
71
+ success: boolean;
72
+ user?: any;
73
+ organization?: {
74
+ slug: string;
75
+ };
76
+ organization_slug?: string;
77
+ error?: string;
78
+ }
79
+ /**
80
+ * Query response with data and pagination
81
+ */
82
+ export interface QueryResponse<T> {
83
+ data: T[];
84
+ pagination: PaginationMeta | null;
85
+ }
86
+ /**
87
+ * Invitation status
88
+ */
89
+ export type InvitationStatus = 'pending' | 'accepted' | 'expired' | 'cancelled';
90
+ /**
91
+ * Invitation object
92
+ */
93
+ export interface Invitation {
94
+ id: number;
95
+ email: string;
96
+ role_id: number;
97
+ role?: {
98
+ id: number;
99
+ name: string;
100
+ };
101
+ status: InvitationStatus;
102
+ invited_by?: {
103
+ id: number;
104
+ name: string;
105
+ };
106
+ expires_at: string;
107
+ created_at: string;
108
+ updated_at: string;
109
+ }
110
+ /**
111
+ * Organization object
112
+ */
113
+ export interface Organization {
114
+ id: number;
115
+ name: string;
116
+ slug: string;
117
+ created_at: string;
118
+ updated_at: string;
119
+ users?: User[];
120
+ }
121
+ /**
122
+ * User object
123
+ */
124
+ export interface User {
125
+ id: number;
126
+ name: string;
127
+ email: string;
128
+ created_at: string;
129
+ updated_at: string;
130
+ pivot?: {
131
+ role_id: number;
132
+ [key: string]: any;
133
+ };
134
+ organizations?: Organization[];
135
+ }
136
+ /**
137
+ * Role object
138
+ */
139
+ export interface Role {
140
+ id: number;
141
+ name: string;
142
+ permissions?: string[];
143
+ created_at: string;
144
+ updated_at: string;
145
+ }
package/package.json ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "@startsoft/lumina",
3
+ "version": "0.0.1",
4
+ "description": "Comprehensive React library for Laravel backends with full CRUD, pagination, soft deletes, and multi-tenant support",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "default": "./dist/index.js"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "README.md",
19
+ "LICENSE",
20
+ "CHANGELOG.md"
21
+ ],
22
+ "keywords": [
23
+ "react",
24
+ "laravel",
25
+ "crud",
26
+ "hooks",
27
+ "api",
28
+ "typescript",
29
+ "multi-tenant",
30
+ "pagination",
31
+ "soft-delete",
32
+ "react-query",
33
+ "tanstack-query",
34
+ "frontend",
35
+ "backend",
36
+ "fullstack",
37
+ "lumina"
38
+ ],
39
+ "author": "Bruno Cipolla <bruno@startsoft.com.br>",
40
+ "license": "MIT",
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "https://github.com/startsoft-dev/lumina-client.git",
44
+ "directory": "packages/@startsoft/lumina"
45
+ },
46
+ "bugs": {
47
+ "url": "https://github.com/startsoft-dev/lumina-client/issues"
48
+ },
49
+ "homepage": "https://github.com/startsoft-dev/lumina-client/tree/main/packages/@startsoft/lumina#readme",
50
+ "scripts": {
51
+ "build": "vite build",
52
+ "prepublishOnly": "npm run build"
53
+ },
54
+ "peerDependencies": {
55
+ "@tanstack/react-query": "^5.0.0",
56
+ "axios": "^1.0.0",
57
+ "react": "^18.0.0 || ^19.0.0",
58
+ "react-dom": "^18.0.0 || ^19.0.0"
59
+ },
60
+ "devDependencies": {
61
+ "@tanstack/react-query": "^5.90.20",
62
+ "@types/react": "^19.0.0",
63
+ "@types/react-dom": "^19.0.0",
64
+ "@vitejs/plugin-react": "^4.3.1",
65
+ "axios": "^1.13.5",
66
+ "react": "^19.2.4",
67
+ "react-dom": "^19.2.4",
68
+ "typescript": "^5.0.0",
69
+ "vite": "^6.0.1",
70
+ "vite-plugin-dts": "^4.0.0"
71
+ }
72
+ }