Skip to content

Commit fdba373

Browse files
authored
fix(farcaster-js-hub-rest): fix submit cast to a channel (#750)
* fix(farcaster-js-hub-rest): fix submit cast to a channel affects: @standard-crypto/farcaster-js-hub-rest * fix(farcaster-js-hub-rest): misc fixes to make tests pass affects: @standard-crypto/farcaster-js-hub-rest * test(farcaster-js-neynar): fix neynar tests affects: @standard-crypto/farcaster-js-neynar * fix(farcaster-js-hub-rest): update hub rest embed spec affects: @standard-crypto/farcaster-js-hub-rest * chore(farcaster-js-hub-rest): prep for release affects: @standard-crypto/farcaster-js-hub-rest, @standard-crypto/farcaster-js * chore(farcaster-js): update version number affects: @standard-crypto/farcaster-js-hub-rest, @standard-crypto/farcaster-js
1 parent be57ded commit fdba373

File tree

19 files changed

+250
-127
lines changed

19 files changed

+250
-127
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# [7.3.0](https://github.com/standard-crypto/farcaster-js/compare/v7.2.0...v7.3.0) (2024-02-14)
2+
3+
### Features
4+
5+
* farcaster-js-hub-rest: Adds the param `parentUrl` to the `submitCast` method to allow casting into a channel
6+
7+
### Bug Fixes
8+
9+
* farcaster-js-hub-rest: Updates the openAPI spec to fix the `Embed` object to support urls and casts
10+
111
# [7.2.0](https://github.com/standard-crypto/farcaster-js/compare/v7.1.0...v7.2.0) (2024-01-29)
212

313
### Features

packages/farcaster-js-hub-rest/docs/classes/hubRestApiClient.HubRestAPIClient.md

Lines changed: 35 additions & 34 deletions
Large diffs are not rendered by default.

packages/farcaster-js-hub-rest/docs/interfaces/openapi.CastAddBody.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ CastAddBody
2626

2727
### embeds
2828

29-
**embeds**: [`Embed`](openapi.Embed.md)[]
29+
**embeds**: [`Embed`](../modules/openapi.md#embed)[]
3030

3131
**`Memberof`**
3232

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[@standard-crypto/farcaster-js-hub-rest](../README.md) / [Modules](../modules.md) / [openapi](../modules/openapi.md) / CastEmbed
2+
3+
# Interface: CastEmbed
4+
5+
[openapi](../modules/openapi.md).CastEmbed
6+
7+
**`Export`**
8+
9+
CastEmbed
10+
11+
## Table of contents
12+
13+
### Properties
14+
15+
- [castId](openapi.CastEmbed.md#castid)
16+
17+
## Properties
18+
19+
### castId
20+
21+
**castId**: [`CastId`](openapi.CastId.md)
22+
23+
**`Memberof`**
24+
25+
CastEmbed
26+
27+
#### Defined in
28+
29+
[packages/farcaster-js-hub-rest/src/openapi/generated/models/cast-embed.ts:31](https://github.com/standard-crypto/farcaster-js/blob/main/packages/farcaster-js-hub-rest/src/openapi/generated/models/cast-embed.ts#L31)

packages/farcaster-js-hub-rest/docs/interfaces/openapi.Embed.md

Lines changed: 0 additions & 44 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[@standard-crypto/farcaster-js-hub-rest](../README.md) / [Modules](../modules.md) / [openapi](../modules/openapi.md) / UrlEmbed
2+
3+
# Interface: UrlEmbed
4+
5+
[openapi](../modules/openapi.md).UrlEmbed
6+
7+
**`Export`**
8+
9+
UrlEmbed
10+
11+
## Table of contents
12+
13+
### Properties
14+
15+
- [url](openapi.UrlEmbed.md#url)
16+
17+
## Properties
18+
19+
### url
20+
21+
**url**: `string`
22+
23+
**`Memberof`**
24+
25+
UrlEmbed
26+
27+
#### Defined in
28+
29+
[packages/farcaster-js-hub-rest/src/openapi/generated/models/url-embed.ts:28](https://github.com/standard-crypto/farcaster-js/blob/main/packages/farcaster-js-hub-rest/src/openapi/generated/models/url-embed.ts#L28)

packages/farcaster-js-hub-rest/docs/modules/openapi.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
- [CastAddAllOf](../interfaces/openapi.CastAddAllOf.md)
4242
- [CastAddAllOfDataAllOf](../interfaces/openapi.CastAddAllOfDataAllOf.md)
4343
- [CastAddBody](../interfaces/openapi.CastAddBody.md)
44+
- [CastEmbed](../interfaces/openapi.CastEmbed.md)
4445
- [CastId](../interfaces/openapi.CastId.md)
4546
- [CastRemoveAllOf](../interfaces/openapi.CastRemoveAllOf.md)
4647
- [CastRemoveBody](../interfaces/openapi.CastRemoveBody.md)
@@ -50,7 +51,6 @@
5051
- [CastsApiListCastsByParentRequest](../interfaces/openapi.CastsApiListCastsByParentRequest.md)
5152
- [ConfigurationParameters](../interfaces/openapi.ConfigurationParameters.md)
5253
- [DbStats](../interfaces/openapi.DbStats.md)
53-
- [Embed](../interfaces/openapi.Embed.md)
5454
- [ErrorResponse](../interfaces/openapi.ErrorResponse.md)
5555
- [ErrorResponseMetadata](../interfaces/openapi.ErrorResponseMetadata.md)
5656
- [FIDsApiListFidsRequest](../interfaces/openapi.FIDsApiListFidsRequest.md)
@@ -118,6 +118,7 @@
118118
- [StorageLimitsResponse](../interfaces/openapi.StorageLimitsResponse.md)
119119
- [StorageRentEventBody](../interfaces/openapi.StorageRentEventBody.md)
120120
- [SubmitMessageApiSubmitMessageRequest](../interfaces/openapi.SubmitMessageApiSubmitMessageRequest.md)
121+
- [UrlEmbed](../interfaces/openapi.UrlEmbed.md)
121122
- [UserDataAddAllOf](../interfaces/openapi.UserDataAddAllOf.md)
122123
- [UserDataApiGetUserDataByFidRequest](../interfaces/openapi.UserDataApiGetUserDataByFidRequest.md)
123124
- [UserDataBody](../interfaces/openapi.UserDataBody.md)
@@ -139,6 +140,7 @@
139140
- [CastAddAllOfData](openapi.md#castaddallofdata)
140141
- [CastRemove](openapi.md#castremove)
141142
- [CastRemoveAllOfData](openapi.md#castremoveallofdata)
143+
- [Embed](openapi.md#embed)
142144
- [GetUserDataByFid200Response](openapi.md#getuserdatabyfid200response)
143145
- [HubEvent](openapi.md#hubevent)
144146
- [LinkAdd](openapi.md#linkadd)
@@ -263,6 +265,18 @@ ___
263265

264266
___
265267

268+
### Embed
269+
270+
Ƭ **Embed**: [`CastEmbed`](../interfaces/openapi.CastEmbed.md) \| [`UrlEmbed`](../interfaces/openapi.UrlEmbed.md)
271+
272+
**`Export`**
273+
274+
#### Defined in
275+
276+
[packages/farcaster-js-hub-rest/src/openapi/generated/models/embed.ts:30](https://github.com/standard-crypto/farcaster-js/blob/main/packages/farcaster-js-hub-rest/src/openapi/generated/models/embed.ts#L30)
277+
278+
___
279+
266280
### GetUserDataByFid200Response
267281

268282
Ƭ **GetUserDataByFid200Response**: [`GetUserDataByFid200ResponseOneOf`](../interfaces/openapi.GetUserDataByFid200ResponseOneOf.md) \| [`UserDataAdd`](openapi.md#userdataadd)

packages/farcaster-js-hub-rest/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@standard-crypto/farcaster-js-hub-rest",
3-
"version": "1.3.0",
3+
"version": "1.4.0",
44
"description": "A tool for interacting with the REST API of any Farcaster hub.",
55
"type": "module",
66
"repository": {

packages/farcaster-js-hub-rest/src/hubRestApiClient.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ export class HubRestAPIClient {
178178
mentions?: number[]
179179
mentionsPositions?: number[]
180180
parentCastId?: CastId
181+
parentUrl?: string
181182
},
182183
fid: number,
183184
signerPrivateKeyHex: string,
@@ -192,6 +193,7 @@ export class HubRestAPIClient {
192193
embedsDeprecated: cast.embedsDeprecated ?? [],
193194
mentions: cast.mentions ?? [],
194195
mentionsPositions: cast.mentionsPositions ?? [],
196+
parentUrl: cast.parentUrl,
195197
};
196198
if (cast.parentCastId !== undefined) {
197199
const parentHashBytes = hexStringToBytes(cast.parentCastId.hash);

packages/farcaster-js-hub-rest/src/openapi/generated/.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ models/cast-add-all-of-data.ts
2121
models/cast-add-all-of.ts
2222
models/cast-add-body.ts
2323
models/cast-add.ts
24+
models/cast-embed.ts
2425
models/cast-id.ts
2526
models/cast-remove-all-of-data.ts
2627
models/cast-remove-all-of.ts
@@ -115,6 +116,7 @@ models/storage-limit.ts
115116
models/storage-limits-response.ts
116117
models/storage-rent-event-body.ts
117118
models/store-type.ts
119+
models/url-embed.ts
118120
models/user-data-add-all-of-data.ts
119121
models/user-data-add-all-of.ts
120122
models/user-data-add.ts
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/**
4+
* Farcaster Hub REST API
5+
* Perform basic queries of Farcaster state via the REST API of a Farcaster hub. See the [Farcaster docs](https://www.thehubble.xyz/docs/httpapi/httpapi.html) for more details. Some client libraries: - [TypeScript](https://www.npmjs.com/package/@standard-crypto/farcaster-js-hub-rest)
6+
*
7+
* The version of the OpenAPI document: 1.0
8+
*
9+
*
10+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11+
* https://openapi-generator.tech
12+
* Do not edit the class manually.
13+
*/
14+
15+
16+
// May contain unused imports in some cases
17+
// @ts-ignore
18+
import { CastId } from './cast-id.js';
19+
20+
/**
21+
*
22+
* @export
23+
* @interface CastEmbed
24+
*/
25+
export interface CastEmbed {
26+
/**
27+
*
28+
* @type {CastId}
29+
* @memberof CastEmbed
30+
*/
31+
'castId': CastId;
32+
}
33+

packages/farcaster-js-hub-rest/src/openapi/generated/models/embed.ts

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,20 @@
1313
*/
1414

1515

16+
// May contain unused imports in some cases
17+
// @ts-ignore
18+
import { CastEmbed } from './cast-embed.js';
1619
// May contain unused imports in some cases
1720
// @ts-ignore
1821
import { CastId } from './cast-id.js';
22+
// May contain unused imports in some cases
23+
// @ts-ignore
24+
import { UrlEmbed } from './url-embed.js';
1925

2026
/**
21-
*
27+
* @type Embed
2228
* @export
23-
* @interface Embed
2429
*/
25-
export interface Embed {
26-
/**
27-
*
28-
* @type {string}
29-
* @memberof Embed
30-
*/
31-
'url': string;
32-
/**
33-
*
34-
* @type {CastId}
35-
* @memberof Embed
36-
*/
37-
'castId'?: CastId;
38-
}
30+
export type Embed = CastEmbed | UrlEmbed;
31+
3932

packages/farcaster-js-hub-rest/src/openapi/generated/models/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export * from './cast-add-all-of.js';
33
export * from './cast-add-all-of-data.js';
44
export * from './cast-add-all-of-data-all-of.js';
55
export * from './cast-add-body.js';
6+
export * from './cast-embed.js';
67
export * from './cast-id.js';
78
export * from './cast-remove.js';
89
export * from './cast-remove-all-of.js';
@@ -96,6 +97,7 @@ export * from './storage-limit.js';
9697
export * from './storage-limits-response.js';
9798
export * from './storage-rent-event-body.js';
9899
export * from './store-type.js';
100+
export * from './url-embed.js';
99101
export * from './user-data-add.js';
100102
export * from './user-data-add-all-of.js';
101103
export * from './user-data-add-all-of-data.js';
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/**
4+
* Farcaster Hub REST API
5+
* Perform basic queries of Farcaster state via the REST API of a Farcaster hub. See the [Farcaster docs](https://www.thehubble.xyz/docs/httpapi/httpapi.html) for more details. Some client libraries: - [TypeScript](https://www.npmjs.com/package/@standard-crypto/farcaster-js-hub-rest)
6+
*
7+
* The version of the OpenAPI document: 1.0
8+
*
9+
*
10+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11+
* https://openapi-generator.tech
12+
* Do not edit the class manually.
13+
*/
14+
15+
16+
17+
/**
18+
*
19+
* @export
20+
* @interface UrlEmbed
21+
*/
22+
export interface UrlEmbed {
23+
/**
24+
*
25+
* @type {string}
26+
* @memberof UrlEmbed
27+
*/
28+
'url': string;
29+
}
30+

packages/farcaster-js-hub-rest/src/openapi/generated/schema.d.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ export interface components {
146146
/** URLs or cast ids to be embedded in the cast */
147147
embeds: components["schemas"]["Embed"][];
148148
};
149+
CastEmbed: {
150+
castId: components["schemas"]["CastId"];
151+
};
149152
CastRemove: components["schemas"]["MessageCommon"] & ({
150153
data: components["schemas"]["MessageDataCastRemove"] & {
151154
type: components["schemas"]["MessageType"];
@@ -177,11 +180,7 @@ export interface components {
177180
/** Format: uint64 */
178181
numFnameEvents: number;
179182
};
180-
Embed: {
181-
/** Format: uri */
182-
url: string;
183-
castId?: components["schemas"]["CastId"];
184-
};
183+
Embed: components["schemas"]["CastEmbed"] | components["schemas"]["UrlEmbed"];
185184
ErrorResponse: {
186185
errCode: string;
187186
presentable: boolean;
@@ -521,6 +520,10 @@ export interface components {
521520
* @enum {string}
522521
*/
523522
StoreType: "STORE_TYPE_CASTS" | "STORE_TYPE_LINKS" | "STORE_TYPE_REACTIONS" | "STORE_TYPE_USER_DATA" | "STORE_TYPE_VERIFICATIONS" | "STORE_TYPE_USERNAME_PROOFS";
523+
UrlEmbed: {
524+
/** Format: uri */
525+
url: string;
526+
};
524527
UserDataAdd: components["schemas"]["MessageCommon"] & ({
525528
data: components["schemas"]["MessageDataUserDataAdd"] & {
526529
type: components["schemas"]["MessageType"];

0 commit comments

Comments
 (0)