diff --git a/.fern/metadata.json b/.fern/metadata.json index d1414ffd..9d76c5ac 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -53,10 +53,10 @@ ] } }, - "originGitCommit": "19cafdf92ab056ef6ba803bf1e352b0422a8ec45", + "originGitCommit": "86a4c45d14847babf70751d87de4da7764ecd894", "originGitCommitIsDirty": false, "invokedBy": "ci", - "requestedVersion": "1.5.4", + "requestedVersion": "1.5.5", "ciProvider": "github", - "sdkVersion": "1.5.4" + "sdkVersion": "1.5.5" } diff --git a/.fern/replay.lock b/.fern/replay.lock index 4d8d6cc6..b8cb9bbe 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -18,5 +18,11 @@ generations: cli_version: unknown generator_versions: fernapi/fern-typescript-node-sdk: 3.70.7 -current_generation: 7277c2f9c5bd737e27f6d3a0bad9a899a50f3af1 + - commit_sha: 690e2a4195915e188edcdfd7c7c92e3e4b8d45c0 + tree_hash: 29c7eed46f0dbaed7c4757d2254f56d477b340ba + timestamp: 2026-07-20T16:23:20.643Z + cli_version: unknown + generator_versions: + fernapi/fern-typescript-node-sdk: 3.70.7 +current_generation: 690e2a4195915e188edcdfd7c7c92e3e4b8d45c0 patches: [] diff --git a/package.json b/package.json index cb2ee084..37c1e2b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@schematichq/schematic-typescript-node", - "version": "1.5.4", + "version": "1.5.5", "private": false, "repository": { "type": "git", diff --git a/reference.md b/reference.md index 98caefdd..0fd29f53 100644 --- a/reference.md +++ b/reference.md @@ -4009,6 +4009,749 @@ await client.credits.countCreditEventLedger({ + + + + +## catalogs +
client.catalogs.listCatalogs({ ...params }) -> Schematic.ListCatalogsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.catalogs.listCatalogs({ + isDefault: true, + q: "q", + limit: 1000000, + offset: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Schematic.ListCatalogsRequest` + +
+
+ +
+
+ +**requestOptions:** `CatalogsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.createCatalog({ ...params }) -> Schematic.CreateCatalogResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.catalogs.createCatalog({ + isDefault: true, + name: "name" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Schematic.CreateCatalogRequestBody` + +
+
+ +
+
+ +**requestOptions:** `CatalogsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.getCatalog(catalog_id) -> Schematic.GetCatalogResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.catalogs.getCatalog("catalog_id"); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `string` — catalog_id + +
+
+ +
+
+ +**requestOptions:** `CatalogsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.updateCatalog(catalog_id, { ...params }) -> Schematic.UpdateCatalogResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.catalogs.updateCatalog("catalog_id"); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `string` — catalog_id + +
+
+ +
+
+ +**request:** `Schematic.UpdateCatalogRequestBody` + +
+
+ +
+
+ +**requestOptions:** `CatalogsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.deleteCatalog(catalog_id) -> Schematic.DeleteCatalogResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.catalogs.deleteCatalog("catalog_id"); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `string` — catalog_id + +
+
+ +
+
+ +**requestOptions:** `CatalogsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.getConfiguration(catalog_id) -> Schematic.GetConfigurationResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.catalogs.getConfiguration("catalog_id"); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `string` — catalog_id + +
+
+ +
+
+ +**requestOptions:** `CatalogsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.updateConfiguration(catalog_id, { ...params }) -> Schematic.UpdateConfigurationResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.catalogs.updateConfiguration("catalog_id"); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `string` — catalog_id + +
+
+ +
+
+ +**request:** `Schematic.UpdateCatalogConfigurationRequestBody` + +
+
+ +
+
+ +**requestOptions:** `CatalogsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.getCreditBundlesInCatalog(catalog_id) -> Schematic.GetCreditBundlesInCatalogResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.catalogs.getCreditBundlesInCatalog("catalog_id"); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `string` — catalog_id + +
+
+ +
+
+ +**requestOptions:** `CatalogsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.addCreditBundle(catalog_id, credit_bundle_id) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.catalogs.addCreditBundle("catalog_id", "credit_bundle_id"); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `string` — catalog_id + +
+
+ +
+
+ +**credit_bundle_id:** `string` — credit_bundle_id + +
+
+ +
+
+ +**requestOptions:** `CatalogsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.removeCreditBundle(catalog_id, credit_bundle_id) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.catalogs.removeCreditBundle("catalog_id", "credit_bundle_id"); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `string` — catalog_id + +
+
+ +
+
+ +**credit_bundle_id:** `string` — credit_bundle_id + +
+
+ +
+
+ +**requestOptions:** `CatalogsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.getDerivedFeatures(catalog_id) -> Schematic.GetDerivedFeaturesResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.catalogs.getDerivedFeatures("catalog_id"); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `string` — catalog_id + +
+
+ +
+
+ +**requestOptions:** `CatalogsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.getPlansInCatalog(catalog_id) -> Schematic.GetPlansInCatalogResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.catalogs.getPlansInCatalog("catalog_id"); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `string` — catalog_id + +
+
+ +
+
+ +**requestOptions:** `CatalogsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.addPlan(catalog_id, plan_id) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.catalogs.addPlan("catalog_id", "plan_id"); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `string` — catalog_id + +
+
+ +
+
+ +**plan_id:** `string` — plan_id + +
+
+ +
+
+ +**requestOptions:** `CatalogsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.removePlan(catalog_id, plan_id) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.catalogs.removePlan("catalog_id", "plan_id"); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `string` — catalog_id + +
+
+ +
+
+ +**plan_id:** `string` — plan_id + +
+
+ +
+
+ +**requestOptions:** `CatalogsClient.RequestOptions` + +
+
+
+
+ +
@@ -9034,6 +9777,63 @@ await client.components.deleteComponent("component_id"); + + + + +
client.components.bindCatalog(component_id, { ...params }) -> Schematic.BindCatalogResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.components.bindCatalog("component_id"); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**component_id:** `string` — component_id + +
+
+ +
+
+ +**request:** `Schematic.BindCatalogRequestBody` + +
+
+ +
+
+ +**requestOptions:** `ComponentsClient.RequestOptions` + +
+
+
+
+ +
@@ -9312,6 +10112,60 @@ await client.planbundle.updatePlanBundle("plan_bundle_id", { ## dataexports +
client.dataexports.listDataExports({ ...params }) -> Schematic.ListDataExportsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.dataexports.listDataExports({ + exportType: "audit-log", + status: "failure", + limit: 1000000, + offset: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Schematic.ListDataExportsRequest` + +
+
+ +
+
+ +**requestOptions:** `DataexportsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+
client.dataexports.createDataExport({ ...params }) -> Schematic.CreateDataExportResponse
@@ -9326,7 +10180,8 @@ await client.planbundle.updatePlanBundle("plan_bundle_id", { ```typescript await client.dataexports.createDataExport({ - metadata: "metadata" + exportType: "audit-log", + outputFileType: "csv" }); ``` @@ -9359,6 +10214,55 @@ await client.dataexports.createDataExport({
+ + +
+ +
client.dataexports.getDataExport(data_export_id) -> Schematic.GetDataExportResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.dataexports.getDataExport("data_export_id"); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**data_export_id:** `string` — data_export_id + +
+
+ +
+
+ +**requestOptions:** `DataexportsClient.RequestOptions` + +
+
+
+
+ +
diff --git a/src/BaseClient.ts b/src/BaseClient.ts index d33f4f87..833d5b4e 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -60,8 +60,8 @@ export function normalizeClientOptions; + + constructor(options: CatalogsClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {Schematic.ListCatalogsRequest} request + * @param {CatalogsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Schematic.BadRequestError} + * @throws {@link Schematic.UnauthorizedError} + * @throws {@link Schematic.ForbiddenError} + * @throws {@link Schematic.NotFoundError} + * @throws {@link Schematic.InternalServerError} + * + * @example + * await client.catalogs.listCatalogs({ + * isDefault: true, + * q: "q", + * limit: 1000000, + * offset: 1000000 + * }) + */ + public listCatalogs( + request: Schematic.ListCatalogsRequest = {}, + requestOptions?: CatalogsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__listCatalogs(request, requestOptions)); + } + + private async __listCatalogs( + request: Schematic.ListCatalogsRequest = {}, + requestOptions?: CatalogsClient.RequestOptions, + ): Promise> { + const { isDefault, q, limit, offset } = request; + const _queryParams: Record = { + is_default: isDefault, + q, + limit, + offset, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SchematicEnvironment.Default, + "catalogs", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListCatalogsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Schematic.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 401: + throw new Schematic.UnauthorizedError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Schematic.ForbiddenError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Schematic.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Schematic.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.SchematicError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/catalogs"); + } + + /** + * @param {Schematic.CreateCatalogRequestBody} request + * @param {CatalogsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Schematic.BadRequestError} + * @throws {@link Schematic.UnauthorizedError} + * @throws {@link Schematic.ForbiddenError} + * @throws {@link Schematic.NotFoundError} + * @throws {@link Schematic.InternalServerError} + * + * @example + * await client.catalogs.createCatalog({ + * isDefault: true, + * name: "name" + * }) + */ + public createCatalog( + request: Schematic.CreateCatalogRequestBody, + requestOptions?: CatalogsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createCatalog(request, requestOptions)); + } + + private async __createCatalog( + request: Schematic.CreateCatalogRequestBody, + requestOptions?: CatalogsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SchematicEnvironment.Default, + "catalogs", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + requestType: "json", + body: serializers.CreateCatalogRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.CreateCatalogResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Schematic.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 401: + throw new Schematic.UnauthorizedError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Schematic.ForbiddenError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Schematic.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Schematic.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.SchematicError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/catalogs"); + } + + /** + * @param {string} catalog_id - catalog_id + * @param {CatalogsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Schematic.UnauthorizedError} + * @throws {@link Schematic.ForbiddenError} + * @throws {@link Schematic.NotFoundError} + * @throws {@link Schematic.InternalServerError} + * + * @example + * await client.catalogs.getCatalog("catalog_id") + */ + public getCatalog( + catalog_id: string, + requestOptions?: CatalogsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getCatalog(catalog_id, requestOptions)); + } + + private async __getCatalog( + catalog_id: string, + requestOptions?: CatalogsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SchematicEnvironment.Default, + `catalogs/${core.url.encodePathParam(catalog_id)}`, + ), + method: "GET", + headers: _headers, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.GetCatalogResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Schematic.UnauthorizedError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Schematic.ForbiddenError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Schematic.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Schematic.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.SchematicError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/catalogs/{catalog_id}"); + } + + /** + * @param {string} catalog_id - catalog_id + * @param {Schematic.UpdateCatalogRequestBody} request + * @param {CatalogsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Schematic.BadRequestError} + * @throws {@link Schematic.UnauthorizedError} + * @throws {@link Schematic.ForbiddenError} + * @throws {@link Schematic.NotFoundError} + * @throws {@link Schematic.InternalServerError} + * + * @example + * await client.catalogs.updateCatalog("catalog_id") + */ + public updateCatalog( + catalog_id: string, + request: Schematic.UpdateCatalogRequestBody = {}, + requestOptions?: CatalogsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateCatalog(catalog_id, request, requestOptions)); + } + + private async __updateCatalog( + catalog_id: string, + request: Schematic.UpdateCatalogRequestBody = {}, + requestOptions?: CatalogsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SchematicEnvironment.Default, + `catalogs/${core.url.encodePathParam(catalog_id)}`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + requestType: "json", + body: serializers.UpdateCatalogRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.UpdateCatalogResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Schematic.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 401: + throw new Schematic.UnauthorizedError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Schematic.ForbiddenError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Schematic.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Schematic.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.SchematicError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/catalogs/{catalog_id}"); + } + + /** + * @param {string} catalog_id - catalog_id + * @param {CatalogsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Schematic.BadRequestError} + * @throws {@link Schematic.UnauthorizedError} + * @throws {@link Schematic.ForbiddenError} + * @throws {@link Schematic.NotFoundError} + * @throws {@link Schematic.InternalServerError} + * + * @example + * await client.catalogs.deleteCatalog("catalog_id") + */ + public deleteCatalog( + catalog_id: string, + requestOptions?: CatalogsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteCatalog(catalog_id, requestOptions)); + } + + private async __deleteCatalog( + catalog_id: string, + requestOptions?: CatalogsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SchematicEnvironment.Default, + `catalogs/${core.url.encodePathParam(catalog_id)}`, + ), + method: "DELETE", + headers: _headers, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.DeleteCatalogResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Schematic.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 401: + throw new Schematic.UnauthorizedError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Schematic.ForbiddenError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Schematic.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Schematic.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.SchematicError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/catalogs/{catalog_id}"); + } + + /** + * @param {string} catalog_id - catalog_id + * @param {CatalogsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Schematic.UnauthorizedError} + * @throws {@link Schematic.ForbiddenError} + * @throws {@link Schematic.NotFoundError} + * @throws {@link Schematic.InternalServerError} + * + * @example + * await client.catalogs.getConfiguration("catalog_id") + */ + public getConfiguration( + catalog_id: string, + requestOptions?: CatalogsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getConfiguration(catalog_id, requestOptions)); + } + + private async __getConfiguration( + catalog_id: string, + requestOptions?: CatalogsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SchematicEnvironment.Default, + `catalogs/${core.url.encodePathParam(catalog_id)}/configuration`, + ), + method: "GET", + headers: _headers, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.GetConfigurationResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Schematic.UnauthorizedError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Schematic.ForbiddenError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Schematic.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Schematic.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.SchematicError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/catalogs/{catalog_id}/configuration", + ); + } + + /** + * @param {string} catalog_id - catalog_id + * @param {Schematic.UpdateCatalogConfigurationRequestBody} request + * @param {CatalogsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Schematic.BadRequestError} + * @throws {@link Schematic.UnauthorizedError} + * @throws {@link Schematic.ForbiddenError} + * @throws {@link Schematic.NotFoundError} + * @throws {@link Schematic.InternalServerError} + * + * @example + * await client.catalogs.updateConfiguration("catalog_id") + */ + public updateConfiguration( + catalog_id: string, + request: Schematic.UpdateCatalogConfigurationRequestBody = {}, + requestOptions?: CatalogsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateConfiguration(catalog_id, request, requestOptions)); + } + + private async __updateConfiguration( + catalog_id: string, + request: Schematic.UpdateCatalogConfigurationRequestBody = {}, + requestOptions?: CatalogsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SchematicEnvironment.Default, + `catalogs/${core.url.encodePathParam(catalog_id)}/configuration`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + requestType: "json", + body: serializers.UpdateCatalogConfigurationRequestBody.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + }), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.UpdateConfigurationResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Schematic.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 401: + throw new Schematic.UnauthorizedError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Schematic.ForbiddenError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Schematic.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Schematic.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.SchematicError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/catalogs/{catalog_id}/configuration", + ); + } + + /** + * @param {string} catalog_id - catalog_id + * @param {CatalogsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Schematic.UnauthorizedError} + * @throws {@link Schematic.ForbiddenError} + * @throws {@link Schematic.NotFoundError} + * @throws {@link Schematic.InternalServerError} + * + * @example + * await client.catalogs.getCreditBundlesInCatalog("catalog_id") + */ + public getCreditBundlesInCatalog( + catalog_id: string, + requestOptions?: CatalogsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getCreditBundlesInCatalog(catalog_id, requestOptions)); + } + + private async __getCreditBundlesInCatalog( + catalog_id: string, + requestOptions?: CatalogsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SchematicEnvironment.Default, + `catalogs/${core.url.encodePathParam(catalog_id)}/credit-bundles`, + ), + method: "GET", + headers: _headers, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.GetCreditBundlesInCatalogResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Schematic.UnauthorizedError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Schematic.ForbiddenError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Schematic.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Schematic.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.SchematicError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/catalogs/{catalog_id}/credit-bundles", + ); + } + + /** + * @param {string} catalog_id - catalog_id + * @param {string} credit_bundle_id - credit_bundle_id + * @param {CatalogsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Schematic.BadRequestError} + * @throws {@link Schematic.UnauthorizedError} + * @throws {@link Schematic.ForbiddenError} + * @throws {@link Schematic.NotFoundError} + * @throws {@link Schematic.InternalServerError} + * + * @example + * await client.catalogs.addCreditBundle("catalog_id", "credit_bundle_id") + */ + public addCreditBundle( + catalog_id: string, + credit_bundle_id: string, + requestOptions?: CatalogsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise( + this.__addCreditBundle(catalog_id, credit_bundle_id, requestOptions), + ); + } + + private async __addCreditBundle( + catalog_id: string, + credit_bundle_id: string, + requestOptions?: CatalogsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SchematicEnvironment.Default, + `catalogs/${core.url.encodePathParam(catalog_id)}/credit-bundles/${core.url.encodePathParam(credit_bundle_id)}`, + ), + method: "POST", + headers: _headers, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Schematic.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 401: + throw new Schematic.UnauthorizedError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Schematic.ForbiddenError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Schematic.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Schematic.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.SchematicError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/catalogs/{catalog_id}/credit-bundles/{credit_bundle_id}", + ); + } + + /** + * @param {string} catalog_id - catalog_id + * @param {string} credit_bundle_id - credit_bundle_id + * @param {CatalogsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Schematic.BadRequestError} + * @throws {@link Schematic.UnauthorizedError} + * @throws {@link Schematic.ForbiddenError} + * @throws {@link Schematic.NotFoundError} + * @throws {@link Schematic.InternalServerError} + * + * @example + * await client.catalogs.removeCreditBundle("catalog_id", "credit_bundle_id") + */ + public removeCreditBundle( + catalog_id: string, + credit_bundle_id: string, + requestOptions?: CatalogsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise( + this.__removeCreditBundle(catalog_id, credit_bundle_id, requestOptions), + ); + } + + private async __removeCreditBundle( + catalog_id: string, + credit_bundle_id: string, + requestOptions?: CatalogsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SchematicEnvironment.Default, + `catalogs/${core.url.encodePathParam(catalog_id)}/credit-bundles/${core.url.encodePathParam(credit_bundle_id)}`, + ), + method: "DELETE", + headers: _headers, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Schematic.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 401: + throw new Schematic.UnauthorizedError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Schematic.ForbiddenError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Schematic.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Schematic.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.SchematicError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/catalogs/{catalog_id}/credit-bundles/{credit_bundle_id}", + ); + } + + /** + * @param {string} catalog_id - catalog_id + * @param {CatalogsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Schematic.UnauthorizedError} + * @throws {@link Schematic.ForbiddenError} + * @throws {@link Schematic.NotFoundError} + * @throws {@link Schematic.InternalServerError} + * + * @example + * await client.catalogs.getDerivedFeatures("catalog_id") + */ + public getDerivedFeatures( + catalog_id: string, + requestOptions?: CatalogsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getDerivedFeatures(catalog_id, requestOptions)); + } + + private async __getDerivedFeatures( + catalog_id: string, + requestOptions?: CatalogsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SchematicEnvironment.Default, + `catalogs/${core.url.encodePathParam(catalog_id)}/features`, + ), + method: "GET", + headers: _headers, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.GetDerivedFeaturesResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Schematic.UnauthorizedError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Schematic.ForbiddenError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Schematic.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Schematic.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.SchematicError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/catalogs/{catalog_id}/features", + ); + } + + /** + * @param {string} catalog_id - catalog_id + * @param {CatalogsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Schematic.UnauthorizedError} + * @throws {@link Schematic.ForbiddenError} + * @throws {@link Schematic.NotFoundError} + * @throws {@link Schematic.InternalServerError} + * + * @example + * await client.catalogs.getPlansInCatalog("catalog_id") + */ + public getPlansInCatalog( + catalog_id: string, + requestOptions?: CatalogsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getPlansInCatalog(catalog_id, requestOptions)); + } + + private async __getPlansInCatalog( + catalog_id: string, + requestOptions?: CatalogsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SchematicEnvironment.Default, + `catalogs/${core.url.encodePathParam(catalog_id)}/plans`, + ), + method: "GET", + headers: _headers, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.GetPlansInCatalogResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Schematic.UnauthorizedError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Schematic.ForbiddenError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Schematic.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Schematic.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.SchematicError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/catalogs/{catalog_id}/plans"); + } + + /** + * @param {string} catalog_id - catalog_id + * @param {string} plan_id - plan_id + * @param {CatalogsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Schematic.BadRequestError} + * @throws {@link Schematic.UnauthorizedError} + * @throws {@link Schematic.ForbiddenError} + * @throws {@link Schematic.NotFoundError} + * @throws {@link Schematic.InternalServerError} + * + * @example + * await client.catalogs.addPlan("catalog_id", "plan_id") + */ + public addPlan( + catalog_id: string, + plan_id: string, + requestOptions?: CatalogsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__addPlan(catalog_id, plan_id, requestOptions)); + } + + private async __addPlan( + catalog_id: string, + plan_id: string, + requestOptions?: CatalogsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SchematicEnvironment.Default, + `catalogs/${core.url.encodePathParam(catalog_id)}/plans/${core.url.encodePathParam(plan_id)}`, + ), + method: "POST", + headers: _headers, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Schematic.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 401: + throw new Schematic.UnauthorizedError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Schematic.ForbiddenError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Schematic.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Schematic.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.SchematicError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/catalogs/{catalog_id}/plans/{plan_id}", + ); + } + + /** + * @param {string} catalog_id - catalog_id + * @param {string} plan_id - plan_id + * @param {CatalogsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Schematic.BadRequestError} + * @throws {@link Schematic.UnauthorizedError} + * @throws {@link Schematic.ForbiddenError} + * @throws {@link Schematic.NotFoundError} + * @throws {@link Schematic.InternalServerError} + * + * @example + * await client.catalogs.removePlan("catalog_id", "plan_id") + */ + public removePlan( + catalog_id: string, + plan_id: string, + requestOptions?: CatalogsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__removePlan(catalog_id, plan_id, requestOptions)); + } + + private async __removePlan( + catalog_id: string, + plan_id: string, + requestOptions?: CatalogsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SchematicEnvironment.Default, + `catalogs/${core.url.encodePathParam(catalog_id)}/plans/${core.url.encodePathParam(plan_id)}`, + ), + method: "DELETE", + headers: _headers, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Schematic.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 401: + throw new Schematic.UnauthorizedError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Schematic.ForbiddenError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Schematic.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Schematic.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.SchematicError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/catalogs/{catalog_id}/plans/{plan_id}", + ); + } +} diff --git a/src/api/resources/catalogs/client/index.ts b/src/api/resources/catalogs/client/index.ts new file mode 100644 index 00000000..415726b7 --- /dev/null +++ b/src/api/resources/catalogs/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/catalogs/client/requests/CreateCatalogRequestBody.ts b/src/api/resources/catalogs/client/requests/CreateCatalogRequestBody.ts new file mode 100644 index 00000000..00354de9 --- /dev/null +++ b/src/api/resources/catalogs/client/requests/CreateCatalogRequestBody.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * isDefault: true, + * name: "name" + * } + */ +export interface CreateCatalogRequestBody { + description?: string; + isDefault: boolean; + name: string; +} diff --git a/src/api/resources/catalogs/client/requests/ListCatalogsRequest.ts b/src/api/resources/catalogs/client/requests/ListCatalogsRequest.ts new file mode 100644 index 00000000..9a26a0f1 --- /dev/null +++ b/src/api/resources/catalogs/client/requests/ListCatalogsRequest.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * isDefault: true, + * q: "q", + * limit: 1000000, + * offset: 1000000 + * } + */ +export interface ListCatalogsRequest { + isDefault?: boolean; + /** Search by catalog name */ + q?: string; + /** Page limit (default 100) */ + limit?: number; + /** Page offset (default 0) */ + offset?: number; +} diff --git a/src/api/resources/catalogs/client/requests/UpdateCatalogConfigurationRequestBody.ts b/src/api/resources/catalogs/client/requests/UpdateCatalogConfigurationRequestBody.ts new file mode 100644 index 00000000..14c746ea --- /dev/null +++ b/src/api/resources/catalogs/client/requests/UpdateCatalogConfigurationRequestBody.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../index"; + +/** + * @example + * {} + */ +export interface UpdateCatalogConfigurationRequestBody { + customPlanCtaText?: string; + customPlanCtaUrl?: string; + customPlanPriceText?: string; + customPlansVisible?: boolean; + orderedAddOns?: Schematic.CatalogConfigOrderedPlan[]; + orderedBundles?: Schematic.CatalogConfigOrderedBundle[]; + orderedPlans?: Schematic.CatalogConfigOrderedPlan[]; + pricingModel?: string; + pricingUrl?: string; +} diff --git a/src/api/resources/catalogs/client/requests/UpdateCatalogRequestBody.ts b/src/api/resources/catalogs/client/requests/UpdateCatalogRequestBody.ts new file mode 100644 index 00000000..24aa63fa --- /dev/null +++ b/src/api/resources/catalogs/client/requests/UpdateCatalogRequestBody.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface UpdateCatalogRequestBody { + description?: string; + isDefault?: boolean; + name?: string; +} diff --git a/src/api/resources/catalogs/client/requests/index.ts b/src/api/resources/catalogs/client/requests/index.ts new file mode 100644 index 00000000..34fc7c7f --- /dev/null +++ b/src/api/resources/catalogs/client/requests/index.ts @@ -0,0 +1,4 @@ +export type { CreateCatalogRequestBody } from "./CreateCatalogRequestBody"; +export type { ListCatalogsRequest } from "./ListCatalogsRequest"; +export type { UpdateCatalogConfigurationRequestBody } from "./UpdateCatalogConfigurationRequestBody"; +export type { UpdateCatalogRequestBody } from "./UpdateCatalogRequestBody"; diff --git a/src/api/resources/catalogs/exports.ts b/src/api/resources/catalogs/exports.ts new file mode 100644 index 00000000..046ab5d4 --- /dev/null +++ b/src/api/resources/catalogs/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CatalogsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/catalogs/index.ts b/src/api/resources/catalogs/index.ts new file mode 100644 index 00000000..d2ec2302 --- /dev/null +++ b/src/api/resources/catalogs/index.ts @@ -0,0 +1,2 @@ +export * from "./client"; +export * from "./types"; diff --git a/src/api/resources/catalogs/types/CreateCatalogResponse.ts b/src/api/resources/catalogs/types/CreateCatalogResponse.ts new file mode 100644 index 00000000..141f6f18 --- /dev/null +++ b/src/api/resources/catalogs/types/CreateCatalogResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../index"; + +export interface CreateCatalogResponse { + data: Schematic.CatalogResponseData; + /** Input parameters */ + params: Record; +} diff --git a/src/api/resources/catalogs/types/DeleteCatalogResponse.ts b/src/api/resources/catalogs/types/DeleteCatalogResponse.ts new file mode 100644 index 00000000..8c0a017c --- /dev/null +++ b/src/api/resources/catalogs/types/DeleteCatalogResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../index"; + +export interface DeleteCatalogResponse { + data: Schematic.DeleteResponse; + /** Input parameters */ + params: Record; +} diff --git a/src/api/resources/catalogs/types/GetCatalogResponse.ts b/src/api/resources/catalogs/types/GetCatalogResponse.ts new file mode 100644 index 00000000..5c1fa3e0 --- /dev/null +++ b/src/api/resources/catalogs/types/GetCatalogResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../index"; + +export interface GetCatalogResponse { + data: Schematic.CatalogResponseData; + /** Input parameters */ + params: Record; +} diff --git a/src/api/resources/catalogs/types/GetConfigurationResponse.ts b/src/api/resources/catalogs/types/GetConfigurationResponse.ts new file mode 100644 index 00000000..12dd00a2 --- /dev/null +++ b/src/api/resources/catalogs/types/GetConfigurationResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../index"; + +export interface GetConfigurationResponse { + data: Schematic.CatalogConfigurationResponseData; + /** Input parameters */ + params: Record; +} diff --git a/src/api/resources/catalogs/types/GetCreditBundlesInCatalogResponse.ts b/src/api/resources/catalogs/types/GetCreditBundlesInCatalogResponse.ts new file mode 100644 index 00000000..69b99f73 --- /dev/null +++ b/src/api/resources/catalogs/types/GetCreditBundlesInCatalogResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../index"; + +export interface GetCreditBundlesInCatalogResponse { + data: Schematic.CatalogCreditBundleIDsResponseData; + /** Input parameters */ + params: Record; +} diff --git a/src/api/resources/catalogs/types/GetDerivedFeaturesResponse.ts b/src/api/resources/catalogs/types/GetDerivedFeaturesResponse.ts new file mode 100644 index 00000000..5e7d47ab --- /dev/null +++ b/src/api/resources/catalogs/types/GetDerivedFeaturesResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../index"; + +export interface GetDerivedFeaturesResponse { + data: Schematic.CatalogDerivedFeaturesResponseData; + /** Input parameters */ + params: Record; +} diff --git a/src/api/resources/catalogs/types/GetPlansInCatalogResponse.ts b/src/api/resources/catalogs/types/GetPlansInCatalogResponse.ts new file mode 100644 index 00000000..81fa556a --- /dev/null +++ b/src/api/resources/catalogs/types/GetPlansInCatalogResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../index"; + +export interface GetPlansInCatalogResponse { + data: Schematic.CatalogPlanIDsResponseData; + /** Input parameters */ + params: Record; +} diff --git a/src/api/resources/catalogs/types/ListCatalogsParams.ts b/src/api/resources/catalogs/types/ListCatalogsParams.ts new file mode 100644 index 00000000..a67c3262 --- /dev/null +++ b/src/api/resources/catalogs/types/ListCatalogsParams.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Input parameters + */ +export interface ListCatalogsParams { + isDefault?: boolean; + /** Page limit (default 100) */ + limit?: number; + /** Page offset (default 0) */ + offset?: number; + /** Search by catalog name */ + q?: string; +} diff --git a/src/api/resources/catalogs/types/ListCatalogsResponse.ts b/src/api/resources/catalogs/types/ListCatalogsResponse.ts new file mode 100644 index 00000000..845ae1d4 --- /dev/null +++ b/src/api/resources/catalogs/types/ListCatalogsResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../index"; + +export interface ListCatalogsResponse { + data: Schematic.CatalogResponseData[]; + /** Input parameters */ + params: Schematic.ListCatalogsParams; +} diff --git a/src/api/resources/catalogs/types/UpdateCatalogResponse.ts b/src/api/resources/catalogs/types/UpdateCatalogResponse.ts new file mode 100644 index 00000000..f4bbd6fa --- /dev/null +++ b/src/api/resources/catalogs/types/UpdateCatalogResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../index"; + +export interface UpdateCatalogResponse { + data: Schematic.CatalogResponseData; + /** Input parameters */ + params: Record; +} diff --git a/src/api/resources/catalogs/types/UpdateConfigurationResponse.ts b/src/api/resources/catalogs/types/UpdateConfigurationResponse.ts new file mode 100644 index 00000000..5c07ee32 --- /dev/null +++ b/src/api/resources/catalogs/types/UpdateConfigurationResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../index"; + +export interface UpdateConfigurationResponse { + data: Schematic.CatalogResponseData; + /** Input parameters */ + params: Record; +} diff --git a/src/api/resources/catalogs/types/index.ts b/src/api/resources/catalogs/types/index.ts new file mode 100644 index 00000000..d066fbe6 --- /dev/null +++ b/src/api/resources/catalogs/types/index.ts @@ -0,0 +1,11 @@ +export * from "./CreateCatalogResponse"; +export * from "./DeleteCatalogResponse"; +export * from "./GetCatalogResponse"; +export * from "./GetConfigurationResponse"; +export * from "./GetCreditBundlesInCatalogResponse"; +export * from "./GetDerivedFeaturesResponse"; +export * from "./GetPlansInCatalogResponse"; +export * from "./ListCatalogsParams"; +export * from "./ListCatalogsResponse"; +export * from "./UpdateCatalogResponse"; +export * from "./UpdateConfigurationResponse"; diff --git a/src/api/resources/components/client/Client.ts b/src/api/resources/components/client/Client.ts index 7028de7d..d76cf243 100644 --- a/src/api/resources/components/client/Client.ts +++ b/src/api/resources/components/client/Client.ts @@ -677,6 +677,145 @@ export class ComponentsClient { return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/components/{component_id}"); } + /** + * @param {string} component_id - component_id + * @param {Schematic.BindCatalogRequestBody} request + * @param {ComponentsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Schematic.BadRequestError} + * @throws {@link Schematic.UnauthorizedError} + * @throws {@link Schematic.ForbiddenError} + * @throws {@link Schematic.NotFoundError} + * @throws {@link Schematic.InternalServerError} + * + * @example + * await client.components.bindCatalog("component_id") + */ + public bindCatalog( + component_id: string, + request: Schematic.BindCatalogRequestBody = {}, + requestOptions?: ComponentsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__bindCatalog(component_id, request, requestOptions)); + } + + private async __bindCatalog( + component_id: string, + request: Schematic.BindCatalogRequestBody = {}, + requestOptions?: ComponentsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SchematicEnvironment.Default, + `components/${core.url.encodePathParam(component_id)}/catalog`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + requestType: "json", + body: serializers.BindCatalogRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.BindCatalogResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Schematic.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 401: + throw new Schematic.UnauthorizedError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Schematic.ForbiddenError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Schematic.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Schematic.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.SchematicError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/components/{component_id}/catalog", + ); + } + /** * @param {Schematic.CountComponentsRequest} request * @param {ComponentsClient.RequestOptions} requestOptions - Request-specific configuration. diff --git a/src/api/resources/components/client/requests/BindCatalogRequestBody.ts b/src/api/resources/components/client/requests/BindCatalogRequestBody.ts new file mode 100644 index 00000000..383801ba --- /dev/null +++ b/src/api/resources/components/client/requests/BindCatalogRequestBody.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface BindCatalogRequestBody { + catalogId?: string; +} diff --git a/src/api/resources/components/client/requests/index.ts b/src/api/resources/components/client/requests/index.ts index 7ddedbaf..fdb3c09d 100644 --- a/src/api/resources/components/client/requests/index.ts +++ b/src/api/resources/components/client/requests/index.ts @@ -1,3 +1,4 @@ +export type { BindCatalogRequestBody } from "./BindCatalogRequestBody"; export type { CountComponentsRequest } from "./CountComponentsRequest"; export type { CreateComponentRequestBody } from "./CreateComponentRequestBody"; export type { ListComponentsRequest } from "./ListComponentsRequest"; diff --git a/src/api/resources/components/types/BindCatalogResponse.ts b/src/api/resources/components/types/BindCatalogResponse.ts new file mode 100644 index 00000000..f285324b --- /dev/null +++ b/src/api/resources/components/types/BindCatalogResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../index"; + +export interface BindCatalogResponse { + data: Schematic.ComponentResponseData; + /** Input parameters */ + params: Record; +} diff --git a/src/api/resources/components/types/index.ts b/src/api/resources/components/types/index.ts index 7187a704..e8471aa4 100644 --- a/src/api/resources/components/types/index.ts +++ b/src/api/resources/components/types/index.ts @@ -1,3 +1,4 @@ +export * from "./BindCatalogResponse"; export * from "./CountComponentsParams"; export * from "./CountComponentsResponse"; export * from "./CreateComponentResponse"; diff --git a/src/api/resources/dataexports/client/Client.ts b/src/api/resources/dataexports/client/Client.ts index a52fce39..a2be09cd 100644 --- a/src/api/resources/dataexports/client/Client.ts +++ b/src/api/resources/dataexports/client/Client.ts @@ -24,6 +24,156 @@ export class DataexportsClient { this._options = normalizeClientOptionsWithAuth(options); } + /** + * @param {Schematic.ListDataExportsRequest} request + * @param {DataexportsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Schematic.BadRequestError} + * @throws {@link Schematic.UnauthorizedError} + * @throws {@link Schematic.ForbiddenError} + * @throws {@link Schematic.NotFoundError} + * @throws {@link Schematic.InternalServerError} + * + * @example + * await client.dataexports.listDataExports({ + * exportType: "audit-log", + * status: "failure", + * limit: 1000000, + * offset: 1000000 + * }) + */ + public listDataExports( + request: Schematic.ListDataExportsRequest = {}, + requestOptions?: DataexportsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__listDataExports(request, requestOptions)); + } + + private async __listDataExports( + request: Schematic.ListDataExportsRequest = {}, + requestOptions?: DataexportsClient.RequestOptions, + ): Promise> { + const { exportType, status, limit, offset } = request; + const _queryParams: Record = { + export_type: + exportType != null + ? serializers.DataExportType.jsonOrThrow(exportType, { unrecognizedObjectKeys: "strip" }) + : undefined, + status: + status != null + ? serializers.DataExportStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip" }) + : undefined, + limit, + offset, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SchematicEnvironment.Default, + "data-exports", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListDataExportsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Schematic.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 401: + throw new Schematic.UnauthorizedError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Schematic.ForbiddenError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Schematic.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Schematic.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.SchematicError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/data-exports"); + } + /** * @param {Schematic.CreateDataExportRequestBody} request * @param {DataexportsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -36,7 +186,8 @@ export class DataexportsClient { * * @example * await client.dataexports.createDataExport({ - * metadata: "metadata" + * exportType: "audit-log", + * outputFileType: "csv" * }) */ public createDataExport( @@ -68,11 +219,7 @@ export class DataexportsClient { contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: { - ...serializers.CreateDataExportRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), - export_type: "company-feature-usage", - output_file_type: "csv", - }, + body: serializers.CreateDataExportRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -161,6 +308,127 @@ export class DataexportsClient { return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/data-exports"); } + /** + * @param {string} data_export_id - data_export_id + * @param {DataexportsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Schematic.UnauthorizedError} + * @throws {@link Schematic.ForbiddenError} + * @throws {@link Schematic.NotFoundError} + * @throws {@link Schematic.InternalServerError} + * + * @example + * await client.dataexports.getDataExport("data_export_id") + */ + public getDataExport( + data_export_id: string, + requestOptions?: DataexportsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getDataExport(data_export_id, requestOptions)); + } + + private async __getDataExport( + data_export_id: string, + requestOptions?: DataexportsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SchematicEnvironment.Default, + `data-exports/${core.url.encodePathParam(data_export_id)}`, + ), + method: "GET", + headers: _headers, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.GetDataExportResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Schematic.UnauthorizedError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Schematic.ForbiddenError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Schematic.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Schematic.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.SchematicError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/data-exports/{data_export_id}", + ); + } + /** * @throws {@link Schematic.UnauthorizedError} * @throws {@link Schematic.ForbiddenError} diff --git a/src/api/resources/dataexports/client/requests/CreateDataExportRequestBody.ts b/src/api/resources/dataexports/client/requests/CreateDataExportRequestBody.ts index 495d0631..1ae9630a 100644 --- a/src/api/resources/dataexports/client/requests/CreateDataExportRequestBody.ts +++ b/src/api/resources/dataexports/client/requests/CreateDataExportRequestBody.ts @@ -1,11 +1,16 @@ // This file was auto-generated by Fern from our API Definition. +import type * as Schematic from "../../../../index"; + /** * @example * { - * metadata: "metadata" + * exportType: "audit-log", + * outputFileType: "csv" * } */ export interface CreateDataExportRequestBody { - metadata: string; + exportType: Schematic.DataExportType; + metadata?: Schematic.DataExportMetadata; + outputFileType: Schematic.DataExportOutputFileType; } diff --git a/src/api/resources/dataexports/client/requests/ListDataExportsRequest.ts b/src/api/resources/dataexports/client/requests/ListDataExportsRequest.ts new file mode 100644 index 00000000..fd43c3cb --- /dev/null +++ b/src/api/resources/dataexports/client/requests/ListDataExportsRequest.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../index"; + +/** + * @example + * { + * exportType: "audit-log", + * status: "failure", + * limit: 1000000, + * offset: 1000000 + * } + */ +export interface ListDataExportsRequest { + exportType?: Schematic.DataExportType; + status?: Schematic.DataExportStatus; + /** Page limit (default 100) */ + limit?: number; + /** Page offset (default 0) */ + offset?: number; +} diff --git a/src/api/resources/dataexports/client/requests/index.ts b/src/api/resources/dataexports/client/requests/index.ts index 8198d765..4a49c083 100644 --- a/src/api/resources/dataexports/client/requests/index.ts +++ b/src/api/resources/dataexports/client/requests/index.ts @@ -1 +1,2 @@ export type { CreateDataExportRequestBody } from "./CreateDataExportRequestBody"; +export type { ListDataExportsRequest } from "./ListDataExportsRequest"; diff --git a/src/api/resources/dataexports/types/GetDataExportResponse.ts b/src/api/resources/dataexports/types/GetDataExportResponse.ts new file mode 100644 index 00000000..eaa9db90 --- /dev/null +++ b/src/api/resources/dataexports/types/GetDataExportResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../index"; + +export interface GetDataExportResponse { + data: Schematic.DataExportResponseData; + /** Input parameters */ + params: Record; +} diff --git a/src/api/resources/dataexports/types/ListDataExportsParams.ts b/src/api/resources/dataexports/types/ListDataExportsParams.ts new file mode 100644 index 00000000..50a53088 --- /dev/null +++ b/src/api/resources/dataexports/types/ListDataExportsParams.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../index"; + +/** + * Input parameters + */ +export interface ListDataExportsParams { + exportType?: Schematic.DataExportType; + /** Page limit (default 100) */ + limit?: number; + /** Page offset (default 0) */ + offset?: number; + status?: Schematic.DataExportStatus; +} diff --git a/src/api/resources/dataexports/types/ListDataExportsResponse.ts b/src/api/resources/dataexports/types/ListDataExportsResponse.ts new file mode 100644 index 00000000..22bae1ba --- /dev/null +++ b/src/api/resources/dataexports/types/ListDataExportsResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../index"; + +export interface ListDataExportsResponse { + data: Schematic.DataExportResponseData[]; + /** Input parameters */ + params: Schematic.ListDataExportsParams; +} diff --git a/src/api/resources/dataexports/types/index.ts b/src/api/resources/dataexports/types/index.ts index 878af314..fe6bc7c6 100644 --- a/src/api/resources/dataexports/types/index.ts +++ b/src/api/resources/dataexports/types/index.ts @@ -1 +1,4 @@ export * from "./CreateDataExportResponse"; +export * from "./GetDataExportResponse"; +export * from "./ListDataExportsParams"; +export * from "./ListDataExportsResponse"; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 27aff446..c9af1325 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -7,6 +7,9 @@ export * from "./accounts/types"; export * as billing from "./billing"; export * from "./billing/client/requests"; export * from "./billing/types"; +export * as catalogs from "./catalogs"; +export * from "./catalogs/client/requests"; +export * from "./catalogs/types"; export * as checkout from "./checkout"; export * from "./checkout/client/requests"; export * from "./checkout/types"; diff --git a/src/api/resources/planbundle/client/requests/CreateCustomPlanBundleRequestBody.ts b/src/api/resources/planbundle/client/requests/CreateCustomPlanBundleRequestBody.ts index ab11b0c2..1b35a6a9 100644 --- a/src/api/resources/planbundle/client/requests/CreateCustomPlanBundleRequestBody.ts +++ b/src/api/resources/planbundle/client/requests/CreateCustomPlanBundleRequestBody.ts @@ -12,6 +12,7 @@ import type * as Schematic from "../../../../index"; */ export interface CreateCustomPlanBundleRequestBody { billingProduct?: Schematic.UpsertBillingProductRequestBody; + creditGrants?: Schematic.PlanBundleCreditGrantRequestBody[]; entitlements: Schematic.PlanBundleEntitlementRequestBody[]; plan?: Schematic.CreateCustomPlanBundlePlanRequestBody; } diff --git a/src/api/types/AuditLogExportMetadata.ts b/src/api/types/AuditLogExportMetadata.ts new file mode 100644 index 00000000..09804f13 --- /dev/null +++ b/src/api/types/AuditLogExportMetadata.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface AuditLogExportMetadata { + /** Restrict the export to audit log entries from this actor type */ + actorType?: string; + /** Restrict the export to audit log entries that started before this time */ + endTime?: Date; + /** Account member emails to notify when the export completes; empty means the artifact is only retrievable via the API */ + notificationEmailRecipientEmailAddresses?: string[]; + /** Free-text search over audit log entries */ + q?: string; + /** Restrict the export to audit log entries that started at or after this time */ + startTime?: Date; +} diff --git a/src/api/types/CatalogConfigOrderedBundle.ts b/src/api/types/CatalogConfigOrderedBundle.ts new file mode 100644 index 00000000..995aed0e --- /dev/null +++ b/src/api/types/CatalogConfigOrderedBundle.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CatalogConfigOrderedBundle { + bundleId: string; +} diff --git a/src/api/types/CatalogConfigOrderedBundleResponseData.ts b/src/api/types/CatalogConfigOrderedBundleResponseData.ts new file mode 100644 index 00000000..76553417 --- /dev/null +++ b/src/api/types/CatalogConfigOrderedBundleResponseData.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CatalogConfigOrderedBundleResponseData { + bundleId: string; +} diff --git a/src/api/types/CatalogConfigOrderedEntitlement.ts b/src/api/types/CatalogConfigOrderedEntitlement.ts new file mode 100644 index 00000000..2568e443 --- /dev/null +++ b/src/api/types/CatalogConfigOrderedEntitlement.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CatalogConfigOrderedEntitlement { + planEntitlementId: string; + visible?: boolean; +} diff --git a/src/api/types/CatalogConfigOrderedEntitlementResponseData.ts b/src/api/types/CatalogConfigOrderedEntitlementResponseData.ts new file mode 100644 index 00000000..38dd897d --- /dev/null +++ b/src/api/types/CatalogConfigOrderedEntitlementResponseData.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CatalogConfigOrderedEntitlementResponseData { + planEntitlementId: string; + visible: boolean; +} diff --git a/src/api/types/CatalogConfigOrderedPlan.ts b/src/api/types/CatalogConfigOrderedPlan.ts new file mode 100644 index 00000000..d88da249 --- /dev/null +++ b/src/api/types/CatalogConfigOrderedPlan.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../index"; + +export interface CatalogConfigOrderedPlan { + entitlements?: Schematic.CatalogConfigOrderedEntitlement[]; + planId: string; +} diff --git a/src/api/types/CatalogConfigOrderedPlanResponseData.ts b/src/api/types/CatalogConfigOrderedPlanResponseData.ts new file mode 100644 index 00000000..d93261ff --- /dev/null +++ b/src/api/types/CatalogConfigOrderedPlanResponseData.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../index"; + +export interface CatalogConfigOrderedPlanResponseData { + entitlements: Schematic.CatalogConfigOrderedEntitlementResponseData[]; + planId: string; +} diff --git a/src/api/types/CatalogConfigurationResponseData.ts b/src/api/types/CatalogConfigurationResponseData.ts new file mode 100644 index 00000000..0a8f23e3 --- /dev/null +++ b/src/api/types/CatalogConfigurationResponseData.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../index"; + +export interface CatalogConfigurationResponseData { + addOns: Schematic.PlanGroupPlanDetailResponseData[]; + customPlanCtaText?: string; + customPlanCtaUrl?: string; + customPlanPriceText?: string; + customPlansVisible: boolean; + orderedAddOns: Schematic.CatalogConfigOrderedPlanResponseData[]; + orderedBundles: Schematic.CatalogConfigOrderedBundleResponseData[]; + orderedPlans: Schematic.CatalogConfigOrderedPlanResponseData[]; + plans: Schematic.PlanGroupPlanDetailResponseData[]; + pricingModel?: string; + pricingUrl?: string; +} diff --git a/src/api/types/CatalogCreditBundleIDsResponseData.ts b/src/api/types/CatalogCreditBundleIDsResponseData.ts new file mode 100644 index 00000000..15ffea3b --- /dev/null +++ b/src/api/types/CatalogCreditBundleIDsResponseData.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CatalogCreditBundleIDsResponseData { + creditBundleIds: string[]; +} diff --git a/src/api/types/CatalogDerivedFeatureResponseData.ts b/src/api/types/CatalogDerivedFeatureResponseData.ts new file mode 100644 index 00000000..d9fb5f7a --- /dev/null +++ b/src/api/types/CatalogDerivedFeatureResponseData.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CatalogDerivedFeatureResponseData { + icon: string; + id: string; + name: string; +} diff --git a/src/api/types/CatalogDerivedFeaturesResponseData.ts b/src/api/types/CatalogDerivedFeaturesResponseData.ts new file mode 100644 index 00000000..b95f48df --- /dev/null +++ b/src/api/types/CatalogDerivedFeaturesResponseData.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../index"; + +export interface CatalogDerivedFeaturesResponseData { + features: Schematic.CatalogDerivedFeatureResponseData[]; +} diff --git a/src/api/types/CatalogPlanIDsResponseData.ts b/src/api/types/CatalogPlanIDsResponseData.ts new file mode 100644 index 00000000..0aac92ae --- /dev/null +++ b/src/api/types/CatalogPlanIDsResponseData.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CatalogPlanIDsResponseData { + planIds: string[]; +} diff --git a/src/api/types/CatalogResponseData.ts b/src/api/types/CatalogResponseData.ts new file mode 100644 index 00000000..2edd4ea4 --- /dev/null +++ b/src/api/types/CatalogResponseData.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CatalogResponseData { + accountId: string; + createdAt: Date; + customPlanCtaText?: string; + customPlanCtaUrl?: string; + customPlanPriceText?: string; + customPlansVisible: boolean; + description?: string; + environmentId: string; + id: string; + isDefault: boolean; + name: string; + pricingModel?: string; + pricingUrl?: string; + updatedAt: Date; +} diff --git a/src/api/types/CompanyFeatureUsageExportMetadata.ts b/src/api/types/CompanyFeatureUsageExportMetadata.ts new file mode 100644 index 00000000..874e4bbc --- /dev/null +++ b/src/api/types/CompanyFeatureUsageExportMetadata.ts @@ -0,0 +1,38 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CompanyFeatureUsageExportMetadata { + /** Restrict the export to these Schematic company IDs (starting with 'comp_') */ + companyIds?: string[]; + /** Restrict the export to companies with these billing credit type IDs */ + creditTypeIds?: string[]; + /** Schematic feature IDs (starting with 'feat_') to include as usage columns; at least one is required */ + featureIds: string[]; + /** Restrict the export to companies that do (or do not) have a scheduled downgrade */ + hasScheduledDowngrade?: boolean; + /** Restrict the export to companies with (or without) a monetized subscription */ + monetizedSubscriptions?: boolean; + /** Account member emails to notify when the export completes; empty means the artifact is only retrievable via the API */ + notificationEmailRecipientEmailAddresses?: string[]; + /** Restrict the export to companies on this plan ID (starting with 'plan_') */ + planId?: string; + /** Restrict the export to companies on any of these plan IDs */ + planIds?: string[]; + /** Restrict the export to companies on this plan version ID */ + planVersionId?: string; + /** Free-text search over company name and keys */ + q?: string; + /** Restrict the export to companies whose subscription has one of these statuses */ + subscriptionStatuses?: string[]; + /** Restrict the export to companies whose subscription has one of these types */ + subscriptionTypes?: string[]; + /** Restrict the export to companies that have an entitlement for this feature ID */ + withEntitlementFor?: string; + /** Restrict the export to companies with a subscription */ + withSubscription?: boolean; + /** Restrict the export to companies without a company-level override for this feature ID */ + withoutFeatureOverrideFor?: string; + /** Restrict the export to companies without a plan */ + withoutPlan?: boolean; + /** Restrict the export to companies without a subscription */ + withoutSubscription?: boolean; +} diff --git a/src/api/types/CompanyPlanDetailResponseData.ts b/src/api/types/CompanyPlanDetailResponseData.ts index 1a0651dc..06ced342 100644 --- a/src/api/types/CompanyPlanDetailResponseData.ts +++ b/src/api/types/CompanyPlanDetailResponseData.ts @@ -9,6 +9,7 @@ export interface CompanyPlanDetailResponseData { billingLinkedResource?: Schematic.BillingLinkedResourceResponseData; billingProduct?: Schematic.BillingProductDetailResponseData; billingStrategy: Schematic.BillingStrategy; + catalogs?: Schematic.PlanCatalogMembershipResponseData[]; chargeType: Schematic.ChargeType; companyCanTrial: boolean; companyCount: number; diff --git a/src/api/types/ComponentResponseData.ts b/src/api/types/ComponentResponseData.ts index 256a4cf4..b8ab360f 100644 --- a/src/api/types/ComponentResponseData.ts +++ b/src/api/types/ComponentResponseData.ts @@ -4,6 +4,7 @@ import type * as Schematic from "../index"; export interface ComponentResponseData { ast?: Record; + catalogId?: string; createdAt: Date; id: string; name: string; diff --git a/src/api/types/DataExportMetadata.ts b/src/api/types/DataExportMetadata.ts new file mode 100644 index 00000000..03d04716 --- /dev/null +++ b/src/api/types/DataExportMetadata.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../index"; + +export type DataExportMetadata = + | Schematic.DataExportMetadata.AuditLog + | Schematic.DataExportMetadata.CompanyFeatureUsage; + +export namespace DataExportMetadata { + export interface AuditLog extends Schematic.AuditLogExportMetadata { + exportType: "audit-log"; + } + + export interface CompanyFeatureUsage extends Schematic.CompanyFeatureUsageExportMetadata { + exportType: "company-feature-usage"; + } +} diff --git a/src/api/types/DataExportOutputFileType.ts b/src/api/types/DataExportOutputFileType.ts index 5d58f0c8..0a882048 100644 --- a/src/api/types/DataExportOutputFileType.ts +++ b/src/api/types/DataExportOutputFileType.ts @@ -1,3 +1,7 @@ // This file was auto-generated by Fern from our API Definition. -export type DataExportOutputFileType = "csv"; +export const DataExportOutputFileType = { + Csv: "csv", + CsvGz: "csv.gz", +} as const; +export type DataExportOutputFileType = (typeof DataExportOutputFileType)[keyof typeof DataExportOutputFileType]; diff --git a/src/api/types/DataExportResponseData.ts b/src/api/types/DataExportResponseData.ts index 3e43922c..ecabd8ae 100644 --- a/src/api/types/DataExportResponseData.ts +++ b/src/api/types/DataExportResponseData.ts @@ -8,7 +8,7 @@ export interface DataExportResponseData { environmentId: string; exportType: Schematic.DataExportType; id: string; - metadata: string; + metadata?: Schematic.DataExportMetadata; outputFileType: Schematic.DataExportOutputFileType; status: Schematic.DataExportStatus; updatedAt: Date; diff --git a/src/api/types/DataExportType.ts b/src/api/types/DataExportType.ts index 62a89971..2fde71ed 100644 --- a/src/api/types/DataExportType.ts +++ b/src/api/types/DataExportType.ts @@ -1,3 +1,7 @@ // This file was auto-generated by Fern from our API Definition. -export type DataExportType = "company-feature-usage"; +export const DataExportType = { + AuditLog: "audit-log", + CompanyFeatureUsage: "company-feature-usage", +} as const; +export type DataExportType = (typeof DataExportType)[keyof typeof DataExportType]; diff --git a/src/api/types/FeatureEntitlement.ts b/src/api/types/FeatureEntitlement.ts index 161b75b3..868352ff 100644 --- a/src/api/types/FeatureEntitlement.ts +++ b/src/api/types/FeatureEntitlement.ts @@ -39,4 +39,6 @@ export interface FeatureEntitlement { usage?: number; /** The type of the entitlement value */ valueType: Schematic.EntitlementValueType; + /** Customer-defined usage warning thresholds configured on this entitlement */ + warningTiers?: Schematic.WarningTier[]; } diff --git a/src/api/types/PlanCatalogMembershipResponseData.ts b/src/api/types/PlanCatalogMembershipResponseData.ts new file mode 100644 index 00000000..281ebc0e --- /dev/null +++ b/src/api/types/PlanCatalogMembershipResponseData.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface PlanCatalogMembershipResponseData { + id: string; + name: string; +} diff --git a/src/api/types/PlanDetailResponseData.ts b/src/api/types/PlanDetailResponseData.ts index 0925c420..fad91fe6 100644 --- a/src/api/types/PlanDetailResponseData.ts +++ b/src/api/types/PlanDetailResponseData.ts @@ -8,6 +8,7 @@ export interface PlanDetailResponseData { billingLinkedResource?: Schematic.BillingLinkedResourceResponseData; billingProduct?: Schematic.BillingProductDetailResponseData; billingStrategy: Schematic.BillingStrategy; + catalogs?: Schematic.PlanCatalogMembershipResponseData[]; chargeType: Schematic.ChargeType; companyCount: number; companyId?: string; diff --git a/src/api/types/PlanGroupPlanDetailResponseData.ts b/src/api/types/PlanGroupPlanDetailResponseData.ts index ebc66498..bf2b8231 100644 --- a/src/api/types/PlanGroupPlanDetailResponseData.ts +++ b/src/api/types/PlanGroupPlanDetailResponseData.ts @@ -9,6 +9,7 @@ export interface PlanGroupPlanDetailResponseData { billingLinkedResource?: Schematic.BillingLinkedResourceResponseData; billingProduct?: Schematic.BillingProductDetailResponseData; billingStrategy: Schematic.BillingStrategy; + catalogs?: Schematic.PlanCatalogMembershipResponseData[]; chargeType: Schematic.ChargeType; companyCount: number; companyId?: string; diff --git a/src/api/types/PlanViewPublicResponseData.ts b/src/api/types/PlanViewPublicResponseData.ts index f5e8adc6..420eb177 100644 --- a/src/api/types/PlanViewPublicResponseData.ts +++ b/src/api/types/PlanViewPublicResponseData.ts @@ -9,6 +9,7 @@ export interface PlanViewPublicResponseData { billingLinkedResource?: Schematic.BillingLinkedResourceResponseData; billingProduct?: Schematic.BillingProductDetailResponseData; billingStrategy: Schematic.BillingStrategy; + catalogs?: Schematic.PlanCatalogMembershipResponseData[]; chargeType: Schematic.ChargeType; companyCount: number; companyId?: string; diff --git a/src/api/types/PreviewSubscriptionDiscountResponseData.ts b/src/api/types/PreviewSubscriptionDiscountResponseData.ts new file mode 100644 index 00000000..589039b6 --- /dev/null +++ b/src/api/types/PreviewSubscriptionDiscountResponseData.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface PreviewSubscriptionDiscountResponseData { + amountOff?: number; + couponName: string; + currency?: string; + customerFacingCode?: string; + duration: string; + durationInMonths?: number; + endedAt?: Date; + isActive: boolean; + percentOff?: number; + promoCodeExternalId?: string; + startedAt: Date; +} diff --git a/src/api/types/PreviewSubscriptionFinanceResponseData.ts b/src/api/types/PreviewSubscriptionFinanceResponseData.ts index f07e4513..0741ca45 100644 --- a/src/api/types/PreviewSubscriptionFinanceResponseData.ts +++ b/src/api/types/PreviewSubscriptionFinanceResponseData.ts @@ -4,9 +4,11 @@ import type * as Schematic from "../index"; export interface PreviewSubscriptionFinanceResponseData { amountOff: number; + discounts: Schematic.PreviewSubscriptionDiscountResponseData[]; dueNow: number; newCharges: number; percentOff: number; + periodEnd: Date; periodStart: Date; promoCodeApplied: boolean; proration: number; diff --git a/src/api/types/RulesengineFeatureEntitlement.ts b/src/api/types/RulesengineFeatureEntitlement.ts index ea41e08c..bdc32337 100644 --- a/src/api/types/RulesengineFeatureEntitlement.ts +++ b/src/api/types/RulesengineFeatureEntitlement.ts @@ -39,4 +39,6 @@ export interface RulesengineFeatureEntitlement { usage?: number; /** The type of the entitlement value */ valueType: Schematic.RulesengineEntitlementValueType; + /** Customer-defined usage warning thresholds configured on this entitlement */ + warningTiers?: Schematic.RulesengineWarningTier[]; } diff --git a/src/api/types/RulesengineWarningTier.ts b/src/api/types/RulesengineWarningTier.ts new file mode 100644 index 00000000..14953200 --- /dev/null +++ b/src/api/types/RulesengineWarningTier.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface RulesengineWarningTier { + /** A customer-defined identifier for the warning tier */ + key: string; + /** The warning threshold, in the entitlement's usage units */ + value: number; +} diff --git a/src/api/types/UpsertCompanyRequestBody.ts b/src/api/types/UpsertCompanyRequestBody.ts index 29da9609..9e114116 100644 --- a/src/api/types/UpsertCompanyRequestBody.ts +++ b/src/api/types/UpsertCompanyRequestBody.ts @@ -1,6 +1,10 @@ // This file was auto-generated by Fern from our API Definition. export interface UpsertCompanyRequestBody { + /** Assign this base plan when creating the company (starts with plan_). Takes precedence over the environment's initial plan and must be provisionable without a payment method. */ + basePlanId?: string; + /** The Schematic price to provision for base_plan_id (starts with bilpp_). Required and must be $0 for a billing-linked plan; omit for a plan that is not billing-linked. */ + basePlanPriceId?: string; /** If you know the Schematic ID, you can use that here instead of keys */ id?: string; /** See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information */ diff --git a/src/api/types/WarningTier.ts b/src/api/types/WarningTier.ts new file mode 100644 index 00000000..d92b21b9 --- /dev/null +++ b/src/api/types/WarningTier.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface WarningTier { + /** A customer-defined identifier for the warning tier */ + key: string; + /** The warning threshold, in the entitlement's usage units */ + value: number; +} diff --git a/src/api/types/index.ts b/src/api/types/index.ts index e65f2a4b..873eb82c 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -9,6 +9,7 @@ export * from "./ApiKeyCreateResponseData"; export * from "./ApiKeyIntegrationResponseData"; export * from "./ApiKeyResponseData"; export * from "./ApiKeyScope"; +export * from "./AuditLogExportMetadata"; export * from "./AuditLogListResponseData"; export * from "./AuditLogResponseData"; export * from "./BillingCouponResponseData"; @@ -59,6 +60,18 @@ export * from "./BillingSubscriptionView"; export * from "./BillingTiersMode"; export * from "./CaptureRawEvent"; export * from "./CaptureRawEventBatch"; +export * from "./CatalogConfigOrderedBundle"; +export * from "./CatalogConfigOrderedBundleResponseData"; +export * from "./CatalogConfigOrderedEntitlement"; +export * from "./CatalogConfigOrderedEntitlementResponseData"; +export * from "./CatalogConfigOrderedPlan"; +export * from "./CatalogConfigOrderedPlanResponseData"; +export * from "./CatalogConfigurationResponseData"; +export * from "./CatalogCreditBundleIDsResponseData"; +export * from "./CatalogDerivedFeatureResponseData"; +export * from "./CatalogDerivedFeaturesResponseData"; +export * from "./CatalogPlanIDsResponseData"; +export * from "./CatalogResponseData"; export * from "./ChangeSubscriptionInternalRequestBody"; export * from "./ChangeSubscriptionRequestBody"; export * from "./ChargeType"; @@ -80,6 +93,7 @@ export * from "./CompanyCreditBalance"; export * from "./CompanyCreditBalanceResponseData"; export * from "./CompanyDetailResponseData"; export * from "./CompanyEventPeriodMetricsResponseData"; +export * from "./CompanyFeatureUsageExportMetadata"; export * from "./CompanyLedgerResponseData"; export * from "./CompanyMatchingCriteria"; export * from "./CompanyMembershipDetailResponseData"; @@ -158,6 +172,7 @@ export * from "./CustomPlanBillingStatus"; export * from "./CustomPlanConfig"; export * from "./CustomPlanViewConfigResponseData"; export * from "./DataEventPayload"; +export * from "./DataExportMetadata"; export * from "./DataExportOutputFileType"; export * from "./DataExportResponseData"; export * from "./DataExportStatus"; @@ -254,6 +269,7 @@ export * from "./PlanBundleAction"; export * from "./PlanBundleCreditGrantRequestBody"; export * from "./PlanBundleEntitlementRequestBody"; export * from "./PlanBundleResponseData"; +export * from "./PlanCatalogMembershipResponseData"; export * from "./PlanChangeAction"; export * from "./PlanChangeBasePlanAction"; export * from "./PlanChangeResponseData"; @@ -291,6 +307,7 @@ export * from "./PlanViewPublicResponseData"; export * from "./PreviewObject"; export * from "./PreviewObjectResponseData"; export * from "./PreviewSubscriptionChangeResponseData"; +export * from "./PreviewSubscriptionDiscountResponseData"; export * from "./PreviewSubscriptionFinanceResponseData"; export * from "./PreviewSubscriptionUpcomingInvoiceLineItems"; export * from "./ProrationBehavior"; @@ -327,6 +344,7 @@ export * from "./RulesengineTrait"; export * from "./RulesengineTraitDefinition"; export * from "./RulesengineTraitDefinitionComparableType"; export * from "./RulesengineUser"; +export * from "./RulesengineWarningTier"; export * from "./RuleType"; export * from "./RuleView"; export * from "./ScheduledCheckoutResponseData"; @@ -371,6 +389,7 @@ export * from "./UsageBasedEntitlementResponseData"; export * from "./UsageTimeSeriesPointResponseData"; export * from "./UserDetailResponseData"; export * from "./UserResponseData"; +export * from "./WarningTier"; export * from "./WarningTierRequestBody"; export * from "./WarningTierResponseData"; export * from "./WebFeatureUsageWebhookOutput"; diff --git a/src/serialization/resources/catalogs/client/index.ts b/src/serialization/resources/catalogs/client/index.ts new file mode 100644 index 00000000..415726b7 --- /dev/null +++ b/src/serialization/resources/catalogs/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/catalogs/client/requests/CreateCatalogRequestBody.ts b/src/serialization/resources/catalogs/client/requests/CreateCatalogRequestBody.ts new file mode 100644 index 00000000..1137adbf --- /dev/null +++ b/src/serialization/resources/catalogs/client/requests/CreateCatalogRequestBody.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../../api/index"; +import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; + +export const CreateCatalogRequestBody: core.serialization.Schema< + serializers.CreateCatalogRequestBody.Raw, + Schematic.CreateCatalogRequestBody +> = core.serialization.object({ + description: core.serialization.string().optional(), + isDefault: core.serialization.property("is_default", core.serialization.boolean()), + name: core.serialization.string(), +}); + +export declare namespace CreateCatalogRequestBody { + export interface Raw { + description?: string | null; + is_default: boolean; + name: string; + } +} diff --git a/src/serialization/resources/catalogs/client/requests/UpdateCatalogConfigurationRequestBody.ts b/src/serialization/resources/catalogs/client/requests/UpdateCatalogConfigurationRequestBody.ts new file mode 100644 index 00000000..50071182 --- /dev/null +++ b/src/serialization/resources/catalogs/client/requests/UpdateCatalogConfigurationRequestBody.ts @@ -0,0 +1,45 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../../api/index"; +import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; +import { CatalogConfigOrderedBundle } from "../../../../types/CatalogConfigOrderedBundle"; +import { CatalogConfigOrderedPlan } from "../../../../types/CatalogConfigOrderedPlan"; + +export const UpdateCatalogConfigurationRequestBody: core.serialization.Schema< + serializers.UpdateCatalogConfigurationRequestBody.Raw, + Schematic.UpdateCatalogConfigurationRequestBody +> = core.serialization.object({ + customPlanCtaText: core.serialization.property("custom_plan_cta_text", core.serialization.string().optional()), + customPlanCtaUrl: core.serialization.property("custom_plan_cta_url", core.serialization.string().optional()), + customPlanPriceText: core.serialization.property("custom_plan_price_text", core.serialization.string().optional()), + customPlansVisible: core.serialization.property("custom_plans_visible", core.serialization.boolean().optional()), + orderedAddOns: core.serialization.property( + "ordered_add_ons", + core.serialization.list(CatalogConfigOrderedPlan).optional(), + ), + orderedBundles: core.serialization.property( + "ordered_bundles", + core.serialization.list(CatalogConfigOrderedBundle).optional(), + ), + orderedPlans: core.serialization.property( + "ordered_plans", + core.serialization.list(CatalogConfigOrderedPlan).optional(), + ), + pricingModel: core.serialization.property("pricing_model", core.serialization.string().optional()), + pricingUrl: core.serialization.property("pricing_url", core.serialization.string().optional()), +}); + +export declare namespace UpdateCatalogConfigurationRequestBody { + export interface Raw { + custom_plan_cta_text?: string | null; + custom_plan_cta_url?: string | null; + custom_plan_price_text?: string | null; + custom_plans_visible?: boolean | null; + ordered_add_ons?: CatalogConfigOrderedPlan.Raw[] | null; + ordered_bundles?: CatalogConfigOrderedBundle.Raw[] | null; + ordered_plans?: CatalogConfigOrderedPlan.Raw[] | null; + pricing_model?: string | null; + pricing_url?: string | null; + } +} diff --git a/src/serialization/resources/catalogs/client/requests/UpdateCatalogRequestBody.ts b/src/serialization/resources/catalogs/client/requests/UpdateCatalogRequestBody.ts new file mode 100644 index 00000000..5408a574 --- /dev/null +++ b/src/serialization/resources/catalogs/client/requests/UpdateCatalogRequestBody.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../../api/index"; +import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; + +export const UpdateCatalogRequestBody: core.serialization.Schema< + serializers.UpdateCatalogRequestBody.Raw, + Schematic.UpdateCatalogRequestBody +> = core.serialization.object({ + description: core.serialization.string().optional(), + isDefault: core.serialization.property("is_default", core.serialization.boolean().optional()), + name: core.serialization.string().optional(), +}); + +export declare namespace UpdateCatalogRequestBody { + export interface Raw { + description?: string | null; + is_default?: boolean | null; + name?: string | null; + } +} diff --git a/src/serialization/resources/catalogs/client/requests/index.ts b/src/serialization/resources/catalogs/client/requests/index.ts new file mode 100644 index 00000000..5d5a9e1c --- /dev/null +++ b/src/serialization/resources/catalogs/client/requests/index.ts @@ -0,0 +1,3 @@ +export { CreateCatalogRequestBody } from "./CreateCatalogRequestBody"; +export { UpdateCatalogConfigurationRequestBody } from "./UpdateCatalogConfigurationRequestBody"; +export { UpdateCatalogRequestBody } from "./UpdateCatalogRequestBody"; diff --git a/src/serialization/resources/catalogs/index.ts b/src/serialization/resources/catalogs/index.ts new file mode 100644 index 00000000..d2ec2302 --- /dev/null +++ b/src/serialization/resources/catalogs/index.ts @@ -0,0 +1,2 @@ +export * from "./client"; +export * from "./types"; diff --git a/src/serialization/resources/catalogs/types/CreateCatalogResponse.ts b/src/serialization/resources/catalogs/types/CreateCatalogResponse.ts new file mode 100644 index 00000000..905a672f --- /dev/null +++ b/src/serialization/resources/catalogs/types/CreateCatalogResponse.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; +import { CatalogResponseData } from "../../../types/CatalogResponseData"; + +export const CreateCatalogResponse: core.serialization.ObjectSchema< + serializers.CreateCatalogResponse.Raw, + Schematic.CreateCatalogResponse +> = core.serialization.object({ + data: CatalogResponseData, + params: core.serialization.record(core.serialization.string(), core.serialization.unknown()), +}); + +export declare namespace CreateCatalogResponse { + export interface Raw { + data: CatalogResponseData.Raw; + params: Record; + } +} diff --git a/src/serialization/resources/catalogs/types/DeleteCatalogResponse.ts b/src/serialization/resources/catalogs/types/DeleteCatalogResponse.ts new file mode 100644 index 00000000..ba27a677 --- /dev/null +++ b/src/serialization/resources/catalogs/types/DeleteCatalogResponse.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; +import { DeleteResponse } from "../../../types/DeleteResponse"; + +export const DeleteCatalogResponse: core.serialization.ObjectSchema< + serializers.DeleteCatalogResponse.Raw, + Schematic.DeleteCatalogResponse +> = core.serialization.object({ + data: DeleteResponse, + params: core.serialization.record(core.serialization.string(), core.serialization.unknown()), +}); + +export declare namespace DeleteCatalogResponse { + export interface Raw { + data: DeleteResponse.Raw; + params: Record; + } +} diff --git a/src/serialization/resources/catalogs/types/GetCatalogResponse.ts b/src/serialization/resources/catalogs/types/GetCatalogResponse.ts new file mode 100644 index 00000000..9de0e602 --- /dev/null +++ b/src/serialization/resources/catalogs/types/GetCatalogResponse.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; +import { CatalogResponseData } from "../../../types/CatalogResponseData"; + +export const GetCatalogResponse: core.serialization.ObjectSchema< + serializers.GetCatalogResponse.Raw, + Schematic.GetCatalogResponse +> = core.serialization.object({ + data: CatalogResponseData, + params: core.serialization.record(core.serialization.string(), core.serialization.unknown()), +}); + +export declare namespace GetCatalogResponse { + export interface Raw { + data: CatalogResponseData.Raw; + params: Record; + } +} diff --git a/src/serialization/resources/catalogs/types/GetConfigurationResponse.ts b/src/serialization/resources/catalogs/types/GetConfigurationResponse.ts new file mode 100644 index 00000000..7830123b --- /dev/null +++ b/src/serialization/resources/catalogs/types/GetConfigurationResponse.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; +import { CatalogConfigurationResponseData } from "../../../types/CatalogConfigurationResponseData"; + +export const GetConfigurationResponse: core.serialization.ObjectSchema< + serializers.GetConfigurationResponse.Raw, + Schematic.GetConfigurationResponse +> = core.serialization.object({ + data: CatalogConfigurationResponseData, + params: core.serialization.record(core.serialization.string(), core.serialization.unknown()), +}); + +export declare namespace GetConfigurationResponse { + export interface Raw { + data: CatalogConfigurationResponseData.Raw; + params: Record; + } +} diff --git a/src/serialization/resources/catalogs/types/GetCreditBundlesInCatalogResponse.ts b/src/serialization/resources/catalogs/types/GetCreditBundlesInCatalogResponse.ts new file mode 100644 index 00000000..99294a92 --- /dev/null +++ b/src/serialization/resources/catalogs/types/GetCreditBundlesInCatalogResponse.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; +import { CatalogCreditBundleIDsResponseData } from "../../../types/CatalogCreditBundleIDsResponseData"; + +export const GetCreditBundlesInCatalogResponse: core.serialization.ObjectSchema< + serializers.GetCreditBundlesInCatalogResponse.Raw, + Schematic.GetCreditBundlesInCatalogResponse +> = core.serialization.object({ + data: CatalogCreditBundleIDsResponseData, + params: core.serialization.record(core.serialization.string(), core.serialization.unknown()), +}); + +export declare namespace GetCreditBundlesInCatalogResponse { + export interface Raw { + data: CatalogCreditBundleIDsResponseData.Raw; + params: Record; + } +} diff --git a/src/serialization/resources/catalogs/types/GetDerivedFeaturesResponse.ts b/src/serialization/resources/catalogs/types/GetDerivedFeaturesResponse.ts new file mode 100644 index 00000000..4fe372ed --- /dev/null +++ b/src/serialization/resources/catalogs/types/GetDerivedFeaturesResponse.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; +import { CatalogDerivedFeaturesResponseData } from "../../../types/CatalogDerivedFeaturesResponseData"; + +export const GetDerivedFeaturesResponse: core.serialization.ObjectSchema< + serializers.GetDerivedFeaturesResponse.Raw, + Schematic.GetDerivedFeaturesResponse +> = core.serialization.object({ + data: CatalogDerivedFeaturesResponseData, + params: core.serialization.record(core.serialization.string(), core.serialization.unknown()), +}); + +export declare namespace GetDerivedFeaturesResponse { + export interface Raw { + data: CatalogDerivedFeaturesResponseData.Raw; + params: Record; + } +} diff --git a/src/serialization/resources/catalogs/types/GetPlansInCatalogResponse.ts b/src/serialization/resources/catalogs/types/GetPlansInCatalogResponse.ts new file mode 100644 index 00000000..fd42b6d5 --- /dev/null +++ b/src/serialization/resources/catalogs/types/GetPlansInCatalogResponse.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; +import { CatalogPlanIDsResponseData } from "../../../types/CatalogPlanIDsResponseData"; + +export const GetPlansInCatalogResponse: core.serialization.ObjectSchema< + serializers.GetPlansInCatalogResponse.Raw, + Schematic.GetPlansInCatalogResponse +> = core.serialization.object({ + data: CatalogPlanIDsResponseData, + params: core.serialization.record(core.serialization.string(), core.serialization.unknown()), +}); + +export declare namespace GetPlansInCatalogResponse { + export interface Raw { + data: CatalogPlanIDsResponseData.Raw; + params: Record; + } +} diff --git a/src/serialization/resources/catalogs/types/ListCatalogsParams.ts b/src/serialization/resources/catalogs/types/ListCatalogsParams.ts new file mode 100644 index 00000000..a967b30c --- /dev/null +++ b/src/serialization/resources/catalogs/types/ListCatalogsParams.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; + +export const ListCatalogsParams: core.serialization.ObjectSchema< + serializers.ListCatalogsParams.Raw, + Schematic.ListCatalogsParams +> = core.serialization.object({ + isDefault: core.serialization.property("is_default", core.serialization.boolean().optional()), + limit: core.serialization.number().optional(), + offset: core.serialization.number().optional(), + q: core.serialization.string().optional(), +}); + +export declare namespace ListCatalogsParams { + export interface Raw { + is_default?: boolean | null; + limit?: number | null; + offset?: number | null; + q?: string | null; + } +} diff --git a/src/serialization/resources/catalogs/types/ListCatalogsResponse.ts b/src/serialization/resources/catalogs/types/ListCatalogsResponse.ts new file mode 100644 index 00000000..d5c94134 --- /dev/null +++ b/src/serialization/resources/catalogs/types/ListCatalogsResponse.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; +import { CatalogResponseData } from "../../../types/CatalogResponseData"; +import { ListCatalogsParams } from "./ListCatalogsParams"; + +export const ListCatalogsResponse: core.serialization.ObjectSchema< + serializers.ListCatalogsResponse.Raw, + Schematic.ListCatalogsResponse +> = core.serialization.object({ + data: core.serialization.list(CatalogResponseData), + params: ListCatalogsParams, +}); + +export declare namespace ListCatalogsResponse { + export interface Raw { + data: CatalogResponseData.Raw[]; + params: ListCatalogsParams.Raw; + } +} diff --git a/src/serialization/resources/catalogs/types/UpdateCatalogResponse.ts b/src/serialization/resources/catalogs/types/UpdateCatalogResponse.ts new file mode 100644 index 00000000..2e80289c --- /dev/null +++ b/src/serialization/resources/catalogs/types/UpdateCatalogResponse.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; +import { CatalogResponseData } from "../../../types/CatalogResponseData"; + +export const UpdateCatalogResponse: core.serialization.ObjectSchema< + serializers.UpdateCatalogResponse.Raw, + Schematic.UpdateCatalogResponse +> = core.serialization.object({ + data: CatalogResponseData, + params: core.serialization.record(core.serialization.string(), core.serialization.unknown()), +}); + +export declare namespace UpdateCatalogResponse { + export interface Raw { + data: CatalogResponseData.Raw; + params: Record; + } +} diff --git a/src/serialization/resources/catalogs/types/UpdateConfigurationResponse.ts b/src/serialization/resources/catalogs/types/UpdateConfigurationResponse.ts new file mode 100644 index 00000000..a22c48f0 --- /dev/null +++ b/src/serialization/resources/catalogs/types/UpdateConfigurationResponse.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; +import { CatalogResponseData } from "../../../types/CatalogResponseData"; + +export const UpdateConfigurationResponse: core.serialization.ObjectSchema< + serializers.UpdateConfigurationResponse.Raw, + Schematic.UpdateConfigurationResponse +> = core.serialization.object({ + data: CatalogResponseData, + params: core.serialization.record(core.serialization.string(), core.serialization.unknown()), +}); + +export declare namespace UpdateConfigurationResponse { + export interface Raw { + data: CatalogResponseData.Raw; + params: Record; + } +} diff --git a/src/serialization/resources/catalogs/types/index.ts b/src/serialization/resources/catalogs/types/index.ts new file mode 100644 index 00000000..d066fbe6 --- /dev/null +++ b/src/serialization/resources/catalogs/types/index.ts @@ -0,0 +1,11 @@ +export * from "./CreateCatalogResponse"; +export * from "./DeleteCatalogResponse"; +export * from "./GetCatalogResponse"; +export * from "./GetConfigurationResponse"; +export * from "./GetCreditBundlesInCatalogResponse"; +export * from "./GetDerivedFeaturesResponse"; +export * from "./GetPlansInCatalogResponse"; +export * from "./ListCatalogsParams"; +export * from "./ListCatalogsResponse"; +export * from "./UpdateCatalogResponse"; +export * from "./UpdateConfigurationResponse"; diff --git a/src/serialization/resources/components/client/requests/BindCatalogRequestBody.ts b/src/serialization/resources/components/client/requests/BindCatalogRequestBody.ts new file mode 100644 index 00000000..a38c8982 --- /dev/null +++ b/src/serialization/resources/components/client/requests/BindCatalogRequestBody.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../../api/index"; +import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; + +export const BindCatalogRequestBody: core.serialization.Schema< + serializers.BindCatalogRequestBody.Raw, + Schematic.BindCatalogRequestBody +> = core.serialization.object({ + catalogId: core.serialization.property("catalog_id", core.serialization.string().optional()), +}); + +export declare namespace BindCatalogRequestBody { + export interface Raw { + catalog_id?: string | null; + } +} diff --git a/src/serialization/resources/components/client/requests/index.ts b/src/serialization/resources/components/client/requests/index.ts index f7e02f93..25dc5155 100644 --- a/src/serialization/resources/components/client/requests/index.ts +++ b/src/serialization/resources/components/client/requests/index.ts @@ -1,2 +1,3 @@ +export { BindCatalogRequestBody } from "./BindCatalogRequestBody"; export { CreateComponentRequestBody } from "./CreateComponentRequestBody"; export { UpdateComponentRequestBody } from "./UpdateComponentRequestBody"; diff --git a/src/serialization/resources/components/types/BindCatalogResponse.ts b/src/serialization/resources/components/types/BindCatalogResponse.ts new file mode 100644 index 00000000..deecfe4c --- /dev/null +++ b/src/serialization/resources/components/types/BindCatalogResponse.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; +import { ComponentResponseData } from "../../../types/ComponentResponseData"; + +export const BindCatalogResponse: core.serialization.ObjectSchema< + serializers.BindCatalogResponse.Raw, + Schematic.BindCatalogResponse +> = core.serialization.object({ + data: ComponentResponseData, + params: core.serialization.record(core.serialization.string(), core.serialization.unknown()), +}); + +export declare namespace BindCatalogResponse { + export interface Raw { + data: ComponentResponseData.Raw; + params: Record; + } +} diff --git a/src/serialization/resources/components/types/index.ts b/src/serialization/resources/components/types/index.ts index 7187a704..e8471aa4 100644 --- a/src/serialization/resources/components/types/index.ts +++ b/src/serialization/resources/components/types/index.ts @@ -1,3 +1,4 @@ +export * from "./BindCatalogResponse"; export * from "./CountComponentsParams"; export * from "./CountComponentsResponse"; export * from "./CreateComponentResponse"; diff --git a/src/serialization/resources/dataexports/client/requests/CreateDataExportRequestBody.ts b/src/serialization/resources/dataexports/client/requests/CreateDataExportRequestBody.ts index 15ad1b93..6e5a25e1 100644 --- a/src/serialization/resources/dataexports/client/requests/CreateDataExportRequestBody.ts +++ b/src/serialization/resources/dataexports/client/requests/CreateDataExportRequestBody.ts @@ -3,16 +3,23 @@ import type * as Schematic from "../../../../../api/index"; import * as core from "../../../../../core"; import type * as serializers from "../../../../index"; +import { DataExportMetadata } from "../../../../types/DataExportMetadata"; +import { DataExportOutputFileType } from "../../../../types/DataExportOutputFileType"; +import { DataExportType } from "../../../../types/DataExportType"; export const CreateDataExportRequestBody: core.serialization.Schema< serializers.CreateDataExportRequestBody.Raw, Schematic.CreateDataExportRequestBody > = core.serialization.object({ - metadata: core.serialization.string(), + exportType: core.serialization.property("export_type", DataExportType), + metadata: DataExportMetadata.optional(), + outputFileType: core.serialization.property("output_file_type", DataExportOutputFileType), }); export declare namespace CreateDataExportRequestBody { export interface Raw { - metadata: string; + export_type: DataExportType.Raw; + metadata?: DataExportMetadata.Raw | null; + output_file_type: DataExportOutputFileType.Raw; } } diff --git a/src/serialization/resources/dataexports/types/GetDataExportResponse.ts b/src/serialization/resources/dataexports/types/GetDataExportResponse.ts new file mode 100644 index 00000000..5ee68cfc --- /dev/null +++ b/src/serialization/resources/dataexports/types/GetDataExportResponse.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; +import { DataExportResponseData } from "../../../types/DataExportResponseData"; + +export const GetDataExportResponse: core.serialization.ObjectSchema< + serializers.GetDataExportResponse.Raw, + Schematic.GetDataExportResponse +> = core.serialization.object({ + data: DataExportResponseData, + params: core.serialization.record(core.serialization.string(), core.serialization.unknown()), +}); + +export declare namespace GetDataExportResponse { + export interface Raw { + data: DataExportResponseData.Raw; + params: Record; + } +} diff --git a/src/serialization/resources/dataexports/types/ListDataExportsParams.ts b/src/serialization/resources/dataexports/types/ListDataExportsParams.ts new file mode 100644 index 00000000..1285f606 --- /dev/null +++ b/src/serialization/resources/dataexports/types/ListDataExportsParams.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; +import { DataExportStatus } from "../../../types/DataExportStatus"; +import { DataExportType } from "../../../types/DataExportType"; + +export const ListDataExportsParams: core.serialization.ObjectSchema< + serializers.ListDataExportsParams.Raw, + Schematic.ListDataExportsParams +> = core.serialization.object({ + exportType: core.serialization.property("export_type", DataExportType.optional()), + limit: core.serialization.number().optional(), + offset: core.serialization.number().optional(), + status: DataExportStatus.optional(), +}); + +export declare namespace ListDataExportsParams { + export interface Raw { + export_type?: DataExportType.Raw | null; + limit?: number | null; + offset?: number | null; + status?: DataExportStatus.Raw | null; + } +} diff --git a/src/serialization/resources/dataexports/types/ListDataExportsResponse.ts b/src/serialization/resources/dataexports/types/ListDataExportsResponse.ts new file mode 100644 index 00000000..fdef43c0 --- /dev/null +++ b/src/serialization/resources/dataexports/types/ListDataExportsResponse.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; +import { DataExportResponseData } from "../../../types/DataExportResponseData"; +import { ListDataExportsParams } from "./ListDataExportsParams"; + +export const ListDataExportsResponse: core.serialization.ObjectSchema< + serializers.ListDataExportsResponse.Raw, + Schematic.ListDataExportsResponse +> = core.serialization.object({ + data: core.serialization.list(DataExportResponseData), + params: ListDataExportsParams, +}); + +export declare namespace ListDataExportsResponse { + export interface Raw { + data: DataExportResponseData.Raw[]; + params: ListDataExportsParams.Raw; + } +} diff --git a/src/serialization/resources/dataexports/types/index.ts b/src/serialization/resources/dataexports/types/index.ts index 878af314..fe6bc7c6 100644 --- a/src/serialization/resources/dataexports/types/index.ts +++ b/src/serialization/resources/dataexports/types/index.ts @@ -1 +1,4 @@ export * from "./CreateDataExportResponse"; +export * from "./GetDataExportResponse"; +export * from "./ListDataExportsParams"; +export * from "./ListDataExportsResponse"; diff --git a/src/serialization/resources/index.ts b/src/serialization/resources/index.ts index c96f25f7..b467928d 100644 --- a/src/serialization/resources/index.ts +++ b/src/serialization/resources/index.ts @@ -7,6 +7,9 @@ export * from "./accounts/types"; export * as billing from "./billing"; export * from "./billing/client/requests"; export * from "./billing/types"; +export * as catalogs from "./catalogs"; +export * from "./catalogs/client/requests"; +export * from "./catalogs/types"; export * as checkout from "./checkout"; export * from "./checkout/client/requests"; export * from "./checkout/types"; diff --git a/src/serialization/resources/planbundle/client/requests/CreateCustomPlanBundleRequestBody.ts b/src/serialization/resources/planbundle/client/requests/CreateCustomPlanBundleRequestBody.ts index 9df18a93..5239dcc3 100644 --- a/src/serialization/resources/planbundle/client/requests/CreateCustomPlanBundleRequestBody.ts +++ b/src/serialization/resources/planbundle/client/requests/CreateCustomPlanBundleRequestBody.ts @@ -4,6 +4,7 @@ import type * as Schematic from "../../../../../api/index"; import * as core from "../../../../../core"; import type * as serializers from "../../../../index"; import { CreateCustomPlanBundlePlanRequestBody } from "../../../../types/CreateCustomPlanBundlePlanRequestBody"; +import { PlanBundleCreditGrantRequestBody } from "../../../../types/PlanBundleCreditGrantRequestBody"; import { PlanBundleEntitlementRequestBody } from "../../../../types/PlanBundleEntitlementRequestBody"; import { UpsertBillingProductRequestBody } from "../../../../types/UpsertBillingProductRequestBody"; @@ -12,6 +13,10 @@ export const CreateCustomPlanBundleRequestBody: core.serialization.Schema< Schematic.CreateCustomPlanBundleRequestBody > = core.serialization.object({ billingProduct: core.serialization.property("billing_product", UpsertBillingProductRequestBody.optional()), + creditGrants: core.serialization.property( + "credit_grants", + core.serialization.list(PlanBundleCreditGrantRequestBody).optional(), + ), entitlements: core.serialization.list(PlanBundleEntitlementRequestBody), plan: CreateCustomPlanBundlePlanRequestBody.optional(), }); @@ -19,6 +24,7 @@ export const CreateCustomPlanBundleRequestBody: core.serialization.Schema< export declare namespace CreateCustomPlanBundleRequestBody { export interface Raw { billing_product?: UpsertBillingProductRequestBody.Raw | null; + credit_grants?: PlanBundleCreditGrantRequestBody.Raw[] | null; entitlements: PlanBundleEntitlementRequestBody.Raw[]; plan?: CreateCustomPlanBundlePlanRequestBody.Raw | null; } diff --git a/src/serialization/types/AuditLogExportMetadata.ts b/src/serialization/types/AuditLogExportMetadata.ts new file mode 100644 index 00000000..c48ba133 --- /dev/null +++ b/src/serialization/types/AuditLogExportMetadata.ts @@ -0,0 +1,29 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const AuditLogExportMetadata: core.serialization.ObjectSchema< + serializers.AuditLogExportMetadata.Raw, + Schematic.AuditLogExportMetadata +> = core.serialization.object({ + actorType: core.serialization.property("actor_type", core.serialization.string().optional()), + endTime: core.serialization.property("end_time", core.serialization.date().optional()), + notificationEmailRecipientEmailAddresses: core.serialization.property( + "notification_email_recipient_email_addresses", + core.serialization.list(core.serialization.string()).optional(), + ), + q: core.serialization.string().optional(), + startTime: core.serialization.property("start_time", core.serialization.date().optional()), +}); + +export declare namespace AuditLogExportMetadata { + export interface Raw { + actor_type?: string | null; + end_time?: string | null; + notification_email_recipient_email_addresses?: string[] | null; + q?: string | null; + start_time?: string | null; + } +} diff --git a/src/serialization/types/CatalogConfigOrderedBundle.ts b/src/serialization/types/CatalogConfigOrderedBundle.ts new file mode 100644 index 00000000..205a9f96 --- /dev/null +++ b/src/serialization/types/CatalogConfigOrderedBundle.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const CatalogConfigOrderedBundle: core.serialization.ObjectSchema< + serializers.CatalogConfigOrderedBundle.Raw, + Schematic.CatalogConfigOrderedBundle +> = core.serialization.object({ + bundleId: core.serialization.property("bundle_id", core.serialization.string()), +}); + +export declare namespace CatalogConfigOrderedBundle { + export interface Raw { + bundle_id: string; + } +} diff --git a/src/serialization/types/CatalogConfigOrderedBundleResponseData.ts b/src/serialization/types/CatalogConfigOrderedBundleResponseData.ts new file mode 100644 index 00000000..9c2f5305 --- /dev/null +++ b/src/serialization/types/CatalogConfigOrderedBundleResponseData.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const CatalogConfigOrderedBundleResponseData: core.serialization.ObjectSchema< + serializers.CatalogConfigOrderedBundleResponseData.Raw, + Schematic.CatalogConfigOrderedBundleResponseData +> = core.serialization.object({ + bundleId: core.serialization.property("bundle_id", core.serialization.string()), +}); + +export declare namespace CatalogConfigOrderedBundleResponseData { + export interface Raw { + bundle_id: string; + } +} diff --git a/src/serialization/types/CatalogConfigOrderedEntitlement.ts b/src/serialization/types/CatalogConfigOrderedEntitlement.ts new file mode 100644 index 00000000..7d506b35 --- /dev/null +++ b/src/serialization/types/CatalogConfigOrderedEntitlement.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const CatalogConfigOrderedEntitlement: core.serialization.ObjectSchema< + serializers.CatalogConfigOrderedEntitlement.Raw, + Schematic.CatalogConfigOrderedEntitlement +> = core.serialization.object({ + planEntitlementId: core.serialization.property("plan_entitlement_id", core.serialization.string()), + visible: core.serialization.boolean().optional(), +}); + +export declare namespace CatalogConfigOrderedEntitlement { + export interface Raw { + plan_entitlement_id: string; + visible?: boolean | null; + } +} diff --git a/src/serialization/types/CatalogConfigOrderedEntitlementResponseData.ts b/src/serialization/types/CatalogConfigOrderedEntitlementResponseData.ts new file mode 100644 index 00000000..5ed1eccb --- /dev/null +++ b/src/serialization/types/CatalogConfigOrderedEntitlementResponseData.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const CatalogConfigOrderedEntitlementResponseData: core.serialization.ObjectSchema< + serializers.CatalogConfigOrderedEntitlementResponseData.Raw, + Schematic.CatalogConfigOrderedEntitlementResponseData +> = core.serialization.object({ + planEntitlementId: core.serialization.property("plan_entitlement_id", core.serialization.string()), + visible: core.serialization.boolean(), +}); + +export declare namespace CatalogConfigOrderedEntitlementResponseData { + export interface Raw { + plan_entitlement_id: string; + visible: boolean; + } +} diff --git a/src/serialization/types/CatalogConfigOrderedPlan.ts b/src/serialization/types/CatalogConfigOrderedPlan.ts new file mode 100644 index 00000000..e763e3db --- /dev/null +++ b/src/serialization/types/CatalogConfigOrderedPlan.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; +import { CatalogConfigOrderedEntitlement } from "./CatalogConfigOrderedEntitlement"; + +export const CatalogConfigOrderedPlan: core.serialization.ObjectSchema< + serializers.CatalogConfigOrderedPlan.Raw, + Schematic.CatalogConfigOrderedPlan +> = core.serialization.object({ + entitlements: core.serialization.list(CatalogConfigOrderedEntitlement).optional(), + planId: core.serialization.property("plan_id", core.serialization.string()), +}); + +export declare namespace CatalogConfigOrderedPlan { + export interface Raw { + entitlements?: CatalogConfigOrderedEntitlement.Raw[] | null; + plan_id: string; + } +} diff --git a/src/serialization/types/CatalogConfigOrderedPlanResponseData.ts b/src/serialization/types/CatalogConfigOrderedPlanResponseData.ts new file mode 100644 index 00000000..1467fe9d --- /dev/null +++ b/src/serialization/types/CatalogConfigOrderedPlanResponseData.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; +import { CatalogConfigOrderedEntitlementResponseData } from "./CatalogConfigOrderedEntitlementResponseData"; + +export const CatalogConfigOrderedPlanResponseData: core.serialization.ObjectSchema< + serializers.CatalogConfigOrderedPlanResponseData.Raw, + Schematic.CatalogConfigOrderedPlanResponseData +> = core.serialization.object({ + entitlements: core.serialization.list(CatalogConfigOrderedEntitlementResponseData), + planId: core.serialization.property("plan_id", core.serialization.string()), +}); + +export declare namespace CatalogConfigOrderedPlanResponseData { + export interface Raw { + entitlements: CatalogConfigOrderedEntitlementResponseData.Raw[]; + plan_id: string; + } +} diff --git a/src/serialization/types/CatalogConfigurationResponseData.ts b/src/serialization/types/CatalogConfigurationResponseData.ts new file mode 100644 index 00000000..022ea88f --- /dev/null +++ b/src/serialization/types/CatalogConfigurationResponseData.ts @@ -0,0 +1,50 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; +import { CatalogConfigOrderedBundleResponseData } from "./CatalogConfigOrderedBundleResponseData"; +import { CatalogConfigOrderedPlanResponseData } from "./CatalogConfigOrderedPlanResponseData"; +import { PlanGroupPlanDetailResponseData } from "./PlanGroupPlanDetailResponseData"; + +export const CatalogConfigurationResponseData: core.serialization.ObjectSchema< + serializers.CatalogConfigurationResponseData.Raw, + Schematic.CatalogConfigurationResponseData +> = core.serialization.object({ + addOns: core.serialization.property("add_ons", core.serialization.list(PlanGroupPlanDetailResponseData)), + customPlanCtaText: core.serialization.property("custom_plan_cta_text", core.serialization.string().optional()), + customPlanCtaUrl: core.serialization.property("custom_plan_cta_url", core.serialization.string().optional()), + customPlanPriceText: core.serialization.property("custom_plan_price_text", core.serialization.string().optional()), + customPlansVisible: core.serialization.property("custom_plans_visible", core.serialization.boolean()), + orderedAddOns: core.serialization.property( + "ordered_add_ons", + core.serialization.list(CatalogConfigOrderedPlanResponseData), + ), + orderedBundles: core.serialization.property( + "ordered_bundles", + core.serialization.list(CatalogConfigOrderedBundleResponseData), + ), + orderedPlans: core.serialization.property( + "ordered_plans", + core.serialization.list(CatalogConfigOrderedPlanResponseData), + ), + plans: core.serialization.list(PlanGroupPlanDetailResponseData), + pricingModel: core.serialization.property("pricing_model", core.serialization.string().optional()), + pricingUrl: core.serialization.property("pricing_url", core.serialization.string().optional()), +}); + +export declare namespace CatalogConfigurationResponseData { + export interface Raw { + add_ons: PlanGroupPlanDetailResponseData.Raw[]; + custom_plan_cta_text?: string | null; + custom_plan_cta_url?: string | null; + custom_plan_price_text?: string | null; + custom_plans_visible: boolean; + ordered_add_ons: CatalogConfigOrderedPlanResponseData.Raw[]; + ordered_bundles: CatalogConfigOrderedBundleResponseData.Raw[]; + ordered_plans: CatalogConfigOrderedPlanResponseData.Raw[]; + plans: PlanGroupPlanDetailResponseData.Raw[]; + pricing_model?: string | null; + pricing_url?: string | null; + } +} diff --git a/src/serialization/types/CatalogCreditBundleIDsResponseData.ts b/src/serialization/types/CatalogCreditBundleIDsResponseData.ts new file mode 100644 index 00000000..ff1d4979 --- /dev/null +++ b/src/serialization/types/CatalogCreditBundleIDsResponseData.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const CatalogCreditBundleIDsResponseData: core.serialization.ObjectSchema< + serializers.CatalogCreditBundleIDsResponseData.Raw, + Schematic.CatalogCreditBundleIDsResponseData +> = core.serialization.object({ + creditBundleIds: core.serialization.property( + "credit_bundle_ids", + core.serialization.list(core.serialization.string()), + ), +}); + +export declare namespace CatalogCreditBundleIDsResponseData { + export interface Raw { + credit_bundle_ids: string[]; + } +} diff --git a/src/serialization/types/CatalogDerivedFeatureResponseData.ts b/src/serialization/types/CatalogDerivedFeatureResponseData.ts new file mode 100644 index 00000000..e8742693 --- /dev/null +++ b/src/serialization/types/CatalogDerivedFeatureResponseData.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const CatalogDerivedFeatureResponseData: core.serialization.ObjectSchema< + serializers.CatalogDerivedFeatureResponseData.Raw, + Schematic.CatalogDerivedFeatureResponseData +> = core.serialization.object({ + icon: core.serialization.string(), + id: core.serialization.string(), + name: core.serialization.string(), +}); + +export declare namespace CatalogDerivedFeatureResponseData { + export interface Raw { + icon: string; + id: string; + name: string; + } +} diff --git a/src/serialization/types/CatalogDerivedFeaturesResponseData.ts b/src/serialization/types/CatalogDerivedFeaturesResponseData.ts new file mode 100644 index 00000000..232b069b --- /dev/null +++ b/src/serialization/types/CatalogDerivedFeaturesResponseData.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; +import { CatalogDerivedFeatureResponseData } from "./CatalogDerivedFeatureResponseData"; + +export const CatalogDerivedFeaturesResponseData: core.serialization.ObjectSchema< + serializers.CatalogDerivedFeaturesResponseData.Raw, + Schematic.CatalogDerivedFeaturesResponseData +> = core.serialization.object({ + features: core.serialization.list(CatalogDerivedFeatureResponseData), +}); + +export declare namespace CatalogDerivedFeaturesResponseData { + export interface Raw { + features: CatalogDerivedFeatureResponseData.Raw[]; + } +} diff --git a/src/serialization/types/CatalogPlanIDsResponseData.ts b/src/serialization/types/CatalogPlanIDsResponseData.ts new file mode 100644 index 00000000..cc73e330 --- /dev/null +++ b/src/serialization/types/CatalogPlanIDsResponseData.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const CatalogPlanIDsResponseData: core.serialization.ObjectSchema< + serializers.CatalogPlanIDsResponseData.Raw, + Schematic.CatalogPlanIDsResponseData +> = core.serialization.object({ + planIds: core.serialization.property("plan_ids", core.serialization.list(core.serialization.string())), +}); + +export declare namespace CatalogPlanIDsResponseData { + export interface Raw { + plan_ids: string[]; + } +} diff --git a/src/serialization/types/CatalogResponseData.ts b/src/serialization/types/CatalogResponseData.ts new file mode 100644 index 00000000..1a6c76aa --- /dev/null +++ b/src/serialization/types/CatalogResponseData.ts @@ -0,0 +1,44 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const CatalogResponseData: core.serialization.ObjectSchema< + serializers.CatalogResponseData.Raw, + Schematic.CatalogResponseData +> = core.serialization.object({ + accountId: core.serialization.property("account_id", core.serialization.string()), + createdAt: core.serialization.property("created_at", core.serialization.date()), + customPlanCtaText: core.serialization.property("custom_plan_cta_text", core.serialization.string().optional()), + customPlanCtaUrl: core.serialization.property("custom_plan_cta_url", core.serialization.string().optional()), + customPlanPriceText: core.serialization.property("custom_plan_price_text", core.serialization.string().optional()), + customPlansVisible: core.serialization.property("custom_plans_visible", core.serialization.boolean()), + description: core.serialization.string().optional(), + environmentId: core.serialization.property("environment_id", core.serialization.string()), + id: core.serialization.string(), + isDefault: core.serialization.property("is_default", core.serialization.boolean()), + name: core.serialization.string(), + pricingModel: core.serialization.property("pricing_model", core.serialization.string().optional()), + pricingUrl: core.serialization.property("pricing_url", core.serialization.string().optional()), + updatedAt: core.serialization.property("updated_at", core.serialization.date()), +}); + +export declare namespace CatalogResponseData { + export interface Raw { + account_id: string; + created_at: string; + custom_plan_cta_text?: string | null; + custom_plan_cta_url?: string | null; + custom_plan_price_text?: string | null; + custom_plans_visible: boolean; + description?: string | null; + environment_id: string; + id: string; + is_default: boolean; + name: string; + pricing_model?: string | null; + pricing_url?: string | null; + updated_at: string; + } +} diff --git a/src/serialization/types/CompanyFeatureUsageExportMetadata.ts b/src/serialization/types/CompanyFeatureUsageExportMetadata.ts new file mode 100644 index 00000000..4311d0e1 --- /dev/null +++ b/src/serialization/types/CompanyFeatureUsageExportMetadata.ts @@ -0,0 +1,74 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const CompanyFeatureUsageExportMetadata: core.serialization.ObjectSchema< + serializers.CompanyFeatureUsageExportMetadata.Raw, + Schematic.CompanyFeatureUsageExportMetadata +> = core.serialization.object({ + companyIds: core.serialization.property( + "company_ids", + core.serialization.list(core.serialization.string()).optional(), + ), + creditTypeIds: core.serialization.property( + "credit_type_ids", + core.serialization.list(core.serialization.string()).optional(), + ), + featureIds: core.serialization.property("feature_ids", core.serialization.list(core.serialization.string())), + hasScheduledDowngrade: core.serialization.property( + "has_scheduled_downgrade", + core.serialization.boolean().optional(), + ), + monetizedSubscriptions: core.serialization.property( + "monetized_subscriptions", + core.serialization.boolean().optional(), + ), + notificationEmailRecipientEmailAddresses: core.serialization.property( + "notification_email_recipient_email_addresses", + core.serialization.list(core.serialization.string()).optional(), + ), + planId: core.serialization.property("plan_id", core.serialization.string().optional()), + planIds: core.serialization.property("plan_ids", core.serialization.list(core.serialization.string()).optional()), + planVersionId: core.serialization.property("plan_version_id", core.serialization.string().optional()), + q: core.serialization.string().optional(), + subscriptionStatuses: core.serialization.property( + "subscription_statuses", + core.serialization.list(core.serialization.string()).optional(), + ), + subscriptionTypes: core.serialization.property( + "subscription_types", + core.serialization.list(core.serialization.string()).optional(), + ), + withEntitlementFor: core.serialization.property("with_entitlement_for", core.serialization.string().optional()), + withSubscription: core.serialization.property("with_subscription", core.serialization.boolean().optional()), + withoutFeatureOverrideFor: core.serialization.property( + "without_feature_override_for", + core.serialization.string().optional(), + ), + withoutPlan: core.serialization.property("without_plan", core.serialization.boolean().optional()), + withoutSubscription: core.serialization.property("without_subscription", core.serialization.boolean().optional()), +}); + +export declare namespace CompanyFeatureUsageExportMetadata { + export interface Raw { + company_ids?: string[] | null; + credit_type_ids?: string[] | null; + feature_ids: string[]; + has_scheduled_downgrade?: boolean | null; + monetized_subscriptions?: boolean | null; + notification_email_recipient_email_addresses?: string[] | null; + plan_id?: string | null; + plan_ids?: string[] | null; + plan_version_id?: string | null; + q?: string | null; + subscription_statuses?: string[] | null; + subscription_types?: string[] | null; + with_entitlement_for?: string | null; + with_subscription?: boolean | null; + without_feature_override_for?: string | null; + without_plan?: boolean | null; + without_subscription?: boolean | null; + } +} diff --git a/src/serialization/types/CompanyPlanDetailResponseData.ts b/src/serialization/types/CompanyPlanDetailResponseData.ts index 029a2b7b..1fa82430 100644 --- a/src/serialization/types/CompanyPlanDetailResponseData.ts +++ b/src/serialization/types/CompanyPlanDetailResponseData.ts @@ -14,6 +14,7 @@ import { CompanyPlanInvalidReason } from "./CompanyPlanInvalidReason"; import { CustomPlanConfig } from "./CustomPlanConfig"; import { FeatureInPlanResponseData } from "./FeatureInPlanResponseData"; import { FeatureUsageResponseData } from "./FeatureUsageResponseData"; +import { PlanCatalogMembershipResponseData } from "./PlanCatalogMembershipResponseData"; import { PlanCreditGrantView } from "./PlanCreditGrantView"; import { PlanCurrencyPricesResponseData } from "./PlanCurrencyPricesResponseData"; import { PlanEntitlementResponseData } from "./PlanEntitlementResponseData"; @@ -35,6 +36,7 @@ export const CompanyPlanDetailResponseData: core.serialization.ObjectSchema< ), billingProduct: core.serialization.property("billing_product", BillingProductDetailResponseData.optional()), billingStrategy: core.serialization.property("billing_strategy", BillingStrategy), + catalogs: core.serialization.list(PlanCatalogMembershipResponseData).optional(), chargeType: core.serialization.property("charge_type", ChargeType), companyCanTrial: core.serialization.property("company_can_trial", core.serialization.boolean()), companyCount: core.serialization.property("company_count", core.serialization.number()), @@ -92,6 +94,7 @@ export declare namespace CompanyPlanDetailResponseData { billing_linked_resource?: BillingLinkedResourceResponseData.Raw | null; billing_product?: BillingProductDetailResponseData.Raw | null; billing_strategy: BillingStrategy.Raw; + catalogs?: PlanCatalogMembershipResponseData.Raw[] | null; charge_type: ChargeType.Raw; company_can_trial: boolean; company_count: number; diff --git a/src/serialization/types/ComponentResponseData.ts b/src/serialization/types/ComponentResponseData.ts index 5f767b93..37afd99c 100644 --- a/src/serialization/types/ComponentResponseData.ts +++ b/src/serialization/types/ComponentResponseData.ts @@ -11,6 +11,7 @@ export const ComponentResponseData: core.serialization.ObjectSchema< Schematic.ComponentResponseData > = core.serialization.object({ ast: core.serialization.record(core.serialization.string(), core.serialization.number()).optional(), + catalogId: core.serialization.property("catalog_id", core.serialization.string().optional()), createdAt: core.serialization.property("created_at", core.serialization.date()), id: core.serialization.string(), name: core.serialization.string(), @@ -22,6 +23,7 @@ export const ComponentResponseData: core.serialization.ObjectSchema< export declare namespace ComponentResponseData { export interface Raw { ast?: Record | null; + catalog_id?: string | null; created_at: string; id: string; name: string; diff --git a/src/serialization/types/DataExportMetadata.ts b/src/serialization/types/DataExportMetadata.ts new file mode 100644 index 00000000..1b656cbc --- /dev/null +++ b/src/serialization/types/DataExportMetadata.ts @@ -0,0 +1,32 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; +import { AuditLogExportMetadata } from "./AuditLogExportMetadata"; +import { CompanyFeatureUsageExportMetadata } from "./CompanyFeatureUsageExportMetadata"; + +export const DataExportMetadata: core.serialization.Schema< + serializers.DataExportMetadata.Raw, + Schematic.DataExportMetadata +> = core.serialization + .union(core.serialization.discriminant("exportType", "export_type"), { + "audit-log": AuditLogExportMetadata, + "company-feature-usage": CompanyFeatureUsageExportMetadata, + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace DataExportMetadata { + export type Raw = DataExportMetadata.AuditLog | DataExportMetadata.CompanyFeatureUsage; + + export interface AuditLog extends AuditLogExportMetadata.Raw { + export_type: "audit-log"; + } + + export interface CompanyFeatureUsage extends CompanyFeatureUsageExportMetadata.Raw { + export_type: "company-feature-usage"; + } +} diff --git a/src/serialization/types/DataExportOutputFileType.ts b/src/serialization/types/DataExportOutputFileType.ts index ec3da6e6..f8222b56 100644 --- a/src/serialization/types/DataExportOutputFileType.ts +++ b/src/serialization/types/DataExportOutputFileType.ts @@ -7,8 +7,8 @@ import type * as serializers from "../index"; export const DataExportOutputFileType: core.serialization.Schema< serializers.DataExportOutputFileType.Raw, Schematic.DataExportOutputFileType -> = core.serialization.stringLiteral("csv"); +> = core.serialization.enum_(["csv", "csv.gz"]); export declare namespace DataExportOutputFileType { - export type Raw = "csv"; + export type Raw = "csv" | "csv.gz"; } diff --git a/src/serialization/types/DataExportResponseData.ts b/src/serialization/types/DataExportResponseData.ts index e04da771..2a4921c1 100644 --- a/src/serialization/types/DataExportResponseData.ts +++ b/src/serialization/types/DataExportResponseData.ts @@ -3,6 +3,7 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; +import { DataExportMetadata } from "./DataExportMetadata"; import { DataExportOutputFileType } from "./DataExportOutputFileType"; import { DataExportStatus } from "./DataExportStatus"; import { DataExportType } from "./DataExportType"; @@ -16,7 +17,7 @@ export const DataExportResponseData: core.serialization.ObjectSchema< environmentId: core.serialization.property("environment_id", core.serialization.string()), exportType: core.serialization.property("export_type", DataExportType), id: core.serialization.string(), - metadata: core.serialization.string(), + metadata: DataExportMetadata.optional(), outputFileType: core.serialization.property("output_file_type", DataExportOutputFileType), status: DataExportStatus, updatedAt: core.serialization.property("updated_at", core.serialization.date()), @@ -29,7 +30,7 @@ export declare namespace DataExportResponseData { environment_id: string; export_type: DataExportType.Raw; id: string; - metadata: string; + metadata?: DataExportMetadata.Raw | null; output_file_type: DataExportOutputFileType.Raw; status: DataExportStatus.Raw; updated_at: string; diff --git a/src/serialization/types/DataExportType.ts b/src/serialization/types/DataExportType.ts index c43398eb..27a3f723 100644 --- a/src/serialization/types/DataExportType.ts +++ b/src/serialization/types/DataExportType.ts @@ -5,8 +5,8 @@ import * as core from "../../core"; import type * as serializers from "../index"; export const DataExportType: core.serialization.Schema = - core.serialization.stringLiteral("company-feature-usage"); + core.serialization.enum_(["audit-log", "company-feature-usage"]); export declare namespace DataExportType { - export type Raw = "company-feature-usage"; + export type Raw = "audit-log" | "company-feature-usage"; } diff --git a/src/serialization/types/FeatureEntitlement.ts b/src/serialization/types/FeatureEntitlement.ts index 2c8f6c16..c143bdc4 100644 --- a/src/serialization/types/FeatureEntitlement.ts +++ b/src/serialization/types/FeatureEntitlement.ts @@ -6,6 +6,7 @@ import type * as serializers from "../index"; import { EntitlementValueType } from "./EntitlementValueType"; import { MetricPeriod } from "./MetricPeriod"; import { MetricPeriodMonthReset } from "./MetricPeriodMonthReset"; +import { WarningTier } from "./WarningTier"; export const FeatureEntitlement: core.serialization.ObjectSchema< serializers.FeatureEntitlement.Raw, @@ -29,6 +30,7 @@ export const FeatureEntitlement: core.serialization.ObjectSchema< softLimit: core.serialization.property("soft_limit", core.serialization.number().optional()), usage: core.serialization.number().optional(), valueType: core.serialization.property("value_type", EntitlementValueType), + warningTiers: core.serialization.property("warning_tiers", core.serialization.list(WarningTier).optional()), }); export declare namespace FeatureEntitlement { @@ -51,5 +53,6 @@ export declare namespace FeatureEntitlement { soft_limit?: number | null; usage?: number | null; value_type: EntitlementValueType.Raw; + warning_tiers?: WarningTier.Raw[] | null; } } diff --git a/src/serialization/types/PlanCatalogMembershipResponseData.ts b/src/serialization/types/PlanCatalogMembershipResponseData.ts new file mode 100644 index 00000000..6388d111 --- /dev/null +++ b/src/serialization/types/PlanCatalogMembershipResponseData.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const PlanCatalogMembershipResponseData: core.serialization.ObjectSchema< + serializers.PlanCatalogMembershipResponseData.Raw, + Schematic.PlanCatalogMembershipResponseData +> = core.serialization.object({ + id: core.serialization.string(), + name: core.serialization.string(), +}); + +export declare namespace PlanCatalogMembershipResponseData { + export interface Raw { + id: string; + name: string; + } +} diff --git a/src/serialization/types/PlanDetailResponseData.ts b/src/serialization/types/PlanDetailResponseData.ts index e9e736cb..96643d37 100644 --- a/src/serialization/types/PlanDetailResponseData.ts +++ b/src/serialization/types/PlanDetailResponseData.ts @@ -12,6 +12,7 @@ import { BillingProviderType } from "./BillingProviderType"; import { BillingStrategy } from "./BillingStrategy"; import { ChargeType } from "./ChargeType"; import { FeatureInPlanResponseData } from "./FeatureInPlanResponseData"; +import { PlanCatalogMembershipResponseData } from "./PlanCatalogMembershipResponseData"; import { PlanCurrencyPricesResponseData } from "./PlanCurrencyPricesResponseData"; import { PlanEntitlementResponseData } from "./PlanEntitlementResponseData"; import { PlanIcon } from "./PlanIcon"; @@ -30,6 +31,7 @@ export const PlanDetailResponseData: core.serialization.ObjectSchema< ), billingProduct: core.serialization.property("billing_product", BillingProductDetailResponseData.optional()), billingStrategy: core.serialization.property("billing_strategy", BillingStrategy), + catalogs: core.serialization.list(PlanCatalogMembershipResponseData).optional(), chargeType: core.serialization.property("charge_type", ChargeType), companyCount: core.serialization.property("company_count", core.serialization.number()), companyId: core.serialization.property("company_id", core.serialization.string().optional()), @@ -74,6 +76,7 @@ export declare namespace PlanDetailResponseData { billing_linked_resource?: BillingLinkedResourceResponseData.Raw | null; billing_product?: BillingProductDetailResponseData.Raw | null; billing_strategy: BillingStrategy.Raw; + catalogs?: PlanCatalogMembershipResponseData.Raw[] | null; charge_type: ChargeType.Raw; company_count: number; company_id?: string | null; diff --git a/src/serialization/types/PlanGroupPlanDetailResponseData.ts b/src/serialization/types/PlanGroupPlanDetailResponseData.ts index f253ffcc..50899f45 100644 --- a/src/serialization/types/PlanGroupPlanDetailResponseData.ts +++ b/src/serialization/types/PlanGroupPlanDetailResponseData.ts @@ -13,6 +13,7 @@ import { BillingStrategy } from "./BillingStrategy"; import { ChargeType } from "./ChargeType"; import { CustomPlanViewConfigResponseData } from "./CustomPlanViewConfigResponseData"; import { FeatureInPlanResponseData } from "./FeatureInPlanResponseData"; +import { PlanCatalogMembershipResponseData } from "./PlanCatalogMembershipResponseData"; import { PlanCurrencyPricesResponseData } from "./PlanCurrencyPricesResponseData"; import { PlanEntitlementResponseData } from "./PlanEntitlementResponseData"; import { PlanIcon } from "./PlanIcon"; @@ -33,6 +34,7 @@ export const PlanGroupPlanDetailResponseData: core.serialization.ObjectSchema< ), billingProduct: core.serialization.property("billing_product", BillingProductDetailResponseData.optional()), billingStrategy: core.serialization.property("billing_strategy", BillingStrategy), + catalogs: core.serialization.list(PlanCatalogMembershipResponseData).optional(), chargeType: core.serialization.property("charge_type", ChargeType), companyCount: core.serialization.property("company_count", core.serialization.number()), companyId: core.serialization.property("company_id", core.serialization.string().optional()), @@ -84,6 +86,7 @@ export declare namespace PlanGroupPlanDetailResponseData { billing_linked_resource?: BillingLinkedResourceResponseData.Raw | null; billing_product?: BillingProductDetailResponseData.Raw | null; billing_strategy: BillingStrategy.Raw; + catalogs?: PlanCatalogMembershipResponseData.Raw[] | null; charge_type: ChargeType.Raw; company_count: number; company_id?: string | null; diff --git a/src/serialization/types/PlanViewPublicResponseData.ts b/src/serialization/types/PlanViewPublicResponseData.ts index 466270f7..60651792 100644 --- a/src/serialization/types/PlanViewPublicResponseData.ts +++ b/src/serialization/types/PlanViewPublicResponseData.ts @@ -12,6 +12,7 @@ import { BillingStrategy } from "./BillingStrategy"; import { ChargeType } from "./ChargeType"; import { CustomPlanConfig } from "./CustomPlanConfig"; import { FeatureInPlanResponseData } from "./FeatureInPlanResponseData"; +import { PlanCatalogMembershipResponseData } from "./PlanCatalogMembershipResponseData"; import { PlanCreditGrantView } from "./PlanCreditGrantView"; import { PlanCurrencyPricesResponseData } from "./PlanCurrencyPricesResponseData"; import { PlanEntitlementResponseData } from "./PlanEntitlementResponseData"; @@ -33,6 +34,7 @@ export const PlanViewPublicResponseData: core.serialization.ObjectSchema< ), billingProduct: core.serialization.property("billing_product", BillingProductDetailResponseData.optional()), billingStrategy: core.serialization.property("billing_strategy", BillingStrategy), + catalogs: core.serialization.list(PlanCatalogMembershipResponseData).optional(), chargeType: core.serialization.property("charge_type", ChargeType), companyCount: core.serialization.property("company_count", core.serialization.number()), companyId: core.serialization.property("company_id", core.serialization.string().optional()), @@ -85,6 +87,7 @@ export declare namespace PlanViewPublicResponseData { billing_linked_resource?: BillingLinkedResourceResponseData.Raw | null; billing_product?: BillingProductDetailResponseData.Raw | null; billing_strategy: BillingStrategy.Raw; + catalogs?: PlanCatalogMembershipResponseData.Raw[] | null; charge_type: ChargeType.Raw; company_count: number; company_id?: string | null; diff --git a/src/serialization/types/PreviewSubscriptionDiscountResponseData.ts b/src/serialization/types/PreviewSubscriptionDiscountResponseData.ts new file mode 100644 index 00000000..d1eee15c --- /dev/null +++ b/src/serialization/types/PreviewSubscriptionDiscountResponseData.ts @@ -0,0 +1,38 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const PreviewSubscriptionDiscountResponseData: core.serialization.ObjectSchema< + serializers.PreviewSubscriptionDiscountResponseData.Raw, + Schematic.PreviewSubscriptionDiscountResponseData +> = core.serialization.object({ + amountOff: core.serialization.property("amount_off", core.serialization.number().optional()), + couponName: core.serialization.property("coupon_name", core.serialization.string()), + currency: core.serialization.string().optional(), + customerFacingCode: core.serialization.property("customer_facing_code", core.serialization.string().optional()), + duration: core.serialization.string(), + durationInMonths: core.serialization.property("duration_in_months", core.serialization.number().optional()), + endedAt: core.serialization.property("ended_at", core.serialization.date().optional()), + isActive: core.serialization.property("is_active", core.serialization.boolean()), + percentOff: core.serialization.property("percent_off", core.serialization.number().optional()), + promoCodeExternalId: core.serialization.property("promo_code_external_id", core.serialization.string().optional()), + startedAt: core.serialization.property("started_at", core.serialization.date()), +}); + +export declare namespace PreviewSubscriptionDiscountResponseData { + export interface Raw { + amount_off?: number | null; + coupon_name: string; + currency?: string | null; + customer_facing_code?: string | null; + duration: string; + duration_in_months?: number | null; + ended_at?: string | null; + is_active: boolean; + percent_off?: number | null; + promo_code_external_id?: string | null; + started_at: string; + } +} diff --git a/src/serialization/types/PreviewSubscriptionFinanceResponseData.ts b/src/serialization/types/PreviewSubscriptionFinanceResponseData.ts index 8597a983..5a2b380d 100644 --- a/src/serialization/types/PreviewSubscriptionFinanceResponseData.ts +++ b/src/serialization/types/PreviewSubscriptionFinanceResponseData.ts @@ -3,6 +3,7 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; +import { PreviewSubscriptionDiscountResponseData } from "./PreviewSubscriptionDiscountResponseData"; import { PreviewSubscriptionUpcomingInvoiceLineItems } from "./PreviewSubscriptionUpcomingInvoiceLineItems"; export const PreviewSubscriptionFinanceResponseData: core.serialization.ObjectSchema< @@ -10,9 +11,11 @@ export const PreviewSubscriptionFinanceResponseData: core.serialization.ObjectSc Schematic.PreviewSubscriptionFinanceResponseData > = core.serialization.object({ amountOff: core.serialization.property("amount_off", core.serialization.number()), + discounts: core.serialization.list(PreviewSubscriptionDiscountResponseData), dueNow: core.serialization.property("due_now", core.serialization.number()), newCharges: core.serialization.property("new_charges", core.serialization.number()), percentOff: core.serialization.property("percent_off", core.serialization.number()), + periodEnd: core.serialization.property("period_end", core.serialization.date()), periodStart: core.serialization.property("period_start", core.serialization.date()), promoCodeApplied: core.serialization.property("promo_code_applied", core.serialization.boolean()), proration: core.serialization.number(), @@ -30,9 +33,11 @@ export const PreviewSubscriptionFinanceResponseData: core.serialization.ObjectSc export declare namespace PreviewSubscriptionFinanceResponseData { export interface Raw { amount_off: number; + discounts: PreviewSubscriptionDiscountResponseData.Raw[]; due_now: number; new_charges: number; percent_off: number; + period_end: string; period_start: string; promo_code_applied: boolean; proration: number; diff --git a/src/serialization/types/RulesengineFeatureEntitlement.ts b/src/serialization/types/RulesengineFeatureEntitlement.ts index dff926ff..4387b8fb 100644 --- a/src/serialization/types/RulesengineFeatureEntitlement.ts +++ b/src/serialization/types/RulesengineFeatureEntitlement.ts @@ -6,6 +6,7 @@ import type * as serializers from "../index"; import { RulesengineEntitlementValueType } from "./RulesengineEntitlementValueType"; import { RulesengineMetricPeriod } from "./RulesengineMetricPeriod"; import { RulesengineMetricPeriodMonthReset } from "./RulesengineMetricPeriodMonthReset"; +import { RulesengineWarningTier } from "./RulesengineWarningTier"; export const RulesengineFeatureEntitlement: core.serialization.ObjectSchema< serializers.RulesengineFeatureEntitlement.Raw, @@ -29,6 +30,10 @@ export const RulesengineFeatureEntitlement: core.serialization.ObjectSchema< softLimit: core.serialization.property("soft_limit", core.serialization.number().optional()), usage: core.serialization.number().optional(), valueType: core.serialization.property("value_type", RulesengineEntitlementValueType), + warningTiers: core.serialization.property( + "warning_tiers", + core.serialization.list(RulesengineWarningTier).optional(), + ), }); export declare namespace RulesengineFeatureEntitlement { @@ -51,5 +56,6 @@ export declare namespace RulesengineFeatureEntitlement { soft_limit?: number | null; usage?: number | null; value_type: RulesengineEntitlementValueType.Raw; + warning_tiers?: RulesengineWarningTier.Raw[] | null; } } diff --git a/src/serialization/types/RulesengineWarningTier.ts b/src/serialization/types/RulesengineWarningTier.ts new file mode 100644 index 00000000..273e9cf7 --- /dev/null +++ b/src/serialization/types/RulesengineWarningTier.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const RulesengineWarningTier: core.serialization.ObjectSchema< + serializers.RulesengineWarningTier.Raw, + Schematic.RulesengineWarningTier +> = core.serialization.object({ + key: core.serialization.string(), + value: core.serialization.number(), +}); + +export declare namespace RulesengineWarningTier { + export interface Raw { + key: string; + value: number; + } +} diff --git a/src/serialization/types/UpsertCompanyRequestBody.ts b/src/serialization/types/UpsertCompanyRequestBody.ts index 9e0e5d3d..c33fb29c 100644 --- a/src/serialization/types/UpsertCompanyRequestBody.ts +++ b/src/serialization/types/UpsertCompanyRequestBody.ts @@ -8,6 +8,8 @@ export const UpsertCompanyRequestBody: core.serialization.ObjectSchema< serializers.UpsertCompanyRequestBody.Raw, Schematic.UpsertCompanyRequestBody > = core.serialization.object({ + basePlanId: core.serialization.property("base_plan_id", core.serialization.string().optional()), + basePlanPriceId: core.serialization.property("base_plan_price_id", core.serialization.string().optional()), id: core.serialization.string().optional(), keys: core.serialization.record(core.serialization.string(), core.serialization.string()), lastSeenAt: core.serialization.property("last_seen_at", core.serialization.date().optional()), @@ -19,6 +21,8 @@ export const UpsertCompanyRequestBody: core.serialization.ObjectSchema< export declare namespace UpsertCompanyRequestBody { export interface Raw { + base_plan_id?: string | null; + base_plan_price_id?: string | null; id?: string | null; keys: Record; last_seen_at?: string | null; diff --git a/src/serialization/types/WarningTier.ts b/src/serialization/types/WarningTier.ts new file mode 100644 index 00000000..6d4b327f --- /dev/null +++ b/src/serialization/types/WarningTier.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const WarningTier: core.serialization.ObjectSchema = + core.serialization.object({ + key: core.serialization.string(), + value: core.serialization.number(), + }); + +export declare namespace WarningTier { + export interface Raw { + key: string; + value: number; + } +} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index e65f2a4b..873eb82c 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -9,6 +9,7 @@ export * from "./ApiKeyCreateResponseData"; export * from "./ApiKeyIntegrationResponseData"; export * from "./ApiKeyResponseData"; export * from "./ApiKeyScope"; +export * from "./AuditLogExportMetadata"; export * from "./AuditLogListResponseData"; export * from "./AuditLogResponseData"; export * from "./BillingCouponResponseData"; @@ -59,6 +60,18 @@ export * from "./BillingSubscriptionView"; export * from "./BillingTiersMode"; export * from "./CaptureRawEvent"; export * from "./CaptureRawEventBatch"; +export * from "./CatalogConfigOrderedBundle"; +export * from "./CatalogConfigOrderedBundleResponseData"; +export * from "./CatalogConfigOrderedEntitlement"; +export * from "./CatalogConfigOrderedEntitlementResponseData"; +export * from "./CatalogConfigOrderedPlan"; +export * from "./CatalogConfigOrderedPlanResponseData"; +export * from "./CatalogConfigurationResponseData"; +export * from "./CatalogCreditBundleIDsResponseData"; +export * from "./CatalogDerivedFeatureResponseData"; +export * from "./CatalogDerivedFeaturesResponseData"; +export * from "./CatalogPlanIDsResponseData"; +export * from "./CatalogResponseData"; export * from "./ChangeSubscriptionInternalRequestBody"; export * from "./ChangeSubscriptionRequestBody"; export * from "./ChargeType"; @@ -80,6 +93,7 @@ export * from "./CompanyCreditBalance"; export * from "./CompanyCreditBalanceResponseData"; export * from "./CompanyDetailResponseData"; export * from "./CompanyEventPeriodMetricsResponseData"; +export * from "./CompanyFeatureUsageExportMetadata"; export * from "./CompanyLedgerResponseData"; export * from "./CompanyMatchingCriteria"; export * from "./CompanyMembershipDetailResponseData"; @@ -158,6 +172,7 @@ export * from "./CustomPlanBillingStatus"; export * from "./CustomPlanConfig"; export * from "./CustomPlanViewConfigResponseData"; export * from "./DataEventPayload"; +export * from "./DataExportMetadata"; export * from "./DataExportOutputFileType"; export * from "./DataExportResponseData"; export * from "./DataExportStatus"; @@ -254,6 +269,7 @@ export * from "./PlanBundleAction"; export * from "./PlanBundleCreditGrantRequestBody"; export * from "./PlanBundleEntitlementRequestBody"; export * from "./PlanBundleResponseData"; +export * from "./PlanCatalogMembershipResponseData"; export * from "./PlanChangeAction"; export * from "./PlanChangeBasePlanAction"; export * from "./PlanChangeResponseData"; @@ -291,6 +307,7 @@ export * from "./PlanViewPublicResponseData"; export * from "./PreviewObject"; export * from "./PreviewObjectResponseData"; export * from "./PreviewSubscriptionChangeResponseData"; +export * from "./PreviewSubscriptionDiscountResponseData"; export * from "./PreviewSubscriptionFinanceResponseData"; export * from "./PreviewSubscriptionUpcomingInvoiceLineItems"; export * from "./ProrationBehavior"; @@ -327,6 +344,7 @@ export * from "./RulesengineTrait"; export * from "./RulesengineTraitDefinition"; export * from "./RulesengineTraitDefinitionComparableType"; export * from "./RulesengineUser"; +export * from "./RulesengineWarningTier"; export * from "./RuleType"; export * from "./RuleView"; export * from "./ScheduledCheckoutResponseData"; @@ -371,6 +389,7 @@ export * from "./UsageBasedEntitlementResponseData"; export * from "./UsageTimeSeriesPointResponseData"; export * from "./UserDetailResponseData"; export * from "./UserResponseData"; +export * from "./WarningTier"; export * from "./WarningTierRequestBody"; export * from "./WarningTierResponseData"; export * from "./WebFeatureUsageWebhookOutput"; diff --git a/tests/wire/catalogs.test.ts b/tests/wire/catalogs.test.ts new file mode 100644 index 00000000..5a55171c --- /dev/null +++ b/tests/wire/catalogs.test.ts @@ -0,0 +1,2311 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Schematic from "../../src/api/index"; +import { SchematicClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("CatalogsClient", () => { + test("listCatalogs (1)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + account_id: "account_id", + created_at: "2024-01-15T09:30:00Z", + custom_plan_cta_text: "custom_plan_cta_text", + custom_plan_cta_url: "custom_plan_cta_url", + custom_plan_price_text: "custom_plan_price_text", + custom_plans_visible: true, + description: "description", + environment_id: "environment_id", + id: "id", + is_default: true, + name: "name", + pricing_model: "pricing_model", + pricing_url: "pricing_url", + updated_at: "2024-01-15T09:30:00Z", + }, + ], + params: { is_default: true, limit: 1000000, offset: 1000000, q: "q" }, + }; + + server.mockEndpoint().get("/catalogs").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.catalogs.listCatalogs({ + isDefault: true, + q: "q", + limit: 1000000, + offset: 1000000, + }); + expect(response).toEqual({ + data: [ + { + accountId: "account_id", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + customPlanCtaText: "custom_plan_cta_text", + customPlanCtaUrl: "custom_plan_cta_url", + customPlanPriceText: "custom_plan_price_text", + customPlansVisible: true, + description: "description", + environmentId: "environment_id", + id: "id", + isDefault: true, + name: "name", + pricingModel: "pricing_model", + pricingUrl: "pricing_url", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + params: { + isDefault: true, + limit: 1000000, + offset: 1000000, + q: "q", + }, + }); + }); + + test("listCatalogs (2)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server.mockEndpoint().get("/catalogs").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.catalogs.listCatalogs(); + }).rejects.toThrow(Schematic.BadRequestError); + }); + + test("listCatalogs (3)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server.mockEndpoint().get("/catalogs").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.catalogs.listCatalogs(); + }).rejects.toThrow(Schematic.UnauthorizedError); + }); + + test("listCatalogs (4)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server.mockEndpoint().get("/catalogs").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.catalogs.listCatalogs(); + }).rejects.toThrow(Schematic.ForbiddenError); + }); + + test("listCatalogs (5)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server.mockEndpoint().get("/catalogs").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.catalogs.listCatalogs(); + }).rejects.toThrow(Schematic.NotFoundError); + }); + + test("listCatalogs (6)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server.mockEndpoint().get("/catalogs").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.catalogs.listCatalogs(); + }).rejects.toThrow(Schematic.InternalServerError); + }); + + test("createCatalog (1)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { is_default: true, name: "name" }; + const rawResponseBody = { + data: { + account_id: "account_id", + created_at: "2024-01-15T09:30:00Z", + custom_plan_cta_text: "custom_plan_cta_text", + custom_plan_cta_url: "custom_plan_cta_url", + custom_plan_price_text: "custom_plan_price_text", + custom_plans_visible: true, + description: "description", + environment_id: "environment_id", + id: "id", + is_default: true, + name: "name", + pricing_model: "pricing_model", + pricing_url: "pricing_url", + updated_at: "2024-01-15T09:30:00Z", + }, + params: { key: "value" }, + }; + + server + .mockEndpoint() + .post("/catalogs") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.catalogs.createCatalog({ + isDefault: true, + name: "name", + }); + expect(response).toEqual({ + data: { + accountId: "account_id", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + customPlanCtaText: "custom_plan_cta_text", + customPlanCtaUrl: "custom_plan_cta_url", + customPlanPriceText: "custom_plan_price_text", + customPlansVisible: true, + description: "description", + environmentId: "environment_id", + id: "id", + isDefault: true, + name: "name", + pricingModel: "pricing_model", + pricingUrl: "pricing_url", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + params: { + key: "value", + }, + }); + }); + + test("createCatalog (2)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { is_default: true, name: "name" }; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .post("/catalogs") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.createCatalog({ + isDefault: true, + name: "name", + }); + }).rejects.toThrow(Schematic.BadRequestError); + }); + + test("createCatalog (3)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { is_default: true, name: "name" }; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .post("/catalogs") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.createCatalog({ + isDefault: true, + name: "name", + }); + }).rejects.toThrow(Schematic.UnauthorizedError); + }); + + test("createCatalog (4)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { is_default: true, name: "name" }; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .post("/catalogs") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.createCatalog({ + isDefault: true, + name: "name", + }); + }).rejects.toThrow(Schematic.ForbiddenError); + }); + + test("createCatalog (5)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { is_default: true, name: "name" }; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .post("/catalogs") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.createCatalog({ + isDefault: true, + name: "name", + }); + }).rejects.toThrow(Schematic.NotFoundError); + }); + + test("createCatalog (6)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { is_default: true, name: "name" }; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .post("/catalogs") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.createCatalog({ + isDefault: true, + name: "name", + }); + }).rejects.toThrow(Schematic.InternalServerError); + }); + + test("getCatalog (1)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + account_id: "account_id", + created_at: "2024-01-15T09:30:00Z", + custom_plan_cta_text: "custom_plan_cta_text", + custom_plan_cta_url: "custom_plan_cta_url", + custom_plan_price_text: "custom_plan_price_text", + custom_plans_visible: true, + description: "description", + environment_id: "environment_id", + id: "id", + is_default: true, + name: "name", + pricing_model: "pricing_model", + pricing_url: "pricing_url", + updated_at: "2024-01-15T09:30:00Z", + }, + params: { key: "value" }, + }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.catalogs.getCatalog("catalog_id"); + expect(response).toEqual({ + data: { + accountId: "account_id", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + customPlanCtaText: "custom_plan_cta_text", + customPlanCtaUrl: "custom_plan_cta_url", + customPlanPriceText: "custom_plan_price_text", + customPlansVisible: true, + description: "description", + environmentId: "environment_id", + id: "id", + isDefault: true, + name: "name", + pricingModel: "pricing_model", + pricingUrl: "pricing_url", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + params: { + key: "value", + }, + }); + }); + + test("getCatalog (2)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.getCatalog("catalog_id"); + }).rejects.toThrow(Schematic.UnauthorizedError); + }); + + test("getCatalog (3)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.getCatalog("catalog_id"); + }).rejects.toThrow(Schematic.ForbiddenError); + }); + + test("getCatalog (4)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.getCatalog("catalog_id"); + }).rejects.toThrow(Schematic.NotFoundError); + }); + + test("getCatalog (5)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.getCatalog("catalog_id"); + }).rejects.toThrow(Schematic.InternalServerError); + }); + + test("updateCatalog (1)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { + data: { + account_id: "account_id", + created_at: "2024-01-15T09:30:00Z", + custom_plan_cta_text: "custom_plan_cta_text", + custom_plan_cta_url: "custom_plan_cta_url", + custom_plan_price_text: "custom_plan_price_text", + custom_plans_visible: true, + description: "description", + environment_id: "environment_id", + id: "id", + is_default: true, + name: "name", + pricing_model: "pricing_model", + pricing_url: "pricing_url", + updated_at: "2024-01-15T09:30:00Z", + }, + params: { key: "value" }, + }; + + server + .mockEndpoint() + .put("/catalogs/catalog_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.catalogs.updateCatalog("catalog_id"); + expect(response).toEqual({ + data: { + accountId: "account_id", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + customPlanCtaText: "custom_plan_cta_text", + customPlanCtaUrl: "custom_plan_cta_url", + customPlanPriceText: "custom_plan_price_text", + customPlansVisible: true, + description: "description", + environmentId: "environment_id", + id: "id", + isDefault: true, + name: "name", + pricingModel: "pricing_model", + pricingUrl: "pricing_url", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + params: { + key: "value", + }, + }); + }); + + test("updateCatalog (2)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .put("/catalogs/catalog_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.updateCatalog("catalog_id"); + }).rejects.toThrow(Schematic.BadRequestError); + }); + + test("updateCatalog (3)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .put("/catalogs/catalog_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.updateCatalog("catalog_id"); + }).rejects.toThrow(Schematic.UnauthorizedError); + }); + + test("updateCatalog (4)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .put("/catalogs/catalog_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.updateCatalog("catalog_id"); + }).rejects.toThrow(Schematic.ForbiddenError); + }); + + test("updateCatalog (5)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .put("/catalogs/catalog_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.updateCatalog("catalog_id"); + }).rejects.toThrow(Schematic.NotFoundError); + }); + + test("updateCatalog (6)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .put("/catalogs/catalog_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.updateCatalog("catalog_id"); + }).rejects.toThrow(Schematic.InternalServerError); + }); + + test("deleteCatalog (1)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { data: { deleted: true }, params: { key: "value" } }; + + server + .mockEndpoint() + .delete("/catalogs/catalog_id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.catalogs.deleteCatalog("catalog_id"); + expect(response).toEqual({ + data: { + deleted: true, + }, + params: { + key: "value", + }, + }); + }); + + test("deleteCatalog (2)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .delete("/catalogs/catalog_id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.deleteCatalog("catalog_id"); + }).rejects.toThrow(Schematic.BadRequestError); + }); + + test("deleteCatalog (3)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .delete("/catalogs/catalog_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.deleteCatalog("catalog_id"); + }).rejects.toThrow(Schematic.UnauthorizedError); + }); + + test("deleteCatalog (4)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .delete("/catalogs/catalog_id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.deleteCatalog("catalog_id"); + }).rejects.toThrow(Schematic.ForbiddenError); + }); + + test("deleteCatalog (5)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .delete("/catalogs/catalog_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.deleteCatalog("catalog_id"); + }).rejects.toThrow(Schematic.NotFoundError); + }); + + test("deleteCatalog (6)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .delete("/catalogs/catalog_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.deleteCatalog("catalog_id"); + }).rejects.toThrow(Schematic.InternalServerError); + }); + + test("getConfiguration (1)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + add_ons: [ + { + available_periods: ["monthly"], + billing_strategy: "schematic_managed", + charge_type: "free", + company_count: 1000000, + compatible_plan_ids: ["compatible_plan_ids"], + controlled_by: "metronome", + created_at: "2024-01-15T09:30:00Z", + credits: [ + { + burn_strategy: "expiration_priority", + cost_editable: true, + created_at: "2024-01-15T09:30:00Z", + currency_prices: [{ currency: "currency" }], + default_expiry_unit: "billing_periods", + default_rollover_policy: "expire", + description: "description", + id: "id", + name: "name", + updated_at: "2024-01-15T09:30:00Z", + }, + ], + currency_prices: [{ currency: "currency" }], + description: "description", + features: [ + { + created_at: "2024-01-15T09:30:00Z", + description: "description", + feature_type: "boolean", + flags: [ + { + created_at: "2024-01-15T09:30:00Z", + default_value: true, + description: "description", + flag_type: "boolean", + id: "id", + key: "key", + name: "name", + rules: [ + { + condition_groups: [ + { + conditions: [ + { + condition_type: "base_plan", + created_at: "2024-01-15T09:30:00Z", + environment_id: "environment_id", + id: "id", + operator: "eq", + resource_ids: ["resource_ids"], + resources: [{ id: "id", name: "name" }], + rule_id: "rule_id", + trait_value: "trait_value", + updated_at: "2024-01-15T09:30:00Z", + }, + ], + created_at: "2024-01-15T09:30:00Z", + environment_id: "environment_id", + id: "id", + rule_id: "rule_id", + updated_at: "2024-01-15T09:30:00Z", + }, + ], + conditions: [ + { + condition_type: "base_plan", + created_at: "2024-01-15T09:30:00Z", + environment_id: "environment_id", + id: "id", + operator: "eq", + resource_ids: ["resource_ids"], + resources: [{ id: "id", name: "name" }], + rule_id: "rule_id", + trait_value: "trait_value", + updated_at: "2024-01-15T09:30:00Z", + }, + ], + created_at: "2024-01-15T09:30:00Z", + environment_id: "environment_id", + id: "id", + name: "name", + priority: 1000000, + rule_type: "company_override", + updated_at: "2024-01-15T09:30:00Z", + value: true, + }, + ], + updated_at: "2024-01-15T09:30:00Z", + }, + ], + icon: "icon", + id: "id", + name: "name", + plans: [{ id: "id", name: "name" }], + updated_at: "2024-01-15T09:30:00Z", + }, + ], + icon: "amber", + id: "id", + is_custom: true, + is_default: true, + is_free: true, + is_trialable: true, + name: "name", + plan_type: "plan", + updated_at: "2024-01-15T09:30:00Z", + versions: [ + { + created_at: "2024-01-15T09:30:00Z", + description: "description", + environment_id: "environment_id", + icon: "amber", + id: "id", + name: "name", + plan_type: "plan", + status: "published", + updated_at: "2024-01-15T09:30:00Z", + version: 1000000, + }, + ], + }, + ], + custom_plan_cta_text: "custom_plan_cta_text", + custom_plan_cta_url: "custom_plan_cta_url", + custom_plan_price_text: "custom_plan_price_text", + custom_plans_visible: true, + ordered_add_ons: [ + { + entitlements: [{ plan_entitlement_id: "plan_entitlement_id", visible: true }], + plan_id: "plan_id", + }, + ], + ordered_bundles: [{ bundle_id: "bundle_id" }], + ordered_plans: [ + { + entitlements: [{ plan_entitlement_id: "plan_entitlement_id", visible: true }], + plan_id: "plan_id", + }, + ], + plans: [ + { + available_periods: ["monthly"], + billing_strategy: "schematic_managed", + charge_type: "free", + company_count: 1000000, + compatible_plan_ids: ["compatible_plan_ids"], + controlled_by: "metronome", + created_at: "2024-01-15T09:30:00Z", + credits: [ + { + burn_strategy: "expiration_priority", + cost_editable: true, + created_at: "2024-01-15T09:30:00Z", + currency_prices: [{ currency: "currency" }], + default_expiry_unit: "billing_periods", + default_rollover_policy: "expire", + description: "description", + id: "id", + name: "name", + updated_at: "2024-01-15T09:30:00Z", + }, + ], + currency_prices: [{ currency: "currency" }], + description: "description", + features: [ + { + created_at: "2024-01-15T09:30:00Z", + description: "description", + feature_type: "boolean", + flags: [ + { + created_at: "2024-01-15T09:30:00Z", + default_value: true, + description: "description", + flag_type: "boolean", + id: "id", + key: "key", + name: "name", + rules: [ + { + condition_groups: [ + { + conditions: [ + { + condition_type: "base_plan", + created_at: "2024-01-15T09:30:00Z", + environment_id: "environment_id", + id: "id", + operator: "eq", + resource_ids: ["resource_ids"], + resources: [{ id: "id", name: "name" }], + rule_id: "rule_id", + trait_value: "trait_value", + updated_at: "2024-01-15T09:30:00Z", + }, + ], + created_at: "2024-01-15T09:30:00Z", + environment_id: "environment_id", + id: "id", + rule_id: "rule_id", + updated_at: "2024-01-15T09:30:00Z", + }, + ], + conditions: [ + { + condition_type: "base_plan", + created_at: "2024-01-15T09:30:00Z", + environment_id: "environment_id", + id: "id", + operator: "eq", + resource_ids: ["resource_ids"], + resources: [{ id: "id", name: "name" }], + rule_id: "rule_id", + trait_value: "trait_value", + updated_at: "2024-01-15T09:30:00Z", + }, + ], + created_at: "2024-01-15T09:30:00Z", + environment_id: "environment_id", + id: "id", + name: "name", + priority: 1000000, + rule_type: "company_override", + updated_at: "2024-01-15T09:30:00Z", + value: true, + }, + ], + updated_at: "2024-01-15T09:30:00Z", + }, + ], + icon: "icon", + id: "id", + name: "name", + plans: [{ id: "id", name: "name" }], + updated_at: "2024-01-15T09:30:00Z", + }, + ], + icon: "amber", + id: "id", + is_custom: true, + is_default: true, + is_free: true, + is_trialable: true, + name: "name", + plan_type: "plan", + updated_at: "2024-01-15T09:30:00Z", + versions: [ + { + created_at: "2024-01-15T09:30:00Z", + description: "description", + environment_id: "environment_id", + icon: "amber", + id: "id", + name: "name", + plan_type: "plan", + status: "published", + updated_at: "2024-01-15T09:30:00Z", + version: 1000000, + }, + ], + }, + ], + pricing_model: "pricing_model", + pricing_url: "pricing_url", + }, + params: { key: "value" }, + }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id/configuration") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.catalogs.getConfiguration("catalog_id"); + expect(response).toEqual({ + data: { + addOns: [ + { + availablePeriods: ["monthly"], + billingStrategy: "schematic_managed", + chargeType: "free", + companyCount: 1000000, + compatiblePlanIds: ["compatible_plan_ids"], + controlledBy: "metronome", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + credits: [ + { + burnStrategy: "expiration_priority", + costEditable: true, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + currencyPrices: [ + { + currency: "currency", + }, + ], + defaultExpiryUnit: "billing_periods", + defaultRolloverPolicy: "expire", + description: "description", + id: "id", + name: "name", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + currencyPrices: [ + { + currency: "currency", + }, + ], + description: "description", + features: [ + { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + description: "description", + featureType: "boolean", + flags: [ + { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + defaultValue: true, + description: "description", + flagType: "boolean", + id: "id", + key: "key", + name: "name", + rules: [ + { + conditionGroups: [ + { + conditions: [ + { + conditionType: "base_plan", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + environmentId: "environment_id", + id: "id", + operator: "eq", + resourceIds: ["resource_ids"], + resources: [ + { + id: "id", + name: "name", + }, + ], + ruleId: "rule_id", + traitValue: "trait_value", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + createdAt: new Date("2024-01-15T09:30:00.000Z"), + environmentId: "environment_id", + id: "id", + ruleId: "rule_id", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + conditions: [ + { + conditionType: "base_plan", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + environmentId: "environment_id", + id: "id", + operator: "eq", + resourceIds: ["resource_ids"], + resources: [ + { + id: "id", + name: "name", + }, + ], + ruleId: "rule_id", + traitValue: "trait_value", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + createdAt: new Date("2024-01-15T09:30:00.000Z"), + environmentId: "environment_id", + id: "id", + name: "name", + priority: 1000000, + ruleType: "company_override", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + value: true, + }, + ], + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + icon: "icon", + id: "id", + name: "name", + plans: [ + { + id: "id", + name: "name", + }, + ], + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + icon: "amber", + id: "id", + isCustom: true, + isDefault: true, + isFree: true, + isTrialable: true, + name: "name", + planType: "plan", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + versions: [ + { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + description: "description", + environmentId: "environment_id", + icon: "amber", + id: "id", + name: "name", + planType: "plan", + status: "published", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + version: 1000000, + }, + ], + }, + ], + customPlanCtaText: "custom_plan_cta_text", + customPlanCtaUrl: "custom_plan_cta_url", + customPlanPriceText: "custom_plan_price_text", + customPlansVisible: true, + orderedAddOns: [ + { + entitlements: [ + { + planEntitlementId: "plan_entitlement_id", + visible: true, + }, + ], + planId: "plan_id", + }, + ], + orderedBundles: [ + { + bundleId: "bundle_id", + }, + ], + orderedPlans: [ + { + entitlements: [ + { + planEntitlementId: "plan_entitlement_id", + visible: true, + }, + ], + planId: "plan_id", + }, + ], + plans: [ + { + availablePeriods: ["monthly"], + billingStrategy: "schematic_managed", + chargeType: "free", + companyCount: 1000000, + compatiblePlanIds: ["compatible_plan_ids"], + controlledBy: "metronome", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + credits: [ + { + burnStrategy: "expiration_priority", + costEditable: true, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + currencyPrices: [ + { + currency: "currency", + }, + ], + defaultExpiryUnit: "billing_periods", + defaultRolloverPolicy: "expire", + description: "description", + id: "id", + name: "name", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + currencyPrices: [ + { + currency: "currency", + }, + ], + description: "description", + features: [ + { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + description: "description", + featureType: "boolean", + flags: [ + { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + defaultValue: true, + description: "description", + flagType: "boolean", + id: "id", + key: "key", + name: "name", + rules: [ + { + conditionGroups: [ + { + conditions: [ + { + conditionType: "base_plan", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + environmentId: "environment_id", + id: "id", + operator: "eq", + resourceIds: ["resource_ids"], + resources: [ + { + id: "id", + name: "name", + }, + ], + ruleId: "rule_id", + traitValue: "trait_value", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + createdAt: new Date("2024-01-15T09:30:00.000Z"), + environmentId: "environment_id", + id: "id", + ruleId: "rule_id", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + conditions: [ + { + conditionType: "base_plan", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + environmentId: "environment_id", + id: "id", + operator: "eq", + resourceIds: ["resource_ids"], + resources: [ + { + id: "id", + name: "name", + }, + ], + ruleId: "rule_id", + traitValue: "trait_value", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + createdAt: new Date("2024-01-15T09:30:00.000Z"), + environmentId: "environment_id", + id: "id", + name: "name", + priority: 1000000, + ruleType: "company_override", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + value: true, + }, + ], + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + icon: "icon", + id: "id", + name: "name", + plans: [ + { + id: "id", + name: "name", + }, + ], + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + icon: "amber", + id: "id", + isCustom: true, + isDefault: true, + isFree: true, + isTrialable: true, + name: "name", + planType: "plan", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + versions: [ + { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + description: "description", + environmentId: "environment_id", + icon: "amber", + id: "id", + name: "name", + planType: "plan", + status: "published", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + version: 1000000, + }, + ], + }, + ], + pricingModel: "pricing_model", + pricingUrl: "pricing_url", + }, + params: { + key: "value", + }, + }); + }); + + test("getConfiguration (2)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id/configuration") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.getConfiguration("catalog_id"); + }).rejects.toThrow(Schematic.UnauthorizedError); + }); + + test("getConfiguration (3)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id/configuration") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.getConfiguration("catalog_id"); + }).rejects.toThrow(Schematic.ForbiddenError); + }); + + test("getConfiguration (4)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id/configuration") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.getConfiguration("catalog_id"); + }).rejects.toThrow(Schematic.NotFoundError); + }); + + test("getConfiguration (5)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id/configuration") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.getConfiguration("catalog_id"); + }).rejects.toThrow(Schematic.InternalServerError); + }); + + test("updateConfiguration (1)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { + data: { + account_id: "account_id", + created_at: "2024-01-15T09:30:00Z", + custom_plan_cta_text: "custom_plan_cta_text", + custom_plan_cta_url: "custom_plan_cta_url", + custom_plan_price_text: "custom_plan_price_text", + custom_plans_visible: true, + description: "description", + environment_id: "environment_id", + id: "id", + is_default: true, + name: "name", + pricing_model: "pricing_model", + pricing_url: "pricing_url", + updated_at: "2024-01-15T09:30:00Z", + }, + params: { key: "value" }, + }; + + server + .mockEndpoint() + .put("/catalogs/catalog_id/configuration") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.catalogs.updateConfiguration("catalog_id"); + expect(response).toEqual({ + data: { + accountId: "account_id", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + customPlanCtaText: "custom_plan_cta_text", + customPlanCtaUrl: "custom_plan_cta_url", + customPlanPriceText: "custom_plan_price_text", + customPlansVisible: true, + description: "description", + environmentId: "environment_id", + id: "id", + isDefault: true, + name: "name", + pricingModel: "pricing_model", + pricingUrl: "pricing_url", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + params: { + key: "value", + }, + }); + }); + + test("updateConfiguration (2)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .put("/catalogs/catalog_id/configuration") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.updateConfiguration("catalog_id"); + }).rejects.toThrow(Schematic.BadRequestError); + }); + + test("updateConfiguration (3)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .put("/catalogs/catalog_id/configuration") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.updateConfiguration("catalog_id"); + }).rejects.toThrow(Schematic.UnauthorizedError); + }); + + test("updateConfiguration (4)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .put("/catalogs/catalog_id/configuration") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.updateConfiguration("catalog_id"); + }).rejects.toThrow(Schematic.ForbiddenError); + }); + + test("updateConfiguration (5)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .put("/catalogs/catalog_id/configuration") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.updateConfiguration("catalog_id"); + }).rejects.toThrow(Schematic.NotFoundError); + }); + + test("updateConfiguration (6)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .put("/catalogs/catalog_id/configuration") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.updateConfiguration("catalog_id"); + }).rejects.toThrow(Schematic.InternalServerError); + }); + + test("getCreditBundlesInCatalog (1)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { data: { credit_bundle_ids: ["credit_bundle_ids"] }, params: { key: "value" } }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id/credit-bundles") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.catalogs.getCreditBundlesInCatalog("catalog_id"); + expect(response).toEqual({ + data: { + creditBundleIds: ["credit_bundle_ids"], + }, + params: { + key: "value", + }, + }); + }); + + test("getCreditBundlesInCatalog (2)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id/credit-bundles") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.getCreditBundlesInCatalog("catalog_id"); + }).rejects.toThrow(Schematic.UnauthorizedError); + }); + + test("getCreditBundlesInCatalog (3)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id/credit-bundles") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.getCreditBundlesInCatalog("catalog_id"); + }).rejects.toThrow(Schematic.ForbiddenError); + }); + + test("getCreditBundlesInCatalog (4)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id/credit-bundles") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.getCreditBundlesInCatalog("catalog_id"); + }).rejects.toThrow(Schematic.NotFoundError); + }); + + test("getCreditBundlesInCatalog (5)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id/credit-bundles") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.getCreditBundlesInCatalog("catalog_id"); + }).rejects.toThrow(Schematic.InternalServerError); + }); + + test("addCreditBundle (1)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server + .mockEndpoint() + .post("/catalogs/catalog_id/credit-bundles/credit_bundle_id") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.catalogs.addCreditBundle("catalog_id", "credit_bundle_id"); + expect(response).toEqual(undefined); + }); + + test("addCreditBundle (2)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .post("/catalogs/catalog_id/credit-bundles/credit_bundle_id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.addCreditBundle("catalog_id", "credit_bundle_id"); + }).rejects.toThrow(Schematic.BadRequestError); + }); + + test("addCreditBundle (3)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .post("/catalogs/catalog_id/credit-bundles/credit_bundle_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.addCreditBundle("catalog_id", "credit_bundle_id"); + }).rejects.toThrow(Schematic.UnauthorizedError); + }); + + test("addCreditBundle (4)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .post("/catalogs/catalog_id/credit-bundles/credit_bundle_id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.addCreditBundle("catalog_id", "credit_bundle_id"); + }).rejects.toThrow(Schematic.ForbiddenError); + }); + + test("addCreditBundle (5)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .post("/catalogs/catalog_id/credit-bundles/credit_bundle_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.addCreditBundle("catalog_id", "credit_bundle_id"); + }).rejects.toThrow(Schematic.NotFoundError); + }); + + test("addCreditBundle (6)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .post("/catalogs/catalog_id/credit-bundles/credit_bundle_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.addCreditBundle("catalog_id", "credit_bundle_id"); + }).rejects.toThrow(Schematic.InternalServerError); + }); + + test("removeCreditBundle (1)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server + .mockEndpoint() + .delete("/catalogs/catalog_id/credit-bundles/credit_bundle_id") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.catalogs.removeCreditBundle("catalog_id", "credit_bundle_id"); + expect(response).toEqual(undefined); + }); + + test("removeCreditBundle (2)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .delete("/catalogs/catalog_id/credit-bundles/credit_bundle_id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.removeCreditBundle("catalog_id", "credit_bundle_id"); + }).rejects.toThrow(Schematic.BadRequestError); + }); + + test("removeCreditBundle (3)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .delete("/catalogs/catalog_id/credit-bundles/credit_bundle_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.removeCreditBundle("catalog_id", "credit_bundle_id"); + }).rejects.toThrow(Schematic.UnauthorizedError); + }); + + test("removeCreditBundle (4)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .delete("/catalogs/catalog_id/credit-bundles/credit_bundle_id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.removeCreditBundle("catalog_id", "credit_bundle_id"); + }).rejects.toThrow(Schematic.ForbiddenError); + }); + + test("removeCreditBundle (5)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .delete("/catalogs/catalog_id/credit-bundles/credit_bundle_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.removeCreditBundle("catalog_id", "credit_bundle_id"); + }).rejects.toThrow(Schematic.NotFoundError); + }); + + test("removeCreditBundle (6)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .delete("/catalogs/catalog_id/credit-bundles/credit_bundle_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.removeCreditBundle("catalog_id", "credit_bundle_id"); + }).rejects.toThrow(Schematic.InternalServerError); + }); + + test("getDerivedFeatures (1)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { features: [{ icon: "icon", id: "id", name: "name" }] }, + params: { key: "value" }, + }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id/features") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.catalogs.getDerivedFeatures("catalog_id"); + expect(response).toEqual({ + data: { + features: [ + { + icon: "icon", + id: "id", + name: "name", + }, + ], + }, + params: { + key: "value", + }, + }); + }); + + test("getDerivedFeatures (2)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id/features") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.getDerivedFeatures("catalog_id"); + }).rejects.toThrow(Schematic.UnauthorizedError); + }); + + test("getDerivedFeatures (3)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id/features") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.getDerivedFeatures("catalog_id"); + }).rejects.toThrow(Schematic.ForbiddenError); + }); + + test("getDerivedFeatures (4)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id/features") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.getDerivedFeatures("catalog_id"); + }).rejects.toThrow(Schematic.NotFoundError); + }); + + test("getDerivedFeatures (5)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id/features") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.getDerivedFeatures("catalog_id"); + }).rejects.toThrow(Schematic.InternalServerError); + }); + + test("getPlansInCatalog (1)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { data: { plan_ids: ["plan_ids"] }, params: { key: "value" } }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id/plans") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.catalogs.getPlansInCatalog("catalog_id"); + expect(response).toEqual({ + data: { + planIds: ["plan_ids"], + }, + params: { + key: "value", + }, + }); + }); + + test("getPlansInCatalog (2)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id/plans") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.getPlansInCatalog("catalog_id"); + }).rejects.toThrow(Schematic.UnauthorizedError); + }); + + test("getPlansInCatalog (3)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id/plans") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.getPlansInCatalog("catalog_id"); + }).rejects.toThrow(Schematic.ForbiddenError); + }); + + test("getPlansInCatalog (4)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id/plans") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.getPlansInCatalog("catalog_id"); + }).rejects.toThrow(Schematic.NotFoundError); + }); + + test("getPlansInCatalog (5)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/catalogs/catalog_id/plans") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.getPlansInCatalog("catalog_id"); + }).rejects.toThrow(Schematic.InternalServerError); + }); + + test("addPlan (1)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().post("/catalogs/catalog_id/plans/plan_id").respondWith().statusCode(200).build(); + + const response = await client.catalogs.addPlan("catalog_id", "plan_id"); + expect(response).toEqual(undefined); + }); + + test("addPlan (2)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .post("/catalogs/catalog_id/plans/plan_id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.addPlan("catalog_id", "plan_id"); + }).rejects.toThrow(Schematic.BadRequestError); + }); + + test("addPlan (3)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .post("/catalogs/catalog_id/plans/plan_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.addPlan("catalog_id", "plan_id"); + }).rejects.toThrow(Schematic.UnauthorizedError); + }); + + test("addPlan (4)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .post("/catalogs/catalog_id/plans/plan_id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.addPlan("catalog_id", "plan_id"); + }).rejects.toThrow(Schematic.ForbiddenError); + }); + + test("addPlan (5)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .post("/catalogs/catalog_id/plans/plan_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.addPlan("catalog_id", "plan_id"); + }).rejects.toThrow(Schematic.NotFoundError); + }); + + test("addPlan (6)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .post("/catalogs/catalog_id/plans/plan_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.addPlan("catalog_id", "plan_id"); + }).rejects.toThrow(Schematic.InternalServerError); + }); + + test("removePlan (1)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/catalogs/catalog_id/plans/plan_id").respondWith().statusCode(200).build(); + + const response = await client.catalogs.removePlan("catalog_id", "plan_id"); + expect(response).toEqual(undefined); + }); + + test("removePlan (2)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .delete("/catalogs/catalog_id/plans/plan_id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.removePlan("catalog_id", "plan_id"); + }).rejects.toThrow(Schematic.BadRequestError); + }); + + test("removePlan (3)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .delete("/catalogs/catalog_id/plans/plan_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.removePlan("catalog_id", "plan_id"); + }).rejects.toThrow(Schematic.UnauthorizedError); + }); + + test("removePlan (4)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .delete("/catalogs/catalog_id/plans/plan_id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.removePlan("catalog_id", "plan_id"); + }).rejects.toThrow(Schematic.ForbiddenError); + }); + + test("removePlan (5)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .delete("/catalogs/catalog_id/plans/plan_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.removePlan("catalog_id", "plan_id"); + }).rejects.toThrow(Schematic.NotFoundError); + }); + + test("removePlan (6)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .delete("/catalogs/catalog_id/plans/plan_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.catalogs.removePlan("catalog_id", "plan_id"); + }).rejects.toThrow(Schematic.InternalServerError); + }); +}); diff --git a/tests/wire/checkout.test.ts b/tests/wire/checkout.test.ts index 08d8bfd5..b6de2c02 100644 --- a/tests/wire/checkout.test.ts +++ b/tests/wire/checkout.test.ts @@ -789,6 +789,7 @@ describe("CheckoutClient", () => { updated_at: "2024-01-15T09:30:00Z", }, billing_strategy: "schematic_managed", + catalogs: [{ id: "id", name: "name" }], charge_type: "free", company_count: 1000000, company_id: "company_id", @@ -1348,6 +1349,7 @@ describe("CheckoutClient", () => { updated_at: "2024-01-15T09:30:00Z", }, billing_strategy: "schematic_managed", + catalogs: [{ id: "id", name: "name" }], charge_type: "free", company_count: 1000000, company_id: "company_id", @@ -1832,6 +1834,12 @@ describe("CheckoutClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, billingStrategy: "schematic_managed", + catalogs: [ + { + id: "id", + name: "name", + }, + ], chargeType: "free", companyCount: 1000000, companyId: "company_id", @@ -2453,6 +2461,12 @@ describe("CheckoutClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, billingStrategy: "schematic_managed", + catalogs: [ + { + id: "id", + name: "name", + }, + ], chargeType: "free", companyCount: 1000000, companyId: "company_id", @@ -2906,9 +2920,18 @@ describe("CheckoutClient", () => { due_now: 1000000, finance: { amount_off: 1000000, + discounts: [ + { + coupon_name: "coupon_name", + duration: "duration", + is_active: true, + started_at: "2024-01-15T09:30:00Z", + }, + ], due_now: 1000000, new_charges: 1000000, percent_off: 1.1, + period_end: "2024-01-15T09:30:00Z", period_start: "2024-01-15T09:30:00Z", promo_code_applied: true, proration: 1000000, @@ -3000,9 +3023,18 @@ describe("CheckoutClient", () => { dueNow: 1000000, finance: { amountOff: 1000000, + discounts: [ + { + couponName: "coupon_name", + duration: "duration", + isActive: true, + startedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], dueNow: 1000000, newCharges: 1000000, percentOff: 1.1, + periodEnd: new Date("2024-01-15T09:30:00.000Z"), periodStart: new Date("2024-01-15T09:30:00.000Z"), promoCodeApplied: true, proration: 1000000, @@ -4552,9 +4584,18 @@ describe("CheckoutClient", () => { due_now: 1000000, finance: { amount_off: 1000000, + discounts: [ + { + coupon_name: "coupon_name", + duration: "duration", + is_active: true, + started_at: "2024-01-15T09:30:00Z", + }, + ], due_now: 1000000, new_charges: 1000000, percent_off: 1.1, + period_end: "2024-01-15T09:30:00Z", period_start: "2024-01-15T09:30:00Z", promo_code_applied: true, proration: 1000000, @@ -4636,9 +4677,18 @@ describe("CheckoutClient", () => { dueNow: 1000000, finance: { amountOff: 1000000, + discounts: [ + { + couponName: "coupon_name", + duration: "duration", + isActive: true, + startedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], dueNow: 1000000, newCharges: 1000000, percentOff: 1.1, + periodEnd: new Date("2024-01-15T09:30:00.000Z"), periodStart: new Date("2024-01-15T09:30:00.000Z"), promoCodeApplied: true, proration: 1000000, diff --git a/tests/wire/companies.test.ts b/tests/wire/companies.test.ts index 9588598f..706623fa 100644 --- a/tests/wire/companies.test.ts +++ b/tests/wire/companies.test.ts @@ -4565,6 +4565,10 @@ describe("CompaniesClient", () => { soft_limit: 1000000, usage: 1000000, value_type: "boolean", + warning_tiers: [ + { key: "key", value: 1000000 }, + { key: "key", value: 1000000 }, + ], }, { allocation: 1000000, @@ -4585,6 +4589,10 @@ describe("CompaniesClient", () => { soft_limit: 1000000, usage: 1000000, value_type: "boolean", + warning_tiers: [ + { key: "key", value: 1000000 }, + { key: "key", value: 1000000 }, + ], }, ], entity_traits: [ @@ -6318,6 +6326,16 @@ describe("CompaniesClient", () => { softLimit: 1000000, usage: 1000000, valueType: "boolean", + warningTiers: [ + { + key: "key", + value: 1000000, + }, + { + key: "key", + value: 1000000, + }, + ], }, { allocation: 1000000, @@ -6338,6 +6356,16 @@ describe("CompaniesClient", () => { softLimit: 1000000, usage: 1000000, valueType: "boolean", + warningTiers: [ + { + key: "key", + value: 1000000, + }, + { + key: "key", + value: 1000000, + }, + ], }, ], entityTraits: [ diff --git a/tests/wire/components.test.ts b/tests/wire/components.test.ts index 40cfcd34..2b100d27 100644 --- a/tests/wire/components.test.ts +++ b/tests/wire/components.test.ts @@ -13,6 +13,7 @@ describe("ComponentsClient", () => { data: [ { ast: { key: 1.1 }, + catalog_id: "catalog_id", created_at: "2024-01-15T09:30:00Z", id: "id", name: "name", @@ -37,6 +38,7 @@ describe("ComponentsClient", () => { ast: { key: 1.1, }, + catalogId: "catalog_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), id: "id", name: "name", @@ -125,6 +127,7 @@ describe("ComponentsClient", () => { const rawResponseBody = { data: { ast: { key: 1.1 }, + catalog_id: "catalog_id", created_at: "2024-01-15T09:30:00Z", id: "id", name: "name", @@ -153,6 +156,7 @@ describe("ComponentsClient", () => { ast: { key: 1.1, }, + catalogId: "catalog_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), id: "id", name: "name", @@ -288,6 +292,7 @@ describe("ComponentsClient", () => { const rawResponseBody = { data: { ast: { key: 1.1 }, + catalog_id: "catalog_id", created_at: "2024-01-15T09:30:00Z", id: "id", name: "name", @@ -312,6 +317,7 @@ describe("ComponentsClient", () => { ast: { key: 1.1, }, + catalogId: "catalog_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), id: "id", name: "name", @@ -408,6 +414,7 @@ describe("ComponentsClient", () => { const rawResponseBody = { data: { ast: { key: 1.1 }, + catalog_id: "catalog_id", created_at: "2024-01-15T09:30:00Z", id: "id", name: "name", @@ -433,6 +440,7 @@ describe("ComponentsClient", () => { ast: { key: 1.1, }, + catalogId: "catalog_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), id: "id", name: "name", @@ -666,6 +674,153 @@ describe("ComponentsClient", () => { }).rejects.toThrow(Schematic.InternalServerError); }); + test("bindCatalog (1)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { + data: { + ast: { key: 1.1 }, + catalog_id: "catalog_id", + created_at: "2024-01-15T09:30:00Z", + id: "id", + name: "name", + state: "draft", + type: "billing", + updated_at: "2024-01-15T09:30:00Z", + }, + params: { key: "value" }, + }; + + server + .mockEndpoint() + .put("/components/component_id/catalog") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.components.bindCatalog("component_id"); + expect(response).toEqual({ + data: { + ast: { + key: 1.1, + }, + catalogId: "catalog_id", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + id: "id", + name: "name", + state: "draft", + type: "billing", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + params: { + key: "value", + }, + }); + }); + + test("bindCatalog (2)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .put("/components/component_id/catalog") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.bindCatalog("component_id"); + }).rejects.toThrow(Schematic.BadRequestError); + }); + + test("bindCatalog (3)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .put("/components/component_id/catalog") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.bindCatalog("component_id"); + }).rejects.toThrow(Schematic.UnauthorizedError); + }); + + test("bindCatalog (4)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .put("/components/component_id/catalog") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.bindCatalog("component_id"); + }).rejects.toThrow(Schematic.ForbiddenError); + }); + + test("bindCatalog (5)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .put("/components/component_id/catalog") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.bindCatalog("component_id"); + }).rejects.toThrow(Schematic.NotFoundError); + }); + + test("bindCatalog (6)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .put("/components/component_id/catalog") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.components.bindCatalog("component_id"); + }).rejects.toThrow(Schematic.InternalServerError); + }); + test("countComponents (1)", async () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -1352,6 +1507,7 @@ describe("ComponentsClient", () => { }, component: { ast: { key: 1.1 }, + catalog_id: "catalog_id", created_at: "2024-01-15T09:30:00Z", id: "id", name: "name", @@ -1447,6 +1603,7 @@ describe("ComponentsClient", () => { updated_at: "2024-01-15T09:30:00Z", }, billing_strategy: "schematic_managed", + catalogs: [{ id: "id", name: "name" }], charge_type: "free", company_count: 1000000, company_id: "company_id", @@ -1732,6 +1889,7 @@ describe("ComponentsClient", () => { updated_at: "2024-01-15T09:30:00Z", }, billing_strategy: "schematic_managed", + catalogs: [{ id: "id", name: "name" }], charge_type: "free", company_count: 1000000, company_id: "company_id", @@ -2741,6 +2899,7 @@ describe("ComponentsClient", () => { ast: { key: 1.1, }, + catalogId: "catalog_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), id: "id", name: "name", @@ -2840,6 +2999,12 @@ describe("ComponentsClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, billingStrategy: "schematic_managed", + catalogs: [ + { + id: "id", + name: "name", + }, + ], chargeType: "free", companyCount: 1000000, companyId: "company_id", @@ -3158,6 +3323,12 @@ describe("ComponentsClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, billingStrategy: "schematic_managed", + catalogs: [ + { + id: "id", + name: "name", + }, + ], chargeType: "free", companyCount: 1000000, companyId: "company_id", diff --git a/tests/wire/dataexports.test.ts b/tests/wire/dataexports.test.ts index b6097298..7ae4c561 100644 --- a/tests/wire/dataexports.test.ts +++ b/tests/wire/dataexports.test.ts @@ -5,18 +5,144 @@ import { SchematicClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("DataexportsClient", () => { + test("listDataExports (1)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + account_id: "account_id", + created_at: "2024-01-15T09:30:00Z", + environment_id: "environment_id", + export_type: "audit-log", + id: "id", + metadata: { export_type: "audit-log" }, + output_file_type: "csv", + status: "failure", + updated_at: "2024-01-15T09:30:00Z", + }, + ], + params: { export_type: "audit-log", limit: 1000000, offset: 1000000, status: "failure" }, + }; + + server.mockEndpoint().get("/data-exports").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.dataexports.listDataExports({ + exportType: "audit-log", + status: "failure", + limit: 1000000, + offset: 1000000, + }); + expect(response).toEqual({ + data: [ + { + accountId: "account_id", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + environmentId: "environment_id", + exportType: "audit-log", + id: "id", + metadata: { + exportType: "audit-log", + }, + outputFileType: "csv", + status: "failure", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + params: { + exportType: "audit-log", + limit: 1000000, + offset: 1000000, + status: "failure", + }, + }); + }); + + test("listDataExports (2)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server.mockEndpoint().get("/data-exports").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.dataexports.listDataExports(); + }).rejects.toThrow(Schematic.BadRequestError); + }); + + test("listDataExports (3)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server.mockEndpoint().get("/data-exports").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.dataexports.listDataExports(); + }).rejects.toThrow(Schematic.UnauthorizedError); + }); + + test("listDataExports (4)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server.mockEndpoint().get("/data-exports").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.dataexports.listDataExports(); + }).rejects.toThrow(Schematic.ForbiddenError); + }); + + test("listDataExports (5)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server.mockEndpoint().get("/data-exports").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.dataexports.listDataExports(); + }).rejects.toThrow(Schematic.NotFoundError); + }); + + test("listDataExports (6)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server.mockEndpoint().get("/data-exports").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.dataexports.listDataExports(); + }).rejects.toThrow(Schematic.InternalServerError); + }); + test("createDataExport (1)", async () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { export_type: "company-feature-usage", metadata: "metadata", output_file_type: "csv" }; + const rawRequestBody = { export_type: "audit-log", output_file_type: "csv" }; const rawResponseBody = { data: { account_id: "account_id", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", - export_type: "company-feature-usage", + export_type: "audit-log", id: "id", - metadata: "metadata", + metadata: { + export_type: "audit-log", + actor_type: "actor_type", + end_time: "2024-01-15T09:30:00Z", + notification_email_recipient_email_addresses: ["notification_email_recipient_email_addresses"], + q: "q", + start_time: "2024-01-15T09:30:00Z", + }, output_file_type: "csv", status: "failure", updated_at: "2024-01-15T09:30:00Z", @@ -34,16 +160,24 @@ describe("DataexportsClient", () => { .build(); const response = await client.dataexports.createDataExport({ - metadata: "metadata", + exportType: "audit-log", + outputFileType: "csv", }); expect(response).toEqual({ data: { accountId: "account_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", - exportType: "company-feature-usage", + exportType: "audit-log", id: "id", - metadata: "metadata", + metadata: { + exportType: "audit-log", + actorType: "actor_type", + endTime: new Date("2024-01-15T09:30:00.000Z"), + notificationEmailRecipientEmailAddresses: ["notification_email_recipient_email_addresses"], + q: "q", + startTime: new Date("2024-01-15T09:30:00.000Z"), + }, outputFileType: "csv", status: "failure", updatedAt: new Date("2024-01-15T09:30:00.000Z"), @@ -57,7 +191,7 @@ describe("DataexportsClient", () => { test("createDataExport (2)", async () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { export_type: "company-feature-usage", metadata: "metadata", output_file_type: "csv" }; + const rawRequestBody = { export_type: "audit-log", output_file_type: "csv" }; const rawResponseBody = { error: "error" }; server @@ -71,7 +205,8 @@ describe("DataexportsClient", () => { await expect(async () => { return await client.dataexports.createDataExport({ - metadata: "metadata", + exportType: "audit-log", + outputFileType: "csv", }); }).rejects.toThrow(Schematic.BadRequestError); }); @@ -79,7 +214,7 @@ describe("DataexportsClient", () => { test("createDataExport (3)", async () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { export_type: "company-feature-usage", metadata: "metadata", output_file_type: "csv" }; + const rawRequestBody = { export_type: "audit-log", output_file_type: "csv" }; const rawResponseBody = { error: "error" }; server @@ -93,7 +228,8 @@ describe("DataexportsClient", () => { await expect(async () => { return await client.dataexports.createDataExport({ - metadata: "metadata", + exportType: "audit-log", + outputFileType: "csv", }); }).rejects.toThrow(Schematic.UnauthorizedError); }); @@ -101,7 +237,7 @@ describe("DataexportsClient", () => { test("createDataExport (4)", async () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { export_type: "company-feature-usage", metadata: "metadata", output_file_type: "csv" }; + const rawRequestBody = { export_type: "audit-log", output_file_type: "csv" }; const rawResponseBody = { error: "error" }; server @@ -115,7 +251,8 @@ describe("DataexportsClient", () => { await expect(async () => { return await client.dataexports.createDataExport({ - metadata: "metadata", + exportType: "audit-log", + outputFileType: "csv", }); }).rejects.toThrow(Schematic.ForbiddenError); }); @@ -123,7 +260,7 @@ describe("DataexportsClient", () => { test("createDataExport (5)", async () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { export_type: "company-feature-usage", metadata: "metadata", output_file_type: "csv" }; + const rawRequestBody = { export_type: "audit-log", output_file_type: "csv" }; const rawResponseBody = { error: "error" }; server @@ -137,7 +274,8 @@ describe("DataexportsClient", () => { await expect(async () => { return await client.dataexports.createDataExport({ - metadata: "metadata", + exportType: "audit-log", + outputFileType: "csv", }); }).rejects.toThrow(Schematic.NotFoundError); }); @@ -145,7 +283,7 @@ describe("DataexportsClient", () => { test("createDataExport (6)", async () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { export_type: "company-feature-usage", metadata: "metadata", output_file_type: "csv" }; + const rawRequestBody = { export_type: "audit-log", output_file_type: "csv" }; const rawResponseBody = { error: "error" }; server @@ -159,8 +297,145 @@ describe("DataexportsClient", () => { await expect(async () => { return await client.dataexports.createDataExport({ - metadata: "metadata", + exportType: "audit-log", + outputFileType: "csv", }); }).rejects.toThrow(Schematic.InternalServerError); }); + + test("getDataExport (1)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + account_id: "account_id", + created_at: "2024-01-15T09:30:00Z", + environment_id: "environment_id", + export_type: "audit-log", + id: "id", + metadata: { + export_type: "audit-log", + actor_type: "actor_type", + end_time: "2024-01-15T09:30:00Z", + notification_email_recipient_email_addresses: ["notification_email_recipient_email_addresses"], + q: "q", + start_time: "2024-01-15T09:30:00Z", + }, + output_file_type: "csv", + status: "failure", + updated_at: "2024-01-15T09:30:00Z", + }, + params: { key: "value" }, + }; + + server + .mockEndpoint() + .get("/data-exports/data_export_id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.dataexports.getDataExport("data_export_id"); + expect(response).toEqual({ + data: { + accountId: "account_id", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + environmentId: "environment_id", + exportType: "audit-log", + id: "id", + metadata: { + exportType: "audit-log", + actorType: "actor_type", + endTime: new Date("2024-01-15T09:30:00.000Z"), + notificationEmailRecipientEmailAddresses: ["notification_email_recipient_email_addresses"], + q: "q", + startTime: new Date("2024-01-15T09:30:00.000Z"), + }, + outputFileType: "csv", + status: "failure", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + params: { + key: "value", + }, + }); + }); + + test("getDataExport (2)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/data-exports/data_export_id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.dataexports.getDataExport("data_export_id"); + }).rejects.toThrow(Schematic.UnauthorizedError); + }); + + test("getDataExport (3)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/data-exports/data_export_id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.dataexports.getDataExport("data_export_id"); + }).rejects.toThrow(Schematic.ForbiddenError); + }); + + test("getDataExport (4)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/data-exports/data_export_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.dataexports.getDataExport("data_export_id"); + }).rejects.toThrow(Schematic.NotFoundError); + }); + + test("getDataExport (5)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/data-exports/data_export_id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.dataexports.getDataExport("data_export_id"); + }).rejects.toThrow(Schematic.InternalServerError); + }); }); diff --git a/tests/wire/features.test.ts b/tests/wire/features.test.ts index 96565f2a..20c11927 100644 --- a/tests/wire/features.test.ts +++ b/tests/wire/features.test.ts @@ -4713,6 +4713,7 @@ describe("FeaturesClient", () => { soft_limit: 1000000, usage: 1000000, value_type: "boolean", + warning_tiers: [{ key: "key", value: 1000000 }], }, error: "error", feature_usage_period: "all_time", @@ -4759,6 +4760,12 @@ describe("FeaturesClient", () => { softLimit: 1000000, usage: 1000000, valueType: "boolean", + warningTiers: [ + { + key: "key", + value: 1000000, + }, + ], }, error: "error", featureUsagePeriod: "all_time", diff --git a/tests/wire/plangroups.test.ts b/tests/wire/plangroups.test.ts index cd7c1408..b48df9d7 100644 --- a/tests/wire/plangroups.test.ts +++ b/tests/wire/plangroups.test.ts @@ -211,6 +211,7 @@ describe("PlangroupsClient", () => { updated_at: "2024-01-15T09:30:00Z", }, billing_strategy: "schematic_managed", + catalogs: [{ id: "id", name: "name" }], charge_type: "free", company_count: 1000000, company_id: "company_id", @@ -468,6 +469,7 @@ describe("PlangroupsClient", () => { updated_at: "2024-01-15T09:30:00Z", }, billing_strategy: "schematic_managed", + catalogs: [{ id: "id", name: "name" }], charge_type: "free", company_count: 1000000, company_id: "company_id", @@ -727,6 +729,7 @@ describe("PlangroupsClient", () => { updated_at: "2024-01-15T09:30:00Z", }, billing_strategy: "schematic_managed", + catalogs: [{ id: "id", name: "name" }], charge_type: "free", company_count: 1000000, company_id: "company_id", @@ -1152,6 +1155,7 @@ describe("PlangroupsClient", () => { updated_at: "2024-01-15T09:30:00Z", }, billing_strategy: "schematic_managed", + catalogs: [{ id: "id", name: "name" }], charge_type: "free", company_count: 1000000, company_id: "company_id", @@ -1630,6 +1634,12 @@ describe("PlangroupsClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, billingStrategy: "schematic_managed", + catalogs: [ + { + id: "id", + name: "name", + }, + ], chargeType: "free", companyCount: 1000000, companyId: "company_id", @@ -1920,6 +1930,12 @@ describe("PlangroupsClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, billingStrategy: "schematic_managed", + catalogs: [ + { + id: "id", + name: "name", + }, + ], chargeType: "free", companyCount: 1000000, companyId: "company_id", @@ -2212,6 +2228,12 @@ describe("PlangroupsClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, billingStrategy: "schematic_managed", + catalogs: [ + { + id: "id", + name: "name", + }, + ], chargeType: "free", companyCount: 1000000, companyId: "company_id", @@ -2705,6 +2727,12 @@ describe("PlangroupsClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, billingStrategy: "schematic_managed", + catalogs: [ + { + id: "id", + name: "name", + }, + ], chargeType: "free", companyCount: 1000000, companyId: "company_id", diff --git a/tests/wire/plans.test.ts b/tests/wire/plans.test.ts index dd777921..52809b4b 100644 --- a/tests/wire/plans.test.ts +++ b/tests/wire/plans.test.ts @@ -1375,6 +1375,7 @@ describe("PlansClient", () => { updated_at: "2024-01-15T09:30:00Z", }, billing_strategy: "schematic_managed", + catalogs: [{ id: "id", name: "name" }], charge_type: "free", company_count: 1000000, company_id: "company_id", @@ -1653,6 +1654,12 @@ describe("PlansClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, billingStrategy: "schematic_managed", + catalogs: [ + { + id: "id", + name: "name", + }, + ], chargeType: "free", companyCount: 1000000, companyId: "company_id", @@ -2076,6 +2083,7 @@ describe("PlansClient", () => { updated_at: "2024-01-15T09:30:00Z", }, billing_strategy: "schematic_managed", + catalogs: [{ id: "id", name: "name" }], charge_type: "free", company_count: 1000000, company_id: "company_id", @@ -2370,6 +2378,12 @@ describe("PlansClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, billingStrategy: "schematic_managed", + catalogs: [ + { + id: "id", + name: "name", + }, + ], chargeType: "free", companyCount: 1000000, companyId: "company_id", @@ -2747,6 +2761,7 @@ describe("PlansClient", () => { updated_at: "2024-01-15T09:30:00Z", }, billing_strategy: "schematic_managed", + catalogs: [{ id: "id", name: "name" }], charge_type: "free", company_count: 1000000, company_id: "company_id", @@ -3025,6 +3040,12 @@ describe("PlansClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, billingStrategy: "schematic_managed", + catalogs: [ + { + id: "id", + name: "name", + }, + ], chargeType: "free", companyCount: 1000000, companyId: "company_id", @@ -3449,6 +3470,7 @@ describe("PlansClient", () => { updated_at: "2024-01-15T09:30:00Z", }, billing_strategy: "schematic_managed", + catalogs: [{ id: "id", name: "name" }], charge_type: "free", company_count: 1000000, company_id: "company_id", @@ -3718,6 +3740,12 @@ describe("PlansClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, billingStrategy: "schematic_managed", + catalogs: [ + { + id: "id", + name: "name", + }, + ], chargeType: "free", companyCount: 1000000, companyId: "company_id", @@ -4074,6 +4102,7 @@ describe("PlansClient", () => { updated_at: "2024-01-15T09:30:00Z", }, billing_strategy: "schematic_managed", + catalogs: [{ id: "id", name: "name" }], charge_type: "free", company_count: 1000000, company_id: "company_id", @@ -4350,6 +4379,12 @@ describe("PlansClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, billingStrategy: "schematic_managed", + catalogs: [ + { + id: "id", + name: "name", + }, + ], chargeType: "free", companyCount: 1000000, companyId: "company_id", @@ -5025,6 +5060,7 @@ describe("PlansClient", () => { updated_at: "2024-01-15T09:30:00Z", }, billing_strategy: "schematic_managed", + catalogs: [{ id: "id", name: "name" }], charge_type: "free", company_count: 1000000, company_id: "company_id", @@ -5305,6 +5341,12 @@ describe("PlansClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, billingStrategy: "schematic_managed", + catalogs: [ + { + id: "id", + name: "name", + }, + ], chargeType: "free", companyCount: 1000000, companyId: "company_id", diff --git a/yarn.lock b/yarn.lock index 6373b8e1..e57fd32c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -338,30 +338,30 @@ dependencies: statuses "^2.0.1" -"@cloudflare/workerd-darwin-64@1.20260708.1": - version "1.20260708.1" - resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20260708.1.tgz#fc054b7c677017f64c73ef7de536d79b4421f6b6" - integrity sha512-HXFCvhS1wpg3uXO0CLUwmwC41i2loM5FSK69EUchOBpmYBAXxT1oHLm6EOA5lqhTk5Mu9kjRiQYxa1GwKPwfJg== - -"@cloudflare/workerd-darwin-arm64@1.20260708.1": - version "1.20260708.1" - resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20260708.1.tgz#8fd30a272f7bd89cd304bf9879b4d0921bf6678a" - integrity sha512-JVlJaKDoRTVKSroHIlf8g3UCPjKj4iDbMZE2CNYht5qQ+2rL0FAUiVlV82G3BqKnnw9kHYnnsMzC08b9zVtdzA== - -"@cloudflare/workerd-linux-64@1.20260708.1": - version "1.20260708.1" - resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20260708.1.tgz#df73b5f2fff999c36b27d8978bc929fec6772c21" - integrity sha512-3daE60YdD7YX0Jtuzc9DE/r/qMkmx8ZvHTkF8Mzmp3F5tbzlV0DAzmu5PFUPF2WuvtKbAhZKbvC2cHmWpQYxnA== - -"@cloudflare/workerd-linux-arm64@1.20260708.1": - version "1.20260708.1" - resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20260708.1.tgz#0eb477348030871c6847d6a8fac7bed99e8158d0" - integrity sha512-VLdNYOx5Hj+9C6isy0ACWZsbMtSxex2DIJWEe7cZxUdlphZ58ZT8zxNXK8yunFiowd34hn3VwGMopdvdj8lvmA== - -"@cloudflare/workerd-windows-64@1.20260708.1": - version "1.20260708.1" - resolved "https://registry.yarnpkg.com/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20260708.1.tgz#c78bbada5f66261ca3722f518d0213fb910dc6be" - integrity sha512-bC/aSAwLy16Vjo24i9XU3aWH+eRgz7NeR5xPKavGbembO18ZywYTQbXh14eXtY6fAqN3RzRG8psijTdhX4xydA== +"@cloudflare/workerd-darwin-64@1.20260714.1": + version "1.20260714.1" + resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20260714.1.tgz#2f006c394473a7b5d792c0144a1886042114a5a2" + integrity sha512-ZWXqAN8G7Cx9hMRQuk+59ziJhR3j1F4iO+Qs8aHdfKZ3Dq5Yi/57xvkJTgCGBnW1YU/L78r8f6HEy51bwbTpNw== + +"@cloudflare/workerd-darwin-arm64@1.20260714.1": + version "1.20260714.1" + resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20260714.1.tgz#2602cab0e0a3dab46b8d2ecb5707a44868e7ecc4" + integrity sha512-tueWxWC3wyCbMG6zRAxsMXX0YLgrRWbiAPYFQ2uJ7dUH8G+5E7UTWaQS9B1HdJ0bpKFW1NWxhs1o2noKVFSUYg== + +"@cloudflare/workerd-linux-64@1.20260714.1": + version "1.20260714.1" + resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20260714.1.tgz#24f3d22a4b8b563f09add8bb48ed649f407c71ff" + integrity sha512-1VChTZRb0l0F7R4e1G5RtLKV4oFi6x+rQgxh2+yu887j3l/3TLgatuv1L8/5zhc9gKEhATTxOh0e52Rtd9dDWQ== + +"@cloudflare/workerd-linux-arm64@1.20260714.1": + version "1.20260714.1" + resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20260714.1.tgz#b7da800741feff8a562273733209941ede82043c" + integrity sha512-rMm3G+NirG2UdgHIRDdF1asNC6FqgIzZzkRG+VDhhDGcVxAQwvrMT1E38BivEvHr3G04MB4AfhcOczX0+GtRkQ== + +"@cloudflare/workerd-windows-64@1.20260714.1": + version "1.20260714.1" + resolved "https://registry.yarnpkg.com/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20260714.1.tgz#a7e7921021e782337a607d2a00c14341d50c0905" + integrity sha512-cGqnU3Hg2YZS/k3SAqrMp1DjpdsyFde72tWltdl6ZT9+SFz/Zrk/8gyTU1TcxC4YApXeNVH5TyU5cOGPgUJ0pg== "@cspotcode/source-map-support@0.8.1": version "0.8.1" @@ -1035,9 +1035,9 @@ integrity sha512-c1Q99M5ljsIuc4YdaCwfUEXsofakb9c8+Zse2qxTadu8TalLXuAESzLvFAvNVbkmSlvlzIQOLpBCmWI9wTOt+g== "@sinclair/typebox@^0.27.8": - version "0.27.10" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.10.tgz#beefe675f1853f73676aecc915b2bd2ac98c4fc6" - integrity sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA== + version "0.27.12" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.12.tgz#0cacd3cff047a32936b1ace47ea7c86eaab60a7f" + integrity sha512-hhyNJ+nbR6ZR7pToHvllEFun9TL0sbL+tk/ON75lo+Xas054uez98qRbsuNt7MBCyZKK4+8Yli/OAGZhmfBZ/g== "@sindresorhus/is@^7.0.2": version "7.2.0" @@ -1539,9 +1539,9 @@ base64-js@^1.3.1: integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== baseline-browser-mapping@^2.10.42: - version "2.10.43" - resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.10.43.tgz#7b5d11590ce5acdbe4859443e3c940e81ce8c02d" - integrity sha512-AjYpR78kDWAY3Efj+cDTFH9t9SCoL7OoTp1BOb0mQV7S+6CiLwnWM3FyxhJtdPufDFKzmCSFoUncKjWgJEZTCQ== + version "2.10.44" + resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.10.44.tgz#2e074675e640b67cb3835c54c11aa2dd9119c0f8" + integrity sha512-T3ghW+sl/ZJ8w1v/yQx3qvJ9040DWoLBz8JT/CILbAKcFyG9b2MRe75v6W5uXjv6uH1lumK2Kv46y2zSkcej0Q== brace-expansion@^1.1.7: version "1.1.16" @@ -1620,9 +1620,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001803: - version "1.0.30001805" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001805.tgz#78d5d5968a69b7ff81af87a96d7ddc7ea6670b1e" - integrity sha512-52noaS3DubycKSXaU30TwPGIp+POyQSUVa5jBEq3vkRkY0kjyb3LQgvhU6WGyCcyXqVLWO0Cw0Q6BSdD0kUfVA== + version "1.0.30001806" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001806.tgz#1bc8e502b723fa393455dfbedd5ccec0c29bb74e" + integrity sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw== chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" @@ -1832,9 +1832,9 @@ dunder-proto@^1.0.1: gopd "^1.2.0" electron-to-chromium@^1.5.389: - version "1.5.389" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.389.tgz#538be9ebec78026d4daba6be321ab854dfac2a8f" - integrity sha512-cEto7aeOqBfU1D+c5py5pE+ooscKE75JifxLBdFUZsqAxRS6y7kebtxAZvICszSl05gPjYHDTjY+lXpyGvpJbg== + version "1.5.393" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.393.tgz#aec971df2a6f4f7e51fbacb200d66cebfc7d3c17" + integrity sha512-kiDJdIUawuEIcp9XoICKp1iTYDEbgguIPq526N1Q7jIQDeQ3CqoMx71025PI/7E48Ddtw2HuWsVjY7afEgNxmg== emittery@^0.13.1: version "0.13.1" @@ -1847,9 +1847,9 @@ emoji-regex@^8.0.0: integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== enhanced-resolve@^5.22.2: - version "5.24.2" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.24.2.tgz#f25d703a24431cb1e02f944adb74aefa4fcb8d7e" - integrity sha512-rpsZEGT1jFuve6QlpyRp9ckQ+kN61hvF9BzCPyMdaKTm8UJce96KBn3sorXOFXlzjPrs3Vc4T1NsSroZ3PxlFw== + version "5.24.3" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.24.3.tgz#406bbf1ec20971265a30254f08030fce6a8207fe" + integrity sha512-PwKooW9JUzh5chmYfHM3IQl5OkK2u2Nm011MgeZrss3JmFraUx/fqrf78kk8GUMYoibx/14MdwTl/1WKkG7TpQ== dependencies: graceful-fs "^4.2.4" tapable "^2.3.3" @@ -2043,9 +2043,9 @@ fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.1.0: integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== fast-uri@^3.0.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.1.3.tgz#f695a40f006aba505631573a0021ddb21194ad11" - integrity sha512-i70LwGWUduXqzicKXWshooq+sWL1K3WUU5rKZNG/0i3a1OSoX3HqhH5WbWwTmqWfor4urUakGPiRQcleRZTwOg== + version "3.1.4" + resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.1.4.tgz#3b3daf9ce68f41f956df0b505132c0cfce9ec7af" + integrity sha512-8JnbkQ4juDyvYs4mgFGQqg4yCYtFDtUtmp2QIQq11ZZe5CFQ5wcqm1rqDgAh/QdMySuBnPzMUiJUNZG5N/AiQw== fb-watchman@^2.0.0: version "2.0.2" @@ -2939,14 +2939,14 @@ mimic-fn@^2.1.0: integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== miniflare@^4.20260421.0: - version "4.20260708.1" - resolved "https://registry.yarnpkg.com/miniflare/-/miniflare-4.20260708.1.tgz#729780313777ff90f71dcd461977a451415ffd92" - integrity sha512-c94O9zRDISdqO18EHt6l0iF/fWgWt8p18PJvRsA/L/NJZ9Cfke3s/F5Blg1XXF7WDutVRzWVWy8Vy4LaT5ifsA== + version "4.20260714.0" + resolved "https://registry.yarnpkg.com/miniflare/-/miniflare-4.20260714.0.tgz#9e6e566320b0664ecbaca9a8205af7ca740b00ef" + integrity sha512-MYlTCLdWCPqvrYY2uLwOjXwmglXuiHE3TGGkbOW4BwjUPa1r07E0iuHwrNDIs/sxK21r+o90Jx58AV2KeNdJZw== dependencies: "@cspotcode/source-map-support" "0.8.1" sharp "0.34.5" undici "7.28.0" - workerd "1.20260708.1" + workerd "1.20260714.1" ws "8.21.0" youch "4.1.0-beta.10" @@ -3534,17 +3534,17 @@ test-exclude@^6.0.0: glob "^7.1.4" minimatch "^3.0.4" -tldts-core@^7.4.8: - version "7.4.8" - resolved "https://registry.yarnpkg.com/tldts-core/-/tldts-core-7.4.8.tgz#c729aee4ff9d3670741193682a98e25a3d780dd9" - integrity sha512-c1P7u0EhACHj7lPy4MJm8iTFEU8+nB0LCtddH0fhP7noaVoXAqafMtOOeX+ulpuPBqnrRgRhw494RICT3mbhnw== +tldts-core@^7.4.9: + version "7.4.9" + resolved "https://registry.yarnpkg.com/tldts-core/-/tldts-core-7.4.9.tgz#8c3e6fc36123b6001290860d2abda6546466980b" + integrity sha512-DxKfPBI52p2msTEu7MPhdpdDTBhhVQg1a/8PjQckeyAvO13eMYElX545grIp6nnTGIMZlRvFZPvFhvI/WIz2Vg== tldts@^7.0.5: - version "7.4.8" - resolved "https://registry.yarnpkg.com/tldts/-/tldts-7.4.8.tgz#f2edc0d81483ea76c45827d642ccd535a3a7a4f7" - integrity sha512-htwgN/8KRB3z3vnC0BOETVh2m499g5GmyTK9Wq5JBLX3FNz6tSBveAd+fQhzy9hkjif8vy2jwDMR1sGhLtZl2A== + version "7.4.9" + resolved "https://registry.yarnpkg.com/tldts/-/tldts-7.4.9.tgz#78e72ad3c68fc1ec0626e6528f259dd5307a2629" + integrity sha512-3kZ8wQQ/k5DrChD4X4FVvr2D7E5uoRgAqkPyLpSCGUvqOvqu+JEdr3mwMUaVWb+vMHZaKhF5fp2PBigKsui7hA== dependencies: - tldts-core "^7.4.8" + tldts-core "^7.4.9" tmpl@1.0.5: version "1.0.5" @@ -3790,16 +3790,16 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== -workerd@1.20260708.1: - version "1.20260708.1" - resolved "https://registry.yarnpkg.com/workerd/-/workerd-1.20260708.1.tgz#cde1642ccb75999aae9f264d10e700f6c5998d74" - integrity sha512-WAK+Kt/VVCSldH2qSr8lx46XCJ4Q+bdlHNaFqUtOHthBEIB8C1N8HVW+VOLrxDoTCk0NGNv0zajnBeQK4JOB9w== +workerd@1.20260714.1: + version "1.20260714.1" + resolved "https://registry.yarnpkg.com/workerd/-/workerd-1.20260714.1.tgz#60fb9c3651f8ed512bd4eaeff211cc8898c76441" + integrity sha512-oIbQzfdyl9UQUnG6XLegcSq0Mgt/7WKDbFOoqGgOWCS+/fhyGB460uKEgdAQQ9RHCO/ttcNCX/KiMIQzdoeu3Q== optionalDependencies: - "@cloudflare/workerd-darwin-64" "1.20260708.1" - "@cloudflare/workerd-darwin-arm64" "1.20260708.1" - "@cloudflare/workerd-linux-64" "1.20260708.1" - "@cloudflare/workerd-linux-arm64" "1.20260708.1" - "@cloudflare/workerd-windows-64" "1.20260708.1" + "@cloudflare/workerd-darwin-64" "1.20260714.1" + "@cloudflare/workerd-darwin-arm64" "1.20260714.1" + "@cloudflare/workerd-linux-64" "1.20260714.1" + "@cloudflare/workerd-linux-arm64" "1.20260714.1" + "@cloudflare/workerd-windows-64" "1.20260714.1" wrap-ansi@^6.2.0: version "6.2.0" @@ -3832,11 +3832,16 @@ write-file-atomic@^4.0.2: imurmurhash "^0.1.4" signal-exit "^3.0.7" -ws@8.21.0, ws@^8.11.0, ws@^8.18.1: +ws@8.21.0: version "8.21.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.21.0.tgz#012e413fc07429945121b0c153158c4343086951" integrity sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g== +ws@^8.11.0, ws@^8.18.1: + version "8.21.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.21.1.tgz#045650cd4b1207809e7547146223c3814a9af586" + integrity sha512-+0NTnW77fFN/DjQi6k/Sq/Yvk4Sgajw7urW8V+asjXnRgDs9gyGkdb7EzgfhA4goXsRIZKE28fzIXBHEzhuiWw== + xml-name-validator@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-4.0.0.tgz#79a006e2e63149a8600f15430f0a4725d1524835"