@crestal/nation-sdk 0.1.29 → 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +2 -0
- package/README.md +5 -2
- package/api.ts +233 -1
- package/base.ts +1 -1
- package/common.ts +1 -1
- package/configuration.ts +1 -1
- package/dist/api.d.ts +124 -1
- package/dist/api.js +248 -3
- package/dist/base.d.ts +1 -1
- package/dist/base.js +1 -1
- package/dist/common.d.ts +1 -1
- package/dist/common.js +1 -1
- package/dist/configuration.d.ts +1 -1
- package/dist/configuration.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/docs/LLMModelInfoWithProviderName.md +2 -2
- package/docs/OAuthApi.md +122 -0
- package/docs/TwitterAuthResponse.md +22 -0
- package/index.ts +1 -1
- package/package.json +1 -1
package/.openapi-generator/FILES
CHANGED
|
@@ -47,9 +47,11 @@ docs/HealthApi.md
|
|
|
47
47
|
docs/LLMModelInfoWithProviderName.md
|
|
48
48
|
docs/LLMProvider.md
|
|
49
49
|
docs/MetadataApi.md
|
|
50
|
+
docs/OAuthApi.md
|
|
50
51
|
docs/OwnerType.md
|
|
51
52
|
docs/Skill.md
|
|
52
53
|
docs/TransactionType.md
|
|
54
|
+
docs/TwitterAuthResponse.md
|
|
53
55
|
docs/UpstreamType.md
|
|
54
56
|
docs/UserApi.md
|
|
55
57
|
docs/ValidationError.md
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## @crestal/nation-sdk@0.1.
|
|
1
|
+
## @crestal/nation-sdk@0.1.30
|
|
2
2
|
|
|
3
3
|
This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
|
|
4
4
|
|
|
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
|
|
|
36
36
|
_published:_
|
|
37
37
|
|
|
38
38
|
```
|
|
39
|
-
npm install @crestal/nation-sdk@0.1.
|
|
39
|
+
npm install @crestal/nation-sdk@0.1.30 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
|
@@ -84,6 +84,8 @@ Class | Method | HTTP request | Description
|
|
|
84
84
|
*MetadataApi* | [**getSkillIcon**](docs/MetadataApi.md#getskillicon) | **GET** /metadata/skills/{skill}/{icon_name}.{ext} | Get skill icon
|
|
85
85
|
*MetadataApi* | [**getSkillSchema**](docs/MetadataApi.md#getskillschema) | **GET** /metadata/skills/{skill}/schema.json | Get skill schema
|
|
86
86
|
*MetadataApi* | [**getSkillsMetadataSkillsGet**](docs/MetadataApi.md#getskillsmetadataskillsget) | **GET** /metadata/skills | Get all skills
|
|
87
|
+
*OAuthApi* | [**getTwitterAuthUrlOauthTwitterGet**](docs/OAuthApi.md#gettwitterauthurloauthtwitterget) | **GET** /oauth/twitter | Get Twitter Auth Url
|
|
88
|
+
*OAuthApi* | [**twitterOauthCallbackOauthTwitterCallbackGet**](docs/OAuthApi.md#twitteroauthcallbackoauthtwittercallbackget) | **GET** /oauth/twitter/callback | Twitter Oauth Callback
|
|
87
89
|
*UserApi* | [**getUserAgentById**](docs/UserApi.md#getuseragentbyid) | **GET** /user/agents/{agent_id} | Get User Agent By Id
|
|
88
90
|
*UserApi* | [**getUserAgents**](docs/UserApi.md#getuseragents) | **GET** /user/agents | Get User Agents
|
|
89
91
|
|
|
@@ -128,6 +130,7 @@ Class | Method | HTTP request | Description
|
|
|
128
130
|
- [OwnerType](docs/OwnerType.md)
|
|
129
131
|
- [Skill](docs/Skill.md)
|
|
130
132
|
- [TransactionType](docs/TransactionType.md)
|
|
133
|
+
- [TwitterAuthResponse](docs/TwitterAuthResponse.md)
|
|
131
134
|
- [UpstreamType](docs/UpstreamType.md)
|
|
132
135
|
- [ValidationError](docs/ValidationError.md)
|
|
133
136
|
- [ValidationErrorLocInner](docs/ValidationErrorLocInner.md)
|
package/api.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Nation IntentKit API
|
|
5
5
|
* API for Nation IntentKit services
|
|
6
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 0.1.
|
|
7
|
+
* The version of the OpenAPI document: 0.1.30
|
|
8
8
|
*
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2650,6 +2650,25 @@ export const TransactionType = {
|
|
|
2650
2650
|
export type TransactionType = typeof TransactionType[keyof typeof TransactionType];
|
|
2651
2651
|
|
|
2652
2652
|
|
|
2653
|
+
/**
|
|
2654
|
+
*
|
|
2655
|
+
* @export
|
|
2656
|
+
* @interface TwitterAuthResponse
|
|
2657
|
+
*/
|
|
2658
|
+
export interface TwitterAuthResponse {
|
|
2659
|
+
/**
|
|
2660
|
+
*
|
|
2661
|
+
* @type {string}
|
|
2662
|
+
* @memberof TwitterAuthResponse
|
|
2663
|
+
*/
|
|
2664
|
+
'agent_id': string;
|
|
2665
|
+
/**
|
|
2666
|
+
*
|
|
2667
|
+
* @type {string}
|
|
2668
|
+
* @memberof TwitterAuthResponse
|
|
2669
|
+
*/
|
|
2670
|
+
'url': string;
|
|
2671
|
+
}
|
|
2653
2672
|
/**
|
|
2654
2673
|
* Type of upstream transaction.
|
|
2655
2674
|
* @export
|
|
@@ -5482,6 +5501,219 @@ export class MetadataApi extends BaseAPI {
|
|
|
5482
5501
|
|
|
5483
5502
|
|
|
5484
5503
|
|
|
5504
|
+
/**
|
|
5505
|
+
* OAuthApi - axios parameter creator
|
|
5506
|
+
* @export
|
|
5507
|
+
*/
|
|
5508
|
+
export const OAuthApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
5509
|
+
return {
|
|
5510
|
+
/**
|
|
5511
|
+
* Get Twitter OAuth2 authorization URL. **Query Parameters:** * `agent_id` - ID of the agent to authenticate * `redirect_uri` - DApp URI to redirect to after authorization from agentkit to DApp **Returns:** * Object containing agent_id and authorization URL
|
|
5512
|
+
* @summary Get Twitter Auth Url
|
|
5513
|
+
* @param {string} agentId
|
|
5514
|
+
* @param {string} redirectUri
|
|
5515
|
+
* @param {*} [options] Override http request option.
|
|
5516
|
+
* @throws {RequiredError}
|
|
5517
|
+
*/
|
|
5518
|
+
getTwitterAuthUrlOauthTwitterGet: async (agentId: string, redirectUri: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
5519
|
+
// verify required parameter 'agentId' is not null or undefined
|
|
5520
|
+
assertParamExists('getTwitterAuthUrlOauthTwitterGet', 'agentId', agentId)
|
|
5521
|
+
// verify required parameter 'redirectUri' is not null or undefined
|
|
5522
|
+
assertParamExists('getTwitterAuthUrlOauthTwitterGet', 'redirectUri', redirectUri)
|
|
5523
|
+
const localVarPath = `/oauth/twitter`;
|
|
5524
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
5525
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
5526
|
+
let baseOptions;
|
|
5527
|
+
if (configuration) {
|
|
5528
|
+
baseOptions = configuration.baseOptions;
|
|
5529
|
+
}
|
|
5530
|
+
|
|
5531
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
5532
|
+
const localVarHeaderParameter = {} as any;
|
|
5533
|
+
const localVarQueryParameter = {} as any;
|
|
5534
|
+
|
|
5535
|
+
// authentication HTTPBearer required
|
|
5536
|
+
// http bearer authentication required
|
|
5537
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
5538
|
+
|
|
5539
|
+
if (agentId !== undefined) {
|
|
5540
|
+
localVarQueryParameter['agent_id'] = agentId;
|
|
5541
|
+
}
|
|
5542
|
+
|
|
5543
|
+
if (redirectUri !== undefined) {
|
|
5544
|
+
localVarQueryParameter['redirect_uri'] = redirectUri;
|
|
5545
|
+
}
|
|
5546
|
+
|
|
5547
|
+
|
|
5548
|
+
|
|
5549
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
5550
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
5551
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
5552
|
+
|
|
5553
|
+
return {
|
|
5554
|
+
url: toPathString(localVarUrlObj),
|
|
5555
|
+
options: localVarRequestOptions,
|
|
5556
|
+
};
|
|
5557
|
+
},
|
|
5558
|
+
/**
|
|
5559
|
+
* Handle Twitter OAuth2 callback. This endpoint is called by Twitter after the user authorizes the application. It exchanges the authorization code for access and refresh tokens, then stores them in the database. **Query Parameters:** * `state` - URL-encoded state containing agent_id and redirect_uri * `code` - Authorization code from Twitter * `error` - Error message from Twitter (optional) **Returns:** * JSONResponse or RedirectResponse depending on redirect_uri
|
|
5560
|
+
* @summary Twitter Oauth Callback
|
|
5561
|
+
* @param {string} state
|
|
5562
|
+
* @param {string | null} [code]
|
|
5563
|
+
* @param {string | null} [error]
|
|
5564
|
+
* @param {*} [options] Override http request option.
|
|
5565
|
+
* @throws {RequiredError}
|
|
5566
|
+
*/
|
|
5567
|
+
twitterOauthCallbackOauthTwitterCallbackGet: async (state: string, code?: string | null, error?: string | null, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
5568
|
+
// verify required parameter 'state' is not null or undefined
|
|
5569
|
+
assertParamExists('twitterOauthCallbackOauthTwitterCallbackGet', 'state', state)
|
|
5570
|
+
const localVarPath = `/oauth/twitter/callback`;
|
|
5571
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
5572
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
5573
|
+
let baseOptions;
|
|
5574
|
+
if (configuration) {
|
|
5575
|
+
baseOptions = configuration.baseOptions;
|
|
5576
|
+
}
|
|
5577
|
+
|
|
5578
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
5579
|
+
const localVarHeaderParameter = {} as any;
|
|
5580
|
+
const localVarQueryParameter = {} as any;
|
|
5581
|
+
|
|
5582
|
+
if (state !== undefined) {
|
|
5583
|
+
localVarQueryParameter['state'] = state;
|
|
5584
|
+
}
|
|
5585
|
+
|
|
5586
|
+
if (code !== undefined) {
|
|
5587
|
+
localVarQueryParameter['code'] = code;
|
|
5588
|
+
}
|
|
5589
|
+
|
|
5590
|
+
if (error !== undefined) {
|
|
5591
|
+
localVarQueryParameter['error'] = error;
|
|
5592
|
+
}
|
|
5593
|
+
|
|
5594
|
+
|
|
5595
|
+
|
|
5596
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
5597
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
5598
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
5599
|
+
|
|
5600
|
+
return {
|
|
5601
|
+
url: toPathString(localVarUrlObj),
|
|
5602
|
+
options: localVarRequestOptions,
|
|
5603
|
+
};
|
|
5604
|
+
},
|
|
5605
|
+
}
|
|
5606
|
+
};
|
|
5607
|
+
|
|
5608
|
+
/**
|
|
5609
|
+
* OAuthApi - functional programming interface
|
|
5610
|
+
* @export
|
|
5611
|
+
*/
|
|
5612
|
+
export const OAuthApiFp = function(configuration?: Configuration) {
|
|
5613
|
+
const localVarAxiosParamCreator = OAuthApiAxiosParamCreator(configuration)
|
|
5614
|
+
return {
|
|
5615
|
+
/**
|
|
5616
|
+
* Get Twitter OAuth2 authorization URL. **Query Parameters:** * `agent_id` - ID of the agent to authenticate * `redirect_uri` - DApp URI to redirect to after authorization from agentkit to DApp **Returns:** * Object containing agent_id and authorization URL
|
|
5617
|
+
* @summary Get Twitter Auth Url
|
|
5618
|
+
* @param {string} agentId
|
|
5619
|
+
* @param {string} redirectUri
|
|
5620
|
+
* @param {*} [options] Override http request option.
|
|
5621
|
+
* @throws {RequiredError}
|
|
5622
|
+
*/
|
|
5623
|
+
async getTwitterAuthUrlOauthTwitterGet(agentId: string, redirectUri: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<TwitterAuthResponse>> {
|
|
5624
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getTwitterAuthUrlOauthTwitterGet(agentId, redirectUri, options);
|
|
5625
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
5626
|
+
const localVarOperationServerBasePath = operationServerMap['OAuthApi.getTwitterAuthUrlOauthTwitterGet']?.[localVarOperationServerIndex]?.url;
|
|
5627
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5628
|
+
},
|
|
5629
|
+
/**
|
|
5630
|
+
* Handle Twitter OAuth2 callback. This endpoint is called by Twitter after the user authorizes the application. It exchanges the authorization code for access and refresh tokens, then stores them in the database. **Query Parameters:** * `state` - URL-encoded state containing agent_id and redirect_uri * `code` - Authorization code from Twitter * `error` - Error message from Twitter (optional) **Returns:** * JSONResponse or RedirectResponse depending on redirect_uri
|
|
5631
|
+
* @summary Twitter Oauth Callback
|
|
5632
|
+
* @param {string} state
|
|
5633
|
+
* @param {string | null} [code]
|
|
5634
|
+
* @param {string | null} [error]
|
|
5635
|
+
* @param {*} [options] Override http request option.
|
|
5636
|
+
* @throws {RequiredError}
|
|
5637
|
+
*/
|
|
5638
|
+
async twitterOauthCallbackOauthTwitterCallbackGet(state: string, code?: string | null, error?: string | null, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>> {
|
|
5639
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.twitterOauthCallbackOauthTwitterCallbackGet(state, code, error, options);
|
|
5640
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
5641
|
+
const localVarOperationServerBasePath = operationServerMap['OAuthApi.twitterOauthCallbackOauthTwitterCallbackGet']?.[localVarOperationServerIndex]?.url;
|
|
5642
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5643
|
+
},
|
|
5644
|
+
}
|
|
5645
|
+
};
|
|
5646
|
+
|
|
5647
|
+
/**
|
|
5648
|
+
* OAuthApi - factory interface
|
|
5649
|
+
* @export
|
|
5650
|
+
*/
|
|
5651
|
+
export const OAuthApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
5652
|
+
const localVarFp = OAuthApiFp(configuration)
|
|
5653
|
+
return {
|
|
5654
|
+
/**
|
|
5655
|
+
* Get Twitter OAuth2 authorization URL. **Query Parameters:** * `agent_id` - ID of the agent to authenticate * `redirect_uri` - DApp URI to redirect to after authorization from agentkit to DApp **Returns:** * Object containing agent_id and authorization URL
|
|
5656
|
+
* @summary Get Twitter Auth Url
|
|
5657
|
+
* @param {string} agentId
|
|
5658
|
+
* @param {string} redirectUri
|
|
5659
|
+
* @param {*} [options] Override http request option.
|
|
5660
|
+
* @throws {RequiredError}
|
|
5661
|
+
*/
|
|
5662
|
+
getTwitterAuthUrlOauthTwitterGet(agentId: string, redirectUri: string, options?: RawAxiosRequestConfig): AxiosPromise<TwitterAuthResponse> {
|
|
5663
|
+
return localVarFp.getTwitterAuthUrlOauthTwitterGet(agentId, redirectUri, options).then((request) => request(axios, basePath));
|
|
5664
|
+
},
|
|
5665
|
+
/**
|
|
5666
|
+
* Handle Twitter OAuth2 callback. This endpoint is called by Twitter after the user authorizes the application. It exchanges the authorization code for access and refresh tokens, then stores them in the database. **Query Parameters:** * `state` - URL-encoded state containing agent_id and redirect_uri * `code` - Authorization code from Twitter * `error` - Error message from Twitter (optional) **Returns:** * JSONResponse or RedirectResponse depending on redirect_uri
|
|
5667
|
+
* @summary Twitter Oauth Callback
|
|
5668
|
+
* @param {string} state
|
|
5669
|
+
* @param {string | null} [code]
|
|
5670
|
+
* @param {string | null} [error]
|
|
5671
|
+
* @param {*} [options] Override http request option.
|
|
5672
|
+
* @throws {RequiredError}
|
|
5673
|
+
*/
|
|
5674
|
+
twitterOauthCallbackOauthTwitterCallbackGet(state: string, code?: string | null, error?: string | null, options?: RawAxiosRequestConfig): AxiosPromise<any> {
|
|
5675
|
+
return localVarFp.twitterOauthCallbackOauthTwitterCallbackGet(state, code, error, options).then((request) => request(axios, basePath));
|
|
5676
|
+
},
|
|
5677
|
+
};
|
|
5678
|
+
};
|
|
5679
|
+
|
|
5680
|
+
/**
|
|
5681
|
+
* OAuthApi - object-oriented interface
|
|
5682
|
+
* @export
|
|
5683
|
+
* @class OAuthApi
|
|
5684
|
+
* @extends {BaseAPI}
|
|
5685
|
+
*/
|
|
5686
|
+
export class OAuthApi extends BaseAPI {
|
|
5687
|
+
/**
|
|
5688
|
+
* Get Twitter OAuth2 authorization URL. **Query Parameters:** * `agent_id` - ID of the agent to authenticate * `redirect_uri` - DApp URI to redirect to after authorization from agentkit to DApp **Returns:** * Object containing agent_id and authorization URL
|
|
5689
|
+
* @summary Get Twitter Auth Url
|
|
5690
|
+
* @param {string} agentId
|
|
5691
|
+
* @param {string} redirectUri
|
|
5692
|
+
* @param {*} [options] Override http request option.
|
|
5693
|
+
* @throws {RequiredError}
|
|
5694
|
+
* @memberof OAuthApi
|
|
5695
|
+
*/
|
|
5696
|
+
public getTwitterAuthUrlOauthTwitterGet(agentId: string, redirectUri: string, options?: RawAxiosRequestConfig) {
|
|
5697
|
+
return OAuthApiFp(this.configuration).getTwitterAuthUrlOauthTwitterGet(agentId, redirectUri, options).then((request) => request(this.axios, this.basePath));
|
|
5698
|
+
}
|
|
5699
|
+
|
|
5700
|
+
/**
|
|
5701
|
+
* Handle Twitter OAuth2 callback. This endpoint is called by Twitter after the user authorizes the application. It exchanges the authorization code for access and refresh tokens, then stores them in the database. **Query Parameters:** * `state` - URL-encoded state containing agent_id and redirect_uri * `code` - Authorization code from Twitter * `error` - Error message from Twitter (optional) **Returns:** * JSONResponse or RedirectResponse depending on redirect_uri
|
|
5702
|
+
* @summary Twitter Oauth Callback
|
|
5703
|
+
* @param {string} state
|
|
5704
|
+
* @param {string | null} [code]
|
|
5705
|
+
* @param {string | null} [error]
|
|
5706
|
+
* @param {*} [options] Override http request option.
|
|
5707
|
+
* @throws {RequiredError}
|
|
5708
|
+
* @memberof OAuthApi
|
|
5709
|
+
*/
|
|
5710
|
+
public twitterOauthCallbackOauthTwitterCallbackGet(state: string, code?: string | null, error?: string | null, options?: RawAxiosRequestConfig) {
|
|
5711
|
+
return OAuthApiFp(this.configuration).twitterOauthCallbackOauthTwitterCallbackGet(state, code, error, options).then((request) => request(this.axios, this.basePath));
|
|
5712
|
+
}
|
|
5713
|
+
}
|
|
5714
|
+
|
|
5715
|
+
|
|
5716
|
+
|
|
5485
5717
|
/**
|
|
5486
5718
|
* UserApi - axios parameter creator
|
|
5487
5719
|
* @export
|
package/base.ts
CHANGED
package/common.ts
CHANGED
package/configuration.ts
CHANGED
package/dist/api.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Nation IntentKit API
|
|
3
3
|
* API for Nation IntentKit services
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 0.1.
|
|
5
|
+
* The version of the OpenAPI document: 0.1.30
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2570,6 +2570,25 @@ export declare const TransactionType: {
|
|
|
2570
2570
|
readonly RechargeBonus: "recharge_bonus";
|
|
2571
2571
|
};
|
|
2572
2572
|
export type TransactionType = typeof TransactionType[keyof typeof TransactionType];
|
|
2573
|
+
/**
|
|
2574
|
+
*
|
|
2575
|
+
* @export
|
|
2576
|
+
* @interface TwitterAuthResponse
|
|
2577
|
+
*/
|
|
2578
|
+
export interface TwitterAuthResponse {
|
|
2579
|
+
/**
|
|
2580
|
+
*
|
|
2581
|
+
* @type {string}
|
|
2582
|
+
* @memberof TwitterAuthResponse
|
|
2583
|
+
*/
|
|
2584
|
+
'agent_id': string;
|
|
2585
|
+
/**
|
|
2586
|
+
*
|
|
2587
|
+
* @type {string}
|
|
2588
|
+
* @memberof TwitterAuthResponse
|
|
2589
|
+
*/
|
|
2590
|
+
'url': string;
|
|
2591
|
+
}
|
|
2573
2592
|
/**
|
|
2574
2593
|
* Type of upstream transaction.
|
|
2575
2594
|
* @export
|
|
@@ -3943,6 +3962,110 @@ export declare class MetadataApi extends BaseAPI {
|
|
|
3943
3962
|
*/
|
|
3944
3963
|
getSkillsMetadataSkillsGet(options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<Skill[], any>>;
|
|
3945
3964
|
}
|
|
3965
|
+
/**
|
|
3966
|
+
* OAuthApi - axios parameter creator
|
|
3967
|
+
* @export
|
|
3968
|
+
*/
|
|
3969
|
+
export declare const OAuthApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
3970
|
+
/**
|
|
3971
|
+
* Get Twitter OAuth2 authorization URL. **Query Parameters:** * `agent_id` - ID of the agent to authenticate * `redirect_uri` - DApp URI to redirect to after authorization from agentkit to DApp **Returns:** * Object containing agent_id and authorization URL
|
|
3972
|
+
* @summary Get Twitter Auth Url
|
|
3973
|
+
* @param {string} agentId
|
|
3974
|
+
* @param {string} redirectUri
|
|
3975
|
+
* @param {*} [options] Override http request option.
|
|
3976
|
+
* @throws {RequiredError}
|
|
3977
|
+
*/
|
|
3978
|
+
getTwitterAuthUrlOauthTwitterGet: (agentId: string, redirectUri: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
3979
|
+
/**
|
|
3980
|
+
* Handle Twitter OAuth2 callback. This endpoint is called by Twitter after the user authorizes the application. It exchanges the authorization code for access and refresh tokens, then stores them in the database. **Query Parameters:** * `state` - URL-encoded state containing agent_id and redirect_uri * `code` - Authorization code from Twitter * `error` - Error message from Twitter (optional) **Returns:** * JSONResponse or RedirectResponse depending on redirect_uri
|
|
3981
|
+
* @summary Twitter Oauth Callback
|
|
3982
|
+
* @param {string} state
|
|
3983
|
+
* @param {string | null} [code]
|
|
3984
|
+
* @param {string | null} [error]
|
|
3985
|
+
* @param {*} [options] Override http request option.
|
|
3986
|
+
* @throws {RequiredError}
|
|
3987
|
+
*/
|
|
3988
|
+
twitterOauthCallbackOauthTwitterCallbackGet: (state: string, code?: string | null, error?: string | null, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
3989
|
+
};
|
|
3990
|
+
/**
|
|
3991
|
+
* OAuthApi - functional programming interface
|
|
3992
|
+
* @export
|
|
3993
|
+
*/
|
|
3994
|
+
export declare const OAuthApiFp: (configuration?: Configuration) => {
|
|
3995
|
+
/**
|
|
3996
|
+
* Get Twitter OAuth2 authorization URL. **Query Parameters:** * `agent_id` - ID of the agent to authenticate * `redirect_uri` - DApp URI to redirect to after authorization from agentkit to DApp **Returns:** * Object containing agent_id and authorization URL
|
|
3997
|
+
* @summary Get Twitter Auth Url
|
|
3998
|
+
* @param {string} agentId
|
|
3999
|
+
* @param {string} redirectUri
|
|
4000
|
+
* @param {*} [options] Override http request option.
|
|
4001
|
+
* @throws {RequiredError}
|
|
4002
|
+
*/
|
|
4003
|
+
getTwitterAuthUrlOauthTwitterGet(agentId: string, redirectUri: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<TwitterAuthResponse>>;
|
|
4004
|
+
/**
|
|
4005
|
+
* Handle Twitter OAuth2 callback. This endpoint is called by Twitter after the user authorizes the application. It exchanges the authorization code for access and refresh tokens, then stores them in the database. **Query Parameters:** * `state` - URL-encoded state containing agent_id and redirect_uri * `code` - Authorization code from Twitter * `error` - Error message from Twitter (optional) **Returns:** * JSONResponse or RedirectResponse depending on redirect_uri
|
|
4006
|
+
* @summary Twitter Oauth Callback
|
|
4007
|
+
* @param {string} state
|
|
4008
|
+
* @param {string | null} [code]
|
|
4009
|
+
* @param {string | null} [error]
|
|
4010
|
+
* @param {*} [options] Override http request option.
|
|
4011
|
+
* @throws {RequiredError}
|
|
4012
|
+
*/
|
|
4013
|
+
twitterOauthCallbackOauthTwitterCallbackGet(state: string, code?: string | null, error?: string | null, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>>;
|
|
4014
|
+
};
|
|
4015
|
+
/**
|
|
4016
|
+
* OAuthApi - factory interface
|
|
4017
|
+
* @export
|
|
4018
|
+
*/
|
|
4019
|
+
export declare const OAuthApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
4020
|
+
/**
|
|
4021
|
+
* Get Twitter OAuth2 authorization URL. **Query Parameters:** * `agent_id` - ID of the agent to authenticate * `redirect_uri` - DApp URI to redirect to after authorization from agentkit to DApp **Returns:** * Object containing agent_id and authorization URL
|
|
4022
|
+
* @summary Get Twitter Auth Url
|
|
4023
|
+
* @param {string} agentId
|
|
4024
|
+
* @param {string} redirectUri
|
|
4025
|
+
* @param {*} [options] Override http request option.
|
|
4026
|
+
* @throws {RequiredError}
|
|
4027
|
+
*/
|
|
4028
|
+
getTwitterAuthUrlOauthTwitterGet(agentId: string, redirectUri: string, options?: RawAxiosRequestConfig): AxiosPromise<TwitterAuthResponse>;
|
|
4029
|
+
/**
|
|
4030
|
+
* Handle Twitter OAuth2 callback. This endpoint is called by Twitter after the user authorizes the application. It exchanges the authorization code for access and refresh tokens, then stores them in the database. **Query Parameters:** * `state` - URL-encoded state containing agent_id and redirect_uri * `code` - Authorization code from Twitter * `error` - Error message from Twitter (optional) **Returns:** * JSONResponse or RedirectResponse depending on redirect_uri
|
|
4031
|
+
* @summary Twitter Oauth Callback
|
|
4032
|
+
* @param {string} state
|
|
4033
|
+
* @param {string | null} [code]
|
|
4034
|
+
* @param {string | null} [error]
|
|
4035
|
+
* @param {*} [options] Override http request option.
|
|
4036
|
+
* @throws {RequiredError}
|
|
4037
|
+
*/
|
|
4038
|
+
twitterOauthCallbackOauthTwitterCallbackGet(state: string, code?: string | null, error?: string | null, options?: RawAxiosRequestConfig): AxiosPromise<any>;
|
|
4039
|
+
};
|
|
4040
|
+
/**
|
|
4041
|
+
* OAuthApi - object-oriented interface
|
|
4042
|
+
* @export
|
|
4043
|
+
* @class OAuthApi
|
|
4044
|
+
* @extends {BaseAPI}
|
|
4045
|
+
*/
|
|
4046
|
+
export declare class OAuthApi extends BaseAPI {
|
|
4047
|
+
/**
|
|
4048
|
+
* Get Twitter OAuth2 authorization URL. **Query Parameters:** * `agent_id` - ID of the agent to authenticate * `redirect_uri` - DApp URI to redirect to after authorization from agentkit to DApp **Returns:** * Object containing agent_id and authorization URL
|
|
4049
|
+
* @summary Get Twitter Auth Url
|
|
4050
|
+
* @param {string} agentId
|
|
4051
|
+
* @param {string} redirectUri
|
|
4052
|
+
* @param {*} [options] Override http request option.
|
|
4053
|
+
* @throws {RequiredError}
|
|
4054
|
+
* @memberof OAuthApi
|
|
4055
|
+
*/
|
|
4056
|
+
getTwitterAuthUrlOauthTwitterGet(agentId: string, redirectUri: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<TwitterAuthResponse, any>>;
|
|
4057
|
+
/**
|
|
4058
|
+
* Handle Twitter OAuth2 callback. This endpoint is called by Twitter after the user authorizes the application. It exchanges the authorization code for access and refresh tokens, then stores them in the database. **Query Parameters:** * `state` - URL-encoded state containing agent_id and redirect_uri * `code` - Authorization code from Twitter * `error` - Error message from Twitter (optional) **Returns:** * JSONResponse or RedirectResponse depending on redirect_uri
|
|
4059
|
+
* @summary Twitter Oauth Callback
|
|
4060
|
+
* @param {string} state
|
|
4061
|
+
* @param {string | null} [code]
|
|
4062
|
+
* @param {string | null} [error]
|
|
4063
|
+
* @param {*} [options] Override http request option.
|
|
4064
|
+
* @throws {RequiredError}
|
|
4065
|
+
* @memberof OAuthApi
|
|
4066
|
+
*/
|
|
4067
|
+
twitterOauthCallbackOauthTwitterCallbackGet(state: string, code?: string | null, error?: string | null, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<any, any>>;
|
|
4068
|
+
}
|
|
3946
4069
|
/**
|
|
3947
4070
|
* UserApi - axios parameter creator
|
|
3948
4071
|
* @export
|
package/dist/api.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Nation IntentKit API
|
|
6
6
|
* API for Nation IntentKit services
|
|
7
7
|
*
|
|
8
|
-
* The version of the OpenAPI document: 0.1.
|
|
8
|
+
* The version of the OpenAPI document: 0.1.30
|
|
9
9
|
*
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -84,8 +84,8 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
84
84
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
85
85
|
};
|
|
86
86
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
87
|
-
exports.
|
|
88
|
-
exports.UserApi = void 0;
|
|
87
|
+
exports.OAuthApiFactory = exports.OAuthApiFp = exports.OAuthApiAxiosParamCreator = exports.MetadataApi = exports.MetadataApiFactory = exports.MetadataApiFp = exports.MetadataApiAxiosParamCreator = exports.HealthApi = exports.HealthApiFactory = exports.HealthApiFp = exports.HealthApiAxiosParamCreator = exports.GeneratorApi = exports.GeneratorApiFactory = exports.GeneratorApiFp = exports.GeneratorApiAxiosParamCreator = exports.CreditApi = exports.CreditApiFactory = exports.CreditApiFp = exports.CreditApiAxiosParamCreator = exports.ChatApi = exports.ChatApiFactory = exports.ChatApiFp = exports.ChatApiAxiosParamCreator = exports.AgentApi = exports.AgentApiFactory = exports.AgentApiFp = exports.AgentApiAxiosParamCreator = exports.UpstreamType = exports.TransactionType = exports.OwnerType = exports.LLMProvider = exports.EventType = exports.Direction = exports.CreditType = exports.CreditDebit = exports.ChatMessageAttachmentType = exports.AuthorType = exports.AgentUpdateCdpNetworkIdEnum = exports.AgentUpdateNetworkIdEnum = exports.AgentUpdateWalletProviderEnum = exports.AgentUpdateShortTermMemoryStrategyEnum = exports.AgentUpdateModeEnum = exports.AgentSortOption = exports.AgentResponseWalletProviderEnum = exports.AgentResponseModeEnum = exports.AgentCdpNetworkIdEnum = exports.AgentNetworkIdEnum = exports.AgentWalletProviderEnum = exports.AgentShortTermMemoryStrategyEnum = exports.AgentModeEnum = void 0;
|
|
88
|
+
exports.UserApi = exports.UserApiFactory = exports.UserApiFp = exports.UserApiAxiosParamCreator = exports.OAuthApi = void 0;
|
|
89
89
|
var axios_1 = require("axios");
|
|
90
90
|
// Some imports not used depending on template conditions
|
|
91
91
|
// @ts-ignore
|
|
@@ -3670,6 +3670,251 @@ var MetadataApi = /** @class */ (function (_super) {
|
|
|
3670
3670
|
return MetadataApi;
|
|
3671
3671
|
}(base_1.BaseAPI));
|
|
3672
3672
|
exports.MetadataApi = MetadataApi;
|
|
3673
|
+
/**
|
|
3674
|
+
* OAuthApi - axios parameter creator
|
|
3675
|
+
* @export
|
|
3676
|
+
*/
|
|
3677
|
+
var OAuthApiAxiosParamCreator = function (configuration) {
|
|
3678
|
+
var _this = this;
|
|
3679
|
+
return {
|
|
3680
|
+
/**
|
|
3681
|
+
* Get Twitter OAuth2 authorization URL. **Query Parameters:** * `agent_id` - ID of the agent to authenticate * `redirect_uri` - DApp URI to redirect to after authorization from agentkit to DApp **Returns:** * Object containing agent_id and authorization URL
|
|
3682
|
+
* @summary Get Twitter Auth Url
|
|
3683
|
+
* @param {string} agentId
|
|
3684
|
+
* @param {string} redirectUri
|
|
3685
|
+
* @param {*} [options] Override http request option.
|
|
3686
|
+
* @throws {RequiredError}
|
|
3687
|
+
*/
|
|
3688
|
+
getTwitterAuthUrlOauthTwitterGet: function (agentId_1, redirectUri_1) {
|
|
3689
|
+
var args_1 = [];
|
|
3690
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
3691
|
+
args_1[_i - 2] = arguments[_i];
|
|
3692
|
+
}
|
|
3693
|
+
return __awaiter(_this, __spreadArray([agentId_1, redirectUri_1], args_1, true), void 0, function (agentId, redirectUri, options) {
|
|
3694
|
+
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
3695
|
+
if (options === void 0) { options = {}; }
|
|
3696
|
+
return __generator(this, function (_a) {
|
|
3697
|
+
switch (_a.label) {
|
|
3698
|
+
case 0:
|
|
3699
|
+
// verify required parameter 'agentId' is not null or undefined
|
|
3700
|
+
(0, common_1.assertParamExists)('getTwitterAuthUrlOauthTwitterGet', 'agentId', agentId);
|
|
3701
|
+
// verify required parameter 'redirectUri' is not null or undefined
|
|
3702
|
+
(0, common_1.assertParamExists)('getTwitterAuthUrlOauthTwitterGet', 'redirectUri', redirectUri);
|
|
3703
|
+
localVarPath = "/oauth/twitter";
|
|
3704
|
+
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
3705
|
+
if (configuration) {
|
|
3706
|
+
baseOptions = configuration.baseOptions;
|
|
3707
|
+
}
|
|
3708
|
+
localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
|
|
3709
|
+
localVarHeaderParameter = {};
|
|
3710
|
+
localVarQueryParameter = {};
|
|
3711
|
+
// authentication HTTPBearer required
|
|
3712
|
+
// http bearer authentication required
|
|
3713
|
+
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
|
|
3714
|
+
case 1:
|
|
3715
|
+
// authentication HTTPBearer required
|
|
3716
|
+
// http bearer authentication required
|
|
3717
|
+
_a.sent();
|
|
3718
|
+
if (agentId !== undefined) {
|
|
3719
|
+
localVarQueryParameter['agent_id'] = agentId;
|
|
3720
|
+
}
|
|
3721
|
+
if (redirectUri !== undefined) {
|
|
3722
|
+
localVarQueryParameter['redirect_uri'] = redirectUri;
|
|
3723
|
+
}
|
|
3724
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
3725
|
+
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3726
|
+
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
3727
|
+
return [2 /*return*/, {
|
|
3728
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
3729
|
+
options: localVarRequestOptions,
|
|
3730
|
+
}];
|
|
3731
|
+
}
|
|
3732
|
+
});
|
|
3733
|
+
});
|
|
3734
|
+
},
|
|
3735
|
+
/**
|
|
3736
|
+
* Handle Twitter OAuth2 callback. This endpoint is called by Twitter after the user authorizes the application. It exchanges the authorization code for access and refresh tokens, then stores them in the database. **Query Parameters:** * `state` - URL-encoded state containing agent_id and redirect_uri * `code` - Authorization code from Twitter * `error` - Error message from Twitter (optional) **Returns:** * JSONResponse or RedirectResponse depending on redirect_uri
|
|
3737
|
+
* @summary Twitter Oauth Callback
|
|
3738
|
+
* @param {string} state
|
|
3739
|
+
* @param {string | null} [code]
|
|
3740
|
+
* @param {string | null} [error]
|
|
3741
|
+
* @param {*} [options] Override http request option.
|
|
3742
|
+
* @throws {RequiredError}
|
|
3743
|
+
*/
|
|
3744
|
+
twitterOauthCallbackOauthTwitterCallbackGet: function (state_1, code_1, error_1) {
|
|
3745
|
+
var args_1 = [];
|
|
3746
|
+
for (var _i = 3; _i < arguments.length; _i++) {
|
|
3747
|
+
args_1[_i - 3] = arguments[_i];
|
|
3748
|
+
}
|
|
3749
|
+
return __awaiter(_this, __spreadArray([state_1, code_1, error_1], args_1, true), void 0, function (state, code, error, options) {
|
|
3750
|
+
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
3751
|
+
if (options === void 0) { options = {}; }
|
|
3752
|
+
return __generator(this, function (_a) {
|
|
3753
|
+
// verify required parameter 'state' is not null or undefined
|
|
3754
|
+
(0, common_1.assertParamExists)('twitterOauthCallbackOauthTwitterCallbackGet', 'state', state);
|
|
3755
|
+
localVarPath = "/oauth/twitter/callback";
|
|
3756
|
+
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
3757
|
+
if (configuration) {
|
|
3758
|
+
baseOptions = configuration.baseOptions;
|
|
3759
|
+
}
|
|
3760
|
+
localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
|
|
3761
|
+
localVarHeaderParameter = {};
|
|
3762
|
+
localVarQueryParameter = {};
|
|
3763
|
+
if (state !== undefined) {
|
|
3764
|
+
localVarQueryParameter['state'] = state;
|
|
3765
|
+
}
|
|
3766
|
+
if (code !== undefined) {
|
|
3767
|
+
localVarQueryParameter['code'] = code;
|
|
3768
|
+
}
|
|
3769
|
+
if (error !== undefined) {
|
|
3770
|
+
localVarQueryParameter['error'] = error;
|
|
3771
|
+
}
|
|
3772
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
3773
|
+
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3774
|
+
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
3775
|
+
return [2 /*return*/, {
|
|
3776
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
3777
|
+
options: localVarRequestOptions,
|
|
3778
|
+
}];
|
|
3779
|
+
});
|
|
3780
|
+
});
|
|
3781
|
+
},
|
|
3782
|
+
};
|
|
3783
|
+
};
|
|
3784
|
+
exports.OAuthApiAxiosParamCreator = OAuthApiAxiosParamCreator;
|
|
3785
|
+
/**
|
|
3786
|
+
* OAuthApi - functional programming interface
|
|
3787
|
+
* @export
|
|
3788
|
+
*/
|
|
3789
|
+
var OAuthApiFp = function (configuration) {
|
|
3790
|
+
var localVarAxiosParamCreator = (0, exports.OAuthApiAxiosParamCreator)(configuration);
|
|
3791
|
+
return {
|
|
3792
|
+
/**
|
|
3793
|
+
* Get Twitter OAuth2 authorization URL. **Query Parameters:** * `agent_id` - ID of the agent to authenticate * `redirect_uri` - DApp URI to redirect to after authorization from agentkit to DApp **Returns:** * Object containing agent_id and authorization URL
|
|
3794
|
+
* @summary Get Twitter Auth Url
|
|
3795
|
+
* @param {string} agentId
|
|
3796
|
+
* @param {string} redirectUri
|
|
3797
|
+
* @param {*} [options] Override http request option.
|
|
3798
|
+
* @throws {RequiredError}
|
|
3799
|
+
*/
|
|
3800
|
+
getTwitterAuthUrlOauthTwitterGet: function (agentId, redirectUri, options) {
|
|
3801
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3802
|
+
var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
|
|
3803
|
+
var _a, _b, _c;
|
|
3804
|
+
return __generator(this, function (_d) {
|
|
3805
|
+
switch (_d.label) {
|
|
3806
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.getTwitterAuthUrlOauthTwitterGet(agentId, redirectUri, options)];
|
|
3807
|
+
case 1:
|
|
3808
|
+
localVarAxiosArgs = _d.sent();
|
|
3809
|
+
localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
3810
|
+
localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['OAuthApi.getTwitterAuthUrlOauthTwitterGet']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
3811
|
+
return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
|
|
3812
|
+
}
|
|
3813
|
+
});
|
|
3814
|
+
});
|
|
3815
|
+
},
|
|
3816
|
+
/**
|
|
3817
|
+
* Handle Twitter OAuth2 callback. This endpoint is called by Twitter after the user authorizes the application. It exchanges the authorization code for access and refresh tokens, then stores them in the database. **Query Parameters:** * `state` - URL-encoded state containing agent_id and redirect_uri * `code` - Authorization code from Twitter * `error` - Error message from Twitter (optional) **Returns:** * JSONResponse or RedirectResponse depending on redirect_uri
|
|
3818
|
+
* @summary Twitter Oauth Callback
|
|
3819
|
+
* @param {string} state
|
|
3820
|
+
* @param {string | null} [code]
|
|
3821
|
+
* @param {string | null} [error]
|
|
3822
|
+
* @param {*} [options] Override http request option.
|
|
3823
|
+
* @throws {RequiredError}
|
|
3824
|
+
*/
|
|
3825
|
+
twitterOauthCallbackOauthTwitterCallbackGet: function (state, code, error, options) {
|
|
3826
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3827
|
+
var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
|
|
3828
|
+
var _a, _b, _c;
|
|
3829
|
+
return __generator(this, function (_d) {
|
|
3830
|
+
switch (_d.label) {
|
|
3831
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.twitterOauthCallbackOauthTwitterCallbackGet(state, code, error, options)];
|
|
3832
|
+
case 1:
|
|
3833
|
+
localVarAxiosArgs = _d.sent();
|
|
3834
|
+
localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
3835
|
+
localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['OAuthApi.twitterOauthCallbackOauthTwitterCallbackGet']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
3836
|
+
return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
|
|
3837
|
+
}
|
|
3838
|
+
});
|
|
3839
|
+
});
|
|
3840
|
+
},
|
|
3841
|
+
};
|
|
3842
|
+
};
|
|
3843
|
+
exports.OAuthApiFp = OAuthApiFp;
|
|
3844
|
+
/**
|
|
3845
|
+
* OAuthApi - factory interface
|
|
3846
|
+
* @export
|
|
3847
|
+
*/
|
|
3848
|
+
var OAuthApiFactory = function (configuration, basePath, axios) {
|
|
3849
|
+
var localVarFp = (0, exports.OAuthApiFp)(configuration);
|
|
3850
|
+
return {
|
|
3851
|
+
/**
|
|
3852
|
+
* Get Twitter OAuth2 authorization URL. **Query Parameters:** * `agent_id` - ID of the agent to authenticate * `redirect_uri` - DApp URI to redirect to after authorization from agentkit to DApp **Returns:** * Object containing agent_id and authorization URL
|
|
3853
|
+
* @summary Get Twitter Auth Url
|
|
3854
|
+
* @param {string} agentId
|
|
3855
|
+
* @param {string} redirectUri
|
|
3856
|
+
* @param {*} [options] Override http request option.
|
|
3857
|
+
* @throws {RequiredError}
|
|
3858
|
+
*/
|
|
3859
|
+
getTwitterAuthUrlOauthTwitterGet: function (agentId, redirectUri, options) {
|
|
3860
|
+
return localVarFp.getTwitterAuthUrlOauthTwitterGet(agentId, redirectUri, options).then(function (request) { return request(axios, basePath); });
|
|
3861
|
+
},
|
|
3862
|
+
/**
|
|
3863
|
+
* Handle Twitter OAuth2 callback. This endpoint is called by Twitter after the user authorizes the application. It exchanges the authorization code for access and refresh tokens, then stores them in the database. **Query Parameters:** * `state` - URL-encoded state containing agent_id and redirect_uri * `code` - Authorization code from Twitter * `error` - Error message from Twitter (optional) **Returns:** * JSONResponse or RedirectResponse depending on redirect_uri
|
|
3864
|
+
* @summary Twitter Oauth Callback
|
|
3865
|
+
* @param {string} state
|
|
3866
|
+
* @param {string | null} [code]
|
|
3867
|
+
* @param {string | null} [error]
|
|
3868
|
+
* @param {*} [options] Override http request option.
|
|
3869
|
+
* @throws {RequiredError}
|
|
3870
|
+
*/
|
|
3871
|
+
twitterOauthCallbackOauthTwitterCallbackGet: function (state, code, error, options) {
|
|
3872
|
+
return localVarFp.twitterOauthCallbackOauthTwitterCallbackGet(state, code, error, options).then(function (request) { return request(axios, basePath); });
|
|
3873
|
+
},
|
|
3874
|
+
};
|
|
3875
|
+
};
|
|
3876
|
+
exports.OAuthApiFactory = OAuthApiFactory;
|
|
3877
|
+
/**
|
|
3878
|
+
* OAuthApi - object-oriented interface
|
|
3879
|
+
* @export
|
|
3880
|
+
* @class OAuthApi
|
|
3881
|
+
* @extends {BaseAPI}
|
|
3882
|
+
*/
|
|
3883
|
+
var OAuthApi = /** @class */ (function (_super) {
|
|
3884
|
+
__extends(OAuthApi, _super);
|
|
3885
|
+
function OAuthApi() {
|
|
3886
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
3887
|
+
}
|
|
3888
|
+
/**
|
|
3889
|
+
* Get Twitter OAuth2 authorization URL. **Query Parameters:** * `agent_id` - ID of the agent to authenticate * `redirect_uri` - DApp URI to redirect to after authorization from agentkit to DApp **Returns:** * Object containing agent_id and authorization URL
|
|
3890
|
+
* @summary Get Twitter Auth Url
|
|
3891
|
+
* @param {string} agentId
|
|
3892
|
+
* @param {string} redirectUri
|
|
3893
|
+
* @param {*} [options] Override http request option.
|
|
3894
|
+
* @throws {RequiredError}
|
|
3895
|
+
* @memberof OAuthApi
|
|
3896
|
+
*/
|
|
3897
|
+
OAuthApi.prototype.getTwitterAuthUrlOauthTwitterGet = function (agentId, redirectUri, options) {
|
|
3898
|
+
var _this = this;
|
|
3899
|
+
return (0, exports.OAuthApiFp)(this.configuration).getTwitterAuthUrlOauthTwitterGet(agentId, redirectUri, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
3900
|
+
};
|
|
3901
|
+
/**
|
|
3902
|
+
* Handle Twitter OAuth2 callback. This endpoint is called by Twitter after the user authorizes the application. It exchanges the authorization code for access and refresh tokens, then stores them in the database. **Query Parameters:** * `state` - URL-encoded state containing agent_id and redirect_uri * `code` - Authorization code from Twitter * `error` - Error message from Twitter (optional) **Returns:** * JSONResponse or RedirectResponse depending on redirect_uri
|
|
3903
|
+
* @summary Twitter Oauth Callback
|
|
3904
|
+
* @param {string} state
|
|
3905
|
+
* @param {string | null} [code]
|
|
3906
|
+
* @param {string | null} [error]
|
|
3907
|
+
* @param {*} [options] Override http request option.
|
|
3908
|
+
* @throws {RequiredError}
|
|
3909
|
+
* @memberof OAuthApi
|
|
3910
|
+
*/
|
|
3911
|
+
OAuthApi.prototype.twitterOauthCallbackOauthTwitterCallbackGet = function (state, code, error, options) {
|
|
3912
|
+
var _this = this;
|
|
3913
|
+
return (0, exports.OAuthApiFp)(this.configuration).twitterOauthCallbackOauthTwitterCallbackGet(state, code, error, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
3914
|
+
};
|
|
3915
|
+
return OAuthApi;
|
|
3916
|
+
}(base_1.BaseAPI));
|
|
3917
|
+
exports.OAuthApi = OAuthApi;
|
|
3673
3918
|
/**
|
|
3674
3919
|
* UserApi - axios parameter creator
|
|
3675
3920
|
* @export
|
package/dist/base.d.ts
CHANGED
package/dist/base.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Nation IntentKit API
|
|
6
6
|
* API for Nation IntentKit services
|
|
7
7
|
*
|
|
8
|
-
* The version of the OpenAPI document: 0.1.
|
|
8
|
+
* The version of the OpenAPI document: 0.1.30
|
|
9
9
|
*
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/dist/common.d.ts
CHANGED
package/dist/common.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Nation IntentKit API
|
|
6
6
|
* API for Nation IntentKit services
|
|
7
7
|
*
|
|
8
|
-
* The version of the OpenAPI document: 0.1.
|
|
8
|
+
* The version of the OpenAPI document: 0.1.30
|
|
9
9
|
*
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/dist/configuration.d.ts
CHANGED
package/dist/configuration.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Nation IntentKit API
|
|
6
6
|
* API for Nation IntentKit services
|
|
7
7
|
*
|
|
8
|
-
* The version of the OpenAPI document: 0.1.
|
|
8
|
+
* The version of the OpenAPI document: 0.1.30
|
|
9
9
|
*
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Nation IntentKit API
|
|
6
6
|
* API for Nation IntentKit services
|
|
7
7
|
*
|
|
8
|
-
* The version of the OpenAPI document: 0.1.
|
|
8
|
+
* The version of the OpenAPI document: 0.1.30
|
|
9
9
|
*
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -27,8 +27,8 @@ Name | Type | Description | Notes
|
|
|
27
27
|
**supports_presence_penalty** | **boolean** | | [optional] [default to true]
|
|
28
28
|
**api_base** | **string** | | [optional] [default to undefined]
|
|
29
29
|
**timeout** | **number** | | [optional] [default to 180]
|
|
30
|
-
**created_at** | **string** | Timestamp when this data was created | [optional] [default to 2025-07-
|
|
31
|
-
**updated_at** | **string** | Timestamp when this data was updated | [optional] [default to 2025-07-
|
|
30
|
+
**created_at** | **string** | Timestamp when this data was created | [optional] [default to 2025-07-21T09:01:33.564+00:00]
|
|
31
|
+
**updated_at** | **string** | Timestamp when this data was updated | [optional] [default to 2025-07-21T09:01:33.564+00:00]
|
|
32
32
|
**provider_name** | **string** | | [default to undefined]
|
|
33
33
|
|
|
34
34
|
## Example
|
package/docs/OAuthApi.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# OAuthApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *http://localhost*
|
|
4
|
+
|
|
5
|
+
|Method | HTTP request | Description|
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
|[**getTwitterAuthUrlOauthTwitterGet**](#gettwitterauthurloauthtwitterget) | **GET** /oauth/twitter | Get Twitter Auth Url|
|
|
8
|
+
|[**twitterOauthCallbackOauthTwitterCallbackGet**](#twitteroauthcallbackoauthtwittercallbackget) | **GET** /oauth/twitter/callback | Twitter Oauth Callback|
|
|
9
|
+
|
|
10
|
+
# **getTwitterAuthUrlOauthTwitterGet**
|
|
11
|
+
> TwitterAuthResponse getTwitterAuthUrlOauthTwitterGet()
|
|
12
|
+
|
|
13
|
+
Get Twitter OAuth2 authorization URL. **Query Parameters:** * `agent_id` - ID of the agent to authenticate * `redirect_uri` - DApp URI to redirect to after authorization from agentkit to DApp **Returns:** * Object containing agent_id and authorization URL
|
|
14
|
+
|
|
15
|
+
### Example
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import {
|
|
19
|
+
OAuthApi,
|
|
20
|
+
Configuration
|
|
21
|
+
} from '@crestal/nation-sdk';
|
|
22
|
+
|
|
23
|
+
const configuration = new Configuration();
|
|
24
|
+
const apiInstance = new OAuthApi(configuration);
|
|
25
|
+
|
|
26
|
+
let agentId: string; // (default to undefined)
|
|
27
|
+
let redirectUri: string; // (default to undefined)
|
|
28
|
+
|
|
29
|
+
const { status, data } = await apiInstance.getTwitterAuthUrlOauthTwitterGet(
|
|
30
|
+
agentId,
|
|
31
|
+
redirectUri
|
|
32
|
+
);
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Parameters
|
|
36
|
+
|
|
37
|
+
|Name | Type | Description | Notes|
|
|
38
|
+
|------------- | ------------- | ------------- | -------------|
|
|
39
|
+
| **agentId** | [**string**] | | defaults to undefined|
|
|
40
|
+
| **redirectUri** | [**string**] | | defaults to undefined|
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Return type
|
|
44
|
+
|
|
45
|
+
**TwitterAuthResponse**
|
|
46
|
+
|
|
47
|
+
### Authorization
|
|
48
|
+
|
|
49
|
+
[HTTPBearer](../README.md#HTTPBearer)
|
|
50
|
+
|
|
51
|
+
### HTTP request headers
|
|
52
|
+
|
|
53
|
+
- **Content-Type**: Not defined
|
|
54
|
+
- **Accept**: application/json
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
### HTTP response details
|
|
58
|
+
| Status code | Description | Response headers |
|
|
59
|
+
|-------------|-------------|------------------|
|
|
60
|
+
|**200** | Successful Response | - |
|
|
61
|
+
|**422** | Validation Error | - |
|
|
62
|
+
|
|
63
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
64
|
+
|
|
65
|
+
# **twitterOauthCallbackOauthTwitterCallbackGet**
|
|
66
|
+
> any twitterOauthCallbackOauthTwitterCallbackGet()
|
|
67
|
+
|
|
68
|
+
Handle Twitter OAuth2 callback. This endpoint is called by Twitter after the user authorizes the application. It exchanges the authorization code for access and refresh tokens, then stores them in the database. **Query Parameters:** * `state` - URL-encoded state containing agent_id and redirect_uri * `code` - Authorization code from Twitter * `error` - Error message from Twitter (optional) **Returns:** * JSONResponse or RedirectResponse depending on redirect_uri
|
|
69
|
+
|
|
70
|
+
### Example
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
import {
|
|
74
|
+
OAuthApi,
|
|
75
|
+
Configuration
|
|
76
|
+
} from '@crestal/nation-sdk';
|
|
77
|
+
|
|
78
|
+
const configuration = new Configuration();
|
|
79
|
+
const apiInstance = new OAuthApi(configuration);
|
|
80
|
+
|
|
81
|
+
let state: string; // (default to undefined)
|
|
82
|
+
let code: string; // (optional) (default to undefined)
|
|
83
|
+
let error: string; // (optional) (default to undefined)
|
|
84
|
+
|
|
85
|
+
const { status, data } = await apiInstance.twitterOauthCallbackOauthTwitterCallbackGet(
|
|
86
|
+
state,
|
|
87
|
+
code,
|
|
88
|
+
error
|
|
89
|
+
);
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Parameters
|
|
93
|
+
|
|
94
|
+
|Name | Type | Description | Notes|
|
|
95
|
+
|------------- | ------------- | ------------- | -------------|
|
|
96
|
+
| **state** | [**string**] | | defaults to undefined|
|
|
97
|
+
| **code** | [**string**] | | (optional) defaults to undefined|
|
|
98
|
+
| **error** | [**string**] | | (optional) defaults to undefined|
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
### Return type
|
|
102
|
+
|
|
103
|
+
**any**
|
|
104
|
+
|
|
105
|
+
### Authorization
|
|
106
|
+
|
|
107
|
+
No authorization required
|
|
108
|
+
|
|
109
|
+
### HTTP request headers
|
|
110
|
+
|
|
111
|
+
- **Content-Type**: Not defined
|
|
112
|
+
- **Accept**: application/json
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
### HTTP response details
|
|
116
|
+
| Status code | Description | Response headers |
|
|
117
|
+
|-------------|-------------|------------------|
|
|
118
|
+
|**200** | Successful Response | - |
|
|
119
|
+
|**422** | Validation Error | - |
|
|
120
|
+
|
|
121
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
122
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# TwitterAuthResponse
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
|
|
6
|
+
Name | Type | Description | Notes
|
|
7
|
+
------------ | ------------- | ------------- | -------------
|
|
8
|
+
**agent_id** | **string** | | [default to undefined]
|
|
9
|
+
**url** | **string** | | [default to undefined]
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { TwitterAuthResponse } from '@crestal/nation-sdk';
|
|
15
|
+
|
|
16
|
+
const instance: TwitterAuthResponse = {
|
|
17
|
+
agent_id,
|
|
18
|
+
url,
|
|
19
|
+
};
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
package/index.ts
CHANGED