Преглед изворни кода

chore: Improve codegen config for Mollie types (#3089)

Philipp Sonntag пре 1 година
родитељ
комит
eda6f20dce

+ 0 - 193
packages/core/e2e/graphql/generated-e2e-admin-types.ts

@@ -6422,28 +6422,6 @@ export type AssignAssetsToChannelMutation = {
     }>;
 };
 
-export type CanCreateCustomerMutationVariables = Exact<{
-    input: CreateCustomerInput;
-}>;
-
-export type CanCreateCustomerMutation = { createCustomer: { id: string } | {} };
-
-export type GetCustomerCountQueryVariables = Exact<{ [key: string]: never }>;
-
-export type GetCustomerCountQuery = { customers: { totalItems: number } };
-
-export type DeepFieldResolutionTestQueryQueryVariables = Exact<{ [key: string]: never }>;
-
-export type DeepFieldResolutionTestQueryQuery = {
-    product?: {
-        variants: Array<{
-            taxRateApplied: {
-                customerGroup?: { customers: { items: Array<{ id: string; emailAddress: string }> } } | null;
-            };
-        }>;
-    } | null;
-};
-
 export type AuthenticateMutationVariables = Exact<{
     input: AuthenticationInput;
 }>;
@@ -15414,177 +15392,6 @@ export const AssignAssetsToChannelDocument = {
         },
     ],
 } as unknown as DocumentNode<AssignAssetsToChannelMutation, AssignAssetsToChannelMutationVariables>;
