# Class JArticleApi

#### Hierarchy (View Summary)

- JBaseApi
  - JArticleApi

- Defined in jamespot-user-api/src/apis/article/article.ts:31

##### Index

### Constructors

constructor

### Properties

jApi
network

### Methods

addComment
archive
count
create
delete
deleteComment
get
getAttachments
getComment
getComments
getRead
list
moveToSpot
permalink
saveAsDraft
search
update
updateComment

## Constructors

### constructor

- new JArticleApi(jApi: JamespotUserApi): JArticleApi

  #### Parameters

  - jApi: JamespotUserApi

  #### Returns JArticleApi

  Inherited from JBaseApi.constructor

  - Defined in jamespot-user-api/src/apis/base.ts:8

## Properties

### jApi

jApi: JamespotUserApi

Inherited from JBaseApi.jApi

- Defined in jamespot-user-api/src/apis/base.ts:5

### network

network: Network

Inherited from JBaseApi.network

- Defined in jamespot-user-api/src/apis/base.ts:6

## Methods

### addComment

- addComment<
  F extends "raw-little"
  | "raw-list"
  | "raw-view" = LITTLE,
  T extends string | number | symbol = never,
  E extends CommentFormatsExtension = [],
  >(
  payload: AddCommentParams,
  options?: { format?: F; formatExtension?: E; signal?: AbortSignal },
  ): Promise<ApiWrapper<T, BaseMessages>>

  #### Type Parameters

  - F extends "raw-little" | "raw-list" | "raw-view" = LITTLE
  - T extends string | number | symbol = never
  - E extends CommentFormatsExtension = []

  #### Parameters

  - payload: AddCommentParams
  - `Optional` options: { format?: F; formatExtension?: E; signal?: AbortSignal }

  #### Returns Promise<ApiWrapper<T, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/article/article.ts:220

### archive

- archive(
  payload: { archive: boolean; uri: string },
  options?: { signal?: AbortSignal },
  ): Promise<ApiWrapper<boolean, BaseMessages>>

  #### Parameters

  - payload: { archive: boolean; uri: string }
  - `Optional` options: { signal?: AbortSignal }

  #### Returns Promise<ApiWrapper<boolean, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/article/article.ts:310

### count

- count(type: string): Promise<ApiWrapper<number, BaseMessages>>

  #### Parameters

  - type: string

  #### Returns Promise<ApiWrapper<number, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/article/article.ts:137

### create

- create<
  P extends ArticleCreation = ArticleCreation,
  F extends "raw-little" | "raw-list" | "raw-view" = VIEW,
  T extends string | number | symbol = never,
  E extends ArticleFormatsExtension = [],
  >(
  payload: MaybeWithToken<P>,
  options?: { format?: F; formatExtension?: E; signal?: AbortSignal },
  ): PromiseApiWrapper<ArticleReturn<F, T, E>[]>

  #### Type Parameters

  - P extends ArticleCreation = ArticleCreation
  - F extends "raw-little" | "raw-list" | "raw-view" = VIEW
  - T extends string | number | symbol = never
  - E extends ArticleFormatsExtension = []

  #### Parameters

  - payload: MaybeWithToken<P>
  - `Optional` options: { format?: F; formatExtension?: E; signal?: AbortSignal }

  #### Returns PromiseApiWrapper<ArticleReturn<F, T, E>[]>

  - Defined in jamespot-user-api/src/apis/article/article.ts:89

### delete

- delete(id: number): Promise<ApiWrapper<boolean, BaseMessages>>

  #### Parameters

  - id: number

  #### Returns Promise<ApiWrapper<boolean, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/article/article.ts:129

### deleteComment

- deleteComment(idComment: number): PromiseApiWrapper<void>

  #### Parameters

  - idComment: number

  #### Returns PromiseApiWrapper<void>

  - Defined in jamespot-user-api/src/apis/article/article.ts:280

### get

