{"_id":"@aitmed/sdk-revamp","_rev":"11-67fd5bafba2ffb44980809394bc6d73c","name":"@aitmed/sdk-revamp","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.1":{"name":"@aitmed/sdk-revamp","version":"1.0.1","description":"AiTmed SDK - REVAMPED","main":"dist/index.cjs.js","module":"dist/index.es.js","jsnext:main":"dist/index.es.js","browser":"dist/index.umd.js","scripts":{"build":"rollup -c","dev":"npx nodemon --inspect dist/index.cjs.js","start":"rollup -c -w","test":"set TS_NODE_COMPILER_OPTIONS={\"module\":\"commonjs\"} && mocha -r ts-node/register src/**/*.test.ts --watch --watch-extensions ts","test:ci":"TS_NODE_COMPILER_OPTIONS={\"module\":\"commonjs\"} && mocha -r ts-node/register src/**/*.test.ts"},"author":"","license":"ISC","dependencies":{"@aitmed/cloudobjectstorage":"^1.0.9","@types/google-protobuf":"^3.7.2","dotenv":"^8.1.0","google-protobuf":"^3.10.0"},"devDependencies":{"@types/chai":"^4.2.3","@types/chai-as-promised":"^7.1.2","@types/mocha":"^5.2.7","@types/nock":"^11.1.0","@types/node":"^12.7.9","chai":"^4.2.0","chai-as-promised":"^7.1.1","mocha":"^6.2.1","nock":"^11.3.5","prettier":"^1.18.2","prettier-eslint":"^9.0.0","rollup":"^1.23.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-typescript2":"^0.24.3","ts-node":"^8.4.1","typescript":"^3.6.3"},"repository":{"type":"git","url":"git@gitlab.aitmed.io:pfftdammitchris/aitmed-sdk-revamp.git"},"gitHead":"2e9718b58cc7330cd0b5e61390adb3035099ee48","_id":"@aitmed/sdk-revamp@1.0.1","_nodeVersion":"10.9.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-2Oy8nKJoUxielX4uR0P0QZ/VL19blimEZC3CK5UNRRg0Xljv4bJ5lfu6OdRmDX6dvxS8qJy9BAhhEFGdFwnv5Q==","shasum":"49d1b3de1394f546727f14c43d58f731a2f9e09d","tarball":"https://registry.npmjs.org/@aitmed/sdk-revamp/-/sdk-revamp-1.0.1.tgz","fileCount":13,"unpackedSize":465738,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlpiQCRA9TVsSAnZWagAAo+YP/jn15nETl8J5Gx5kDIjX\nceABABa58sRHdT6Q6IAFJN/t4UkMvYkp9xIjV7MMcCHS8zfxRb3l2bm4i4hH\nVVCU33mZvpUcCWx0sM4m2fqJVDLwUB20SUNgY97htVc88HiXv7lqoW9zs1WO\nQIYnTagqb5N4EQzOI8hTaDG/Dy5ahlnBUlGfK63AVrQF9ZB6GZCgBwxUtZpy\nvtsFCcpmES+2zuYnNFz0w6qV3I46QXzI9DB2YdoYu4wFcEJXrjGQmpy1NI1b\nmSP3/ht6SMKZnddNS092EiQ8+cBa3XlBTzKY0HezYJ9iFs0k326HxtIjmKSD\nRkyt903+DMW40o/GUs8+35D9v7ieMcfsV8Izi+PNL4ZoVBK2KgVbIEv68Tt5\nmFeMzHY/yF54Gmazuf+af+rnHkMKVxx/8jZEh4zmzT88gaISNRrS1EzN6xIJ\njXiRu8/gVBet3nWD5rLjPCP7HfOfWFB6z6LKN6oa6ho1dDIVA4ODP0WHUolb\n7PLRGezKxlYU2bDjXX4kJSedgod3QKHGaSVjOpg92/BQHUterNeIsM/w8kNs\nxbUbHOAOkZUmOcWOw9SKJoxKvVQ5aPlv5VaUQBgeujJ5JHR9kv3xrv9TR9Tq\nQsxO5511vwPTbSl8If7zOLEnCmgSCLvJaXdcn27r6rhapN495kN6+NDx8M6e\nVZrh\r\n=Klhz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICKP5JRL3Vli5g0zO9ERyWQQyD0Fue00oEH7IaQB6OftAiB0G8JGi5xmnHkL4vOwHLrLn8umDCQlhd9e+1l9h47OYg=="}]},"maintainers":[{"name":"fullstackray","email":"fullstackray@gmail.com"},{"name":"junrup","email":"pujunru@gmail.com"},{"name":"yueminn","email":"yueminn@aitmed.com"},{"name":"pfftdammitchris","email":"pfftdammitchris@gmail.com"},{"name":"pfftdammitchris2","email":"christopher@aitmed.com"}],"_npmUser":{"name":"pfftdammitchris","email":"pfftdammitchris@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk-revamp_1.0.1_1570150543896_0.030183045662050212"},"_hasShrinkwrap":false}},"time":{"created":"2019-10-04T00:55:43.705Z","1.0.1":"2019-10-04T00:55:44.042Z","modified":"2023-02-18T08:54:37.790Z"},"maintainers":[{"email":"q441321034@gmail.com","name":"atslotus"},{"email":"3286614219@qq.com","name":"dazhoutong"},{"email":"yuyongjian1998@gmail.com","name":"yongjian.yu"},{"email":"chenxu2656@163.com","name":"chenchen.xu"},{"email":"christopher@aitmed.com","name":"pfftdammitchris2"},{"email":"pfftdammitchris@gmail.com","name":"pfftdammitchris"},{"email":"yuhan@aitmed.com","name":"blairgao"}],"description":"AiTmed SDK - REVAMPED","repository":{"type":"git","url":"git@gitlab.aitmed.io:pfftdammitchris/aitmed-sdk-revamp.git"},"license":"ISC","readme":"# AiTmed's TypeScript/JavaScript SDK Boilerplate\r\n\r\n> Note: this boilerplate is not intended for react applications. You need to extend this boilerplate with additional configurations if you want this to bundle out to a react library components.\r\n\r\n## Usage\r\n\r\nPut all `.js` or `.ts` files in `src/` directory and make sure they are exported using `src/index.ts`. There are a couple of ways to export things out to the output bundle depending on how you want devs to use your library.\r\n\r\nFor example, for a directory like this:\r\n\r\n- `src`\r\n  - `createS3Object.ts`\r\n  - `deleteS3Object.ts`\r\n  - `updateS3Object.ts`\r\n  - `makeRequest.ts`\r\n  - `index.ts`\r\n\r\nYour `index.ts` file should look like this:\r\n\r\n### Named exports\r\n\r\n```ts\r\nexport { default as createS3Object } from './createS3Object'\r\nexport { default as deleteS3Object } from './deleteS3Object'\r\nexport { default as updateS3Object } from './updateS3Object'\r\nexport { default as makeRequest } from './makeRequest'\r\n```\r\n\r\nWhen you `npm run build`, it will generate files into the `./dist` directory. This `dist` directory will be imported in JavaScript applications like this:\r\n\r\n```js\r\nimport { createS3Object, makeRequest } from 'js-sdk-boilerplate'\r\n\r\nfunction callSomeApi() {\r\n  const req = makeRequest()\r\n\r\n  return createS3Object(...).then(...).catch(...)\r\n}\r\n```\r\n\r\n### Main export (single, main object)\r\n\r\nIf you want developers to import it and use it like this:\r\n\r\n```js\r\nimport aitmedSdk from 'js-sdk-boilerplate'\r\n\r\nfunction callSomeApi() {\r\n  const req = aitmedSdk.makeRequest()\r\n\r\n  return aitmedSdk.createS3Object(...).then(...).catch(...)\r\n}\r\n```\r\n\r\nThen the `index.ts` file above will not work. You will have to export it differently like this so that it exports a main object:\r\n\r\n> `src/index.ts`\r\n\r\n```ts\r\nimport createS3Object from './createS3Object'\r\nimport deleteS3Object from './deleteS3Object'\r\nimport updateS3Object from './updateS3Object'\r\nimport makeRequest from './makeRequest'\r\n\r\n// This main object will be exported\r\nexport default {\r\n  createS3Object,\r\n  deleteS3Object,\r\n  updateS3Object,\r\n  makeRequest,\r\n}\r\n```\r\n\r\n### Main export variation #2\r\n\r\nYou can also make a main object to be exported out by just directly importing and exporting the target file back out:\r\n\r\n> `src/index.ts`\r\n\r\n```ts\r\nexport { default } from './someMethodOrSomething'\r\n```\r\n\r\n> `src/someMethodOrSomething.ts`\r\n\r\n```ts\r\nfunction someMethod() {\r\n  console.log('hello')\r\n  return null\r\n}\r\n\r\nexport default someMethod\r\n```\r\n\r\nDevs can then use the main object like this in their apps:\r\n\r\n```js\r\nimport someMethodOrWhatever from '@aitmed/js-sdk-boilerplate'\r\n```\r\n\r\n## Publishing to NPM\r\n\r\nWhen you want to publish to NPM, type in `npm publish` and it will publish the library to NPM.\r\n\r\nSince this repo was created using a scope, it should already be [private](https://docs.npmjs.com/creating-and-publishing-private-packages) only to NPM users who are members of the aitmed organization on NPM.\r\n\r\nThe name of this repo is currently `@aitmed/js-sdk-boilerplate` and that will be the name the devs will import from in their applications, which is probably what you don't want. Try changing the `name` property in `package.json` to some name of your choice after the `aitmed` part like this:\r\n\r\n```js\r\n{\r\n  \"name\": \"@aitmed/my-custom-sdk\",\r\n  \"version\": \"1.0.0\",\r\n  ...\r\n}\r\n```\r\n\r\nTo make the package free to the public, instead of typing `npm publish` in the CLI you do this:\r\n\r\n```bash\r\nnpm publish --access public\r\n```\r\n\r\nFor including typescript definition files coming from outside the repo, try putting them in `src/types` and adding that path to `typeRoots` or `types` in the `tsconfig.json` file (not sure if this will work).\r\n\r\n## Extra dependencies included the project that you might want to use:\r\n\r\n| Package                                      | Description                                                |\r\n| -------------------------------------------- | ---------------------------------------------------------- |\r\n| [dotenv](https://github.com/motdotla/dotenv) | Loads environment variables from .env for nodejs projects. |\r\n| [mocha](https://mochajs.org/)                | Test runner.                                               |\r\n| [chai](https://www.chaijs.com/)              | Test matchers.                                             |\r\n\r\n### More info on these dependencies\r\n\r\n- `dotenv`\r\n\r\n  - You can put your secret keys/env variables here. Don't let git commit this file if you want to be 100% safe. (Already done in this boilerplate in `.gitignore`)\r\n  - To enter an environment variable, add a new line in the `.env` file in this format: `MY_ENV_VARIABLE=MY_ENV_VARIABLE_VALUE`\r\n\r\n- `mocha`\r\n\r\n  - Test runner\r\n\r\n- `chai`\r\n  - Test matchers\r\n","readmeFilename":"README.md"}