How to use the @commercetools-frontend/constants.MC_API_PROXY_TARGETS.COMMERCETOOLS_PLATFORM function in @commercetools-frontend/constants

To help you get started, we’ve selected a few @commercetools-frontend/constants examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github commercetools / merchant-center-application-kit / packages / sdk / src / middleware / middleware.spec.ts View on Github external
describe('when there is a mcApiProxyTarget', () => {
      const dispatch = jest.fn();
      const action = sdkActions.get({
        uri: '/foo',
        mcApiProxyTarget: MC_API_PROXY_TARGETS.COMMERCETOOLS_PLATFORM,
      });
      const next = jest.fn();
      const response = { body: { foo: 'bar' }, headers: {}, statusCode: 200 };
      beforeEach(() => {
        execute = jest.fn(() => Promise.resolve(response));
        mocked(createClient).mockReturnValue({
          execute,
        });

        return createMiddleware(middlewareOptions)({
          dispatch,
          getState: jest.fn(),
        })(next)(action);
      });

      it('should call `client.execute` with uri with prefix', () => {
github commercetools / merchant-center-application-kit / playground / src / components / state-machines-list-connector / actions.js View on Github external
export const fetchStateMachines = requestOptions =>
  sdkActions.get({
    mcApiProxyTarget: MC_API_PROXY_TARGETS.COMMERCETOOLS_PLATFORM,
    service: 'states',
    options: requestOptions,
  });
github commercetools / merchant-center-application-kit / playground / src / components / state-machines-list / state-machines-list.spec.js View on Github external
const createStateMachinesDetailSdkMockForId1 = () => ({
  action: {
    type: 'SDK',
    payload: {
      method: 'GET',
      service: 'states',
      options: { id: 'sm1' },
      mcApiProxyTarget: MC_API_PROXY_TARGETS.COMMERCETOOLS_PLATFORM,
    },
  },
  response: {
    id: 'sm1',
    key: 'sm-1',
    type: 'LineItemState',
    initial: true,
    builtIn: true,
  },
});
const createStateMachinesDetailSdkMockForId2 = () => ({
github commercetools / merchant-center-application-kit / playground / src / components / state-machines-details / actions.js View on Github external
export const fetchStateMachine = id =>
  sdkActions.get({
    mcApiProxyTarget: MC_API_PROXY_TARGETS.COMMERCETOOLS_PLATFORM,
    service: 'states',
    options: { id },
  });

@commercetools-frontend/constants

Shared constants for MC applications

MIT
Latest version published 3 days ago

Package Health Score

87 / 100
Full package analysis