|
49 | 49 | ->param('limit', 25 , new Mock(), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) |
50 | 50 | ->param('offset', 0 , new Mock(), 'Results offset. The default value is 0. Use this param to manage pagination.', true) |
51 | 51 | ->param('orderType', 'ASC' , new Mock(), 'Order result by ASC or DESC order.', true) |
52 | | - ->action(function ( $search, $limit, $offset, $orderType ) use ($parser) { |
| 52 | + ->action(function ( $search, $limit, $offset, $orderType ) use ($parser) { |
53 | 53 | $client = new Client(); |
54 | 54 | $path = str_replace([], [], '/database/collections'); |
55 | 55 | $params = []; |
|
71 | 71 | ->param('read', '' , new Mock(), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.', false) |
72 | 72 | ->param('write', '' , new Mock(), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.', false) |
73 | 73 | ->param('rules', '' , new Mock(), 'Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation.', false) |
74 | | - ->action(function ( $name, $read, $write, $rules ) use ($parser) { |
| 74 | + ->action(function ( $name, $read, $write, $rules ) use ($parser) { |
75 | 75 | $client = new Client(); |
76 | 76 | $path = str_replace([], [], '/database/collections'); |
77 | 77 | $params = []; |
|
90 | 90 | ->task('getCollection') |
91 | 91 | ->label('description', "Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.\n\n") |
92 | 92 | ->param('collectionId', '' , new Mock(), 'Collection unique ID.', false) |
93 | | - ->action(function ( $collectionId ) use ($parser) { |
| 93 | + ->action(function ( $collectionId ) use ($parser) { |
94 | 94 | $client = new Client(); |
95 | 95 | $path = str_replace(['{collectionId}'], [$collectionId], '/database/collections/{collectionId}'); |
96 | 96 | $params = []; |
|
109 | 109 | ->param('read', '' , new Mock(), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(/docs/permissions) and get a full list of available permissions.', false) |
110 | 110 | ->param('write', '' , new Mock(), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.', false) |
111 | 111 | ->param('rules', [] , new Mock(), 'Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation.', true) |
112 | | - ->action(function ( $collectionId, $name, $read, $write, $rules ) use ($parser) { |
| 112 | + ->action(function ( $collectionId, $name, $read, $write, $rules ) use ($parser) { |
113 | 113 | $client = new Client(); |
114 | 114 | $path = str_replace(['{collectionId}'], [$collectionId], '/database/collections/{collectionId}'); |
115 | 115 | $params = []; |
|
128 | 128 | ->task('deleteCollection') |
129 | 129 | ->label('description', "Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.\n\n") |
130 | 130 | ->param('collectionId', '' , new Mock(), 'Collection unique ID.', false) |
131 | | - ->action(function ( $collectionId ) use ($parser) { |
| 131 | + ->action(function ( $collectionId ) use ($parser) { |
132 | 132 | $client = new Client(); |
133 | 133 | $path = str_replace(['{collectionId}'], [$collectionId], '/database/collections/{collectionId}'); |
134 | 134 | $params = []; |
|
150 | 150 | ->param('orderType', 'ASC' , new Mock(), 'Order direction. Possible values are DESC for descending order, or ASC for ascending order.', true) |
151 | 151 | ->param('orderCast', 'string' , new Mock(), 'Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.', true) |
152 | 152 | ->param('search', '' , new Mock(), 'Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars.', true) |
153 | | - ->action(function ( $collectionId, $filters, $limit, $offset, $orderField, $orderType, $orderCast, $search ) use ($parser) { |
| 153 | + ->action(function ( $collectionId, $filters, $limit, $offset, $orderField, $orderType, $orderCast, $search ) use ($parser) { |
154 | 154 | $client = new Client(); |
155 | 155 | $path = str_replace(['{collectionId}'], [$collectionId], '/database/collections/{collectionId}/documents'); |
156 | 156 | $params = []; |
|
178 | 178 | ->param('parentDocument', '' , new Mock(), 'Parent document unique ID. Use when you want your new document to be a child of a parent document.', true) |
179 | 179 | ->param('parentProperty', '' , new Mock(), 'Parent document property name. Use when you want your new document to be a child of a parent document.', true) |
180 | 180 | ->param('parentPropertyType', 'assign' , new Mock(), 'Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.', true) |
181 | | - ->action(function ( $collectionId, $data, $read, $write, $parentDocument, $parentProperty, $parentPropertyType ) use ($parser) { |
| 181 | + ->action(function ( $collectionId, $data, $read, $write, $parentDocument, $parentProperty, $parentPropertyType ) use ($parser) { |
182 | 182 | $client = new Client(); |
183 | 183 | $path = str_replace(['{collectionId}'], [$collectionId], '/database/collections/{collectionId}/documents'); |
184 | 184 | $params = []; |
|
200 | 200 | ->label('description', "Get a document by its unique ID. This endpoint response returns a JSON object with the document data.\n\n") |
201 | 201 | ->param('collectionId', '' , new Mock(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).', false) |
202 | 202 | ->param('documentId', '' , new Mock(), 'Document unique ID.', false) |
203 | | - ->action(function ( $collectionId, $documentId ) use ($parser) { |
| 203 | + ->action(function ( $collectionId, $documentId ) use ($parser) { |
204 | 204 | $client = new Client(); |
205 | 205 | $path = str_replace(['{collectionId}', '{documentId}'], [$collectionId, $documentId], '/database/collections/{collectionId}/documents/{documentId}'); |
206 | 206 | $params = []; |
|
219 | 219 | ->param('data', '' , new Mock(), 'Document data as JSON object.', false) |
220 | 220 | ->param('read', '' , new Mock(), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.', false) |
221 | 221 | ->param('write', '' , new Mock(), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.', false) |
222 | | - ->action(function ( $collectionId, $documentId, $data, $read, $write ) use ($parser) { |
| 222 | + ->action(function ( $collectionId, $documentId, $data, $read, $write ) use ($parser) { |
223 | 223 | $client = new Client(); |
224 | 224 | $path = str_replace(['{collectionId}', '{documentId}'], [$collectionId, $documentId], '/database/collections/{collectionId}/documents/{documentId}'); |
225 | 225 | $params = []; |
|
238 | 238 | ->label('description', "Delete a document by its unique ID. This endpoint deletes only the parent documents, its attributes and relations to other documents. Child documents **will not** be deleted.\n\n") |
239 | 239 | ->param('collectionId', '' , new Mock(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).', false) |
240 | 240 | ->param('documentId', '' , new Mock(), 'Document unique ID.', false) |
241 | | - ->action(function ( $collectionId, $documentId ) use ($parser) { |
| 241 | + ->action(function ( $collectionId, $documentId ) use ($parser) { |
242 | 242 | $client = new Client(); |
243 | 243 | $path = str_replace(['{collectionId}', '{documentId}'], [$collectionId, $documentId], '/database/collections/{collectionId}/documents/{documentId}'); |
244 | 244 | $params = []; |
|
0 commit comments