Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Deals

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Private Readonly store

store: Store

Static Readonly DEFAULT_FIELDS

DEFAULT_FIELDS: string = ...

Methods

add

  • Add a deal. Must include a name and the uid of a pipeline stage.

    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const response = await client.crm.deals.add({
      Name: 'Fancy New Deal',
      DealPipelineStage: {
        Uid: 'qNmdZA90'
      }
    });
    console.log(response);
    
    throws

    Response If the server returns a non-"OK" or non-"400" status, the whole response object will be thrown.

    Parameters

    • deal: DealAdd

      The deal you would like to add.

    • options: { fields?: string } = {}
      • Optional fields?: string

        Not all fields on the model are returned by default - you can request specific fields with a that looks something like ',(field name here).(child field name here or * for all)'. Note: the shape of the returned object may not match the model in this library if this string does not start with '' as shown.

    Returns Promise<Deal | ValidationError<Deal>>

    The response body if response status OK, or response body of validation errors if response status 400.

delete

  • delete(uid: string): Promise<null>
  • Delete a specific deal by its uid.

    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const response = await client.crm.deals.delete(uid);
    console.log(response);
    
    throws

    Response If the server returns a non-"OK" status, the whole response object will be thrown.

    Parameters

    • uid: string

      The uid for the deal to delete.

    Returns Promise<null>

    Null if deletion was successful.

get

  • get(uid: string, options?: { fields?: string }): Promise<Deal>
  • Get a specific deal.

    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const response = await client.crm.deals.get(uid);
    console.log(response);
    
    throws

    Response If the server returns a non-"OK" status, the whole response object will be thrown.

    Parameters

    • uid: string

      The uid for the deal to get.

    • options: { fields?: string } = {}
      • Optional fields?: string

        Not all fields on the model are returned by default - you can request specific fields with a that looks something like ',(field name here).(child field name here or * for all)'. Note: the shape of the returned object may not match the model in this library if this string does not start with '' as shown.

    Returns Promise<Deal>

    The response body if response status OK.

getAll

  • getAll(options?: { DealPipelineStage?: Required<Pick<DealPipelineStage, "Uid">>; fields?: string; limit?: number; offset?: number }): Promise<List<Deal>>
  • Get all deals:

    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const response = await client.crm.deals.getAll();
    console.log(response);
    

    Get all deals in a specific pipeline's stage:

    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const DealPipelineStage = {
      Uid: 'qNmdZA90'
    };
    const response = await client.crm.deals.getAll({ DealPipelineStage });
    console.log(response);
    
    throws

    Response If the server returns a non-"OK" status, the whole response object will be thrown.

    Parameters

    • options: { DealPipelineStage?: Required<Pick<DealPipelineStage, "Uid">>; fields?: string; limit?: number; offset?: number } = {}
      • Optional DealPipelineStage?: Required<Pick<DealPipelineStage, "Uid">>

        Filter by pipeline stage.

      • Optional fields?: string

        Not all fields on the model are returned by default - you can request specific fields with a that looks something like ',(field name here).(child field name here or * for all)'. Note: the shape of the returned object may not match the model in this library if this string does not start with '' as shown.

      • Optional limit?: number

        The number of results returned by the API.

      • Optional offset?: number

        For pagination; returns (limit) results after this value.

    Returns Promise<List<Deal>>

    The response body if response status OK.

update

  • Make changes to a deal. Must include the uid.

    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const response = await client.crm.deals.update({
      Uid: 'Rm8pvym4',
      Name: 'Brand New Deal Name'
    });
    console.log(response);
    
    throws

    Response If the server returns a non-"OK" or non-"400" status, the whole response object will be thrown.

    Parameters

    • deal: DealUpdate

      The deal with its uid and any fields to be changed.

    • options: { fields?: string } = {}
      • Optional fields?: string

        Not all fields on the model are returned by default - you can request specific fields with a that looks something like ',(field name here).(child field name here or * for all)'. Note: the shape of the returned object may not match the model in this library if this string does not start with '' as shown.

    Returns Promise<Deal | ValidationError<Deal>>

    The response body if response status OK, or response body with validation errors if response status 400.

Generated using TypeDoc