Skip to content

Commit 5b601a9

Browse files
committed
.
1 parent ca53fd2 commit 5b601a9

File tree

79 files changed

+2201
-2201
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+2201
-2201
lines changed

.gitignore

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
# Dependency directories
2-
node_modules/
3-
4-
# TypeScript build output
5-
/dist/
6-
*.js
7-
*.js.map
8-
9-
# NPM package files
10-
npm-debug.log
11-
*.tgz
12-
13-
# Editor directories and files
14-
.vscode/
15-
.idea/
16-
*.suo
17-
*.ntvs*
18-
*.njsproj
19-
*.sln
20-
*.sw?
21-
22-
# OS generated files
23-
.DS_Store
1+
# Dependency directories
2+
node_modules/
3+
4+
# TypeScript build output
5+
/dist/
6+
*.js
7+
*.js.map
8+
9+
# NPM package files
10+
npm-debug.log
11+
*.tgz
12+
13+
# Editor directories and files
14+
.vscode/
15+
.idea/
16+
*.suo
17+
*.ntvs*
18+
*.njsproj
19+
*.sln
20+
*.sw?
21+
22+
# OS generated files
23+
.DS_Store
2424
Thumbs.db

.npmignore

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
# Source TypeScript files
2-
src/
3-
4-
# Tests and examples
5-
tests/
6-
examples/
7-
8-
# Configuration files
9-
tsconfig.json
10-
.jest/
11-
.nyc_output/
12-
coverage/
13-
14-
# Environment files
15-
.env.example
16-
.env
17-
18-
codegen.yml
1+
# Source TypeScript files
2+
src/
3+
4+
# Tests and examples
5+
tests/
6+
examples/
7+
8+
# Configuration files
9+
tsconfig.json
10+
.jest/
11+
.nyc_output/
12+
coverage/
13+
14+
# Environment files
15+
.env.example
16+
.env
17+
18+
codegen.yml
1919
azure-pipelines.yml

LICENSE

+21-21
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
MIT License
2-
3-
Copyright (c) 2024 Unstruk Data Inc.
4-
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
11-
12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
1+
MIT License
2+
3+
Copyright (c) 2024 Unstruk Data Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+53-53
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
1-
# TypeScript Client for Graphlit Platform
2-
## Overview
3-
4-
The Graphlit Client for Node.js enables straightforward interactions with the Graphlit API, allowing developers to execute GraphQL queries and mutations against the Graphlit service. This document outlines the setup process and provides a basic example of using the client.
5-
6-
## Prerequisites
7-
8-
Before you begin, ensure you have the following:
9-
10-
- Node.js installed on your system (recommended version 20.x or higher).
11-
- An active account on the [Graphlit Platform](https://portal.graphlit.dev) with access to the API settings dashboard.
12-
13-
## Installation
14-
15-
To install the Graphlit Client, use npm or yarn:
16-
17-
```bash
18-
npm install graphlit-client
19-
```
20-
or
21-
```bash
22-
yarn add graphlit-client
23-
```
24-
25-
## Configuration
26-
27-
The Graphlit Client supports environment variables to be set for authentication and configuration:
28-
29-
- `GRAPHLIT_ENVIRONMENT_ID`: Your environment ID.
30-
- `GRAPHLIT_ORGANIZATION_ID`: Your organization ID.
31-
- `GRAPHLIT_JWT_SECRET`: Your JWT secret for signing the JWT token.
32-
33-
Alternately, you can pass these values with the constructor of the Graphlit client.
34-
35-
You can find these values in the API settings dashboard on the [Graphlit Platform](https://portal.graphlit.dev).
36-
37-
### Setting Environment Variables
38-
39-
To set these environment variables on your system, you can place them in a `.env` file at the root of your project:
40-
41-
```env
42-
GRAPHLIT_ENVIRONMENT_ID=your_environment_id_value
43-
GRAPHLIT_ORGANIZATION_ID=your_organization_id_value
44-
GRAPHLIT_JWT_SECRET=your_jwt_secret_value
45-
```
46-
47-
## Support
48-
49-
Please refer to the [Graphlit API Documentation](https://docs.graphlit.dev/).
50-
51-
For support with the Graphlit Client, please submit a [GitHub Issue](https://github.com/graphlit/graphlit-client-typescript/issues).
52-
53-
For further support with the Graphlit Platform, please join our [Discord](https://discord.gg/ygFmfjy3Qx) community.
1+
# TypeScript Client for Graphlit Platform
2+
## Overview
3+
4+
The Graphlit Client for Node.js enables straightforward interactions with the Graphlit API, allowing developers to execute GraphQL queries and mutations against the Graphlit service. This document outlines the setup process and provides a basic example of using the client.
5+
6+
## Prerequisites
7+
8+
Before you begin, ensure you have the following:
9+
10+
- Node.js installed on your system (recommended version 20.x or higher).
11+
- An active account on the [Graphlit Platform](https://portal.graphlit.dev) with access to the API settings dashboard.
12+
13+
## Installation
14+
15+
To install the Graphlit Client, use npm or yarn:
16+
17+
```bash
18+
npm install graphlit-client
19+
```
20+
or
21+
```bash
22+
yarn add graphlit-client
23+
```
24+
25+
## Configuration
26+
27+
The Graphlit Client supports environment variables to be set for authentication and configuration:
28+
29+
- `GRAPHLIT_ENVIRONMENT_ID`: Your environment ID.
30+
- `GRAPHLIT_ORGANIZATION_ID`: Your organization ID.
31+
- `GRAPHLIT_JWT_SECRET`: Your JWT secret for signing the JWT token.
32+
33+
Alternately, you can pass these values with the constructor of the Graphlit client.
34+
35+
You can find these values in the API settings dashboard on the [Graphlit Platform](https://portal.graphlit.dev).
36+
37+
### Setting Environment Variables
38+
39+
To set these environment variables on your system, you can place them in a `.env` file at the root of your project:
40+
41+
```env
42+
GRAPHLIT_ENVIRONMENT_ID=your_environment_id_value
43+
GRAPHLIT_ORGANIZATION_ID=your_organization_id_value
44+
GRAPHLIT_JWT_SECRET=your_jwt_secret_value
45+
```
46+
47+
## Support
48+
49+
Please refer to the [Graphlit API Documentation](https://docs.graphlit.dev/).
50+
51+
For support with the Graphlit Client, please submit a [GitHub Issue](https://github.com/graphlit/graphlit-client-typescript/issues).
52+
53+
For further support with the Graphlit Platform, please join our [Discord](https://discord.gg/ygFmfjy3Qx) community.

azure-pipelines.yml

+40-40
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
trigger:
2-
branches:
3-
include:
4-
- main
5-
6-
name: $(Date:yyyyMMdd)$(Rev:rrr)
7-
8-
pool:
9-
vmImage: "ubuntu-latest"
10-
11-
steps:
12-
- task: NodeTool@0
13-
inputs:
14-
versionSpec: "20.x"
15-
displayName: "Install Node.js"
16-
17-
- script: |
18-
npm install
19-
npm run generate
20-
npm run build
21-
npm version 1.0.$(Build.BuildNumber) --no-git-tag-version --allow-same-version
22-
displayName: "Install dependencies and build"
23-
24-
- task: CopyFiles@2
25-
inputs:
26-
SourceFolder: "$(Build.SourcesDirectory)"
27-
Contents: "README.md"
28-
TargetFolder: "$(Build.ArtifactStagingDirectory)/dist"
29-
30-
- task: CopyFiles@2
31-
inputs:
32-
SourceFolder: "$(Build.SourcesDirectory)"
33-
Contents: "LICENSE"
34-
TargetFolder: "$(Build.ArtifactStagingDirectory)/dist"
35-
36-
- task: Npm@1
37-
inputs:
38-
command: publish
39-
publishRegistry: useExternalRegistry
40-
publishEndpoint: "NPM"
1+
trigger:
2+
branches:
3+
include:
4+
- main
5+
6+
name: $(Date:yyyyMMdd)$(Rev:rrr)
7+
8+
pool:
9+
vmImage: "ubuntu-latest"
10+
11+
steps:
12+
- task: NodeTool@0
13+
inputs:
14+
versionSpec: "20.x"
15+
displayName: "Install Node.js"
16+
17+
- script: |
18+
npm install
19+
npm run generate
20+
npm run build
21+
npm version 1.0.$(Build.BuildNumber) --no-git-tag-version --allow-same-version
22+
displayName: "Install dependencies and build"
23+
24+
- task: CopyFiles@2
25+
inputs:
26+
SourceFolder: "$(Build.SourcesDirectory)"
27+
Contents: "README.md"
28+
TargetFolder: "$(Build.ArtifactStagingDirectory)/dist"
29+
30+
- task: CopyFiles@2
31+
inputs:
32+
SourceFolder: "$(Build.SourcesDirectory)"
33+
Contents: "LICENSE"
34+
TargetFolder: "$(Build.ArtifactStagingDirectory)/dist"
35+
36+
- task: Npm@1
37+
inputs:
38+
command: publish
39+
publishRegistry: useExternalRegistry
40+
publishEndpoint: "NPM"

codegen.yml

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
overwrite: true
2-
schema: "https://data-scus-dev.graphlit.io/api/v1/graphql"
3-
documents: "./src/documents/**/*.graphql"
4-
generates:
5-
./src/generated/graphql-types.ts:
6-
plugins:
7-
- "typescript"
8-
- "typescript-operations" # Generates types for operations based on documents
9-
config:
10-
withComponent: false
11-
withHOC: false
12-
withHooks: false
13-
./src/generated/graphql-documents.ts:
14-
plugins:
15-
- "typescript-document-nodes" # Generates TypeScript constants for your GraphQL documents
1+
overwrite: true
2+
schema: "https://data-scus-dev.graphlit.io/api/v1/graphql"
3+
documents: "./src/documents/**/*.graphql"
4+
generates:
5+
./src/generated/graphql-types.ts:
6+
plugins:
7+
- "typescript"
8+
- "typescript-operations" # Generates types for operations based on documents
9+
config:
10+
withComponent: false
11+
withHOC: false
12+
withHooks: false
13+
./src/generated/graphql-documents.ts:
14+
plugins:
15+
- "typescript-document-nodes" # Generates TypeScript constants for your GraphQL documents

src/client.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ class Graphlit {
1919
private correlationId: string | undefined;
2020
private token: string;
2121

22-
constructor(environmentId?: string, organizationId?: string, jwtSecret?: string, ownerId?: string, apiUri?: string, correlationId?: string) {
22+
constructor(organizationId?: string, environmentId?: string, jwtSecret?: string, ownerId?: string, apiUri?: string, correlationId?: string) {
2323
this.apiUri = apiUri || "https://data-scus.graphlit.io/api/v1";
2424

25-
this.environmentId = environmentId || process.env.GRAPHLIT_ENVIRONMENT_ID;
2625
this.organizationId = organizationId || process.env.GRAPHLIT_ORGANIZATION_ID;
26+
this.environmentId = environmentId || process.env.GRAPHLIT_ENVIRONMENT_ID;
2727
this.jwtSecret = jwtSecret || process.env.GRAPHLIT_JWT_SECRET;
2828

2929
// optional: for multi-tenant support
+7-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
mutation CreateAlert($alert: AlertInput!, $correlationId: String) {
2-
createAlert(alert: $alert, correlationId: $correlationId) {
3-
id
4-
name
5-
state
6-
type
7-
}
1+
mutation CreateAlert($alert: AlertInput!, $correlationId: String) {
2+
createAlert(alert: $alert, correlationId: $correlationId) {
3+
id
4+
name
5+
state
6+
type
7+
}
88
}
+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
mutation DeleteAlert($id: ID!) {
2-
deleteAlert(id: $id) {
3-
id
4-
state
5-
}
1+
mutation DeleteAlert($id: ID!) {
2+
deleteAlert(id: $id) {
3+
id
4+
state
5+
}
66
}

0 commit comments

Comments
 (0)