-export const CanCreateCustomerDocument = {
-    kind: 'Document',
-    definitions: [
-        {
-            kind: 'OperationDefinition',
-            operation: 'mutation',
-            name: { kind: 'Name', value: 'CanCreateCustomer' },
-            variableDefinitions: [
-                {
-                    kind: 'VariableDefinition',
-                    variable: { kind: 'Variable', name: { kind: 'Name', value: 'input' } },
-                    type: {
-                        kind: 'NonNullType',
-                        type: { kind: 'NamedType', name: { kind: 'Name', value: 'CreateCustomerInput' } },
-                    },
-                },
-            ],
-            selectionSet: {
-                kind: 'SelectionSet',
-                selections: [
-                    {
-                        kind: 'Field',
-                        name: { kind: 'Name', value: 'createCustomer' },
-                        arguments: [
-                            {
-                                kind: 'Argument',
-                                name: { kind: 'Name', value: 'input' },
-                                value: { kind: 'Variable', name: { kind: 'Name', value: 'input' } },
-                            },
-                        ],
-                        selectionSet: {
-                            kind: 'SelectionSet',
-                            selections: [
-                                {
-                                    kind: 'InlineFragment',
-                                    typeCondition: {
-                                        kind: 'NamedType',
-                                        name: { kind: 'Name', value: 'Customer' },
-                                    },
-                                    selectionSet: {
-                                        kind: 'SelectionSet',
-                                        selections: [{ kind: 'Field', name: { kind: 'Name', value: 'id' } }],
-                                    },
-                                },
-                            ],
-                        },
-                    },
-                ],
-            },
-        },
-    ],
-} as unknown as DocumentNode<CanCreateCustomerMutation, CanCreateCustomerMutationVariables>;
-export const GetCustomerCountDocument = {
-    kind: 'Document',
-    definitions: [
-        {
-            kind: 'OperationDefinition',
-            operation: 'query',
-            name: { kind: 'Name', value: 'GetCustomerCount' },
-            selectionSet: {
-                kind: 'SelectionSet',
-                selections: [
-                    {
-                        kind: 'Field',
-                        name: { kind: 'Name', value: 'customers' },
-                        selectionSet: {
-                            kind: 'SelectionSet',
-                            selections: [{ kind: 'Field', name: { kind: 'Name', value: 'totalItems' } }],
-                        },
-                    },
-                ],
-            },
-        },
-    ],
-} as unknown as DocumentNode<GetCustomerCountQuery, GetCustomerCountQueryVariables>;
-export const DeepFieldResolutionTestQueryDocument = {
-    kind: 'Document',
-    definitions: [
-        {
-            kind: 'OperationDefinition',
-            operation: 'query',
-            name: { kind: 'Name', value: 'DeepFieldResolutionTestQuery' },
-            selectionSet: {
-                kind: 'SelectionSet',
-                selections: [
-                    {
-                        kind: 'Field',
-                        name: { kind: 'Name', value: 'product' },
-                        arguments: [
-                            {
-                                kind: 'Argument',
-                                name: { kind: 'Name', value: 'id' },
-                                value: { kind: 'StringValue', value: 'T_1', block: false },
-                            },
-                        ],
-                        selectionSet: {
-                            kind: 'SelectionSet',
-                            selections: [
-                                {
-                                    kind: 'Field',
-                                    name: { kind: 'Name', value: 'variants' },
-                                    selectionSet: {
-                                        kind: 'SelectionSet',
-                                        selections: [
-                                            {
-                                                kind: 'Field',
-                                                name: { kind: 'Name', value: 'taxRateApplied' },
-                                                selectionSet: {
-                                                    kind: 'SelectionSet',
-                                                    selections: [
-                                                        {
-                                                            kind: 'Field',
-                                                            name: { kind: 'Name', value: 'customerGroup' },
-                                                            selectionSet: {
-                                                                kind: 'SelectionSet',
-                                                                selections: [
-                                                                    {
-                                                                        kind: 'Field',
-                                                                        name: {
-                                                                            kind: 'Name',
-                                                                            value: 'customers',
-                                                                        },
-                                                                        selectionSet: {
-                                                                            kind: 'SelectionSet',
-                                                                            selections: [
-                                                                                {
-                                                                                    kind: 'Field',
-                                                                                    name: {
-                                                                                        kind: 'Name',
-                                                                                        value: 'items',
-                                                                                    },
-                                                                                    selectionSet: {
-                                                                                        kind: 'SelectionSet',
-                                                                                        selections: [
-                                                                                            {
-                                                                                                kind: 'Field',
-                                                                                                name: {
-                                                                                                    kind: 'Name',
-                                                                                                    value: 'id',
-                                                                                                },
-                                                                                            },
-                                                                                            {
-                                                                                                kind: 'Field',
-                                                                                                name: {
-                                                                                                    kind: 'Name',
-                                                                                                    value: 'emailAddress',
-                                                                                                },
-                                                                                            },
-                                                                                        ],
-                                                                                    },
-                                                                                },
-                                                                            ],
-                                                                        },
-                                                                    },
-                                                                ],
-                                                            },
-                                                        },
-                                                    ],
-                                                },
-                                            },
-                                        ],
-                                    },
-                                },
-                            ],
-                        },
-                    },
-                ],
-            },
-        },
-    ],
-} as unknown as DocumentNode<DeepFieldResolutionTestQueryQuery, DeepFieldResolutionTestQueryQueryVariables>;
 export const AuthenticateDocument = {
     kind: 'Document',
     definitions: [

+ 40 - 2
packages/payments-plugin/e2e/graphql/generated-admin-types.ts

@@ -16,9 +16,13 @@ export type Scalars = {
     Boolean: { input: boolean; output: boolean };
     Int: { input: number; output: number };
     Float: { input: number; output: number };
+    /** A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. */
     DateTime: { input: any; output: any };
+    /** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */
     JSON: { input: any; output: any };
+    /** The `Money` scalar type represents monetary values and supports signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point). */
     Money: { input: number; output: number };
+    /** The `Upload` scalar type represents a file upload. */
     Upload: { input: any; output: any };
 };
 
@@ -1617,7 +1621,6 @@ export enum ErrorCode {
     MANUAL_PAYMENT_STATE_ERROR = 'MANUAL_PAYMENT_STATE_ERROR',
     MIME_TYPE_ERROR = 'MIME_TYPE_ERROR',
     MISSING_CONDITIONS_ERROR = 'MISSING_CONDITIONS_ERROR',
-    MOLLIE_PAYMENT_INTENT_ERROR = 'MOLLIE_PAYMENT_INTENT_ERROR',
     MULTIPLE_ORDER_ERROR = 'MULTIPLE_ORDER_ERROR',
     NATIVE_AUTH_STRATEGY_ERROR = 'NATIVE_AUTH_STRATEGY_ERROR',
     NEGATIVE_QUANTITY_ERROR = 'NEGATIVE_QUANTITY_ERROR',
@@ -2601,6 +2604,11 @@ export type ModifyOrderResult =
     | PaymentMethodMissingError
     | RefundPaymentIdMissingError;
 
+export type MollieAmount = {
+    currency?: Maybe<Scalars['String']['output']>;
+    value?: Maybe<Scalars['String']['output']>;
+};
+
 export type MolliePaymentIntent = {
     url: Scalars['String']['output'];
 };
@@ -2636,6 +2644,26 @@ export type MolliePaymentIntentInput = {
 
 export type MolliePaymentIntentResult = MolliePaymentIntent | MolliePaymentIntentError;
 
+export type MolliePaymentMethod = {
+    code: Scalars['String']['output'];
+    description?: Maybe<Scalars['String']['output']>;
+    id: Scalars['ID']['output'];
+    image?: Maybe<MolliePaymentMethodImages>;
+    maximumAmount?: Maybe<MollieAmount>;
+    minimumAmount?: Maybe<MollieAmount>;
+    status?: Maybe<Scalars['String']['output']>;
+};
+
+export type MolliePaymentMethodImages = {
+    size1x?: Maybe<Scalars['String']['output']>;
+    size2x?: Maybe<Scalars['String']['output']>;
+    svg?: Maybe<Scalars['String']['output']>;
+};
+
+export type MolliePaymentMethodsInput = {
+    paymentMethodCode: Scalars['String']['input'];
+};
+
 export type MoveCollectionInput = {
     collectionId: Scalars['ID']['input'];
     index: Scalars['Int']['input'];
@@ -2843,7 +2871,12 @@ export type Mutation = {
     duplicateEntity: DuplicateEntityResult;
     flushBufferedJobs: Success;
     importProducts?: Maybe<ImportInfo>;
-    /** Authenticates the user using the native authentication strategy. This mutation is an alias for `authenticate({ native: { ... }})` */
+    /**
+     * Authenticates the user using the native authentication strategy. This mutation is an alias for authenticate({ native: { ... }})
+     *
+     * The `rememberMe` option applies when using cookie-based sessions, and if `true` it will set the maxAge of the session cookie
+     * to 1 year.
+     */
     login: NativeAuthenticationResult;
     logout: Success;
     /**
@@ -4811,6 +4844,7 @@ export type Query = {
     me?: Maybe<CurrentUser>;
     /** Get metrics for the given interval and metric types. */
     metricSummary: Array<MetricSummary>;
+    molliePaymentMethods: Array<MolliePaymentMethod>;
     order?: Maybe<Order>;
     orders: OrderList;
     paymentMethod?: Maybe<PaymentMethod>;
@@ -4952,6 +4986,10 @@ export type QueryMetricSummaryArgs = {
     input?: InputMaybe<MetricSummaryInput>;
 };
 
+export type QueryMolliePaymentMethodsArgs = {
+    input: MolliePaymentMethodsInput;
+};
+
 export type QueryOrderArgs = {
     id: Scalars['ID']['input'];
 };

+ 10 - 2
packages/payments-plugin/e2e/graphql/generated-shop-types.ts

@@ -16,9 +16,13 @@ export type Scalars = {
     Boolean: { input: boolean; output: boolean };
     Int: { input: number; output: number };
     Float: { input: number; output: number };
+    /** A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. */
     DateTime: { input: any; output: any };
+    /** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */
     JSON: { input: any; output: any };
+    /** The `Money` scalar type represents monetary values and supports signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point). */
     Money: { input: number; output: number };
+    /** The `Upload` scalar type represents a file upload. */
     Upload: { input: any; output: any };
 };
 
@@ -895,7 +899,6 @@ export enum ErrorCode {
     INSUFFICIENT_STOCK_ERROR = 'INSUFFICIENT_STOCK_ERROR',
     INVALID_CREDENTIALS_ERROR = 'INVALID_CREDENTIALS_ERROR',
     MISSING_PASSWORD_ERROR = 'MISSING_PASSWORD_ERROR',
-    MOLLIE_PAYMENT_INTENT_ERROR = 'MOLLIE_PAYMENT_INTENT_ERROR',
     NATIVE_AUTH_STRATEGY_ERROR = 'NATIVE_AUTH_STRATEGY_ERROR',
     NEGATIVE_QUANTITY_ERROR = 'NEGATIVE_QUANTITY_ERROR',
     NOT_VERIFIED_ERROR = 'NOT_VERIFIED_ERROR',
@@ -1706,7 +1709,12 @@ export type Mutation = {
     createMolliePaymentIntent: MolliePaymentIntentResult;
     /** Delete an existing Address */
     deleteCustomerAddress: Success;
-    /** Authenticates the user using the native authentication strategy. This mutation is an alias for `authenticate({ native: { ... }})` */
+    /**
+     * Authenticates the user using the native authentication strategy. This mutation is an alias for authenticate({ native: { ... }})
+     *
+     * The `rememberMe` option applies when using cookie-based sessions, and if `true` it will set the maxAge of the session cookie
+     * to 1 year.
+     */
     login: NativeAuthenticationResult;
     /** End the current authenticated session */
     logout: Success;

+ 10 - 2
packages/payments-plugin/src/mollie/graphql/generated-shop-types.ts

@@ -15,9 +15,13 @@ export type Scalars = {
     Boolean: { input: boolean; output: boolean };
     Int: { input: number; output: number };
     Float: { input: number; output: number };
+    /** A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. */
     DateTime: { input: any; output: any };
+    /** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */
     JSON: { input: any; output: any };
+    /** The `Money` scalar type represents monetary values and supports signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point). */
     Money: { input: number; output: number };
+    /** The `Upload` scalar type represents a file upload. */
     Upload: { input: any; output: any };
 };
 
@@ -926,7 +930,6 @@ export enum ErrorCode {
     INSUFFICIENT_STOCK_ERROR = 'INSUFFICIENT_STOCK_ERROR',
     INVALID_CREDENTIALS_ERROR = 'INVALID_CREDENTIALS_ERROR',
     MISSING_PASSWORD_ERROR = 'MISSING_PASSWORD_ERROR',
-    MOLLIE_PAYMENT_INTENT_ERROR = 'MOLLIE_PAYMENT_INTENT_ERROR',
     NATIVE_AUTH_STRATEGY_ERROR = 'NATIVE_AUTH_STRATEGY_ERROR',
     NEGATIVE_QUANTITY_ERROR = 'NEGATIVE_QUANTITY_ERROR',
     NOT_VERIFIED_ERROR = 'NOT_VERIFIED_ERROR',
@@ -1767,7 +1770,12 @@ export type Mutation = {
     createMolliePaymentIntent: MolliePaymentIntentResult;
     /** Delete an existing Address */
     deleteCustomerAddress: Success;
-    /** Authenticates the user using the native authentication strategy. This mutation is an alias for `authenticate({ native: { ... }})` */
+    /**
+     * Authenticates the user using the native authentication strategy. This mutation is an alias for authenticate({ native: { ... }})
+     *
+     * The `rememberMe` option applies when using cookie-based sessions, and if `true` it will set the maxAge of the session cookie
+     * to 1 year.
+     */
     login: NativeAuthenticationResult;
     /** End the current authenticated session */
     logout: Success;

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
schema-admin.json


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
schema-shop.json


+ 16 - 6
scripts/codegen/generate-graphql-types.ts

@@ -32,6 +32,7 @@ const specFileToIgnore = [
     'active-order-strategy.e2e-spec',
     'error-handler-strategy.e2e-spec',
     'order-multi-vendor.e2e-spec',
+    'auth.e2e-spec',
 ];
 const E2E_ADMIN_QUERY_FILES = path.join(
     __dirname,
@@ -175,7 +176,13 @@ Promise.all([
                 },
                 [path.join(__dirname, '../../packages/payments-plugin/e2e/graphql/generated-admin-types.ts')]:
                     {
-                        schema: [ADMIN_SCHEMA_OUTPUT_FILE],
+                        schema: [
+                            ADMIN_SCHEMA_OUTPUT_FILE,
+                            path.join(
+                                __dirname,
+                                '../../packages/payments-plugin/src/mollie/api-extensions.ts',
+                            ),
+                        ],
                         documents: path.join(
                             __dirname,
                             '../../packages/payments-plugin/e2e/graphql/admin-queries.ts',
@@ -185,7 +192,13 @@ Promise.all([
                     },
                 [path.join(__dirname, '../../packages/payments-plugin/e2e/graphql/generated-shop-types.ts')]:
                     {
-                        schema: [SHOP_SCHEMA_OUTPUT_FILE],
+                        schema: [
+                            SHOP_SCHEMA_OUTPUT_FILE,
+                            path.join(
+                                __dirname,
+                                '../../packages/payments-plugin/src/mollie/api-extensions.ts',
+                            ),
+                        ],
                         documents: path.join(
                             __dirname,
                             '../../packages/payments-plugin/e2e/graphql/shop-queries.ts',
@@ -199,10 +212,7 @@ Promise.all([
                 )]: {
                     schema: [
                         SHOP_SCHEMA_OUTPUT_FILE,
-                        path.join(
-                            __dirname,
-                            '../../packages/payments-plugin/src/mollie/mollie-shop-schema.ts',
-                        ),
+                        path.join(__dirname, '../../packages/payments-plugin/src/mollie/api-extensions.ts'),
                     ],
                     plugins: clientPlugins,
                     config,

Неке датотеке нису приказане због велике количине промена