Constructor
new v2(resourceURL, optionsopt)
- Source:
Creates a new instance.
Example
import { CRESTv2 } from "@forgerock/crest-js";
const resource = new CRESTv2("http://www.example.com");
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
resourceURL |
string | URL of the resource. | |||||||||||||||||
options |
object |
<optional> |
{}
|
Options.
Properties
|
Members
(readonly) protocolVersion
- Source:
CREST protocol version.
Methods
action(action, optionsopt) → {Promise.<Response>}
- Source:
- See:
Invokes an action on a resource provider.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
action |
string | Action name. | ||||||||||||||
options |
object |
<optional> |
{}
|
Options.
Properties
|
Returns:
A Promise that resolves to a Response object.
- Type
- Promise.<Response>
create(body, optionsopt) → {Promise.<Response>}
- Source:
- See:
Creates a resource.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
body |
object | Resource representation. | ||||||||||||||
options |
object |
<optional> |
{}
|
Options.
Properties
|
Returns:
A Promise that resolves to a Response object.
- Type
- Promise.<Response>
delete(id, optionsopt) → {Promise.<Response>}
- Source:
- See:
Deletes a single resource by ID.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id |
string | Resource ID. | ||||||||||||||
options |
object |
<optional> |
{}
|
Options.
Properties
|
Returns:
A Promise that resolves to a Response object.
- Type
- Promise.<Response>
get(id, optionsopt) → {Promise.<Response>}
- Source:
- See:
Retrieves a single resource by ID.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
id |
string | Resource ID. | ||||||||||
options |
object |
<optional> |
{}
|
Options.
Properties
|
Returns:
A Promise that resolves to a Response object.
- Type
- Promise.<Response>
queryFilter(optionsopt) → {Promise.<Response>}
- Source:
- See:
Queries a resource collection.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
{}
|
Options.
Properties
|
Returns:
A Promise that resolves to a Response object.
- Type
- Promise.<Response>
update(id, body, optionsopt) → {Promise.<Response>}
- Source:
- See:
Updates a single resource by ID.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id |
string | Resource ID. | ||||||||||||||
body |
object | Resource representation. | ||||||||||||||
options |
object |
<optional> |
{}
|
Options.
Properties
|
Returns:
A Promise that resolves to a Response object.
- Type
- Promise.<Response>