diff --git a/doc/index.html b/doc/index.html index 5ddbed6..491ce6f 100644 --- a/doc/index.html +++ b/doc/index.html @@ -982,47 +982,6 @@ "format" : "int32" } } -}; - defs["analytic_service.SyncExecuteSQLRequest"] = { - "type" : "object", - "properties" : { - "projectOwner" : { - "title" : "username or organization name", - "type" : "string" - }, - "projectSlug" : { - "title" : "project slug", - "type" : "string" - }, - "projectId" : { - "title" : "use project id if project_owner and project_slug are not provided", - "type" : "string" - }, - "version" : { - "title" : "version of the datasource, default to the active version if not provided", - "type" : "integer", - "format" : "int32" - }, - "sqlQuery" : { - "$ref" : "#/components/schemas/analytic_service.SQLQuery" - }, - "cursor" : { - "title" : "cursor for pagination", - "type" : "string" - }, - "bypassCache" : { - "title" : "deprecated, use cachePolicy instead", - "type" : "boolean" - }, - "cachePolicy" : { - "$ref" : "#/components/schemas/common.CachePolicy" - } - }, - "example" : { - "sqlQuery" : { - "sql" : "SELECT uniq(distinct_id) FROM `Transfer`" - } - } }; defs["analytic_service.SyncExecuteSQLResponse"] = { "type" : "object", @@ -4602,9 +4561,6 @@
  • executeSQL
  • -
  • - executeSQL2 -
  • listCoins
  • @@ -5215,435 +5171,6 @@


    -
    -
    -
    -

    executeSQL2

    -

    Execute SQL

    -
    -
    -
    -

    -

    Execute SQL in a project. Go to "Data Studio" -> "SQL Editor", write your query and then click "Export as cURL" - -![screenshot](https://raw.githubusercontent.com/sentioxyz/docs/main/.gitbook/assets/image%20(102).png) - -Find more: https://docs.sentio.xyz/docs/data-api#sql-api

    -

    -
    -
    /api/v1/analytics/sql/execute
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X POST \
    --H "Api-Key: [[apiKey]]" \
    - -H "Accept: application/json" \
    - -H "Content-Type: application/json" \
    - "http://app.sentio.xyz/api/v1/analytics/sql/execute" \
    - -d ''
    -
    -
    -
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.DataApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class DataApiExample {
    -    public static void main(String[] args) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -
    -        // Configure API key authorization: ApiKeyAuth
    -        ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
    -        ApiKeyAuth.setApiKey("YOUR API KEY");
    -        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    -        //ApiKeyAuth.setApiKeyPrefix("Token");
    -
    -        // Create an instance of the API class
    -        DataApi apiInstance = new DataApi();
    -        AnalyticServiceSyncExecuteSQLRequest body = ; // AnalyticServiceSyncExecuteSQLRequest | 
    -
    -        try {
    -            analytic_service.SyncExecuteSQLResponse result = apiInstance.executeSQL2(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling DataApi#executeSQL2");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    -
    - -
    -
    import 'package:openapi/api.dart';
    -
    -final api_instance = DefaultApi();
    -
    -final AnalyticServiceSyncExecuteSQLRequest body = new AnalyticServiceSyncExecuteSQLRequest(); // AnalyticServiceSyncExecuteSQLRequest | 
    -
    -try {
    -    final result = await api_instance.executeSQL2(body);
    -    print(result);
    -} catch (e) {
    -    print('Exception when calling DefaultApi->executeSQL2: $e\n');
    -}
    -
    -
    -
    - -
    -
    import org.openapitools.client.api.DataApi;
    -
    -public class DataApiExample {
    -    public static void main(String[] args) {
    -        DataApi apiInstance = new DataApi();
    -        AnalyticServiceSyncExecuteSQLRequest body = ; // AnalyticServiceSyncExecuteSQLRequest | 
    -
    -        try {
    -            analytic_service.SyncExecuteSQLResponse result = apiInstance.executeSQL2(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling DataApi#executeSQL2");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    Configuration *apiConfig = [Configuration sharedConfig];
    -
    -// Configure API key authorization: (authentication scheme: ApiKeyAuth)
    -[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"Api-Key"];
    -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    -//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"Api-Key"];
    -
    -
    -// Create an instance of the API class
    -DataApi *apiInstance = [[DataApi alloc] init];
    -AnalyticServiceSyncExecuteSQLRequest *body = ; // 
    -
    -// Execute SQL
    -[apiInstance executeSQL2With:body
    -              completionHandler: ^(analytic_service.SyncExecuteSQLResponse output, NSError* error) {
    -    if (output) {
    -        NSLog(@"%@", output);
    -    }
    -    if (error) {
    -        NSLog(@"Error: %@", error);
    -    }
    -}];
    -
    -
    - -
    -
    var SentioApi = require('sentio_api');
    -var defaultClient = SentioApi.ApiClient.instance;
    -
    -// Configure API key authorization: ApiKeyAuth
    -var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
    -ApiKeyAuth.apiKey = "YOUR API KEY";
    -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    -//ApiKeyAuth.apiKeyPrefix['Api-Key'] = "Token";
    -
    -// Create an instance of the API class
    -var api = new SentioApi.DataApi()
    -var body = ; // {AnalyticServiceSyncExecuteSQLRequest} 
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.executeSQL2(body, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using Org.OpenAPITools.Api;
    -using Org.OpenAPITools.Client;
    -using Org.OpenAPITools.Model;
    -
    -namespace Example
    -{
    -    public class executeSQL2Example
    -    {
    -        public void main()
    -        {
    -            // Configure API key authorization: ApiKeyAuth
    -            Configuration.Default.ApiKey.Add("Api-Key", "YOUR_API_KEY");
    -            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    -            // Configuration.Default.ApiKeyPrefix.Add("Api-Key", "Bearer");
    -
    -            // Create an instance of the API class
    -            var apiInstance = new DataApi();
    -            var body = new AnalyticServiceSyncExecuteSQLRequest(); // AnalyticServiceSyncExecuteSQLRequest | 
    -
    -            try {
    -                // Execute SQL
    -                analytic_service.SyncExecuteSQLResponse result = apiInstance.executeSQL2(body);
    -                Debug.WriteLine(result);
    -            } catch (Exception e) {
    -                Debug.Print("Exception when calling DataApi.executeSQL2: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -// Configure API key authorization: ApiKeyAuth
    -OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('Api-Key', 'YOUR_API_KEY');
    -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    -// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Api-Key', 'Bearer');
    -
    -// Create an instance of the API class
    -$api_instance = new OpenAPITools\Client\Api\DataApi();
    -$body = ; // AnalyticServiceSyncExecuteSQLRequest | 
    -
    -try {
    -    $result = $api_instance->executeSQL2($body);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling DataApi->executeSQL2: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use WWW::OPenAPIClient::Configuration;
    -use WWW::OPenAPIClient::DataApi;
    -
    -# Configure API key authorization: ApiKeyAuth
    -$WWW::OPenAPIClient::Configuration::api_key->{'Api-Key'} = 'YOUR_API_KEY';
    -# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    -#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'Api-Key'} = "Bearer";
    -
    -# Create an instance of the API class
    -my $api_instance = WWW::OPenAPIClient::DataApi->new();
    -my $body = WWW::OPenAPIClient::Object::AnalyticServiceSyncExecuteSQLRequest->new(); # AnalyticServiceSyncExecuteSQLRequest | 
    -
    -eval {
    -    my $result = $api_instance->executeSQL2(body => $body);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling DataApi->executeSQL2: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import openapi_client
    -from openapi_client.rest import ApiException
    -from pprint import pprint
    -
    -# Configure API key authorization: ApiKeyAuth
    -openapi_client.configuration.api_key['Api-Key'] = 'YOUR_API_KEY'
    -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    -# openapi_client.configuration.api_key_prefix['Api-Key'] = 'Bearer'
    -
    -# Create an instance of the API class
    -api_instance = openapi_client.DataApi()
    -body =  # AnalyticServiceSyncExecuteSQLRequest | 
    -
    -try:
    -    # Execute SQL
    -    api_response = api_instance.execute_sql2(body)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling DataApi->executeSQL2: %s\n" % e)
    -
    - -
    -
    extern crate DataApi;
    -
    -pub fn main() {
    -    let body = ; // AnalyticServiceSyncExecuteSQLRequest
    -
    -    let mut context = DataApi::Context::default();
    -    let result = client.executeSQL2(body, &context).wait();
    -
    -    println!("{:?}", result);
    -}
    -
    -
    -
    - -

    Scopes

    - - -
    - -

    Parameters

    - - - -
    Body parameters
    - - - - - - - - - -
    NameDescription
    body * -

    - -
    -
    - - - -

    Responses

    -

    -

    - - - - - - -
    -
    -
    - -
    - -
    -
    -
    -
    -
    diff --git a/openapi.json b/openapi.json index cf79aef..d9c5424 100644 --- a/openapi.json +++ b/openapi.json @@ -12,38 +12,6 @@ "application/json" ], "paths": { - "/api/v1/analytics/sql/execute": { - "post": { - "summary": "Execute SQL", - "description": "Execute SQL in a project. Go to \"Data Studio\" -> \"SQL Editor\", write your query and then click \"Export as cURL\"\n\n![screenshot](https://raw.githubusercontent.com/sentioxyz/docs/main/.gitbook/assets/image%20(102).png)\n\nFind more: https://docs.sentio.xyz/docs/data-api#sql-api", - "operationId": "ExecuteSQL2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/analytic_service.SyncExecuteSQLResponse" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/analytic_service.SyncExecuteSQLRequest" - } - } - ], - "tags": [ - "Data" - ], - "externalDocs": { - "description": "find more information here", - "url": "https://docs.sentio.xyz/docs/data-api#sql-api" - } - } - }, "/api/v1/analytics/{owner}/{slug}/sql/execute": { "post": { "summary": "Execute SQL", @@ -1526,47 +1494,6 @@ } } }, - "analytic_service.SyncExecuteSQLRequest": { - "type": "object", - "example": { - "sqlQuery": { - "sql": "SELECT uniq(distinct_id) FROM `Transfer`" - } - }, - "properties": { - "projectOwner": { - "type": "string", - "title": "username or organization name" - }, - "projectSlug": { - "type": "string", - "title": "project slug" - }, - "projectId": { - "type": "string", - "title": "use project id if project_owner and project_slug are not provided" - }, - "version": { - "type": "integer", - "format": "int32", - "title": "version of the datasource, default to the active version if not provided" - }, - "sqlQuery": { - "$ref": "#/definitions/analytic_service.SQLQuery" - }, - "cursor": { - "type": "string", - "title": "cursor for pagination" - }, - "bypassCache": { - "type": "boolean", - "title": "deprecated, use cachePolicy instead" - }, - "cachePolicy": { - "$ref": "#/definitions/common.CachePolicy" - } - } - }, "analytic_service.SyncExecuteSQLResponse": { "type": "object", "properties": { diff --git a/src/apis/DataApi.ts b/src/apis/DataApi.ts index 7153d07..724d4e8 100644 --- a/src/apis/DataApi.ts +++ b/src/apis/DataApi.ts @@ -18,7 +18,6 @@ import type { AnalyticServiceAnalyticServiceExecuteSQLBody, AnalyticServiceLogQueryResponse, AnalyticServiceSearchServiceQueryLogBody, - AnalyticServiceSyncExecuteSQLRequest, AnalyticServiceSyncExecuteSQLResponse, InsightsServiceInsightsServiceQueryBody, InsightsServiceInsightsServiceRetentionBody, @@ -40,8 +39,6 @@ import { AnalyticServiceLogQueryResponseToJSON, AnalyticServiceSearchServiceQueryLogBodyFromJSON, AnalyticServiceSearchServiceQueryLogBodyToJSON, - AnalyticServiceSyncExecuteSQLRequestFromJSON, - AnalyticServiceSyncExecuteSQLRequestToJSON, AnalyticServiceSyncExecuteSQLResponseFromJSON, AnalyticServiceSyncExecuteSQLResponseToJSON, InsightsServiceInsightsServiceQueryBodyFromJSON, @@ -76,10 +73,6 @@ export interface ExecuteSQLRequest { body: AnalyticServiceAnalyticServiceExecuteSQLBody; } -export interface ExecuteSQL2Request { - body: AnalyticServiceSyncExecuteSQLRequest; -} - export interface ListCoinsRequest { owner: string; slug: string; @@ -227,48 +220,6 @@ export class DataApi extends runtime.BaseAPI { return await response.value(); } - /** - * Execute SQL in a project. Go to \"Data Studio\" -> \"SQL Editor\", write your query and then click \"Export as cURL\" ![screenshot](https://raw.githubusercontent.com/sentioxyz/docs/main/.gitbook/assets/image%20(102).png) Find more: https://docs.sentio.xyz/docs/data-api#sql-api - * Execute SQL - */ - async executeSQL2Raw(requestParameters: ExecuteSQL2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters['body'] == null) { - throw new runtime.RequiredError( - 'body', - 'Required parameter "body" was null or undefined when calling executeSQL2().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Api-Key"] = await this.configuration.apiKey("Api-Key"); // ApiKeyAuth authentication - } - - const response = await this.request({ - path: `/api/v1/analytics/sql/execute`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: AnalyticServiceSyncExecuteSQLRequestToJSON(requestParameters['body']), - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => AnalyticServiceSyncExecuteSQLResponseFromJSON(jsonValue)); - } - - /** - * Execute SQL in a project. Go to \"Data Studio\" -> \"SQL Editor\", write your query and then click \"Export as cURL\" ![screenshot](https://raw.githubusercontent.com/sentioxyz/docs/main/.gitbook/assets/image%20(102).png) Find more: https://docs.sentio.xyz/docs/data-api#sql-api - * Execute SQL - */ - async executeSQL2(requestParameters: ExecuteSQL2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.executeSQL2Raw(requestParameters, initOverrides); - return await response.value(); - } - /** * Get a list of coins in a project. * List coins diff --git a/src/models/AnalyticServiceSyncExecuteSQLRequest.ts b/src/models/AnalyticServiceSyncExecuteSQLRequest.ts deleted file mode 100644 index d2844cc..0000000 --- a/src/models/AnalyticServiceSyncExecuteSQLRequest.ts +++ /dev/null @@ -1,129 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Sentio API - * Sentio Open API for query data - * - * The version of the OpenAPI document: version not set - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime.js'; -import type { AnalyticServiceSQLQuery } from './AnalyticServiceSQLQuery.js'; -import { - AnalyticServiceSQLQueryFromJSON, - AnalyticServiceSQLQueryFromJSONTyped, - AnalyticServiceSQLQueryToJSON, -} from './AnalyticServiceSQLQuery.js'; -import type { CommonCachePolicy } from './CommonCachePolicy.js'; -import { - CommonCachePolicyFromJSON, - CommonCachePolicyFromJSONTyped, - CommonCachePolicyToJSON, -} from './CommonCachePolicy.js'; - -/** - * - * @export - * @interface AnalyticServiceSyncExecuteSQLRequest - */ -export interface AnalyticServiceSyncExecuteSQLRequest { - /** - * - * @type {string} - * @memberof AnalyticServiceSyncExecuteSQLRequest - */ - projectOwner?: string; - /** - * - * @type {string} - * @memberof AnalyticServiceSyncExecuteSQLRequest - */ - projectSlug?: string; - /** - * - * @type {string} - * @memberof AnalyticServiceSyncExecuteSQLRequest - */ - projectId?: string; - /** - * - * @type {number} - * @memberof AnalyticServiceSyncExecuteSQLRequest - */ - version?: number; - /** - * - * @type {AnalyticServiceSQLQuery} - * @memberof AnalyticServiceSyncExecuteSQLRequest - */ - sqlQuery?: AnalyticServiceSQLQuery; - /** - * - * @type {string} - * @memberof AnalyticServiceSyncExecuteSQLRequest - */ - cursor?: string; - /** - * - * @type {boolean} - * @memberof AnalyticServiceSyncExecuteSQLRequest - */ - bypassCache?: boolean; - /** - * - * @type {CommonCachePolicy} - * @memberof AnalyticServiceSyncExecuteSQLRequest - */ - cachePolicy?: CommonCachePolicy; -} - -/** - * Check if a given object implements the AnalyticServiceSyncExecuteSQLRequest interface. - */ -export function instanceOfAnalyticServiceSyncExecuteSQLRequest(value: object): boolean { - return true; -} - -export function AnalyticServiceSyncExecuteSQLRequestFromJSON(json: any): AnalyticServiceSyncExecuteSQLRequest { - return AnalyticServiceSyncExecuteSQLRequestFromJSONTyped(json, false); -} - -export function AnalyticServiceSyncExecuteSQLRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AnalyticServiceSyncExecuteSQLRequest { - if (json == null) { - return json; - } - return { - - 'projectOwner': json['projectOwner'] == null ? undefined : json['projectOwner'], - 'projectSlug': json['projectSlug'] == null ? undefined : json['projectSlug'], - 'projectId': json['projectId'] == null ? undefined : json['projectId'], - 'version': json['version'] == null ? undefined : json['version'], - 'sqlQuery': json['sqlQuery'] == null ? undefined : AnalyticServiceSQLQueryFromJSON(json['sqlQuery']), - 'cursor': json['cursor'] == null ? undefined : json['cursor'], - 'bypassCache': json['bypassCache'] == null ? undefined : json['bypassCache'], - 'cachePolicy': json['cachePolicy'] == null ? undefined : CommonCachePolicyFromJSON(json['cachePolicy']), - }; -} - -export function AnalyticServiceSyncExecuteSQLRequestToJSON(value?: AnalyticServiceSyncExecuteSQLRequest | null): any { - if (value == null) { - return value; - } - return { - - 'projectOwner': value['projectOwner'], - 'projectSlug': value['projectSlug'], - 'projectId': value['projectId'], - 'version': value['version'], - 'sqlQuery': AnalyticServiceSQLQueryToJSON(value['sqlQuery']), - 'cursor': value['cursor'], - 'bypassCache': value['bypassCache'], - 'cachePolicy': CommonCachePolicyToJSON(value['cachePolicy']), - }; -} - diff --git a/src/models/index.ts b/src/models/index.ts index 7579c47..fea2bda 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -6,7 +6,6 @@ export * from './AnalyticServiceLogQueryRequestSort.js'; export * from './AnalyticServiceLogQueryResponse.js'; export * from './AnalyticServiceSQLQuery.js'; export * from './AnalyticServiceSearchServiceQueryLogBody.js'; -export * from './AnalyticServiceSyncExecuteSQLRequest.js'; export * from './AnalyticServiceSyncExecuteSQLResponse.js'; export * from './CommonAggregate.js'; export * from './CommonAggregateAggregateOps.js';