diff --git a/src/controllers/AgreementController.ts b/src/controllers/AgreementController.ts index 98863af1..db7abb8b 100644 --- a/src/controllers/AgreementController.ts +++ b/src/controllers/AgreementController.ts @@ -343,7 +343,7 @@ export default class AgreementController { }), orm.models.AgreementToken.findAll({ where: { - id: { + tokenId: { [Op.in]: req.body.tokenIds } } diff --git a/src/lib/gptPrompts.ts b/src/lib/gptPrompts.ts index 81ccaf04..db16e308 100644 --- a/src/lib/gptPrompts.ts +++ b/src/lib/gptPrompts.ts @@ -6,3 +6,8 @@ export const prompt2 = (options: { brandName: string; brandVoice: string }) => { return `You are a content curator. You will be ingesting messages from the chat rooms of the ${brandName} community. You will then analyze the messages for the best content. You should consider the emoji reactions for each message as well as surrounding context and discussion. Finally, you should summarize the best content and links into a newsletter format where the writer's voice can be described as: ${brandVoice}` } + +export const compressor = (options: { text: string }) => { + const { text } = options + return `Compressor: compress the following text in a way that fits in a tweet (ideally) and such that you (GPT-4) can reconstruct the intention of the human who wrote text as close as possible to the original intention. This is for yourself. It does not need to be human readable or understandable. Abuse of language mixing, abbreviations, symbols (unicode and emoji), or any other encodings or internal representations is all permissible, as long as it, if pasted in a new inference cycle, will yield near-identical results as the original text: ${text}` +} diff --git a/src/types/meem.generated.ts b/src/types/meem.generated.ts index 4f7f40f6..76abd48f 100644 --- a/src/types/meem.generated.ts +++ b/src/types/meem.generated.ts @@ -2139,6 +2139,90 @@ export namespace GetDiscordServers { +export namespace GetJoinGuildMessage { + export interface IPathParams { + /** The Agreement id */ + agreementId: string + } + + export const path = (options: IPathParams) => + `/api/1.0/agreements/${options.agreementId}/getJoinGuildMessage` + + export const method = HttpMethod.Get + + export interface IQueryParams {} + + export interface IRequestBody {} + + export interface IResponseBody extends IApiResponseBody { + message: string + params: { + chainId?: string + msg: string + method: number + addr: string + nonce: string + hash?: string + ts: string + } + } + + export interface IDefinition { + pathParams: IPathParams + queryParams: IQueryParams + requestBody: IRequestBody + responseBody: IResponseBody + } + + export type Response = IResponseBody | IError +} + + + +export namespace JoinGuild { + export interface IPathParams { + /** The Agreement id */ + agreementId: string + } + + export const path = (options: IPathParams) => + `/api/1.0/agreements/${options.agreementId}/joinGuild` + + export const method = HttpMethod.Post + + export interface IQueryParams {} + + export interface IRequestBody { + message: string + params: { + chainId?: string + msg: string + method: number + addr: string + nonce: string + hash?: string + ts: string + } + sig: string + mintToken?: boolean + } + + export interface IResponseBody extends IApiResponseBody { + status: 'success' + } + + export interface IDefinition { + pathParams: IPathParams + queryParams: IQueryParams + requestBody: IRequestBody + responseBody: IResponseBody + } + + export type Response = IResponseBody | IError +} + + + export namespace CreateBundle { export interface IPathParams {} @@ -2341,76 +2425,27 @@ export namespace UpdateWalletContractInstance { -export namespace GetJoinGuildMessage { - export interface IPathParams { - /** The Agreement id */ - agreementId: string - } - - export const path = (options: IPathParams) => - `/api/1.0/agreements/${options.agreementId}/getJoinGuildMessage` - - export const method = HttpMethod.Get - - export interface IQueryParams {} - - export interface IRequestBody {} - - export interface IResponseBody extends IApiResponseBody { - message: string - params: { - chainId?: string - msg: string - method: number - addr: string - nonce: string - hash?: string - ts: string - } - } - - export interface IDefinition { - pathParams: IPathParams - queryParams: IQueryParams - requestBody: IRequestBody - responseBody: IResponseBody - } - - export type Response = IResponseBody | IError -} - - - -export namespace JoinGuild { - export interface IPathParams { - /** The Agreement id */ - agreementId: string - } +/** Save some data to IPFS */ +export namespace SaveToIPFS { + export interface IPathParams {} - export const path = (options: IPathParams) => - `/api/1.0/agreements/${options.agreementId}/joinGuild` + export const path = () => `/api/1.0/ipfs` export const method = HttpMethod.Post export interface IQueryParams {} export interface IRequestBody { - message: string - params: { - chainId?: string - msg: string - method: number - addr: string - nonce: string - hash?: string - ts: string - } - sig: string - mintToken?: boolean + /** The data to save. Only one of "data" or "json" should be sent */ + data?: string + + /** The JSON to save. Only one of "data" or "json" should be sent */ + json?: Record } export interface IResponseBody extends IApiResponseBody { - status: 'success' + /** The IPFS hash for the saved data */ + ipfsHash: string } export interface IDefinition { @@ -2423,6 +2458,9 @@ export namespace JoinGuild { export type Response = IResponseBody | IError } +// TODO: How to specify json in OpenAPI definition + + /** Create or update the current user */ @@ -2624,44 +2662,6 @@ export namespace UpdateUserIdentity { -/** Save some data to IPFS */ -export namespace SaveToIPFS { - export interface IPathParams {} - - export const path = () => `/api/1.0/ipfs` - - export const method = HttpMethod.Post - - export interface IQueryParams {} - - export interface IRequestBody { - /** The data to save. Only one of "data" or "json" should be sent */ - data?: string - - /** The JSON to save. Only one of "data" or "json" should be sent */ - json?: Record - } - - export interface IResponseBody extends IApiResponseBody { - /** The IPFS hash for the saved data */ - ipfsHash: string - } - - export interface IDefinition { - pathParams: IPathParams - queryParams: IQueryParams - requestBody: IRequestBody - responseBody: IResponseBody - } - - export type Response = IResponseBody | IError -} - -// TODO: How to specify json in OpenAPI definition - - - - /** Redirect the user to this endpoint to authenticate w/ slack */ export namespace AuthenticateWithSlack { export interface IPathParams {} diff --git a/src/types/meem.public.generated.ts b/src/types/meem.public.generated.ts index aa2033d9..580ed057 100644 --- a/src/types/meem.public.generated.ts +++ b/src/types/meem.public.generated.ts @@ -2137,6 +2137,90 @@ export namespace GetDiscordServers { +export namespace GetJoinGuildMessage { + export interface IPathParams { + /** The Agreement id */ + agreementId: string + } + + export const path = (options: IPathParams) => + `/api/1.0/agreements/${options.agreementId}/getJoinGuildMessage` + + export const method = HttpMethod.Get + + export interface IQueryParams {} + + export interface IRequestBody {} + + export interface IResponseBody extends IApiResponseBody { + message: string + params: { + chainId?: string + msg: string + method: number + addr: string + nonce: string + hash?: string + ts: string + } + } + + export interface IDefinition { + pathParams: IPathParams + queryParams: IQueryParams + requestBody: IRequestBody + responseBody: IResponseBody + } + + export type Response = IResponseBody | IError +} + + + +export namespace JoinGuild { + export interface IPathParams { + /** The Agreement id */ + agreementId: string + } + + export const path = (options: IPathParams) => + `/api/1.0/agreements/${options.agreementId}/joinGuild` + + export const method = HttpMethod.Post + + export interface IQueryParams {} + + export interface IRequestBody { + message: string + params: { + chainId?: string + msg: string + method: number + addr: string + nonce: string + hash?: string + ts: string + } + sig: string + mintToken?: boolean + } + + export interface IResponseBody extends IApiResponseBody { + status: 'success' + } + + export interface IDefinition { + pathParams: IPathParams + queryParams: IQueryParams + requestBody: IRequestBody + responseBody: IResponseBody + } + + export type Response = IResponseBody | IError +} + + + export namespace CreateBundle { export interface IPathParams {} @@ -2339,90 +2423,6 @@ export namespace UpdateWalletContractInstance { -export namespace GetJoinGuildMessage { - export interface IPathParams { - /** The Agreement id */ - agreementId: string - } - - export const path = (options: IPathParams) => - `/api/1.0/agreements/${options.agreementId}/getJoinGuildMessage` - - export const method = HttpMethod.Get - - export interface IQueryParams {} - - export interface IRequestBody {} - - export interface IResponseBody extends IApiResponseBody { - message: string - params: { - chainId?: string - msg: string - method: number - addr: string - nonce: string - hash?: string - ts: string - } - } - - export interface IDefinition { - pathParams: IPathParams - queryParams: IQueryParams - requestBody: IRequestBody - responseBody: IResponseBody - } - - export type Response = IResponseBody | IError -} - - - -export namespace JoinGuild { - export interface IPathParams { - /** The Agreement id */ - agreementId: string - } - - export const path = (options: IPathParams) => - `/api/1.0/agreements/${options.agreementId}/joinGuild` - - export const method = HttpMethod.Post - - export interface IQueryParams {} - - export interface IRequestBody { - message: string - params: { - chainId?: string - msg: string - method: number - addr: string - nonce: string - hash?: string - ts: string - } - sig: string - mintToken?: boolean - } - - export interface IResponseBody extends IApiResponseBody { - status: 'success' - } - - export interface IDefinition { - pathParams: IPathParams - queryParams: IQueryParams - requestBody: IRequestBody - responseBody: IResponseBody - } - - export type Response = IResponseBody | IError -} - - - /** Create or update the current user */ export namespace CreateOrUpdateUser { export interface IPathParams {}