Skip to content

Commit 52fe846

Browse files
authored
Update hypersync-sdk to 6.0.0-beta.1 #84
2 parents cf2f4ff + 81fa8ce commit 52fe846

45 files changed

Lines changed: 7758 additions & 1401 deletions

Some content is hidden

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

.eslintrc.js

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,20 @@
1+
/* eslint-env node */
2+
13
module.exports = {
2-
env: {
3-
browser: false,
4-
commonjs: true,
5-
es2021: true,
6-
node: true
7-
},
8-
extends: [
9-
'eslint:recommended',
10-
'plugin:@typescript-eslint/recommended',
11-
'prettier'
12-
],
13-
parserOptions: {
14-
ecmaVersion: 'latest'
15-
},
16-
plugins: ['@typescript-eslint'],
17-
rules: {
18-
'@typescript-eslint/no-non-null-assertion': 0,
19-
'@typescript-eslint/ban-types': 0,
20-
'@typescript-eslint/explicit-module-boundary-types': ['off'],
21-
'@typescript-eslint/no-explicit-any': ['off']
22-
},
4+
ignorePatterns: ['src/**/*.test.ts'],
235
overrides: [
246
{
25-
files: ['*.js'],
7+
files: ['*.ts'],
8+
parser: '@typescript-eslint/parser',
9+
parserOptions: {
10+
ecmaVersion: 'latest',
11+
project: `${__dirname}/tsconfig.json`
12+
},
2613
rules: {
27-
'@typescript-eslint/no-var-requires': 'off'
14+
'max-lines-per-function': ['error', { max: 570, skipBlankLines: true }],
15+
'max-depth': ['error', 6],
16+
complexity: ['error', 25]
2817
}
2918
}
30-
],
31-
ignorePatterns: ['**/build/*']
19+
]
3220
};

.github/workflows/build.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '22'
20+
cache: 'yarn'
21+
22+
- name: Install dependencies
23+
run: yarn install --frozen-lockfile
24+
25+
- name: Build
26+
run: yarn build

