0.0.6 • Published 2 years ago

@patrickeddy/theonesdk v0.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

The One - JS SDK

Getting Started

  1. Get an API access token.
  2. Configure your project
npm install @patrickeddy/theonesdk

Examples

import TheOneClient from "@patrickeddy/theonesdk";

// client
const client = new TheOneClient({
  accessToken: process.env.ACCESS_TOKEN, // set your access token as an environment variable: https://nodejs.dev/en/learn/how-to-read-environment-variables-from-nodejs/
  apiVersion: "v2", // optional - api version
});

// books
await client.books();
await client.book("5cf5805fb53e011a64671582");
await client.bookChapters("5cf5805fb53e011a64671582");

// movies
await client.movies();
await client.movie("5cd95395de30eff6ebccde56");
await client.movieQuotes("5cd95395de30eff6ebccde56");

// characters
await client.characters();
await client.character("5cd99d4bde30eff6ebccfbbe");
await client.characterQuotes("5cd99d4bde30eff6ebccfbbe");

// quotes
await client.quotes();
await client.quote("5cd96e05de30eff6ebcce7e9");

// chapters
await client.chapters();
await client.chapter("6091b6d6d58360f988133b8b");

// pagination
await client.characters({ limit: 100 });
await client.characters({ page: 2 });
await client.characters({ offset: 3 });

// sorting
await client.characters({ sort: { name: "asc" } });
await client.quotes({ sort: { character: "desc" } });

// filtering
await client.characters({ match: { name: "Gandalf" } });
await client.characters({ notMatch: { name: "Gandalf" } });
await client.characters({ include: { race: ["Hobbit", "Human"] } });
await client.characters({ exclude: { race: ["Orc", "Goblin"] } });
await client.characters({ exists: ["name"] });
await client.characters({ notExist: ["name"] });
await client.characters({ regex: { name: "/foot/i" } });
await client.characters({ notRegex: { name: "/foot/i" } });

// comparison
await client.movies({ lt: { budgetInMillions: 100 } });
await client.movies({ gt: { academyAwardWins: 0 } });
await client.movies({ gte: { runtimeInMinutes: 160 } });

Development

  1. Clone repo and install dependencies
git clone git@github.com:patrickeddy/patrickeddy-sdk.git
cd cd patrickeddy-sdk
npm i
  1. Test Driven Development (TDD)
npm run test:watch
  1. Publish updates to NPM
npm run deploy
acornacorn-walkansi-escapesansi-regexansi-stylesanymatchargargparseasynckitbabel-jestbabel-plugin-istanbulbabel-plugin-jest-hoistbabel-preset-current-node-syntaxbabel-preset-jestbalanced-matchbrace-expansionbracesbrowserslistbs-loggerbserbuffer-fromcallsitescamelcasecaniuse-litechalkchar-regexci-infocjs-module-lexercliuicocollect-v8-coveragecolor-convertcolor-namecombined-streamconcat-mapconvert-source-mapcore-jscreate-requirecross-spawndebugdedentdeepmergedelayed-streamdetect-newlinediffdiff-sequenceselectron-to-chromiumemitteryemoji-regexerror-exescaladeescape-string-regexpesprimaexecaexitexpectfast-json-stable-stringifyfb-watchmanfill-rangefind-upform-datafs.realpathfseventsfunction-bindgensyncget-caller-fileget-package-typeget-streamglobglob-to-regexpglobalsgraceful-fshashas-flaghtml-escaperhuman-signalsimport-localimurmurhashinflightinheritsis-arrayishis-core-moduleis-fullwidth-code-pointis-generator-fnis-numberis-streamis-subsetisexeistanbul-lib-coverageistanbul-lib-instrumentistanbul-lib-reportistanbul-lib-source-mapsistanbul-reportsjest-changed-filesjest-circusjest-clijest-configjest-diffjest-docblockjest-eachjest-environment-nodejest-get-typejest-haste-mapjest-leak-detectorjest-matcher-utilsjest-message-utiljest-mockjest-pnp-resolverjest-regex-utiljest-resolvejest-resolve-dependenciesjest-runnerjest-runtimejest-snapshotjest-utiljest-validatejest-watcherjest-workerjs-tokensjs-yamljsescjson-parse-even-better-errorsjson5kleurlevenlines-and-columnslocate-pathlodash.isequallodash.memoizelodash.sortbylru-cachemake-dirmake-errormakeerrormerge-streammicromatchmime-dbmime-typesmimic-fnminimatchmsnatural-comparenode-int64node-releasesnormalize-pathnpm-run-pathonceonetimep-limitp-locatep-tryparse-jsonpath-existspath-is-absolutepath-keypath-parsepath-to-regexppicocolorspicomatchpiratespkg-dirpretty-formatpromptspunycodequerystringreact-isregenerator-runtimerequire-directoryresolveresolve-cwdresolve-fromresolve.exportssemvershebang-commandshebang-regexsignal-exitsisteransislashsource-mapsource-map-supportsprintf-jsstack-utilsstring-lengthstring-widthstrip-ansistrip-bomstrip-final-newlinestrip-json-commentssupports-colorsupports-preserve-symlinks-flagtest-excludetmplto-fast-propertiesto-regex-rangetr46type-detecttype-festtypescriptupdate-browserslist-dbv8-compile-cache-libv8-to-istanbulwalkerwebidl-conversionswhatwg-urlwhichwrap-ansiwrappywrite-file-atomicy18nyallistyargsyargs-parserynyocto-queue
0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago