@bcrumbs.net/bc-api 0.0.25 → 0.0.27

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/index.cjs.js CHANGED
@@ -4,7 +4,7 @@ var client = require('@apollo/client');
4
4
  var error = require('@apollo/client/link/error');
5
5
  var context = require('@apollo/client/link/context');
6
6
  var apolloLinkRest = require('apollo-link-rest');
7
- var withApollo = require('next-with-apollo');
7
+ var nextWithApollo = require('next-with-apollo');
8
8
  var decode = require('jwt-decode');
9
9
  var dateFns = require('date-fns');
10
10
  var Stream = require('stream');
@@ -6927,7 +6927,7 @@ const dqueryClient = new client.ApolloClient({
6927
6927
  connectToDevTools: isDevEnv$1,
6928
6928
  queryDeduplication: true
6929
6929
  });
6930
- const withDQueryClient = withApollo.withApollo(({
6930
+ const withDQueryClient = nextWithApollo.withApollo(({
6931
6931
  initialState
6932
6932
  }) =>
6933
6933
  // @ts-expect-error TypeScript is complaining
@@ -7656,7 +7656,8 @@ let _$6 = t => t,
7656
7656
  _t6$4,
7657
7657
  _t7$2,
7658
7658
  _t8$2,
7659
- _t9$2;
7659
+ _t9$2,
7660
+ _t10;
7660
7661
  const showcaseContentsQuery = gql(_t$6 || (_t$6 = _$6`
7661
7662
  query ($rootId: Int!, $path: String, $deep: Int!) {
7662
7663
  contents(rootId: $rootId, deep: $deep, path: $path) {
@@ -8068,6 +8069,18 @@ const useTemplateSectionsThumbsMap = companyContextId => client.useQuery(showcas
8068
8069
  companyContextId
8069
8070
  }
8070
8071
  });
8072
+ const showcaseContext = gql(_t10 || (_t10 = _$6`
8073
+ query ($domain: String!) {
8074
+ contextId(domain: $domain)
8075
+ }
8076
+ `));
8077
+ const useShowcaseContext = domain => client.useQuery(showcaseConfig, {
8078
+ fetchPolicy: 'cache-first',
8079
+ client: dqueryClient,
8080
+ variables: {
8081
+ domain
8082
+ }
8083
+ });
8071
8084
 
8072
8085
  let _$5 = t => t,
8073
8086
  _t$5;
@@ -90973,7 +90986,7 @@ const showcaseClient = new client.ApolloClient({
90973
90986
  });
90974
90987
  // Export a HOC from next-with-apollo
90975
90988
  // Docs: https://www.npmjs.com/package/next-with-apollo
90976
- const withShowcaseClient = withApollo(({
90989
+ const withShowcaseClient = nextWithApollo.withApollo(({
90977
90990
  initialState
90978
90991
  }) =>
90979
90992
  // @ts-expect-error will be fixed later
@@ -91946,6 +91959,7 @@ exports.showcaseConfigById = showcaseConfigById;
91946
91959
  exports.showcaseConfigurationQuery = showcaseConfigurationQuery;
91947
91960
  exports.showcaseConfigurationQueryOptions = showcaseConfigurationQueryOptions;
91948
91961
  exports.showcaseContentsQuery = showcaseContentsQuery;
91962
+ exports.showcaseContext = showcaseContext;
91949
91963
  exports.showcaseDomainsQuery = showcaseDomainsQuery;
91950
91964
  exports.showcaseDomainsQueryOptions = showcaseDomainsQueryOptions;
91951
91965
  exports.showcasePagesQuery = showcasePagesQuery;
@@ -91990,6 +92004,7 @@ exports.useShowcaseConfig = useShowcaseConfig;
91990
92004
  exports.useShowcaseConfigById = useShowcaseConfigById;
91991
92005
  exports.useShowcaseConfigurationQuery = useShowcaseConfigurationQuery;
91992
92006
  exports.useShowcaseContentsQuery = useShowcaseContentsQuery;
92007
+ exports.useShowcaseContext = useShowcaseContext;
91993
92008
  exports.useShowcasePagesQuery = useShowcasePagesQuery;
91994
92009
  exports.useShowcaseSectionQuery = useShowcaseSectionQuery;
91995
92010
  exports.useShowcaseTemplate = useShowcaseTemplate;
package/index.esm.js CHANGED
@@ -2,7 +2,7 @@ import { InMemoryCache, ApolloClient, from, useQuery, createHttpLink, useMutatio
2
2
  import { onError } from '@apollo/client/link/error';
3
3
  import { setContext } from '@apollo/client/link/context';
4
4
  import { RestLink } from 'apollo-link-rest';
5
- import withApollo$1, { withApollo } from 'next-with-apollo';
5
+ import { withApollo } from 'next-with-apollo';
6
6
  import decode from 'jwt-decode';
7
7
  import { isAfter } from 'date-fns';
8
8
  import Stream from 'stream';
@@ -7654,7 +7654,8 @@ let _$6 = t => t,
7654
7654
  _t6$4,
7655
7655
  _t7$2,
7656
7656
  _t8$2,
7657
- _t9$2;
7657
+ _t9$2,
7658
+ _t10;
7658
7659
  const showcaseContentsQuery = gql(_t$6 || (_t$6 = _$6`
7659
7660
  query ($rootId: Int!, $path: String, $deep: Int!) {
7660
7661
  contents(rootId: $rootId, deep: $deep, path: $path) {
@@ -8066,6 +8067,18 @@ const useTemplateSectionsThumbsMap = companyContextId => useQuery(showcaseTempla
8066
8067
  companyContextId
8067
8068
  }
8068
8069
  });
8070
+ const showcaseContext = gql(_t10 || (_t10 = _$6`
8071
+ query ($domain: String!) {
8072
+ contextId(domain: $domain)
8073
+ }
8074
+ `));
8075
+ const useShowcaseContext = domain => useQuery(showcaseConfig, {
8076
+ fetchPolicy: 'cache-first',
8077
+ client: dqueryClient,
8078
+ variables: {
8079
+ domain
8080
+ }
8081
+ });
8069
8082
 
8070
8083
  let _$5 = t => t,
8071
8084
  _t$5;
@@ -90971,7 +90984,7 @@ const showcaseClient = new ApolloClient({
90971
90984
  });
90972
90985
  // Export a HOC from next-with-apollo
90973
90986
  // Docs: https://www.npmjs.com/package/next-with-apollo
90974
- const withShowcaseClient = withApollo$1(({
90987
+ const withShowcaseClient = withApollo(({
90975
90988
  initialState
90976
90989
  }) =>
90977
90990
  // @ts-expect-error will be fixed later
@@ -91892,4 +91905,4 @@ class StringsUtils {
91892
91905
  }
91893
91906
  }
91894
91907
 
91895
- export { CreateCheckoutSessionUri, CreatePortalSessionUri, HttpStatusCode, HttpStatusCodeName, LOCAL_STORAGE_I18N_STRING, LangService, Languages, ModelFieldsTypes, ModelUtilities, StringsUtils, VALIDATE_COMPANY_NAME, addDomain, addDomainOptions, apiBackend, apiV2Backend, appConfig, auth, companyUsersQuery, contentInstancesQuery, createCompany, createCompanyOptions, createContentInstanceMutation, createContentInstanceMutationOptions, createContentMutation, createContentMutationOptions, createFileMutation, createFolderMutation, dconfigClient, deleteFileMutation, deleteFolderMutation, dqueryClient, filesQuery, foldersTreeQuery, forgetPassword, forgetPasswordOptions, frontend, inviteUser, inviteUserOptions, login, loginOptions, querySectionThumb, queryUsage, registeUsage, register, registerOptions, removeContentMutation, removeDomain, removeDomainOptions, removeUserFromCompany, removeUserFromCompanyOptions, resetPassword, resetPasswordOptions, showcaseClient, showcaseConfig, showcaseConfigById, showcaseConfigurationQuery, showcaseConfigurationQueryOptions, showcaseContentsQuery, showcaseDomainsQuery, showcaseDomainsQueryOptions, showcasePagesQuery, showcasePagesQueryOptions, showcaseSectionQuery, showcaseSectionsQuery, showcaseSectionsQueryOptions, showcaseTemplateSectionsThumbsMap, showcaseTemplatesQuery, showcaseTemplatesQueryOptions, subscriptionConfigurationQuery, subscriptionConfigurationQueryOptions, tokenClient, updateCompany, updateCompanyOptions, updateContentInstanceFieldValuesMutation, updateContentInstanceFieldValuesMutationOptions, updateContentsOrderingMutation, updateContentsOrderingMutationOptions, updateTemplateSectionThumb, updateUserPassword, updateUserPasswordOptions, updateUserProfile, updateUserProfileOptions, useContentInstancesQuery, useCreateContentInstanceMutation, useCreateContentMutation, useCreateFileMutation, useCreateFolderMutation, useDeleteContentMutation, useDeleteFileMutation, useDeleteFolderMutation, useDomainsQuery, useFilesQuery, useFoldersTreeQuery, useModelChildrenQuery, useModelsQuery, useQuerySectionThumb, useQueryUsage, useRegisterUsage, useShowcaseConfig, useShowcaseConfigById, useShowcaseConfigurationQuery, useShowcaseContentsQuery, useShowcasePagesQuery, useShowcaseSectionQuery, useShowcaseTemplate, useShowcaseTemplateOptions, useShowcaseTemplateProgress, useShowcaseTemplateProgressQuery, useTemplateSectionsThumbsMap, useUpdateContentInstanceFieldValuesMutation, useUpdateContentsOrderingMutation, useUserCompaniesQuery, useValidateCompanyName, userCompaniesQuery, userCompaniesQueryOptions, userInfoQuery, userInfoQueryOptions, viewTypeChildrenQuery, viewTypeChildrenQueryOptions, viewTypesQuery, viewTypesQueryOptions, withDQueryClient, withShowcaseClient };
91908
+ export { CreateCheckoutSessionUri, CreatePortalSessionUri, HttpStatusCode, HttpStatusCodeName, LOCAL_STORAGE_I18N_STRING, LangService, Languages, ModelFieldsTypes, ModelUtilities, StringsUtils, VALIDATE_COMPANY_NAME, addDomain, addDomainOptions, apiBackend, apiV2Backend, appConfig, auth, companyUsersQuery, contentInstancesQuery, createCompany, createCompanyOptions, createContentInstanceMutation, createContentInstanceMutationOptions, createContentMutation, createContentMutationOptions, createFileMutation, createFolderMutation, dconfigClient, deleteFileMutation, deleteFolderMutation, dqueryClient, filesQuery, foldersTreeQuery, forgetPassword, forgetPasswordOptions, frontend, inviteUser, inviteUserOptions, login, loginOptions, querySectionThumb, queryUsage, registeUsage, register, registerOptions, removeContentMutation, removeDomain, removeDomainOptions, removeUserFromCompany, removeUserFromCompanyOptions, resetPassword, resetPasswordOptions, showcaseClient, showcaseConfig, showcaseConfigById, showcaseConfigurationQuery, showcaseConfigurationQueryOptions, showcaseContentsQuery, showcaseContext, showcaseDomainsQuery, showcaseDomainsQueryOptions, showcasePagesQuery, showcasePagesQueryOptions, showcaseSectionQuery, showcaseSectionsQuery, showcaseSectionsQueryOptions, showcaseTemplateSectionsThumbsMap, showcaseTemplatesQuery, showcaseTemplatesQueryOptions, subscriptionConfigurationQuery, subscriptionConfigurationQueryOptions, tokenClient, updateCompany, updateCompanyOptions, updateContentInstanceFieldValuesMutation, updateContentInstanceFieldValuesMutationOptions, updateContentsOrderingMutation, updateContentsOrderingMutationOptions, updateTemplateSectionThumb, updateUserPassword, updateUserPasswordOptions, updateUserProfile, updateUserProfileOptions, useContentInstancesQuery, useCreateContentInstanceMutation, useCreateContentMutation, useCreateFileMutation, useCreateFolderMutation, useDeleteContentMutation, useDeleteFileMutation, useDeleteFolderMutation, useDomainsQuery, useFilesQuery, useFoldersTreeQuery, useModelChildrenQuery, useModelsQuery, useQuerySectionThumb, useQueryUsage, useRegisterUsage, useShowcaseConfig, useShowcaseConfigById, useShowcaseConfigurationQuery, useShowcaseContentsQuery, useShowcaseContext, useShowcasePagesQuery, useShowcaseSectionQuery, useShowcaseTemplate, useShowcaseTemplateOptions, useShowcaseTemplateProgress, useShowcaseTemplateProgressQuery, useTemplateSectionsThumbsMap, useUpdateContentInstanceFieldValuesMutation, useUpdateContentsOrderingMutation, useUserCompaniesQuery, useValidateCompanyName, userCompaniesQuery, userCompaniesQueryOptions, userInfoQuery, userInfoQueryOptions, viewTypeChildrenQuery, viewTypeChildrenQueryOptions, viewTypesQuery, viewTypesQueryOptions, withDQueryClient, withShowcaseClient };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bcrumbs.net/bc-api",
3
3
  "description": "The SDK that helps to work with Bread Crumbs APIs",
4
- "version": "0.0.25",
4
+ "version": "0.0.27",
5
5
  "keyword": [
6
6
  "bcrumbs",
7
7
  "bc-api"
@@ -18,3 +18,5 @@ export declare const showcaseConfigById: import("@apollo/client").DocumentNode;
18
18
  export declare const useShowcaseConfigById: (companyContextId: number) => import("@apollo/client").QueryResult<any, import("@apollo/client").OperationVariables>;
19
19
  export declare const showcaseTemplateSectionsThumbsMap: import("@apollo/client").DocumentNode;
20
20
  export declare const useTemplateSectionsThumbsMap: (companyContextId: number) => import("@apollo/client").QueryResult<any, import("@apollo/client").OperationVariables>;
21
+ export declare const showcaseContext: import("@apollo/client").DocumentNode;
22
+ export declare const useShowcaseContext: (domain: string) => import("@apollo/client").QueryResult<any, import("@apollo/client").OperationVariables>;