0.0.6 • Published 7 years ago

whosmysanta v0.0.6

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

whosmysanta

Build Status

Tools to build secret santa apps.

Packages

whosmysanta-core

Core Secret Santa selection logic.

whosmysanta-js

JavaScript SDK for interacting with the core.

import {
  drawSecretSanta,
  setEmailConfig,
  sendEmail,
} from 'whosmysanta';

setEmailConfig({
  provider: 'MAILGUN',
  username: 'glenn',
  password: '****',
});

drawSecretSanta
  .then(selections => {
    selections.map(({giver, recipient}) => {
      sendEmail({
        recipient: giver.email,
        body: `Yo, you need to buy ${recipient.wish || 'a gift'} for ${recipient.name}`,
      }).catch((err) => console.log('errored out!', err));
    });
  });

Future API Ideas

Move all GraphQL logic to the JS library to make the process of creating apps easier.

import {
  setAdapter,
  graphQLSchema,
  graphQLQueries,
  graphQLMutations,
  graphQLCreateGroup,
  createGroup,
  joinGroup,
} from 'whosmysanta-js';

setAdapter('GRAPHQL', SERVER, PORT);

createGroup({
  id: 'my-title',
  title: 'my title',
  description: 'description',
  friends: [
    {
      name: 'Glenn',
      email: 'glenn@example.com',
    },
  ],
});

// => Group {
//   id: 'my-title',
//   title: 'my title',
//   description: 'description',
//   friends: [
//     {
//       id: 'HBEIWJkfjwir38',
//       name: 'Glenn',
//       email: 'glenn@example.com',
//       wish: null,
//     },
//   ],
// }

joinGroup({
  id: 'HBEIWJkfjwir38',
  wish: 'iPhone 9',
});

LICENSE

MIT

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.0

7 years ago