Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"cliVersion": "5.6.0",
"generatorName": "fernapi/fern-typescript-node-sdk",
"generatorVersion": "3.66.6",
"generatorVersion": "3.70.5",
"generatorConfig": {
"allowCustomFetcher": true,
"includeApiReference": true,
Expand Down Expand Up @@ -52,10 +52,10 @@
]
}
},
"originGitCommit": "e82d22946ead3625acd2ff64d8017582cdb1b791",
"originGitCommit": "4fd82021eff164a6f2484d4504850c46fe8f4a95",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"requestedVersion": "1.4.7",
"requestedVersion": "1.4.6",
"ciProvider": "github",
"sdkVersion": "1.4.7"
"sdkVersion": "1.4.6"
}
5 changes: 5 additions & 0 deletions .fern/verify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -euo pipefail
yarn install
yarn build
yarn test
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@schematichq/schematic-typescript-node",
"version": "1.4.7",
"version": "1.4.6",
"private": false,
"repository": {
"type": "git",
Expand Down Expand Up @@ -42,7 +42,7 @@
"ts-jest": "^29.3.4",
"jest-environment-jsdom": "^29.7.0",
"msw": "2.11.2",
"@types/node": "^18.19.70",
"@types/node": "^20.0.0",
"typescript": "~5.9.3",
"@biomejs/biome": "2.4.10",
"esbuild": "^0.25.9",
Expand Down
12 changes: 12 additions & 0 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -3229,6 +3229,7 @@ await client.credits.listBillingPlanCreditGrants({
planId: "plan_id",
planIds: ["plan_ids"],
planVersionId: "plan_version_id",
planVersionIds: ["plan_version_ids"],
limit: 1000000,
offset: 1000000
});
Expand Down Expand Up @@ -3509,6 +3510,7 @@ await client.credits.countBillingPlanCreditGrants({
planId: "plan_id",
planIds: ["plan_ids"],
planVersionId: "plan_version_id",
planVersionIds: ["plan_version_ids"],
limit: 1000000,
offset: 1000000
});
Expand Down Expand Up @@ -3682,6 +3684,9 @@ await client.checkout.internal({
addOnId: "add_on_id",
priceId: "price_id"
}],
autoTopupOverrides: [{
planCreditGrantId: "plan_credit_grant_id"
}],
companyId: "company_id",
creditBundles: [{
bundleId: "bundle_id",
Expand Down Expand Up @@ -3799,6 +3804,9 @@ await client.checkout.previewCheckoutInternal({
addOnId: "add_on_id",
priceId: "price_id"
}],
autoTopupOverrides: [{
planCreditGrantId: "plan_credit_grant_id"
}],
companyId: "company_id",
creditBundles: [{
bundleId: "bundle_id",
Expand Down Expand Up @@ -7511,6 +7519,7 @@ await client.plans.createCustomPlan({
```typescript
await client.plans.listPlans({
companyId: "company_id",
companyScopedOnly: true,
excludeCompanyScoped: true,
forFallbackPlan: true,
forInitialPlan: true,
Expand Down Expand Up @@ -8019,6 +8028,7 @@ await client.plans.countBillingProductMatchCompanies({
```typescript
await client.plans.countPlans({
companyId: "company_id",
companyScopedOnly: true,
excludeCompanyScoped: true,
forFallbackPlan: true,
forInitialPlan: true,
Expand Down Expand Up @@ -9036,6 +9046,7 @@ await client.features.listFeatures({
booleanRequireEvent: true,
featureType: ["boolean"],
ids: ["ids"],
managedBy: "orb",
planVersionId: "plan_version_id",
q: "q",
withoutCompanyOverrideFor: "without_company_override_for",
Expand Down Expand Up @@ -9358,6 +9369,7 @@ await client.features.countFeatures({
booleanRequireEvent: true,
featureType: ["boolean"],
ids: ["ids"],
managedBy: "orb",
planVersionId: "plan_version_id",
q: "q",
withoutCompanyOverrideFor: "without_company_override_for",
Expand Down
29 changes: 27 additions & 2 deletions src/BaseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import * as core from "./core";
import { mergeHeaders } from "./core/headers";
import type * as environments from "./environments";

export type AuthOption =
| false
| core.AuthProvider["getAuthRequest"]
| core.AuthProvider
| HeaderAuthProvider.AuthOptions;

export type BaseClientOptions = {
environment?: core.Supplier<environments.SchematicEnvironment | string>;
/** Specify a custom URL to connect the client to. */
Expand All @@ -20,6 +26,8 @@ export type BaseClientOptions = {
fetcher?: core.FetchFunction;
/** Configure logging for the client. */
logging?: core.logging.LogConfig | core.logging.Logger;
/** Override auth. Pass false to disable, a function returning auth headers, an AuthProvider, or auth options. */
auth?: AuthOption;
} & HeaderAuthProvider.AuthOptions;

export interface BaseRequestOptions {
Expand Down Expand Up @@ -52,8 +60,8 @@ export function normalizeClientOptions<T extends BaseClientOptions = BaseClientO
{
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@schematichq/schematic-typescript-node",
"X-Fern-SDK-Version": "1.4.7",
"User-Agent": "@schematichq/schematic-typescript-node/1.4.7",
"X-Fern-SDK-Version": "1.4.6",
"User-Agent": "@schematichq/schematic-typescript-node/1.4.6",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand All @@ -71,6 +79,23 @@ export function normalizeClientOptionsWithAuth<T extends BaseClientOptions = Bas
options: T,
): NormalizedClientOptionsWithAuth<T> {
const normalized = normalizeClientOptions(options) as NormalizedClientOptionsWithAuth<T>;

if (options.auth === false) {
normalized.authProvider = new core.NoOpAuthProvider();
return normalized;
}
if (options.auth != null) {
if (typeof options.auth === "function") {
normalized.authProvider = { getAuthRequest: options.auth };
return normalized;
}
if (core.isAuthProvider(options.auth)) {
normalized.authProvider = options.auth;
return normalized;
}
Object.assign(normalized, options.auth);
}

const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);
normalized.authProvider ??= new HeaderAuthProvider(normalizedWithNoOpAuthProvider);
return normalized;
Expand Down
6 changes: 6 additions & 0 deletions src/api/resources/checkout/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ export class CheckoutClient {
* addOnId: "add_on_id",
* priceId: "price_id"
* }],
* autoTopupOverrides: [{
* planCreditGrantId: "plan_credit_grant_id"
* }],
* companyId: "company_id",
* creditBundles: [{
* bundleId: "bundle_id",
Expand Down Expand Up @@ -322,6 +325,9 @@ export class CheckoutClient {
* addOnId: "add_on_id",
* priceId: "price_id"
* }],
* autoTopupOverrides: [{
* planCreditGrantId: "plan_credit_grant_id"
* }],
* companyId: "company_id",
* creditBundles: [{
* bundleId: "bundle_id",
Expand Down
8 changes: 6 additions & 2 deletions src/api/resources/credits/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3022,6 +3022,7 @@ export class CreditsClient {
* planId: "plan_id",
* planIds: ["plan_ids"],
* planVersionId: "plan_version_id",
* planVersionIds: ["plan_version_ids"],
* limit: 1000000,
* offset: 1000000
* })
Expand All @@ -3037,13 +3038,14 @@ export class CreditsClient {
request: Schematic.ListBillingPlanCreditGrantsRequest = {},
requestOptions?: CreditsClient.RequestOptions,
): Promise<core.WithRawResponse<Schematic.ListBillingPlanCreditGrantsResponse>> {
const { creditId, ids, planId, planIds, planVersionId, limit, offset } = request;
const { creditId, ids, planId, planIds, planVersionId, planVersionIds, limit, offset } = request;
const _queryParams: Record<string, unknown> = {
credit_id: creditId,
ids,
plan_id: planId,
plan_ids: planIds,
plan_version_id: planVersionId,
plan_version_ids: planVersionIds,
limit,
offset,
};
Expand Down Expand Up @@ -3728,6 +3730,7 @@ export class CreditsClient {
* planId: "plan_id",
* planIds: ["plan_ids"],
* planVersionId: "plan_version_id",
* planVersionIds: ["plan_version_ids"],
* limit: 1000000,
* offset: 1000000
* })
Expand All @@ -3743,13 +3746,14 @@ export class CreditsClient {
request: Schematic.CountBillingPlanCreditGrantsRequest = {},
requestOptions?: CreditsClient.RequestOptions,
): Promise<core.WithRawResponse<Schematic.CountBillingPlanCreditGrantsResponse>> {
const { creditId, ids, planId, planIds, planVersionId, limit, offset } = request;
const { creditId, ids, planId, planIds, planVersionId, planVersionIds, limit, offset } = request;
const _queryParams: Record<string, unknown> = {
credit_id: creditId,
ids,
plan_id: planId,
plan_ids: planIds,
plan_version_id: planVersionId,
plan_version_ids: planVersionIds,
limit,
offset,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* planId: "plan_id",
* planIds: ["plan_ids"],
* planVersionId: "plan_version_id",
* planVersionIds: ["plan_version_ids"],
* limit: 1000000,
* offset: 1000000
* }
Expand All @@ -18,6 +19,7 @@ export interface CountBillingPlanCreditGrantsRequest {
planId?: string;
planIds?: string | string[];
planVersionId?: string;
planVersionIds?: string | string[];
/** Page limit (default 100) */
limit?: number;
/** Page offset (default 0) */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* planId: "plan_id",
* planIds: ["plan_ids"],
* planVersionId: "plan_version_id",
* planVersionIds: ["plan_version_ids"],
* limit: 1000000,
* offset: 1000000
* }
Expand All @@ -18,6 +19,7 @@ export interface ListBillingPlanCreditGrantsRequest {
planId?: string;
planIds?: string | string[];
planVersionId?: string;
planVersionIds?: string | string[];
/** Page limit (default 100) */
limit?: number;
/** Page offset (default 0) */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ export interface CountBillingPlanCreditGrantsParams {
planId?: string;
planIds?: string[];
planVersionId?: string;
planVersionIds?: string[];
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ export interface ListBillingPlanCreditGrantsParams {
planId?: string;
planIds?: string[];
planVersionId?: string;
planVersionIds?: string[];
}
12 changes: 12 additions & 0 deletions src/api/resources/features/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export class FeaturesClient {
* booleanRequireEvent: true,
* featureType: ["boolean"],
* ids: ["ids"],
* managedBy: "orb",
* planVersionId: "plan_version_id",
* q: "q",
* withoutCompanyOverrideFor: "without_company_override_for",
Expand All @@ -61,6 +62,7 @@ export class FeaturesClient {
booleanRequireEvent,
featureType,
ids,
managedBy,
planVersionId,
q,
withoutCompanyOverrideFor,
Expand All @@ -78,6 +80,10 @@ export class FeaturesClient {
? serializers.FeatureType.jsonOrThrow(featureType, { unrecognizedObjectKeys: "strip" })
: undefined,
ids,
managed_by:
managedBy != null
? serializers.BillingProviderType.jsonOrThrow(managedBy, { unrecognizedObjectKeys: "strip" })
: undefined,
plan_version_id: planVersionId,
q,
without_company_override_for: withoutCompanyOverrideFor,
Expand Down Expand Up @@ -860,6 +866,7 @@ export class FeaturesClient {
* booleanRequireEvent: true,
* featureType: ["boolean"],
* ids: ["ids"],
* managedBy: "orb",
* planVersionId: "plan_version_id",
* q: "q",
* withoutCompanyOverrideFor: "without_company_override_for",
Expand All @@ -883,6 +890,7 @@ export class FeaturesClient {
booleanRequireEvent,
featureType,
ids,
managedBy,
planVersionId,
q,
withoutCompanyOverrideFor,
Expand All @@ -900,6 +908,10 @@ export class FeaturesClient {
? serializers.FeatureType.jsonOrThrow(featureType, { unrecognizedObjectKeys: "strip" })
: undefined,
ids,
managed_by:
managedBy != null
? serializers.BillingProviderType.jsonOrThrow(managedBy, { unrecognizedObjectKeys: "strip" })
: undefined,
plan_version_id: planVersionId,
q,
without_company_override_for: withoutCompanyOverrideFor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type * as Schematic from "../../../../index";
* booleanRequireEvent: true,
* featureType: ["boolean"],
* ids: ["ids"],
* managedBy: "orb",
* planVersionId: "plan_version_id",
* q: "q",
* withoutCompanyOverrideFor: "without_company_override_for",
Expand All @@ -22,6 +23,8 @@ export interface CountFeaturesRequest {
/** Filter by one or more feature types (boolean, event, trait) */
featureType?: Schematic.FeatureType | Schematic.FeatureType[];
ids?: string | string[];
/** Filter for features managed by a billing provider, or by Schematic (no billing provider) */
managedBy?: Schematic.BillingProviderType;
/** Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used */
planVersionId?: string;
/** Search by feature name or ID */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type * as Schematic from "../../../../index";
* booleanRequireEvent: true,
* featureType: ["boolean"],
* ids: ["ids"],
* managedBy: "orb",
* planVersionId: "plan_version_id",
* q: "q",
* withoutCompanyOverrideFor: "without_company_override_for",
Expand All @@ -22,6 +23,8 @@ export interface ListFeaturesRequest {
/** Filter by one or more feature types (boolean, event, trait) */
featureType?: Schematic.FeatureType | Schematic.FeatureType[];
ids?: string | string[];
/** Filter for features managed by a billing provider, or by Schematic (no billing provider) */
managedBy?: Schematic.BillingProviderType;
/** Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used */
planVersionId?: string;
/** Search by feature name or ID */
Expand Down
2 changes: 2 additions & 0 deletions src/api/resources/features/types/CountFeaturesParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export interface CountFeaturesParams {
ids?: string[];
/** Page limit (default 100) */
limit?: number;
/** Filter for features managed by a billing provider, or by Schematic (no billing provider) */
managedBy?: Schematic.BillingProviderType;
/** Page offset (default 0) */
offset?: number;
/** Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used */
Expand Down
2 changes: 2 additions & 0 deletions src/api/resources/features/types/ListFeaturesParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export interface ListFeaturesParams {
ids?: string[];
/** Page limit (default 100) */
limit?: number;
/** Filter for features managed by a billing provider, or by Schematic (no billing provider) */
managedBy?: Schematic.BillingProviderType;
/** Page offset (default 0) */
offset?: number;
/** Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used */
Expand Down
Loading