@narrative.io/data-collaboration-sdk-ts 0.0.78 → 0.0.81
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.
- package/README.md +18 -0
- package/build/authentication/index.d.ts +9 -2
- package/build/authentication/index.js +9 -0
- package/build/authentication/types.d.ts +12 -5
- package/build/index.d.ts +2 -2
- package/package.json +8 -11
package/README.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# SDK
|
|
2
|
+
|
|
3
|
+
## Make a release
|
|
4
|
+
|
|
5
|
+
To make a new release of the SDK, create a branch, make your changes, create a commit with a message following this
|
|
6
|
+
format: `chore(main): release x.y.z` where x.y.z is the release number that you want. You can calculate it like this:
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
VERSION=$(cat package.json | jq -r .version); \
|
|
10
|
+
PATCH=$(expr $(echo $VERSION|cut -f3 -d.) + 1); \
|
|
11
|
+
NEW_VERSION=$(printf "$(echo $VERSION | cut -f1,2 -d.).$PATCH\n"); \
|
|
12
|
+
echo $NEW_VERSION | pbcopy; \
|
|
13
|
+
echo "The new VERSION=${NEW_VERSION} is in your clipboard."
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Push your changes to the branch, merge it to the `main` branch. Once the merge is completed (i.e., github actions
|
|
17
|
+
completed) a new release pull request will be available on the github project. Merge the new pull request and the
|
|
18
|
+
github actions will publish the new version of the SKD for you.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseApi } from '../base-api';
|
|
2
|
-
import { type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type LoggedInUser, type StytchToken, type ApiToken, type UserRole } from './types';
|
|
2
|
+
import { type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type LoggedInUser, type StytchToken, type ApiToken, type UserRole, type RegistrationStatus, type RegistrationStatusRequest, type RegistrationStatusResponse } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* A class for accessing the Authentication API
|
|
5
5
|
* @extends BaseApi
|
|
@@ -19,5 +19,12 @@ declare class AuthenticationApi extends BaseApi {
|
|
|
19
19
|
* @returns {Promise<RegisterResponse>} - A promise that resolves to the register response.
|
|
20
20
|
*/
|
|
21
21
|
register(registerRequest: RegisterRequest): Promise<RegisterResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Checks the resgistration status of a user.
|
|
24
|
+
*
|
|
25
|
+
* @param {RegistrationStatusRequest} statusRewquest - request payload of user login for whom to check status.
|
|
26
|
+
* @returns {Promise<RegistrationStatusResponse>} - A promise that resolves to the response.
|
|
27
|
+
*/
|
|
28
|
+
checkRegistrationStatus(statusRequest: RegistrationStatusRequest): Promise<RegistrationStatusResponse>;
|
|
22
29
|
}
|
|
23
|
-
export { type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type LoggedInUser, type StytchToken, type ApiToken, type UserRole, AuthenticationApi };
|
|
30
|
+
export { type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type LoggedInUser, type StytchToken, type ApiToken, type UserRole, type RegistrationStatus, type RegistrationStatusRequest, type RegistrationStatusResponse, AuthenticationApi };
|
|
@@ -29,5 +29,14 @@ class AuthenticationApi extends BaseApi {
|
|
|
29
29
|
async register(registerRequest) {
|
|
30
30
|
return await this.post(`${resourceName}/register`, registerRequest);
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Checks the resgistration status of a user.
|
|
34
|
+
*
|
|
35
|
+
* @param {RegistrationStatusRequest} statusRewquest - request payload of user login for whom to check status.
|
|
36
|
+
* @returns {Promise<RegistrationStatusResponse>} - A promise that resolves to the response.
|
|
37
|
+
*/
|
|
38
|
+
async checkRegistrationStatus(statusRequest) {
|
|
39
|
+
return await this.post(`${resourceName}/registration-status`, statusRequest);
|
|
40
|
+
}
|
|
32
41
|
}
|
|
33
42
|
export { AuthenticationApi };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export interface LoginRequest {
|
|
2
|
-
|
|
3
|
-
session_duration_minutes?: number;
|
|
2
|
+
stytch_session_token: string;
|
|
4
3
|
}
|
|
5
4
|
export interface LoginResponse {
|
|
6
5
|
user: {
|
|
@@ -13,8 +12,6 @@ export interface LoginResponse {
|
|
|
13
12
|
};
|
|
14
13
|
api_token: ApiToken;
|
|
15
14
|
legacy_token: string;
|
|
16
|
-
stytch_session_token: string;
|
|
17
|
-
stytch_session_jwt: string;
|
|
18
15
|
}
|
|
19
16
|
export interface ApiToken {
|
|
20
17
|
access_token: string;
|
|
@@ -23,7 +20,7 @@ export interface ApiToken {
|
|
|
23
20
|
refresh_token_expires_in: number;
|
|
24
21
|
}
|
|
25
22
|
export interface RegisterRequest {
|
|
26
|
-
|
|
23
|
+
stytch_session_token: string;
|
|
27
24
|
name?: string;
|
|
28
25
|
company_name: string;
|
|
29
26
|
}
|
|
@@ -43,3 +40,13 @@ export interface StytchToken {
|
|
|
43
40
|
token_type: 'magiclinks' | 'oauth';
|
|
44
41
|
}
|
|
45
42
|
export type UserRole = 'global_admin' | 'partner_admin' | 'partner_user';
|
|
43
|
+
export interface RegistrationStatusRequest {
|
|
44
|
+
stytch_token: StytchToken;
|
|
45
|
+
session_duration_minutes?: number;
|
|
46
|
+
}
|
|
47
|
+
export interface RegistrationStatusResponse {
|
|
48
|
+
status: RegistrationStatus;
|
|
49
|
+
stytch_session_token: string;
|
|
50
|
+
stytch_session_jwt: string;
|
|
51
|
+
}
|
|
52
|
+
export type RegistrationStatus = 'complete' | 'pending';
|
package/build/index.d.ts
CHANGED
|
@@ -22,11 +22,11 @@ import { ForecastApi, type ForecastRequest, type ForecastResponse, type CostFore
|
|
|
22
22
|
import { ContractsApi, type ContractDetails, type CustomerContract, type PaymentMethod, type ContractRateView } from './contracts';
|
|
23
23
|
import { getNqlObject, buildNql } from './nql/NQLParser';
|
|
24
24
|
import { convertNqlObjectToForecastBody } from './nql/DataRulesConverter';
|
|
25
|
-
import { AuthenticationApi, type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type LoggedInUser, type StytchToken, type ApiToken, type UserRole } from './authentication';
|
|
25
|
+
import { AuthenticationApi, type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type LoggedInUser, type StytchToken, type ApiToken, type UserRole, type RegistrationStatus, type RegistrationStatusRequest, type RegistrationStatusResponse } from './authentication';
|
|
26
26
|
import { AppsApi, type App } from './apps';
|
|
27
27
|
import type { ForecastBody } from './nql/types';
|
|
28
28
|
declare class NarrativeApi extends BaseApi {
|
|
29
29
|
}
|
|
30
30
|
interface NarrativeApi extends BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi, AttributeApi, PingApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, AuthenticationApi {
|
|
31
31
|
}
|
|
32
|
-
export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, AuthenticationApi, AppsApi, type App, type Resource, type UploadsResponse, type PingStatus, type Attribute, type RefAttribute, type SubAttribute, type Environment, type Config, type ApiRecords, type Dataset, type HealthCheckResult, type SampleRecords, type DatasetTableSummary, type DatasetTableSummaryAPIResponse, type Product, type MonetaryAmount, type CompanyInfo, type Installation, type FilePerSnapshotResponse, type BucketCreationRequest, type UpdateAccessTypeRequest, type Nql, type NqlField, type NqlResult, type NqlQueryInput, type NqlCompileResult, type NqlExpression, type NqlWhere, type NqlFilterExpression, type NqlBooleanExpression, type NqlFilterBinaryExpression, type NqlFilterUnaryExpression, type DataStream, type ForecastRequest, type ForecastResponse, type CostForecastRequest, type CostForecastResponse, type JobState, type ContractDetails, type CustomerContract, type PaymentMethod, type ContractRateView, type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type LoggedInUser, type StytchToken, type ApiToken, type UserRole, getNqlObject, buildNql, convertNqlObjectToForecastBody, type ForecastBody };
|
|
32
|
+
export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, ContractsApi, AuthenticationApi, AppsApi, type App, type Resource, type UploadsResponse, type PingStatus, type Attribute, type RefAttribute, type SubAttribute, type Environment, type Config, type ApiRecords, type Dataset, type HealthCheckResult, type SampleRecords, type DatasetTableSummary, type DatasetTableSummaryAPIResponse, type Product, type MonetaryAmount, type CompanyInfo, type Installation, type FilePerSnapshotResponse, type BucketCreationRequest, type UpdateAccessTypeRequest, type Nql, type NqlField, type NqlResult, type NqlQueryInput, type NqlCompileResult, type NqlExpression, type NqlWhere, type NqlFilterExpression, type NqlBooleanExpression, type NqlFilterBinaryExpression, type NqlFilterUnaryExpression, type DataStream, type ForecastRequest, type ForecastResponse, type CostForecastRequest, type CostForecastResponse, type JobState, type ContractDetails, type CustomerContract, type PaymentMethod, type ContractRateView, type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type LoggedInUser, type StytchToken, type ApiToken, type UserRole, type RegistrationStatus, type RegistrationStatusRequest, type RegistrationStatusResponse, getNqlObject, buildNql, convertNqlObjectToForecastBody, type ForecastBody };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@narrative.io/data-collaboration-sdk-ts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.81",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"repository": "github:narrative-io/data-collaboration-sdk-ts",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -20,28 +20,25 @@
|
|
|
20
20
|
"author": "",
|
|
21
21
|
"license": "ISC",
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@babel/core": "^7.
|
|
24
|
-
"@babel/preset-env": "^7.
|
|
23
|
+
"@babel/core": "^7.22.5",
|
|
24
|
+
"@babel/preset-env": "^7.22.5",
|
|
25
25
|
"@babel/preset-typescript": "^7.18.6",
|
|
26
26
|
"@commitlint/cli": "^17.4.2",
|
|
27
27
|
"@commitlint/config-conventional": "^17.4.2",
|
|
28
28
|
"@types/jest": "^29.5.0",
|
|
29
|
-
"@typescript-eslint/eslint-plugin": "^5.51.0",
|
|
30
29
|
"babel-jest": "^29.4.3",
|
|
31
|
-
"eslint": "^
|
|
32
|
-
"eslint-config-standard-with-typescript": "^35.0.0",
|
|
33
|
-
"eslint-plugin-import": "^2.27.5",
|
|
34
|
-
"eslint-plugin-n": "^15.7.0",
|
|
35
|
-
"eslint-plugin-promise": "^6.1.1",
|
|
30
|
+
"eslint-config-standard-with-typescript": "^36.0.0",
|
|
36
31
|
"husky": "^8.0.0",
|
|
37
32
|
"jest": "^29.4.3",
|
|
38
|
-
"ts-jest": "^29.0.5"
|
|
39
|
-
"typescript": "^5.0.2"
|
|
33
|
+
"ts-jest": "^29.0.5"
|
|
40
34
|
},
|
|
41
35
|
"dependencies": {
|
|
42
36
|
"mande": "^2.0.3",
|
|
43
37
|
"zod": "^3.21.4"
|
|
44
38
|
},
|
|
39
|
+
"overrides": {
|
|
40
|
+
"semver@<7.5.2": "7.5.2"
|
|
41
|
+
},
|
|
45
42
|
"files": [
|
|
46
43
|
"build"
|
|
47
44
|
]
|