This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createSyncProducts } from '@commercetools/sync-actions' | |
import {cloneDeep} from 'lodash' | |
const syncProducts = createSyncProducts() | |
const before = { | |
"id": "4e7ccbb5-0d06-48a8-8ff1-2b17b4bee189", | |
"version": 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createClient } from '@commercetools/sdk-client'; | |
import { createAuthMiddlewareForClientCredentialsFlow } from '@commercetools/sdk-middleware-auth'; | |
import { createHttpMiddleware } from '@commercetools/sdk-middleware-http'; | |
import { createQueueMiddleware } from '@commercetools/sdk-middleware-queue'; | |
import { createRequestBuilder } from '@commercetools/api-request-builder'; | |
import fetch from 'node-fetch'; | |
import HttpsProxyAgent from 'https-proxy-agent'; | |
export const fetchPatched = (url, options = {}) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createClient } from '@commercetools/sdk-client'; | |
import { createCorrelationIdMiddleware } from '@commercetools/sdk-middleware-correlation-id'; | |
import { createAuthMiddlewareForClientCredentialsFlow } from '@commercetools/sdk-middleware-auth'; | |
import { createHttpMiddleware } from '@commercetools/sdk-middleware-http'; | |
import { createQueueMiddleware } from '@commercetools/sdk-middleware-queue'; | |
import { createRequestBuilder } from '@commercetools/api-request-builder'; | |
import { createUserAgentMiddleware } from '@commercetools/sdk-middleware-user-agent'; | |
import uuid from 'uuid/v4'; | |
import fetch from 'node-fetch'; | |
import HttpsProxyAgent from 'https-proxy-agent'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In commercetools' solution enablement department we aim to help our customers and partners implement the best solutions with commercetools' apis. This means a lot of interacting with our apis. Very often we'll end up needing to fetch and present product data in a meaningful fashion for our customers. | |
Please write an application that will display a list of many products filterable by (your choice) categories, or, some manner of search ( think text and filters/facets). If you have time, also include a product detail view that fetches and shows information about a single product given its id (or sku, or slug if you want) | |
You should find all documentation on commercetools' api endpoints at docs.commercetools.com, You will probably be making use of the product projections endpoint. | |
In the email asking about this exercise, you should get some credentials for accessing a project that should have sample product data already loaded. | |
Feel free to use any libraries available to complete this exercise. Keep in mind |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
set -e | |
# Below will find env vars prefixed with ${CI_ENVIRONMENT} and set env vars without the prefix to the prefixed value | |
# e.g. if ${development_CTP_CLIENT_SECRET} is defined, define $CTP_CLIENT_SECRET with the value from ${development_CTP_CLIENT_SECRET} | |
while read -r line | |
do | |
non_prefixed=${line#"${CI_ENVIRONMENT}_"} | |
declare -x $non_prefixed=${!line} |