doc/001-getting-started.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ Every Hypersync app is a [Node.js](https://nodejs.org/en/) [module](https://node
88

99
To use the Hypersync SDK you will need a Windows, Mac or Linux computer with a few software packages installed.
1010

11-
Since each Hypersync is a Node.js module, you will need to have Node.js installed in order to build custom Hypersyncs. The Hypersync platform uses Node.js version 16 which you can install here:
11+
Since each Hypersync is a Node.js module, you will need to have Node.js installed in order to build custom Hypersyncs. The Hypersync platform uses Node.js version 22 which you can install here:
1212

13-
- [Node JS version 18](https://nodejs.org/download/release/v18.17.1/).
13+
- [Node.js](https://nodejs.org/en/download).
1414

15-
You will also need to install the classic yarn package manager (version 1.22.19) using the link below.
15+
You will also need to install the classic yarn package manager using the link below:
1616

1717
- [yarn package manager](https://classic.yarnpkg.com)
1818

@@ -22,15 +22,14 @@ The Hyperproof CLI is needed to publish and manage your custom Hypersyncs:
2222

2323
Finally, we recommend cloning the [Hypersync SDK Samples GitHub repository](https://github.com/Hyperproof/hypersync-sdk-samples). This is a public repository available on GitHub.com.
2424

25-
- The samples repository contains several complete Hypersync apps that can be used to bring data from an external service into Hyperproof. Using the Hyperysnc SDK you can customize these samples to meet your needs. The hypersync-sdk-samples repository contains samples for MySQL, Zoho and other services. Your will find the these Hypersync apps in the `/apps` directory.
25+
- The samples repository contains several complete Hypersync apps that can be used to bring data from an external service into Hyperproof. Using the Hypersync SDK you can customize these samples to meet your needs. The hypersync-sdk-samples repository contains samples for MySQL, Zoho and other services. Your will find the these Hypersync apps in the `/apps` directory.
2626

2727
- The samples repository also includes a handful of templates to get you started building your own Hypersyncs from scatch. Templates can be found in the `/templates` directory. See the `README.md` files in each template directory for more information on using the templates.
2828

2929
## Sandbox Organization (optional)
3030

3131
For development purposes it is recommended to have a separate 'sandbox' organization in Hyperproof. This will allow you to develop and test your custom Hypersync apps in isolation without affecting the users in your production Hyperproof organization. To create a 'sandbox' organization, please contact your Hyperproof Customer Service Manager.
3232

33-
3433
## Next Steps
3534

3635
Once you have installed the prerequisites and determined the organization that you will use for development, you are ready to install your first custom Hypersync app. Follow the guidance in [App Development Workflow](./002-dev-workflow.md) to install, test and update one of the pre-built sample apps.

doc/002-dev-workflow.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,14 @@ After installing the CLI, you will first need to sign in using this command:
1515
```
1616
hp signin
1717
```
18-
> NOTE: For customers using Hyperproof EU or Hyperproof GOV, please use the following commands:
18+
19+
> NOTE: For customers using Hyperproof EU, please use the following command:
20+
>
21+
> ```
22+
> hp signin --domain hyperproof.eu
23+
> ```
1924
>
20-
>```
21-
>hp signin --domain hyperproof.eu
22-
>```
23-
>or
24-
>```
25-
>hp signin --domain hyperproofgov.app
26-
>```
27-
>For additional information use 'hp signin -help'
25+
> For additional information use 'hp signin -help'
2826
2927
This command will launch a new browser window and allow you to sign in (if you are not already signed in) and then authorize CLI access to your Hyperproof organization.
3028
@@ -34,7 +32,7 @@ This command will launch a new browser window and allow you to sign in (if you a
3432
3533
### Importing Your Hypersync App
3634
37-
Once you have signed in and authorized the CLI, you are ready to import a custom Hyperysnc app.
35+
Once you have signed in and authorized the CLI, you are ready to import a custom Hypersync app.
3836
3937
1. Find the `apps/open-library/` directory in your clone of the Hypersync SDK Samples repository.
4038
2. Make a copy of that folder somewhere else on your computer. Feel free to rename the folder if that helps.

doc/004-connections.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ In a Hypersync app, there are two types connections: [OAuth connections](#oauth-
2424
> a [custom authentication connection](#custom-authentication) should be used.
2525
2626
> **NOTE: API Permissions**
27-
>- Always use the minimum permissions necessary for proofs. Hypersyncs are read-only so use read-only permissions when possible.
28-
>- Use minimum scopes when using OAuth. The Hypersync author is going to be asked to authorize one or more scopes. You only want to ask for what you need.
27+
>
28+
> - Always use the minimum permissions necessary for proofs. Hypersyncs are read-only so use read-only permissions when possible.
29+
> - Use minimum scopes when using OAuth. The Hypersync author is going to be asked to authorize one or more scopes. You only want to ask for what you need.
2930
3031
## OAuth Authorization
3132

@@ -92,7 +93,7 @@ Finally, implement the `getUserId` and `getUserAccountName` methods. `getUserId`
9293

9394
## Custom Authentication
9495

95-
All non-OAuth authentication/authorization schemes are classified as "Custom" in the Hyperysnc SDK. If your service does not use OAuth 2.0, you should specify `custom` as your `authType` in `package.json`. See [Custom Hypersync App package.json Reference](./030-package-json-reference.md) for more information.
96+
All non-OAuth authentication/authorization schemes are classified as "Custom" in the Hypersync SDK. If your service does not use OAuth 2.0, you should specify `custom` as your `authType` in `package.json`. See [Custom Hypersync App package.json Reference](./030-package-json-reference.md) for more information.
9697

9798
Custom auth covers any type of authentication where the user provides credentials to make a connection. Credentials can include user name/password, access key/secret key, API Token, and many others. Users may also need to designate the endpoint they’re connecting to - for example by providing a URL or a region.
9899

doc/005-data-sources.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Data sources can retrieve different data sets from the external service. Each da
66

77
Data set names are used in other components like proof types to identify the specific data element or elements needed by that component.
88

9-
> **NOTE**: Data sets can and *should* be re-used across multiple proof types, and can also be used in non-proof scenarios such as collecting user data during the `validateCredentials` process.
9+
> **NOTE**: Data sets can and _should_ be re-used across multiple proof types, and can also be used in non-proof scenarios such as collecting user data during the `validateCredentials` process.
1010
1111
## REST Data Sources
1212

@@ -66,9 +66,9 @@ For more information on configuring the data sets in your data source using `dat
6666

6767
Many REST APIs use a paging mechanism to allow data to be retrieved in chunks. For example, some APIs take a `pageSize` and `pageNumber` argument which specify how many items to return, and the page number to start reading from, respectively.
6868

69-
Four paging styles are supported: __Page Based__, __Offset And Limit__, __Next Token__, and __GraphQL Connections__. As a default, query string parameters will be programatically added to an API url. If POST is designated as the data source HTTP method, paging parameters are added to the body of the request.
69+
Four paging styles are supported: **Page Based**, **Offset And Limit**, **Next Token**, and **GraphQL Connections**. As a default, query string parameters will be programatically added to an API url. If POST is designated as the data source HTTP method, paging parameters are added to the body of the request.
7070

71-
1. __Page Based.__ Begin paging at a starting value and increment the page value by 1 after each iteration (1, 2, 3, etc). Return at most `limitValue` items per page.
71+
1. **Page Based.** Begin paging at a starting value and increment the page value by 1 after each iteration (1, 2, 3, etc). Return at most `limitValue` items per page.
7272

7373
```json
7474
"pagingScheme": {
@@ -83,9 +83,9 @@ Four paging styles are supported: __Page Based__, __Offset And Limit__, __Next T
8383
}
8484
```
8585

86-
The mandatory `request` property in the paging scheme constructs the paged query string. The query string of the first API call from the above example will be: `?pageNumber=1&pageSize=100`. Each paging scheme must include a `pageUntil` property which defines the point at which pagination stops. If `reachTotalCount` condition is applied, `totalCount` must be defined in the response object, which represents the path to the total combined number of items in the data returned from the external service.*
86+
The mandatory `request` property in the paging scheme constructs the paged query string. The query string of the first API call from the above example will be: `?pageNumber=1&pageSize=100`. Each paging scheme must include a `pageUntil` property which defines the point at which pagination stops. If `reachTotalCount` condition is applied, `totalCount` must be defined in the response object, which represents the path to the total combined number of items in the data returned from the external service.\*
8787

88-
2. __Offset And Limit.__ Begin paging at a starting value and increment the offset by the number of elements in a full page (0, 100, 200, 300, etc). Return at most `limitValue` items per page.
88+
2. **Offset And Limit.** Begin paging at a starting value and increment the offset by the number of elements in a full page (0, 100, 200, 300, etc). Return at most `limitValue` items per page.
8989

9090
```json
9191
"pagingScheme": {
@@ -103,9 +103,9 @@ The mandatory `request` property in the paging scheme constructs the paged query
103103
}
104104
```
105105

106-
The mandatory `request` property in the paging scheme constructs the paged query string. The query string of the first API call from the above example will be: `?offset=0&limit=100`. Each paging scheme must include a `pageUntil` property which defines the point at which pagination stops. If `reachTotalCount` condition is applied, `totalCount` must be defined in the response object. This string value represents the path to the total combined number of items in the data returned from the external service.*
106+
The mandatory `request` property in the paging scheme constructs the paged query string. The query string of the first API call from the above example will be: `?offset=0&limit=100`. Each paging scheme must include a `pageUntil` property which defines the point at which pagination stops. If `reachTotalCount` condition is applied, `totalCount` must be defined in the response object. This string value represents the path to the total combined number of items in the data returned from the external service.\*
107107

108-
3. __Next Token.__ Begin paging and continue until `nextToken` is no longer provided. Return at most `limitValue` items per page. Tokens may be a unique string returned from the external service or a url.
108+
3. **Next Token.** Begin paging and continue until `nextToken` is no longer provided. Return at most `limitValue` items per page. Tokens may be a unique string returned from the external service or a url.
109109

110110
```json
111111
"pagingScheme": {
@@ -123,9 +123,9 @@ The mandatory `request` property in the paging scheme constructs the paged query
123123
}
124124
```
125125

126-
The mandatory `request` property in the paging scheme constructs the paged query string. The query string of the first API call from the above example will be: `?size=20`. Each successive call will be structured in the pattern: `?size=20&token=891b629672384d04`. Each paging scheme must include a `pageUntil` property which defines the point at which pagination stops. When `noNextToken` condition is applied, `nextToken` must be included in the response object. This string value represents the path to the expected value in the data returned from the external service.*
126+
The mandatory `request` property in the paging scheme constructs the paged query string. The query string of the first API call from the above example will be: `?size=20`. Each successive call will be structured in the pattern: `?size=20&token=891b629672384d04`. Each paging scheme must include a `pageUntil` property which defines the point at which pagination stops. When `noNextToken` condition is applied, `nextToken` must be included in the response object. This string value represents the path to the expected value in the data returned from the external service.\*
127127

128-
4. __GraphQL Connections.__ Following the GraphQL [Connections](https://graphql.org/learn/pagination/#connection-specification) specification, continue paging until `hasNextPage` is false. Return at most `limitValue` items per page. Supports forward, non-nested pagination.
128+
4. **GraphQL Connections.** Following the GraphQL [Connections](https://graphql.org/learn/pagination/#connection-specification) specification, continue paging until `hasNextPage` is false. Return at most `limitValue` items per page. Supports forward, non-nested pagination.
129129

130130
```json
131131
"body": {
@@ -149,9 +149,9 @@ The mandatory `request` property in the paging scheme constructs the paged query
149149
}
150150
```
151151

152-
The paging scheme dynamically adds the `first` and `after` variables to the body of a request. The `after` variable is defined using the `endCursor` string from the preceding response. `pageInfo` must be included in the paging scheme response object. This string value represents the path to the `pageInfo` object in the data returned from the external service.
152+
The paging scheme dynamically adds the `first` and `after` variables to the body of a request. The `after` variable is defined using the `endCursor` string from the preceding response. `pageInfo` must be included in the paging scheme response object. This string value represents the path to the `pageInfo` object in the data returned from the external service.
153153

154-
*If values are to be found in the response header, apply the `header:` prefix.
154+
\*If values are to be found in the response header, apply the `header:` prefix.
155155

156156
## Custom Data Sources
157157

doc/006-proof-types.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,17 @@ Once the user selects a proof type, they may be asked for one or more criteria v
1212

1313
Proof types retrieve data from the app's [data source](./005-data-sources.md) by name. The proof type may also provide parameter values to the data source to ensure that the right data is returned.
1414

15-
> **IMPORTANT: Planning Your Proof Types and Fields**
16-
>>- Define different kinds of proof - Users, Groups, etc...
17-
>>- Define key fields of information needed in each proof type. Make sure your API calls can return these vital elements.
18-
>>- Define how to identify the right resource(s) - This information can be unique to each proof type and will be needed to configure `criteriafields.json` You’ll want to ask the user for these when they author the Hypersync. For example if you want to get configuration information from Azure you might need to know the tenant and subscription and resource group.
19-
>>
20-
> **Tips for finding this info**:
21-
>>- Look at console pages and dashboards. They usually contain all key information by default and are a great starting point.
22-
>>- Look at other similar proof types in other apps.
23-
>>- Always include proof for users and their permissions. See User Access Reviews proof for more information.
15+
> **IMPORTANT: Planning Your Proof Types and Fields**
16+
>
17+
> > - Define different kinds of proof - Users, Groups, etc...
18+
> > - Define key fields of information needed in each proof type. Make sure your API calls can return these vital elements.
19+
> > - Define how to identify the right resource(s) - This information can be unique to each proof type and will be needed to configure `criteriafields.json` You’ll want to ask the user for these when they author the Hypersync. For example if you want to get configuration information from Azure you might need to know the tenant and subscription and resource group.
20+
> >
21+
> > **Tips for finding this info**:
22+
> >
23+
> > - Look at console pages and dashboards. They usually contain all key information by default and are a great starting point.
24+
> > - Look at other similar proof types in other apps.
25+
> > - Always include proof for users and their permissions. See User Access Reviews proof for more information.
2426
2527
### Layouts
2628

doc/007-criteria.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class MyCriteriaProvider implements ICriteriaProvider{
7171
pages: ICriteriaPage[]
7272
): Promise<ICriteriaMetadata> {
7373
// TODO: Generate an ICriteriaMetdata instance containing the metadata for
74-
// the fields the user needs to configure, as well as defaults for the Hyperysnc
74+
// the fields the user needs to configure, as well as defaults for the Hypersync
7575
// name, frequency of execution, and versioning behavior.
7676
}
7777

0 commit comments

Comments
 (0)