@sitecore-jss/sitecore-jss-nextjs 21.6.0-canary.38 → 21.6.0-canary.39

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.
Files changed (37) hide show
  1. package/context.d.ts +1 -0
  2. package/context.js +1 -0
  3. package/dist/cjs/context/context.js +68 -0
  4. package/dist/cjs/context/index.js +5 -0
  5. package/dist/cjs/editing/constants.js +6 -0
  6. package/dist/cjs/editing/editing-data-middleware.js +2 -2
  7. package/dist/cjs/editing/editing-data-service.js +15 -7
  8. package/dist/cjs/editing/editing-render-middleware.js +31 -8
  9. package/dist/cjs/graphql/index.js +6 -0
  10. package/dist/cjs/index.js +10 -5
  11. package/dist/cjs/middleware/personalize-middleware.js +33 -32
  12. package/dist/cjs/services/base-graphql-sitemap-service.js +8 -0
  13. package/dist/cjs/utils/utils.js +6 -18
  14. package/dist/esm/context/context.js +64 -0
  15. package/dist/esm/context/index.js +1 -0
  16. package/dist/esm/editing/constants.js +3 -0
  17. package/dist/esm/editing/editing-data-middleware.js +1 -1
  18. package/dist/esm/editing/editing-data-service.js +13 -5
  19. package/dist/esm/editing/editing-render-middleware.js +31 -8
  20. package/dist/esm/graphql/index.js +1 -0
  21. package/dist/esm/index.js +8 -2
  22. package/dist/esm/middleware/personalize-middleware.js +34 -33
  23. package/dist/esm/services/base-graphql-sitemap-service.js +9 -1
  24. package/dist/esm/utils/utils.js +6 -15
  25. package/graphql.d.ts +1 -0
  26. package/graphql.js +1 -0
  27. package/package.json +11 -10
  28. package/types/context/context.d.ts +113 -0
  29. package/types/context/index.d.ts +1 -0
  30. package/types/editing/constants.d.ts +3 -0
  31. package/types/editing/editing-data-service.d.ts +12 -4
  32. package/types/editing/editing-render-middleware.d.ts +10 -0
  33. package/types/graphql/index.d.ts +1 -0
  34. package/types/index.d.ts +6 -2
  35. package/types/middleware/personalize-middleware.d.ts +20 -15
  36. package/types/services/base-graphql-sitemap-service.d.ts +10 -3
  37. package/types/utils/utils.d.ts +1 -0
@@ -1,4 +1,4 @@
1
- import { GraphQLClient, PageInfo } from '@sitecore-jss/sitecore-jss/graphql';
1
+ import { GraphQLClient, GraphQLRequestClientFactory, PageInfo } from '@sitecore-jss/sitecore-jss/graphql';
2
2
  /** @private */
3
3
  export declare const languageError = "The list of languages cannot be empty";
4
4
  export declare const siteError = "The service needs a site name";
@@ -68,17 +68,24 @@ export type RouteListQueryResult = {
68
68
  export interface BaseGraphQLSitemapServiceConfig extends Omit<SiteRouteQueryVariables, 'language' | 'siteName'> {
69
69
  /**
70
70
  * Your Graphql endpoint
71
+ * @deprecated use @param clientFactory property instead
71
72
  */
72
- endpoint: string;
73
+ endpoint?: string;
73
74
  /**
74
75
  * The API key to use for authentication.
76
+ * @deprecated use @param clientFactory property instead
75
77
  */
76
- apiKey: string;
78
+ apiKey?: string;
77
79
  /**
78
80
  * A flag for whether to include personalized routes in service output - only works on XM Cloud
79
81
  * turned off by default
80
82
  */
81
83
  includePersonalizedRoutes?: boolean;
84
+ /**
85
+ * A GraphQL Request Client Factory is a function that accepts configuration and returns an instance of a GraphQLRequestClient.
86
+ * This factory function is used to create and configure GraphQL clients for making GraphQL API requests.
87
+ */
88
+ clientFactory?: GraphQLRequestClientFactory;
82
89
  }
83
90
  /**
84
91
  * Object model of a site page item.
@@ -5,6 +5,7 @@
5
5
  * VERCEL_URL is provided by Vercel in case if we are in Preview deployment (deployment based on the custom branch),
6
6
  * preview deployment has unique url, we don't know exact url.
7
7
  * Similarly, DEPLOY_URL is provided by Netlify and would give us the deploy URL
8
+ * In production non-editing environments it is desirable to use relative urls, so in that case set PUBLIC_URL = ''
8
9
  */
9
10
  export declare const getPublicUrl: () => string;
10
11
  /**