diff --git a/packages/omniapi-generator/src/generateResource.ts b/packages/omniapi-generator/src/generateResource.ts index 79632d5a1..85cc94017 100644 --- a/packages/omniapi-generator/src/generateResource.ts +++ b/packages/omniapi-generator/src/generateResource.ts @@ -132,12 +132,18 @@ function generateOperationArray(method: StaticOperation) { const requestType = method.requestBody?.body.requestType; const bodyInfo = getReqBodyInfo(requestType); const respInfo = getResponseInfo(method.response); + const paramInfo = getParamInfo(method.parameters); + paramInfo.QUERY.length; + + const flag = (bodyInfo.componentType != null ? 1 : 0) + + (paramInfo.QUERY.length > 0 ? 2 : 0) + + (paramInfo.HEADER.length > 0 ? 4 : 0); let count = 0; const constParts = [ HTTP_VERB_MAP[method.httpMethod], `"${method.path.replace(/{.*?}/g, () => `{${count++}}`)}"`, - bodyInfo.componentType != null ? 1 : "", + flag > 0 ? flag : "", bodyInfo.mimeType, respInfo.mimeType, ]; diff --git a/packages/omniapi/src/public/Datasets_Branch.ts b/packages/omniapi/src/public/Datasets_Branch.ts index 40fafe51f..71a2d34d9 100644 --- a/packages/omniapi/src/public/Datasets_Branch.ts +++ b/packages/omniapi/src/public/Datasets_Branch.ts @@ -26,7 +26,7 @@ const _listBranches: $OmniMethod< datasetRid: $C.DatasetRid, $queryParams?: { pageSize?: $C.PageSize; pageToken?: $C.PageToken }, ) => Promise<$C.ListBranchesResponse> -> = [0, "/v1/datasets/{0}/branches"]; +> = [0, "/v1/datasets/{0}/branches", 2]; /** * Lists the Branches of a Dataset. diff --git a/packages/omniapi/src/public/Datasets_Dataset.ts b/packages/omniapi/src/public/Datasets_Dataset.ts index 4f6275495..06ae26531 100644 --- a/packages/omniapi/src/public/Datasets_Dataset.ts +++ b/packages/omniapi/src/public/Datasets_Dataset.ts @@ -71,7 +71,7 @@ const _readTable: $OmniMethod< rowLimit?: number; }, ) => Promise -> = [0, "/v1/datasets/{0}/readTable", , , "*/*"]; +> = [0, "/v1/datasets/{0}/readTable", 2, , "*/*"]; /** * Gets the content of a dataset as a table in the specified format. @@ -110,7 +110,7 @@ const _getSchema: $OmniMethod< preview?: $C.PreviewMode; }, ) => Promise -> = [0, "/v1/datasets/{0}/schema"]; +> = [0, "/v1/datasets/{0}/schema", 2]; /** * Retrieves the Schema for a Dataset and Branch, if it exists. @@ -139,7 +139,7 @@ const _putSchema: $OmniMethod< $body: any, $queryParams?: { branchId?: $C.BranchId; preview?: $C.PreviewMode }, ) => Promise -> = [2, "/v1/datasets/{0}/schema", 1]; +> = [2, "/v1/datasets/{0}/schema", 3]; /** * Puts a Schema on an existing Dataset and Branch. @@ -167,7 +167,7 @@ const _deleteSchema: $OmniMethod< preview?: $C.PreviewMode; }, ) => Promise -> = [3, "/v1/datasets/{0}/schema"]; +> = [3, "/v1/datasets/{0}/schema", 2]; /** * Deletes the Schema from a Dataset and Branch. diff --git a/packages/omniapi/src/public/Datasets_File.ts b/packages/omniapi/src/public/Datasets_File.ts index b287961a2..5b1c52d36 100644 --- a/packages/omniapi/src/public/Datasets_File.ts +++ b/packages/omniapi/src/public/Datasets_File.ts @@ -32,7 +32,7 @@ const _listFiles: $OmniMethod< pageToken?: $C.PageToken; }, ) => Promise<$C.ListFilesResponse> -> = [0, "/v1/datasets/{0}/files"]; +> = [0, "/v1/datasets/{0}/files", 2]; /** * Lists Files contained in a Dataset. By default files are listed on the latest view of the default @@ -92,7 +92,7 @@ const _uploadFile: $OmniMethod< transactionRid?: $C.TransactionRid; }, ) => Promise<$C.File> -> = [1, "/v1/datasets/{0}/files:upload", , "*/*"]; +> = [1, "/v1/datasets/{0}/files:upload", 2, "*/*"]; /** * Uploads a File to an existing Dataset. @@ -145,7 +145,7 @@ const _getFileMetadata: $OmniMethod< endTransactionRid?: $C.TransactionRid; }, ) => Promise<$C.File> -> = [0, "/v1/datasets/{0}/files/{1}"]; +> = [0, "/v1/datasets/{0}/files/{1}", 2]; /** * Gets metadata about a File contained in a Dataset. By default this retrieves the file's metadata from the latest @@ -201,7 +201,7 @@ const _deleteFile: $OmniMethod< transactionRid?: $C.TransactionRid; }, ) => Promise -> = [3, "/v1/datasets/{0}/files/{1}"]; +> = [3, "/v1/datasets/{0}/files/{1}", 2]; /** * Deletes a File from a Dataset. By default the file is deleted in a new transaction on the default @@ -249,7 +249,7 @@ const _getFileContent: $OmniMethod< endTransactionRid?: $C.TransactionRid; }, ) => Promise -> = [0, "/v1/datasets/{0}/files/{1}/content", , , "*/*"]; +> = [0, "/v1/datasets/{0}/files/{1}/content", 2, , "*/*"]; /** * Gets the content of a File contained in a Dataset. By default this retrieves the file's content from the latest diff --git a/packages/omniapi/src/public/Datasets_Transaction.ts b/packages/omniapi/src/public/Datasets_Transaction.ts index ac2083d5a..7ca33ee52 100644 --- a/packages/omniapi/src/public/Datasets_Transaction.ts +++ b/packages/omniapi/src/public/Datasets_Transaction.ts @@ -27,7 +27,7 @@ const _createTransaction: $OmniMethod< $body: $C.CreateTransactionRequest, $queryParams?: { branchId?: $C.BranchId }, ) => Promise<$C.Transaction> -> = [1, "/v1/datasets/{0}/transactions", 1]; +> = [1, "/v1/datasets/{0}/transactions", 3]; /** * Creates a Transaction on a Branch of a Dataset. diff --git a/packages/omniapi/src/public/Models_LanguageModel.ts b/packages/omniapi/src/public/Models_LanguageModel.ts index 48a91f94e..9d880ea02 100644 --- a/packages/omniapi/src/public/Models_LanguageModel.ts +++ b/packages/omniapi/src/public/Models_LanguageModel.ts @@ -66,7 +66,7 @@ const _listLanguageModels: $OmniMethod< ($queryParams?: { source?: $C.LanguageModelSource; }) => Promise<$C.ListLanguageModelsResponse> -> = [0, "/v1/models/languageModels"]; +> = [0, "/v1/models/languageModels", 2]; /** * Lists the language models available. Can be filtered by source. diff --git a/packages/omniapi/src/public/OntologiesV2_Action.ts b/packages/omniapi/src/public/OntologiesV2_Action.ts index 7ccfd1858..093f2d06c 100644 --- a/packages/omniapi/src/public/OntologiesV2_Action.ts +++ b/packages/omniapi/src/public/OntologiesV2_Action.ts @@ -31,7 +31,7 @@ const _applyActionV2: $OmniMethod< packageName?: $C.SdkPackageName; }, ) => Promise<$C.SyncApplyActionResponseV2> -> = [1, "/v2/ontologies/{0}/actions/{1}/apply", 1]; +> = [1, "/v2/ontologies/{0}/actions/{1}/apply", 3]; /** * Applies an action using the given parameters. @@ -72,7 +72,7 @@ const _applyActionBatchV2: $OmniMethod< packageName?: $C.SdkPackageName; }, ) => Promise<$C.BatchApplyActionResponseV2> -> = [1, "/v2/ontologies/{0}/actions/{1}/applyBatch", 1]; +> = [1, "/v2/ontologies/{0}/actions/{1}/applyBatch", 3]; /** * Applies multiple actions (of the same Action Type) using the given parameters. @@ -112,7 +112,7 @@ const _applyActionAsyncV2: $OmniMethod< packageName?: $C.SdkPackageName; }, ) => Promise<$C.AsyncApplyActionResponseV2> -> = [1, "/v2/ontologies/{0}/actions/{1}/applyAsync", 1]; +> = [1, "/v2/ontologies/{0}/actions/{1}/applyAsync", 3]; /** * Applies an action using the given parameters. diff --git a/packages/omniapi/src/public/OntologiesV2_ActionTypeV2.ts b/packages/omniapi/src/public/OntologiesV2_ActionTypeV2.ts index 8b46ef29d..103e02560 100644 --- a/packages/omniapi/src/public/OntologiesV2_ActionTypeV2.ts +++ b/packages/omniapi/src/public/OntologiesV2_ActionTypeV2.ts @@ -26,7 +26,7 @@ const _listActionTypesV2: $OmniMethod< ontology: $C.OntologyIdentifier, $queryParams?: { pageSize?: $C.PageSize; pageToken?: $C.PageToken }, ) => Promise<$C.ListActionTypesResponseV2> -> = [0, "/v2/ontologies/{0}/actionTypes"]; +> = [0, "/v2/ontologies/{0}/actionTypes", 2]; /** * Lists the action types for the given Ontology. diff --git a/packages/omniapi/src/public/OntologiesV2_ObjectTypeV2.ts b/packages/omniapi/src/public/OntologiesV2_ObjectTypeV2.ts index 1ff5c54ae..9ec9a2d8e 100644 --- a/packages/omniapi/src/public/OntologiesV2_ObjectTypeV2.ts +++ b/packages/omniapi/src/public/OntologiesV2_ObjectTypeV2.ts @@ -26,7 +26,7 @@ const _listObjectTypesV2: $OmniMethod< ontology: $C.OntologyIdentifier, $queryParams?: { pageSize?: $C.PageSize; pageToken?: $C.PageToken }, ) => Promise<$C.ListObjectTypesV2Response> -> = [0, "/v2/ontologies/{0}/objectTypes"]; +> = [0, "/v2/ontologies/{0}/objectTypes", 2]; /** * Lists the object types for the given Ontology. @@ -79,7 +79,7 @@ const _listOutgoingLinkTypesV2: $OmniMethod< objectType: $C.ObjectTypeApiName, $queryParams?: { pageSize?: $C.PageSize; pageToken?: $C.PageToken }, ) => Promise<$C.ListOutgoingLinkTypesResponseV2> -> = [0, "/v2/ontologies/{0}/objectTypes/{1}/outgoingLinkTypes"]; +> = [0, "/v2/ontologies/{0}/objectTypes/{1}/outgoingLinkTypes", 2]; /** * List the outgoing links for an object type. diff --git a/packages/omniapi/src/public/OntologiesV2_OntologyObjectSet.ts b/packages/omniapi/src/public/OntologiesV2_OntologyObjectSet.ts index 2896ae7ec..329df6e2e 100644 --- a/packages/omniapi/src/public/OntologiesV2_OntologyObjectSet.ts +++ b/packages/omniapi/src/public/OntologiesV2_OntologyObjectSet.ts @@ -52,7 +52,7 @@ const _loadObjectSetV2: $OmniMethod< packageName?: $C.SdkPackageName; }, ) => Promise<$C.LoadObjectSetResponseV2> -> = [1, "/v2/ontologies/{0}/objectSets/loadObjects", 1]; +> = [1, "/v2/ontologies/{0}/objectSets/loadObjects", 3]; /** * Load the ontology objects present in the `ObjectSet` from the provided object set definition. @@ -91,7 +91,7 @@ const _aggregateObjectSetV2: $OmniMethod< preview?: $C.PreviewMode; }, ) => Promise<$C.AggregateObjectsResponseV2> -> = [1, "/v2/ontologies/{0}/objectSets/aggregate", 1]; +> = [1, "/v2/ontologies/{0}/objectSets/aggregate", 3]; /** * Aggregates the ontology objects present in the `ObjectSet` from the provided object set definition. diff --git a/packages/omniapi/src/public/OntologiesV2_OntologyObjectV2.ts b/packages/omniapi/src/public/OntologiesV2_OntologyObjectV2.ts index 38e605d33..f1c45f5e7 100644 --- a/packages/omniapi/src/public/OntologiesV2_OntologyObjectV2.ts +++ b/packages/omniapi/src/public/OntologiesV2_OntologyObjectV2.ts @@ -35,7 +35,7 @@ const _listObjectsV2: $OmniMethod< excludeRid?: boolean; }, ) => Promise<$C.ListObjectsResponseV2> -> = [0, "/v2/ontologies/{0}/objects/{1}"]; +> = [0, "/v2/ontologies/{0}/objects/{1}", 2]; /** * Lists the objects for the given Ontology and object type. @@ -89,7 +89,7 @@ const _getObjectV2: $OmniMethod< excludeRid?: boolean; }, ) => Promise<$C.OntologyObjectV2> -> = [0, "/v2/ontologies/{0}/objects/{1}/{2}"]; +> = [0, "/v2/ontologies/{0}/objects/{1}/{2}", 2]; /** * Gets a specific object with the given primary key. @@ -126,7 +126,7 @@ const _countObjects: $OmniMethod< packageName?: $C.SdkPackageName; }, ) => Promise<$C.CountObjectsResponseV2> -> = [1, "/v2/ontologies/{0}/objects/{1}/count"]; +> = [1, "/v2/ontologies/{0}/objects/{1}/count", 2]; /** * Returns a count of the objects of the given object type. @@ -161,7 +161,7 @@ const _searchObjectsV2: $OmniMethod< packageName?: $C.SdkPackageName; }, ) => Promise<$C.SearchObjectsResponseV2> -> = [1, "/v2/ontologies/{0}/objects/{1}/search", 1]; +> = [1, "/v2/ontologies/{0}/objects/{1}/search", 3]; /** * Search for objects in the specified ontology and object type. The request body is used @@ -216,7 +216,7 @@ const _aggregateObjectsV2: $OmniMethod< preview?: $C.PreviewMode; }, ) => Promise<$C.AggregateObjectsResponseV2> -> = [1, "/v2/ontologies/{0}/objects/{1}/aggregate", 1]; +> = [1, "/v2/ontologies/{0}/objects/{1}/aggregate", 3]; /** * Perform functions on object fields in the specified ontology and object type. @@ -251,7 +251,7 @@ const _listInterfaceTypes: $OmniMethod< preview?: $C.PreviewMode; }, ) => Promise<$C.ListInterfaceTypesResponse> -> = [0, "/v2/ontologies/{0}/interfaceTypes"]; +> = [0, "/v2/ontologies/{0}/interfaceTypes", 2]; /** * :::callout{theme=warning title=Warning} @@ -290,7 +290,7 @@ const _getInterfaceType: $OmniMethod< interfaceType: $C.InterfaceTypeApiName, $queryParams?: { preview?: $C.PreviewMode }, ) => Promise<$C.InterfaceType> -> = [0, "/v2/ontologies/{0}/interfaceTypes/{1}"]; +> = [0, "/v2/ontologies/{0}/interfaceTypes/{1}", 2]; /** * :::callout{theme=warning title=Warning} @@ -324,7 +324,7 @@ const _searchObjectsForInterface: $OmniMethod< $body: $C.SearchObjectsForInterfaceRequest, $queryParams?: { preview?: $C.PreviewMode }, ) => Promise<$C.SearchObjectsResponseV2> -> = [1, "/v2/ontologies/{0}/interfaces/{1}/search", 1]; +> = [1, "/v2/ontologies/{0}/interfaces/{1}/search", 3]; /** * :::callout{theme=warning title=Warning} @@ -379,7 +379,7 @@ const _aggregateObjectsForInterface: $OmniMethod< $body: $C.AggregateObjectsRequestV2, $queryParams?: { preview?: $C.PreviewMode }, ) => Promise<$C.AggregateObjectsResponseV2> -> = [1, "/v2/ontologies/{0}/interfaces/{1}/aggregate", 1]; +> = [1, "/v2/ontologies/{0}/interfaces/{1}/aggregate", 3]; /** * :::callout{theme=warning title=Warning} @@ -423,7 +423,7 @@ const _listLinkedObjectsV2: $OmniMethod< excludeRid?: boolean; }, ) => Promise<$C.ListLinkedObjectsResponseV2> -> = [0, "/v2/ontologies/{0}/objects/{1}/{2}/links/{3}"]; +> = [0, "/v2/ontologies/{0}/objects/{1}/{2}/links/{3}", 2]; /** * Lists the linked objects for a specific object and the given link type. @@ -481,7 +481,7 @@ const _getLinkedObjectV2: $OmniMethod< excludeRid?: boolean; }, ) => Promise<$C.OntologyObjectV2> -> = [0, "/v2/ontologies/{0}/objects/{1}/{2}/links/{3}/{4}"]; +> = [0, "/v2/ontologies/{0}/objects/{1}/{2}/links/{3}/{4}", 2]; /** * Get a specific linked object that originates from another object. @@ -524,7 +524,7 @@ const _getAttachmentsV2: $OmniMethod< packageName?: $C.SdkPackageName; }, ) => Promise<$C.AttachmentMetadataResponse> -> = [0, "/v2/ontologies/{0}/objects/{1}/{2}/attachments/{3}"]; +> = [0, "/v2/ontologies/{0}/objects/{1}/{2}/attachments/{3}", 2]; /** * Get the metadata of attachments parented to the given object. @@ -564,7 +564,7 @@ const _getAttachmentByRidV2: $OmniMethod< packageName?: $C.SdkPackageName; }, ) => Promise<$C.AttachmentV2> -> = [0, "/v2/ontologies/{0}/objects/{1}/{2}/attachments/{3}/{4}"]; +> = [0, "/v2/ontologies/{0}/objects/{1}/{2}/attachments/{3}/{4}", 2]; /** * Get the metadata of a particular attachment in an attachment list. @@ -607,7 +607,7 @@ const _getAttachmentContentV2: $OmniMethod< > = [ 0, "/v2/ontologies/{0}/objects/{1}/{2}/attachments/{3}/content", - , + 2, , "*/*", ]; @@ -653,7 +653,7 @@ const _getAttachmentContentByRidV2: $OmniMethod< > = [ 0, "/v2/ontologies/{0}/objects/{1}/{2}/attachments/{3}/{4}/content", - , + 2, , "*/*", ]; @@ -698,7 +698,7 @@ const _getFirstPoint: $OmniMethod< packageName?: $C.SdkPackageName; }, ) => Promise<$C.TimeSeriesPoint | undefined> -> = [0, "/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/firstPoint"]; +> = [0, "/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/firstPoint", 2]; /** * Get the first point of a time series property. @@ -737,7 +737,7 @@ const _getLastPoint: $OmniMethod< packageName?: $C.SdkPackageName; }, ) => Promise<$C.TimeSeriesPoint | undefined> -> = [0, "/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/lastPoint"]; +> = [0, "/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/lastPoint", 2]; /** * Get the last point of a time series property. @@ -780,7 +780,7 @@ const _streamPoints: $OmniMethod< > = [ 1, "/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/streamPoints", - 1, + 3, , "*/*", ]; diff --git a/packages/omniapi/src/public/OntologiesV2_QueryType.ts b/packages/omniapi/src/public/OntologiesV2_QueryType.ts index 227ec966b..2cd7392e0 100644 --- a/packages/omniapi/src/public/OntologiesV2_QueryType.ts +++ b/packages/omniapi/src/public/OntologiesV2_QueryType.ts @@ -26,7 +26,7 @@ const _listQueryTypesV2: $OmniMethod< ontology: $C.OntologyIdentifier, $queryParams?: { pageSize?: $C.PageSize; pageToken?: $C.PageToken }, ) => Promise<$C.ListQueryTypesResponseV2> -> = [0, "/v2/ontologies/{0}/queryTypes"]; +> = [0, "/v2/ontologies/{0}/queryTypes", 2]; /** * Lists the query types for the given Ontology. @@ -82,7 +82,7 @@ const _executeQueryV2: $OmniMethod< packageName?: $C.SdkPackageName; }, ) => Promise<$C.ExecuteQueryResponse> -> = [1, "/v2/ontologies/{0}/queries/{1}/execute", 1]; +> = [1, "/v2/ontologies/{0}/queries/{1}/execute", 3]; /** * Executes a Query using the given parameters.