@webbdays/tailcall 0.0.1-security → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of @webbdays/tailcall might be problematic. Click here for more details.

package/README.md CHANGED
@@ -1,5 +1,134 @@
1
- # Security holding package
1
+ [![Tailcall Logo](https://raw.githubusercontent.com/tailcallhq/tailcall/main/assets/logo_main.svg)](https://tailcall.run)
2
2
 
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
3
+ Tailcall is an open-source solution for building [high-performance] GraphQL backends.
4
4
 
5
- Please refer to www.npmjs.com/advisories?search=%40webbdays%2Ftailcall for more information.
5
+ Please support us by giving the repository a star
6
+ ![image](https://raw.githubusercontent.com/tailcallhq/tailcall/main/assets/star-our-repo.gif)
7
+
8
+ [high-performance]: https://github.com/tailcallhq/graphql-benchmarks
9
+
10
+ [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=for-the-badge&logo=x&color=black&labelColor=black)](https://twitter.com/intent/tweet?text=%40tailcallhq%20is%20building%20a%20high-performance%20API%20Orchestration%20solution%20over%20%23GraphQL.%0A%0ACheck%20it%20out%20at%3A%0A%F0%9F%94%97%20https%3A%2F%2Ftailcall.run%20%0A%F0%9F%94%97%20https%3A%2F%2Fgithub.com%2Ftailcallhq%2Ftailcall%20%0A%0A&hashtags=api,http,rest,grpc,graphql,nocode,microservice,opensource)
11
+ [![Discord](https://img.shields.io/discord/1044859667798568962?style=for-the-badge&cacheSeconds=120&logo=discord)](https://discord.gg/kRZBPpkgwq)
12
+
13
+ [![Open Bounties](https://img.shields.io/endpoint?url=https%3A%2F%2Fconsole.algora.io%2Fapi%2Fshields%2Ftailcallhq%2Fbounties%3Fstatus%3Dopen&style=for-the-badge)](https://console.algora.io/org/tailcallhq/bounties?status=open)
14
+ [![Rewarded Bounties](https://img.shields.io/endpoint?url=https%3A%2F%2Fconsole.algora.io%2Fapi%2Fshields%2Ftailcallhq%2Fbounties%3Fstatus%3Dcompleted&style=for-the-badge)](https://console.algora.io/org/tailcallhq/bounties?status=completed)
15
+ [![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/tailcallhq/tailcall/ci.yml?style=for-the-badge)](https://github.com/tailcallhq/tailcall/actions)
16
+ ![GitHub release (by tag)](https://img.shields.io/github/downloads/tailcallhq/tailcall/total?style=for-the-badge)
17
+ [![Discord](https://img.shields.io/discord/1044859667798568962?style=for-the-badge&cacheSeconds=60)](https://discord.gg/kRZBPpkgwq)
18
+ [![Codecov](https://img.shields.io/codecov/c/github/tailcallhq/tailcall?style=for-the-badge)](https://app.codecov.io/gh/tailcallhq/tailcall)
19
+
20
+ ## Installation
21
+
22
+ ### NPM
23
+
24
+ ```bash
25
+ npm i -g @tailcallhq/tailcall
26
+ ```
27
+
28
+ ### Yarn
29
+
30
+ ```bash
31
+ yarn global add @tailcallhq/tailcall
32
+ ```
33
+
34
+ ### Home Brew
35
+
36
+ ```bash
37
+ brew tap tailcallhq/tailcall
38
+ brew install tailcall
39
+ ```
40
+
41
+ ### Curl
42
+
43
+ ```bash
44
+ curl -sSL https://raw.githubusercontent.com/tailcallhq/tailcall/master/install.sh | bash
45
+ ```
46
+
47
+ ### Docker
48
+
49
+ ```bash
50
+ docker pull ghcr.io/tailcallhq/tailcall/tc-server
51
+ docker run -p 8080:8080 -p 8081:8081 ghcr.io/tailcallhq/tailcall/tc-server
52
+ ```
53
+
54
+ ## Get Started
55
+
56
+ The below file is a standard `.graphQL` file, with a few additions such as `@server` and `@http` directives. So, basically, we specify the GraphQL schema and how to resolve that GraphQL schema in the same file, without having to write any code!
57
+
58
+ ```graphql
59
+ schema
60
+ @server(port: 8000, hostname: "0.0.0.0")
61
+ @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: 42) {
62
+ query: Query
63
+ }
64
+
65
+ type Query {
66
+ posts: [Post] @http(path: "/posts")
67
+ user(id: Int!): User @http(path: "/users/{{.args.id}}")
68
+ }
69
+
70
+ type User {
71
+ id: Int!
72
+ name: String!
73
+ username: String!
74
+ email: String!
75
+ phone: String
76
+ website: String
77
+ }
78
+
79
+ type Post {
80
+ id: Int!
81
+ userId: Int!
82
+ title: String!
83
+ body: String!
84
+ user: User @http(path: "/users/{{.value.userId}}")
85
+ }
86
+ ```
87
+
88
+ Now, run the following command to start the server with the full path to the jsonplaceholder.graphql file that you created above.
89
+
90
+ ```bash
91
+ tailcall start ./jsonplaceholder.graphql
92
+ ```
93
+
94
+ Head out to [docs] to learn about other powerful tailcall features.
95
+
96
+ [docs]: https://tailcall.run/docs
97
+
98
+ ### Benchmarks
99
+
100
+ Throughput comparison of various GraphQL solutions for a N + 1 query:
101
+
102
+ ```graphql
103
+ query {
104
+ posts {
105
+ title
106
+ body
107
+ user {
108
+ name
109
+ }
110
+ }
111
+ }
112
+ ```
113
+
114
+ ![Throughput Histogram](https://raw.githubusercontent.com/tailcallhq/graphql-benchmarks/main/assets/req_sec_histogram1.png)
115
+
116
+ Check out detailed benchmarks on our benchmarking [repository](https://github.com/tailcallhq/graphql-benchmarks).
117
+
118
+ ### Contributing
119
+
120
+ Your contributions are invaluable! Kindly go through our [contribution guidelines] if you are a first time contributor.
121
+
122
+ [contribution guidelines]: https://tailcall.run/docs/contribution-guidelines
123
+
124
+ ### Support Us
125
+
126
+ ⭐️ Give us a star.
127
+
128
+ 👀 Watch us for updates.
129
+
130
+ ### License
131
+
132
+ This initiative is protected under the Apache 2.0 License.
133
+
134
+ <img referrerpolicy="no-referrer-when-downgrade" src="https://static.scarf.sh/a.png?x-pxid=82cc2ee2-ff41-4844-9ae6-c9face103e81" />
@@ -0,0 +1,80 @@
1
+ build:
2
+ [
3
+ linux-x64-gnu,
4
+ linux-x64-musl,
5
+ linux-arm64-gnu,
6
+ linux-arm64-musl,
7
+ linux-ia32-gnu,
8
+ darwin-arm64,
9
+ darwin-x64,
10
+ win32-x64-msvc,
11
+ win32-arm64-msvc,
12
+ win32-ia32-msvc,
13
+ ]
14
+ include:
15
+ - build: linux-x64-gnu
16
+ os: ubuntu-latest
17
+ rust: stable
18
+ target: x86_64-unknown-linux-gnu
19
+ libc: glibc
20
+
21
+ - build: linux-x64-musl
22
+ os: ubuntu-latest
23
+ rust: stable
24
+ target: x86_64-unknown-linux-musl
25
+ libc: musl
26
+ cross: true
27
+
28
+ - build: linux-arm64-gnu
29
+ os: ubuntu-latest
30
+ rust: stable
31
+ target: aarch64-unknown-linux-gnu
32
+ libc: glibc
33
+ cross: true
34
+
35
+ - build: linux-arm64-musl
36
+ os: ubuntu-latest
37
+ rust: stable
38
+ target: aarch64-unknown-linux-musl
39
+ libc: musl
40
+ cross: true
41
+
42
+ - build: linux-ia32-gnu
43
+ os: ubuntu-latest
44
+ rust: stable
45
+ target: i686-unknown-linux-gnu
46
+ libc: glibc
47
+ cross: true
48
+
49
+ - build: darwin-arm64
50
+ os: macos-latest
51
+ rust: stable
52
+ target: aarch64-apple-darwin
53
+
54
+ - build: darwin-x64
55
+ os: macos-latest
56
+ rust: stable
57
+ target: x86_64-apple-darwin
58
+
59
+ - build: win32-x64-msvc
60
+ os: windows-latest
61
+ rust: stable
62
+ target: x86_64-pc-windows-msvc
63
+ libc: msvc
64
+ ext: ".exe"
65
+
66
+ - build: win32-arm64-msvc
67
+ os: windows-latest
68
+ rust: stable
69
+ target: aarch64-pc-windows-msvc
70
+ features: --no-default-features --features cli
71
+ libc: msvc
72
+ ext: ".exe"
73
+ test: false # TODO: tests are broken without default features
74
+
75
+ - build: win32-ia32-msvc
76
+ os: windows-latest
77
+ rust: stable
78
+ target: i686-pc-windows-msvc
79
+ libc: msvc
80
+ ext: ".exe"
package/package.json CHANGED
@@ -1,6 +1,42 @@
1
1
  {
2
+ "description": "A high-performance GraphQL proxy, optimized for cloud-native environments, covering edge, middle, and service layers.",
3
+ "license": "Apache-2.0",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/tailcallhq/tailcall"
7
+ },
8
+ "homepage": "https://tailcall.run/",
9
+ "keywords": [
10
+ "graphql",
11
+ "proxy",
12
+ "api-gateway",
13
+ "rust",
14
+ "http",
15
+ "grpc",
16
+ "bff",
17
+ "backend-for-frontend",
18
+ "microservices",
19
+ "high-performance",
20
+ "edge"
21
+ ],
2
22
  "name": "@webbdays/tailcall",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
6
- }
23
+ "type": "module",
24
+ "version": "0.0.30",
25
+ "scarfSettings": {
26
+ "defaultOptIn": true,
27
+ "allowTopLevel": true
28
+ },
29
+ "dependencies": {
30
+ "detect-libc": "^2.0.2",
31
+ "@scarf/scarf": "^1.3.0",
32
+ "yaml": "^2.3.3",
33
+ "axios": "^1.7.4"
34
+ },
35
+ "scripts": {
36
+ "postinstall": "node ./scripts/post-install.js",
37
+ "preinstall": "node ./scripts/pre-install.js"
38
+ },
39
+ "bin": {
40
+ "tailcall": "bin/tailcall"
41
+ }
42
+ }
@@ -0,0 +1,63 @@
1
+ const version = "0.0.30";
2
+ // @ts-check
3
+ import {familySync, GLIBC, MUSL} from "detect-libc"
4
+ import {exec} from "child_process"
5
+ import util from "util"
6
+ import get_matched_platform from "./utils.js"
7
+ import fs from "fs"
8
+ import axios from "axios"
9
+ import {resolve, dirname} from "path"
10
+ import {fileURLToPath} from "url"
11
+
12
+ const execa = util.promisify(exec)
13
+ const os = process.platform
14
+ const arch = process.arch
15
+ const libcFamily = familySync()
16
+
17
+ let libc = ""
18
+ if (os === "win32") {
19
+ libc = "msvc"
20
+ } else {
21
+ libc = libcFamily === GLIBC ? "gnu" : libcFamily === MUSL ? "musl" : ""
22
+ }
23
+
24
+ const matched_platform = get_matched_platform(os, arch, libc)
25
+ if (matched_platform != null) {
26
+ const targetPlatform = matched_platform
27
+
28
+ let targetPlatformExt = ""
29
+ if (Object.keys(targetPlatform).includes("ext")) {
30
+ targetPlatformExt = targetPlatform.get("ext")
31
+ }
32
+
33
+ const pkg_download_base_url = "https://github.com/tailcallhq/tailcall/releases/download/"
34
+ const specific_url = `v${version}/tailcall-${targetPlatform.get("target")}${targetPlatformExt}`
35
+ const full_url = pkg_download_base_url + specific_url
36
+
37
+ console.log(`Downloading Tailcall for ${targetPlatform.get("target")}${targetPlatformExt} ...`)
38
+
39
+ const output_path = `bin/tailcall-${targetPlatform.get("target")}${targetPlatformExt}`
40
+ download_binary(full_url, output_path)
41
+ }
42
+
43
+ async function download_binary(full_url, output_path) {
44
+ const file = fs.createWriteStream(output_path)
45
+ axios({
46
+ url: full_url,
47
+ method: "GET",
48
+ responseType: "stream",
49
+ }).then((response) => {
50
+ response.data.pipe(file)
51
+ file.on("finish", async () => {
52
+ const __dirname = dirname(fileURLToPath(import.meta.url))
53
+
54
+ const directoryPath = resolve(__dirname, "../")
55
+ const packageJsonString = fs.readFileSync(resolve(directoryPath, "./package.json"), "utf8")
56
+ const packageJson = JSON.parse(packageJsonString)
57
+ packageJson.bin = {tailcall: output_path}
58
+ fs.writeFileSync(resolve(directoryPath, "./package.json"), JSON.stringify(packageJson, null, 2), "utf8")
59
+
60
+ console.log("Tailcall binary downloaded successfully")
61
+ })
62
+ })
63
+ }
@@ -0,0 +1,23 @@
1
+ // @ts-check
2
+ import {familySync, GLIBC, MUSL} from "detect-libc"
3
+ import get_matched_platform from "./utils.js"
4
+
5
+ const os = process.platform
6
+ const arch = process.arch
7
+ const libcFamily = familySync()
8
+
9
+ let libc = ""
10
+ if (os === "win32") {
11
+ libc = "msvc"
12
+ } else {
13
+ libc = libcFamily === GLIBC ? "gnu" : libcFamily === MUSL ? "musl" : ""
14
+ }
15
+
16
+ const matched_platform = get_matched_platform(os, arch, libc)
17
+
18
+ if (matched_platform == null) {
19
+ const redColor = "\x1b[31m"
20
+ const resetColor = "\x1b[0m"
21
+ console.error(`${redColor} Tailcall does not support platform - ${os}, arch - ${arch}, libc - ${libc} ${resetColor}`)
22
+ process.exit(1)
23
+ }
@@ -0,0 +1,24 @@
1
+ import fs from "fs"
2
+ import {dirname, resolve} from "path"
3
+ import {fileURLToPath} from "url"
4
+ import YML from "yaml"
5
+
6
+ const __dirname = dirname(fileURLToPath(import.meta.url))
7
+
8
+ export default function get_matched_platform(os, arch, libc) {
9
+ const directoryPath = resolve(__dirname, "../")
10
+ const file = fs.readFileSync(resolve(directoryPath, "./build-matrix.yaml"), "utf8")
11
+ const build_matrix = YML.parse(file, {mapAsMap: true})
12
+
13
+ let found = null
14
+ build_matrix.get("include").forEach((platform) => {
15
+ const split = platform.get("build").split("-")
16
+ const platform_arch = split.at(1)
17
+ const platform_os = split.at(0)
18
+ const platform_libc = split.at(-1)
19
+ if (platform_arch == arch && platform_os == os && platform_libc == libc) {
20
+ found = platform
21
+ }
22
+ })
23
+ return found
24
+ }