{"_id":"@appsync-butler/sst","_rev":"4-457c3fe951a30ef10477b88227477a71","name":"@appsync-butler/sst","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"@appsync-butler/sst","version":"0.1.0","author":{"name":"Ali Cherry"},"license":"MIT","_id":"@appsync-butler/sst@0.1.0","maintainers":[{"name":"alichry","email":"ctcmnpm@alicherry.net"}],"homepage":"https://github.com/alichry/appsync-butler#readme","bugs":{"url":"https://github.com/alichry/appsync-butler/issues"},"dist":{"shasum":"c356ed44dac95c70d07f8baa521baaf331bc51ea","tarball":"https://registry.npmjs.org/@appsync-butler/sst/-/sst-0.1.0.tgz","fileCount":22,"integrity":"sha512-tKx/IbXneAvNW22UfoFaMuIJ24gOfltZYS+cwJ43ngVHYqNgGPQVus0vCiPbESrjNDYVTr1zJDLYKDgq3HMT3A==","signatures":[{"sig":"MEYCIQCIf0DRTQuU854iJWWUq6zpos3R8Sn3Hf7PgnzPo1qeLwIhALSOTi+omHibZ/35GSaJJlOqhthXCN8neReS/xnUB5fx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17148,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJimOtwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoxfw//ffJFG2zKknpanNGm2tE22mSeKxjNcnF657vzcp3AJn8JGqiD\r\nln3+e+RF+ZffZi3UvgkiBwpecL6OUWUzeSQT9PdzBKTR+ekiE+ztyIq5szga\r\n19xcq1fM6f1a/9Vdx3BDnIAGIKC2ZG+M8KMp9lx8bR1RVFUpbIKXE+Hto3xC\r\nWE6lIl0UAM+C8CSb46/tLy3NQbB1DGem0g/KR5gJmY3X1+RWW0Qn7uLc2DPf\r\ndfx+bkL/o1WAOtNEcccIAviDDT6wk5pwGjNmbHSGviPWJnKd0viVhOJ/S28G\r\nlkQHxqzyMwblNr9tm0tqWttp15P6vk0d3rN4sdw6kV99W3tE9Mkl2mX0gJYh\r\na4+v7WStEFaXs168TXIdlZMKYyDR5GaGoYIc5bKbJiNLG8r/McSV6UXQZAf1\r\nPcuAur/5jv/du6cdM7g7W/q2STBbJHxTgMBCamnAztJRsrG0KdMQOHvv7ccc\r\n8H8l8nkCI1yrmYYrL96AJox+9KYrmrP+6gLNuMfBk/78LrLdFRQKtF0lgNH2\r\nMdw9NvbsIqdrWzSGoGZTQgC0B44L+bybFK48km0LRvg8z9FIyW4TqQ0RoKnL\r\nWpzYUnEtFWD9OCMVki9joNdRriYfqFCnWkbM9XKbpA+cGMzMCv4Qhvhb/QgB\r\n2WSQq9OwQqW7Fy/10EGbQFoR3Qkd49LPA0I=\r\n=RyGW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cjs/index.js","type":"module","module":"dist/esm/index.js","exports":{".":{"import":"./dist/esm/index.js","require":"./dist/cjs/index.js"}},"gitHead":"2c9aa0b58dd9be826b841e9065e1c813e6a2d9a2","scripts":{"lint":"eslint . --ext .ts","test":"c8 mocha --loader=ts-node/esm 'test/**/*.{ts,js}'","build":"npm run lint && npm run transpile","transpile":"npm run transpile:esm && npm run transpile:cjs","transpile:cjs":"tsc --project tsconfig.build.cjs.json --outDir ./dist/cjs","transpile:esm":"tsc --project tsconfig.build.json --outDir ./dist/esm","prepublishOnly":"npm run build && npm run test","pretranspile:cjs":"rm -rf ./dist/cjs","pretranspile:esm":"rm -rf ./dist/esm","posttranspile:cjs":"echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json"},"_npmUser":{"name":"alichry","email":"ctcmnpm@alicherry.net"},"repository":{"url":"git+https://github.com/alichry/appsync-butler.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.15.0+x64 (darwin)","description":"Load resolvers into SST AppSync API constructs.","directories":{"lib":"lib","test":"test"},"_nodeVersion":"16.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^7.11.3","chai":"^4.3.4","mocha":"^9.1.3","eslint":"^8.4.1","ts-node":"^10.4.0","typescript":"^4.5.4","@types/chai":"^4.3.0","@types/node":"^16.11.12","aws-cdk-lib":"2.24.0","@types/mocha":"^9.1.1","@types/lodash":"^4.14.178","@appsync-butler/core":"^0.1.0","eslint-plugin-import":"^2.25.3","@typescript-eslint/parser":"^5.7.0","@aws-cdk/aws-appsync-alpha":"2.24.0-alpha.0","@serverless-stack/resources":"1.2.11","@typescript-eslint/eslint-plugin":"^5.7.0"},"peerDependencies":{"aws-cdk-lib":"2.x","@appsync-butler/core":"*","@aws-cdk/aws-appsync-alpha":"*","@serverless-stack/resources":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/sst_0.1.0_1654188912011_0.6249264037810573","host":"s3://npm-registry-packages"}},"0.1.2":{"name":"@appsync-butler/sst","version":"0.1.2","author":{"name":"Ali Cherry"},"license":"MIT","_id":"@appsync-butler/sst@0.1.2","maintainers":[{"name":"alichry","email":"ctcmnpm@alicherry.net"}],"homepage":"https://github.com/alichry/appsync-butler#readme","bugs":{"url":"https://github.com/alichry/appsync-butler/issues"},"dist":{"shasum":"b3f583bfa3149ca9fc38d1335affd832e6a0ece0","tarball":"https://registry.npmjs.org/@appsync-butler/sst/-/sst-0.1.2.tgz","fileCount":22,"integrity":"sha512-TTJP0cBC3iG0WKeXeVAV7enmrM5iJEHXbJ6V2RzIPCo35AZcGQwGSMJrgrSeGGWpQAEN6me/l8zrEUhT8vif9w==","signatures":[{"sig":"MEUCIGsGoB68hZg+M0w24KoUtr6ioZSSvlXmCXStGI6dKxkZAiEAvxT5Pi9/9v7OFHEUIboiS/HSAmBJzPXSu6V/T6rEy0k=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18131},"main":"dist/cjs/index.js","type":"module","types":"./dist/cjs/index.d.ts","module":"dist/esm/index.js","engines":{"node":">=16.0.0 <25.0.0"},"exports":{".":{"import":"./dist/esm/index.js","require":"./dist/cjs/index.js"}},"gitHead":"6b919d77f28a9c8203ab2058ed78b03395a3ed30","scripts":{"lint":"eslint **/*.ts","test":"c8 mocha","build":"npm run transpile","transpile":"npm run transpile:esm && npm run transpile:cjs","transpile:cjs":"tsc --project tsconfig.build.cjs.json --outDir ./dist/cjs","transpile:esm":"tsc --project tsconfig.build.json --outDir ./dist/esm","prepublishOnly":"npm run build && npm run test","pretranspile:cjs":"rm -rf ./dist/cjs","pretranspile:esm":"rm -rf ./dist/esm","posttranspile:cjs":"echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json"},"_npmUser":{"name":"alichry","email":"ctcmnpm@alicherry.net"},"repository":{"url":"git+https://github.com/alichry/appsync-butler.git","type":"git"},"_npmVersion":"10.8.1","description":"Load resolvers into SST AppSync API constructs.","directories":{"lib":"lib","test":"test"},"_nodeVersion":"22.4.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.1.3","chai":"^5.2.0","mocha":"^11.1.0","eslint":"^9.20.1","lodash":"^4.17.21","aws-cdk":"2.50.0","ts-node":"^10.9.2","typescript":"^5.7.3","@types/chai":"^5.0.1","@types/node":"^22.13.4","aws-cdk-lib":"2.50.0","@types/mocha":"^10.0.10","@types/lodash":"^4.17.15","@appsync-butler/core":"0.1.1","eslint-plugin-import":"^2.31.0","@serverless-stack/core":"1.18.4","@serverless-stack/resources":"1.18.4","@typescript-eslint/eslint-plugin":"^8.24.0"},"peerDependencies":{"@appsync-butler/core":"0.1.1","@serverless-stack/resources":">= 1.0.0 <= 1.18.4"},"_npmOperationalInternal":{"tmp":"tmp/sst_0.1.2_1739748462902_0.4069593893000971","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@appsync-butler/sst","description":"Load resolvers into SST AppSync API constructs.","version":"0.1.3","author":{"name":"Ali Cherry"},"homepage":"https://github.com/alichry/appsync-butler#readme","license":"MIT","type":"module","main":"dist/cjs/index.js","module":"dist/esm/index.js","exports":{".":{"import":"./dist/esm/index.js","require":"./dist/cjs/index.js"}},"directories":{"lib":"lib","test":"test"},"publishConfig":{"access":"public"},"engines":{"node":">=16.0.0 <25.0.0"},"scripts":{"lint":"eslint **/*.ts","pretranspile:esm":"rm -rf ./dist/esm","pretranspile:cjs":"rm -rf ./dist/cjs","transpile:esm":"tsc --project tsconfig.build.json --outDir ./dist/esm","transpile:cjs":"tsc --project tsconfig.build.cjs.json --outDir ./dist/cjs","posttranspile:cjs":"echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","transpile":"npm run transpile:esm && npm run transpile:cjs","build":"npm run transpile","test":"c8 mocha","prepublishOnly":"npm run build && npm run test"},"devDependencies":{"@appsync-butler/core":"0.1.2","@serverless-stack/core":"1.18.4","@serverless-stack/resources":"1.18.4","@types/chai":"^5.0.1","@types/lodash":"^4.17.15","@types/mocha":"^10.0.10","@types/node":"^22.13.4","@typescript-eslint/eslint-plugin":"^8.24.0","aws-cdk":"2.50.0","aws-cdk-lib":"2.50.0","c8":"^10.1.3","chai":"^5.2.0","eslint":"^9.20.1","eslint-plugin-import":"^2.31.0","lodash":"^4.17.21","mocha":"^11.1.0","ts-node":"^10.9.2","typescript":"^5.7.3"},"peerDependencies":{"@appsync-butler/core":"0.1.2","@serverless-stack/resources":">= 1.0.0 <= 1.18.4"},"repository":{"type":"git","url":"git+https://github.com/alichry/appsync-butler.git"},"bugs":{"url":"https://github.com/alichry/appsync-butler/issues"},"_id":"@appsync-butler/sst@0.1.3","gitHead":"230d4b5fa4fcb39b0e1358723828a7226325f615","types":"./dist/cjs/index.d.ts","_nodeVersion":"22.4.0","_npmVersion":"10.8.1","dist":{"integrity":"sha512-2guxzCUZQ+/e/3vEThfA+8oFDihD7/ZjNE6tsE7mBGRJIcrom45vEm+0VqVm6XRAASsUkerPhtDe/koWlUcdbA==","shasum":"11461332791a513f0d3eb33f457fa6ed3ddd8d98","tarball":"https://registry.npmjs.org/@appsync-butler/sst/-/sst-0.1.3.tgz","fileCount":22,"unpackedSize":18131,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIH+ZJCq+V2tKBUNGUM0GsuPHt18BZKImRlxJlwAzkWj7AiByq5pTO5jykiliScGSgmSIqUIn8sb4sLHwn5Zrf4klXg=="}]},"_npmUser":{"name":"alichry","email":"ctcmnpm@alicherry.net"},"maintainers":[{"name":"alichry","email":"ctcmnpm@alicherry.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sst_0.1.3_1739748955412_0.36479561694838125"},"_hasShrinkwrap":false}},"time":{"created":"2022-06-02T16:55:11.958Z","modified":"2025-02-16T23:35:55.751Z","0.1.0":"2022-06-02T16:55:12.275Z","0.1.1":"2025-02-16T17:30:52.841Z","0.1.2":"2025-02-16T23:27:43.081Z","0.1.3":"2025-02-16T23:35:55.575Z"},"bugs":{"url":"https://github.com/alichry/appsync-butler/issues"},"author":{"name":"Ali Cherry"},"license":"MIT","homepage":"https://github.com/alichry/appsync-butler#readme","repository":{"type":"git","url":"git+https://github.com/alichry/appsync-butler.git"},"description":"Load resolvers into SST AppSync API constructs.","maintainers":[{"name":"alichry","email":"ctcmnpm@alicherry.net"}],"readme":"# AppSync Butler (SST)\n\n> AppSync Butler is an AppSync (GraphQL) API development framework, compatible with\n> AWS Cloud Development Kit and Serverless Stack Toolkit. Visit the\n> [homepage](https://github.com/alichry/appsync-butler#readme) for more\n> information.\n\nThis package is concerned with loading on-disk resolvers into \nSST AppSync API constructs. This is not necessarily required \nwhen using SST, you can still load on-disk resolvers and functions \nusing [`@appsync-butler/core`](../core/README.md) only:\n\n```ts  title=\"stacks/MyStack.ts\"\nimport { Loader } from '@appsync-butler/core';\nimport { StackContext, AppSyncApi, Table } from '@serverless-stack/resources';\n\nexport function MyStack({ stack }: StackContext) {\n\tconst table = new Table(stack, 'table', {\n\t\tfields: { pk: \"string\" },\n\t\tprimaryIndex: { partitionKey: \"pk\" }\n\t});\n\tconst api = new AppSyncApi(stack, 'api', {\n\t\tschema: 'graphql/index.graphql',\n\t\tdataSources: {\n\t\t\tsstTableDs: { type: \"dynamodb\", table }\n\t\t}\n\t});\n    \n\tconst loader = new Loader(stack, {\n\t\tapi: api.cdk.graphqlApi,\n\t\tdataSources: {\n\t\t\ttableDs: getDataSource(api, 'sstTableDs')!\n\t\t},\n\t\tdefaultUnitResolverDataSource: 'tableDs',\n\t\tdefaultFunctionDataSource: 'tableDs'\n\t});\n\tloader.load();\n}\n\nfunction getDataSource(api: AppSyncApi, key: string) {\n\tconst ds = api.getDataSource(key);\n\tif (! ds) {\n\t\tthrow new Error(\n\t\t\t`Expecting '${key}' datasource key to be set, ` +\n\t\t\t'found otherwise.'\n\t\t)\n\t}\n\treturn ds;\n}\n```\n\nThis package introduces [`SstLoader`](lib/SstLoader.ts) to load resolvers with SST compatibility. This might be useful for specific use cases.\n\n```ts  title=\"stacks/MyStack.ts\"\nimport { StackContext, AppSyncApi, Table } from '@serverless-stack/resources';\nimport { SstLoader } from '@appsync-butler/sst';\nimport { Resolver } from '@aws-cdk/aws-appsync-alpha';\n\nexport function MyStack({ stack }: StackContext) {\n    const table = new Table(stack, 'table', { ... });\n    const api = new AppSyncApi(stack, 'api', {\n        schema: 'graphql/index.graphql',\n        dataSources: {\n            tableDs: { type: \"dynamodb\", table }\n        }\n    });\n\n    const loader = new SstLoader(stack, {\n        api,\n        defaultUnitResolverDataSource: 'tableDs',\n        defaultFunctionDataSource: 'tableDs'\n    });\n    loader.load();\n\n    // Suppose we have the following on-disk resolver:\n    // vtl/resolvers/Query/posts\n\n    const r = api.getResolver('Query posts');\n    r instanceof Resolver // => true\n}\n```\n\n## Documentation\n\nExplore the documentation of AppSync Butler [here](https://alichry.github.io/appsync-butler). \n","readmeFilename":"README.md"}