Skip to content

Commit a5aceba

Browse files
committed
formatting & restore scoped actions
1 parent f32a91d commit a5aceba

37 files changed

+1042
-847
lines changed
Lines changed: 95 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,158 +1,169 @@
1-
---
2-
title: ApiInstance
3-
---
1+
---
2+
title: ApiInstance
3+
---
44

55
[![view on npm](http://img.shields.io/npm/v/@plexusjs/core.svg)](https://www.npmjs.org/package/@plexusjs/core)
66

77
An API instance is used to make requests to a server. Interact with this by using api()
88

9-
10-
* [ApiInstance](#ApiInstance)
11-
* [.headers](#ApiInstance+headers) ⇒ <code>Record.&lt;string, string&gt;</code>
12-
* [.config](#ApiInstance+config) ⇒ <code>Record.&lt;string, any&gt;</code>
13-
* [.makeRequest(path, options)](#ApiInstance+makeRequest)
14-
* [.send(path, options)](#ApiInstance+send)
15-
* [.options(options, overwrite)](#ApiInstance+options) ⇒ <code>this</code>
16-
* [.get(path, query)](#ApiInstance+get)
17-
* [.post(path, body)](#ApiInstance+post) ⇒ <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code>
18-
* [.put(path, body)](#ApiInstance+put) ⇒ <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code>
19-
* [.delete(path)](#ApiInstance+delete) ⇒ <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code>
20-
* [.patch(path, body)](#ApiInstance+patch) ⇒ <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code>
21-
* [.gql(query, variables)](#ApiInstance+gql) ⇒ <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code>
22-
* [.auth(type, token)](#ApiInstance+auth) ⇒ <code>this</code>
23-
* [.reset()](#ApiInstance+reset) ⇒ <code>this</code>
24-
25-
<a name="ApiInstance+headers"></a>
9+
- [ApiInstance](#ApiInstance)
10+
- [.headers](#ApiInstance+headers) ⇒ <code>Record.&lt;string, string&gt;</code>
11+
- [.config](#ApiInstance+config) ⇒ <code>Record.&lt;string, any&gt;</code>
12+
- [.makeRequest(path, options)](#ApiInstance+makeRequest)
13+
- [.send(path, options)](#ApiInstance+send)
14+
- [.options(options, overwrite)](#ApiInstance+options) ⇒ <code>this</code>
15+
- [.get(path, query)](#ApiInstance+get)
16+
- [.post(path, body)](#ApiInstance+post) ⇒ <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code>
17+
- [.put(path, body)](#ApiInstance+put) ⇒ <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code>
18+
- [.delete(path)](#ApiInstance+delete) ⇒ <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code>
19+
- [.patch(path, body)](#ApiInstance+patch) ⇒ <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code>
20+
- [.gql(query, variables)](#ApiInstance+gql) ⇒ <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code>
21+
- [.auth(type, token)](#ApiInstance+auth) ⇒ <code>this</code>
22+
- [.reset()](#ApiInstance+reset) ⇒ <code>this</code>
23+
24+
<a name='ApiInstance+headers'></a>
2625

2726
### .headers ⇒ <code>Record.&lt;string, string&gt;</code>
27+
2828
<p>Get the headers for the request</p>
2929

30-
**Returns**: <code>Record.&lt;string, string&gt;</code> <p>The headers for the request</p>
31-
<a name="ApiInstance+config"></a>
30+
**Returns**: <code>Record.&lt;string, string&gt;</code> <p>The headers for the request</p>
31+
32+
<a name='ApiInstance+config'></a>
3233

3334
### .config ⇒ <code>Record.&lt;string, any&gt;</code>
35+
3436
<p>The configuration of this api</p>
3537

36-
**Returns**: <code>Record.&lt;string, any&gt;</code> <p>The configuration of this api</p>
37-
<a name="ApiInstance+makeRequest"></a>
38+
**Returns**: <code>Record.&lt;string, any&gt;</code> <p>The configuration of this api</p>
39+
40+
<a name='ApiInstance+makeRequest'></a>
3841

3942
### .makeRequest(path, options)
40-
<p>Send a request to the server</p>
4143

44+
<p>Send a request to the server</p>
4245

43-
| Param |
44-
| --- |
45-
| path |
46-
| options |
46+
| Param |
47+
| ------- |
48+
| path |
49+
| options |
4750

48-
<a name="ApiInstance+send"></a>
51+
<a name='ApiInstance+send'></a>
4952

5053
### .send(path, options)
51-
<p>Do some pre-send stuff</p>
5254

55+
<p>Do some pre-send stuff</p>
5356

54-
| Param |
55-
| --- |
56-
| path |
57-
| options |
57+
| Param |
58+
| ------- |
59+
| path |
60+
| options |
5861

59-
<a name="ApiInstance+options"></a>
62+
<a name='ApiInstance+options'></a>
6063

6164
### .options(options, overwrite) ⇒ <code>this</code>
65+
6266
<p>Set the configuration options for fetch</p>
6367

64-
**Returns**: <code>this</code> <p>The current instance</p>
68+
**Returns**: <code>this</code> <p>The current instance</p>
6569

66-
| Param | Type | Default | Description |
67-
| --- | --- | --- | --- |
68-
| options | <code>RequestInit</code> | | <p>Same as fetch options</p> |
69-
| overwrite | <code>boolean</code> | <code>false</code> | <p>(optional) If true, will overwrite the current options object</p> |
70+
| Param | Type | Default | Description |
71+
| --------- | ------------------------ | ------------------ | -------------------------------------------------------------------- |
72+
| options | <code>RequestInit</code> | | <p>Same as fetch options</p> |
73+
| overwrite | <code>boolean</code> | <code>false</code> | <p>(optional) If true, will overwrite the current options object</p> |
7074

71-
<a name="ApiInstance+get"></a>
75+
<a name='ApiInstance+get'></a>
7276

7377
### .get(path, query)
74-
<p>Send a get request</p>
7578

79+
<p>Send a get request</p>
7680

77-
| Param | Type | Description |
78-
| --- | --- | --- |
79-
| path | <code>string</code> | <p>The url to send the request to</p> |
80-
| query | <code>Record.&lt;string, any&gt;</code> | <p>The url query to send</p> |
81+
| Param | Type | Description |
82+
| ----- | --------------------------------------- | ------------------------------------- |
83+
| path | <code>string</code> | <p>The url to send the request to</p> |
84+
| query | <code>Record.&lt;string, any&gt;</code> | <p>The url query to send</p> |
8185

82-
<a name="ApiInstance+post"></a>
86+
<a name='ApiInstance+post'></a>
8387

8488
### .post(path, body) ⇒ <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code>
89+
8590
<p>Send a post request</p>
8691

87-
**Returns**: <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code> <p>The response from the server</p>
92+
**Returns**: <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code> <p>The response from the server</p>
8893

89-
| Param | Type | Description |
90-
| --- | --- | --- |
91-
| path | <code>string</code> | <p>The url to send the request to</p> |
92-
| body | <code>Record.&lt;string, any&gt;</code> \| <code>string</code> | <p>The body of the request (can be a string or object)</p> |
94+
| Param | Type | Description |
95+
| ----- | -------------------------------------------------------------- | ---------------------------------------------------------- |
96+
| path | <code>string</code> | <p>The url to send the request to</p> |
97+
| body | <code>Record.&lt;string, any&gt;</code> \| <code>string</code> | <p>The body of the request (can be a string or object)</p> |
9398

94-
<a name="ApiInstance+put"></a>
99+
<a name='ApiInstance+put'></a>
95100

96101
### .put(path, body) ⇒ <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code>
102+
97103
<p>Send a put request</p>
98104

99-
**Returns**: <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code> <p>The response from the server</p>
105+
**Returns**: <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code> <p>The response from the server</p>
100106

101-
| Param | Type | Description |
102-
| --- | --- | --- |
103-
| path | <code>string</code> | <p>The url to send the request to</p> |
104-
| body | <code>Record.&lt;string, any&gt;</code> \| <code>string</code> | <p>The body of the request (can be a string or object)</p> |
107+
| Param | Type | Description |
108+
| ----- | -------------------------------------------------------------- | ---------------------------------------------------------- |
109+
| path | <code>string</code> | <p>The url to send the request to</p> |
110+
| body | <code>Record.&lt;string, any&gt;</code> \| <code>string</code> | <p>The body of the request (can be a string or object)</p> |
105111

106-
<a name="ApiInstance+delete"></a>
112+
<a name='ApiInstance+delete'></a>
107113

108114
### .delete(path) ⇒ <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code>
115+
109116
<p>Send a delete request</p>
110117

111-
**Returns**: <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code> <p>The response from the server</p>
118+
**Returns**: <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code> <p>The response from the server</p>
112119

113-
| Param | Type | Description |
114-
| --- | --- | --- |
115-
| path | <code>string</code> | <p>The url to send the request to</p> |
120+
| Param | Type | Description |
121+
| ----- | ------------------- | ------------------------------------- |
122+
| path | <code>string</code> | <p>The url to send the request to</p> |
116123

117-
<a name="ApiInstance+patch"></a>
124+
<a name='ApiInstance+patch'></a>
118125

119126
### .patch(path, body) ⇒ <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code>
127+
120128
<p>Send a patch request</p>
121129

122-
**Returns**: <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code> <p>The response from the server</p>
130+
**Returns**: <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code> <p>The response from the server</p>
123131

124-
| Param | Type | Description |
125-
| --- | --- | --- |
126-
| path | <code>string</code> | <p>The url to send the request to</p> |
127-
| body | <code>Record.&lt;string, any&gt;</code> \| <code>string</code> | <p>The body of the request (can be a string or object)</p> |
132+
| Param | Type | Description |
133+
| ----- | -------------------------------------------------------------- | ---------------------------------------------------------- |
134+
| path | <code>string</code> | <p>The url to send the request to</p> |
135+
| body | <code>Record.&lt;string, any&gt;</code> \| <code>string</code> | <p>The body of the request (can be a string or object)</p> |
128136

129-
<a name="ApiInstance+gql"></a>
137+
<a name='ApiInstance+gql'></a>
130138

131139
### .gql(query, variables) ⇒ <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code>
140+
132141
<p>Send a graphql request</p>
133142

134-
**Returns**: <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code> <p>The response from the server</p>
143+
**Returns**: <code>Promise.&lt;PlexusApiRes.&lt;unknown&gt;&gt;</code> <p>The response from the server</p>
135144

136-
| Param | Type | Description |
137-
| --- | --- | --- |
138-
| query | <code>string</code> | <p>The gql query to send</p> |
139-
| variables | <code>Record.&lt;string, any&gt;</code> | <p>Variables</p> |
145+
| Param | Type | Description |
146+
| --------- | --------------------------------------- | ---------------------------- |
147+
| query | <code>string</code> | <p>The gql query to send</p> |
148+
| variables | <code>Record.&lt;string, any&gt;</code> | <p>Variables</p> |
140149

141-
<a name="ApiInstance+auth"></a>
150+
<a name='ApiInstance+auth'></a>
142151

143152
### .auth(type, token) ⇒ <code>this</code>
153+
144154
<p>Set the authentication details for the request</p>
145155

146-
**Returns**: <code>this</code> <p>The current instance</p>
156+
**Returns**: <code>this</code> <p>The current instance</p>
147157

148-
| Param | Type | Description |
149-
| --- | --- | --- |
150-
| type | <code>&#x27;bearer&#x27;</code> \| <code>&#x27;basic&#x27;</code> \| <code>&#x27;jwt&#x27;</code> | <p>optional - The type of authentication to use. This determines what prefix to use for the header</p> |
151-
| token | <code>string</code> | <p>The token to use for authentication</p> |
158+
| Param | Type | Description |
159+
| ----- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
160+
| type | <code>&#x27;bearer&#x27;</code> \| <code>&#x27;basic&#x27;</code> \| <code>&#x27;jwt&#x27;</code> | <p>optional - The type of authentication to use. This determines what prefix to use for the header</p> |
161+
| token | <code>string</code> | <p>The token to use for authentication</p> |
152162

153-
<a name="ApiInstance+reset"></a>
163+
<a name='ApiInstance+reset'></a>
154164

155165
### .reset() ⇒ <code>this</code>
166+
156167
<p>Reset this routes configuration</p>
157168

158-
**Returns**: <code>this</code> <p>The current instance</p>
169+
**Returns**: <code>this</code> <p>The current instance</p>
Lines changed: 52 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,99 @@
1-
---
2-
title: CollectionData
3-
---
1+
---
2+
title: CollectionData
3+
---
44

55
[![view on npm](http://img.shields.io/npm/v/@plexusjs/core.svg)](https://www.npmjs.org/package/@plexusjs/core)
66

77
A piece of data belonging to a collection
88

9+
- [CollectionData](#CollectionData)
10+
- [.id](#CollectionData+id) : <code>string</code>
11+
- [.instanceId](#CollectionData+instanceId) : <code>string</code>
12+
- [.value](#CollectionData+value) : <code>DataType</code>
13+
- [.shallowValue](#CollectionData+shallowValue) : <code>DataType</code>
14+
- [.set(value)](#CollectionData+set) ⇒ <code>this</code>
15+
- [.patch(value)](#CollectionData+patch) ⇒ <code>this</code>
16+
- [.delete()](#CollectionData+delete) ⇒ <code>this</code>
17+
- [.clean()](#CollectionData+clean) ⇒ <code>this</code>
18+
- [.decay(time)](#CollectionData+decay) ⇒ <code>this</code>
919

10-
* [CollectionData](#CollectionData)
11-
* [.id](#CollectionData+id) : <code>string</code>
12-
* [.instanceId](#CollectionData+instanceId) : <code>string</code>
13-
* [.value](#CollectionData+value) : <code>DataType</code>
14-
* [.shallowValue](#CollectionData+shallowValue) : <code>DataType</code>
15-
* [.set(value)](#CollectionData+set) ⇒ <code>this</code>
16-
* [.patch(value)](#CollectionData+patch) ⇒ <code>this</code>
17-
* [.delete()](#CollectionData+delete) ⇒ <code>this</code>
18-
* [.clean()](#CollectionData+clean) ⇒ <code>this</code>
19-
* [.decay(time)](#CollectionData+decay) ⇒ <code>this</code>
20-
21-
<a name="CollectionData+id"></a>
20+
<a name='CollectionData+id'></a>
2221

2322
### .id : <code>string</code>
23+
2424
<p>The internal id of the state with an instance prefix</p>
2525

26-
<a name="CollectionData+instanceId"></a>
26+
<a name='CollectionData+instanceId'></a>
2727

2828
### .instanceId : <code>string</code>
29+
2930
<p>The internal id of the state with an instance prefix</p>
3031

31-
<a name="CollectionData+value"></a>
32+
<a name='CollectionData+value'></a>
3233

3334
### .value : <code>DataType</code>
35+
3436
<p>Get the value of the data instance</p>
3537

36-
<a name="CollectionData+shallowValue"></a>
38+
<a name='CollectionData+shallowValue'></a>
3739

3840
### .shallowValue : <code>DataType</code>
39-
<p>Get the shallow value of the data instance (no foreign key values injected)</p>
4041

41-
<a name="CollectionData+set"></a>
42+
<p>
43+
Get the shallow value of the data instance (no foreign key values injected)
44+
</p>
45+
46+
<a name='CollectionData+set'></a>
4247

4348
### .set(value) ⇒ <code>this</code>
49+
4450
<p>Set the value of the data instance</p>
4551

46-
**Returns**: <code>this</code> <p>The data instance</p>
52+
**Returns**: <code>this</code> <p>The data instance</p>
4753

48-
| Param | Type | Description |
49-
| --- | --- | --- |
54+
| Param | Type | Description |
55+
| ----- | --------------------- | ----------------------- |
5056
| value | <code>DataType</code> | <p>The value to set</p> |
5157

52-
<a name="CollectionData+patch"></a>
58+
<a name='CollectionData+patch'></a>
5359

5460
### .patch(value) ⇒ <code>this</code>
61+
5562
<p>Patch the current value of the state</p>
5663

57-
**Returns**: <code>this</code> <p>The data instance</p>
64+
**Returns**: <code>this</code> <p>The data instance</p>
5865

59-
| Param | Type | Description |
60-
| --- | --- | --- |
66+
| Param | Type | Description |
67+
| ----- | --------------------- | ----------------------------------------------------------- |
6168
| value | <code>DataType</code> | <p>A value of the state to merge with the current value</p> |
6269

63-
<a name="CollectionData+delete"></a>
70+
<a name='CollectionData+delete'></a>
6471

6572
### .delete() ⇒ <code>this</code>
73+
6674
<p>Delete the data instance</p>
6775

68-
**Returns**: <code>this</code> <p>The data instance</p>
69-
<a name="CollectionData+clean"></a>
76+
**Returns**: <code>this</code> <p>The data instance</p>
77+
78+
<a name='CollectionData+clean'></a>
7079

7180
### .clean() ⇒ <code>this</code>
72-
<p>Clean this data instance (remove all watchers &amp; remove the state from the instance)</p>
7381

74-
**Returns**: <code>this</code> <p>The data instance</p>
75-
<a name="CollectionData+decay"></a>
82+
<p>
83+
Clean this data instance (remove all watchers &amp; remove the state from the
84+
instance)
85+
</p>
86+
87+
**Returns**: <code>this</code> <p>The data instance</p>
88+
89+
<a name='CollectionData+decay'></a>
7690

7791
### .decay(time) ⇒ <code>this</code>
78-
<p>Decay this data instance after a certain amount of time</p>
7992

80-
**Returns**: <code>this</code> <p>The data instance</p>
93+
<p>Decay this data instance after a certain amount of time</p>
8194

82-
| Param | Type | Description |
83-
| --- | --- | --- |
84-
| time | <code>boolean</code> \| <code>string</code> | <p>The time to decay in ms</p> |
95+
**Returns**: <code>this</code> <p>The data instance</p>
8596

97+
| Param | Type | Description |
98+
| ----- | ------------------------------------------- | ------------------------------ |
99+
| time | <code>boolean</code> \| <code>string</code> | <p>The time to decay in ms</p> |

0 commit comments

Comments
 (0)