Skip to content

Commit

Permalink
Release 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Aug 21, 2023
1 parent 2f9ceed commit 2ffff9e
Show file tree
Hide file tree
Showing 19 changed files with 91 additions and 53 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ node_modules
/dist
/Client.d.ts
/Client.js
/environments.d.ts
/environments.js
/index.d.ts
/index.js
/api
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flagright",
"version": "1.0.0",
"version": "1.0.2",
"private": false,
"repository": "https://github.com/flagright/flagright-node",
"main": "./index.js",
Expand Down
3 changes: 2 additions & 1 deletion src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as environments from "./environments";
import * as core from "./core";
import { Transactions } from "./api/resources/transactions/client/Client";
import { TransactionEvents } from "./api/resources/transactionEvents/client/Client";
Expand All @@ -12,7 +13,7 @@ import { BusinessUserEvents } from "./api/resources/businessUserEvents/client/Cl

export declare namespace FlagrightClient {
interface Options {
environment: core.Supplier<string>;
environment?: core.Supplier<environments.FlagrightEnvironment | string>;
apiKey: core.Supplier<string>;
}

Expand Down
10 changes: 7 additions & 3 deletions src/api/resources/businessUserEvents/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as environments from "../../../../environments";
import * as core from "../../../../core";
import * as Flagright from "../../..";
import { default as URLSearchParams } from "@ungap/url-search-params";
Expand All @@ -11,7 +12,7 @@ import * as errors from "../../../../errors";

export declare namespace BusinessUserEvents {
interface Options {
environment: core.Supplier<string>;
environment?: core.Supplier<environments.FlagrightEnvironment | string>;
apiKey: core.Supplier<string>;
}

Expand Down Expand Up @@ -59,13 +60,16 @@ export class BusinessUserEvents {
}

const _response = await core.fetcher({
url: urlJoin(await core.Supplier.get(this._options.environment), "events/business/user"),
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FlagrightEnvironment.Default,
"events/business/user"
),
method: "POST",
headers: {
"x-api-key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "flagright",
"X-Fern-SDK-Version": "1.0.0",
"X-Fern-SDK-Version": "1.0.2",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down
17 changes: 12 additions & 5 deletions src/api/resources/businessUsers/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as environments from "../../../../environments";
import * as core from "../../../../core";
import * as Flagright from "../../..";
import * as serializers from "../../../../serialization";
Expand All @@ -10,7 +11,7 @@ import * as errors from "../../../../errors";

export declare namespace BusinessUsers {
interface Options {
environment: core.Supplier<string>;
environment?: core.Supplier<environments.FlagrightEnvironment | string>;
apiKey: core.Supplier<string>;
}

Expand Down Expand Up @@ -46,13 +47,16 @@ export class BusinessUsers {
requestOptions?: BusinessUsers.RequestOptions
): Promise<Flagright.BusinessUsersCreateResponse> {
const _response = await core.fetcher({
url: urlJoin(await core.Supplier.get(this._options.environment), "business/users"),
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FlagrightEnvironment.Default,
"business/users"
),
method: "POST",
headers: {
"x-api-key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "flagright",
"X-Fern-SDK-Version": "1.0.0",
"X-Fern-SDK-Version": "1.0.2",
},
contentType: "application/json",
body: await serializers.Business.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -112,13 +116,16 @@ export class BusinessUsers {
requestOptions?: BusinessUsers.RequestOptions
): Promise<Flagright.BusinessResponse> {
const _response = await core.fetcher({
url: urlJoin(await core.Supplier.get(this._options.environment), `business/users/${userId}`),
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FlagrightEnvironment.Default,
`business/users/${userId}`
),
method: "GET",
headers: {
"x-api-key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "flagright",
"X-Fern-SDK-Version": "1.0.0",
"X-Fern-SDK-Version": "1.0.2",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down
10 changes: 7 additions & 3 deletions src/api/resources/consumerUserEvents/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as environments from "../../../../environments";
import * as core from "../../../../core";
import * as Flagright from "../../..";
import { default as URLSearchParams } from "@ungap/url-search-params";
Expand All @@ -11,7 +12,7 @@ import * as errors from "../../../../errors";

export declare namespace ConsumerUserEvents {
interface Options {
environment: core.Supplier<string>;
environment?: core.Supplier<environments.FlagrightEnvironment | string>;
apiKey: core.Supplier<string>;
}

Expand Down Expand Up @@ -59,13 +60,16 @@ export class ConsumerUserEvents {
}

const _response = await core.fetcher({
url: urlJoin(await core.Supplier.get(this._options.environment), "events/consumer/user"),
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FlagrightEnvironment.Default,
"events/consumer/user"
),
method: "POST",
headers: {
"x-api-key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "flagright",
"X-Fern-SDK-Version": "1.0.0",
"X-Fern-SDK-Version": "1.0.2",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down
17 changes: 12 additions & 5 deletions src/api/resources/consumerUsers/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as environments from "../../../../environments";
import * as core from "../../../../core";
import * as Flagright from "../../..";
import * as serializers from "../../../../serialization";
Expand All @@ -10,7 +11,7 @@ import * as errors from "../../../../errors";

export declare namespace ConsumerUsers {
interface Options {
environment: core.Supplier<string>;
environment?: core.Supplier<environments.FlagrightEnvironment | string>;
apiKey: core.Supplier<string>;
}

Expand Down Expand Up @@ -45,13 +46,16 @@ export class ConsumerUsers {
requestOptions?: ConsumerUsers.RequestOptions
): Promise<Flagright.ConsumerUsersCreateResponse> {
const _response = await core.fetcher({
url: urlJoin(await core.Supplier.get(this._options.environment), "consumer/users"),
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FlagrightEnvironment.Default,
"consumer/users"
),
method: "POST",
headers: {
"x-api-key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "flagright",
"X-Fern-SDK-Version": "1.0.0",
"X-Fern-SDK-Version": "1.0.2",
},
contentType: "application/json",
body: await serializers.User.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -108,13 +112,16 @@ export class ConsumerUsers {
*/
public async get(userId: string, requestOptions?: ConsumerUsers.RequestOptions): Promise<Flagright.UserResponse> {
const _response = await core.fetcher({
url: urlJoin(await core.Supplier.get(this._options.environment), `consumer/users/${userId}`),
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FlagrightEnvironment.Default,
`consumer/users/${userId}`
),
method: "GET",
headers: {
"x-api-key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "flagright",
"X-Fern-SDK-Version": "1.0.0",
"X-Fern-SDK-Version": "1.0.2",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down
17 changes: 12 additions & 5 deletions src/api/resources/transactionEvents/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as environments from "../../../../environments";
import * as core from "../../../../core";
import * as Flagright from "../../..";
import * as serializers from "../../../../serialization";
Expand All @@ -10,7 +11,7 @@ import * as errors from "../../../../errors";

export declare namespace TransactionEvents {
interface Options {
environment: core.Supplier<string>;
environment?: core.Supplier<environments.FlagrightEnvironment | string>;
apiKey: core.Supplier<string>;
}

Expand Down Expand Up @@ -53,13 +54,16 @@ export class TransactionEvents {
requestOptions?: TransactionEvents.RequestOptions
): Promise<Flagright.TransactionEventMonitoringResult> {
const _response = await core.fetcher({
url: urlJoin(await core.Supplier.get(this._options.environment), "events/transaction"),
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FlagrightEnvironment.Default,
"events/transaction"
),
method: "POST",
headers: {
"x-api-key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "flagright",
"X-Fern-SDK-Version": "1.0.0",
"X-Fern-SDK-Version": "1.0.2",
},
contentType: "application/json",
body: await serializers.TransactionEvent.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -120,13 +124,16 @@ export class TransactionEvents {
requestOptions?: TransactionEvents.RequestOptions
): Promise<Flagright.TransactionEvent> {
const _response = await core.fetcher({
url: urlJoin(await core.Supplier.get(this._options.environment), `events/transaction/${eventId}`),
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FlagrightEnvironment.Default,
`events/transaction/${eventId}`
),
method: "GET",
headers: {
"x-api-key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "flagright",
"X-Fern-SDK-Version": "1.0.0",
"X-Fern-SDK-Version": "1.0.2",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down
17 changes: 12 additions & 5 deletions src/api/resources/transactions/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as environments from "../../../../environments";
import * as core from "../../../../core";
import * as Flagright from "../../..";
import { default as URLSearchParams } from "@ungap/url-search-params";
Expand All @@ -11,7 +12,7 @@ import * as errors from "../../../../errors";

export declare namespace Transactions {
interface Options {
environment: core.Supplier<string>;
environment?: core.Supplier<environments.FlagrightEnvironment | string>;
apiKey: core.Supplier<string>;
}

Expand Down Expand Up @@ -64,13 +65,16 @@ export class Transactions {
}

const _response = await core.fetcher({
url: urlJoin(await core.Supplier.get(this._options.environment), "transactions"),
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FlagrightEnvironment.Default,
"transactions"
),
method: "POST",
headers: {
"x-api-key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "flagright",
"X-Fern-SDK-Version": "1.0.0",
"X-Fern-SDK-Version": "1.0.2",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -131,13 +135,16 @@ export class Transactions {
requestOptions?: Transactions.RequestOptions
): Promise<Flagright.TransactionWithRulesResult> {
const _response = await core.fetcher({
url: urlJoin(await core.Supplier.get(this._options.environment), `transactions/${transactionId}`),
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FlagrightEnvironment.Default,
`transactions/${transactionId}`
),
method: "GET",
headers: {
"x-api-key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "flagright",
"X-Fern-SDK-Version": "1.0.0",
"X-Fern-SDK-Version": "1.0.2",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down
2 changes: 1 addition & 1 deletion src/api/types/Address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface Address {
/** Address lines of the user's residence address */
addressLines: unknown[];
/** Post code of the user's residence address <span style="white-space: nowrap">`non-empty`</span> */
postcode: string;
postcode?: string;
/** City of the user's residence address <span style="white-space: nowrap">`non-empty`</span> */
city: string;
/** State of the user's residence address <span style="white-space: nowrap">`non-empty`</span> */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,9 @@
* This file was auto-generated by Fern from our API Definition.
*/

/**
* Segmentation of the business user
*/
export type CompanyGeneralDetailsUserSegment =
| "SOLE_PROPRIETORSHIP"
| "LIMITED"
| "SMB"
| "SMALL"
| "MEDIUM"
| "LARGE"
| "UNKNOWN";
export type BusinessUserSegment = "SOLE_PROPRIETORSHIP" | "LIMITED" | "SMB" | "SMALL" | "MEDIUM" | "LARGE" | "UNKNOWN";

export const CompanyGeneralDetailsUserSegment = {
export const BusinessUserSegment = {
SoleProprietorship: "SOLE_PROPRIETORSHIP",
Limited: "LIMITED",
Smb: "SMB",
Expand Down
3 changes: 1 addition & 2 deletions src/api/types/CompanyGeneralDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ export interface CompanyGeneralDetails {
businessIndustry?: string[];
/** The key products and services provided by the company */
mainProductsServicesSold?: string[];
/** Segmentation of the business user */
userSegment?: Flagright.CompanyGeneralDetailsUserSegment;
userSegment?: Flagright.BusinessUserSegment;
userRegistrationStatus?: Flagright.UserRegistrationStatus;
/** Additional information that can be added via tags */
tags?: Flagright.Tag[];
Expand Down
2 changes: 1 addition & 1 deletion src/api/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export * from "./CompanyFinancialDetails";
export * from "./UserDetails";
export * from "./UserDetailsGender";
export * from "./UserRegistrationStatus";
export * from "./BusinessUserSegment";
export * from "./CompanyGeneralDetails";
export * from "./CompanyGeneralDetailsUserSegment";
export * from "./CompanyRegistrationDetails";
export * from "./BusinessBase";
export * from "./BusinessOptional";
Expand Down
9 changes: 9 additions & 0 deletions src/environments.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export const FlagrightEnvironment = {
Default: "https://sandbox.api.flagright.com",
} as const;

export type FlagrightEnvironment = typeof FlagrightEnvironment.Default;
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * as Flagright from "./api";
export { FlagrightClient } from "./Client";
export { FlagrightEnvironment } from "./environments";
export { FlagrightError, FlagrightTimeoutError } from "./errors";
Loading

0 comments on commit 2ffff9e

Please sign in to comment.