0.0.11 • Published 9 months ago

@airlst/sdk v0.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

WIP

Installation

yarn add @airlst/sdk

Usage

Set API key

import { Api } from '@airlst/sdk'

Api.setApiKey('YOUR_API_KEY')

Methods

Currently available methods:

Event methods

Get all company events

Important: This method requires that API key must be company bound!

import { Event } from '@airlst/sdk'

const { data } = await new Event().list()

Get single event with UUID

import { Event } from '@airlst/sdk'

const { data } = await new Event().get('event-uuid')

Guest methods

List all guests

import { Guest } from '@airlst/sdk'

const { data } = await new Guest('event-uuid').list({ page: 2, search: 'John' })

Method accepts following parameters:

ParameterTypeDescription
pagenumberPage number
perPagenumberNumber of items per page
searchstringQuick search
filtersarrayFilters arrays
filters.*.fieldstringFilter field e.g: extended_fields->field1, booking:extended_fields->field1
filters.*.valuestringFilter field value
filters.*.operatorstringFilter field operator. Optional. One of: eq (equal), neq (not equal), like, gt (greater than), gte (greater than or equal), lt (less than), lte (less than or equal). If operator is not provided eq will be used as default
sortsarraySorts array
sorts.*.fieldstringSort field
sorts.*.directionstringSort field direction. One of: asc (ascending), desc (descending)
sorts.*.ordernumberSort field order. Optional. Defines order/priority of the sort when sorting by multiple fields

Validate guest code

import { Guest } from '@airlst/sdk'

const { data } = await new Guest('event-uuid').validatedCode('guest-code')

Get guest with code

import { Guest } from '@airlst/sdk'

const { data } = await new Guest('event-uuid').get('guest-code')

Create a new guest

import { Guest } from '@airlst/sdk'

const { data } = await new Guest('event-uuid').create({
  status: 'confirmed',
  contact: {
    first_name: 'John',
    last_name: 'Doe',
  }
})

Create a new companion guest

import { Guest } from '@airlst/sdk'

const { data } = await new Guest('event-uuid').createCompanion('guest-code', {
  contact: {
    first_name: 'John',
    last_name: 'Doe',
  }
})

Update existing guest

import { Guest } from '@airlst/sdk'

const { data } = await new Guest('event-uuid').update('guest-code', { status: 'confirmed' })

Archive guest

import { Guest } from '@airlst/sdk'

await new Guest('event-uuid').archive('guest-code')

Restore an archived guest

import { Guest } from '@airlst/sdk'

const { data } = await new Guest('event-uuid').restore('guest-code')

Delete guest

import { Guest } from '@airlst/sdk'

await new Guest('event-uuid').delete('guest-code')

Check in a guest

import { Guest } from '@airlst/sdk'

const { data } = await new Guest('event-uuid').checkin('guest-code', {
  type: Guest.CheckinType.CHECK_IN,
  device: 'Mobile',
  location: 'Munich',
  timestamp: Date.now(),
})

Create recommendation

import { Guest } from '@airlst/sdk'

const { data } = await new Guest('event-uuid').createRecommendation('guest-code', {
    status: 'confirmed',
    contact: {
      first_name: 'John',
      last_name: 'Doe',
    }
  })

Email Template methods

Retrieve all email templates for the event

import { EmailTemplate } from '@airlst/sdk'

const { data } = await new EmailTemplate('event-uuid').list()

Send email template to selected guests

import { EmailTemplate } from '@airlst/sdk'

await new EmailTemplate('event-uuid').send('email-template-uuid',{
  guests:[
    "guest-code-1",
    "guest-code-2"
    ]
})
0.0.11

9 months ago

0.0.9

9 months ago

0.0.8

9 months ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.3

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago