@objectstack/spec 0.1.2 → 0.2.0

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 (58) hide show
  1. package/dist/data/filter.zod.d.ts +295 -0
  2. package/dist/data/filter.zod.d.ts.map +1 -0
  3. package/dist/data/filter.zod.js +226 -0
  4. package/dist/index.d.ts +2 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +2 -0
  7. package/dist/system/auth.zod.d.ts +2287 -0
  8. package/dist/system/auth.zod.d.ts.map +1 -0
  9. package/dist/system/auth.zod.js +365 -0
  10. package/dist/system/datasource.zod.d.ts +118 -38
  11. package/dist/system/datasource.zod.d.ts.map +1 -1
  12. package/dist/system/datasource.zod.js +25 -6
  13. package/dist/system/driver.zod.d.ts +106 -0
  14. package/dist/system/driver.zod.d.ts.map +1 -1
  15. package/dist/system/driver.zod.js +47 -0
  16. package/dist/system/policy.zod.d.ts +10 -10
  17. package/dist/ui/dashboard.zod.d.ts +10 -10
  18. package/dist/ui/dashboard.zod.d.ts.map +1 -1
  19. package/dist/ui/dashboard.zod.js +3 -2
  20. package/dist/ui/report.zod.d.ts +4 -32
  21. package/dist/ui/report.zod.d.ts.map +1 -1
  22. package/dist/ui/report.zod.js +3 -8
  23. package/json-schema/AccountLinkingConfig.json +27 -0
  24. package/json-schema/AuthConfig.json +606 -0
  25. package/json-schema/AuthPluginConfig.json +28 -0
  26. package/json-schema/AuthStrategy.json +17 -0
  27. package/json-schema/AuthenticationConfig.json +601 -0
  28. package/json-schema/AuthenticationProvider.json +617 -0
  29. package/json-schema/CSRFConfig.json +31 -0
  30. package/json-schema/ComparisonOperator.json +56 -0
  31. package/json-schema/Dashboard.json +20 -0
  32. package/json-schema/DashboardWidget.json +20 -0
  33. package/json-schema/DatabaseAdapter.json +38 -0
  34. package/json-schema/Datasource.json +25 -5
  35. package/json-schema/DatasourceCapabilities.json +25 -5
  36. package/json-schema/DriverCapabilities.json +30 -0
  37. package/json-schema/DriverDefinition.json +25 -5
  38. package/json-schema/DriverInterface.json +30 -0
  39. package/json-schema/EmailPasswordConfig.json +43 -0
  40. package/json-schema/EqualityOperator.json +14 -0
  41. package/json-schema/FieldOperators.json +108 -0
  42. package/json-schema/FilterCondition.json +28 -0
  43. package/json-schema/MagicLinkConfig.json +21 -0
  44. package/json-schema/NormalizedFilter.json +348 -0
  45. package/json-schema/OAuthProvider.json +66 -0
  46. package/json-schema/PasskeyConfig.json +54 -0
  47. package/json-schema/QueryFilter.json +34 -0
  48. package/json-schema/RangeOperator.json +41 -0
  49. package/json-schema/RateLimitConfig.json +36 -0
  50. package/json-schema/Report.json +20 -26
  51. package/json-schema/SessionConfig.json +56 -0
  52. package/json-schema/SetOperator.json +18 -0
  53. package/json-schema/SpecialOperator.json +18 -0
  54. package/json-schema/StandardAuthProvider.json +622 -0
  55. package/json-schema/StringOperator.json +21 -0
  56. package/json-schema/TwoFactorConfig.json +40 -0
  57. package/json-schema/UserFieldMapping.json +47 -0
  58. package/package.json +1 -1
