@narrative.io/data-collaboration-sdk-ts 0.0.75 → 0.0.77

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.
@@ -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 } from './types';
2
+ import { type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type LoggedInUser, type StytchToken, type ApiToken, type UserRole } from './types';
3
3
  /**
4
4
  * A class for accessing the Authentication API
5
5
  * @extends BaseApi
@@ -20,4 +20,4 @@ declare class AuthenticationApi extends BaseApi {
20
20
  */
21
21
  register(registerRequest: RegisterRequest): Promise<RegisterResponse>;
22
22
  }
23
- export { type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type LoggedInUser, type StytchToken, AuthenticationApi };
23
+ export { type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type LoggedInUser, type StytchToken, type ApiToken, type UserRole, AuthenticationApi };
@@ -3,11 +3,25 @@ export interface LoginRequest {
3
3
  session_duration_minutes?: number;
4
4
  }
5
5
  export interface LoginResponse {
6
- user: LoggedInUser;
7
- api_token: string;
6
+ user: {
7
+ id: number;
8
+ email: string;
9
+ name: string;
10
+ company_id: number;
11
+ company_name: string;
12
+ role: UserRole;
13
+ };
14
+ api_token: ApiToken;
15
+ legacy_token: string;
8
16
  stytch_session_token: string;
9
17
  stytch_session_jwt: string;
10
18
  }
19
+ export interface ApiToken {
20
+ access_token: string;
21
+ access_token_expires_in: number;
22
+ refresh_token: string;
23
+ refresh_token_expires_in: number;
24
+ }
11
25
  export interface RegisterRequest {
12
26
  stytch_token: StytchToken;
13
27
  name?: string;
@@ -18,11 +32,14 @@ export interface RegisterResponse {
18
32
  }
19
33
  export interface LoggedInUser {
20
34
  id: number;
35
+ email?: string;
21
36
  name: string;
22
37
  company_id: number;
23
38
  company_name: string;
39
+ role: UserRole;
24
40
  }
25
41
  export interface StytchToken {
26
42
  token: string;
27
43
  token_type: 'magiclinks' | 'oauth';
28
44
  }
45
+ export type UserRole = 'global_admin' | 'partner_admin' | 'partner_user';
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 } from './authentication';
25
+ import { AuthenticationApi, type LoginRequest, type LoginResponse, type RegisterRequest, type RegisterResponse, type LoggedInUser, type StytchToken, type ApiToken, type UserRole } 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, 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, 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.75",
3
+ "version": "0.0.77",
4
4
  "main": "build/index.js",
5
5
  "repository": "github:narrative-io/data-collaboration-sdk-ts",
6
6
  "source": "src/index.ts",