Skip to content

Commit 37d7b34

Browse files
authored
Merge pull request #421 from spaceuptech/v0.12.0
V0.12.0
2 parents 6925517 + 6b09cd3 commit 37d7b34

File tree

361 files changed

+7819
-38239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

361 files changed

+7819
-38239
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ build/
3737
.idea
3838
.vscode
3939

40-
yarn.lock
40+
yarn.lock

config/config.go

+36-12
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ type Modules struct {
7373
Crud Crud `json:"crud" yaml:"crud"`
7474
Auth Auth `json:"auth" yaml:"auth"`
7575
Functions *Functions `json:"functions" yaml:"functions"`
76-
Realtime *Realtime `json:"realtime" yaml:"realtime"`
7776
FileStore *FileStore `json:"fileStore" yaml:"fileStore"`
77+
Pubsub *Pubsub `json:"pubsub" yaml:"pubsub"`
78+
Eventing Eventing `json:"eventing,omitempty" yaml:"eventing,omitempty"`
7879
}
7980

8081
// Crud holds the mapping of database level configuration
@@ -92,6 +93,7 @@ type CrudStub struct {
9293
type TableRule struct {
9394
IsRealTimeEnabled bool `json:"isRealtimeEnabled" yaml:"isRealtimeEnabled"`
9495
Rules map[string]*Rule `json:"rules" yaml:"rules"` // The key here is query, insert, update or delete
96+
Schema string `json:"schema" yaml:"schema"`
9597
}
9698

9799
// Rule is the authorisation object at the query level
@@ -121,10 +123,7 @@ type AuthStub struct {
121123

122124
// Functions holds the config for the functions module
123125
type Functions struct {
124-
Enabled bool `json:"enabled" yaml:"enabled"`
125-
Broker utils.Broker `json:"broker" yaml:"broker"`
126-
Conn string `json:"conn" yaml:"conn"`
127-
Services Services `json:"services" yaml:"services"`
126+
Services Services `json:"services" yaml:"services"`
128127
}
129128

130129
// Services holds the config of services
@@ -140,13 +139,6 @@ type Function struct {
140139
Rule *Rule `json:"rule" yaml:"rule"`
141140
}
142141

143-
// Realtime holds the config for the realtime module
144-
type Realtime struct {
145-
Enabled bool `json:"enabled" yaml:"enabled"`
146-
Broker utils.Broker `json:"broker" yaml:"broker"`
147-
Conn string `json:"conn" yaml:"conn"`
148-
}
149-
150142
// FileStore holds the config for the file store module
151143
type FileStore struct {
152144
Enabled bool `json:"enabled" yaml:"enabled"`
@@ -178,3 +170,35 @@ type StaticRoute struct {
178170
Proxy string `json:"proxy" yaml:"proxy"`
179171
Protocol string `json:"protocol,omitempty" yaml:"protocol,omitempty"`
180172
}
173+
174+
// Pubsub holds the config for the realtime module
175+
type Pubsub struct {
176+
Enabled bool `json:"enabled" yaml:"enabled"`
177+
Broker utils.Broker `json:"broker" yaml:"broker"`
178+
Conn string `json:"conn" yaml:"conn"`
179+
Rules []*PubsubRule `json:"rules" yaml:"rules"`
180+
}
181+
182+
// PubsubRule is the authorization object at the pubsub rule level
183+
type PubsubRule struct {
184+
Subject string `json:"subject" yaml:"subject"` // The channel subject
185+
Rule map[string]*Rule `json:"rule" yaml:"rule"` // The key can be publish or subscribe
186+
}
187+
188+
// Eventing holds the config for the eventing module (task queue)
189+
type Eventing struct {
190+
Enabled bool `json:"enabled" yaml:"enabled"`
191+
DBType string `json:"dbType" yaml:"dbType"`
192+
Col string `json:"col" yaml:"col"`
193+
Rules map[string]EventingRule `json:"rules" yaml:"rules"`
194+
InternalRules map[string]EventingRule `json:"internalRules,omitempty" yaml:"internalRules,omitempty"`
195+
}
196+
197+
// EventingRule holds an eventing rule
198+
type EventingRule struct {
199+
Type string `json:"type" yaml:"type"`
200+
Retries int `json:"retries" yaml:"retries"`
201+
Service string `json:"service" yaml:"service"`
202+
Function string `json:"func" yaml:"func"`
203+
Options map[string]string `json:"options" yaml:"options"`
204+
}

config/template.go

+11
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,17 @@ projects:
4646
enabled: true
4747
broker: nats
4848
conn: nats://localhost:4222
49+
pubsub:
50+
enabled: false
51+
broker: nats
52+
conn: nats://localhost:4222
53+
rules:
54+
- subject: /
55+
rule:
56+
publish:
57+
rule: allow
58+
subscribe:
59+
rule: allow
4960
fileStore:
5061
enabled: false
5162
storeType: local

docs/config.json

-180
This file was deleted.

docs/index.js

-89
This file was deleted.

docs/manual/architecture/index.md

-3
This file was deleted.

0 commit comments

Comments
 (0)