docs: added reference for JS Client (#1629)

* added reference for JS Client

* added reference for JS Client

* added reference for JS Client
This commit is contained in:
Shahed Nasser
2022-07-08 18:21:46 +03:00
committed by GitHub
parent 371682b4f7
commit 3b28f46705
357 changed files with 32911 additions and 3 deletions

View File

@@ -0,0 +1,133 @@
# Class: AdminCollectionsResource
## Hierarchy
- `default`
**`AdminCollectionsResource`**
## Methods
### create
**create**(`payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminCollectionsRes`](../modules/internal.md#admincollectionsres)\>
**`description`** Creates a collection.
#### Parameters
| Name | Type |
| :------ | :------ |
| `payload` | [`AdminPostCollectionsReq`](internal.AdminPostCollectionsReq.md) |
| `customHeaders` | [`Record`](../modules/internal.md#record)<`string`, `any`\> |
#### Returns
[`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminCollectionsRes`](../modules/internal.md#admincollectionsres)\>
Created collection.
#### Defined in
[packages/medusa-js/src/resources/admin/collections.ts:20](https://github.com/medusajs/medusa/blob/2eb2126f/packages/medusa-js/src/resources/admin/collections.ts#L20)
___
### delete
**delete**(`id`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`DeleteResponse`](../modules/internal.md#deleteresponse)\>
**`description`** deletes a collection
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `id` | `string` | id of collection to delete. |
| `customHeaders` | [`Record`](../modules/internal.md#record)<`string`, `any`\> | |
#### Returns
[`ResponsePromise`](../modules/internal.md#responsepromise)<[`DeleteResponse`](../modules/internal.md#deleteresponse)\>
Deleted response
#### Defined in
[packages/medusa-js/src/resources/admin/collections.ts:50](https://github.com/medusajs/medusa/blob/2eb2126f/packages/medusa-js/src/resources/admin/collections.ts#L50)
___
### list
**list**(`query?`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminCollectionsListRes`](../modules/internal.md#admincollectionslistres)\>
**`description`** Lists collections matching a query
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `query?` | [`AdminGetCollectionsParams`](internal.AdminGetCollectionsParams.md) | Query for searching collections |
| `customHeaders` | [`Record`](../modules/internal.md#record)<`string`, `any`\> | |
#### Returns
[`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminCollectionsListRes`](../modules/internal.md#admincollectionslistres)\>
a list of collections matching the query.
#### Defined in
[packages/medusa-js/src/resources/admin/collections.ts:72](https://github.com/medusajs/medusa/blob/2eb2126f/packages/medusa-js/src/resources/admin/collections.ts#L72)
___
### retrieve
**retrieve**(`id`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminCollectionsRes`](../modules/internal.md#admincollectionsres)\>
**`description`** get a collection
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `id` | `string` | id of the collection to retrieve. |
| `customHeaders` | [`Record`](../modules/internal.md#record)<`string`, `any`\> | |
#### Returns
[`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminCollectionsRes`](../modules/internal.md#admincollectionsres)\>
the collection with the given id
#### Defined in
[packages/medusa-js/src/resources/admin/collections.ts:61](https://github.com/medusajs/medusa/blob/2eb2126f/packages/medusa-js/src/resources/admin/collections.ts#L61)
___
### update
**update**(`id`, `payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminCollectionsRes`](../modules/internal.md#admincollectionsres)\>
**`description`** Updates a collection
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `id` | `string` | id of the collection to update. |
| `payload` | [`AdminPostCollectionsCollectionReq`](internal.AdminPostCollectionsCollectionReq.md) | update to apply to collection. |
| `customHeaders` | [`Record`](../modules/internal.md#record)<`string`, `any`\> | |
#### Returns
[`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminCollectionsRes`](../modules/internal.md#admincollectionsres)\>
the updated collection.
#### Defined in
[packages/medusa-js/src/resources/admin/collections.ts:35](https://github.com/medusajs/medusa/blob/2eb2126f/packages/medusa-js/src/resources/admin/collections.ts#L35)