Skip to content

Commit

Permalink
SDK regeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed May 2, 2024
1 parent 21c2b0f commit 02fdc0c
Show file tree
Hide file tree
Showing 25 changed files with 200 additions and 96 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webflow-api",
"version": "2.3.2",
"version": "2.3.3",
"private": false,
"repository": "https://github.com/webflow/js-webflow-api",
"main": "./index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/api/resources/accessGroups/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class AccessGroups {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
16 changes: 8 additions & 8 deletions src/api/resources/assets/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class Assets {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -129,7 +129,7 @@ export class Assets {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -205,7 +205,7 @@ export class Assets {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -280,7 +280,7 @@ export class Assets {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -355,7 +355,7 @@ export class Assets {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -431,7 +431,7 @@ export class Assets {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -513,7 +513,7 @@ export class Assets {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -592,7 +592,7 @@ export class Assets {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
10 changes: 5 additions & 5 deletions src/api/resources/collections/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class Collections {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -131,7 +131,7 @@ export class Collections {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -207,7 +207,7 @@ export class Collections {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -282,7 +282,7 @@ export class Collections {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -355,7 +355,7 @@ export class Collections {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class Fields {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -140,7 +140,7 @@ export class Fields {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
109 changes: 98 additions & 11 deletions src/api/resources/collections/resources/items/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class Items {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -160,7 +160,7 @@ export class Items {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -252,7 +252,7 @@ export class Items {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -344,7 +344,7 @@ export class Items {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -426,7 +426,7 @@ export class Items {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -509,7 +509,7 @@ export class Items {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -600,7 +600,7 @@ export class Items {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -687,7 +687,7 @@ export class Items {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -741,6 +741,93 @@ export class Items {
}
}

/**
* Get details of a selected Collection live Item. </br></br> Required scope | `CMS:read`
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
* @throws {@link Webflow.NotFoundError}
* @throws {@link Webflow.TooManyRequestsError}
* @throws {@link Webflow.InternalServerError}
*
* @example
* await webflow.collections.items.getItemLive("collection_id", "item_id", {})
*/
public async getItemLive(
collectionId: string,
itemId: string,
request: Webflow.collections.ItemsGetItemLiveRequest = {},
requestOptions?: Items.RequestOptions
): Promise<Webflow.CollectionItem> {
const { cmsLocaleId } = request;
const _queryParams: Record<string, string | string[] | object | object[]> = {};
if (cmsLocaleId != null) {
_queryParams["cmsLocaleId"] = cmsLocaleId;
}

const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default,
`collections/${collectionId}/items/${itemId}/live`
),
method: "GET",
headers: {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
queryParameters: _queryParams,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
return await serializers.CollectionItem.parseOrThrow(_response.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
skipValidation: true,
breadcrumbsPrefix: ["response"],
});
}

if (_response.error.reason === "status-code") {
switch (_response.error.statusCode) {
case 400:
throw new Webflow.BadRequestError(_response.error.body);
case 401:
throw new Webflow.UnauthorizedError(_response.error.body);
case 404:
throw new Webflow.NotFoundError(_response.error.body);
case 429:
throw new Webflow.TooManyRequestsError(_response.error.body);
case 500:
throw new Webflow.InternalServerError(_response.error.body);
default:
throw new errors.WebflowError({
statusCode: _response.error.statusCode,
body: _response.error.body,
});
}
}

switch (_response.error.reason) {
case "non-json":
throw new errors.WebflowError({
statusCode: _response.error.statusCode,
body: _response.error.rawBody,
});
case "timeout":
throw new errors.WebflowTimeoutError();
case "unknown":
throw new errors.WebflowError({
message: _response.error.errorMessage,
});
}
}

/**
* Delete a live Item from a Collection. The Item will be unpublished from the live site. This endpoint does not currently support bulk deletion. </br></br> Required scope | `CMS:write`
* @throws {@link Webflow.BadRequestError}
Expand All @@ -767,7 +854,7 @@ export class Items {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -853,7 +940,7 @@ export class Items {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -935,7 +1022,7 @@ export class Items {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

/**
* @example
* {}
*/
export interface ItemsGetItemLiveRequest {
/**
* Unique identifier for a CMS Locale. These UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. Applicable when using localization.
*/
cmsLocaleId?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export { ItemsListItemsLiveRequest } from "./ItemsListItemsLiveRequest";
export { BulkCollectionItem } from "./BulkCollectionItem";
export { ItemsGetItemRequest } from "./ItemsGetItemRequest";
export { ItemsDeleteItemRequest } from "./ItemsDeleteItemRequest";
export { ItemsGetItemLiveRequest } from "./ItemsGetItemLiveRequest";
export { ItemsPublishItemRequest } from "./ItemsPublishItemRequest";
2 changes: 1 addition & 1 deletion src/api/resources/ecommerce/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class Ecommerce {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "webflow-api",
"X-Fern-SDK-Version": "2.3.2",
"X-Fern-SDK-Version": "2.3.3",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
Loading

0 comments on commit 02fdc0c

Please sign in to comment.