@graphcommerce/next-config 10.0.0-canary.66 → 10.0.0-canary.67

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/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Change Log
2
2
 
3
+ ## 10.0.0-canary.67
4
+
3
5
  ## 10.0.0-canary.66
4
6
 
5
7
  ## 10.0.0-canary.65
package/Config.graphqls CHANGED
@@ -10,7 +10,7 @@ The configuration file is a javascript file that exports a `GraphCommerceConfig`
10
10
 
11
11
  ## Using configuration
12
12
 
13
- Configuration can be accessed in your project with the `import.meta.graphCommerce` object.
13
+ Configuration can be accessed in your project by importing the config from `@graphcommerce/next-config/config`.
14
14
 
15
15
  ```tsx
16
16
  import { storefrontAll, storefrontConfig, storefrontConfigDefault, useStorefrontConfig } from '@graphcommerce/next-ui'
@@ -2,6 +2,7 @@ import { z } from 'zod';
2
2
 
3
3
  const isDefinedNonNullAny = (v) => v !== void 0 && v !== null;
4
4
  const definedNonNullAnySchema = z.any().refine((v) => isDefinedNonNullAny(v));
5
+ const BillingAddressPermissionsSchema = z.enum(["EDITABLE", "READONLY"]);
5
6
  const CartPermissionsSchema = z.enum(["CUSTOMER_ONLY", "DISABLED", "ENABLED"]);
6
7
  const CompareVariantSchema = z.enum(["CHECKBOX", "ICON"]);
7
8
  const ContainerSizingSchema = z.enum(["BREAKPOINT", "FULL_WIDTH"]);
@@ -83,6 +84,7 @@ function GraphCommerceGooglePlaystoreConfigSchema() {
83
84
  }
84
85
  function GraphCommercePermissionsSchema() {
85
86
  return z.object({
87
+ billingAddress: BillingAddressPermissionsSchema.nullish(),
86
88
  cart: CartPermissionsSchema.nullish(),
87
89
  checkout: CartPermissionsSchema.nullish(),
88
90
  customerAccount: CustomerAccountPermissionsSchema.nullish(),
@@ -126,4 +128,4 @@ function SidebarGalleryConfigSchema() {
126
128
  });
127
129
  }
128
130
 
129
- export { CartPermissionsSchema, CompareVariantSchema, ContainerSizingSchema, CustomerAccountPermissionsSchema, DatalayerConfigSchema, GraphCommerceConfigSchema, GraphCommerceDebugConfigSchema, GraphCommerceGooglePlaystoreConfigSchema, GraphCommercePermissionsSchema, GraphCommerceStorefrontConfigSchema, MagentoConfigurableVariantValuesSchema, PaginationVariantSchema, ProductFiltersLayoutSchema, RecentlyViewedProductsConfigSchema, SidebarGalleryConfigSchema, SidebarGalleryPaginationVariantSchema, WebsitePermissionsSchema, definedNonNullAnySchema, isDefinedNonNullAny };
131
+ export { BillingAddressPermissionsSchema, CartPermissionsSchema, CompareVariantSchema, ContainerSizingSchema, CustomerAccountPermissionsSchema, DatalayerConfigSchema, GraphCommerceConfigSchema, GraphCommerceDebugConfigSchema, GraphCommerceGooglePlaystoreConfigSchema, GraphCommercePermissionsSchema, GraphCommerceStorefrontConfigSchema, MagentoConfigurableVariantValuesSchema, PaginationVariantSchema, ProductFiltersLayoutSchema, RecentlyViewedProductsConfigSchema, SidebarGalleryConfigSchema, SidebarGalleryPaginationVariantSchema, WebsitePermissionsSchema, definedNonNullAnySchema, isDefinedNonNullAny };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/next-config",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "10.0.0-canary.66",
5
+ "version": "10.0.0-canary.67",
6
6
  "type": "module",
7
7
  "types": "./src/index.ts",
8
8
  "exports": {
@@ -64,7 +64,7 @@
64
64
  },
65
65
  "peerDependencies": {
66
66
  "@apollo/client": "*",
67
- "@graphcommerce/prettier-config-pwa": "^10.0.0-canary.66",
67
+ "@graphcommerce/prettier-config-pwa": "^10.0.0-canary.67",
68
68
  "@lingui/loader": "*",
69
69
  "@lingui/macro": "*",
70
70
  "@lingui/react": "*",
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod'
2
+
2
3
  export type Maybe<T> = T | null
3
4
  export type InputMaybe<T> = Maybe<T>
4
5
  export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] }
@@ -19,6 +20,8 @@ export type Scalars = {
19
20
  Float: { input: number; output: number }
20
21
  }
21
22
 
23
+ export type BillingAddressPermissions = 'EDITABLE' | 'READONLY'
24
+
22
25
  export type CartPermissions = 'CUSTOMER_ONLY' | 'DISABLED' | 'ENABLED'
23
26
 
24
27
  export type CompareVariant = 'CHECKBOX' | 'ICON'
@@ -311,8 +314,10 @@ export type GraphCommerceConfig = {
311
314
  * - Delete public content views
312
315
  * - Can see schema view
313
316
  *
314
- * GC_HYGRAPH_WRITE_ACCESS_TOKEN="AccessTokenFromHygraph"
315
- * yarn graphcommerce hygraph-migrate
317
+ * ```bash
318
+ * GC_HYGRAPH_WRITE_ACCESS_TOKEN="AccessTokenFromHygraph"
319
+ * yarn graphcommerce hygraph-migrate
320
+ * ```
316
321
  */
317
322
  hygraphWriteAccessToken?: InputMaybe<Scalars['String']['input']>
318
323
  /**
@@ -417,6 +422,8 @@ export type GraphCommerceGooglePlaystoreConfig = {
417
422
 
418
423
  /** Permissions input */
419
424
  export type GraphCommercePermissions = {
425
+ /** Allows customers to change their billing address or locks it down. */
426
+ billingAddress?: InputMaybe<BillingAddressPermissions>
420
427
  /**
421
428
  * Changes the availability of the add to cart buttons and the cart page to either customer only
422
429
  * or completely disables it.
@@ -569,6 +576,8 @@ export const isDefinedNonNullAny = (v: any): v is definedNonNullAny => v !== und
569
576
 
570
577
  export const definedNonNullAnySchema = z.any().refine((v) => isDefinedNonNullAny(v))
571
578
 
579
+ export const BillingAddressPermissionsSchema = z.enum(['EDITABLE', 'READONLY'])
580
+
572
581
  export const CartPermissionsSchema = z.enum(['CUSTOMER_ONLY', 'DISABLED', 'ENABLED'])
573
582
 
574
583
  export const CompareVariantSchema = z.enum(['CHECKBOX', 'ICON'])
@@ -668,6 +677,7 @@ export function GraphCommercePermissionsSchema(): z.ZodObject<
668
677
  Properties<GraphCommercePermissions>
669
678
  > {
670
679
  return z.object({
680
+ billingAddress: BillingAddressPermissionsSchema.nullish(),
671
681
  cart: CartPermissionsSchema.nullish(),
672
682
  checkout: CartPermissionsSchema.nullish(),
673
683
  customerAccount: CustomerAccountPermissionsSchema.nullish(),