boulevard / book-sdk Goto Github PK
View Code? Open in Web Editor NEWThe Boulevard booking SDK
License: MIT License
The Boulevard booking SDK
License: MIT License
When attempting to run the following code with typescript using Node version 12.14.0
import { Blvd } from "@boulevard/blvd-book-sdk";
(async()=>{
const API_KEY='...'
const BUSINESS_ID = '09cf52dc-a001-4b9f-9f4a-198ddf23dcad'
const client = new Blvd(API_KEY, BUSINESS_ID);
const business = await client.businesses.get();
const locations = await business.getLocations();
console.log(locations)
})();
I get the following error:
import { GraphQLClient, gql as gql$1 } from 'graphql-request';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Module._compile (internal/modules/cjs/loader.js:895:18)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Module.require (internal/modules/cjs/loader.js:852:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/Users/alejandro/Documents/upk/upk-api/scripts/adhoc/run.ts:1:1)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Module.m._compile (/Users/alejandro/Documents/upk/upk-api/node_modules/ts-node/src/index.ts:392:23)
at Module._extensions..js (internal/modules/cjs/loader.js:995:10)
I have also tried the import statement: const Blvd = require("@boulevard/blvd-book-sdk")
and obtained the same error.
My package JSON is the following:
{
"scripts": {
"start": "ts-node app.ts",
...,
"dependencies": {
"@boulevard/blvd-book-sdk": "^1.0.37"
},
"devDependencies": {
"ts-node": "3.3.0"
}
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.