@@ -0,0 +1,56 @@
1
+ {
2
+ "$ref": "#/definitions/ComparisonOperator",
3
+ "definitions": {
4
+ "ComparisonOperator": {
5
+ "type": "object",
6
+ "properties": {
7
+ "$gt": {
8
+ "anyOf": [
9
+ {
10
+ "type": "number"
11
+ },
12
+ {
13
+ "type": "string",
14
+ "format": "date-time"
15
+ }
16
+ ]
17
+ },
18
+ "$gte": {
19
+ "anyOf": [
20
+ {
21
+ "type": "number"
22
+ },
23
+ {
24
+ "type": "string",
25
+ "format": "date-time"
26
+ }
27
+ ]
28
+ },
29
+ "$lt": {
30
+ "anyOf": [
31
+ {
32
+ "type": "number"
33
+ },
34
+ {
35
+ "type": "string",
36
+ "format": "date-time"
37
+ }
38
+ ]
39
+ },
40
+ "$lte": {
41
+ "anyOf": [
42
+ {
43
+ "type": "number"
44
+ },
45
+ {
46
+ "type": "string",
47
+ "format": "date-time"
48
+ }
49
+ ]
50
+ }
51
+ },
52
+ "additionalProperties": false
53
+ }
54
+ },
55
+ "$schema": "http://json-schema.org/draft-07/schema#"
56
+ }
@@ -46,6 +46,26 @@
46
46
  "description": "Data source object name"
47
47
  },
48
48
  "filter": {
49
+ "allOf": [
50
+ {
51
+ "type": "object",
52
+ "additionalProperties": {}
53
+ },
54
+ {
55
+ "type": "object",
56
+ "properties": {
57
+ "$and": {
58
+ "type": "array",
59
+ "items": {}
60
+ },
61
+ "$or": {
62
+ "type": "array",
63
+ "items": {}
64
+ },
65
+ "$not": {}
66
+ }
67
+ }
68
+ ],
49
69
  "description": "Data filter criteria"
50
70
  },
51
71
  "categoryField": {
@@ -28,6 +28,26 @@
28
28
  "description": "Data source object name"
29
29
  },
30
30
  "filter": {
31
+ "allOf": [
32
+ {
33
+ "type": "object",
34
+ "additionalProperties": {}
35
+ },
36
+ {
37
+ "type": "object",
38
+ "properties": {
39
+ "$and": {
40
+ "type": "array",
41
+ "items": {}
42
+ },
43
+ "$or": {
44
+ "type": "array",
45
+ "items": {}
46
+ },
47
+ "$not": {}
48
+ }
49
+ }
50
+ ],
31
51
  "description": "Data filter criteria"
32
52
  },
