From cee550949ed470e57738e51000f901cb36a4da89 Mon Sep 17 00:00:00 2001 From: "ct-sdks[bot]" <153784748+ct-sdks[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 15:19:00 +0000 Subject: [PATCH] build(codegen): updating SDK --- .changeset/changes_api.md | 2 ++ changes.md | 2 ++ .../by-project-key-graphql-request-builder.ts | 4 +-- .../src/generated/models/graph-ql.ts | 28 ++++++++++++++++++- references.txt | 1 + 5 files changed, 34 insertions(+), 3 deletions(-) diff --git a/.changeset/changes_api.md b/.changeset/changes_api.md index 3e2c59690..bc4aebd63 100644 --- a/.changeset/changes_api.md +++ b/.changeset/changes_api.md @@ -8,6 +8,8 @@ Changed Property(s) - :warning: changed property `value` of type `DirectDiscountDraft` from type `CartDiscountValue` to `CartDiscountValueDraft` +- :warning: changed property `line` of type `GraphQLErrorLocation` from type `integer` to `number` +- :warning: changed property `column` of type `GraphQLErrorLocation` from type `integer` to `number` - :warning: changed property `totalPrice` of type `OrderLineItemDiscountSetMessage` from type `Money` to `CentPrecisionMoney` - :warning: changed property `value` of type `StandalonePriceValueChangedMessage` from type `Money` to `TypedMoney` - :warning: changed property `oldValue` of type `StandalonePriceValueChangedMessage` from type `Money` to `TypedMoney` diff --git a/changes.md b/changes.md index 6b3b86bd6..0628fd422 100644 --- a/changes.md +++ b/changes.md @@ -4,6 +4,8 @@ Changed Property(s) - :warning: changed property `value` of type `DirectDiscountDraft` from type `CartDiscountValue` to `CartDiscountValueDraft` +- :warning: changed property `line` of type `GraphQLErrorLocation` from type `integer` to `number` +- :warning: changed property `column` of type `GraphQLErrorLocation` from type `integer` to `number` - :warning: changed property `totalPrice` of type `OrderLineItemDiscountSetMessage` from type `Money` to `CentPrecisionMoney` - :warning: changed property `value` of type `StandalonePriceValueChangedMessage` from type `Money` to `TypedMoney` - :warning: changed property `oldValue` of type `StandalonePriceValueChangedMessage` from type `Money` to `TypedMoney` diff --git a/packages/platform-sdk/src/generated/client/graphql/by-project-key-graphql-request-builder.ts b/packages/platform-sdk/src/generated/client/graphql/by-project-key-graphql-request-builder.ts index a7c25d8e2..b7574629a 100644 --- a/packages/platform-sdk/src/generated/client/graphql/by-project-key-graphql-request-builder.ts +++ b/packages/platform-sdk/src/generated/client/graphql/by-project-key-graphql-request-builder.ts @@ -19,7 +19,7 @@ export class ByProjectKeyGraphqlRequestBuilder { } ) {} /** - * Execute a GraphQL query + * Execute a GraphQL request. */ public post(methodArgs: { body: GraphQLRequest @@ -34,7 +34,7 @@ export class ByProjectKeyGraphqlRequestBuilder { uriTemplate: '/{projectKey}/graphql', pathVariables: this.args.pathArgs, headers: { - 'Content-Type': 'application/graphql', + 'Content-Type': 'application/json', ...methodArgs?.headers, }, body: methodArgs?.body, diff --git a/packages/platform-sdk/src/generated/models/graph-ql.ts b/packages/platform-sdk/src/generated/models/graph-ql.ts index 2e6ea9815..983b6462c 100644 --- a/packages/platform-sdk/src/generated/models/graph-ql.ts +++ b/packages/platform-sdk/src/generated/models/graph-ql.ts @@ -6,59 +6,85 @@ import { GraphQLErrorObject } from './error' +/** + * Contains an error message, the location of the code that caused the error, and other information to help you correct the error. + */ export interface GraphQLError { /** + * Detailed description of the error explaining the root cause of the problem and suggesting how to correct the error. * */ readonly message: string /** + * Location within your query where the error occurred. * */ readonly locations: GraphQLErrorLocation[] /** + * Query fields listed in order from the root of the query response up to the field in which the error occurred. `path` is displayed in the response only if an error is associated with a particular field in the query result. * */ readonly path?: any[] /** - * Represents a single error. + * Dictionary with additional information where applicable. * */ readonly extensions: GraphQLErrorObject } +/** + * Represents the location within your query where the error occurred. + */ export interface GraphQLErrorLocation { /** + * Line number of the query where the error occurred. * */ readonly line: number /** + * Position in `line` where the error occurred. * */ readonly column: number } +/** + * The query, operation name, and variables that are sent to the GraphQL API. + */ export interface GraphQLRequest { /** + * String representation of the _Source Text_ of the _Document_ that is specified in the [Language section of the GraphQL specification](https://spec.graphql.org/draft/#sec-Language). * */ readonly query: string /** + * Name of the operation, if you defined several operations in `query`. * */ readonly operationName?: string /** + * JSON object that contains key-value pairs in which the keys are variable names and the values are variable values. * */ readonly variables?: GraphQLVariablesMap } +/** + * `error` is present in the response only if the GraphQL query was unsuccessful. + * + */ export interface GraphQLResponse { /** + * JSON object that contains the results of a GraphQL query. * */ readonly data?: any /** + * Errors that the GraphQL query returns. * */ readonly errors?: GraphQLError[] } +/** + * The variables that the GraphQL query uses. + */ export interface GraphQLVariablesMap { [key: string]: any } diff --git a/references.txt b/references.txt index 35dabfb0a..ece87bfe3 100644 --- a/references.txt +++ b/references.txt @@ -337,3 +337,4 @@ ccf4522140c12b0093aefe0e2a27d62bcc4834a6 8e09aa861a0ba58755289bc185dcb268ac4f1c13 0be69283d6aba9d3a2f895140378673f2f80f7b0 605a1ff5cf861ca0d8e2711ca79374804f180b50 +f254d17f05343dcc4299fc53ff9b335b5ef63d69