- get<
  F extends "raw-little"
  | "raw-list"
  | "raw-view" = VIEW,
  T extends string | number | symbol = never,
  E extends ArticleFormatsExtension = [],
  >(
  payload: ArticleGetConfig,
  options?: { format?: F; formatExtension?: E; signal?: AbortSignal },
  ): PromiseApiWrapper<ArticleReturn<F, T, E>>

  #### Type Parameters

  - F extends "raw-little" | "raw-list" | "raw-view" = VIEW
  - T extends string | number | symbol = never
  - E extends ArticleFormatsExtension = []

  #### Parameters

  - payload: ArticleGetConfig
  - `Optional` options: { format?: F; formatExtension?: E; signal?: AbortSignal }

  #### Returns PromiseApiWrapper<ArticleReturn<F, T, E>>

  - Defined in jamespot-user-api/src/apis/article/article.ts:70

### getAttachments

- getAttachments(
  id: number,
  type: string,
  options?: {
  format?: "raw-little" | "raw-list" | "raw-view";
  signal?: AbortSignal;
  },
  ): Promise<ApiWrapper<jFileLittle[], BaseMessages>>

  ❌ Take care of format

  #### Parameters

  - id: number
  - type: string
  - `Optional` options: { format?: "raw-little" | "raw-list" | "raw-view"; signal?: AbortSignal }

  #### Returns Promise<ApiWrapper<jFileLittle[], BaseMessages>>

  - Defined in jamespot-user-api/src/apis/article/article.ts:148

### getComment

- getComment<
  F extends "raw-little"
  | "raw-list"
  | "raw-view" = LITTLE,
  T extends string | number | symbol = never,
  E extends CommentFormatsExtension = [],
  >(
  payload: { idComment: string | number },
  options?: { format?: F; formatExtension?: E; signal?: AbortSignal },
  ): PromiseApiWrapper<CommentReturn<F, T, E>>

  #### Type Parameters

  - F extends "raw-little" | "raw-list" | "raw-view" = LITTLE
  - T extends string | number | symbol = never
  - E extends CommentFormatsExtension = []

  #### Parameters

  - payload: { idComment: string | number }
  - `Optional` options: { format?: F; formatExtension?: E; signal?: AbortSignal }

  #### Returns PromiseApiWrapper<CommentReturn<F, T, E>>

  - Defined in jamespot-user-api/src/apis/article/article.ts:261

### getComments

- getComments<
  F extends "raw-little"
  | "raw-list"
  | "raw-view" = LITTLE,
  T extends string | number | symbol = never,
  E extends CommentFormatsExtension = [],
  >(
  payload: GetCommentsParams,
  options?: { format?: F; formatExtension?: E; signal?: AbortSignal },
  ): PromiseApiWrapper<CommentReturn<F, T, E>[]>

  #### Type Parameters

  - F extends "raw-little" | "raw-list" | "raw-view" = LITTLE
  - T extends string | number | symbol = never
  - E extends CommentFormatsExtension = []

  #### Parameters

  - payload: GetCommentsParams
  - `Optional` options: { format?: F; formatExtension?: E; signal?: AbortSignal }

  #### Returns PromiseApiWrapper<CommentReturn<F, T, E>[]>

  - Defined in jamespot-user-api/src/apis/article/article.ts:199

### getRead

- getRead(uri: string): PromiseApiWrapper<{ count: number; list: UserRead[] }>

  #### Parameters

  - uri: string

  #### Returns PromiseApiWrapper<{ count: number; list: UserRead[] }>

  - Defined in jamespot-user-api/src/apis/article/article.ts:288

### list

- list<
  F extends "raw-little"
  | "raw-list"
  | "raw-view" = LITTLE,
  T extends string | number | symbol = never,
  E extends ArticleFormatsExtension = [],
  >(
  payload: ArticleListConfig,
  options?: { format?: F; formatExtension?: E; signal?: AbortSignal },
  ): PromiseApiPagingResults<ArticleReturn<F, T, E>>

  #### Type Parameters

  - F extends "raw-little" | "raw-list" | "raw-view" = LITTLE
  - T extends string | number | symbol = never
  - E extends ArticleFormatsExtension = []

  #### Parameters

  - payload: ArticleListConfig
  - `Optional` options: { format?: F; formatExtension?: E; signal?: AbortSignal }

  #### Returns PromiseApiPagingResults<ArticleReturn<F, T, E>>

  - Defined in jamespot-user-api/src/apis/article/article.ts:32

### moveToSpot

