├── .github ├── actions │ └── build │ │ └── action.yml ├── pull_request_template.md └── workflows │ ├── build.yml │ ├── close.yml │ ├── pull-request-lint.yml │ └── release.yml ├── .gitignore ├── .gitpod.yml ├── .husky └── pre-commit ├── .mergify.yml ├── .prettierignore ├── .prettierrc.json ├── .vscode ├── launch.json └── settings.json ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── apps ├── fl-exp-simple │ ├── .gitignore │ ├── cdk.json │ ├── package.json │ ├── src │ │ ├── api │ │ │ ├── _api.ts │ │ │ └── todos │ │ │ │ ├── [todoId] │ │ │ │ └── delete-todo.ts │ │ │ │ ├── create-todo.ts │ │ │ │ └── list-todos.ts │ │ ├── table.ts │ │ └── useless-machine.ts │ └── tsconfig.json ├── test-app │ ├── .gitignore │ ├── .vscode │ │ └── settings.json │ ├── cdk.context.json │ ├── cdk.json │ ├── codegen.yml │ ├── message-board.gql │ ├── package.json │ ├── schema.gql │ ├── src │ │ ├── api-test.ts │ │ ├── app.ts │ │ ├── func-test.ts │ │ ├── generated-types.ts │ │ ├── message-board.ts │ │ ├── order-processing-queue.ts │ │ ├── people-db.ts │ │ ├── people-events.ts │ │ ├── stream-processing.ts │ │ └── text-processing-queue.ts │ └── tsconfig.json └── website │ ├── .eslintrc.json │ ├── .gitignore │ ├── README.md │ ├── blog │ ├── 2022-04-04-welcome.md │ └── authors.yml │ ├── docs │ ├── advanced-concepts │ │ ├── _category_.yml │ │ ├── how-integrations-work.md │ │ └── reflection.md │ ├── concepts │ │ ├── _category_.yml │ │ ├── appsync │ │ │ ├── _category_.yml │ │ │ ├── code-generation.md │ │ │ ├── index.md │ │ │ ├── supported-integrations.md │ │ │ ├── syntax.md │ │ │ └── usage.md │ │ ├── aws.md │ │ ├── event-bridge │ │ │ ├── _category_.yml │ │ │ ├── event-bus.md │ │ │ ├── event-sources.md │ │ │ ├── index.md │ │ │ ├── integrations.md │ │ │ ├── limitations.md │ │ │ ├── rule.md │ │ │ ├── syntax.md │ │ │ └── transform.md │ │ ├── event-source.md │ │ ├── function │ │ │ ├── _category_.yml │ │ │ ├── event-sources.md │ │ │ ├── index.md │ │ │ └── integrations.md │ │ ├── integration │ │ │ ├── _category_.yml │ │ │ └── index.md │ │ ├── iterable.md │ │ ├── queue.md │ │ ├── secret.md │ │ ├── step-function │ │ │ ├── _category_.yml │ │ │ ├── event-sources.md │ │ │ ├── index.md │ │ │ ├── intrinsic-functions.md │ │ │ ├── syntax.md │ │ │ └── usage.md │ │ ├── table.md │ │ ├── terminology.md │ │ ├── third-party.md │ │ └── user-pool.md │ ├── getting-started │ │ ├── _category_.yml │ │ ├── assets │ │ │ ├── confirm-destroy.png │ │ │ ├── deployment-confirmation.png │ │ │ ├── iam-review.png │ │ │ ├── stack-destroyed.png │ │ │ └── synth-success.png │ │ ├── clean-up.mdx │ │ ├── create-new-project.mdx │ │ ├── deploy-project.mdx │ │ ├── project-walkthrough.md │ │ └── setup.md │ ├── philosophy.md │ └── what-is-functionless.md │ ├── docusaurus.config.js │ ├── package.json │ ├── scripts │ ├── compile-error-code-page.js │ └── copy-typedoc.js │ ├── sidebars.js │ ├── src │ ├── components │ │ ├── docs │ │ │ └── screenshot.tsx │ │ ├── highlighter.tsx │ │ └── home │ │ │ ├── blog.tsx │ │ │ ├── blogs.tsx │ │ │ ├── code.tsx │ │ │ ├── cta.tsx │ │ │ ├── features │ │ │ ├── asides │ │ │ │ ├── develop-naturally.tsx │ │ │ │ ├── organise-operate.tsx │ │ │ │ ├── tabs.tsx │ │ │ │ └── upgrade.tsx │ │ │ ├── compose │ │ │ │ ├── composeCode.tsx │ │ │ │ ├── composeFeature.tsx │ │ │ │ ├── diagram.tsx │ │ │ │ └── timeline.ts │ │ │ ├── featureSection.tsx │ │ │ └── index.tsx │ │ │ ├── featuresCore.tsx │ │ │ ├── hero.tsx │ │ │ ├── social.tsx │ │ │ ├── subscribe.tsx │ │ │ ├── team.tsx │ │ │ ├── testimonial.tsx │ │ │ ├── testimonials.tsx │ │ │ ├── visibilityWindow.tsx │ │ │ └── window.tsx │ ├── content │ │ ├── home │ │ │ ├── blog.ts │ │ │ ├── cta.ts │ │ │ ├── features │ │ │ │ ├── code │ │ │ │ │ ├── code.ts │ │ │ │ │ ├── iam-policy.mdx │ │ │ │ │ ├── output.mdx │ │ │ │ │ └── table-function.mdx │ │ │ │ ├── compose │ │ │ │ │ ├── compose.mdx │ │ │ │ │ └── compose.ts │ │ │ │ ├── index.tsx │ │ │ │ └── snippets │ │ │ │ │ ├── appsync-resolver.mdx │ │ │ │ │ ├── get-user-query.mdx │ │ │ │ │ ├── get-user-resolver.mdx │ │ │ │ │ ├── get-user.mdx │ │ │ │ │ ├── hello.mdx │ │ │ │ │ ├── invoke-hello.mdx │ │ │ │ │ ├── policy.mdx │ │ │ │ │ ├── state-machine.mdx │ │ │ │ │ └── step-function.mdx │ │ │ ├── featuresCore.ts │ │ │ ├── hero.ts │ │ │ ├── nav.ts │ │ │ ├── social.tsx │ │ │ ├── subscribe.ts │ │ │ └── testimonials.ts │ │ └── site.ts │ ├── css.d.ts │ ├── css │ │ └── custom.css │ ├── lib │ │ ├── clamp.ts │ │ ├── feature.ts │ │ ├── observable.ts │ │ ├── useTimeline.ts │ │ └── useVisibility.ts │ ├── pages │ │ ├── index.tsx │ │ └── team.tsx │ ├── plugins │ │ └── docusaurus-plugin-content-blog.js │ └── theme │ │ ├── CodeBlock │ │ └── index.tsx │ │ ├── DocItem │ │ └── TOC │ │ │ └── Desktop │ │ │ └── index.js │ │ ├── DocPage │ │ └── Layout │ │ │ └── Sidebar │ │ │ ├── index.js │ │ │ └── styles.module.css │ │ ├── DocSidebar │ │ └── Desktop │ │ │ └── index.js │ │ ├── DocSidebarItem │ │ └── index.js │ │ ├── Footer │ │ └── index.tsx │ │ ├── MDXContent │ │ └── index.js │ │ ├── Navbar │ │ ├── Content │ │ │ ├── index.tsx │ │ │ └── styles.module.css │ │ ├── Layout │ │ │ ├── index.tsx │ │ │ └── styles.module.css │ │ ├── Logo │ │ │ └── index.tsx │ │ └── MobileSidebar │ │ │ ├── Header │ │ │ └── index.tsx │ │ │ └── PrimaryMenu │ │ │ └── index.tsx │ │ ├── code-theme.js │ │ └── terminal-theme.js │ ├── static │ ├── .nojekyll │ └── img │ │ ├── Arch diagram 1.svg │ │ ├── Discord-Logo-Color.svg │ │ ├── Logo-dark.svg │ │ ├── Logo-fav.svg │ │ ├── Logo-large.svg │ │ ├── Logo.svg │ │ ├── aws │ │ ├── appsync-resolver.svg │ │ ├── aws-bucket.svg │ │ ├── compute-cluster.svg │ │ ├── data-stream.svg │ │ ├── database-cluster.svg │ │ ├── database.svg │ │ ├── event-filter.svg │ │ ├── filter2.svg │ │ ├── func.svg │ │ ├── lambda-function-2.svg │ │ ├── lambda-function.svg │ │ ├── letterbox.svg │ │ ├── queue.svg │ │ ├── role.svg │ │ └── step-function.svg │ │ ├── cloud.png │ │ ├── compose │ │ ├── events.svg │ │ ├── orders.svg │ │ └── process.svg │ │ ├── friendly.png │ │ ├── headshot.png │ │ ├── ide-language-service-preview.png │ │ ├── keys.png │ │ ├── lines.svg │ │ ├── logo-white.png │ │ ├── logo │ │ ├── dark.png │ │ ├── dark.svg │ │ ├── light.png │ │ ├── light.svg │ │ ├── logo_dark.png │ │ ├── logo_dark.svg │ │ ├── logo_dark_icon.png │ │ ├── logo_dark_icon.svg │ │ ├── logo_light.png │ │ └── logo_light.svg │ │ ├── safe.png │ │ ├── shapes │ │ ├── 1.svg │ │ ├── 2.svg │ │ ├── 3.svg │ │ ├── 4.svg │ │ ├── 5.svg │ │ ├── 6.svg │ │ ├── 7.svg │ │ └── bg.png │ │ ├── social │ │ ├── discord.svg │ │ ├── github.svg │ │ ├── linkedin.svg │ │ └── twitter.svg │ │ ├── tweets │ │ ├── loujaybee.jpg │ │ ├── petehanssens.jpg │ │ └── s0enke.jpg │ │ ├── undraw_docusaurus_mountain.svg │ │ ├── undraw_docusaurus_react.svg │ │ └── undraw_docusaurus_tree.svg │ ├── tailwind.config.js │ └── tsconfig.json ├── assets ├── logo-small.svg └── type-safe.gif ├── lerna.json ├── package.json ├── packages ├── @functionless │ ├── asl │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── asl-graph.ts │ │ │ ├── asl-integration.ts │ │ │ ├── asl.ts │ │ │ ├── constants.ts │ │ │ ├── eval-expr-context.ts │ │ │ ├── guards.ts │ │ │ ├── index.ts │ │ │ ├── states.ts │ │ │ ├── step-function-error.ts │ │ │ └── to-state-name.ts │ │ └── tsconfig.json │ ├── ast │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── assert.ts │ │ │ ├── constants.ts │ │ │ ├── declaration.ts │ │ │ ├── ensure.ts │ │ │ ├── error.ts │ │ │ ├── expression.ts │ │ │ ├── find.ts │ │ │ ├── guards.ts │ │ │ ├── index.ts │ │ │ ├── literal.ts │ │ │ ├── node-clone.ts │ │ │ ├── node-ctor.ts │ │ │ ├── node-kind.ts │ │ │ ├── node.ts │ │ │ ├── reflect.ts │ │ │ ├── resolve-references.ts │ │ │ ├── s-expression.ts │ │ │ ├── span.ts │ │ │ ├── statement.ts │ │ │ ├── util.ts │ │ │ └── visit.ts │ │ ├── test │ │ │ ├── node-kind.test.ts │ │ │ ├── node.test.ts │ │ │ ├── reflect.test.ts │ │ │ └── s-expression.test.ts │ │ ├── tsconfig-dev.json │ │ └── tsconfig.json │ ├── aws-apigateway-constructs │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── api-vtl.ts │ │ │ ├── api.ts │ │ │ └── index.ts │ │ └── tsconfig.json │ ├── aws-apigateway │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── api-integration.ts │ │ │ ├── api-vtl.ts │ │ │ ├── index.ts │ │ │ ├── method.ts │ │ │ └── rest-api.ts │ │ └── tsconfig.json │ ├── aws-appsync-constructs │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── appsync-resolver.ts │ │ │ └── index.ts │ │ └── tsconfig.json │ ├── aws-appsync │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── appsync-integration.ts │ │ │ └── index.ts │ │ └── tsconfig.json │ ├── aws-cognito-constructs │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── index.ts │ │ │ └── user-pool.ts │ │ ├── test │ │ │ └── user-pool.test.ts │ │ └── tsconfig.json │ ├── aws-dynamodb-constructs │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── appsync.ts │ │ │ ├── batch-get-item.ts │ │ │ ├── batch-write-item.ts │ │ │ ├── delete-item.ts │ │ │ ├── get-item.ts │ │ │ ├── index.ts │ │ │ ├── integration.ts │ │ │ ├── put-item.ts │ │ │ ├── query.ts │ │ │ ├── runtime.ts │ │ │ ├── scan.ts │ │ │ ├── table.ts │ │ │ ├── transact-get-item.ts │ │ │ ├── transact-write-item.ts │ │ │ ├── update-item.ts │ │ │ └── util.ts │ │ └── tsconfig.json │ ├── aws-dynamodb │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── appsync.ts │ │ │ ├── attribute-type.ts │ │ │ ├── batch-get-item.ts │ │ │ ├── batch-write-item.ts │ │ │ ├── client.ts │ │ │ ├── delete-item.ts │ │ │ ├── get-item.ts │ │ │ ├── index.ts │ │ │ ├── put-item.ts │ │ │ ├── query.ts │ │ │ ├── return-value.ts │ │ │ ├── runtime.ts │ │ │ ├── scan.ts │ │ │ ├── table.ts │ │ │ ├── transact-get-item.ts │ │ │ ├── transact-write-item.ts │ │ │ ├── update-item.ts │ │ │ └── util.ts │ │ └── tsconfig.json │ ├── aws-events-constructs │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── event-bus.ts │ │ │ ├── event-pattern │ │ │ │ ├── index.ts │ │ │ │ ├── numeric.ts │ │ │ │ ├── pattern.ts │ │ │ │ └── synth.ts │ │ │ ├── index.ts │ │ │ ├── rule.ts │ │ │ ├── target-input.ts │ │ │ ├── transform.ts │ │ │ ├── types.ts │ │ │ └── utils.ts │ │ └── tsconfig.json │ ├── aws-events │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── client.ts │ │ │ ├── event-bus-integration.ts │ │ │ ├── event-bus.ts │ │ │ ├── event.ts │ │ │ └── index.ts │ │ └── tsconfig.json │ ├── aws-lambda-constructs │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── async-synth.ts │ │ │ ├── function.ts │ │ │ └── index.ts │ │ └── tsconfig.json │ ├── aws-lambda │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── client.ts │ │ │ ├── function.ts │ │ │ ├── index.ts │ │ │ ├── native-context.ts │ │ │ ├── native-integration.ts │ │ │ └── native-runtime-environment.ts │ │ └── tsconfig.json │ ├── aws-sdk │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── scripts │ │ │ ├── sdk-gen-aws.ts │ │ │ └── sdk-gen.ts │ │ ├── src │ │ │ ├── asl.ts │ │ │ ├── aws.ts │ │ │ ├── iam.ts │ │ │ ├── index.ts │ │ │ ├── sdk.generated.ts │ │ │ ├── sdk.ts │ │ │ └── types.ts │ │ ├── tsconfig.gen.json │ │ └── tsconfig.json │ ├── aws-secretsmanager-constructs │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── index.ts │ │ │ └── secret.ts │ │ └── tsconfig.json │ ├── aws-secretsmanager │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── client.ts │ │ │ └── index.ts │ │ └── tsconfig.json │ ├── aws-sqs-constructs │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── event-source.ts │ │ │ ├── index.ts │ │ │ ├── iterable.ts │ │ │ └── queue.ts │ │ └── tsconfig.json │ ├── aws-sqs │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── client.ts │ │ │ └── index.ts │ │ └── tsconfig.json │ ├── aws-stepfunctions-constructs │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── index.ts │ │ │ └── step-function.ts │ │ └── tsconfig.json │ ├── aws-stepfunctions │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── client.ts │ │ │ ├── express-step-function.ts │ │ │ ├── index.ts │ │ │ ├── invoker-shim.ts │ │ │ └── step-function.ts │ │ └── tsconfig.json │ ├── aws-util │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── client-factory.ts │ │ │ ├── credentials.ts │ │ │ └── index.ts │ │ └── tsconfig.json │ ├── aws │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── index.ts │ │ │ └── stack.ts │ │ └── tsconfig.json │ ├── cli │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── bin │ │ │ └── cli.js │ │ ├── package.json │ │ ├── src │ │ │ ├── cli.ts │ │ │ ├── command-provider.ts │ │ │ ├── commands │ │ │ │ ├── cdk-synth.ts │ │ │ │ ├── index.ts │ │ │ │ ├── local.ts │ │ │ │ └── resource │ │ │ │ │ ├── api-method.ts │ │ │ │ │ ├── express-step-function.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── lambda-function.ts │ │ │ │ │ ├── open-console.ts │ │ │ │ │ └── step-function.ts │ │ │ ├── esbuild-resource-processor.ts │ │ │ ├── index.ts │ │ │ ├── load-project.ts │ │ │ ├── local-serve-project.ts │ │ │ ├── logical-id.ts │ │ │ ├── process-lambda.ts │ │ │ ├── project.ts │ │ │ ├── resource-plugins │ │ │ │ ├── loader │ │ │ │ │ ├── arn.ts │ │ │ │ │ ├── ast.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── lib.ts │ │ │ │ │ ├── loader.ts │ │ │ │ │ └── visitor.ts │ │ │ │ ├── plugin.ts │ │ │ │ └── plugins │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── step-function │ │ │ │ │ ├── plugin.ts │ │ │ │ │ └── resource-loader.ts │ │ │ │ │ └── table │ │ │ │ │ ├── plugin.ts │ │ │ │ │ └── resource-loader.ts │ │ │ ├── resource.ts │ │ │ ├── synthesize.ts │ │ │ ├── tree │ │ │ │ ├── file.ts │ │ │ │ ├── folder.ts │ │ │ │ └── tree.ts │ │ │ └── util.ts │ │ └── tsconfig.json │ ├── error-code │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── error-code.ts │ │ │ ├── error-codes.ts │ │ │ ├── error-type.ts │ │ │ ├── format-error.ts │ │ │ ├── index.ts │ │ │ └── synth-error.ts │ │ └── tsconfig.json │ ├── jest │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ └── index.ts │ │ └── tsconfig.json │ ├── register │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ └── index.ts │ │ └── tsconfig.json │ ├── serde │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── index.ts │ │ │ └── serializer.ts │ │ └── tsconfig.json │ ├── serialize-closure │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── globals.json │ │ │ ├── globals.ts │ │ │ ├── index.ts │ │ │ ├── serialize.ts │ │ │ └── util.ts │ │ ├── test │ │ │ ├── __snapshots__ │ │ │ │ └── serialize-closure.test.ts.snap │ │ │ └── serialize-closure.test.ts │ │ └── tsconfig.json │ ├── swc-config │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ └── index.ts │ │ └── tsconfig.json │ ├── test │ │ ├── README.md │ │ ├── package.json │ │ ├── schema.gql │ │ ├── src │ │ │ ├── index.ts │ │ │ ├── runtime-util.ts │ │ │ ├── runtime.ts │ │ │ ├── self-destructor.ts │ │ │ └── util.ts │ │ └── tsconfig.json │ ├── util │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── assert.ts │ │ │ ├── environment-variable.ts │ │ │ ├── index.ts │ │ │ └── memoize.ts │ │ └── tsconfig.json │ ├── validate │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── checker.ts │ │ │ ├── compile.ts │ │ │ ├── format-error.ts │ │ │ ├── index.ts │ │ │ ├── tsc.ts │ │ │ └── validate.ts │ │ ├── test │ │ │ ├── __snapshots__ │ │ │ │ └── validate.test.ts.snap │ │ │ ├── error-code.test.ts │ │ │ ├── test-files │ │ │ │ ├── api-gateway.ts │ │ │ │ ├── appsync.ts │ │ │ │ ├── event-bus.ts │ │ │ │ ├── function.ts │ │ │ │ └── step-function.ts │ │ │ └── validate.test.ts │ │ └── tsconfig.json │ └── vtl │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ ├── index.ts │ │ └── vtl.ts │ │ └── tsconfig.json ├── @tests │ ├── aws-apigateway-constructs │ │ ├── package.json │ │ ├── test │ │ │ ├── __snapshots__ │ │ │ │ └── api.test.ts.snap │ │ │ ├── api.localstack.test.ts │ │ │ └── api.test.ts │ │ └── tsconfig.json │ ├── aws-appsync-constructs │ │ ├── package.json │ │ ├── test │ │ │ ├── __snapshots__ │ │ │ │ ├── appsync.test.ts.snap │ │ │ │ └── vtl.test.ts.snap │ │ │ ├── appsync.localstack.test.ts │ │ │ ├── appsync.test.ts │ │ │ ├── schema.gql │ │ │ └── vtl.test.ts │ │ └── tsconfig.json │ ├── aws-dynamodb-constructs │ │ ├── package.json │ │ ├── test │ │ │ ├── __snapshots__ │ │ │ │ └── table.test.ts.snap │ │ │ ├── table.runtime.gql │ │ │ ├── table.runtime.test.ts │ │ │ └── table.test.ts │ │ └── tsconfig.json │ ├── aws-events-constructs │ │ ├── package.json │ │ ├── test │ │ │ ├── eventbus.localstack.test.ts │ │ │ ├── eventbus.test.ts │ │ │ ├── eventpattern.test.ts │ │ │ ├── eventtargets.test.ts │ │ │ └── util.ts │ │ └── tsconfig.json │ ├── aws-lambda-constructs │ │ ├── README.md │ │ ├── package.json │ │ ├── test │ │ │ ├── __snapshots__ │ │ │ │ ├── function.test.ts.snap │ │ │ │ └── serialize.test.ts.snap │ │ │ ├── function.localstack.test.ts │ │ │ ├── function.test.ts │ │ │ └── serialize.test.ts │ │ └── tsconfig.json │ ├── aws-secretsmanager-constructs │ │ ├── package.json │ │ ├── test │ │ │ └── secret.localstack.test.ts │ │ └── tsconfig.json │ ├── aws-sqs-constructs │ │ ├── package.json │ │ ├── test │ │ │ └── queue.localstack.test.ts │ │ └── tsconfig.json │ ├── aws-stepfunctions-constructs │ │ ├── package.json │ │ ├── test │ │ │ ├── __snapshots__ │ │ │ │ ├── step-function.localstack.test.ts.snap │ │ │ │ └── step-function.test.ts.snap │ │ │ ├── step-function.localstack.test.ts │ │ │ └── step-function.test.ts │ │ └── tsconfig.json │ └── cleanup │ │ ├── package.json │ │ ├── test │ │ └── cleanup.runtime.test.ts │ │ └── tsconfig.json ├── create-functionless │ ├── .gitignore │ ├── CHANGELOG.md │ ├── README.md │ ├── bin │ │ ├── test-devx.sh │ │ ├── test-npm.sh │ │ ├── test-yarn.sh │ │ └── test.sh │ ├── package.json │ ├── src │ │ ├── index.ts │ │ ├── plan.ts │ │ └── util.ts │ ├── templates │ │ ├── base │ │ │ ├── .gitignore.template │ │ │ ├── cdk.json │ │ │ ├── manifest.json │ │ │ ├── package.json.template │ │ │ └── tsconfig.json │ │ ├── default │ │ │ ├── manifest.json │ │ │ └── src │ │ │ │ └── app.ts │ │ └── devx-experimental │ │ │ ├── cdk.json │ │ │ ├── manifest.json │ │ │ └── src │ │ │ ├── create-todo.ts │ │ │ ├── delete-todo.ts │ │ │ ├── list-todos.ts │ │ │ └── table.ts │ └── tsconfig.json ├── functionless-build-utils │ ├── bin │ │ └── fls-typedoc.js │ ├── package.json │ ├── src │ │ └── compile-typedoc.ts │ └── tsconfig.json └── functionless │ ├── CHANGELOG.md │ ├── package.json │ └── tsconfig.json ├── scripts ├── doctor-aggregate-packages.mjs ├── doctor-pkg-readmes.mjs ├── doctor-ts-references.mjs ├── localstack └── util.mjs ├── tsconfig-base.json ├── tsconfig.json ├── turbo.json └── yarn.lock /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | Fixes # -------------------------------------------------------------------------------- /.github/workflows/close.yml: -------------------------------------------------------------------------------- 1 | name: close 2 | on: 3 | pull_request: 4 | types: 5 | - closed 6 | jobs: 7 | cleanUp: 8 | runs-on: ubuntu-latest 9 | permissions: 10 | contents: write 11 | id-token: write 12 | env: 13 | CI: "true" 14 | steps: 15 | - name: Configure AWS Credentials 16 | uses: aws-actions/configure-aws-credentials@v1 17 | with: 18 | role-to-assume: arn:aws:iam::593491530938:role/githubActionStack-githubactionroleA106E4DC-14SHKLVA61IN4 19 | aws-region: us-east-1 20 | role-duration-seconds: 3600 21 | if: contains(fromJson('["release", "build", "close"]'), github.workflow) 22 | - uses: marvinpinto/action-inject-ssm-secrets@latest 23 | with: 24 | ssm_parameter: /functionlessTestDeleter/FunctionlessTest-refs/pull/${{ github.event.pull_request.number }}/merge/deleteUrl 25 | env_variable_name: FL_DELETE_URL 26 | - uses: fjogeleit/http-request-action@v1 27 | with: 28 | url: ${{ env.FL_DELETE_URL }} 29 | method: GET 30 | -------------------------------------------------------------------------------- /.github/workflows/pull-request-lint.yml: -------------------------------------------------------------------------------- 1 | name: pull-request-lint 2 | on: 3 | pull_request_target: 4 | types: 5 | - labeled 6 | - opened 7 | - synchronize 8 | - reopened 9 | - ready_for_review 10 | - edited 11 | jobs: 12 | validate: 13 | name: Validate PR title 14 | runs-on: ubuntu-latest 15 | permissions: 16 | pull-requests: write 17 | steps: 18 | - uses: amannn/action-semantic-pull-request@v4.5.0 19 | env: 20 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 21 | with: 22 | types: |- 23 | feat 24 | fix 25 | chore 26 | requireScope: false 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | !/.gitattributes 2 | !/.projen/tasks.json 3 | !/.github/workflows/pull-request-lint.yml 4 | !/package.json 5 | !/LICENSE 6 | !/.npmignore 7 | logs 8 | *.log 9 | npm-debug.log* 10 | yarn-debug.log* 11 | yarn-error.log* 12 | lerna-debug.log* 13 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 14 | pids 15 | *.pid 16 | *.seed 17 | *.pid.lock 18 | lib-cov 19 | coverage 20 | *.lcov 21 | .nyc_output 22 | build/Release 23 | node_modules/ 24 | jspm_packages/ 25 | *.tsbuildinfo 26 | .eslintcache 27 | *.tgz 28 | .yarn-integrity 29 | .cache 30 | .DS_Store 31 | .dccache 32 | .swc 33 | !/.projenrc.js 34 | /test-reports/ 35 | junit.xml 36 | /coverage/ 37 | !/.github/workflows/build.yml 38 | /dist/changelog.md 39 | /dist/version.txt 40 | !/.github/workflows/release.yml 41 | !/.mergify.yml 42 | !/.github/workflows/upgrade-main.yml 43 | !/.github/pull_request_template.md 44 | !/.prettierignore 45 | !/.prettierrc.json 46 | !/test/ 47 | !/tsconfig.json 48 | !/tsconfig.dev.json 49 | !/src/ 50 | packages/*/lib 51 | /dist/ 52 | !/.eslintrc.json 53 | !/.git/hooks/pre-commit 54 | !/.github/workflows/close.yml 55 | .turbo 56 | lib 57 | docs/ 58 | .npmrc 59 | .turbo-cache 60 | -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | tasks: 2 | - name: Install 3 | init: | 4 | yarn install 5 | yarn build 6 | 7 | ports: 8 | - name: LocalStack 9 | description: The default port range used by LocalStack 10 | port: 4510-4559 11 | onOpen: ignore 12 | 13 | vscode: 14 | extensions: 15 | - dbaeumer.vscode-eslint 16 | - streetsidesoftware.code-spell-checker 17 | - esbenp.prettier-vscode 18 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | yarn typecheck 5 | yarn lint-staged -------------------------------------------------------------------------------- /.mergify.yml: -------------------------------------------------------------------------------- 1 | 2 | queue_rules: 3 | - name: default 4 | conditions: 5 | - "#approved-reviews-by>=1" 6 | - -label~=(do-not-merge) 7 | - status-success=build 8 | pull_request_rules: 9 | - name: Automatic merge on approval and successful build 10 | actions: 11 | delete_head_branch: {} 12 | queue: 13 | method: squash 14 | name: default 15 | commit_message_template: |- 16 | {{ title }} (#{{ number }}) 17 | 18 | {{ body }} 19 | conditions: 20 | - "#approved-reviews-by>=1" 21 | - -label~=(do-not-merge) 22 | - status-success=build 23 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | coverage 2 | lib 3 | CHANGELOG.md -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "overrides": [] 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "type": "node", 6 | "name": "vscode-jest-tests.v2", 7 | "request": "launch", 8 | "console": "integratedTerminal", 9 | "internalConsoleOptions": "neverOpen", 10 | "disableOptimisticBPs": true, 11 | "program": "${workspaceFolder}/node_modules/.bin/jest", 12 | "cwd": "${workspaceFolder}", 13 | "runtimeArgs": ["--enable-source-maps"], 14 | "args": [ 15 | "--runInBand", 16 | "--watchAll=false", 17 | "--testNamePattern", 18 | "${jest.testNamePattern}", 19 | "--runTestsByPath", 20 | "${jest.testFile}", 21 | "--coverage=false" 22 | ] 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Functionless is an attempt to compile TypeScript code into AWS "Functionless" definitions (e.g. Step Functions or Event Bridge Pipes). 2 | 3 | It primarily focused on transforming a TypeScript function into an AWS Step Function workflow definition, but Step Functions weren't Turing Complete (lacked JSONAta back then), so ultimately failed. 4 | 5 | 6 | ```ts 7 | import { StepFunction } from "@functionless/aws-stepfunctions"; 8 | 9 | import MyDatabase from "./table"; 10 | 11 | export default StepFunction(async (input: { todoId: string }) => { 12 | await StepFunction.waitSeconds(10); 13 | 14 | await MyDatabase.attributes.delete({ 15 | Key: { 16 | pk: { 17 | S: "todo", 18 | }, 19 | sk: { 20 | S: input.todoId, 21 | }, 22 | }, 23 | }); 24 | }); 25 | ``` 26 | 27 | The lesson learned from this project is to find solutions that don't necessitate static analysis and compiler tools. "Don't fight your language". 28 | -------------------------------------------------------------------------------- /apps/fl-exp-simple/.gitignore: -------------------------------------------------------------------------------- 1 | /.fl 2 | /cdk.out 3 | /lib -------------------------------------------------------------------------------- /apps/fl-exp-simple/cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "fl synth" 3 | } 4 | -------------------------------------------------------------------------------- /apps/fl-exp-simple/src/api/_api.ts: -------------------------------------------------------------------------------- 1 | import { RestApi } from "@functionless/aws-apigateway"; 2 | 3 | export default RestApi(); 4 | -------------------------------------------------------------------------------- /apps/fl-exp-simple/src/api/todos/[todoId]/delete-todo.ts: -------------------------------------------------------------------------------- 1 | // BUG: Uncomment this and this line and `putEvents` call bellow 2 | // to trigger the function serializer error. 3 | // import Events from "../event-bus"; 4 | 5 | import { PathParam } from "@functionless/aws-apigateway"; 6 | import { LambdaFunction } from "@functionless/aws-lambda"; 7 | import { Method } from "@functionless/aws-apigateway"; 8 | import { MyDatabase } from "../../../table"; 9 | 10 | export default Method<{ 11 | todoId: PathParam; 12 | }>( 13 | { 14 | httpMethod: "DELETE", 15 | }, 16 | LambdaFunction(async (request) => { 17 | await MyDatabase.delete({ 18 | Key: { 19 | pk: "todo", 20 | sk: request["todoId"], 21 | }, 22 | }); 23 | 24 | return { 25 | statusCode: 200, 26 | body: "DELETED", 27 | }; 28 | }) 29 | ); 30 | -------------------------------------------------------------------------------- /apps/fl-exp-simple/src/api/todos/create-todo.ts: -------------------------------------------------------------------------------- 1 | import { LambdaFunction } from "@functionless/aws-lambda"; 2 | import { Method } from "@functionless/aws-apigateway"; 3 | import * as uuid from "uuid"; 4 | import MyDatabase from "../../table"; 5 | 6 | export default Method( 7 | { 8 | httpMethod: "POST", 9 | }, 10 | LambdaFunction(async (request) => { 11 | const id = uuid.v4(); 12 | 13 | await MyDatabase.put({ 14 | Item: { 15 | pk: "todo", 16 | sk: id, 17 | id, 18 | type: "todo", 19 | message: request.message, 20 | }, 21 | }); 22 | 23 | return { 24 | statusCode: 200, 25 | body: id, 26 | }; 27 | }) 28 | ); 29 | 30 | export interface CreateTodoRequest { 31 | message: string; 32 | } 33 | -------------------------------------------------------------------------------- /apps/fl-exp-simple/src/api/todos/list-todos.ts: -------------------------------------------------------------------------------- 1 | import { LambdaFunction } from "@functionless/aws-lambda"; 2 | import { Method } from "@functionless/aws-apigateway"; 3 | 4 | import { MyDatabase } from "../../table"; 5 | 6 | export default Method( 7 | { 8 | httpMethod: "GET", 9 | }, 10 | LambdaFunction(async () => { 11 | const result = await MyDatabase.query({ 12 | KeyConditionExpression: "#pk = :pk", 13 | ExpressionAttributeNames: { 14 | "#pk": "pk", 15 | }, 16 | ExpressionAttributeValues: { 17 | ":pk": "todo", 18 | }, 19 | }); 20 | 21 | const response = { 22 | items: (result.Items ?? []).map((item) => { 23 | return { 24 | id: item.id, 25 | message: item.message, 26 | }; 27 | }), 28 | }; 29 | 30 | return { 31 | statusCode: 200, 32 | body: JSON.stringify(response), 33 | }; 34 | }) 35 | ); 36 | -------------------------------------------------------------------------------- /apps/fl-exp-simple/src/table.ts: -------------------------------------------------------------------------------- 1 | import type { AttributeType, BillingMode } from "aws-cdk-lib/aws-dynamodb"; 2 | import { Table } from "@functionless/aws-dynamodb"; 3 | 4 | interface TableItem { 5 | pk: T; 6 | sk: string; 7 | id: string; 8 | type: T; 9 | } 10 | 11 | export interface Todo extends TableItem<"todo"> { 12 | message: string; 13 | } 14 | 15 | export const MyDatabase = Table({ 16 | partitionKey: { 17 | name: "pk", 18 | type: "S" as AttributeType, 19 | }, 20 | sortKey: { 21 | name: "sk", 22 | type: "S" as AttributeType, 23 | }, 24 | billingMode: "PAY_PER_REQUEST" as BillingMode, 25 | }); 26 | 27 | export default MyDatabase; 28 | -------------------------------------------------------------------------------- /apps/fl-exp-simple/src/useless-machine.ts: -------------------------------------------------------------------------------- 1 | import { StepFunction } from "@functionless/aws-stepfunctions"; 2 | 3 | import MyDatabase from "./table"; 4 | 5 | export default StepFunction(async (input: { todoId: string }) => { 6 | await StepFunction.waitSeconds(10); 7 | 8 | await MyDatabase.attributes.delete({ 9 | Key: { 10 | pk: { 11 | S: "todo", 12 | }, 13 | sk: { 14 | S: input.todoId, 15 | }, 16 | }, 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /apps/fl-exp-simple/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src", 6 | "declaration": true, 7 | "inlineSourceMap": true 8 | }, 9 | "include": ["."], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../packages/@functionless/cli" 14 | }, 15 | { 16 | "path": "../../packages/@functionless/register" 17 | }, 18 | { 19 | "path": "../../packages/functionless" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /apps/test-app/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | lib 3 | cdk.out -------------------------------------------------------------------------------- /apps/test-app/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib" 3 | } 4 | -------------------------------------------------------------------------------- /apps/test-app/cdk.context.json: -------------------------------------------------------------------------------- 1 | { 2 | "acknowledged-issue-numbers": [ 3 | 19179 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /apps/test-app/cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "node -r '@functionless/register' ./src/order-processing-queue.ts" 3 | } 4 | -------------------------------------------------------------------------------- /apps/test-app/codegen.yml: -------------------------------------------------------------------------------- 1 | overwrite: true 2 | schema: 3 | # The path to your schema 4 | - "schema.gql" 5 | generates: 6 | src/generated-types.ts: 7 | plugins: 8 | - "typescript" 9 | - "typescript-resolvers" 10 | config: 11 | # Set to true in order to allow the Resolver type to be callable 12 | makeResolverTypeCallable: true 13 | # This will cause the generator to avoid using optionals (?), so all field resolvers must be implemented in order to avoid compilation errors 14 | avoidOptionals: true 15 | # custom type for the resolver makes it easy to reference arguments, source and result from the resolver 16 | customResolverFn: "{ args: TArgs; context: TContext; result: TResult; source: TParent;}" 17 | # appsync allows returnning undefined instead of null only when a type is optional 18 | maybeValue: T | null | undefined 19 | # typename is not really usefull for resolvers and can cause clashes in the case where a type extends another type but have different names 20 | skipTypename: true 21 | -------------------------------------------------------------------------------- /apps/test-app/message-board.gql: -------------------------------------------------------------------------------- 1 | schema { 2 | query: Query 3 | mutation: Mutation 4 | } 5 | 6 | type Post { 7 | postId: ID! 8 | title: String! 9 | comments(nextToken: String, limit: Int): CommentPage 10 | } 11 | 12 | type CommentPage { 13 | nextToken: String 14 | comments: [Comment]! 15 | } 16 | 17 | type Comment { 18 | postId: ID! 19 | commentId: ID! 20 | commentText: String! 21 | createdTime: String! 22 | } 23 | type Query { 24 | getPost(postId: ID!): Post 25 | getDeletionStatus(executionArn: String!): String 26 | } 27 | 28 | type StartExecutionOutput { 29 | executionArn: String! 30 | startDate: Float! 31 | } 32 | 33 | type Mutation { 34 | createPost(title: String): Post! 35 | deletePost(postId: ID!): StartExecutionOutput 36 | addComment(postId: ID!, commentText: String!): Comment! 37 | } 38 | -------------------------------------------------------------------------------- /apps/test-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test-app", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "lint": "tsc --noEmit && functionless", 7 | "test": "cdk synth", 8 | "deploy": "cdk deploy", 9 | "build": "graphql-codegen --config codegen.yml" 10 | }, 11 | "dependencies": { 12 | "@aws-cdk/aws-appsync-alpha": "2.44.0-alpha.0", 13 | "@functionless/language-service": "^0.0.4", 14 | "@functionless/register": "*", 15 | "@graphql-codegen/cli": "^2.6.2", 16 | "@graphql-codegen/typescript-resolvers": "^2.6.1", 17 | "@graphql-codegen/typescript": "^2.4.8", 18 | "@types/node": "^16", 19 | "functionless": "^0.28.0", 20 | "aws-cdk-lib": "2.44.0", 21 | "aws-cdk": "2.44.0", 22 | "constructs": "10.0.0", 23 | "graphql": "^16.3.0", 24 | "typesafe-dynamodb": "^0.2.3", 25 | "typescript": "^4.8.3" 26 | }, 27 | "devDependencies": { 28 | "@swc/cli": "^0.1.57", 29 | "@swc/core": "1.2.245", 30 | "@swc/jest": "^0.2.22", 31 | "@swc/register": "^0.1.10", 32 | "@types/graphql": "^14.5.0" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /apps/test-app/schema.gql: -------------------------------------------------------------------------------- 1 | type Person { 2 | id: String! 3 | name: String! 4 | } 5 | 6 | type ProcessedPerson { 7 | id: String! 8 | name: String! 9 | score: Int! 10 | } 11 | type Query { 12 | getPerson(id: String!): ProcessedPerson 13 | } 14 | input PersonInput { 15 | name: String! 16 | } 17 | type Mutation { 18 | deletePerson(id: ID!): Person 19 | addPerson(input: PersonInput!): Person 20 | addPerson2(input: PersonInput!): Person 21 | updateName(id: ID!, name: String!): Person 22 | } 23 | -------------------------------------------------------------------------------- /apps/test-app/src/stream-processing.ts: -------------------------------------------------------------------------------- 1 | import { App, aws_dynamodb, Stack } from "aws-cdk-lib"; 2 | import { Table } from "@functionless/aws-dynamodb-constructs"; 3 | import { Queue } from "@functionless/aws-sqs-constructs"; 4 | import { JsonSerializer } from "@functionless/serde"; 5 | 6 | const app = new App(); 7 | const stack = new Stack(app, "StreamProcessing"); 8 | 9 | const table = new Table(stack, "Table", { 10 | partitionKey: { 11 | name: "id", 12 | type: aws_dynamodb.AttributeType.STRING, 13 | }, 14 | }); 15 | 16 | interface Message { 17 | id: string; 18 | data: string; 19 | } 20 | 21 | const queue = new Queue(stack, "queue", { 22 | serializer: new JsonSerializer(), 23 | }); 24 | 25 | queue.messages().forEach(async (message) => { 26 | await table.put({ 27 | Item: { 28 | id: message.id, 29 | data: message.data, 30 | }, 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /apps/test-app/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig-base", 3 | "compilerOptions": { 4 | "rootDir": "src", 5 | "outDir": "lib", 6 | "plugins": [ 7 | { 8 | "name": "@functionless/language-service" 9 | } 10 | ] 11 | }, 12 | "include": ["src/**/*.ts"], 13 | "exclude": ["node_modules"], 14 | "references": [ 15 | { 16 | "path": "../../packages/@functionless/register" 17 | }, 18 | { 19 | "path": "../../packages/functionless" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /apps/website/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "settings": { 3 | "import/parsers": { 4 | "@typescript-eslint/parser": [".ts", ".tsx", ".js", ".jsx"] 5 | } 6 | }, 7 | "rules": { 8 | "import/no-unresolved": [ 9 | "error", 10 | { "ignore": ["^@theme", "^@docusaurus", "^@site"] } 11 | ], 12 | "import/no-extraneous-dependencies": ["off"] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /apps/website/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | 22 | !/docs/ 23 | /docs/api 24 | /docs/error-codes.md 25 | -------------------------------------------------------------------------------- /apps/website/README.md: -------------------------------------------------------------------------------- 1 | # Website 2 | 3 | This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. 4 | 5 | ### Installation 6 | 7 | ``` 8 | $ yarn 9 | ``` 10 | 11 | ### Local Development 12 | 13 | ``` 14 | $ yarn start 15 | ``` 16 | 17 | This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. 18 | 19 | ### Build 20 | 21 | ``` 22 | $ yarn build 23 | ``` 24 | 25 | This command generates static content into the `build` directory and can be served using any static contents hosting service. 26 | 27 | ### Deployment 28 | 29 | Using SSH: 30 | 31 | ``` 32 | $ USE_SSH=true yarn deploy 33 | ``` 34 | 35 | Not using SSH: 36 | 37 | ``` 38 | $ GIT_USER= yarn deploy 39 | ``` 40 | 41 | If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. 42 | -------------------------------------------------------------------------------- /apps/website/blog/2022-04-04-welcome.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: welcome 3 | title: Stay Tuned 4 | authors: [sam-goodwin, thantos] 5 | tags: [functionless] 6 | --- 7 | 8 | Stay tuned, we're just getting started! 9 | -------------------------------------------------------------------------------- /apps/website/blog/authors.yml: -------------------------------------------------------------------------------- 1 | sam-goodwin: 2 | name: Sam Goodwin 3 | title: Functionless builder 4 | url: https://github.com/sam-goodwin 5 | image_url: https://github.com/sam-goodwin.png 6 | 7 | thantos: 8 | name: Sam Sussman 9 | title: Functionless builder 10 | url: https://github.com/thantos 11 | image_url: https://github.com/thantos.png 12 | -------------------------------------------------------------------------------- /apps/website/docs/advanced-concepts/_category_.yml: -------------------------------------------------------------------------------- 1 | label: Advanced Concepts 2 | position: 3 3 | -------------------------------------------------------------------------------- /apps/website/docs/advanced-concepts/reflection.md: -------------------------------------------------------------------------------- 1 | --- 2 | position: 8 3 | --- 4 | 5 | # Reflect 6 | 7 | Functionless converts TypeScript function syntax into a [`FunctionDecl`](../api/ast/classes/FunctionDecl.md) AST data object. This object contains a total representation of the syntax contained within the Function and can then be processed within your CDK application. 8 | 9 | To get a `FunctionDecl` for a function, use the `functionless.reflect` utility: 10 | 11 | ```ts 12 | import { reflect } from "@functionless/ast"; 13 | 14 | const functionDecl = reflect((arg: string) => { 15 | return `${arg}_1`; 16 | }); 17 | ``` 18 | 19 | Then, write a recursive function to process the representation: 20 | 21 | ```ts 22 | import { FunctionlessNode, isFunctionDecl } from "@functionless/ast"; 23 | 24 | function processExpr(node: FunctionlessNode) { 25 | // do work 26 | if (isFunctionDecl(node)) { 27 | // blah 28 | } 29 | } 30 | ``` 31 | -------------------------------------------------------------------------------- /apps/website/docs/concepts/_category_.yml: -------------------------------------------------------------------------------- 1 | label: Concepts 2 | position: 2 3 | -------------------------------------------------------------------------------- /apps/website/docs/concepts/appsync/_category_.yml: -------------------------------------------------------------------------------- 1 | position: 4 2 | -------------------------------------------------------------------------------- /apps/website/docs/concepts/aws.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 7 3 | --- 4 | 5 | # AWS SDK 6 | 7 | The `$AWS.SDK` object contains implementations of each AWS API that do not require the instantiation of any client. Use these static API calls to interact with AWS services from within Functionless. These API calls are known by the Functionless framework and are used to automatically configure integrations between services. 8 | 9 | ```ts 10 | import { $AWS, Table } from "@functionless/aws-constructs"; 11 | 12 | const table = Table.fromTable(..); 13 | 14 | new StepFunction(scope, "Func", async (name: string) => { 15 | await $AWS.SDK.DynamoDB.DeleteItem({ 16 | TableName: table.tableName, 17 | Key: { 18 | name: { 19 | S: name 20 | } 21 | } 22 | }, { 23 | iam: { resources: [table.tableArn] }, 24 | }); 25 | }); 26 | ``` 27 | -------------------------------------------------------------------------------- /apps/website/docs/concepts/event-bridge/_category_.yml: -------------------------------------------------------------------------------- 1 | label: Event Bridge 2 | position: 4.5 3 | -------------------------------------------------------------------------------- /apps/website/docs/concepts/event-source.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Event Source 3 | sidebar_position: 5.6 4 | --- 5 | 6 | # Event Source 7 | -------------------------------------------------------------------------------- /apps/website/docs/concepts/function/_category_.yml: -------------------------------------------------------------------------------- 1 | label: Function 2 | position: 2 3 | -------------------------------------------------------------------------------- /apps/website/docs/concepts/integration/_category_.yml: -------------------------------------------------------------------------------- 1 | label: Integration 2 | position: 1 3 | -------------------------------------------------------------------------------- /apps/website/docs/concepts/iterable.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Iterable 3 | sidebar_position: 5.7 4 | --- 5 | 6 | # Iterable 7 | -------------------------------------------------------------------------------- /apps/website/docs/concepts/step-function/_category_.yml: -------------------------------------------------------------------------------- 1 | label: Step Function 2 | position: 3 3 | -------------------------------------------------------------------------------- /apps/website/docs/concepts/third-party.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 7 3 | --- 4 | 5 | # Third Party 6 | 7 | TODO 8 | -------------------------------------------------------------------------------- /apps/website/docs/getting-started/_category_.yml: -------------------------------------------------------------------------------- 1 | label: Getting Started 2 | position: 1 3 | -------------------------------------------------------------------------------- /apps/website/docs/getting-started/assets/confirm-destroy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/apps/website/docs/getting-started/assets/confirm-destroy.png -------------------------------------------------------------------------------- /apps/website/docs/getting-started/assets/deployment-confirmation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/apps/website/docs/getting-started/assets/deployment-confirmation.png -------------------------------------------------------------------------------- /apps/website/docs/getting-started/assets/iam-review.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/apps/website/docs/getting-started/assets/iam-review.png -------------------------------------------------------------------------------- /apps/website/docs/getting-started/assets/stack-destroyed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/apps/website/docs/getting-started/assets/stack-destroyed.png -------------------------------------------------------------------------------- /apps/website/docs/getting-started/assets/synth-success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/apps/website/docs/getting-started/assets/synth-success.png -------------------------------------------------------------------------------- /apps/website/sidebars.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creating a sidebar enables you to: 3 | - create an ordered group of docs 4 | - render a sidebar for each doc of that group 5 | - provide next/previous navigation 6 | 7 | The sidebars can be generated from the filesystem, or explicitly defined here. 8 | 9 | Create as many sidebars as you want. 10 | */ 11 | 12 | // @ts-check 13 | 14 | /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ 15 | const sidebars = { 16 | // By default, Docusaurus generates a sidebar from the docs folder structure 17 | tutorialSidebar: [{ type: "autogenerated", dirName: "." }], 18 | 19 | // But you can create a sidebar manually 20 | /* 21 | tutorialSidebar: [ 22 | { 23 | type: 'category', 24 | label: 'Tutorial', 25 | items: ['hello'], 26 | }, 27 | ], 28 | */ 29 | }; 30 | 31 | module.exports = sidebars; 32 | -------------------------------------------------------------------------------- /apps/website/src/components/docs/screenshot.tsx: -------------------------------------------------------------------------------- 1 | import Zoom from "react-medium-image-zoom"; 2 | import "react-medium-image-zoom/dist/styles.css"; 3 | 4 | export interface ScreenshotProps { 5 | src: string; 6 | } 7 | 8 | export function Screenshot({ src }: ScreenshotProps) { 9 | return ( 10 |
11 | 12 | 13 | 14 |
15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /apps/website/src/components/home/blogs.tsx: -------------------------------------------------------------------------------- 1 | import { BlogPost } from "@docusaurus/plugin-content-blog"; 2 | import { usePluginData } from "@docusaurus/useGlobalData"; 3 | import { subtitle, title } from "@site/src/content/home/blog"; 4 | import { Blog } from "./blog"; 5 | 6 | export const Blogs = () => { 7 | const { blogPosts } = usePluginData("docusaurus-plugin-content-blog") as { 8 | blogPosts: BlogPost[]; 9 | }; 10 | return ( 11 |
12 |
13 | {title} 14 |

{subtitle}

15 |
16 |
17 | {blogPosts.map((post: BlogPost) => ( 18 | 19 | ))} 20 |
21 |
22 | ); 23 | }; 24 | -------------------------------------------------------------------------------- /apps/website/src/components/home/cta.tsx: -------------------------------------------------------------------------------- 1 | import Link from "@docusaurus/Link"; 2 | import { ChevronLeftIcon } from "@heroicons/react/24/outline"; 3 | import { body, docsButton, title } from "@site/src//content/home/cta"; 4 | import { Social } from "./social"; 5 | 6 | export const CTA = () => { 7 | return ( 8 |
9 |
10 |
11 |

{title}

12 |

{body}

13 | 14 | 15 | 18 | 19 |
20 |
21 | 22 |
23 |
24 |
25 | ); 26 | }; 27 | -------------------------------------------------------------------------------- /apps/website/src/components/home/features/asides/tabs.tsx: -------------------------------------------------------------------------------- 1 | import { Tab } from "@headlessui/react"; 2 | import { Fragment, PropsWithChildren, ReactElement } from "react"; 3 | 4 | const ButtonTab = ({ children }: PropsWithChildren<{}>) => ( 5 | 6 | {({ selected }) => ( 7 | 10 | )} 11 | 12 | ); 13 | 14 | export interface Tab { 15 | title: string; 16 | panel: ReactElement; 17 | } 18 | 19 | export const AsideTabs = ({ children: tabs }: { children: Tab[] }) => ( 20 | 21 | 22 | {tabs.map(({ title }) => ( 23 | {title} 24 | ))} 25 | 26 | 27 | {tabs.map(({ title, panel }) => ( 28 | {panel as any} 29 | ))} 30 | 31 | 32 | ); 33 | -------------------------------------------------------------------------------- /apps/website/src/components/home/features/compose/composeCode.tsx: -------------------------------------------------------------------------------- 1 | import Compose from "@site/src/content/home/features/compose/compose.mdx"; 2 | import { TimelineCode } from "../../code"; 3 | import { VisibilityWindow } from "../../visibilityWindow"; 4 | import { composeTimeline } from "./timeline"; 5 | 6 | export const ComposeCode = ({ 7 | onVisibilityChanged, 8 | }: { 9 | onVisibilityChanged: (visible: boolean) => void; 10 | }) => ( 11 | 16 | {(visible) => ( 17 | 24 | 25 | 26 | )} 27 | 28 | ); 29 | -------------------------------------------------------------------------------- /apps/website/src/components/home/features/compose/composeFeature.tsx: -------------------------------------------------------------------------------- 1 | import { compose } from "@site/src/content/home/features/compose/compose"; 2 | import { useState } from "react"; 3 | import { FeatureSection } from "../featureSection"; 4 | import { ComposeCode } from "./composeCode"; 5 | import { Diagram } from "./diagram"; 6 | 7 | export const ComposeFeature = () => { 8 | const [codeVisible, setCodeVisible] = useState(false); 9 | return ( 10 | } 13 | footer={() => } 14 | /> 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /apps/website/src/components/home/features/compose/timeline.ts: -------------------------------------------------------------------------------- 1 | export const composeTimeline = { 2 | events: 500, 3 | orders: 2000, 4 | processOrder: 5000, 5 | } as const; 6 | -------------------------------------------------------------------------------- /apps/website/src/components/home/features/index.tsx: -------------------------------------------------------------------------------- 1 | import { features } from "../../../content/home/features"; 2 | import { FeatureSection } from "./featureSection"; 3 | 4 | export const Features = () => { 5 | return ( 6 |
7 | {features.map((feature) => ( 8 | 9 | ))} 10 |
11 | ); 12 | }; 13 | -------------------------------------------------------------------------------- /apps/website/src/components/home/testimonials.tsx: -------------------------------------------------------------------------------- 1 | import { testimonials, title } from "@site/src/content/home/testimonials"; 2 | import { TestimonialBlock } from "./testimonial"; 3 | 4 | export const Testimonials = () => { 5 | return ( 6 |
7 |
8 | {title} 9 |
10 |
11 | {testimonials.map((testimonial, i) => ( 12 | 13 | ))} 14 |
15 |
16 | ); 17 | }; 18 | -------------------------------------------------------------------------------- /apps/website/src/components/home/window.tsx: -------------------------------------------------------------------------------- 1 | export const Window = ({ children }: React.PropsWithChildren<{}>) => ( 2 |
3 |
{children}
4 |
5 | ); 6 | -------------------------------------------------------------------------------- /apps/website/src/content/home/blog.ts: -------------------------------------------------------------------------------- 1 | export const title = "BLOG"; 2 | export const subtitle = "Read Our Latest Updates"; 3 | -------------------------------------------------------------------------------- /apps/website/src/content/home/cta.ts: -------------------------------------------------------------------------------- 1 | export const title = "Get Started"; 2 | 3 | export const body = 4 | "Functionless is an open source framework. Build your first cloud application today - all you need is an AWS account."; 5 | 6 | export const docsButton = { 7 | to: "/docs/getting-started/setup", 8 | title: "Read Docs", 9 | }; 10 | -------------------------------------------------------------------------------- /apps/website/src/content/home/features/code/code.ts: -------------------------------------------------------------------------------- 1 | import type { Feature } from "@site/src/lib/feature"; 2 | 3 | export const tab1 = "Lambda function"; 4 | export const tab2 = "Step function"; 5 | export const tab3 = "Appsync resolver"; 6 | 7 | export const code: Feature = { 8 | title: "Code", 9 | points: [ 10 | { 11 | title: "Infrastructure from code", 12 | body: "Build functionless architectures using TypeScript syntax instead of cumbersome and error-prone service-specific domain specific languages.", 13 | }, 14 | { 15 | title: "Automated IAM policies", 16 | body: "The best security auditor is no auditor - our compiler derives minimal IAM Policies from your code.", 17 | }, 18 | ], 19 | }; 20 | -------------------------------------------------------------------------------- /apps/website/src/content/home/features/code/iam-policy.mdx: -------------------------------------------------------------------------------- 1 | ```json 2 | // inferred IAM Policy 3 | { 4 | "Effect": "Allow", 5 | "Resource:": "arn:aws:dynamodb:us-east-2:123456789012:table/usersTable", 6 | "Action": ["dynamodb:GetItem"] 7 | } 8 | ``` 9 | -------------------------------------------------------------------------------- /apps/website/src/content/home/features/code/output.mdx: -------------------------------------------------------------------------------- 1 | ```json 2 | // output 3 | { 4 | "Item": { 5 | "id": { 6 | "S": "user-id", 7 | }, 8 | .. 9 | } 10 | } 11 | ``` 12 | -------------------------------------------------------------------------------- /apps/website/src/content/home/features/code/table-function.mdx: -------------------------------------------------------------------------------- 1 | ```ts 2 | const userTable = new Table(this, "userTable"); 3 | 4 | const getUser = new Function(this, "getUser", async (userId: string) => { 5 | return userTable.get({ 6 | Key: { 7 | id: { 8 | S: userId, 9 | }, 10 | }, 11 | }); 12 | }); 13 | ``` 14 | -------------------------------------------------------------------------------- /apps/website/src/content/home/features/compose/compose.mdx: -------------------------------------------------------------------------------- 1 | ```ts 2 | const events = new EventBus(this, "events"); 3 | $$; 4 | const orders = new Queue(this, "orders"); 5 | 6 | events 7 | .when("Order", (event) => event["detail-type"] === "Order") 8 | .map((event) => event.detail) 9 | .pipe(orders); 10 | $$; 11 | import { aws_lambda } from "aws-cdk-lib"; 12 | 13 | declare const golangWorker: aws_lambda.IFunction; 14 | 15 | const processOrderWorker = Function.import(golangWorker); 16 | 17 | const processOrder = new StepFunction(stack, "processOrder", async (order) => { 18 | await processOrderWorker(job); 19 | }); 20 | 21 | orders.messages().forEach((order) => processOrder(order)); 22 | ``` 23 | -------------------------------------------------------------------------------- /apps/website/src/content/home/features/compose/compose.ts: -------------------------------------------------------------------------------- 1 | import { Feature } from "@site/src/lib/feature"; 2 | 3 | export const compose: Feature = { 4 | title: "Compose", 5 | points: [ 6 | { 7 | title: "Realtime Feedback", 8 | body: "Catch bugs before they occur and enjoy Intellisense in your IDE with type-safety that works across service boundaries.", 9 | }, 10 | { 11 | title: "Debug Locally", 12 | body: "Coming Soon!", 13 | }, 14 | ], 15 | }; 16 | -------------------------------------------------------------------------------- /apps/website/src/content/home/features/snippets/appsync-resolver.mdx: -------------------------------------------------------------------------------- 1 | ```ts 2 | import { userTable } from "./user-table"; 3 | 4 | export default AppsyncResolver<{ userId: string }, User>( 5 | { 6 | typeName: "Query", 7 | fieldName: "getUser", 8 | }, 9 | async ($context) => 10 | userTable.appsync.get({ 11 | id: $util.dynamodb.toDynamoDB($context.arguments.userId), 12 | }) 13 | ); 14 | ``` 15 | -------------------------------------------------------------------------------- /apps/website/src/content/home/features/snippets/get-user-query.mdx: -------------------------------------------------------------------------------- 1 | ```graphql 2 | { 3 | getUser(userId: "user-id") { 4 | userId 5 | userName 6 | createTime 7 | } 8 | } 9 | ``` 10 | -------------------------------------------------------------------------------- /apps/website/src/content/home/features/snippets/get-user-resolver.mdx: -------------------------------------------------------------------------------- 1 | ```json 2 | { 3 | "version": "2017-02-28", 4 | "operation": "GetItem", 5 | "key": { 6 | "id": { 7 | "S": "$context.arguments.id" 8 | } 9 | }, 10 | "consistentRead": true 11 | } 12 | ``` 13 | -------------------------------------------------------------------------------- /apps/website/src/content/home/features/snippets/get-user.mdx: -------------------------------------------------------------------------------- 1 | ```ts 2 | import { users } from "./user-table"; 3 | 4 | export default Function(async (name: string) => { 5 | return users.get({ 6 | Key: { 7 | name, 8 | }, 9 | }); 10 | }); 11 | ``` 12 | -------------------------------------------------------------------------------- /apps/website/src/content/home/features/snippets/hello.mdx: -------------------------------------------------------------------------------- 1 | ```ts 2 | import { Function } from "@functionless/aws-lambda-constructs"; 3 | 4 | export default Function(async (name: string) => { 5 | return `hello ${name}`; 6 | }); 7 | ``` 8 | -------------------------------------------------------------------------------- /apps/website/src/content/home/features/snippets/invoke-hello.mdx: -------------------------------------------------------------------------------- 1 | ```sh 2 | > fl ./my-stack/hello.ts invoke '"sam"' 3 | { 4 | Payload: "hello sam" 5 | } 6 | ``` 7 | -------------------------------------------------------------------------------- /apps/website/src/content/home/features/snippets/policy.mdx: -------------------------------------------------------------------------------- 1 | ```json 2 | { 3 | "Effect": "Allow", 4 | "Resource:": "arn:aws:dynamodb:us-east-2:123456789012:table/user-table", 5 | "Action": ["dynamodb:GetItem"] 6 | } 7 | ``` 8 | -------------------------------------------------------------------------------- /apps/website/src/content/home/features/snippets/state-machine.mdx: -------------------------------------------------------------------------------- 1 | ```json 2 | { 3 | "StartsAt": "await queue.sendMesage({ Message: item })", 4 | "States": { 5 | "await queue.sendMesage({ Message: item })": { 6 | "Type": "Task", 7 | "Resource": "arn:..", 8 | "Parameters": { 9 | "QueueUrl": "https://..", 10 | "MessageBody.$": "States.JsonToString($.item)" 11 | } 12 | } 13 | } 14 | } 15 | ``` 16 | -------------------------------------------------------------------------------- /apps/website/src/content/home/features/snippets/step-function.mdx: -------------------------------------------------------------------------------- 1 | ```ts 2 | export default StepFunction(async (item) => { 3 | await queue.sendMessage({ 4 | MessageBody: item, 5 | }); 6 | }); 7 | ``` 8 | -------------------------------------------------------------------------------- /apps/website/src/content/home/hero.ts: -------------------------------------------------------------------------------- 1 | // export const announcement = { 2 | // href: "https://github.com/functionless/functionless/releases", 3 | // }; 4 | 5 | export const title1 = "Code-first,"; 6 | export const title2 = "Cloud-native."; 7 | 8 | export const body = 9 | "Build cloud applications with batteries-included Components and easy-to-follow Conventions. Perform operational tasks with an extensible CLI and UI that understands your application."; 10 | 11 | export const docsLink = { 12 | title: "Read Docs", 13 | to: "/docs/what-is-functionless", 14 | }; 15 | 16 | export const githubLink = "Star us on Github"; 17 | -------------------------------------------------------------------------------- /apps/website/src/content/home/nav.ts: -------------------------------------------------------------------------------- 1 | import { discordUrl, twitterUrl } from "../site"; 2 | 3 | export interface MainItem { 4 | to: string; 5 | title: string; 6 | } 7 | 8 | export interface SocialItem { 9 | href: string; 10 | icon: string; 11 | title: string; 12 | } 13 | 14 | export const main = [ 15 | { 16 | to: "/docs/what-is-functionless", 17 | title: "Docs", 18 | }, 19 | ]; 20 | 21 | export const social = [ 22 | { 23 | title: "Discord", 24 | href: discordUrl, 25 | icon: "/img/social/discord.svg", 26 | }, 27 | { 28 | title: "Twitter", 29 | href: twitterUrl, 30 | icon: "/img/social/twitter.svg", 31 | }, 32 | ]; 33 | -------------------------------------------------------------------------------- /apps/website/src/content/home/social.tsx: -------------------------------------------------------------------------------- 1 | export const title = "Connect with us"; 2 | export const githubButtonTitle = "Star us on Github"; 3 | export const discordButtonTitle = "Join our Discord"; 4 | export const twitterButtonTitle = "Follow us on Twitter"; 5 | -------------------------------------------------------------------------------- /apps/website/src/content/home/subscribe.ts: -------------------------------------------------------------------------------- 1 | export const title = "Subscribe for updates"; 2 | 3 | export const description = 4 | "Get weekly articles in your inbox on tips and tricks to apply Functionless in your engineering pipeline."; 5 | 6 | export const emailPlaceholder = "Enter email address"; 7 | 8 | export const button = "Subscribe"; 9 | 10 | export const errorMessage = "There was an error subscribing"; 11 | 12 | export const successMessage = "Thanks for signing up!"; 13 | -------------------------------------------------------------------------------- /apps/website/src/content/site.ts: -------------------------------------------------------------------------------- 1 | export const githubUrl = "https://github.com/functionless/functionless"; 2 | 3 | export const discordUrl = "https://discord.gg/VRqHbjrbfC"; 4 | 5 | export const twitterUrl = "https://twitter.com/_functionless"; 6 | -------------------------------------------------------------------------------- /apps/website/src/css.d.ts: -------------------------------------------------------------------------------- 1 | declare module "*.css"; 2 | -------------------------------------------------------------------------------- /apps/website/src/lib/clamp.ts: -------------------------------------------------------------------------------- 1 | export const clamp=(n: number, c: number) => Math.min(1, Math.max(-1, (n + c - 1) / c)) -------------------------------------------------------------------------------- /apps/website/src/lib/feature.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export interface Feature { 4 | key?: string 5 | title: string; 6 | points: Array<{ title: string; body: string }>; 7 | side?: "left" | "right" 8 | aside?: ({scrollFactor}: {scrollFactor: number})=>React.ReactElement 9 | footer?: ()=>React.ReactElement 10 | } -------------------------------------------------------------------------------- /apps/website/src/lib/observable.ts: -------------------------------------------------------------------------------- 1 | export class Observable { 2 | private subscribers: Mapvoid> = new Map() 3 | 4 | public subscribe(subscriber: (data: D)=>void): Symbol { 5 | const key = Symbol() 6 | this.subscribers.set(key,subscriber) 7 | return key 8 | } 9 | 10 | public unsubscribe(key: Symbol) { 11 | this.subscribers.delete(key) 12 | } 13 | 14 | public onNext(data: D) { 15 | this.subscribers.forEach((s=>s(data))) 16 | } 17 | } -------------------------------------------------------------------------------- /apps/website/src/lib/useTimeline.ts: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from "react" 2 | 3 | /** 4 | * Timeline is simply mapping from keys to ms at which to trigger 5 | */ 6 | export type Timeline = Record 7 | 8 | /** 9 | * Given a timeline object, return a live state which represents which keys have elapsed 10 | * @param timeline Timeline to map 11 | * @returns List of keys which have elapsed 12 | */ 13 | export function useTimeline(timeline: Timeline): K[] { 14 | const [state, setState] = useState([]) 15 | 16 | useEffect(()=>{ 17 | const ids: NodeJS.Timeout[] = [] 18 | Object.entries(timeline).forEach(([k, v]) => { 19 | ids.push(setTimeout(()=>{ 20 | //The list will be naturally sorted, as the shorter timeouts will trigger first 21 | setState(s => [...s, k as K]) 22 | }, v)) 23 | }) 24 | return ()=>{ 25 | ids.forEach((id) => { 26 | clearTimeout(id) 27 | }) 28 | } 29 | }, [timeline]) 30 | 31 | return state 32 | } -------------------------------------------------------------------------------- /apps/website/src/pages/index.tsx: -------------------------------------------------------------------------------- 1 | import Layout from "@theme/Layout"; 2 | import { CTA } from "../components/home/cta"; 3 | import { Features } from "../components/home/features"; 4 | import { Hero } from "../components/home/hero"; 5 | import { Subscribe } from "../components/home/subscribe"; 6 | import { Testimonials } from "../components/home/testimonials"; 7 | 8 | const Home = () => ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | ); 17 | 18 | export default Home; 19 | -------------------------------------------------------------------------------- /apps/website/src/pages/team.tsx: -------------------------------------------------------------------------------- 1 | import Layout from "@theme/Layout"; 2 | 3 | const Team = () => ( 4 | 5 | Team 6 | 7 | ); 8 | 9 | export default Team; 10 | -------------------------------------------------------------------------------- /apps/website/src/plugins/docusaurus-plugin-content-blog.js: -------------------------------------------------------------------------------- 1 | const { 2 | default: pluginContentBlog, 3 | // eslint-disable-next-line @typescript-eslint/no-require-imports 4 | } = require("@docusaurus/plugin-content-blog"); 5 | const { 6 | validateOptions, 7 | // eslint-disable-next-line @typescript-eslint/no-require-imports 8 | } = require("@docusaurus/plugin-content-blog/lib"); 9 | 10 | async function pluginContentBlogGlobalExported(context, options) { 11 | const blogPluginInstance = await pluginContentBlog(context, options); 12 | 13 | return { 14 | ...blogPluginInstance, 15 | //Name needs to match the original plugins, or mdx loading will fail 16 | name: "docusaurus-plugin-content-blog", 17 | async contentLoaded(...contentLoadedArgs) { 18 | await blogPluginInstance.contentLoaded?.(...contentLoadedArgs); 19 | const { actions, content } = contentLoadedArgs[0]; 20 | const { setGlobalData } = actions; 21 | const { blogPosts } = content; 22 | setGlobalData({ blogPosts }); 23 | }, 24 | }; 25 | } 26 | 27 | exports.default = pluginContentBlogGlobalExported; 28 | exports.validateOptions = validateOptions; 29 | -------------------------------------------------------------------------------- /apps/website/src/theme/CodeBlock/index.tsx: -------------------------------------------------------------------------------- 1 | import CodeBlock from "@theme-original/CodeBlock"; 2 | 3 | export default function CodeBlockWrapper(props: any) { 4 | return ( 5 |
6 | 7 |
8 | ); 9 | } 10 | -------------------------------------------------------------------------------- /apps/website/src/theme/DocItem/TOC/Desktop/index.js: -------------------------------------------------------------------------------- 1 | import Desktop from "@theme-original/DocItem/TOC/Desktop"; 2 | import React from "react"; 3 | 4 | export default function DesktopWrapper(props) { 5 | return ( 6 |
7 | 8 |
9 | ); 10 | } 11 | -------------------------------------------------------------------------------- /apps/website/src/theme/DocPage/Layout/Sidebar/styles.module.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --doc-sidebar-width: 300px; 3 | --doc-sidebar-hidden-width: 30px; 4 | } 5 | 6 | .docSidebarContainer { 7 | display: none; 8 | } 9 | 10 | @media (min-width: 997px) { 11 | .docSidebarContainer { 12 | display: block; 13 | width: var(--doc-sidebar-width); 14 | margin-top: calc(-1 * var(--ifm-navbar-height)); 15 | will-change: width; 16 | transition: width var(--ifm-transition-fast) ease; 17 | clip-path: inset(0); 18 | } 19 | 20 | .docSidebarContainerHidden { 21 | width: var(--doc-sidebar-hidden-width); 22 | cursor: pointer; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /apps/website/src/theme/DocSidebar/Desktop/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Desktop from "@theme-original/DocSidebar/Desktop"; 3 | 4 | export default function DesktopWrapper(props) { 5 | return ( 6 |
7 | 8 |
9 | ); 10 | } 11 | -------------------------------------------------------------------------------- /apps/website/src/theme/DocSidebarItem/index.js: -------------------------------------------------------------------------------- 1 | import DocSidebarItem from "@theme-original/DocSidebarItem"; 2 | import React from "react"; 3 | 4 | export default function DocSidebarItemWrapper(props) { 5 | return ( 6 |
7 | 8 |
9 | ); 10 | } 11 | -------------------------------------------------------------------------------- /apps/website/src/theme/MDXContent/index.js: -------------------------------------------------------------------------------- 1 | import { MDXProvider } from "@mdx-js/react"; 2 | import MDXComponents from "@theme/MDXComponents"; 3 | import React from "react"; 4 | export default function MDXContent({ children }) { 5 | return {children}; 6 | } 7 | -------------------------------------------------------------------------------- /apps/website/src/theme/Navbar/Content/styles.module.css: -------------------------------------------------------------------------------- 1 | /* 2 | Hide color mode toggle in small viewports 3 | */ 4 | @media (max-width: 996px) { 5 | .colorModeToggle { 6 | display: none; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /apps/website/src/theme/Navbar/Layout/styles.module.css: -------------------------------------------------------------------------------- 1 | .navbarHideable { 2 | transition: transform var(--ifm-transition-fast) ease; 3 | } 4 | 5 | .navbarHidden { 6 | transform: translate3d(0, calc(-100% - 2px), 0); 7 | } 8 | -------------------------------------------------------------------------------- /apps/website/src/theme/Navbar/Logo/index.tsx: -------------------------------------------------------------------------------- 1 | import Link from "@docusaurus/Link"; 2 | 3 | export default function NavbarLogo(): JSX.Element { 4 | return ( 5 | 6 | Functionless logo 11 | 12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /apps/website/src/theme/Navbar/MobileSidebar/Header/index.tsx: -------------------------------------------------------------------------------- 1 | // @ts-expect-error - types are not exported for internals 2 | import { useNavbarMobileSidebar } from "@docusaurus/theme-common/internal"; 3 | import IconClose from "@theme/Icon/Close"; 4 | import NavbarLogo from "@theme/Navbar/Logo"; 5 | 6 | function CloseButton() { 7 | const mobileSidebar = useNavbarMobileSidebar(); 8 | return ( 9 | 16 | ); 17 | } 18 | 19 | export default function NavbarMobileSidebarHeader() { 20 | return ( 21 |
22 | 23 | 24 |
25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /apps/website/static/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/apps/website/static/.nojekyll -------------------------------------------------------------------------------- /apps/website/static/img/cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/apps/website/static/img/cloud.png -------------------------------------------------------------------------------- /apps/website/static/img/friendly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/apps/website/static/img/friendly.png -------------------------------------------------------------------------------- /apps/website/static/img/headshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/apps/website/static/img/headshot.png -------------------------------------------------------------------------------- /apps/website/static/img/ide-language-service-preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/apps/website/static/img/ide-language-service-preview.png -------------------------------------------------------------------------------- /apps/website/static/img/keys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/apps/website/static/img/keys.png -------------------------------------------------------------------------------- /apps/website/static/img/logo-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/apps/website/static/img/logo-white.png -------------------------------------------------------------------------------- /apps/website/static/img/logo/dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/apps/website/static/img/logo/dark.png -------------------------------------------------------------------------------- /apps/website/static/img/logo/light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/apps/website/static/img/logo/light.png -------------------------------------------------------------------------------- /apps/website/static/img/logo/logo_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/apps/website/static/img/logo/logo_dark.png -------------------------------------------------------------------------------- /apps/website/static/img/logo/logo_dark_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/apps/website/static/img/logo/logo_dark_icon.png -------------------------------------------------------------------------------- /apps/website/static/img/logo/logo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/apps/website/static/img/logo/logo_light.png -------------------------------------------------------------------------------- /apps/website/static/img/safe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/apps/website/static/img/safe.png -------------------------------------------------------------------------------- /apps/website/static/img/shapes/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/apps/website/static/img/shapes/bg.png -------------------------------------------------------------------------------- /apps/website/static/img/social/linkedin.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /apps/website/static/img/tweets/loujaybee.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/apps/website/static/img/tweets/loujaybee.jpg -------------------------------------------------------------------------------- /apps/website/static/img/tweets/petehanssens.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/apps/website/static/img/tweets/petehanssens.jpg -------------------------------------------------------------------------------- /apps/website/static/img/tweets/s0enke.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/apps/website/static/img/tweets/s0enke.jpg -------------------------------------------------------------------------------- /assets/type-safe.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sam-goodwin/functionless/6f2bd9dac478b6e56283b9a423e525ea13577a02/assets/type-safe.gif -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/lerna/schemas/lerna-schema.json", 3 | "npmClient": "yarn", 4 | "useWorkspaces": true, 5 | "packages": [ 6 | "packages/create-functionless", 7 | "packages/functionless", 8 | "packages/@functionless/*" 9 | ], 10 | "conventionalCommits": true, 11 | "commitHooks": false, 12 | "private": false, 13 | "createRelease": "github", 14 | "verifyAccess": false, 15 | "command": { 16 | "publish": { 17 | "npmClient": "npm", 18 | "allowBranch": ["main", "*"] 19 | } 20 | }, 21 | "version": "0.29.0" 22 | } 23 | -------------------------------------------------------------------------------- /packages/@functionless/asl/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.29.0](https://github.com/functionless/functionless/compare/v0.28.5...v0.29.0) (2022-10-18) 7 | 8 | **Note:** Version bump only for package @functionless/asl 9 | 10 | ## [0.28.4](https://github.com/functionless/functionless/compare/v0.28.3...v0.28.4) (2022-10-17) 11 | 12 | **Note:** Version bump only for package @functionless/asl 13 | 14 | # [0.28.0](https://github.com/functionless/functionless/compare/v0.27.4...v0.28.0) (2022-10-14) 15 | 16 | ### chore 17 | 18 | - refactor aws-constructs into individual packages ([#552](https://github.com/functionless/functionless/issues/552)) ([01a2c9f](https://github.com/functionless/functionless/commit/01a2c9ff714e811f679ab25d9d62722e535eaf6b)) 19 | 20 | ### BREAKING CHANGES 21 | 22 | - @functionless/aws-constructs package has been refactored into many service-specific packages. 23 | -------------------------------------------------------------------------------- /packages/@functionless/asl/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/asl 2 | -------------------------------------------------------------------------------- /packages/@functionless/asl/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/asl", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc", 12 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "dependencies": { 17 | "@functionless/ast": "^0.29.0", 18 | "@functionless/aws-stepfunctions": "^0.29.0", 19 | "@functionless/util": "^0.29.0" 20 | }, 21 | "peerDependencies": { 22 | "@aws-cdk/aws-appsync-alpha": "*", 23 | "aws-cdk-lib": "^2.44.0" 24 | }, 25 | "devDependencies": { 26 | "@aws-cdk/aws-appsync-alpha": "2.44.0-alpha.0", 27 | "aws-cdk-lib": "2.44.0", 28 | "functionless-build-utils": "*", 29 | "typescript": "^4.8.3" 30 | }, 31 | "publishConfig": { 32 | "access": "public" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/@functionless/asl/src/asl-integration.ts: -------------------------------------------------------------------------------- 1 | import { CallExpr } from "@functionless/ast"; 2 | import { ASL } from "./asl"; 3 | import { ASLGraph } from "./asl-graph"; 4 | 5 | export function isASLIntegration(a: any): a is ASLIntegration { 6 | return ( 7 | a && 8 | typeof a === "object" && 9 | typeof a.kind === "string" && 10 | typeof a.asl === "function" 11 | ); 12 | } 13 | 14 | export interface ASLIntegration { 15 | kind: string; 16 | asl: (call: CallExpr, context: ASL) => ASLGraph.NodeResults; 17 | } 18 | 19 | // to prevent the closure serializer from trying to import all of functionless. 20 | export const deploymentOnlyModule = true; 21 | -------------------------------------------------------------------------------- /packages/@functionless/asl/src/constants.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * The name of the functionless context data node used in {@link FUNCTIONLESS_CONTEXT_JSON_PATH}. 3 | */ 4 | export const FUNCTIONLESS_CONTEXT_NAME = "fnl_context"; 5 | /** 6 | * A json path which stores functionless context data like the input and a hard to manufacture null value 7 | * 8 | * This path/variable must start with a letter. 9 | * https://twitter.com/sussmansa/status/1542777348616990720?s=20&t=2PepSKvzPhojs_x01WoQVQ 10 | */ 11 | export const FUNCTIONLESS_CONTEXT_JSON_PATH = `$.${FUNCTIONLESS_CONTEXT_NAME}`; 12 | 13 | // to prevent the closure serializer from trying to import all of functionless. 14 | export const deploymentOnlyModule = true; 15 | -------------------------------------------------------------------------------- /packages/@functionless/asl/src/index.ts: -------------------------------------------------------------------------------- 1 | export { ASLGraph } from "./asl-graph"; 2 | export { ASLIntegration, isASLIntegration } from "./asl-integration"; 3 | export { ASL } from "./asl"; 4 | export * from "./eval-expr-context"; 5 | export * from "./guards"; 6 | export { 7 | Branch, 8 | Catch, 9 | Choice, 10 | CommonFields, 11 | CommonTaskFields, 12 | Condition, 13 | Fail, 14 | MapTask, 15 | ParallelTask, 16 | Parameters, 17 | Pass, 18 | Retry, 19 | State, 20 | StateMachine, 21 | States, 22 | Succeed, 23 | Task, 24 | TerminalState, 25 | Wait, 26 | isChoiceState, 27 | isFailState, 28 | isMapTaskState, 29 | isParallelTaskState, 30 | isPassState, 31 | isState, 32 | isSucceedState, 33 | isTaskState, 34 | isWaitState, 35 | } from "./states"; 36 | export { StepFunctionCause, StepFunctionError } from "./step-function-error"; 37 | -------------------------------------------------------------------------------- /packages/@functionless/asl/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../ast" 17 | }, 18 | { 19 | "path": "../aws-stepfunctions" 20 | }, 21 | { 22 | "path": "../util" 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /packages/@functionless/ast/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/ast 2 | -------------------------------------------------------------------------------- /packages/@functionless/ast/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/ast", 3 | "version": "0.29.0", 4 | "main": "lib/index.js", 5 | "types": "lib/index.d.ts", 6 | "scripts": { 7 | "build:docs": "fls-typedoc", 8 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 9 | "dev": "tsc --watch", 10 | "typecheck": "tsc --noEmit", 11 | "test": "jest" 12 | }, 13 | "dependencies": { 14 | "@functionless/error-code": "^0.29.0" 15 | }, 16 | "devDependencies": { 17 | "@functionless/jest": "^0.29.0", 18 | "@types/jest": "^29.0.3", 19 | "@types/node": "^16", 20 | "functionless-build-utils": "*", 21 | "jest": "^29.0.3", 22 | "ts-jest": "^29.0.2", 23 | "typescript": "^4.8.3" 24 | }, 25 | "files": [ 26 | "lib", 27 | "docs" 28 | ], 29 | "publishConfig": { 30 | "access": "public" 31 | }, 32 | "jest": { 33 | "transform": { 34 | "^.+\\.(t|j)sx?$": [ 35 | "@functionless/jest", 36 | {} 37 | ] 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /packages/@functionless/ast/src/error.ts: -------------------------------------------------------------------------------- 1 | import { BaseNode } from "./node"; 2 | import { NodeKind } from "./node-kind"; 3 | import { Span } from "./span"; 4 | 5 | export class Err extends BaseNode { 6 | readonly nodeKind: "Err" = "Err"; 7 | 8 | constructor( 9 | /** 10 | * Range of text in the source file where this Node resides. 11 | */ 12 | span: Span, 13 | readonly error: Error 14 | ) { 15 | super(NodeKind.Err, span, arguments); 16 | } 17 | } 18 | 19 | // to prevent the closure serializer from trying to import all of functionless. 20 | export const deploymentOnlyModule = true; 21 | -------------------------------------------------------------------------------- /packages/@functionless/ast/src/literal.ts: -------------------------------------------------------------------------------- 1 | export type Literal = 2 | | undefined 3 | | null 4 | | boolean 5 | | number 6 | | string 7 | | Literal[] 8 | | readonly Literal[] 9 | | { 10 | [key: string]: Literal; 11 | }; 12 | -------------------------------------------------------------------------------- /packages/@functionless/ast/src/node-clone.ts: -------------------------------------------------------------------------------- 1 | import { isNode } from "./guards"; 2 | import { BaseNode } from "./node"; 3 | import { getCtor } from "./node-ctor"; 4 | import type { NodeKind } from "./node-kind"; 5 | 6 | declare module "./node" { 7 | interface BaseNode { 8 | /** 9 | * Clones the node and all of its children into a new copy. 10 | */ 11 | clone(): this; 12 | } 13 | } 14 | 15 | // we use module augmentation to inject this method to avoid circular module imports between node <-> node-ctor 16 | BaseNode.prototype.clone = function () { 17 | const ctor = getCtor(this.kind); 18 | return new ctor( 19 | ...Array.from(this._arguments).map(function clone(arg: any): any { 20 | if (isNode(arg)) { 21 | return arg.clone(); 22 | } else if (Array.isArray(arg)) { 23 | return arg.map(clone); 24 | } else { 25 | return arg; 26 | } 27 | }) 28 | ); 29 | }; 30 | -------------------------------------------------------------------------------- /packages/@functionless/ast/src/span.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A {@link Span} is a range of text within a source file, represented 3 | * by two numbers, a `start` and `end` character position. 4 | */ 5 | export type Span = [ 6 | /** 7 | * 1-based line number of the span. 8 | */ 9 | line: number, 10 | /** 11 | * 0-based column of the span. 12 | */ 13 | column: number 14 | ]; 15 | 16 | /** 17 | * Determines if {@link a} is a {@link Span}. 18 | */ 19 | export function isSpan(a: any): a is Span { 20 | return ( 21 | Array.isArray(a) && 22 | a.length === 2 && 23 | typeof a[0] === "number" && 24 | typeof a[1] === "number" 25 | ); 26 | } 27 | 28 | export function emptySpan(): Span { 29 | return [0, 0]; 30 | } 31 | 32 | // to prevent the closure serializer from trying to import all of functionless. 33 | export const deploymentOnlyModule = true; 34 | -------------------------------------------------------------------------------- /packages/@functionless/ast/test/node-kind.test.ts: -------------------------------------------------------------------------------- 1 | import "jest"; 2 | 3 | import { NodeKind } from "../src/node-kind"; 4 | 5 | describe("no duplicate ids", () => { 6 | const seen = new Map(); 7 | Object.entries(NodeKind).forEach(([name, code]) => { 8 | if (typeof code === "number") { 9 | if (!seen.has(code)) { 10 | seen.set(code, [name]); 11 | } else { 12 | seen.get(code)!.push(name); 13 | } 14 | } 15 | }); 16 | 17 | for (const [code, names] of seen) { 18 | test(`NodeKind(${code})`, () => { 19 | if (names.length > 1) { 20 | fail( 21 | `NodeKind(${code}) is used more than once by [${names.join(", ")}]` 22 | ); 23 | } 24 | }); 25 | } 26 | }); 27 | -------------------------------------------------------------------------------- /packages/@functionless/ast/test/s-expression.test.ts: -------------------------------------------------------------------------------- 1 | import "jest"; 2 | import { isNode, parseSExpr, reflect } from "../src"; 3 | 4 | test("s-expression isomorphism", () => { 5 | function foo(...args: any[]) { 6 | return args; 7 | } 8 | const ast = reflect(function bar(a: string, { b: c }: any) { 9 | return foo([a, c]); 10 | }); 11 | 12 | expect(equals(parseSExpr(ast?.toSExpr()!), ast)).toEqual(true); 13 | }); 14 | 15 | function equals(self: any, other: any): boolean { 16 | if (isNode(self) && isNode(other)) { 17 | if (self.kind === other.kind) { 18 | return (self._arguments as any[]).every((thisArg, i) => 19 | equals(thisArg, other._arguments[i]) 20 | ); 21 | } else { 22 | return false; 23 | } 24 | } else if (Array.isArray(self) && Array.isArray(other)) { 25 | return ( 26 | self.length === other.length && self.every((a, i) => equals(a, other[i])) 27 | ); 28 | } else { 29 | return self === other; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packages/@functionless/ast/tsconfig-dev.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "noEmit": true 5 | }, 6 | "include": ["src", "test"], 7 | "exclude": ["lib", "node_modules"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/@functionless/ast/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../error-code" 17 | }, 18 | { 19 | "path": "../jest" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/@functionless/aws-apigateway-constructs/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.29.0](https://github.com/functionless/functionless/compare/v0.28.5...v0.29.0) (2022-10-18) 7 | 8 | **Note:** Version bump only for package @functionless/aws-apigateway-constructs 9 | 10 | ## [0.28.4](https://github.com/functionless/functionless/compare/v0.28.3...v0.28.4) (2022-10-17) 11 | 12 | **Note:** Version bump only for package @functionless/aws-apigateway-constructs 13 | 14 | # [0.28.0](https://github.com/functionless/functionless/compare/v0.27.4...v0.28.0) (2022-10-14) 15 | 16 | ### chore 17 | 18 | - refactor aws-constructs into individual packages ([#552](https://github.com/functionless/functionless/issues/552)) ([01a2c9f](https://github.com/functionless/functionless/commit/01a2c9ff714e811f679ab25d9d62722e535eaf6b)) 19 | 20 | ### BREAKING CHANGES 21 | 22 | - @functionless/aws-constructs package has been refactored into many service-specific packages. 23 | -------------------------------------------------------------------------------- /packages/@functionless/aws-apigateway-constructs/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/aws-apigateway-constructs 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-apigateway-constructs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/aws-apigateway-constructs", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc", 12 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "dependencies": { 17 | "@functionless/ast": "^0.29.0", 18 | "@functionless/aws-apigateway": "^0.29.0", 19 | "@functionless/aws-lambda-constructs": "^0.29.0", 20 | "@functionless/error-code": "^0.29.0", 21 | "@functionless/vtl": "^0.29.0", 22 | "aws-cdk-lib": "2.44.0" 23 | }, 24 | "devDependencies": { 25 | "functionless-build-utils": "*", 26 | "typescript": "^4.8.3" 27 | }, 28 | "publishConfig": { 29 | "access": "public" 30 | }, 31 | "jest": { 32 | "transform": { 33 | "^.+\\.(t|j)sx?$": [ 34 | "@functionless/jest", 35 | {} 36 | ] 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /packages/@functionless/aws-apigateway-constructs/src/index.ts: -------------------------------------------------------------------------------- 1 | export { APIGatewayVTL } from "./api-vtl"; 2 | export { 3 | APIGatewayError, 4 | APIGatewayRequestOverride, 5 | ApiBody, 6 | ApiGatewayContext, 7 | ApiGatewayInput, 8 | ApiGatewayResponseOverride, 9 | ApiMethod, 10 | ApiMethodKind, 11 | ApiParameter, 12 | ApiParameters, 13 | ApiRequest, 14 | AwsMethod, 15 | HttpMethod, 16 | LambdaMethod, 17 | LambdaMethodProps, 18 | MethodProps, 19 | MockMethod, 20 | isApiMethodKind, 21 | } from "./api"; 22 | -------------------------------------------------------------------------------- /packages/@functionless/aws-apigateway-constructs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../ast" 17 | }, 18 | { 19 | "path": "../aws-apigateway" 20 | }, 21 | { 22 | "path": "../aws-lambda-constructs" 23 | }, 24 | { 25 | "path": "../error-code" 26 | }, 27 | { 28 | "path": "../vtl" 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /packages/@functionless/aws-apigateway/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/aws-apigateway 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-apigateway/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/aws-apigateway", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc", 12 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "dependencies": { 17 | "@functionless/ast": "^0.29.0", 18 | "@functionless/aws-lambda": "^0.29.0", 19 | "@functionless/aws-stepfunctions": "^0.29.0", 20 | "@functionless/vtl": "^0.29.0", 21 | "aws-cdk-lib": "2.44.0" 22 | }, 23 | "devDependencies": { 24 | "functionless-build-utils": "*", 25 | "typedoc": "^0.23.16", 26 | "typedoc-plugin-markdown": "^3.13.6", 27 | "typescript": "^4.8.3" 28 | }, 29 | "publishConfig": { 30 | "access": "public" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /packages/@functionless/aws-apigateway/src/api-integration.ts: -------------------------------------------------------------------------------- 1 | import type { aws_apigateway, aws_iam } from "aws-cdk-lib"; 2 | import type { CallExpr } from "@functionless/ast"; 3 | import { APIGatewayVTL } from "./api-vtl"; 4 | 5 | export interface ApiGatewayIntegration { 6 | apiGWVtl: ApiGatewayVtlIntegration; 7 | } 8 | 9 | export function isApiGatewayIntegration(a: any): a is ApiGatewayIntegration { 10 | return typeof a?.apiGWVtl?.createIntegration === "function"; 11 | } 12 | 13 | /** 14 | * Hooks used to create API Gateway integrations. 15 | */ 16 | export interface ApiGatewayVtlIntegration { 17 | /** 18 | * Render the Request Payload as a VTL string. 19 | */ 20 | renderRequest: (call: CallExpr, context: APIGatewayVTL) => string; 21 | 22 | /** 23 | * Construct an API GW integration. 24 | */ 25 | createIntegration: ( 26 | options: aws_apigateway.IntegrationOptions & { 27 | credentialsRole: aws_iam.IRole; 28 | } 29 | ) => aws_apigateway.Integration; 30 | } 31 | -------------------------------------------------------------------------------- /packages/@functionless/aws-apigateway/src/api-vtl.ts: -------------------------------------------------------------------------------- 1 | import type { aws_iam } from "aws-cdk-lib"; 2 | import type { Expr } from "@functionless/ast"; 3 | import type { VTL } from "@functionless/vtl"; 4 | 5 | export interface APIGatewayVTL extends VTL { 6 | role: aws_iam.IRole; 7 | /** 8 | * Attempt to return the expression as a valid escaped json string. 9 | * 10 | * ```ts 11 | * { 12 | * x: input 13 | * } 14 | * ``` 15 | * 16 | * => 17 | * 18 | * ```ts 19 | * { "x": $input.json('$') } 20 | * ``` 21 | * 22 | * => 23 | * 24 | * ```ts 25 | * "{ \"x\": $util.escapeJavaScript($input.json('$')) }" 26 | * ``` 27 | */ 28 | stringify(expr: Expr): string; 29 | 30 | /** 31 | * Renders a VTL string that will emit a JSON String representation of the {@link expr} to the VTL output. 32 | * 33 | * @param expr the {@link Expr} to convert to JSON 34 | * @returns a VTL string that emits the {@link expr} as JSON 35 | */ 36 | exprToJson(expr: Expr): string; 37 | } 38 | -------------------------------------------------------------------------------- /packages/@functionless/aws-apigateway/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./api-vtl"; 2 | export * from "./api-integration"; 3 | export * from "./method"; 4 | export * from "./rest-api"; 5 | -------------------------------------------------------------------------------- /packages/@functionless/aws-apigateway/src/rest-api.ts: -------------------------------------------------------------------------------- 1 | import type { aws_apigateway } from "aws-cdk-lib"; 2 | 3 | export const RestApiKind = "fl.RestApi"; 4 | 5 | export interface RestApi extends aws_apigateway.RestApi { 6 | kind: typeof RestApiKind; 7 | props?: aws_apigateway.RestApiProps; 8 | } 9 | 10 | export function isRestApi(a: any): a is RestApi { 11 | return a?.kind === RestApiKind; 12 | } 13 | 14 | export function RestApi(props?: aws_apigateway.RestApiProps): RestApi { 15 | return { 16 | kind: RestApiKind, 17 | props, 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /packages/@functionless/aws-apigateway/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../ast" 17 | }, 18 | { 19 | "path": "../aws-lambda" 20 | }, 21 | { 22 | "path": "../aws-stepfunctions" 23 | }, 24 | { 25 | "path": "../vtl" 26 | } 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /packages/@functionless/aws-appsync-constructs/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.29.0](https://github.com/functionless/functionless/compare/v0.28.5...v0.29.0) (2022-10-18) 7 | 8 | **Note:** Version bump only for package @functionless/aws-appsync-constructs 9 | 10 | ## [0.28.4](https://github.com/functionless/functionless/compare/v0.28.3...v0.28.4) (2022-10-17) 11 | 12 | **Note:** Version bump only for package @functionless/aws-appsync-constructs 13 | 14 | # [0.28.0](https://github.com/functionless/functionless/compare/v0.27.4...v0.28.0) (2022-10-14) 15 | 16 | ### chore 17 | 18 | - refactor aws-constructs into individual packages ([#552](https://github.com/functionless/functionless/issues/552)) ([01a2c9f](https://github.com/functionless/functionless/commit/01a2c9ff714e811f679ab25d9d62722e535eaf6b)) 19 | 20 | ### BREAKING CHANGES 21 | 22 | - @functionless/aws-constructs package has been refactored into many service-specific packages. 23 | -------------------------------------------------------------------------------- /packages/@functionless/aws-appsync-constructs/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/aws-appsync-constructs 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-appsync-constructs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/aws-appsync-constructs", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc", 12 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "dependencies": { 17 | "@functionless/ast": "^0.29.0", 18 | "@functionless/aws-appsync": "^0.29.0", 19 | "@functionless/aws-lambda": "^0.29.0", 20 | "@functionless/aws-util": "^0.29.0", 21 | "@functionless/util": "^0.29.0", 22 | "@functionless/vtl": "^0.29.0" 23 | }, 24 | "devDependencies": { 25 | "functionless-build-utils": "*", 26 | "typescript": "^4.8.3" 27 | }, 28 | "publishConfig": { 29 | "access": "public" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packages/@functionless/aws-appsync-constructs/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./appsync-resolver"; 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-appsync-constructs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../ast" 17 | }, 18 | { 19 | "path": "../aws-appsync" 20 | }, 21 | { 22 | "path": "../aws-lambda" 23 | }, 24 | { 25 | "path": "../aws-util" 26 | }, 27 | { 28 | "path": "../util" 29 | }, 30 | { 31 | "path": "../vtl" 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /packages/@functionless/aws-appsync/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.29.0](https://github.com/functionless/functionless/compare/v0.28.5...v0.29.0) (2022-10-18) 7 | 8 | **Note:** Version bump only for package @functionless/aws-appsync 9 | 10 | # [0.28.0](https://github.com/functionless/functionless/compare/v0.27.4...v0.28.0) (2022-10-14) 11 | 12 | ### chore 13 | 14 | - refactor aws-constructs into individual packages ([#552](https://github.com/functionless/functionless/issues/552)) ([01a2c9f](https://github.com/functionless/functionless/commit/01a2c9ff714e811f679ab25d9d62722e535eaf6b)) 15 | 16 | ### BREAKING CHANGES 17 | 18 | - @functionless/aws-constructs package has been refactored into many service-specific packages. 19 | -------------------------------------------------------------------------------- /packages/@functionless/aws-appsync/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/aws-appsync 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-appsync/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/aws-appsync", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc", 12 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "dependencies": { 17 | "@functionless/vtl": "^0.29.0" 18 | }, 19 | "peerDependencies": { 20 | "@aws-cdk/aws-appsync-alpha": "*" 21 | }, 22 | "devDependencies": { 23 | "@aws-cdk/aws-appsync-alpha": "2.44.0-alpha.0", 24 | "functionless-build-utils": "*", 25 | "typescript": "^4.8.3" 26 | }, 27 | "publishConfig": { 28 | "access": "public" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /packages/@functionless/aws-appsync/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./appsync-integration"; 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-appsync/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../vtl" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /packages/@functionless/aws-cognito-constructs/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.29.0](https://github.com/functionless/functionless/compare/v0.28.5...v0.29.0) (2022-10-18) 7 | 8 | **Note:** Version bump only for package @functionless/aws-cognito-constructs 9 | 10 | ## [0.28.4](https://github.com/functionless/functionless/compare/v0.28.3...v0.28.4) (2022-10-17) 11 | 12 | **Note:** Version bump only for package @functionless/aws-cognito-constructs 13 | 14 | # [0.28.0](https://github.com/functionless/functionless/compare/v0.27.4...v0.28.0) (2022-10-14) 15 | 16 | ### chore 17 | 18 | - refactor aws-constructs into individual packages ([#552](https://github.com/functionless/functionless/issues/552)) ([01a2c9f](https://github.com/functionless/functionless/commit/01a2c9ff714e811f679ab25d9d62722e535eaf6b)) 19 | 20 | ### BREAKING CHANGES 21 | 22 | - @functionless/aws-constructs package has been refactored into many service-specific packages. 23 | -------------------------------------------------------------------------------- /packages/@functionless/aws-cognito-constructs/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/aws-cognito-constructs 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-cognito-constructs/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./user-pool"; 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-cognito-constructs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../aws-lambda" 17 | }, 18 | { 19 | "path": "../aws-lambda-constructs" 20 | }, 21 | { 22 | "path": "../jest" 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /packages/@functionless/aws-dynamodb-constructs/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.29.0](https://github.com/functionless/functionless/compare/v0.28.5...v0.29.0) (2022-10-18) 7 | 8 | **Note:** Version bump only for package @functionless/aws-dynamodb-constructs 9 | 10 | ## [0.28.4](https://github.com/functionless/functionless/compare/v0.28.3...v0.28.4) (2022-10-17) 11 | 12 | **Note:** Version bump only for package @functionless/aws-dynamodb-constructs 13 | 14 | # [0.28.0](https://github.com/functionless/functionless/compare/v0.27.4...v0.28.0) (2022-10-14) 15 | 16 | ### chore 17 | 18 | - refactor aws-constructs into individual packages ([#552](https://github.com/functionless/functionless/issues/552)) ([01a2c9f](https://github.com/functionless/functionless/commit/01a2c9ff714e811f679ab25d9d62722e535eaf6b)) 19 | 20 | ### BREAKING CHANGES 21 | 22 | - @functionless/aws-constructs package has been refactored into many service-specific packages. 23 | -------------------------------------------------------------------------------- /packages/@functionless/aws-dynamodb-constructs/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/aws-dynamodb-constructs 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-dynamodb-constructs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/aws-dynamodb-constructs", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc", 12 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "dependencies": { 17 | "@functionless/asl": "^0.29.0", 18 | "@functionless/aws-apigateway": "^0.29.0", 19 | "@functionless/aws-appsync": "^0.29.0", 20 | "@functionless/aws-dynamodb": "^0.29.0", 21 | "@functionless/aws-lambda": "^0.29.0", 22 | "@functionless/vtl": "^0.29.0", 23 | "aws-sdk": "^2" 24 | }, 25 | "peerDependencies": { 26 | "aws-cdk-lib": "^2.44.0" 27 | }, 28 | "devDependencies": { 29 | "@types/node": "^16", 30 | "aws-cdk-lib": "2.44.0", 31 | "functionless-build-utils": "*", 32 | "typescript": "^4.8.3" 33 | }, 34 | "publishConfig": { 35 | "access": "public" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /packages/@functionless/aws-dynamodb-constructs/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./appsync"; 2 | export * from "./batch-get-item"; 3 | export * from "./batch-write-item"; 4 | export * from "./delete-item"; 5 | export * from "./get-item"; 6 | export * from "./integration"; 7 | export * from "./put-item"; 8 | export * from "./query"; 9 | export * from "./runtime"; 10 | export * from "./scan"; 11 | export * from "./table"; 12 | export * from "./transact-get-item"; 13 | export * from "./transact-write-item"; 14 | export * from "./update-item"; 15 | export * from "./util"; 16 | -------------------------------------------------------------------------------- /packages/@functionless/aws-dynamodb-constructs/src/util.ts: -------------------------------------------------------------------------------- 1 | import type { NativeBinaryAttribute } from "typesafe-dynamodb/lib/attribute-value"; 2 | 3 | export type AttributeKeyToObject = { 4 | [k in keyof T]: T[k] extends { S: infer S } 5 | ? S 6 | : T[k] extends { N: `${infer N}` } 7 | ? N 8 | : T[k] extends { B: any } 9 | ? NativeBinaryAttribute 10 | : never; 11 | }; 12 | -------------------------------------------------------------------------------- /packages/@functionless/aws-dynamodb-constructs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../asl" 17 | }, 18 | { 19 | "path": "../aws-apigateway" 20 | }, 21 | { 22 | "path": "../aws-appsync" 23 | }, 24 | { 25 | "path": "../aws-dynamodb" 26 | }, 27 | { 28 | "path": "../aws-lambda" 29 | }, 30 | { 31 | "path": "../vtl" 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /packages/@functionless/aws-dynamodb/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/aws-dynamodb 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-dynamodb/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/aws-dynamodb", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc", 12 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "dependencies": { 17 | "@functionless/aws-lambda": "^0.29.0", 18 | "@functionless/aws-util": "^0.29.0", 19 | "aws-sdk": "^2" 20 | }, 21 | "peerDependencies": { 22 | "aws-cdk-lib": "^2.44.0" 23 | }, 24 | "devDependencies": { 25 | "@types/node": "^16", 26 | "aws-cdk-lib": "2.44.0", 27 | "functionless-build-utils": "*", 28 | "typescript": "^4.8.3" 29 | }, 30 | "publishConfig": { 31 | "access": "public" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /packages/@functionless/aws-dynamodb/src/attribute-type.ts: -------------------------------------------------------------------------------- 1 | export type AttributeType = "S" | "N" | "B"; 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-dynamodb/src/client.ts: -------------------------------------------------------------------------------- 1 | import DynamoDB from "aws-sdk/clients/dynamodb"; 2 | import { DocumentClient } from "aws-sdk/lib/dynamodb/document_client"; 3 | import type { NativeRuntimeInitializer } from "@functionless/aws-lambda"; 4 | 5 | export const DocumentDBClient: NativeRuntimeInitializer< 6 | "DynamoDB", 7 | DocumentClient 8 | > = { 9 | key: "DynamoDB", 10 | init: (key, props) => 11 | new (require("aws-sdk/clients/dynamodb").DocumentClient)( 12 | props?.clientConfigRetriever?.(key) 13 | ), 14 | }; 15 | 16 | export const DynamoDBClient: NativeRuntimeInitializer< 17 | "DynamoDBDocument", 18 | DynamoDB 19 | > = { 20 | key: "DynamoDBDocument", 21 | init: (key, props) => 22 | new (require("aws-sdk/clients/dynamodb"))( 23 | props?.clientConfigRetriever?.(key) 24 | ), 25 | }; 26 | -------------------------------------------------------------------------------- /packages/@functionless/aws-dynamodb/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./appsync"; 2 | export * from "./attribute-type"; 3 | export * from "./batch-get-item"; 4 | export * from "./batch-write-item"; 5 | export * from "./delete-item"; 6 | export * from "./client"; 7 | export * from "./get-item"; 8 | export * from "./put-item"; 9 | export * from "./query"; 10 | export * from "./scan"; 11 | export * from "./return-value"; 12 | export * from "./runtime"; 13 | export * from "./table"; 14 | export * from "./transact-get-item"; 15 | export * from "./transact-write-item"; 16 | export * from "./update-item"; 17 | export * from "./util"; 18 | -------------------------------------------------------------------------------- /packages/@functionless/aws-dynamodb/src/return-value.ts: -------------------------------------------------------------------------------- 1 | export type ReturnValues = 2 | | "ALL_NEW" 3 | | "ALL_OLD" 4 | | "NONE" 5 | | "UPDATED_NEW" 6 | | "UPDATED_OLD"; 7 | -------------------------------------------------------------------------------- /packages/@functionless/aws-dynamodb/src/util.ts: -------------------------------------------------------------------------------- 1 | import { NativeBinaryAttribute } from "typesafe-dynamodb/lib/attribute-value"; 2 | 3 | export type AttributeKeyToObject = { 4 | [k in keyof T]: T[k] extends { S: infer S } 5 | ? S 6 | : T[k] extends { N: `${infer N}` } 7 | ? N 8 | : T[k] extends { B: any } 9 | ? NativeBinaryAttribute 10 | : never; 11 | }; 12 | -------------------------------------------------------------------------------- /packages/@functionless/aws-dynamodb/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../aws-lambda" 17 | }, 18 | { 19 | "path": "../aws-util" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/@functionless/aws-events-constructs/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.29.0](https://github.com/functionless/functionless/compare/v0.28.5...v0.29.0) (2022-10-18) 7 | 8 | **Note:** Version bump only for package @functionless/aws-events-constructs 9 | 10 | ## [0.28.4](https://github.com/functionless/functionless/compare/v0.28.3...v0.28.4) (2022-10-17) 11 | 12 | **Note:** Version bump only for package @functionless/aws-events-constructs 13 | 14 | # [0.28.0](https://github.com/functionless/functionless/compare/v0.27.4...v0.28.0) (2022-10-14) 15 | 16 | ### chore 17 | 18 | - refactor aws-constructs into individual packages ([#552](https://github.com/functionless/functionless/issues/552)) ([01a2c9f](https://github.com/functionless/functionless/commit/01a2c9ff714e811f679ab25d9d62722e535eaf6b)) 19 | 20 | ### BREAKING CHANGES 21 | 22 | - @functionless/aws-constructs package has been refactored into many service-specific packages. 23 | -------------------------------------------------------------------------------- /packages/@functionless/aws-events-constructs/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/aws-events-constructs 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-events-constructs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/aws-events-constructs", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc", 12 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "dependencies": { 17 | "@functionless/asl": "^0.29.0", 18 | "@functionless/ast": "^0.29.0", 19 | "@functionless/aws-apigateway": "^0.29.0", 20 | "@functionless/aws-appsync": "^0.29.0", 21 | "@functionless/aws-events": "^0.29.0", 22 | "@functionless/aws-lambda": "^0.29.0", 23 | "@functionless/util": "^0.29.0" 24 | }, 25 | "peerDependencies": { 26 | "aws-cdk-lib": "^2.44.0" 27 | }, 28 | "devDependencies": { 29 | "aws-cdk-lib": "2.44.0", 30 | "functionless-build-utils": "*", 31 | "typescript": "^4.8.3" 32 | }, 33 | "publishConfig": { 34 | "access": "public" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/@functionless/aws-events-constructs/src/event-pattern/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./synth"; 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-events-constructs/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./event-bus"; 2 | export { 3 | synthesizeEventPattern, 4 | synthesizePatternDocument, 5 | } from "./event-pattern"; 6 | export { 7 | ImportedRule, 8 | IRule, 9 | PredicateRuleBase, 10 | Rule, 11 | RulePredicateFunction, 12 | ScheduledEvent, 13 | } from "./rule"; 14 | export { 15 | EventTransform, 16 | EventTransformFunction, 17 | EventTransformUtils, 18 | NonEventBusIntegration, 19 | } from "./transform"; 20 | export { synthesizeEventBridgeTargets } from "./target-input"; 21 | export { 22 | AnythingButPattern, 23 | ExistsPattern, 24 | FunctionlessEventPattern, 25 | MatchPattern, 26 | NumberPattern, 27 | Pattern, 28 | PatternList, 29 | PrefixPattern, 30 | SubPattern, 31 | isAnythingButPattern, 32 | isExistsPattern, 33 | isMatchPattern, 34 | isNumberPattern, 35 | isPrefixPattern, 36 | } from "./types"; 37 | -------------------------------------------------------------------------------- /packages/@functionless/aws-events-constructs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../asl" 17 | }, 18 | { 19 | "path": "../ast" 20 | }, 21 | { 22 | "path": "../aws-apigateway" 23 | }, 24 | { 25 | "path": "../aws-appsync" 26 | }, 27 | { 28 | "path": "../aws-events" 29 | }, 30 | { 31 | "path": "../aws-lambda" 32 | }, 33 | { 34 | "path": "../util" 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /packages/@functionless/aws-events/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.29.0](https://github.com/functionless/functionless/compare/v0.28.5...v0.29.0) (2022-10-18) 7 | 8 | **Note:** Version bump only for package @functionless/aws-events 9 | 10 | ## [0.28.4](https://github.com/functionless/functionless/compare/v0.28.3...v0.28.4) (2022-10-17) 11 | 12 | **Note:** Version bump only for package @functionless/aws-events 13 | 14 | # [0.28.0](https://github.com/functionless/functionless/compare/v0.27.4...v0.28.0) (2022-10-14) 15 | 16 | ### chore 17 | 18 | - refactor aws-constructs into individual packages ([#552](https://github.com/functionless/functionless/issues/552)) ([01a2c9f](https://github.com/functionless/functionless/commit/01a2c9ff714e811f679ab25d9d62722e535eaf6b)) 19 | 20 | ### BREAKING CHANGES 21 | 22 | - @functionless/aws-constructs package has been refactored into many service-specific packages. 23 | -------------------------------------------------------------------------------- /packages/@functionless/aws-events/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/aws-events 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-events/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/aws-events", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc", 12 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "dependencies": { 17 | "@functionless/aws-lambda": "^0.29.0", 18 | "aws-sdk": "^2" 19 | }, 20 | "peerDependencies": { 21 | "aws-cdk-lib": "^2.44.0" 22 | }, 23 | "devDependencies": { 24 | "@types/node": "^16", 25 | "aws-cdk-lib": "2.44.0", 26 | "functionless-build-utils": "*", 27 | "typescript": "^4.8.3" 28 | }, 29 | "publishConfig": { 30 | "access": "public" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /packages/@functionless/aws-events/src/client.ts: -------------------------------------------------------------------------------- 1 | import type { NativeRuntimeInitializer } from "@functionless/aws-lambda"; 2 | import type EventBridge from "aws-sdk/clients/eventbridge"; 3 | 4 | export const EventBridgeClient: NativeRuntimeInitializer = 5 | { 6 | key: "EventBridge", 7 | init: (key, props) => 8 | new (require("aws-sdk/clients/eventbridge"))( 9 | props?.clientConfigRetriever?.(key) 10 | ), 11 | }; 12 | -------------------------------------------------------------------------------- /packages/@functionless/aws-events/src/event-bus.ts: -------------------------------------------------------------------------------- 1 | import type { EventBusProps } from "aws-cdk-lib/aws-events"; 2 | import { Event } from "./event"; 3 | 4 | export interface EventBusEvent< 5 | Detail extends object = {}, 6 | Type extends string = string, 7 | Source extends string = string 8 | > { 9 | detail: Detail; 10 | "detail-type": Type; 11 | source: Source; 12 | } 13 | 14 | export const EventBusKind = "fl.EventBus"; 15 | 16 | export interface EventBus< 17 | in In extends EventBusEvent = EventBusEvent, 18 | out Out extends In = In 19 | > { 20 | _out?: Out; 21 | 22 | kind: typeof EventBusKind; 23 | props?: EventBusProps; 24 | } 25 | 26 | export function isEventBus(a: any): a is EventBus { 27 | return a?.kind === EventBusKind; 28 | } 29 | 30 | export function EventBus( 31 | props?: EventBusProps 32 | ): EventBus> { 33 | return (>>{ 34 | kind: EventBusKind, 35 | props, 36 | }) as any; 37 | } 38 | -------------------------------------------------------------------------------- /packages/@functionless/aws-events/src/event.ts: -------------------------------------------------------------------------------- 1 | export interface Event< 2 | T = any, 3 | DetailType extends string = string, 4 | Source extends string = string 5 | > { 6 | source: Source; 7 | "detail-type": DetailType; 8 | detail: T; 9 | version: string; 10 | id: string; 11 | account: string; 12 | time: string; 13 | region: string; 14 | resources: string[]; 15 | } 16 | -------------------------------------------------------------------------------- /packages/@functionless/aws-events/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./client"; 2 | export * from "./event-bus-integration"; 3 | export * from "./event-bus"; 4 | export * from "./event"; 5 | -------------------------------------------------------------------------------- /packages/@functionless/aws-events/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../aws-lambda" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /packages/@functionless/aws-lambda-constructs/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.29.0](https://github.com/functionless/functionless/compare/v0.28.5...v0.29.0) (2022-10-18) 7 | 8 | **Note:** Version bump only for package @functionless/aws-lambda-constructs 9 | 10 | ## [0.28.4](https://github.com/functionless/functionless/compare/v0.28.3...v0.28.4) (2022-10-17) 11 | 12 | **Note:** Version bump only for package @functionless/aws-lambda-constructs 13 | 14 | # [0.28.0](https://github.com/functionless/functionless/compare/v0.27.4...v0.28.0) (2022-10-14) 15 | 16 | ### chore 17 | 18 | - refactor aws-constructs into individual packages ([#552](https://github.com/functionless/functionless/issues/552)) ([01a2c9f](https://github.com/functionless/functionless/commit/01a2c9ff714e811f679ab25d9d62722e535eaf6b)) 19 | 20 | ### BREAKING CHANGES 21 | 22 | - @functionless/aws-constructs package has been refactored into many service-specific packages. 23 | -------------------------------------------------------------------------------- /packages/@functionless/aws-lambda-constructs/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/aws-lambda-constructs 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-lambda-constructs/src/async-synth.ts: -------------------------------------------------------------------------------- 1 | import type { App } from "aws-cdk-lib"; 2 | import type { SynthesisOptions } from "aws-cdk-lib/core/lib/private/synthesis"; 3 | import { Function } from "./function"; 4 | 5 | /** 6 | * Experimental hack that waits for async code in CDK construct instantiation to complete before 7 | * calling app.synth(). 8 | */ 9 | export const asyncSynth = async (app: App, options?: SynthesisOptions) => { 10 | await new Promise(setImmediate); 11 | await Promise.all(Function.promises); 12 | return app.synth(options); 13 | }; 14 | 15 | // to prevent the closure serializer from trying to import all of functionless. 16 | export const deploymentOnlyModule = true; 17 | -------------------------------------------------------------------------------- /packages/@functionless/aws-lambda-constructs/src/index.ts: -------------------------------------------------------------------------------- 1 | export { asyncSynth } from "./async-synth"; 2 | export * from "./function"; 3 | -------------------------------------------------------------------------------- /packages/@functionless/aws-lambda/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/aws-lambda 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-lambda/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/aws-lambda", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc", 12 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "dependencies": { 17 | "@functionless/ast": "^0.29.0", 18 | "@functionless/aws-util": "^0.29.0", 19 | "@functionless/serde": "^0.29.0", 20 | "@functionless/util": "^0.29.0", 21 | "aws-sdk": "^2" 22 | }, 23 | "peerDependencies": { 24 | "aws-cdk-lib": "^2.44.0" 25 | }, 26 | "devDependencies": { 27 | "@types/node": "^16", 28 | "aws-cdk-lib": "2.44.0", 29 | "functionless-build-utils": "*", 30 | "typescript": "^4.8.3" 31 | }, 32 | "publishConfig": { 33 | "access": "public" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /packages/@functionless/aws-lambda/src/client.ts: -------------------------------------------------------------------------------- 1 | import { NativeRuntimeInitializer } from "./native-context"; 2 | import type Lambda from "aws-sdk/clients/lambda"; 3 | 4 | export const LambdaClient: NativeRuntimeInitializer = { 5 | key: "Lambda", 6 | init: (key, props) => 7 | new (require("aws-sdk/clients/lambda"))( 8 | props?.clientConfigRetriever?.(key) 9 | ), 10 | }; 11 | -------------------------------------------------------------------------------- /packages/@functionless/aws-lambda/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./client"; 2 | export * from "./function"; 3 | export * from "./native-context"; 4 | export * from "./native-integration"; 5 | export * from "./native-runtime-environment"; 6 | -------------------------------------------------------------------------------- /packages/@functionless/aws-lambda/src/native-context.ts: -------------------------------------------------------------------------------- 1 | import { NativeRuntimeEnvironmentProps } from "./native-runtime-environment"; 2 | 3 | /** 4 | * This client is used at runtime. Keep the dependencies to a minimal and analyze the lambda bundles on output. 5 | */ 6 | export interface NativeRuntimeInitializer { 7 | key: T; 8 | init: (key: string, props?: NativeRuntimeEnvironmentProps) => O; 9 | } 10 | -------------------------------------------------------------------------------- /packages/@functionless/aws-lambda/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../ast" 17 | }, 18 | { 19 | "path": "../aws-util" 20 | }, 21 | { 22 | "path": "../serde" 23 | }, 24 | { 25 | "path": "../util" 26 | } 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /packages/@functionless/aws-sdk/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.29.0](https://github.com/functionless/functionless/compare/v0.28.5...v0.29.0) (2022-10-18) 7 | 8 | **Note:** Version bump only for package @functionless/aws-sdk 9 | 10 | ## [0.28.4](https://github.com/functionless/functionless/compare/v0.28.3...v0.28.4) (2022-10-17) 11 | 12 | **Note:** Version bump only for package @functionless/aws-sdk 13 | 14 | # [0.28.0](https://github.com/functionless/functionless/compare/v0.27.4...v0.28.0) (2022-10-14) 15 | 16 | ### chore 17 | 18 | - refactor aws-constructs into individual packages ([#552](https://github.com/functionless/functionless/issues/552)) ([01a2c9f](https://github.com/functionless/functionless/commit/01a2c9ff714e811f679ab25d9d62722e535eaf6b)) 19 | 20 | ### BREAKING CHANGES 21 | 22 | - @functionless/aws-constructs package has been refactored into many service-specific packages. 23 | -------------------------------------------------------------------------------- /packages/@functionless/aws-sdk/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/aws-sdk 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-sdk/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/aws-sdk", 3 | "version": "0.29.0", 4 | "main": "lib/index.js", 5 | "types": "lib/index.d.ts", 6 | "scripts": { 7 | "build": "ts-node -p ./scripts/sdk-gen.ts", 8 | "typecheck": "tsc --noEmit", 9 | "test": "echo no-op" 10 | }, 11 | "peerDependencies": { 12 | "aws-sdk": "^2" 13 | }, 14 | "dependencies": { 15 | "@functionless/asl": "^0.29.0", 16 | "@functionless/ast": "^0.29.0", 17 | "@functionless/aws-events": "^0.29.0", 18 | "@functionless/aws-events-constructs": "^0.29.0", 19 | "@functionless/aws-lambda": "^0.29.0", 20 | "@functionless/aws-lambda-constructs": "^0.29.0", 21 | "@functionless/error-code": "^0.29.0" 22 | }, 23 | "devDependencies": { 24 | "@types/node": "^16", 25 | "aws-sdk": "^2", 26 | "functionless-build-utils": "*", 27 | "typescript": "^4.8.3" 28 | }, 29 | "files": [ 30 | "lib", 31 | "docs" 32 | ], 33 | "publishConfig": { 34 | "access": "public" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/@functionless/aws-sdk/scripts/sdk-gen-aws.ts: -------------------------------------------------------------------------------- 1 | import * as AWS from "aws-sdk"; 2 | 3 | /** 4 | * Store a reference to the AWS object so that its type can be easily obtained in the ./sdk-gen.ts script. 5 | */ 6 | export const aws = AWS; 7 | -------------------------------------------------------------------------------- /packages/@functionless/aws-sdk/src/asl.ts: -------------------------------------------------------------------------------- 1 | import { SDK } from "./sdk.generated"; 2 | 3 | export const SDK_INTEGRATION_SERVICE_NAME: Partial> = 4 | { 5 | Discovery: "applicationdiscovery", 6 | ConfigService: "config", 7 | CUR: "costandusagereport", 8 | DMS: "databasemigration", 9 | DirectoryService: "directory", 10 | MarketplaceEntitlementService: "marketplaceentitlement", 11 | RDSDataService: "rdsdata", 12 | StepFunctions: "sfn", 13 | AugmentedAIRuntime: "sagemakera2iruntime", 14 | ForecastQueryService: "forecastquery", 15 | KinesisVideoSignalingChannels: "kinesisvideosignaling", 16 | LexModelBuildingService: "lexmodelbuilding", 17 | TranscribeService: "transcribe", 18 | ELB: "elasticloadbalancing", 19 | ELBv2: "elasticloadbalancingv2", 20 | }; 21 | -------------------------------------------------------------------------------- /packages/@functionless/aws-sdk/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./sdk.generated"; 2 | export * from "./aws"; 3 | export * from "./types"; 4 | -------------------------------------------------------------------------------- /packages/@functionless/aws-sdk/tsconfig.gen.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "noEmit": true, 4 | "rootDir": "." 5 | }, 6 | "include": ["scripts/*.ts"], 7 | "exclude": ["lib", "node_modules"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/@functionless/aws-sdk/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "esModuleInterop": true, 8 | "rootDir": "src" 9 | }, 10 | "include": ["src"], 11 | "exclude": ["lib", "node_modules"], 12 | "references": [ 13 | { 14 | "path": "../../functionless-build-utils" 15 | }, 16 | { 17 | "path": "../asl" 18 | }, 19 | { 20 | "path": "../ast" 21 | }, 22 | { 23 | "path": "../aws-events" 24 | }, 25 | { 26 | "path": "../aws-events-constructs" 27 | }, 28 | { 29 | "path": "../aws-lambda" 30 | }, 31 | { 32 | "path": "../aws-lambda-constructs" 33 | }, 34 | { 35 | "path": "../error-code" 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /packages/@functionless/aws-secretsmanager-constructs/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.29.0](https://github.com/functionless/functionless/compare/v0.28.5...v0.29.0) (2022-10-18) 7 | 8 | **Note:** Version bump only for package @functionless/aws-secretsmanager-constructs 9 | 10 | ## [0.28.4](https://github.com/functionless/functionless/compare/v0.28.3...v0.28.4) (2022-10-17) 11 | 12 | **Note:** Version bump only for package @functionless/aws-secretsmanager-constructs 13 | 14 | # [0.28.0](https://github.com/functionless/functionless/compare/v0.27.4...v0.28.0) (2022-10-14) 15 | 16 | ### chore 17 | 18 | - refactor aws-constructs into individual packages ([#552](https://github.com/functionless/functionless/issues/552)) ([01a2c9f](https://github.com/functionless/functionless/commit/01a2c9ff714e811f679ab25d9d62722e535eaf6b)) 19 | 20 | ### BREAKING CHANGES 21 | 22 | - @functionless/aws-constructs package has been refactored into many service-specific packages. 23 | -------------------------------------------------------------------------------- /packages/@functionless/aws-secretsmanager-constructs/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/aws-secretsmanager-constructs 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-secretsmanager-constructs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/aws-secretsmanager-constructs", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc", 12 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "dependencies": { 17 | "@functionless/aws-lambda": "^0.29.0", 18 | "@functionless/aws-secretsmanager": "^0.29.0", 19 | "aws-sdk": "^2" 20 | }, 21 | "peerDependencies": { 22 | "aws-cdk-lib": "^2.44.0" 23 | }, 24 | "devDependencies": { 25 | "@types/node": "^16", 26 | "aws-cdk-lib": "2.44.0", 27 | "functionless-build-utils": "*", 28 | "typescript": "^4.8.3" 29 | }, 30 | "publishConfig": { 31 | "access": "public" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /packages/@functionless/aws-secretsmanager-constructs/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./secret"; 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-secretsmanager-constructs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../aws-lambda" 17 | }, 18 | { 19 | "path": "../aws-secretsmanager" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/@functionless/aws-secretsmanager/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.29.0](https://github.com/functionless/functionless/compare/v0.28.5...v0.29.0) (2022-10-18) 7 | 8 | **Note:** Version bump only for package @functionless/aws-secretsmanager 9 | 10 | ## [0.28.4](https://github.com/functionless/functionless/compare/v0.28.3...v0.28.4) (2022-10-17) 11 | 12 | **Note:** Version bump only for package @functionless/aws-secretsmanager 13 | 14 | # [0.28.0](https://github.com/functionless/functionless/compare/v0.27.4...v0.28.0) (2022-10-14) 15 | 16 | ### chore 17 | 18 | - refactor aws-constructs into individual packages ([#552](https://github.com/functionless/functionless/issues/552)) ([01a2c9f](https://github.com/functionless/functionless/commit/01a2c9ff714e811f679ab25d9d62722e535eaf6b)) 19 | 20 | ### BREAKING CHANGES 21 | 22 | - @functionless/aws-constructs package has been refactored into many service-specific packages. 23 | -------------------------------------------------------------------------------- /packages/@functionless/aws-secretsmanager/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/aws-secretsmanager 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-secretsmanager/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/aws-secretsmanager", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc", 12 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "dependencies": { 17 | "@functionless/ast": "^0.29.0", 18 | "@functionless/aws-lambda": "^0.29.0", 19 | "aws-sdk": "^2" 20 | }, 21 | "devDependencies": { 22 | "@types/node": "^16", 23 | "functionless-build-utils": "*", 24 | "typescript": "^4.8.3" 25 | }, 26 | "publishConfig": { 27 | "access": "public" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/@functionless/aws-secretsmanager/src/client.ts: -------------------------------------------------------------------------------- 1 | import type { NativeRuntimeInitializer } from "@functionless/aws-lambda"; 2 | import type SecretsManager from "aws-sdk/clients/secretsmanager"; 3 | 4 | export const SecretsManagerClient: NativeRuntimeInitializer< 5 | string, 6 | SecretsManager 7 | > = { 8 | key: "SecretsManager", 9 | init: (key, props) => 10 | new (require("aws-sdk/clients/secretsmanager"))( 11 | props?.clientConfigRetriever?.(key) 12 | ), 13 | }; 14 | -------------------------------------------------------------------------------- /packages/@functionless/aws-secretsmanager/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./client"; 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-secretsmanager/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../ast" 17 | }, 18 | { 19 | "path": "../aws-lambda" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/@functionless/aws-sqs-constructs/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.29.0](https://github.com/functionless/functionless/compare/v0.28.5...v0.29.0) (2022-10-18) 7 | 8 | **Note:** Version bump only for package @functionless/aws-sqs-constructs 9 | 10 | ## [0.28.4](https://github.com/functionless/functionless/compare/v0.28.3...v0.28.4) (2022-10-17) 11 | 12 | **Note:** Version bump only for package @functionless/aws-sqs-constructs 13 | 14 | # [0.28.0](https://github.com/functionless/functionless/compare/v0.27.4...v0.28.0) (2022-10-14) 15 | 16 | ### chore 17 | 18 | - refactor aws-constructs into individual packages ([#552](https://github.com/functionless/functionless/issues/552)) ([01a2c9f](https://github.com/functionless/functionless/commit/01a2c9ff714e811f679ab25d9d62722e535eaf6b)) 19 | 20 | ### BREAKING CHANGES 21 | 22 | - @functionless/aws-constructs package has been refactored into many service-specific packages. 23 | -------------------------------------------------------------------------------- /packages/@functionless/aws-sqs-constructs/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/aws-sqs-constructs 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-sqs-constructs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/aws-sqs-constructs", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc", 12 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "dependencies": { 17 | "@functionless/asl": "^0.29.0", 18 | "@functionless/ast": "^0.29.0", 19 | "@functionless/aws-events": "^0.29.0", 20 | "@functionless/aws-lambda": "^0.29.0", 21 | "@functionless/aws-lambda-constructs": "^0.29.0", 22 | "@functionless/aws-sqs": "^0.29.0", 23 | "@functionless/serde": "^0.29.0", 24 | "aws-sdk": "^2" 25 | }, 26 | "peerDependencies": { 27 | "aws-cdk-lib": "^2.44.0" 28 | }, 29 | "devDependencies": { 30 | "@types/node": "^16", 31 | "aws-cdk-lib": "2.44.0", 32 | "functionless-build-utils": "*", 33 | "typescript": "^4.8.3" 34 | }, 35 | "publishConfig": { 36 | "access": "public" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/@functionless/aws-sqs-constructs/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./event-source"; 2 | export * from "./iterable"; 3 | export * from "./queue"; 4 | -------------------------------------------------------------------------------- /packages/@functionless/aws-sqs-constructs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../asl" 17 | }, 18 | { 19 | "path": "../ast" 20 | }, 21 | { 22 | "path": "../aws-events" 23 | }, 24 | { 25 | "path": "../aws-lambda" 26 | }, 27 | { 28 | "path": "../aws-lambda-constructs" 29 | }, 30 | { 31 | "path": "../aws-sqs" 32 | }, 33 | { 34 | "path": "../serde" 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /packages/@functionless/aws-sqs/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.29.0](https://github.com/functionless/functionless/compare/v0.28.5...v0.29.0) (2022-10-18) 7 | 8 | **Note:** Version bump only for package @functionless/aws-sqs 9 | 10 | ## [0.28.4](https://github.com/functionless/functionless/compare/v0.28.3...v0.28.4) (2022-10-17) 11 | 12 | **Note:** Version bump only for package @functionless/aws-sqs 13 | 14 | # [0.28.0](https://github.com/functionless/functionless/compare/v0.27.4...v0.28.0) (2022-10-14) 15 | 16 | ### chore 17 | 18 | - refactor aws-constructs into individual packages ([#552](https://github.com/functionless/functionless/issues/552)) ([01a2c9f](https://github.com/functionless/functionless/commit/01a2c9ff714e811f679ab25d9d62722e535eaf6b)) 19 | 20 | ### BREAKING CHANGES 21 | 22 | - @functionless/aws-constructs package has been refactored into many service-specific packages. 23 | -------------------------------------------------------------------------------- /packages/@functionless/aws-sqs/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/aws-sqs 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-sqs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/aws-sqs", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc", 12 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "dependencies": { 17 | "@functionless/ast": "^0.29.0", 18 | "@functionless/aws-lambda": "^0.29.0", 19 | "aws-sdk": "^2" 20 | }, 21 | "devDependencies": { 22 | "@types/node": "^16", 23 | "functionless-build-utils": "*", 24 | "typescript": "^4.8.3" 25 | }, 26 | "publishConfig": { 27 | "access": "public" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/@functionless/aws-sqs/src/client.ts: -------------------------------------------------------------------------------- 1 | import type { NativeRuntimeInitializer } from "@functionless/aws-lambda"; 2 | import type SQS from "aws-sdk/clients/sqs"; 3 | 4 | export const SQSClient: NativeRuntimeInitializer<"SQS", SQS> = { 5 | key: "SQS", 6 | init: (key, props) => { 7 | const SQS = require("aws-sdk/clients/sqs"); 8 | return new SQS(props?.clientConfigRetriever?.(key)); 9 | }, 10 | }; 11 | -------------------------------------------------------------------------------- /packages/@functionless/aws-sqs/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./client"; 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-sqs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../ast" 17 | }, 18 | { 19 | "path": "../aws-lambda" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/@functionless/aws-stepfunctions-constructs/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.29.0](https://github.com/functionless/functionless/compare/v0.28.5...v0.29.0) (2022-10-18) 7 | 8 | **Note:** Version bump only for package @functionless/aws-stepfunctions-constructs 9 | 10 | ## [0.28.4](https://github.com/functionless/functionless/compare/v0.28.3...v0.28.4) (2022-10-17) 11 | 12 | **Note:** Version bump only for package @functionless/aws-stepfunctions-constructs 13 | 14 | # [0.28.0](https://github.com/functionless/functionless/compare/v0.27.4...v0.28.0) (2022-10-14) 15 | 16 | ### chore 17 | 18 | - refactor aws-constructs into individual packages ([#552](https://github.com/functionless/functionless/issues/552)) ([01a2c9f](https://github.com/functionless/functionless/commit/01a2c9ff714e811f679ab25d9d62722e535eaf6b)) 19 | 20 | ### BREAKING CHANGES 21 | 22 | - @functionless/aws-constructs package has been refactored into many service-specific packages. 23 | -------------------------------------------------------------------------------- /packages/@functionless/aws-stepfunctions-constructs/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/aws-stepfunctions-constructs 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-stepfunctions-constructs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/aws-stepfunctions-constructs", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc", 12 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "dependencies": { 17 | "@functionless/asl": "^0.29.0", 18 | "@functionless/ast": "^0.29.0", 19 | "@functionless/aws-apigateway": "^0.29.0", 20 | "@functionless/aws-appsync": "^0.29.0", 21 | "@functionless/aws-events": "^0.29.0", 22 | "@functionless/aws-events-constructs": "^0.29.0", 23 | "@functionless/aws-stepfunctions": "^0.29.0", 24 | "@functionless/vtl": "^0.29.0" 25 | }, 26 | "peerDependencies": { 27 | "aws-cdk-lib": "^2.44.0" 28 | }, 29 | "devDependencies": { 30 | "aws-cdk-lib": "2.44.0", 31 | "functionless-build-utils": "*", 32 | "typescript": "^4.8.3" 33 | }, 34 | "publishConfig": { 35 | "access": "public" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /packages/@functionless/aws-stepfunctions-constructs/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./step-function"; 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-stepfunctions-constructs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../asl" 17 | }, 18 | { 19 | "path": "../ast" 20 | }, 21 | { 22 | "path": "../aws-apigateway" 23 | }, 24 | { 25 | "path": "../aws-appsync" 26 | }, 27 | { 28 | "path": "../aws-events" 29 | }, 30 | { 31 | "path": "../aws-events-constructs" 32 | }, 33 | { 34 | "path": "../aws-stepfunctions" 35 | }, 36 | { 37 | "path": "../vtl" 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /packages/@functionless/aws-stepfunctions/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/aws-stepfunctions 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-stepfunctions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/aws-stepfunctions", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc", 12 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "dependencies": { 17 | "@functionless/ast": "^0.29.0", 18 | "@functionless/aws-lambda": "^0.29.0", 19 | "@functionless/aws-util": "^0.29.0" 20 | }, 21 | "peerDependencies": { 22 | "aws-cdk-lib": "^2.44.0" 23 | }, 24 | "devDependencies": { 25 | "@types/node": "^16", 26 | "aws-cdk-lib": "2.44.0", 27 | "functionless-build-utils": "*", 28 | "typescript": "^4.8.3" 29 | }, 30 | "publishConfig": { 31 | "access": "public" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /packages/@functionless/aws-stepfunctions/src/client.ts: -------------------------------------------------------------------------------- 1 | import type StepFunctions from "aws-sdk/clients/stepfunctions"; 2 | import { NativeRuntimeInitializer } from "@functionless/aws-lambda"; 3 | 4 | export const StepFunctionsClient: NativeRuntimeInitializer< 5 | "StepFunctions", 6 | StepFunctions 7 | > = { 8 | key: "StepFunctions", 9 | init: (key, props) => 10 | new (require("aws-sdk/clients/stepfunctions"))( 11 | props?.clientConfigRetriever?.(key) 12 | ), 13 | }; 14 | -------------------------------------------------------------------------------- /packages/@functionless/aws-stepfunctions/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./client"; 2 | export * from "./express-step-function"; 3 | export * from "./step-function"; 4 | export * from "./invoker-shim"; 5 | -------------------------------------------------------------------------------- /packages/@functionless/aws-stepfunctions/src/invoker-shim.ts: -------------------------------------------------------------------------------- 1 | import StepFunctions from "aws-sdk/clients/stepfunctions"; 2 | 3 | const stepFunctionClient = new StepFunctions(); 4 | 5 | /** 6 | * A shim that is loaded in when invoking step functions from lambdas, in synth target 7 | * @param stateMachineArn Arn of the step function to invoke 8 | * @returns 9 | */ 10 | export const _invokeStepFunction = 11 | (stateMachineArn: string) => 12 | async (...args: any) => 13 | stepFunctionClient 14 | .startExecution({ 15 | stateMachineArn: stateMachineArn, 16 | input: JSON.stringify(args), 17 | }) 18 | .promise(); 19 | -------------------------------------------------------------------------------- /packages/@functionless/aws-stepfunctions/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../ast" 17 | }, 18 | { 19 | "path": "../aws-lambda" 20 | }, 21 | { 22 | "path": "../aws-util" 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /packages/@functionless/aws-util/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/aws-util 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws-util/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/aws-util", 3 | "version": "0.29.0", 4 | "main": "lib/index.js", 5 | "types": "lib/index.d.ts", 6 | "scripts": { 7 | "build:docs": "fls-typedoc", 8 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 9 | "dev": "tsc --watch", 10 | "typecheck": "tsc --noEmit" 11 | }, 12 | "dependencies": { 13 | "@functionless/util": "^0.29.0" 14 | }, 15 | "peerDependencies": { 16 | "aws-sdk": "^2" 17 | }, 18 | "devDependencies": { 19 | "@types/node": "^16", 20 | "aws-sdk": "^2", 21 | "functionless-build-utils": "*", 22 | "typescript": "^4.8.3" 23 | }, 24 | "files": [ 25 | "lib", 26 | "docs" 27 | ], 28 | "publishConfig": { 29 | "access": "public" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packages/@functionless/aws-util/src/credentials.ts: -------------------------------------------------------------------------------- 1 | import { CredentialProviderChain } from "aws-sdk"; 2 | 3 | // export function getCredentials() { 4 | // return new SsoCredentials({ 5 | // profile: "sam", 6 | // }); 7 | // } 8 | export function getClientProps() { 9 | return { 10 | credentialProvider: getCredentialProvider(), 11 | // region: getRegion(), 12 | }; 13 | } 14 | 15 | function getCredentialProvider() { 16 | return new CredentialProviderChain(CredentialProviderChain.defaultProviders); 17 | } 18 | -------------------------------------------------------------------------------- /packages/@functionless/aws-util/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./client-factory"; 2 | export * from "./credentials"; 3 | -------------------------------------------------------------------------------- /packages/@functionless/aws-util/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../util" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /packages/@functionless/aws/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/aws 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/aws", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc", 12 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "dependencies": { 17 | "@functionless/aws-util": "^0.29.0", 18 | "@functionless/util": "^0.29.0", 19 | "typesafe-dynamodb": "^0.2.3" 20 | }, 21 | "devDependencies": { 22 | "functionless-build-utils": "*", 23 | "typescript": "^4.8.3" 24 | }, 25 | "publishConfig": { 26 | "access": "public" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/@functionless/aws/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./stack"; 2 | -------------------------------------------------------------------------------- /packages/@functionless/aws/src/stack.ts: -------------------------------------------------------------------------------- 1 | import type { StackProps } from "aws-cdk-lib/core/lib/stack"; 2 | 3 | export const StackKind = "fl.Stack"; 4 | 5 | export interface StackDecl { 6 | kind: typeof StackKind; 7 | props?: StackProps; 8 | } 9 | 10 | export function isStack(a: any): a is StackDecl { 11 | return a?.kind === StackKind; 12 | } 13 | 14 | export function Stack(props?: StackProps) { 15 | return { 16 | kind: StackKind, 17 | props, 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /packages/@functionless/aws/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../aws-util" 17 | }, 18 | { 19 | "path": "../util" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/@functionless/cli/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/cli 2 | -------------------------------------------------------------------------------- /packages/@functionless/cli/bin/cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | require("../lib/cli"); 4 | -------------------------------------------------------------------------------- /packages/@functionless/cli/src/command-provider.ts: -------------------------------------------------------------------------------- 1 | import { StackResourceDetail } from "aws-sdk/clients/cloudformation"; 2 | import { Command } from "commander"; 3 | 4 | interface CommandDefinition { 5 | resourceKind: Kind; 6 | handler: ( 7 | command: Command, 8 | resourceKind: Kind, 9 | details: StackResourceDetail 10 | ) => void; 11 | } 12 | 13 | const registry: { 14 | [kind in string]: CommandDefinition; 15 | } = {}; 16 | 17 | export function registerCommand(definition: CommandDefinition) { 18 | registry[definition.resourceKind] = definition; 19 | } 20 | 21 | export async function dispatch( 22 | resourceKind: string, 23 | resourceDetail: StackResourceDetail 24 | ) { 25 | const found = registry[resourceKind]; 26 | const command = new Command(); 27 | 28 | if (found) { 29 | found.handler(command, found.resourceKind, resourceDetail); 30 | } 31 | command.parse([process.argv[0]!, ...process.argv.slice(2)]); 32 | } 33 | -------------------------------------------------------------------------------- /packages/@functionless/cli/src/commands/cdk-synth.ts: -------------------------------------------------------------------------------- 1 | import { loadProject } from "../load-project"; 2 | import { synthesizeProject } from "../synthesize"; 3 | 4 | export async function cdkSynth() { 5 | const project = await loadProject(process.cwd()); 6 | 7 | await synthesizeProject(project); 8 | } 9 | -------------------------------------------------------------------------------- /packages/@functionless/cli/src/commands/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./cdk-synth"; 2 | export * from "./resource"; 3 | -------------------------------------------------------------------------------- /packages/@functionless/cli/src/commands/local.ts: -------------------------------------------------------------------------------- 1 | import { localServeProject } from "../local-serve-project"; 2 | import { loadProject } from "../load-project"; 3 | 4 | export async function localServer() { 5 | const project = await loadProject(process.cwd()); 6 | await localServeProject(project); 7 | } 8 | -------------------------------------------------------------------------------- /packages/@functionless/cli/src/commands/resource/index.ts: -------------------------------------------------------------------------------- 1 | import { dispatch } from "../../command-provider"; 2 | import { logicalIdForPath, resolveStackDetail } from "../../logical-id"; 3 | 4 | import "./api-method"; 5 | import "./lambda-function"; 6 | import "./express-step-function"; 7 | import "./step-function"; 8 | import { File } from "../../tree/file"; 9 | 10 | require("@functionless/register"); 11 | 12 | export async function invoke(resourceFile: File, _args: string[]) { 13 | const absoluteResourcePath = resourceFile.filePath; 14 | const resourceId = resourceFile.address; 15 | 16 | const logicalId = logicalIdForPath(resourceId); 17 | 18 | const smartResource = (await import(absoluteResourcePath)).default; 19 | if (smartResource) { 20 | const stackDetail = await resolveStackDetail( 21 | resourceFile.stackName, 22 | logicalId 23 | ); 24 | 25 | if (!stackDetail) { 26 | return; 27 | } 28 | 29 | dispatch(smartResource.kind, stackDetail); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packages/@functionless/cli/src/commands/resource/open-console.ts: -------------------------------------------------------------------------------- 1 | import { StackResourceDetail } from "aws-sdk/clients/cloudformation"; 2 | import open from "open"; 3 | 4 | export async function openConsole(detail: StackResourceDetail) { 5 | const lambdaName = detail.PhysicalResourceId; 6 | 7 | if (detail.ResourceType === "AWS::StepFunctions::StateMachine") { 8 | const stepFunctionName = detail.PhysicalResourceId; 9 | open( 10 | `https://us-east-1.console.aws.amazon.com/states/home?region=us-east-1#/statemachines/view/${stepFunctionName}` 11 | ); 12 | } else if (detail.ResourceType === "AWS::Lambda::Function") { 13 | open( 14 | `https://us-east-1.console.aws.amazon.com/lambda/home?region=us-east-1#/functions/${lambdaName}?tab=code` 15 | ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/@functionless/cli/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./load-project"; 2 | -------------------------------------------------------------------------------- /packages/@functionless/cli/src/logical-id.ts: -------------------------------------------------------------------------------- 1 | import CloudFormation from "aws-sdk/clients/cloudformation"; 2 | import crypto from "crypto"; 3 | import { getClientProps } from "@functionless/aws-util"; 4 | 5 | export async function resolveStackDetail(stackName: string, logicalId: string) { 6 | const cfnClient = new CloudFormation(getClientProps()); 7 | 8 | const { StackResourceDetail } = await cfnClient 9 | .describeStackResource({ 10 | StackName: stackName, 11 | LogicalResourceId: logicalId, 12 | }) 13 | .promise(); 14 | 15 | if (!StackResourceDetail) { 16 | return; 17 | } 18 | 19 | return StackResourceDetail; 20 | } 21 | 22 | export function logicalIdForPath(idPath: string) { 23 | const parts = idPath.split("/").filter((part) => part !== "Resource"); 24 | const md5 = crypto.createHash("md5").update(parts.join("")).digest("hex"); 25 | const localId = parts.at(parts.length - 1)?.replace(/[^A-Za-z0-9]+/g, "")!; 26 | return `${localId}${md5}`.slice(0, 255); 27 | } 28 | -------------------------------------------------------------------------------- /packages/@functionless/cli/src/resource-plugins/loader/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./arn"; 2 | export * from "./lib"; 3 | export * from "./loader"; 4 | export * from "./visitor"; 5 | -------------------------------------------------------------------------------- /packages/@functionless/cli/src/resource-plugins/plugin.ts: -------------------------------------------------------------------------------- 1 | import { AtLeastOne } from "../util"; 2 | import { ResourceLoader } from "./loader/loader"; 3 | 4 | /** 5 | * Type of a resource plugin. 6 | * It is intended to contain all sorts of functionality to support providing resources to functionless apps 7 | */ 8 | export interface ResourcePlugin { 9 | kind: AtLeastOne; 10 | resourceLoader: ResourceLoader; 11 | } 12 | -------------------------------------------------------------------------------- /packages/@functionless/cli/src/resource-plugins/plugins/index.ts: -------------------------------------------------------------------------------- 1 | import { ResourcePlugin } from "../plugin"; 2 | import stepFunction from "./step-function/plugin"; 3 | import table from "./table/plugin"; 4 | 5 | /** 6 | * List of plugins to handle resource loading 7 | */ 8 | export const resourcePlugins: ResourcePlugin[] = [stepFunction, table]; 9 | -------------------------------------------------------------------------------- /packages/@functionless/cli/src/resource-plugins/plugins/step-function/plugin.ts: -------------------------------------------------------------------------------- 1 | import { ResourcePlugin } from "../../plugin"; 2 | import { resourceLoader } from "./resource-loader"; 3 | 4 | const stepFunctionPlugin: ResourcePlugin = { 5 | kind: ["fl.StepFunction", "fl.ExpressStepFunction"], 6 | resourceLoader, 7 | }; 8 | 9 | export default stepFunctionPlugin; 10 | -------------------------------------------------------------------------------- /packages/@functionless/cli/src/resource-plugins/plugins/table/plugin.ts: -------------------------------------------------------------------------------- 1 | import { ResourcePlugin } from "../../plugin"; 2 | import { resourceLoader } from "./resource-loader"; 3 | 4 | const tablePlugin: ResourcePlugin = { 5 | kind: "fl.Table", 6 | resourceLoader: resourceLoader, 7 | }; 8 | 9 | export default tablePlugin; 10 | -------------------------------------------------------------------------------- /packages/@functionless/cli/src/resource.ts: -------------------------------------------------------------------------------- 1 | export function isResource(a: any): a is Resource { 2 | return typeof a?.kind === "string"; 3 | } 4 | 5 | export interface Resource { 6 | kind: string; 7 | } 8 | -------------------------------------------------------------------------------- /packages/@functionless/cli/src/tree/tree.ts: -------------------------------------------------------------------------------- 1 | import { File, isFile } from "./file"; 2 | import type { Folder } from "./folder"; 3 | 4 | export type Tree = File | Folder; 5 | 6 | export function getResourceFiles(node: Tree): File[] { 7 | if (isFile(node)) { 8 | return [node]; 9 | } else { 10 | return Object.values(node.tree).flatMap(getResourceFiles); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/@functionless/cli/src/util.ts: -------------------------------------------------------------------------------- 1 | import path from "path"; 2 | import fs from "fs/promises"; 3 | import { constants } from "fs"; 4 | 5 | export async function exists(file: string): Promise { 6 | try { 7 | await fs.access(file, constants.F_OK); 8 | return true; 9 | } catch { 10 | return false; 11 | } 12 | } 13 | 14 | export async function ls(dir: string): Promise { 15 | return (await fs.readdir(dir)).map((file) => path.resolve(dir, file)); 16 | } 17 | 18 | /** 19 | * One or more of something 20 | */ 21 | export type AtLeastOne = T | T[]; 22 | 23 | export function matchAtLeastOne(t: AtLeastOne | undefined, val: T) { 24 | return !t || (Array.isArray(t) ? t.includes(val) : t === val); 25 | } 26 | -------------------------------------------------------------------------------- /packages/@functionless/error-code/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.29.0](https://github.com/functionless/functionless/compare/v0.28.5...v0.29.0) (2022-10-18) 7 | 8 | **Note:** Version bump only for package @functionless/error-code 9 | 10 | # [0.28.0](https://github.com/functionless/functionless/compare/v0.27.4...v0.28.0) (2022-10-14) 11 | 12 | ### chore 13 | 14 | - refactor aws-constructs into individual packages ([#552](https://github.com/functionless/functionless/issues/552)) ([01a2c9f](https://github.com/functionless/functionless/commit/01a2c9ff714e811f679ab25d9d62722e535eaf6b)) 15 | 16 | ### BREAKING CHANGES 17 | 18 | - @functionless/aws-constructs package has been refactored into many service-specific packages. 19 | -------------------------------------------------------------------------------- /packages/@functionless/error-code/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/error-code 2 | -------------------------------------------------------------------------------- /packages/@functionless/error-code/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/error-code", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "docs", 8 | "lib" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc", 12 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "devDependencies": { 17 | "@types/node": "^16", 18 | "functionless-build-utils": "*", 19 | "typedoc": "^0.23.16", 20 | "typedoc-plugin-markdown": "^3", 21 | "typescript": "^4.8.3" 22 | }, 23 | "publishConfig": { 24 | "access": "public" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/@functionless/error-code/src/error-code.ts: -------------------------------------------------------------------------------- 1 | import { ErrorType } from "./error-type"; 2 | 3 | export interface ErrorCode { 4 | /** 5 | * Error code, a unique number between 10000 and 99999. 6 | * 7 | * New error codes should be sequential. 8 | */ 9 | readonly code: number; 10 | /** 11 | * The type of the error, determine how the error is displayed in the language service and on the website. 12 | */ 13 | readonly type: ErrorType; 14 | /** 15 | * Title of the error which will appear on `https://functionless.org/docs/error-codes` and act as the deep link. 16 | * (https://functionless.org/docs/error-codes#title-with-dashes) 17 | */ 18 | readonly title: string; 19 | } 20 | -------------------------------------------------------------------------------- /packages/@functionless/error-code/src/error-type.ts: -------------------------------------------------------------------------------- 1 | export enum ErrorType { 2 | "ERROR" = "ERROR", 3 | "WARN" = "WARN", 4 | "INFO" = "INFO", 5 | "DEPRECATED" = "DEPRECATED", 6 | } 7 | -------------------------------------------------------------------------------- /packages/@functionless/error-code/src/format-error.ts: -------------------------------------------------------------------------------- 1 | import { ErrorCode } from "./error-code"; 2 | 3 | const BASE_URL = process.env.FUNCTIONLESS_LOCAL 4 | ? `http://localhost:3000` 5 | : `https://functionless.org`; 6 | 7 | /** 8 | * Formats an error message consistently across Functionless. 9 | * 10 | * Includes a deep link url to functionless.org's error code page. 11 | * 12 | * ``` 13 | * [messageText | code.MessageText] 14 | * 15 | * http://functionless.org/docs/error-codes/#[Anchor from Message Text] 16 | * ``` 17 | */ 18 | export const formatErrorMessage = (code: ErrorCode, messageText?: string) => `${ 19 | messageText ?? code.title 20 | } 21 | 22 | ${formatErrorUrl(code)}`; 23 | 24 | /** 25 | * Deep link to functionless.org's error code page. 26 | * 27 | * `http://functionless.org/docs/error-codes/#[Anchor from Message Text]` 28 | */ 29 | export const formatErrorUrl = (code: ErrorCode) => 30 | `${BASE_URL}/docs/error-codes#${code.title 31 | .toLowerCase() 32 | .replace(/\s/g, "-")}`; 33 | -------------------------------------------------------------------------------- /packages/@functionless/error-code/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./error-code"; 2 | export * from "./error-codes"; 3 | export * from "./error-type"; 4 | export * from "./format-error"; 5 | export * from "./synth-error"; 6 | -------------------------------------------------------------------------------- /packages/@functionless/error-code/src/synth-error.ts: -------------------------------------------------------------------------------- 1 | import { ErrorCode } from "./error-code"; 2 | import { formatErrorMessage } from "./format-error"; 3 | 4 | /** 5 | * Error to throw during synth failures 6 | */ 7 | export class SynthError extends Error { 8 | constructor(readonly code: ErrorCode, message?: string) { 9 | super(formatErrorMessage(code, message)); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/@functionless/error-code/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "rootDir": "src", 5 | "outDir": "lib", 6 | "declaration": true, 7 | "inlineSourceMap": true 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/@functionless/jest/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/jest 2 | -------------------------------------------------------------------------------- /packages/@functionless/jest/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/jest", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc" 12 | }, 13 | "dependencies": { 14 | "@functionless/ast-reflection": "^0.3.1", 15 | "@functionless/swc-config": "^0.29.0", 16 | "@swc/jest": "^0.2.23" 17 | }, 18 | "devDependencies": { 19 | "functionless-build-utils": "*", 20 | "typescript": "^4.8.3" 21 | }, 22 | "publishConfig": { 23 | "access": "public" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /packages/@functionless/jest/src/index.ts: -------------------------------------------------------------------------------- 1 | const swcJest = require("@swc/jest"); 2 | import { config } from "@functionless/swc-config"; 3 | 4 | function createTransformer() { 5 | return swcJest.createTransformer(config); 6 | } 7 | 8 | module.exports = { createTransformer }; 9 | -------------------------------------------------------------------------------- /packages/@functionless/jest/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../swc-config" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /packages/@functionless/register/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/register 2 | -------------------------------------------------------------------------------- /packages/@functionless/register/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/register", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.js", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc" 12 | }, 13 | "dependencies": { 14 | "@functionless/ast-reflection": "^0.3.1", 15 | "@functionless/swc-config": "^0.29.0", 16 | "@swc/register": "^0.1.10" 17 | }, 18 | "peerDependencies": { 19 | "@swc/core": "~1.2.245" 20 | }, 21 | "devDependencies": { 22 | "functionless-build-utils": "*", 23 | "typescript": "^4.8.3" 24 | }, 25 | "publishConfig": { 26 | "access": "public" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/@functionless/register/src/index.ts: -------------------------------------------------------------------------------- 1 | import register from "@swc/register/lib/node"; 2 | import { config } from "@functionless/swc-config"; 3 | import path from "path"; 4 | 5 | function tryResolve(mod: string) { 6 | try { 7 | const index = require.resolve(mod); 8 | return path.dirname(index); 9 | } catch { 10 | return undefined; 11 | } 12 | } 13 | 14 | const awsConstructs = tryResolve("@functionless/aws-sqs-constructs"); 15 | const flExp = tryResolve("@functionless/cli"); 16 | const src = path.resolve("src"); 17 | 18 | const prefixes = [awsConstructs, flExp, src].filter( 19 | (s): s is Exclude => s !== undefined 20 | ); 21 | 22 | register({ 23 | ...(config as any), 24 | ignore: [ 25 | (file) => { 26 | // console.log(file); 27 | if (prefixes.find((p) => file.startsWith(p)) !== undefined) { 28 | return false; 29 | } else { 30 | return true; 31 | } 32 | }, 33 | ], 34 | }); 35 | -------------------------------------------------------------------------------- /packages/@functionless/register/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../swc-config" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /packages/@functionless/serde/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.29.0](https://github.com/functionless/functionless/compare/v0.28.5...v0.29.0) (2022-10-18) 7 | 8 | **Note:** Version bump only for package @functionless/serde 9 | 10 | # [0.28.0](https://github.com/functionless/functionless/compare/v0.27.4...v0.28.0) (2022-10-14) 11 | 12 | ### chore 13 | 14 | - refactor aws-constructs into individual packages ([#552](https://github.com/functionless/functionless/issues/552)) ([01a2c9f](https://github.com/functionless/functionless/commit/01a2c9ff714e811f679ab25d9d62722e535eaf6b)) 15 | 16 | ### BREAKING CHANGES 17 | 18 | - @functionless/aws-constructs package has been refactored into many service-specific packages. 19 | -------------------------------------------------------------------------------- /packages/@functionless/serde/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/serde 2 | -------------------------------------------------------------------------------- /packages/@functionless/serde/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/serde", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc", 12 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "devDependencies": { 17 | "functionless-build-utils": "*", 18 | "typescript": "^4.8.3" 19 | }, 20 | "publishConfig": { 21 | "access": "public" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/@functionless/serde/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./serializer"; 2 | -------------------------------------------------------------------------------- /packages/@functionless/serde/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/@functionless/serialize-closure/.gitignore: -------------------------------------------------------------------------------- 1 | /test/.test -------------------------------------------------------------------------------- /packages/@functionless/serialize-closure/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.29.0](https://github.com/functionless/functionless/compare/v0.28.5...v0.29.0) (2022-10-18) 7 | 8 | **Note:** Version bump only for package @functionless/serialize-closure 9 | 10 | ## [0.28.4](https://github.com/functionless/functionless/compare/v0.28.3...v0.28.4) (2022-10-17) 11 | 12 | **Note:** Version bump only for package @functionless/serialize-closure 13 | 14 | # [0.28.0](https://github.com/functionless/functionless/compare/v0.27.4...v0.28.0) (2022-10-14) 15 | 16 | ### chore 17 | 18 | - refactor aws-constructs into individual packages ([#552](https://github.com/functionless/functionless/issues/552)) ([01a2c9f](https://github.com/functionless/functionless/commit/01a2c9ff714e811f679ab25d9d62722e535eaf6b)) 19 | 20 | ### BREAKING CHANGES 21 | 22 | - @functionless/aws-constructs package has been refactored into many service-specific packages. 23 | -------------------------------------------------------------------------------- /packages/@functionless/serialize-closure/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/serialize-closure 2 | -------------------------------------------------------------------------------- /packages/@functionless/serialize-closure/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/serialize-closure", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc", 12 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch", 15 | "test": "jest" 16 | }, 17 | "dependencies": { 18 | "@functionless/ast": "^0.29.0", 19 | "@functionless/util": "^0.29.0", 20 | "source-map": "^0.7.4" 21 | }, 22 | "devDependencies": { 23 | "@functionless/aws-lambda": "^0.29.0", 24 | "@functionless/jest": "^0.29.0", 25 | "@types/jest": "^29.0.3", 26 | "@types/node": "^16", 27 | "functionless-build-utils": "*", 28 | "jest": "^29.0.3", 29 | "typescript": "^4.8.3" 30 | }, 31 | "publishConfig": { 32 | "access": "public" 33 | }, 34 | "jest": { 35 | "transform": { 36 | "^.+\\.(t|j)sx?$": [ 37 | "@functionless/jest", 38 | {} 39 | ] 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /packages/@functionless/serialize-closure/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./serialize"; 2 | -------------------------------------------------------------------------------- /packages/@functionless/serialize-closure/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "resolveJsonModule": true, 8 | "rootDir": "src" 9 | }, 10 | "include": ["src", "src/globals.json"], 11 | "exclude": ["lib", "test", "node_modules"], 12 | "references": [ 13 | { 14 | "path": "../../functionless-build-utils" 15 | }, 16 | { 17 | "path": "../ast" 18 | }, 19 | { 20 | "path": "../aws-lambda" 21 | }, 22 | { 23 | "path": "../jest" 24 | }, 25 | { 26 | "path": "../util" 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /packages/@functionless/swc-config/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/swc-config 2 | -------------------------------------------------------------------------------- /packages/@functionless/swc-config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/swc-config", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc" 12 | }, 13 | "devDependencies": { 14 | "functionless-build-utils": "*", 15 | "typescript": "^4.8.3" 16 | }, 17 | "publishConfig": { 18 | "access": "public" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/@functionless/swc-config/src/index.ts: -------------------------------------------------------------------------------- 1 | export const config = { 2 | jsc: { 3 | parser: { 4 | syntax: "typescript", 5 | dynamicImport: false, 6 | decorators: false, 7 | hidden: { 8 | jest: true, 9 | }, 10 | }, 11 | transform: undefined, 12 | target: "es2022", 13 | loose: false, 14 | externalHelpers: false, 15 | experimental: { 16 | plugins: [["@functionless/ast-reflection", {}]], 17 | }, 18 | }, 19 | minify: true, 20 | sourceMaps: true, 21 | module: { 22 | type: "commonjs", 23 | }, 24 | } as const; 25 | -------------------------------------------------------------------------------- /packages/@functionless/swc-config/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/@functionless/test/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/test 2 | -------------------------------------------------------------------------------- /packages/@functionless/test/schema.gql: -------------------------------------------------------------------------------- 1 | type Person { 2 | id: String! 3 | name: String! 4 | } 5 | 6 | type ProcessedPerson { 7 | id: String! 8 | name: String! 9 | score: Int! 10 | } 11 | type Query { 12 | getPerson(id: String!): ProcessedPerson 13 | } 14 | input PersonInput { 15 | name: String! 16 | } 17 | type Mutation { 18 | deletePerson(id: ID!): Person 19 | addPerson(input: PersonInput!): Person 20 | addPerson2(input: PersonInput!): Person 21 | updateName(id: ID!, name: String!): Person 22 | } 23 | -------------------------------------------------------------------------------- /packages/@functionless/test/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./runtime"; 2 | export * from "./runtime-util"; 3 | export * from "./self-destructor"; 4 | export * from "./util"; 5 | -------------------------------------------------------------------------------- /packages/@functionless/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../asl" 17 | }, 18 | { 19 | "path": "../aws-appsync-constructs" 20 | }, 21 | { 22 | "path": "../aws-dynamodb-constructs" 23 | }, 24 | { 25 | "path": "../aws-events" 26 | }, 27 | { 28 | "path": "../aws-events-constructs" 29 | }, 30 | { 31 | "path": "../aws-lambda-constructs" 32 | }, 33 | { 34 | "path": "../aws-sdk" 35 | }, 36 | { 37 | "path": "../aws-stepfunctions-constructs" 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /packages/@functionless/util/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/util 2 | -------------------------------------------------------------------------------- /packages/@functionless/util/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/util", 3 | "version": "0.29.0", 4 | "main": "lib/index.js", 5 | "types": "lib/index.d.ts", 6 | "scripts": { 7 | "build:docs": "fls-typedoc", 8 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 9 | "typecheck": "tsc --noEmit", 10 | "dev": "tsc --watch" 11 | }, 12 | "devDependencies": { 13 | "@types/node": "^16", 14 | "functionless-build-utils": "*", 15 | "typescript": "^4.8.3" 16 | }, 17 | "files": [ 18 | "lib", 19 | "docs" 20 | ], 21 | "publishConfig": { 22 | "access": "public" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/@functionless/util/src/assert.ts: -------------------------------------------------------------------------------- 1 | export function assertNever(value: never): never { 2 | throw new Error( 3 | `reached unreachable branch with value: ${ 4 | typeof value === "string" ? value : JSON.stringify(value) 5 | }` 6 | ); 7 | } 8 | 9 | export function assertString(value: any, message?: string): string { 10 | if (typeof value !== "string") { 11 | throw new Error(message ?? `Expected string, got ${value}`); 12 | } 13 | return value; 14 | } 15 | 16 | export function assertNumber(value: any, message?: string): number { 17 | if (typeof value !== "number") { 18 | throw new Error(message ?? `Expected number, got ${value}`); 19 | } 20 | return value; 21 | } 22 | 23 | export function assertDefined( 24 | value?: T, 25 | message?: string 26 | ): Exclude { 27 | if (value === undefined) { 28 | throw new Error(message ?? "Expected value to be present"); 29 | } 30 | return value as Exclude; 31 | } 32 | -------------------------------------------------------------------------------- /packages/@functionless/util/src/environment-variable.ts: -------------------------------------------------------------------------------- 1 | export function getEnvironmentVariableName(resourceId: string): string { 2 | return resourceId.replaceAll(/[^A-Za-z_0-9]/g, "_"); 3 | } 4 | -------------------------------------------------------------------------------- /packages/@functionless/util/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./assert"; 2 | export * from "./environment-variable"; 3 | export * from "./memoize"; 4 | -------------------------------------------------------------------------------- /packages/@functionless/util/src/memoize.ts: -------------------------------------------------------------------------------- 1 | export function memoize any>(f: F): F { 2 | let t: any | undefined; 3 | let set = false; 4 | return ((input) => { 5 | if (!set) { 6 | t = f(input); 7 | } 8 | return t!; 9 | }) as F; 10 | } 11 | -------------------------------------------------------------------------------- /packages/@functionless/util/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/@functionless/validate/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.29.0](https://github.com/functionless/functionless/compare/v0.28.5...v0.29.0) (2022-10-18) 7 | 8 | **Note:** Version bump only for package @functionless/validate 9 | 10 | ## [0.28.4](https://github.com/functionless/functionless/compare/v0.28.3...v0.28.4) (2022-10-17) 11 | 12 | **Note:** Version bump only for package @functionless/validate 13 | 14 | # [0.28.0](https://github.com/functionless/functionless/compare/v0.27.4...v0.28.0) (2022-10-14) 15 | 16 | ### chore 17 | 18 | - refactor aws-constructs into individual packages ([#552](https://github.com/functionless/functionless/issues/552)) ([01a2c9f](https://github.com/functionless/functionless/commit/01a2c9ff714e811f679ab25d9d62722e535eaf6b)) 19 | 20 | ### BREAKING CHANGES 21 | 22 | - @functionless/aws-constructs package has been refactored into many service-specific packages. 23 | -------------------------------------------------------------------------------- /packages/@functionless/validate/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/validate 2 | -------------------------------------------------------------------------------- /packages/@functionless/validate/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./checker"; 2 | export * from "./compile"; 3 | export * from "./format-error"; 4 | export * from "./tsc"; 5 | export * from "./validate"; 6 | -------------------------------------------------------------------------------- /packages/@functionless/validate/test/error-code.test.ts: -------------------------------------------------------------------------------- 1 | import { ErrorCodes } from "@functionless/error-code"; 2 | 3 | test("error codes must be unique", () => { 4 | const errorCodes = new Set(); 5 | Object.values(ErrorCodes).forEach(({ code }) => { 6 | expect(errorCodes).not.toContain(code); 7 | errorCodes.add(code); 8 | }); 9 | }); 10 | 11 | test("error codes must be between 10000 and 99999", () => { 12 | Object.values(ErrorCodes).forEach(({ code }) => { 13 | expect(code).toBeGreaterThanOrEqual(10000); 14 | expect(code).toBeLessThanOrEqual(99999); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /packages/@functionless/validate/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../asl" 17 | }, 18 | { 19 | "path": "../aws-apigateway-constructs" 20 | }, 21 | { 22 | "path": "../aws-appsync-constructs" 23 | }, 24 | { 25 | "path": "../aws-dynamodb-constructs" 26 | }, 27 | { 28 | "path": "../aws-events" 29 | }, 30 | { 31 | "path": "../aws-events-constructs" 32 | }, 33 | { 34 | "path": "../aws-lambda-constructs" 35 | }, 36 | { 37 | "path": "../aws-sdk" 38 | }, 39 | { 40 | "path": "../aws-stepfunctions-constructs" 41 | }, 42 | { 43 | "path": "../error-code" 44 | } 45 | ] 46 | } 47 | -------------------------------------------------------------------------------- /packages/@functionless/vtl/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [0.29.0](https://github.com/functionless/functionless/compare/v0.28.5...v0.29.0) (2022-10-18) 7 | 8 | **Note:** Version bump only for package @functionless/vtl 9 | 10 | # [0.28.0](https://github.com/functionless/functionless/compare/v0.27.4...v0.28.0) (2022-10-14) 11 | 12 | ### chore 13 | 14 | - refactor aws-constructs into individual packages ([#552](https://github.com/functionless/functionless/issues/552)) ([01a2c9f](https://github.com/functionless/functionless/commit/01a2c9ff714e811f679ab25d9d62722e535eaf6b)) 15 | 16 | ### BREAKING CHANGES 17 | 18 | - @functionless/aws-constructs package has been refactored into many service-specific packages. 19 | -------------------------------------------------------------------------------- /packages/@functionless/vtl/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/vtl 2 | -------------------------------------------------------------------------------- /packages/@functionless/vtl/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@functionless/vtl", 3 | "version": "0.29.0", 4 | "main": "./lib/index.js", 5 | "types": "./lib/index.d.ts", 6 | "files": [ 7 | "lib", 8 | "docs" 9 | ], 10 | "scripts": { 11 | "build:docs": "fls-typedoc", 12 | "clean:build": "rm -rf lib tsconfig.tsbuildinfo", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "dependencies": { 17 | "@functionless/ast": "^0.29.0", 18 | "@functionless/util": "^0.29.0" 19 | }, 20 | "devDependencies": { 21 | "functionless-build-utils": "*", 22 | "typescript": "^4.8.3" 23 | }, 24 | "publishConfig": { 25 | "access": "public" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/@functionless/vtl/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./vtl"; 2 | -------------------------------------------------------------------------------- /packages/@functionless/vtl/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "test", "node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../functionless-build-utils" 14 | }, 15 | { 16 | "path": "../ast" 17 | }, 18 | { 19 | "path": "../util" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/@tests/aws-appsync-constructs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@tests/aws-appsync-constructs", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./lib/index.js", 6 | "types": "./lib/index.d.ts", 7 | "files": [ 8 | "lib", 9 | "docs" 10 | ], 11 | "scripts": { 12 | "test": "jest", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "devDependencies": { 17 | "@functionless/ast": "*", 18 | "@functionless/aws-appsync-constructs": "*", 19 | "@functionless/aws-appsync": "*", 20 | "@functionless/aws-dynamodb-constructs": "*", 21 | "@functionless/aws-lambda-constructs": "*", 22 | "@functionless/aws-stepfunctions-constructs": "*", 23 | "@functionless/error-code": "*", 24 | "@functionless/jest": "*", 25 | "@functionless/test": "*", 26 | "@functionless/vtl": "*", 27 | "@types/jest": "^29.0.3", 28 | "aws-cdk-lib": "2.44.0", 29 | "jest": "^29.0.3", 30 | "typescript": "^4.8.3" 31 | }, 32 | "jest": { 33 | "transform": { 34 | "^.+\\.(t|j)sx?$": [ 35 | "@functionless/jest", 36 | {} 37 | ] 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /packages/@tests/aws-appsync-constructs/test/schema.gql: -------------------------------------------------------------------------------- 1 | type Person { 2 | id: String! 3 | name: String! 4 | } 5 | 6 | type ProcessedPerson { 7 | id: String! 8 | name: String! 9 | score: Int! 10 | } 11 | type Query { 12 | getPerson(id: String!): ProcessedPerson 13 | } 14 | input PersonInput { 15 | name: String! 16 | } 17 | type Mutation { 18 | deletePerson(id: ID!): Person 19 | addPerson(input: PersonInput!): Person 20 | addPerson2(input: PersonInput!): Person 21 | updateName(id: ID!, name: String!): Person 22 | } 23 | -------------------------------------------------------------------------------- /packages/@tests/aws-appsync-constructs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "declaration": true, 5 | "inlineSourceMap": true, 6 | "rootDir": "test", 7 | "noEmit": true 8 | }, 9 | "include": ["src"], 10 | "exclude": ["node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../@functionless/ast" 14 | }, 15 | { 16 | "path": "../../@functionless/aws-appsync" 17 | }, 18 | { 19 | "path": "../../@functionless/aws-appsync-constructs" 20 | }, 21 | { 22 | "path": "../../@functionless/aws-dynamodb-constructs" 23 | }, 24 | { 25 | "path": "../../@functionless/aws-lambda-constructs" 26 | }, 27 | { 28 | "path": "../../@functionless/aws-stepfunctions-constructs" 29 | }, 30 | { 31 | "path": "../../@functionless/error-code" 32 | }, 33 | { 34 | "path": "../../@functionless/jest" 35 | }, 36 | { 37 | "path": "../../@functionless/test" 38 | }, 39 | { 40 | "path": "../../@functionless/vtl" 41 | } 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /packages/@tests/aws-dynamodb-constructs/test/table.runtime.gql: -------------------------------------------------------------------------------- 1 | schema { 2 | mutation: Mutation 3 | query: Query 4 | } 5 | 6 | type Person { 7 | pk: ID! 8 | id: ID! 9 | name: String! 10 | } 11 | 12 | type Query { 13 | getPerson(id: ID!): Person @aws_iam 14 | getPeopleAtomic(ids: [ID!]!): [Person!]! @aws_iam 15 | getPeopleBatch(ids: [ID!]!): [Person!]! @aws_iam 16 | } 17 | 18 | type Mutation { 19 | addPerson(name: String!): Person! @aws_iam 20 | addPeopleBatch(names: [String!]!): [Person!]! @aws_iam 21 | addPeopleAtomic(names: [String!]!): [Person!]! @aws_iam 22 | deletePerson(id: ID!): Person @aws_iam 23 | deletePeopleAtomic(ids: [ID!]!): [Person]! @aws_iam 24 | deletePeopleBatch(ids: [ID!]!): [Person]! @aws_iam 25 | } 26 | -------------------------------------------------------------------------------- /packages/@tests/aws-dynamodb-constructs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "declaration": true, 5 | "inlineSourceMap": true, 6 | "rootDir": "test", 7 | "noEmit": true 8 | }, 9 | "include": ["src"], 10 | "exclude": ["node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../@functionless/aws-appsync-constructs" 14 | }, 15 | { 16 | "path": "../../@functionless/aws-dynamodb-constructs" 17 | }, 18 | { 19 | "path": "../../@functionless/aws-lambda-constructs" 20 | }, 21 | { 22 | "path": "../../@functionless/aws-stepfunctions-constructs" 23 | }, 24 | { 25 | "path": "../../@functionless/jest" 26 | }, 27 | { 28 | "path": "../../@functionless/test" 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /packages/@tests/aws-events-constructs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@tests/aws-events-constructs", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./lib/index.js", 6 | "types": "./lib/index.d.ts", 7 | "files": [ 8 | "lib", 9 | "docs" 10 | ], 11 | "scripts": { 12 | "test": "jest", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "devDependencies": { 17 | "@functionless/aws-dynamodb-constructs": "*", 18 | "@functionless/aws-events": "*", 19 | "@functionless/aws-events-constructs": "*", 20 | "@functionless/aws-lambda-constructs": "*", 21 | "@functionless/aws-stepfunctions-constructs": "*", 22 | "@functionless/error-code": "*", 23 | "@functionless/jest": "*", 24 | "@functionless/test": "*", 25 | "@types/jest": "^29.0.3", 26 | "aws-cdk-lib": "2.44.0", 27 | "jest": "^29.0.3", 28 | "typescript": "^4.8.3" 29 | }, 30 | "jest": { 31 | "transform": { 32 | "^.+\\.(t|j)sx?$": [ 33 | "@functionless/jest", 34 | {} 35 | ] 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/@tests/aws-events-constructs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "declaration": true, 5 | "inlineSourceMap": true, 6 | "rootDir": "test", 7 | "noEmit": true 8 | }, 9 | "include": ["src"], 10 | "exclude": ["node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../@functionless/aws-dynamodb-constructs" 14 | }, 15 | { 16 | "path": "../../@functionless/aws-events" 17 | }, 18 | { 19 | "path": "../../@functionless/aws-events-constructs" 20 | }, 21 | { 22 | "path": "../../@functionless/aws-lambda-constructs" 23 | }, 24 | { 25 | "path": "../../@functionless/aws-stepfunctions-constructs" 26 | }, 27 | { 28 | "path": "../../@functionless/error-code" 29 | }, 30 | { 31 | "path": "../../@functionless/jest" 32 | }, 33 | { 34 | "path": "../../@functionless/test" 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /packages/@tests/aws-lambda-constructs/README.md: -------------------------------------------------------------------------------- 1 | # @functionless/aws-lambda-constructs 2 | -------------------------------------------------------------------------------- /packages/@tests/aws-secretsmanager-constructs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@tests/aws-secretsmanager-constructs", 3 | "private": true, 4 | "version": "0.0.0", 5 | "main": "./lib/index.js", 6 | "types": "./lib/index.d.ts", 7 | "files": [ 8 | "lib", 9 | "docs" 10 | ], 11 | "scripts": { 12 | "test": "jest", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "devDependencies": { 17 | "@functionless/aws-lambda-constructs": "*", 18 | "@functionless/aws-secretsmanager-constructs": "*", 19 | "@functionless/jest": "*", 20 | "@functionless/test": "*", 21 | "@types/jest": "^29.0.3", 22 | "aws-cdk-lib": "2.44.0", 23 | "jest": "^29.0.3", 24 | "typescript": "^4.8.3" 25 | }, 26 | "jest": { 27 | "transform": { 28 | "^.+\\.(t|j)sx?$": [ 29 | "@functionless/jest", 30 | {} 31 | ] 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/@tests/aws-secretsmanager-constructs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "declaration": true, 5 | "inlineSourceMap": true, 6 | "rootDir": "test", 7 | "noEmit": true 8 | }, 9 | "include": ["src"], 10 | "exclude": ["node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../@functionless/aws-lambda-constructs" 14 | }, 15 | { 16 | "path": "../../@functionless/aws-secretsmanager-constructs" 17 | }, 18 | { 19 | "path": "../../@functionless/jest" 20 | }, 21 | { 22 | "path": "../../@functionless/test" 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /packages/@tests/aws-sqs-constructs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@tests/aws-sqs-constructs", 3 | "private": true, 4 | "version": "0.0.0", 5 | "main": "./lib/index.js", 6 | "types": "./lib/index.d.ts", 7 | "files": [ 8 | "lib", 9 | "docs" 10 | ], 11 | "scripts": { 12 | "test": "jest", 13 | "typecheck": "tsc --noEmit", 14 | "dev": "tsc --watch" 15 | }, 16 | "devDependencies": { 17 | "@functionless/aws-dynamodb-constructs": "*", 18 | "@functionless/aws-events-constructs": "*", 19 | "@functionless/aws-events": "*", 20 | "@functionless/aws-lambda-constructs": "*", 21 | "@functionless/aws-sqs-constructs": "*", 22 | "@functionless/jest": "*", 23 | "@functionless/serde": "*", 24 | "@functionless/test": "*", 25 | "@types/jest": "^29.0.3", 26 | "aws-cdk-lib": "2.44.0", 27 | "jest": "^29.0.3", 28 | "typescript": "^4.8.3" 29 | }, 30 | "jest": { 31 | "transform": { 32 | "^.+\\.(t|j)sx?$": [ 33 | "@functionless/jest", 34 | {} 35 | ] 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/@tests/aws-sqs-constructs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "declaration": true, 5 | "inlineSourceMap": true, 6 | "rootDir": "test", 7 | "noEmit": true 8 | }, 9 | "include": ["src"], 10 | "exclude": ["node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../@functionless/aws-dynamodb-constructs" 14 | }, 15 | { 16 | "path": "../../@functionless/aws-events" 17 | }, 18 | { 19 | "path": "../../@functionless/aws-events-constructs" 20 | }, 21 | { 22 | "path": "../../@functionless/aws-lambda-constructs" 23 | }, 24 | { 25 | "path": "../../@functionless/aws-sqs-constructs" 26 | }, 27 | { 28 | "path": "../../@functionless/jest" 29 | }, 30 | { 31 | "path": "../../@functionless/serde" 32 | }, 33 | { 34 | "path": "../../@functionless/test" 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /packages/@tests/cleanup/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "declaration": true, 5 | "inlineSourceMap": true, 6 | "rootDir": "test", 7 | "noEmit": true 8 | }, 9 | "include": ["src"], 10 | "exclude": ["node_modules"], 11 | "references": [ 12 | { 13 | "path": "../../@functionless/aws-lambda-constructs" 14 | }, 15 | { 16 | "path": "../../@functionless/aws-sdk" 17 | }, 18 | { 19 | "path": "../../@functionless/aws-stepfunctions-constructs" 20 | }, 21 | { 22 | "path": "../../@functionless/jest" 23 | }, 24 | { 25 | "path": "../../@functionless/test" 26 | } 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /packages/create-functionless/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ 3 | .test/ -------------------------------------------------------------------------------- /packages/create-functionless/README.md: -------------------------------------------------------------------------------- 1 | # create-functionless 2 | -------------------------------------------------------------------------------- /packages/create-functionless/bin/test-devx.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ue pipefail 4 | 5 | TEST_PROJECT="test-devx" 6 | 7 | # Use the create script to create a new project 8 | create-functionless ${TEST_PROJECT} -t devx-experimental 9 | cd ${TEST_PROJECT} 10 | 11 | # Verify new project can synth 12 | npm run synth -------------------------------------------------------------------------------- /packages/create-functionless/bin/test-npm.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ue pipefail 4 | 5 | TEST_PROJECT="test-npm" 6 | 7 | # Use the create script to create a new project 8 | create-functionless ${TEST_PROJECT} 9 | cd ${TEST_PROJECT} 10 | 11 | # Verify new project can synth 12 | npm run synth -------------------------------------------------------------------------------- /packages/create-functionless/bin/test-yarn.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ue pipefail 4 | 5 | TEST_PROJECT="test-project" 6 | 7 | # Use the create script to create a new project 8 | yarn create --offline functionless ${TEST_PROJECT} 9 | cd ${TEST_PROJECT} 10 | 11 | # Verify new project can synth 12 | yarn synth -------------------------------------------------------------------------------- /packages/create-functionless/bin/test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ue pipefail 4 | 5 | rm -rf .test 6 | 7 | CWD=$(pwd) 8 | 9 | PACKAGE_NAME="create-functionless" 10 | PACKED_NAME="${PACKAGE_NAME}.tgz" 11 | 12 | mkdir -p .test 13 | 14 | function test_case() { 15 | 16 | cd ${CWD}/.test 17 | ${CWD}/bin/$1.sh 18 | } 19 | 20 | function clean_up() { 21 | cd ${CWD} 22 | rm -rf .test 23 | } 24 | 25 | trap clean_up EXIT 26 | 27 | test_case test-npm 28 | 29 | test_case test-yarn 30 | 31 | test_case test-devx 32 | 33 | rm -rf .test -------------------------------------------------------------------------------- /packages/create-functionless/templates/base/.gitignore.template: -------------------------------------------------------------------------------- 1 | .fl/ 2 | .swc/ 3 | cdk.out/ 4 | node_modules/ 5 | lib/ -------------------------------------------------------------------------------- /packages/create-functionless/templates/base/cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "node -r '@functionless/register' ./src/app.ts" 3 | } 4 | -------------------------------------------------------------------------------- /packages/create-functionless/templates/base/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": [ 3 | "@swc/core@~1.2", 4 | "@aws-cdk/aws-appsync-alpha", 5 | "@functionless/ast-reflection", 6 | "@functionless/language-service", 7 | "@types/jest", 8 | "@types/node", 9 | "aws-cdk", 10 | "aws-cdk-lib", 11 | "aws-sdk", 12 | "constructs", 13 | "esbuild", 14 | "functionless", 15 | "jest", 16 | "typesafe-dynamodb", 17 | "typescript" 18 | ], 19 | "files": [ 20 | "package.json.template", 21 | "cdk.json", 22 | "tsconfig.json", 23 | ".gitignore.template" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /packages/create-functionless/templates/base/package.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{projectName}}", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "deploy": "cdk deploy", 7 | "synth": "cdk synth", 8 | "test": "jest", 9 | "validate": "functionless", 10 | "watch": "tsc --build --watch" 11 | }, 12 | "devDependencies": {}, 13 | "jest": { 14 | "transform": { 15 | "^.+\\.(t|j)sx?$": [ 16 | "functionless/jest", 17 | {} 18 | ] 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/create-functionless/templates/base/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2019", 4 | "module": "commonjs", 5 | "esModuleInterop": true, 6 | "forceConsistentCasingInFileNames": true, 7 | "strict": true, 8 | "skipLibCheck": true, 9 | "outDir": "lib", 10 | "plugins": [ 11 | { 12 | "name": "@functionless/language-service" 13 | } 14 | ] 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/create-functionless/templates/default/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "extend": "base", 3 | "files": ["src/app.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /packages/create-functionless/templates/default/src/app.ts: -------------------------------------------------------------------------------- 1 | import { App, Stack } from "aws-cdk-lib"; 2 | import { Function } from "@functionless/aws-lambda-constructs"; 3 | import { StepFunction } from "@functionless/aws-stepfunctions-constructs"; 4 | 5 | const app = new App(); 6 | 7 | const stack = new Stack(app, "MyStack"); 8 | 9 | const sayFunction = new Function( 10 | stack, 11 | "SayFunction", 12 | async (event: { message: string }) => { 13 | console.log(event.message); 14 | return; 15 | } 16 | ); 17 | 18 | new StepFunction(stack, "Workflow", async (event: { name: string }) => { 19 | await sayFunction({ message: `Hello ${event.name}` }); 20 | }); 21 | -------------------------------------------------------------------------------- /packages/create-functionless/templates/devx-experimental/cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "fl synth" 3 | } 4 | -------------------------------------------------------------------------------- /packages/create-functionless/templates/devx-experimental/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "extend": "base", 3 | "devDependencies": ["@types/uuid", "functionless", "uuid"], 4 | "files": [ 5 | "cdk.json", 6 | "src/create-todo.ts", 7 | "src/delete-todo.ts", 8 | "src/list-todos.ts", 9 | "src/table.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /packages/create-functionless/templates/devx-experimental/src/create-todo.ts: -------------------------------------------------------------------------------- 1 | import { LambdaFunction } from "@functionless/aws-lambda"; 2 | import * as uuid from "uuid"; 3 | 4 | import { AppTable } from "./table"; 5 | 6 | export default LambdaFunction(async (event: { message: string }) => { 7 | const id = uuid.v4(); 8 | await AppTable.put({ 9 | Item: { 10 | pk: "todo", 11 | sk: id, 12 | id: id, 13 | message: event.message, 14 | type: "todo", 15 | }, 16 | }); 17 | 18 | return "CREATED"; 19 | }); 20 | -------------------------------------------------------------------------------- /packages/create-functionless/templates/devx-experimental/src/delete-todo.ts: -------------------------------------------------------------------------------- 1 | import { LambdaFunction } from "@functionless/aws-lambda"; 2 | import { AppTable } from "./table"; 3 | 4 | export default LambdaFunction(async (event: { id: string }) => { 5 | await AppTable.delete({ 6 | Key: { 7 | pk: "todo", 8 | sk: event.id, 9 | }, 10 | }); 11 | 12 | return "DELETED"; 13 | }); 14 | -------------------------------------------------------------------------------- /packages/create-functionless/templates/devx-experimental/src/list-todos.ts: -------------------------------------------------------------------------------- 1 | import { LambdaFunction } from "@functionless/aws-lambda"; 2 | 3 | import { AppTable } from "./table"; 4 | 5 | export default LambdaFunction(async (event: {}) => { 6 | const response = await AppTable.query({ 7 | KeyConditionExpression: "#pk = :pk", 8 | ExpressionAttributeNames: { 9 | "#pk": "pk", 10 | }, 11 | ExpressionAttributeValues: { 12 | ":pk": "todo", 13 | }, 14 | }); 15 | 16 | return (response.Items ?? []).map((item) => { 17 | return { 18 | id: item.id, 19 | message: item.message, 20 | }; 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /packages/create-functionless/templates/devx-experimental/src/table.ts: -------------------------------------------------------------------------------- 1 | import { Table } from "@functionless/aws-dynamodb"; 2 | 3 | interface TableItem { 4 | pk: T; 5 | sk: string; 6 | type: T; 7 | id: string; 8 | } 9 | 10 | interface Todo extends TableItem<"todo"> { 11 | message: string; 12 | } 13 | 14 | export const AppTable = Table({ 15 | partitionKey: { 16 | name: "pk", 17 | type: "S", 18 | }, 19 | sortKey: { 20 | name: "sk", 21 | type: "S", 22 | }, 23 | }); 24 | 25 | export default AppTable; 26 | -------------------------------------------------------------------------------- /packages/create-functionless/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig-base", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src", 6 | "types": ["node"] 7 | }, 8 | "include": ["src/**/*.ts", "src/**/*.json"], 9 | "exclude": [], 10 | "references": [ 11 | { 12 | "path": "../functionless" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /packages/functionless-build-utils/bin/fls-typedoc.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | require("../lib/compile-typedoc"); 4 | -------------------------------------------------------------------------------- /packages/functionless-build-utils/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "functionless-build-utils", 3 | "description": "Private utility scripts for use within the functionless repository", 4 | "private": true, 5 | "version": "0.0.0", 6 | "bin": { 7 | "fls-typedoc": "./bin/fls-typedoc.js" 8 | }, 9 | "dependencies": { 10 | "typedoc": "^0.23.16", 11 | "docusaurus-plugin-typedoc": "^0.17.4" 12 | }, 13 | "devDependencies": { 14 | "typescript": "^4.8.3" 15 | }, 16 | "files": [ 17 | "bin", 18 | "lib" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /packages/functionless-build-utils/src/compile-typedoc.ts: -------------------------------------------------------------------------------- 1 | import path from "path"; 2 | import fs from "fs/promises"; 3 | 4 | const pluginDocusaurus = require("docusaurus-plugin-typedoc").default; 5 | 6 | const rootDir = process.cwd(); 7 | 8 | async function main() { 9 | const pkgJson = JSON.parse( 10 | (await fs.readFile(path.join(rootDir, "package.json"))).toString("utf-8") 11 | ); 12 | 13 | const plugin = pluginDocusaurus( 14 | { 15 | siteDir: rootDir, 16 | }, 17 | { 18 | id: "load-content", 19 | entryPointStrategy: "expand", 20 | entryPoints: [path.join(rootDir, "src", "index.ts")], 21 | sidebar: { 22 | fullNames: true, 23 | categoryLabel: pkgJson.name, 24 | }, 25 | logLevel: "Error", 26 | readme: "./README.md", 27 | tsconfig: "./tsconfig.json", 28 | } 29 | ); 30 | 31 | await plugin.loadContent(); 32 | } 33 | 34 | main().catch((err) => { 35 | console.error(err); 36 | process.exit(1); 37 | }); 38 | -------------------------------------------------------------------------------- /packages/functionless-build-utils/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig-base.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "declaration": true, 6 | "inlineSourceMap": true, 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"], 10 | "exclude": ["lib", "node_modules"] 11 | } 12 | -------------------------------------------------------------------------------- /scripts/localstack: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Installs and runs localstack 4 | 5 | # install LocalStack cli and awslocal 6 | pip install localstack pyOpenSSL awscli-local[ver1] --upgrade 7 | # install CDK Local 8 | npm install -g aws-cdk-local aws-cdk 9 | # Make sure to pull the latest version of the image 10 | docker pull localstack/localstack 11 | # Start LocalStack in the background 12 | localstack start -d 13 | # Wait 30 seconds for the LocalStack container to become ready before timing out 14 | echo "Waiting for LocalStack startup..." 15 | localstack wait -t 30 16 | echo "Startup complete" 17 | echo "Bootstrapping CDK..." 18 | # Bootstrap CDK 19 | cdklocal bootstrap aws://000000000000/us-east-1 -------------------------------------------------------------------------------- /scripts/util.mjs: -------------------------------------------------------------------------------- 1 | import prettier from "prettier"; 2 | import path from "path"; 3 | import fs from "fs/promises"; 4 | 5 | export async function ls(dir) { 6 | return (await fs.readdir(dir)).map((d) => path.join(dir, d)); 7 | } 8 | 9 | export async function readJsonFile(file) { 10 | try { 11 | return JSON.parse((await fs.readFile(file)).toString("utf-8")); 12 | } catch (err) { 13 | console.error("Failed to read JSON file", file, err); 14 | } 15 | } 16 | 17 | export async function writeJsonFile(file, obj) { 18 | await fs.writeFile( 19 | file, 20 | prettier.format(JSON.stringify(obj, null, 2), { 21 | parser: "json", 22 | }) 23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /tsconfig-base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "lib", 4 | "baseUrl": ".", 5 | "composite": true, 6 | "alwaysStrict": true, 7 | "declaration": true, 8 | "esModuleInterop": true, 9 | "experimentalDecorators": true, 10 | "inlineSourceMap": true, 11 | "inlineSources": true, 12 | "lib": ["dom", "ES2022"], 13 | "module": "CommonJS", 14 | "noEmitOnError": false, 15 | "noFallthroughCasesInSwitch": true, 16 | "noImplicitAny": true, 17 | "noImplicitReturns": true, 18 | "noImplicitThis": true, 19 | "noUnusedLocals": true, 20 | "noUnusedParameters": true, 21 | "resolveJsonModule": true, 22 | "strict": true, 23 | "strictNullChecks": true, 24 | "strictPropertyInitialization": true, 25 | "stripInternal": true, 26 | "target": "ES2019", 27 | "declarationMap": true, 28 | "noUncheckedIndexedAccess": true, 29 | "skipLibCheck": true 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /turbo.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://turborepo.org/schema.json", 3 | "pipeline": { 4 | "dev": { 5 | "cache": false 6 | }, 7 | "typecheck": { 8 | "dependsOn": ["^build"] 9 | }, 10 | "lint": {}, 11 | "clean:build": { 12 | "cache": false 13 | }, 14 | "build": { 15 | "dependsOn": ["^build"], 16 | "outputs": ["lib/**"] 17 | }, 18 | "build:docs": { 19 | "dependsOn": ["^build"], 20 | "outputs": ["docs/**"] 21 | }, 22 | "build:website": { 23 | "dependsOn": ["^build:docs"], 24 | "outputs": ["build/**"] 25 | }, 26 | "test": { 27 | "dependsOn": ["^build"] 28 | }, 29 | "test:smoke": { 30 | "dependsOn": ["^build"] 31 | } 32 | } 33 | } 34 | --------------------------------------------------------------------------------