|
8 | 8 | "default": "import { compositionClient } from '@algolia/client-composition';"
|
9 | 9 | },
|
10 | 10 | "customDelete": {
|
11 |
| - "default": "const response = await client.customDelete({ path: 'test/minimal' });" |
| 11 | + "allow del method for a custom path with minimal parameters": "const response = await client.customDelete({ path: 'test/minimal' });", |
| 12 | + "allow del method for a custom path with all parameters": "const response = await client.customDelete({ path: 'test/all', parameters: { query: 'parameters' } });" |
12 | 13 | },
|
13 | 14 | "customGet": {
|
14 |
| - "default": "const response = await client.customGet({ path: 'test/minimal' });" |
| 15 | + "allow get method for a custom path with minimal parameters": "const response = await client.customGet({ path: 'test/minimal' });", |
| 16 | + "allow get method for a custom path with all parameters": "const response = await client.customGet({ path: 'test/all', parameters: { query: 'parameters with space' } });", |
| 17 | + "requestOptions should be escaped too": "const response = await client.customGet(\n { path: 'test/all', parameters: { query: 'to be overriden' } },\n {\n queryParameters: { query: 'parameters with space', 'and an array': ['array', 'with spaces'] },\n headers: { 'x-header-1': 'spaces are left alone' },\n },\n);" |
15 | 18 | },
|
16 | 19 | "customPost": {
|
17 |
| - "default": "const response = await client.customPost({ path: 'test/minimal' });" |
| 20 | + "allow post method for a custom path with minimal parameters": "const response = await client.customPost({ path: 'test/minimal' });", |
| 21 | + "allow post method for a custom path with all parameters": "const response = await client.customPost({\n path: 'test/all',\n parameters: { query: 'parameters' },\n body: { body: 'parameters' },\n});", |
| 22 | + "requestOptions can override default query parameters": "const response = await client.customPost(\n { path: 'test/requestOptions', parameters: { query: 'parameters' }, body: { facet: 'filters' } },\n {\n queryParameters: { query: 'myQueryParameter' },\n },\n);", |
| 23 | + "requestOptions merges query parameters with default ones": "const response = await client.customPost(\n { path: 'test/requestOptions', parameters: { query: 'parameters' }, body: { facet: 'filters' } },\n {\n queryParameters: { query2: 'myQueryParameter' },\n },\n);", |
| 24 | + "requestOptions can override default headers": "const response = await client.customPost(\n { path: 'test/requestOptions', parameters: { query: 'parameters' }, body: { facet: 'filters' } },\n {\n headers: { 'x-algolia-api-key': 'ALGOLIA_API_KEY' },\n },\n);", |
| 25 | + "requestOptions merges headers with default ones": "const response = await client.customPost(\n { path: 'test/requestOptions', parameters: { query: 'parameters' }, body: { facet: 'filters' } },\n {\n headers: { 'x-algolia-api-key': 'ALGOLIA_API_KEY' },\n },\n);", |
| 26 | + "requestOptions queryParameters accepts booleans": "const response = await client.customPost(\n { path: 'test/requestOptions', parameters: { query: 'parameters' }, body: { facet: 'filters' } },\n {\n queryParameters: { isItWorking: true },\n },\n);", |
| 27 | + "requestOptions queryParameters accepts integers": "const response = await client.customPost(\n { path: 'test/requestOptions', parameters: { query: 'parameters' }, body: { facet: 'filters' } },\n {\n queryParameters: { myParam: 2 },\n },\n);", |
| 28 | + "requestOptions queryParameters accepts list of string": "const response = await client.customPost(\n { path: 'test/requestOptions', parameters: { query: 'parameters' }, body: { facet: 'filters' } },\n {\n queryParameters: { myParam: ['b and c', 'd'] },\n },\n);", |
| 29 | + "requestOptions queryParameters accepts list of booleans": "const response = await client.customPost(\n { path: 'test/requestOptions', parameters: { query: 'parameters' }, body: { facet: 'filters' } },\n {\n queryParameters: { myParam: [true, true, false] },\n },\n);", |
| 30 | + "requestOptions queryParameters accepts list of integers": "const response = await client.customPost(\n { path: 'test/requestOptions', parameters: { query: 'parameters' }, body: { facet: 'filters' } },\n {\n queryParameters: { myParam: [1, 2] },\n },\n);" |
18 | 31 | },
|
19 | 32 | "customPut": {
|
20 |
| - "default": "const response = await client.customPut({ path: 'test/minimal' });" |
| 33 | + "allow put method for a custom path with minimal parameters": "const response = await client.customPut({ path: 'test/minimal' });", |
| 34 | + "allow put method for a custom path with all parameters": "const response = await client.customPut({\n path: 'test/all',\n parameters: { query: 'parameters' },\n body: { body: 'parameters' },\n});" |
21 | 35 | },
|
22 | 36 | "getComposition": {
|
23 | 37 | "default": "const response = await client.getComposition({ compositionID: 'foo' });"
|
|
29 | 43 | "default": "const response = await client.getTask({ compositionID: 'foo', taskID: 42 });"
|
30 | 44 | },
|
31 | 45 | "listCompositions": {
|
32 |
| - "default": "const response = await client.listCompositions();" |
| 46 | + "listCompositions": "const response = await client.listCompositions();" |
33 | 47 | },
|
34 | 48 | "multipleBatch": {
|
35 | 49 | "default": "const response = await client.multipleBatch({\n requests: [\n {\n action: 'upsert',\n body: {\n objectID: 'foo',\n name: 'my first composition',\n behavior: { injection: { main: { source: { search: { index: 'bar' } } }, injectedItems: [] } },\n },\n },\n { action: 'delete', body: { objectID: 'baz' } },\n ],\n});"
|
|
0 commit comments