diff --git a/.gitignore b/.gitignore index 1498321..050eae0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,6 @@ node_modules /dist /Client.d.ts /Client.js -/environments.d.ts -/environments.js /index.d.ts /index.js /api diff --git a/package.json b/package.json index ec6bc1b..ae6bb27 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flagright", - "version": "0.1.2", + "version": "1.0.0", "private": false, "repository": "https://github.com/flagright/flagright-node", "main": "./index.js", diff --git a/src/Client.ts b/src/Client.ts index 10f1f5c..26c4499 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -2,7 +2,6 @@ * 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"; @@ -13,7 +12,7 @@ import { BusinessUserEvents } from "./api/resources/businessUserEvents/client/Cl export declare namespace FlagrightClient { interface Options { - environment?: core.Supplier; + environment: core.Supplier; apiKey: core.Supplier; } diff --git a/src/api/resources/businessUserEvents/client/Client.ts b/src/api/resources/businessUserEvents/client/Client.ts index ccdfd78..4525b88 100644 --- a/src/api/resources/businessUserEvents/client/Client.ts +++ b/src/api/resources/businessUserEvents/client/Client.ts @@ -2,7 +2,6 @@ * 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"; @@ -12,7 +11,7 @@ import * as errors from "../../../../errors"; export declare namespace BusinessUserEvents { interface Options { - environment?: core.Supplier; + environment: core.Supplier; apiKey: core.Supplier; } @@ -60,16 +59,13 @@ export class BusinessUserEvents { } const _response = await core.fetcher({ - url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.FlagrightEnvironment.Default, - "events/business/user" - ), + url: urlJoin(await core.Supplier.get(this._options.environment), "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": "0.1.2", + "X-Fern-SDK-Version": "1.0.0", }, contentType: "application/json", queryParameters: _queryParams, diff --git a/src/api/resources/businessUsers/client/Client.ts b/src/api/resources/businessUsers/client/Client.ts index f0d6385..f8e677b 100644 --- a/src/api/resources/businessUsers/client/Client.ts +++ b/src/api/resources/businessUsers/client/Client.ts @@ -2,7 +2,6 @@ * 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"; @@ -11,7 +10,7 @@ import * as errors from "../../../../errors"; export declare namespace BusinessUsers { interface Options { - environment?: core.Supplier; + environment: core.Supplier; apiKey: core.Supplier; } @@ -47,16 +46,13 @@ export class BusinessUsers { requestOptions?: BusinessUsers.RequestOptions ): Promise { const _response = await core.fetcher({ - url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.FlagrightEnvironment.Default, - "business/users" - ), + url: urlJoin(await core.Supplier.get(this._options.environment), "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": "0.1.2", + "X-Fern-SDK-Version": "1.0.0", }, contentType: "application/json", body: await serializers.Business.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), @@ -116,16 +112,13 @@ export class BusinessUsers { requestOptions?: BusinessUsers.RequestOptions ): Promise { const _response = await core.fetcher({ - url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.FlagrightEnvironment.Default, - `business/users/${userId}` - ), + url: urlJoin(await core.Supplier.get(this._options.environment), `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": "0.1.2", + "X-Fern-SDK-Version": "1.0.0", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, diff --git a/src/api/resources/consumerUserEvents/client/Client.ts b/src/api/resources/consumerUserEvents/client/Client.ts index 7334840..15a5864 100644 --- a/src/api/resources/consumerUserEvents/client/Client.ts +++ b/src/api/resources/consumerUserEvents/client/Client.ts @@ -2,7 +2,6 @@ * 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"; @@ -12,7 +11,7 @@ import * as errors from "../../../../errors"; export declare namespace ConsumerUserEvents { interface Options { - environment?: core.Supplier; + environment: core.Supplier; apiKey: core.Supplier; } @@ -60,16 +59,13 @@ export class ConsumerUserEvents { } const _response = await core.fetcher({ - url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.FlagrightEnvironment.Default, - "events/consumer/user" - ), + url: urlJoin(await core.Supplier.get(this._options.environment), "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": "0.1.2", + "X-Fern-SDK-Version": "1.0.0", }, contentType: "application/json", queryParameters: _queryParams, diff --git a/src/api/resources/consumerUsers/client/Client.ts b/src/api/resources/consumerUsers/client/Client.ts index 23b7c14..b8e6c63 100644 --- a/src/api/resources/consumerUsers/client/Client.ts +++ b/src/api/resources/consumerUsers/client/Client.ts @@ -2,7 +2,6 @@ * 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"; @@ -11,7 +10,7 @@ import * as errors from "../../../../errors"; export declare namespace ConsumerUsers { interface Options { - environment?: core.Supplier; + environment: core.Supplier; apiKey: core.Supplier; } @@ -46,16 +45,13 @@ export class ConsumerUsers { requestOptions?: ConsumerUsers.RequestOptions ): Promise { const _response = await core.fetcher({ - url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.FlagrightEnvironment.Default, - "consumer/users" - ), + url: urlJoin(await core.Supplier.get(this._options.environment), "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": "0.1.2", + "X-Fern-SDK-Version": "1.0.0", }, contentType: "application/json", body: await serializers.User.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), @@ -112,16 +108,13 @@ export class ConsumerUsers { */ public async get(userId: string, requestOptions?: ConsumerUsers.RequestOptions): Promise { const _response = await core.fetcher({ - url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.FlagrightEnvironment.Default, - `consumer/users/${userId}` - ), + url: urlJoin(await core.Supplier.get(this._options.environment), `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": "0.1.2", + "X-Fern-SDK-Version": "1.0.0", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, diff --git a/src/api/resources/transactionEvents/client/Client.ts b/src/api/resources/transactionEvents/client/Client.ts index f8eb5d0..26950f6 100644 --- a/src/api/resources/transactionEvents/client/Client.ts +++ b/src/api/resources/transactionEvents/client/Client.ts @@ -2,7 +2,6 @@ * 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"; @@ -11,7 +10,7 @@ import * as errors from "../../../../errors"; export declare namespace TransactionEvents { interface Options { - environment?: core.Supplier; + environment: core.Supplier; apiKey: core.Supplier; } @@ -54,16 +53,13 @@ export class TransactionEvents { requestOptions?: TransactionEvents.RequestOptions ): Promise { const _response = await core.fetcher({ - url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.FlagrightEnvironment.Default, - "events/transaction" - ), + url: urlJoin(await core.Supplier.get(this._options.environment), "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": "0.1.2", + "X-Fern-SDK-Version": "1.0.0", }, contentType: "application/json", body: await serializers.TransactionEvent.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), @@ -124,16 +120,13 @@ export class TransactionEvents { requestOptions?: TransactionEvents.RequestOptions ): Promise { const _response = await core.fetcher({ - url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.FlagrightEnvironment.Default, - `events/transaction/${eventId}` - ), + url: urlJoin(await core.Supplier.get(this._options.environment), `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": "0.1.2", + "X-Fern-SDK-Version": "1.0.0", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, diff --git a/src/api/resources/transactions/client/Client.ts b/src/api/resources/transactions/client/Client.ts index 079ff76..1eb2cac 100644 --- a/src/api/resources/transactions/client/Client.ts +++ b/src/api/resources/transactions/client/Client.ts @@ -2,7 +2,6 @@ * 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"; @@ -12,7 +11,7 @@ import * as errors from "../../../../errors"; export declare namespace Transactions { interface Options { - environment?: core.Supplier; + environment: core.Supplier; apiKey: core.Supplier; } @@ -65,16 +64,13 @@ export class Transactions { } const _response = await core.fetcher({ - url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.FlagrightEnvironment.Default, - "transactions" - ), + url: urlJoin(await core.Supplier.get(this._options.environment), "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": "0.1.2", + "X-Fern-SDK-Version": "1.0.0", }, contentType: "application/json", queryParameters: _queryParams, @@ -135,16 +131,13 @@ export class Transactions { requestOptions?: Transactions.RequestOptions ): Promise { const _response = await core.fetcher({ - url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.FlagrightEnvironment.Default, - `transactions/${transactionId}` - ), + url: urlJoin(await core.Supplier.get(this._options.environment), `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": "0.1.2", + "X-Fern-SDK-Version": "1.0.0", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, diff --git a/src/environments.ts b/src/environments.ts deleted file mode 100644 index ec337d1..0000000 --- a/src/environments.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * 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; diff --git a/src/index.ts b/src/index.ts index 5667d00..dafdb93 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,3 @@ export * as Flagright from "./api"; export { FlagrightClient } from "./Client"; -export { FlagrightEnvironment } from "./environments"; export { FlagrightError, FlagrightTimeoutError } from "./errors";