Skip to content

Commit 1b7c7ab

Browse files
BrRenatjenyapoyarkov
authored andcommitted
feat: organizations api (#393)
* feat: added base create organization action * fix: added organization create test * fix: added tests for create organization, edited method * feat: added organization updateMetadata method * feat: added remove organization methodf * fix: added organization info to members * feat: added method to switch organization state * feat: added invite to organization method * fix: edited create organization * fix: edited create organization * fix: fix lint error * fix: fix discussions, edited resolveOrganization script * feat: added invite, members organization api * fix: edited update organization metadata * fix: fix resolve organization metadata * fix: fix lint errors * feat: added getMetadata action * fix: return oauth in test config * fix: added organization api docs * fix: edited lua script, metadata test * fix: fix lua script * fix: fix updateMetadata test * fix: edited invite member to organization * fix: edited add organization members * fix: fix organization members test * fix: edited send invite action * fix: fix get organization test * fix: fix lint test * fix: return oauth config * fix: add allowed method to organization actions * fix: fix auth in organization tests * fix: restart semaphoreci * feat: added request organizations list * fix: fix organizations lua script * fix: remove organization id from ORGANIZATIONS_INDEX * fix: edited allowed handler for organizations * fix: added lock on create organization, resolved discussions * fix: returned bluebird promise * fix: actions response format, switch name to id on requests * fix: edited create organization action * fix: skip facebook test
1 parent 562608a commit 1b7c7ab

57 files changed

Lines changed: 2043 additions & 47 deletions

Some content is hidden

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

schemas/common.json

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,73 @@
8686
"minLength": 32,
8787
"maxLength": 64,
8888
"pattern": "^([A-Z2-7]{2}){16,32}$"
89+
},
90+
"metadata": {
91+
"type": "object",
92+
"minProperties": 1,
93+
"properties": {
94+
"$set": {
95+
"type": "object",
96+
"minProperties": 1,
97+
"additionalProperties": {
98+
"oneOf": [
99+
{
100+
"type": "string",
101+
"minLength": 1
102+
},
103+
{
104+
"type": "array"
105+
},
106+
{
107+
"type": "object"
108+
},
109+
{
110+
"type": "boolean"
111+
},
112+
{
113+
"type": "number"
114+
}
115+
]
116+
}
117+
},
118+
"$remove": {
119+
"type": "array",
120+
"items": {
121+
"type": "string",
122+
"minLength": 1
123+
},
124+
"minItems": 1
125+
},
126+
"$incr": {
127+
"type": "object",
128+
"minProperties": 1,
129+
"additionalProperties": {
130+
"type": "integer"
131+
}
132+
}
133+
}
134+
},
135+
"organizationMember": {
136+
"type": "object",
137+
"required": [
138+
"firstName",
139+
"lastName",
140+
"email"
141+
],
142+
"properties": {
143+
"email": {
144+
"type": "string"
145+
},
146+
"firstName": {
147+
"type": "string"
148+
},
149+
"lastName": {
150+
"type": "string"
151+
},
152+
"permissions": {
153+
"type": "array"
154+
}
155+
}
89156
}
90157
}
91158
}

schemas/organization.create.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"type": "object",
3+
"required": [
4+
"name"
5+
],
6+
"properties": {
7+
"name": {
8+
"type": "string"
9+
},
10+
"active": {
11+
"type": "boolean"
12+
},
13+
"metadata": {
14+
"type": "object",
15+
"minProperties": 1
16+
},
17+
"members": {
18+
"type": "array",
19+
"minItems": 1,
20+
"items": {
21+
"$ref": "common.json#/definitions/organizationMember"
22+
}
23+
}
24+
}
25+
}

schemas/organization.delete.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"type": "object",
3+
"required": [
4+
"organizationId"
5+
],
6+
"properties": {
7+
"organizationId": {
8+
"type": "string"
9+
}
10+
}
11+
}

schemas/organization.get.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"type": "object",
3+
"required": [
4+
"organizationId"
5+
],
6+
"properties": {
7+
"organizationId": {
8+
"type": "string"
9+
}
10+
}
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"type": "object",
3+
"required": [
4+
"organizationId"
5+
],
6+
"properties": {
7+
"organizationId": {
8+
"type": "string"
9+
}
10+
}
11+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"type": "object",
3+
"required": [
4+
"organizationId",
5+
"username",
6+
"inviteToken"
7+
],
8+
"properties": {
9+
"organizationId": {
10+
"type": "string"
11+
},
12+
"username": {
13+
"type": "string"
14+
},
15+
"inviteToken": {
16+
"type": "string",
17+
"minLength": 1
18+
}
19+
}
20+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"type": "object",
3+
"required": [
4+
"organizationId",
5+
"member"
6+
],
7+
"properties": {
8+
"organizationId": {
9+
"type": "string"
10+
},
11+
"member": {
12+
"$ref": "common.json#/definitions/organizationMember"
13+
}
14+
}
15+
}

schemas/organization.list.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"type": "object",
3+
"properties": {
4+
"offset": {
5+
"type": "integer",
6+
"minimum": 0
7+
},
8+
"limit": {
9+
"type": "integer",
10+
"minimum": 1,
11+
"maximum": 100
12+
},
13+
"order": {
14+
"type": "string",
15+
"enum": [
16+
"ASC",
17+
"DESC"
18+
]
19+
},
20+
"criteria": {
21+
"type": "string"
22+
},
23+
"filter": {
24+
"$ref": "common.json#/definitions/filter"
25+
}
26+
}
27+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"type": "object",
3+
"required": [
4+
"organizationId",
5+
"member"
6+
],
7+
"properties": {
8+
"organizationId": {
9+
"type": "string"
10+
},
11+
"member": {
12+
"$ref": "common.json#/definitions/organizationMember"
13+
}
14+
}
15+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"type": "object",
3+
"required": [
4+
"organizationId"
5+
],
6+
"properties": {
7+
"organizationId": {
8+
"type": "string"
9+
}
10+
}
11+
}

0 commit comments

Comments
 (0)