33
53
  "categoryField": {
@@ -0,0 +1,38 @@
1
+ {
2
+ "$ref": "#/definitions/DatabaseAdapter",
3
+ "definitions": {
4
+ "DatabaseAdapter": {
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "enum": [
10
+ "prisma",
11
+ "drizzle",
12
+ "kysely",
13
+ "custom"
14
+ ],
15
+ "description": "Database adapter type"
16
+ },
17
+ "connectionString": {
18
+ "type": "string",
19
+ "description": "Database connection string"
20
+ },
21
+ "tablePrefix": {
22
+ "type": "string",
23
+ "default": "auth_",
24
+ "description": "Prefix for auth tables"
25
+ },
26
+ "schema": {
27
+ "type": "string",
28
+ "description": "Database schema name"
29
+ }
30
+ },
31
+ "required": [
32
+ "type"
33
+ ],
34
+ "additionalProperties": false
35
+ }
36
+ },
37
+ "$schema": "http://json-schema.org/draft-07/schema#"
38
+ }
@@ -25,29 +25,49 @@
25
25
  "capabilities": {
26
26
  "type": "object",
27
27
  "properties": {
28
- "joins": {
28
+ "transactions": {
29
29
  "type": "boolean",
30
30
  "default": false
31
31
  },
32
- "transactions": {
32
+ "queryFilters": {
33
33
  "type": "boolean",
34
34
  "default": false
35
35
  },
36
- "fullTextSearch": {
36
+ "queryAggregations": {
37
37
  "type": "boolean",
38
38
  "default": false
39
39
  },
40
- "aggregation": {
40
+ "querySorting": {
41
41
  "type": "boolean",
42
42
  "default": false
43
43
  },
44
- "dynamicSchema": {
44
+ "queryPagination": {
45
+ "type": "boolean",
46
+ "default": false
47
+ },
48
+ "queryWindowFunctions": {
49
+ "type": "boolean",
50
+ "default": false
51
+ },
52
+ "querySubqueries": {
53
+ "type": "boolean",
54
+ "default": false
55
+ },
56
+ "joins": {
57
+ "type": "boolean",
58
+ "default": false
59
+ },
60
+ "fullTextSearch": {
45
61
  "type": "boolean",
46
62
  "default": false
47
63
  },
48
64
  "readOnly": {
49
65
  "type": "boolean",
50
66
  "default": false
67
+ },
68
+ "dynamicSchema": {
69
+ "type": "boolean",
70
+ "default": false
51
71
  }
52
72
  },
53
73
  "additionalProperties": false,
@@ -4,29 +4,49 @@
4
4
  "DatasourceCapabilities": {
5
5
  "type": "object",
6
6
  "properties": {
7
- "joins": {
7
+ "transactions": {
8
8
  "type": "boolean",
9
9
  "default": false
10
10
  },
11
- "transactions": {
11
+ "queryFilters": {
12
12
  "type": "boolean",
13
13
  "default": false
14
14
  },
15
- "fullTextSearch": {
15
+ "queryAggregations": {
16
16
  "type": "boolean",
17
17
  "default": false
18
18
  },
19
- "aggregation": {
19
+ "querySorting": {
20
20
  "type": "boolean",
21
21
  "default": false
22
22
  },
23
- "dynamicSchema": {
23
+ "queryPagination": {
24
+ "type": "boolean",
25
+ "default": false
26
+ },
27
+ "queryWindowFunctions": {
28
+ "type": "boolean",
29
+ "default": false
30
+ },
31
+ "querySubqueries": {
32
+ "type": "boolean",
33
+ "default": false
34
+ },
35
+ "joins": {
36
+ "type": "boolean",
37
+ "default": false
38
+ },
39
+ "fullTextSearch": {
24
40
  "type": "boolean",
25
41
  "default": false
26
42
  },
27
43
  "readOnly": {
28
44
  "type": "boolean",
29
45
  "default": false
46
+ },
47
+ "dynamicSchema": {
48
+ "type": "boolean",
49
+ "default": false
30
50
  }
31
51
  },
32
52
  "additionalProperties": false
@@ -8,6 +8,30 @@
8
8
  "type": "boolean",
9
9
  "description": "Supports transactions"
10
10
  },
11
+ "queryFilters": {
12
+ "type": "boolean",
13
+ "description": "Supports WHERE clause filtering"
14
+ },
15
+ "queryAggregations": {
16
+ "type": "boolean",
17
+ "description": "Supports GROUP BY and aggregation functions"
18
+ },
19
+ "querySorting": {
20
+ "type": "boolean",
21
+ "description": "Supports ORDER BY sorting"
22
+ },
23
+ "queryPagination": {
24
+ "type": "boolean",
25
+ "description": "Supports LIMIT/OFFSET pagination"
26
+ },
27
+ "queryWindowFunctions": {
28
+ "type": "boolean",
29
+ "description": "Supports window functions with OVER clause"
30
+ },
31
+ "querySubqueries": {
32
+ "type": "boolean",
33
+ "description": "Supports subqueries"
34
+ },
11
35
  "joins": {
12
36
  "type": "boolean",
13
37
  "description": "Supports SQL joins"
@@ -27,6 +51,12 @@
27
51
  },
28
52
  "required": [
29
53
  "transactions",
54
+ "queryFilters",
55
+ "queryAggregations",
56
+ "querySorting",
57
+ "queryPagination",
58
+ "queryWindowFunctions",
59
+ "querySubqueries",
30
60
  "joins",
31
61
  "fullTextSearch",
32
62
  "jsonFields",
@@ -26,29 +26,49 @@
26
26
  "capabilities": {
27
27
  "type": "object",
28
28
  "properties": {
29
- "joins": {
29
+ "transactions": {
30
30
  "type": "boolean",
31
31
  "default": false
32
32
  },
33
- "transactions": {
33
+ "queryFilters": {
34
34
  "type": "boolean",
35
35
  "default": false
36
36
  },
37
- "fullTextSearch": {
37
+ "queryAggregations": {
38
38
  "type": "boolean",
39
39
  "default": false
40
40
  },
41
- "aggregation": {
41
+ "querySorting": {
42
42
  "type": "boolean",
43
43
  "default": false
44
44
  },
45
- "dynamicSchema": {
45
+ "queryPagination": {
46
+ "type": "boolean",
47
+ "default": false
48
+ },
49
+ "queryWindowFunctions": {
50
+ "type": "boolean",
51
+ "default": false
52
+ },
53
+ "querySubqueries": {
54
+ "type": "boolean",
55
+ "default": false
56
+ },
57
+ "joins": {
58
+ "type": "boolean",
59
+ "default": false
60
+ },
61
+ "fullTextSearch": {
46
62
  "type": "boolean",
47
63
  "default": false
48
64
  },
49
65
  "readOnly": {
50
66
  "type": "boolean",
51
67
  "default": false
68
+ },
69
+ "dynamicSchema": {
70
+ "type": "boolean",
71
+ "default": false
52
72
  }
53
73
  },
54
74
  "additionalProperties": false
@@ -19,6 +19,30 @@
19
19
  "type": "boolean",
20
20
  "description": "Supports transactions"
21
21
  },
22
+ "queryFilters": {
23
+ "type": "boolean",
24
+ "description": "Supports WHERE clause filtering"
25
+ },
26
+ "queryAggregations": {
27
+ "type": "boolean",
28
+ "description": "Supports GROUP BY and aggregation functions"
29
+ },
30
+ "querySorting": {
31
+ "type": "boolean",
32
+ "description": "Supports ORDER BY sorting"
33
+ },
34
+ "queryPagination": {
35
+ "type": "boolean",
36
+ "description": "Supports LIMIT/OFFSET pagination"
37
+ },
38
+ "queryWindowFunctions": {
39
+ "type": "boolean",
40
+ "description": "Supports window functions with OVER clause"
41
+ },
42
+ "querySubqueries": {
43
+ "type": "boolean",
44
+ "description": "Supports subqueries"
45
+ },
22
46
  "joins": {
23
47
  "type": "boolean",
24
48
  "description": "Supports SQL joins"
@@ -38,6 +62,12 @@
38
62
  },
39
63
  "required": [
40
64
  "transactions",
65
+ "queryFilters",
66
+ "queryAggregations",
67
+ "querySorting",
68
+ "queryPagination",
69
+ "queryWindowFunctions",
70
+ "querySubqueries",
41
71
  "joins",
42
72
  "fullTextSearch",
43
73
  "jsonFields",
@@ -0,0 +1,43 @@
1
+ {
2
+ "$ref": "#/definitions/EmailPasswordConfig",
3
+ "definitions": {
4
+ "EmailPasswordConfig": {
5
+ "type": "object",
6
+ "properties": {
7
+ "enabled": {
8
+ "type": "boolean",
9
+ "default": true
10
+ },
11
+ "requireEmailVerification": {
12
+ "type": "boolean",
13
+ "default": true,
14
+ "description": "Require email verification before login"
15
+ },
16
+ "minPasswordLength": {
17
+ "type": "number",
18
+ "minimum": 6,
19
+ "maximum": 128,
20
+ "default": 8,
21
+ "description": "Minimum password length"
22
+ },
23
+ "requirePasswordComplexity": {
24
+ "type": "boolean",
25
+ "default": true,
26
+ "description": "Require uppercase, lowercase, numbers, symbols"
27
+ },
28
+ "allowPasswordReset": {
29
+ "type": "boolean",
30
+ "default": true,
31
+ "description": "Enable password reset functionality"
32
+ },
33
+ "passwordResetExpiry": {
34
+ "type": "number",
35
+ "default": 3600,
36
+ "description": "Password reset token expiry in seconds"
37
+ }
38
+ },
39
+ "additionalProperties": false
40
+ }
41
+ },
42
+ "$schema": "http://json-schema.org/draft-07/schema#"
43
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$ref": "#/definitions/EqualityOperator",
3
+ "definitions": {
4
+ "EqualityOperator": {
5
+ "type": "object",
6
+ "properties": {
7
+ "$eq": {},
8
+ "$ne": {}
9
+ },
10
+ "additionalProperties": false
11
+ }
12
+ },
13
+ "$schema": "http://json-schema.org/draft-07/schema#"
14
+ }
@@ -0,0 +1,108 @@
1
+ {
2
+ "$ref": "#/definitions/FieldOperators",
3
+ "definitions": {
4
+ "FieldOperators": {
5
+ "type": "object",
6
+ "properties": {
7
+ "$eq": {},
8
+ "$ne": {},
9
+ "$gt": {
10
+ "anyOf": [
11
+ {
12
+ "type": "number"
13
+ },
14
+ {
15
+ "type": "string",
16
+ "format": "date-time"
17
+ }
18
+ ]
19
+ },
20
+ "$gte": {
21
+ "anyOf": [
22
+ {
23
+ "type": "number"
24
+ },
25
+ {
26
+ "type": "string",
27
+ "format": "date-time"
28
+ }
29
+ ]
30
+ },
31
+ "$lt": {
32
+ "anyOf": [
33
+ {
34
+ "type": "number"
35
+ },
36
+ {
37
+ "type": "string",
38
+ "format": "date-time"
39
+ }
40
+ ]
41
+ },
42
+ "$lte": {
43
+ "anyOf": [
44
+ {
45
+ "type": "number"
46
+ },
47
+ {
48
+ "type": "string",
49
+ "format": "date-time"
50
+ }
51
+ ]
52
+ },
53
+ "$in": {
54
+ "type": "array"
55
+ },
56
+ "$nin": {
57
+ "type": "array"
58
+ },
59
+ "$between": {
60
+ "type": "array",
61
+ "minItems": 2,
62
+ "maxItems": 2,
63
+ "items": [
64
+ {
65
+ "anyOf": [
66
+ {
67
+ "type": "number"
68
+ },
69
+ {
70
+ "type": "string",
71
+ "format": "date-time"
72
+ }
73
+ ]
74
+ },
75
+ {
76
+ "anyOf": [
77
+ {
78
+ "type": "number"
79
+ },
80
+ {
81
+ "type": "string",
82
+ "format": "date-time"
83
+ }
84
+ ]
85
+ }
86
+ ]
87
+ },
88
+ "$contains": {
89
+ "type": "string"
90
+ },
91
+ "$startsWith": {
92
+ "type": "string"
93
+ },
94
+ "$endsWith": {
95
+ "type": "string"
96
+ },
97
+ "$null": {
98
+ "type": "boolean"
99
+ },
100
+ "$exist": {
101
+ "type": "boolean"
102
+ }
103
+ },
104
+ "additionalProperties": false
105
+ }
106
+ },
107
+ "$schema": "http://json-schema.org/draft-07/schema#"
108
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "$ref": "#/definitions/FilterCondition",
3
+ "definitions": {
4
+ "FilterCondition": {
5
+ "allOf": [
6
+ {
7
+ "type": "object",
8
+ "additionalProperties": {}
9
+ },
10
+ {
11
+ "type": "object",
12
+ "properties": {
13
+ "$and": {
14
+ "type": "array",
15
+ "items": {}
16
+ },
17
+ "$or": {
18
+ "type": "array",
19
+ "items": {}
20
+ },
21
+ "$not": {}
22
+ }
23
+ }
24
+ ]
25
+ }
26
+ },
27
+ "$schema": "http://json-schema.org/draft-07/schema#"
28
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$ref": "#/definitions/MagicLinkConfig",
3
+ "definitions": {
4
+ "MagicLinkConfig": {
5
+ "type": "object",
6
+ "properties": {
7
+ "enabled": {
8
+ "type": "boolean",
9
+ "default": true
10
+ },
11
+ "expiryTime": {
12
+ "type": "number",
13
+ "default": 900,
14
+ "description": "Magic link expiry time in seconds (default 15 min)"
15
+ }
16
+ },
17
+ "additionalProperties": false
18
+ }
19
+ },
20
+ "$schema": "http://json-schema.org/draft-07/schema#"
21
+ }