- moveToSpot(
  payload: { idArticle: number; idSpotFrom: number; idSpotTo: number },
  options?: { signal?: AbortSignal },
  ): PromiseApiWrapper<boolean>

  #### Parameters

  - payload: { idArticle: number; idSpotFrom: number; idSpotTo: number }
  - `Optional` options: { signal?: AbortSignal }

  #### Returns PromiseApiWrapper<boolean>

  - Defined in jamespot-user-api/src/apis/article/article.ts:296

### permalink

- permalink(
  permalinkId: string,
  options?: { signal?: AbortSignal },
  ): Promise<ApiWrapper<jArticleLittle, BaseMessages>>

  #### Parameters

  - permalinkId: string
  - `Optional` options: { signal?: AbortSignal }

  #### Returns Promise<ApiWrapper<jArticleLittle, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/article/article.ts:165

### saveAsDraft

- saveAsDraft(
  payload: {
  contentType: string;
  form: Record<string, unknown>;
  idDraft?: string;
  idFrom?: number;
  permalinkId?: string;
  scheduleDate?: string;
  },
  options?: { signal?: AbortSignal },
  ): PromiseApiWrapper<{ idDraft: string; msg: string }>

  #### Parameters

  - payload: {
    contentType: string;
    form: Record<string, unknown>;
    idDraft?: string;
    idFrom?: number;
    permalinkId?: string;
    scheduleDate?: string;
    }
  - `Optional` options: { signal?: AbortSignal }

  #### Returns PromiseApiWrapper<{ idDraft: string; msg: string }>

  - Defined in jamespot-user-api/src/apis/article/article.ts:176

### search

- search<
  F extends "raw-little"
  | "raw-list"
  | "raw-view" = LITTLE,
  T extends string | number | symbol = never,
  E extends ArticleFormatsExtension = [],
  >(
  payload: ArticleListConfig,
  options?: { format?: F; formatExtension?: E; signal?: AbortSignal },
  ): PromiseApiPagingResults<ArticleReturn<F, T, E>>

  #### Type Parameters

  - F extends "raw-little" | "raw-list" | "raw-view" = LITTLE
  - T extends string | number | symbol = never
  - E extends ArticleFormatsExtension = []

  #### Parameters

  - payload: ArticleListConfig
  - `Optional` options: { format?: F; formatExtension?: E; signal?: AbortSignal }

  #### Returns PromiseApiPagingResults<ArticleReturn<F, T, E>>

  - Defined in jamespot-user-api/src/apis/article/article.ts:51

### update

- update<
  P extends { uri: string },
  F extends "raw-little" | "raw-list" | "raw-view" = LIST,
  T extends string | number | symbol = never,
  E extends ArticleFormatsExtension = [],
  >(
  payload: P,
  options?: { format?: F; formatExtension?: E; signal?: AbortSignal },
  ): PromiseApiWrapper<ArticleReturn<F, T, E>>

  #### Type Parameters

  - P extends { uri: string }
  - F extends "raw-little" | "raw-list" | "raw-view" = LIST
  - T extends string | number | symbol = never
  - E extends ArticleFormatsExtension = []

  #### Parameters

  - payload: P
  - `Optional` options: { format?: F; formatExtension?: E; signal?: AbortSignal }

  #### Returns PromiseApiWrapper<ArticleReturn<F, T, E>>

  - Defined in jamespot-user-api/src/apis/article/article.ts:109

### updateComment

- updateComment<
  F extends "raw-little"
  | "raw-list"
  | "raw-view" = LITTLE,
  T extends string | number | symbol = never,
  E extends CommentFormatsExtension = [],
  >(
  payload: UpdateCommentParams,
  options?: { format?: F; formatExtension?: E; signal?: AbortSignal },
  ): PromiseApiWrapper<CommentReturn<F, T, E>>

  #### Type Parameters

  - F extends "raw-little" | "raw-list" | "raw-view" = LITTLE
  - T extends string | number | symbol = never
  - E extends CommentFormatsExtension = []

  #### Parameters

  - payload: UpdateCommentParams
  - `Optional` options: { format?: F; formatExtension?: E; signal?: AbortSignal }

  #### Returns PromiseApiWrapper<CommentReturn<F, T, E>>

  - Defined in jamespot-user-api/src/apis/article/article.ts:242