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,OAAS,IAC1Dw0C,EAAY4M,cAAcyI,GAC1BrV,EAAYT,OAAO,kBAAmB8V,GAE1C,GACF,CACF,GACF,GAAG,CAAC/X,GAGN,C","sources":["../../../../client-data/packages/overreact-bingads/src/request-contract-helper/query-string-parser.js","../../../../client-data/packages/overreact-bingads/src/request-contract-helper/header.js","../../../../client-data/packages/overreact-bingads/src/environment/edm.js","../../../../client-data/packages/overreact-bingads/src/request-contract-helper/bulk.js","../../../../client-data/packages/overreact-cc/src/environment/requestor.js","../../../../client-data/packages/overreact-cc/src/environment/schema.js","../../../../client-data/packages/overreact-cc/src/environment/environment-instance.js","../../../../client-data/packages/overreact-cc/src/environment/use-cc-environment.js","../../../../client-data/packages/overreact-cc/src/request-contract-helper/options.js","../../../../client-data/packages/overreact-cc/src/entity/user/spec/fetch.js","../../../../client-data/packages/overreact-cc/src/entity/user/spec/mutation.js","../../../../client-data/packages/overreact-cc/src/entity/user/hooks/use-user.js","../../../../client-data/packages/overreact-cc/src/entity/customer/spec/fetch.js","../../../../client-data/packages/overreact-cc/src/entity/customer/spec/mutation.js","../../../../client-data/packages/overreact-cc/src/entity/customer/hooks/use-customer.js","../../../../client-data/packages/overreact-cc/src/entity/account/spec/fetch.js","../../../../client-data/packages/overreact-cc/src/entity/account/spec/mutation.js","../../../../client-data/packages/overreact-cc/src/entity/account/hooks/use-account.js","../../../../client-data/packages/overreact-cc/src/entity/account/spec/coll-fetch.js","../../../../client-data/packages/overreact-cc/src/entity/account/hooks/use-accounts.js","../../../../client-data/packages/overreact-cc/src/entity/sub-geographies/spec/fetch.js","../../../../client-data/packages/overreact-cc/src/entity/sub-geographies/hooks/use-sub-geographies.js","../../../../client-data/packages/overreact-cc/src/entity/time-zones/spec/coll-fetch.js","../../../../client-data/packages/overreact-cc/src/entity/time-zones/hooks/use-time-zones.js","../../../../client-data/packages/overreact-cc/src/entity/countries/spec/coll-fetch.js","../../../../client-data/packages/overreact-cc/src/entity/countries/hooks/use-countries.js","../../../../client-data/packages/overreact-cc/src/entity/currencies/spec/coll-fetch.js","../../../../client-data/packages/overreact-cc/src/entity/currencies/hooks/use-currencies.js","../../../../client-data/packages/overreact-cc/src/entity/currency-countries-mappings/spec/coll-fetch.js","../../../../client-data/packages/overreact-cc/src/entity/currency-countries-mappings/hooks/use-currency-countries-mappings.js","../../../../client-data/packages/overreact-cc/src/entity/country-currencies-mappings/spec/coll-fetch.js","../../../../client-data/packages/overreact-cc/src/entity/country-currencies-mappings/hooks/use-country-currencies-mappings.js","../../../../client-data/packages/overreact-cc/src/entity/validate-address/spec/fetch.js","../../../../client-data/packages/overreact-cc/src/entity/validate-address/hooks/use-validate-address.js","../../../../client-data/packages/overreact-cc/src/entity/sign-up/spec/fetch.js","../../../../client-data/packages/overreact-cc/src/entity/sign-up/hooks/use-sign-up.js","../../../../client-data/packages/overreact-cc/src/entity/estimate-taxes/spec/fetch.js","../../../../client-data/packages/overreact-cc/src/entity/estimate-taxes/hooks/use-estimate-taxes.js","../../../../client-data/packages/overreact-cc/src/entity/top-up-limit/spec/fetch.js","../../../../client-data/packages/overreact-cc/src/entity/top-up-limit/hooks/use-top-up-limit.js","../../../../client-data/packages/overreact-cc/src/entity/offline-payment-instructions/spec/fetch.js","../../../../client-data/packages/overreact-cc/src/entity/offline-payment-instructions/hooks/use-offline-payment-instructions.js","../../../../client-data/packages/overreact-cc/src/entity/create-expert-from-smart/spec/fetch.js","../../../../client-data/packages/overreact-cc/src/entity/create-expert-from-smart/hooks/use-create-expert-from-smart.js","../../../../client-data/packages/overreact-cc/src/entity/payment-instrument/spec/fetch.js","../../../../client-data/packages/overreact-cc/src/entity/payment-instrument/hooks/use-payment-instrument.js","../../../../client-data/packages/overreact-cc/src/entity/get-coupon-details/spec/fetch.js","../../../../client-data/packages/overreact-cc/src/entity/get-coupon-details/hooks/use-get-coupon-details.js","../../../../client-data/packages/overreact-cc/src/entity/get-coupon-string-for-signup/spec/fetch.js","../../../../client-data/packages/overreact-cc/src/entity/get-coupon-string-for-signup/hooks/use-get-coupon-string-for-signup.js","../../../../client-data/packages/overreact-cc/src/entity/get-coupon-valid-for-customer-website/spec/fetch.js","../../../../client-data/packages/overreact-cc/src/entity/get-coupon-valid-for-customer-website/hooks/use-get-coupon-valid-for-customer-website.js","../../../../client-data/packages/overreact-cc/src/entity/save-coupon-string-for-signup/spec/fetch.js","../../../../client-data/packages/overreact-cc/src/entity/save-coupon-string-for-signup/hooks/use-save-coupon-string-for-signup.js","../../../../client-data/packages/overreact-cc/src/entity/country-timezones-mapping/spec/coll-fetch.js","../../../../client-data/packages/overreact-cc/src/entity/country-timezones-mapping/hooks/use-country-timezones-mapping.js","../../../../client-data/packages/overreact-expert/src/environment/edm.js","../../../../client-data/packages/overreact-expert/src/environment/schema.js","../../../../client-data/packages/overreact-expert/src/environment/index.js","../../../../client-data/packages/overreact-expert/src/entity/campaign/spec/fetch.js","../../../../client-data/packages/overreact-expert/src/entity/campaign/spec/mutation.js","../../../../client-data/packages/overreact-expert/src/entity/campaign/hooks/use-campaign.js","../../../../client-data/packages/overreact-expert/src/entity/campaign/spec/coll-fetch.js","../../../../client-data/packages/overreact-expert/src/entity/campaign/hooks/use-campaigns.js","../../../../client-data/packages/overreact-expert/src/entity/ad-group/spec/coll-fetch.js","../../../../client-data/packages/overreact-expert/src/entity/ad-group/spec/mutation.js","../../../../client-data/packages/overreact-expert/src/entity/ad-group/hooks/use-ad-groups.js","../../../../client-data/packages/overreact-expert/src/entity/ad-group/spec/fetch.js","../../../../client-data/packages/overreact-expert/src/entity/ad-group/hooks/use-ad-group.js","../../../../client-data/packages/overreact-expert/src/entity/ad/spec/ad-coll-fetch.js","../../../../client-data/packages/overreact-expert/src/entity/ad/spec/ad-coll-mutation.js","../../../../client-data/packages/overreact-expert/src/entity/ad/hooks/use-ads.js","../../../../client-data/packages/overreact-expert/src/entity/keyword/spec/keyword-coll-fetch.js","../../../../client-data/packages/overreact-expert/src/entity/keyword/spec/keyword-coll-mutation.js","../../../../client-data/packages/overreact-expert/src/entity/keyword/hooks/use-keywords.js","../../../../client-data/packages/overreact-expert/src/entity/location/spec/fetch.js","../../../../client-data/packages/overreact-expert/src/entity/location/hooks/use-location.js","../../../../client-data/packages/overreact-expert/src/entity/campaign-criterions/spec/coll-fetch.js","../../../../client-data/packages/overreact-expert/src/entity/campaign-criterions/spec/mutation.js","../../../../client-data/packages/overreact-expert/src/entity/campaign-criterions/hooks/use-campaign-criterions.js","../../../../client-data/packages/overreact-expert/src/entity/target-suggestion/spec/target-suggestion-coll-fetch.js","../../../../client-data/packages/overreact-expert/src/entity/target-suggestion/hooks/use-target-suggesions.js","../../../../client-data/packages/overreact-expert/src/entity/rsa-suggestion/spec/rsa-suggestion-coll-fetch.js","../../../../client-data/packages/overreact-expert/src/entity/rsa-suggestion/hooks/use-rsa-suggesions.js","../../../../client-data/packages/overreact-expert/src/entity/ad-strength/spec/ad-strength-fetch.js","../../../../client-data/packages/overreact-expert/src/entity/ad-strength/hooks/use-ad-strength.js","../../../../client-data/packages/overreact-expert/src/entity/extracted-business-info/spec/extracted-business-info-fetch.js","../../../../client-data/packages/overreact-expert/src/entity/extracted-business-info/hooks/use-extracted-business-info.js","../../../../client-data/packages/overreact-expert/src/entity/budget-suggestion/spec/budget-suggestion-fetch.js","../../../../client-data/packages/overreact-expert/src/entity/budget-suggestion/hooks/use-budget-suggestion.js","../../../../client-data/packages/overreact-odata-campaign/env/edm.js","../../../../client-data/packages/overreact-odata-campaign/env/schema.js","../../../../client-data/packages/overreact-odata-campaign/env/requestor.js","../../../../client-data/packages/overreact-odata-campaign/env/env-instance.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/__specs/entity/destroy-decorators.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/__specs/entity/destroy-spec.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/__specs/entity/fetch-decorators.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/__specs/entity/fetch-spec.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/__specs/entity/mutation-decorators.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/__specs/entity/mutation-spec.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/__specs/coll/add-decorators.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/__specs/coll/add-spec.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/__specs/coll/destroy-decorators.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/__specs/coll/destroy-spec.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/__specs/coll/fetch-decorators.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/__specs/coll/fetch-spec.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/__specs/coll/mutation-decorators.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/__specs/coll/mutation-spec.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/business_category_recommendations/__specs/calls/action-decorators.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/business_category_recommendations/__specs/calls/action-spec.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/get_extracted_business_info/__specs/calls/action-decorators.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/get_extracted_business_info/__specs/calls/action-spec.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/post_a_b_testing_flight_log/__specs/calls/action-decorators.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/post_a_b_testing_flight_log/__specs/calls/action-spec.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/post_a_b_testing_event_log/__specs/calls/action-decorators.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/post_a_b_testing_event_log/__specs/calls/action-spec.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/campaign/prepare_ad_recommendation/__specs/calls/action-decorators.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/campaign/prepare_ad_recommendation/__specs/calls/action-spec.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/tag/__specs/coll/add-decorators.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/tag/__specs/coll/add-spec.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/tag/__specs/coll/destroy-decorators.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/tag/__specs/coll/destroy-spec.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/tag/__specs/coll/fetch-decorators.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/tag/__specs/coll/fetch-spec.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/tag/__specs/coll/mutation-decorators.js","../../../../client-data/packages/overreact-odata-campaign/specs/customer/account/tag/__specs/coll/mutation-spec.js","../../../../client-data/packages/overreact-odata/index.js","../../../../client-data/packages/overreact-odata/src/edm/core.js","../../../../client-data/packages/overreact-odata/src/edm/lodash.js","../../../../client-data/packages/overreact-odata/src/edm/reflection.js","../../../../client-data/packages/overreact-odata/src/edm/registry.js","../../../../client-data/packages/overreact-odata/src/edm/resource-identifiers.js","../../../../client-data/packages/overreact-odata/src/edm/schema-plugin.js","../../../../client-data/packages/overreact-odata/src/edm/types-plugin.js","../../../../client-data/packages/overreact-odata/src/edm/url-util.js","../../../../client-data/packages/overreact-odata/src/helpers/compose-search-string.js","../../../../client-data/packages/overreact-odata/src/helpers/parse-search.js","../../../../client-data/packages/overreact-odata/src/hooks/use-odata-call.js","../../../../client-data/packages/overreact-odata/src/hooks/use-odata-coll.js","../../../../client-data/packages/overreact-odata/src/hooks/use-odata-entity.js","../../../../client-data/packages/overreact-odata/src/hooks/use-specs.js","../../../../client-data/packages/overreact/src/environment/context.js","../../../../client-data/packages/overreact/src/data-fetcher/index.js","../../../../client-data/packages/overreact/src/utils/observer-pattern/subject.js","../../../../client-data/packages/overreact/src/store/schema-extension/data-ref.js","../../../../client-data/packages/overreact/src/store/schema-extension/data-node.js","../../../../client-data/packages/overreact/src/store/schema-extension/schema-extension.js","../../../../client-data/packages/overreact/src/store/record.js","../../../../client-data/packages/overreact/src/store/consts.js","../../../../client-data/packages/overreact/src/store/record-group.js","../../../../client-data/packages/overreact/src/store/store.js","../../../../client-data/packages/overreact/src/store/record-group-helper.js","../../../../client-data/packages/overreact/src/spec/spec-types.js","../../../../client-data/packages/overreact/src/spec/response-types.js","../../../../client-data/packages/overreact/src/middleware/fetch-policy/fetch-policy-utils.js","../../../../client-data/packages/overreact/src/middleware/fetch-policy/fetch-policy-middleware.js","../../../../client-data/packages/overreact/src/middleware/middleware-types.js","../../../../client-data/packages/overreact/src/middleware/request-with-middleware.js","../../../../client-data/packages/overreact/src/middleware/wrapped-requestor.js","../../../../client-data/packages/overreact/src/middleware/error/error-middleware.js","../../../../client-data/packages/overreact/src/utils/primitive-utilities/date.js","../../../../client-data/packages/overreact/src/utils/primitive-utilities/primitive-hooks.js","../../../../client-data/packages/overreact/src/middleware/instrumentation/instrumentation-utils.js","../../../../client-data/packages/overreact/src/middleware/instrumentation/instrumentation-context.js","../../../../client-data/packages/overreact/src/middleware/instrumentation/instrumentation-middleware.js","../../../../client-data/packages/overreact/src/environment/environment.js","../../../../client-data/packages/overreact/src/environment/use-environment.js","../../../../client-data/packages/overreact/src/spec/request-verbs.js","../../../../client-data/packages/overreact/src/spec/request-contract.js","../../../../client-data/packages/overreact/src/spec/response-handler/sideEffectFnHelper.js","../../../../client-data/packages/overreact/src/spec/response-contract.js","../../../../client-data/packages/overreact/src/spec/response-handler/fetch.js","../../../../client-data/packages/overreact/src/spec/response-handler/mutation.js","../../../../client-data/packages/overreact/src/spec/response-handler/refetch.js","../../../../client-data/packages/overreact/src/spec/response-handler/error.js","../../../../client-data/packages/overreact/src/spec/spec.js","../../../../client-data/packages/overreact/src/schema/schema-node.js","../../../../client-data/packages/overreact/src/schema/index.js","../../../../client-data/packages/overreact/src/hooks/overreact-request.js","../../../../client-data/packages/overreact/src/hooks/lookup-cache.js","../../../../client-data/packages/overreact/src/hooks/helper.js","../../../../client-data/packages/overreact/src/hooks/use-component.js","../../../../client-data/packages/overreact/src/hooks/use-fetch.js","../../../../client-data/packages/overreact/src/hooks/merge-config.js","../../../../client-data/packages/overreact/src/hooks/use-mutation.js","../../../../client-data/packages/overreact/src/hooks/use-refetch.js","../../../../client-data/packages/overreact/src/hooks/use-pagination.js","../../../../client-data/packages/overreact/src/hooks/use-data-ref-id.js","../../../../client-data/packages/overreact/src/hooks/use-promisify.js","../../../../client-data/packages/overreact/src/test-utils/use-clean-all-cache.js"],"sourcesContent":["import _ from 'underscore';\r\n// support a mongoDB like orderby object for now: { age : -1, name: 1 }\r\n// for backward compatibility, support array format: [['age', 'desc'], ['name', 'asc]]\r\nfunction parseOrderBy(orderby) {\r\n function lowerCaseOrderValue(value) {\r\n return _.map(value, (v, index) => (index === 1 ? v.toLowerCase() : v));\r\n }\r\n\r\n if (_.isEmpty(orderby)) {\r\n return {};\r\n }\r\n\r\n let $orderby;\r\n if (_.isArray(orderby)) {\r\n $orderby = _.map(orderby, value => lowerCaseOrderValue(value).join(' ')).join(',');\r\n } else {\r\n $orderby = _.map(orderby, (value, key) => `${key} ${value > 0 ? 'asc' : 'desc'}`).join(',');\r\n }\r\n\r\n return {\r\n $orderby,\r\n };\r\n}\r\n\r\nfunction parseFilter(filter) {\r\n if (_.isEmpty(filter) || _.isEmpty(filter.where)) {\r\n return {};\r\n }\r\n\r\n return {\r\n $filter: filter.where,\r\n };\r\n}\r\n\r\nfunction parseTop(top) {\r\n if (!top) {\r\n return {};\r\n }\r\n\r\n return {\r\n $top: top,\r\n };\r\n}\r\n\r\nfunction parseSkip(skip) {\r\n if (!skip) {\r\n return {};\r\n }\r\n\r\n return {\r\n $skip: skip,\r\n };\r\n}\r\n\r\nfunction parseCount(count) {\r\n if (count === undefined) {\r\n return {};\r\n }\r\n\r\n return {\r\n $count: count,\r\n };\r\n}\r\n\r\nfunction parseSelect(select, resource) {\r\n if (!select) return {};\r\n const parsed = {};\r\n const elementType = resource.type.elementType ? resource.type.elementType : resource.type;\r\n const { navigationPropertyNames } = elementType;\r\n const $select = select.filter(item => !_.contains(navigationPropertyNames, item)).join(',');\r\n const $expand = select.filter(item => _.contains(navigationPropertyNames, item)).join(',');\r\n\r\n if ($select.length) {\r\n parsed.$select = $select;\r\n }\r\n\r\n if ($expand.length) {\r\n parsed.$expand = $expand;\r\n }\r\n\r\n return parsed;\r\n}\r\n\r\nfunction parseSearch(search) {\r\n if (!search) {\r\n return {};\r\n }\r\n return { $search: search };\r\n}\r\n\r\nexport function parseQuery(query, edmResource) {\r\n return {\r\n ...parseOrderBy(query.orderby),\r\n ...parseFilter(query.filter),\r\n ...parseTop(query.top),\r\n ...parseSkip(query.skip),\r\n ...parseCount(query.count),\r\n ...parseSelect(query.select, edmResource),\r\n ...parseSearch(query.search),\r\n };\r\n}\r\n","import { v4 as uuidv4 } from 'uuid';\r\n\r\nfunction generateRequestId() {\r\n return uuidv4();\r\n}\r\n\r\nexport function getDefaultHeaderObj() {\r\n return {\r\n 'cache-control': 'no-cache',\r\n 'content-type': 'application/json',\r\n 'x-ms-lastwritetime': 'Max',\r\n 'x-ms-applicationname': 'bingadsweb',\r\n 'x-ms-requestid': generateRequestId(),\r\n };\r\n}\r\n","// TODO: make this edm as a separate package in smart project?\r\nimport _ from 'underscore';\r\nimport { EDM } from '@bingads-webui/edm-core';\r\nimport { resIdsPlugin } from '@bingads-webui/edm-resource-identifiers';\r\nimport { odataPlugin } from '@bingads-webui/edm-odata';\r\nimport { odataBulkUpsertPlugin } from '@bingads-webui/edm-bulk';\r\nimport { defineConstProperty } from '@bingads-webui/reflection';\r\nimport { schemas } from '@bingads-webui/campaign-odata-schemas';\r\nimport * as bulkUpsertSchema from '@bingads-webui/odata-bulk-upsert-config';\r\n\r\nexport const edm = new EDM({\r\n schemas: {\r\n $ROOT: {\r\n $$ref: '$ROOT',\r\n type: 'object',\r\n properties: {\r\n Customers: {\r\n type: 'array',\r\n items: schemas['Model/Customer'],\r\n },\r\n },\r\n $$ODataExtension: {\r\n Name: '$ROOT',\r\n NavigationProperty: [\r\n 'Customers',\r\n ],\r\n },\r\n },\r\n ..._.mapObject(\r\n schemas,\r\n (schema, name) => _.extend(schema, { $$ref: name })\r\n ),\r\n },\r\n});\r\n\r\nresIdsPlugin(edm);\r\n\r\nodataPlugin(edm, '' /* we don't use edm to send request so make host url empty */, {});\r\n\r\nodataBulkUpsertPlugin(edm, _.extend({}, window.campaignODataConfigs, {\r\n bulkUpsertSchema,\r\n}));\r\n\r\nconst root = edm.types.resolve('$ROOT');\r\n\r\nconst rootResourceIdentifier = new root.ResourceIdentifier();\r\ndefineConstProperty(edm, 'root', rootResourceIdentifier);\r\ndefineConstProperty(edm, 'Customers', rootResourceIdentifier.Customers);\r\n","import _ from 'underscore';\r\nimport { serialize, parse, populateIds } from '@bingads-webui/odata-bulk-upsert';\r\nimport { edm } from '../environment/edm';\r\n\r\nclass BulkError extends Error {\r\n constructor({\r\n entity,\r\n errors,\r\n }) {\r\n super();\r\n this.entity = entity;\r\n this.errors = errors;\r\n }\r\n}\r\n\r\nexport function getBulkUrl(params) {\r\n const { variables } = params;\r\n const { locator } = variables;\r\n const { descriptor } = locator;\r\n const { cid, aid } = descriptor;\r\n\r\n const entity = edm\r\n .Customers.$withKey(cid)\r\n .Accounts.$withKey(aid);\r\n\r\n return `${entity.path}/Default.BulkUpsert`;\r\n}\r\n\r\nexport function getBulkPayload(entitySchema, data) {\r\n const CsvRows = serialize(entitySchema, data);\r\n const payload = {\r\n CsvRows,\r\n };\r\n\r\n return payload;\r\n}\r\n\r\nexport function getProcessedBulkResult(response, request) {\r\n const { data } = request;\r\n const csvData = parse(response);\r\n const {\r\n results,\r\n errors,\r\n } = csvData;\r\n\r\n const ret = populateIds(results, data);\r\n\r\n if (!_.isEmpty(errors)) {\r\n throw new BulkError({\r\n entity: ret,\r\n errors,\r\n });\r\n }\r\n\r\n return Array.isArray(ret) ? ret : [ret];\r\n}\r\n","import URI from 'urijs';\r\nimport Promise from 'bluebird';\r\nimport RestfulServiceBase from '@bingads-webui-clientcenter/restful-service';\r\n\r\n// Some cc calls take LCIDCookie as local input, which will return non-English data\r\nconst localeParam = 'mkt';\r\nconst localeUs = 'en-US';\r\n\r\nconst isCCError = response => response.ResultType === 1 || response.ResultType === 3;\r\n\r\nexport function getRequestor({\r\n serviceRoot,\r\n locale,\r\n}) {\r\n return function networkRequestor(uri, requestVerb, options, body) {\r\n const restfulService = new RestfulServiceBase({});\r\n const cleanedRootUrl = URI(serviceRoot).path('').toString();\r\n const currentLocale = locale || localeUs;\r\n const uriWithLocale = URI(uri).addQuery(localeParam, currentLocale).toString();\r\n\r\n const url = `${cleanedRootUrl}${uriWithLocale}`;\r\n\r\n return restfulService.http.ajax(url, {\r\n method: requestVerb,\r\n data: JSON.stringify(body),\r\n ...options,\r\n }).then((response) => {\r\n if (isCCError(response)) {\r\n return Promise.reject(response);\r\n }\r\n return response;\r\n });\r\n };\r\n}\r\n","import { Schema } from '@bingads-webui-react/overreact';\r\n\r\nconst schemaToModelMapping = {\r\n user: 'user',\r\n customer: 'customer',\r\n account: 'account',\r\n sub_geography: 'sub_geography',\r\n time_zones: 'time_zones',\r\n countries: 'countries',\r\n currencies: 'currencies',\r\n currency_countries_mappings: 'currency_countries_mappings',\r\n country_currencies_mappings: 'country_currencies_mappings',\r\n validate_address: 'validate_address',\r\n sign_up: 'sign_up',\r\n estimate_taxes: 'estimate_taxes',\r\n top_up_limit: 'top_up_limit',\r\n offline_payment_instructions: 'offline_payment_instructions',\r\n create_expert_from_smart: 'create_expert_from_smart',\r\n payment_instrument: 'payment_instrument',\r\n get_coupon_details: 'get_coupon_details',\r\n get_coupon_string_for_signup: 'get_coupon_string_for_signup',\r\n get_coupon_valid_for_customer_website: 'get_coupon_valid_for_customer_website',\r\n save_coupon_string_for_signup: 'save_coupon_string_for_signup',\r\n country_timezones_mapping: 'country_timezones_mapping',\r\n};\r\n\r\nexport const schema = new Schema(schemaToModelMapping, () => { });\r\n","import {\r\n Environment,\r\n middlewareTypes,\r\n createFetchPolicyMiddleware,\r\n createErrorMiddleware,\r\n Store,\r\n} from '@bingads-webui-react/overreact';\r\nimport { schema } from './schema';\r\n\r\nexport const middlewares = {\r\n [middlewareTypes.FETCH_POLICY]: createFetchPolicyMiddleware(),\r\n [middlewareTypes.ERROR]: createErrorMiddleware(),\r\n};\r\n\r\nconst store = new Store();\r\nlet env = null;\r\n\r\nexport const CC_ENVIRONMENT_TAG = 'ClientCenter_Endpoint';\r\n\r\nexport function getEnvironmentInstance(requestor, customStore, customMiddlewares) {\r\n if (!env) {\r\n env = new Environment(\r\n requestor,\r\n schema,\r\n customStore || store,\r\n customMiddlewares || middlewares,\r\n CC_ENVIRONMENT_TAG\r\n );\r\n }\r\n\r\n // allow caller to update requestor\r\n env.networkRequestor = requestor;\r\n env.middlewares = customMiddlewares || middlewares;\r\n\r\n return env;\r\n}\r\n\r\nexport function environmentLookupFn(environmentTag) {\r\n return environmentTag === CC_ENVIRONMENT_TAG;\r\n}\r\n","import { useMemo } from 'react';\r\nimport { getRequestor } from './requestor';\r\nimport { getEnvironmentInstance } from './environment-instance';\r\n\r\nexport function useCCEnvironment({\r\n serviceRoot,\r\n store,\r\n middlewares,\r\n locale,\r\n}) {\r\n return useMemo(() => {\r\n const overreactRequestor = getRequestor({\r\n serviceRoot,\r\n locale,\r\n });\r\n return getEnvironmentInstance(overreactRequestor, store, middlewares);\r\n }, [locale, middlewares, serviceRoot, store]);\r\n}\r\n","import { v4 as uuidv4 } from 'uuid';\r\n\r\nfunction generateRequestId() {\r\n return uuidv4();\r\n}\r\n\r\nexport function getDefaultOptions() {\r\n return {\r\n contentType: 'application/json',\r\n dataType: 'json',\r\n cacheResponse: false,\r\n 'x-ms-requestid': generateRequestId(),\r\n xhrFields: {\r\n withCredentials: true,\r\n },\r\n };\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper/index';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid } = descriptor;\r\n\r\n const search = {\r\n uid,\r\n cid,\r\n id: uid,\r\n };\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/API/User${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user',\r\n verb: requestVerbs.GET,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n keySelector: variables => variables.locator.descriptor.uid,\r\n parentKeySelector: variables => variables.locator.descriptor.uid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: user => user.id,\r\n processorFn: response => response,\r\n});\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n FetchPolicy,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid } = descriptor;\r\n\r\n const search = {\r\n uid,\r\n cid,\r\n id: uid,\r\n };\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/API/User${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nfunction ccPayloadFactory(params) {\r\n const { data } = params;\r\n return data.User ? data : { User: data };\r\n}\r\n\r\nexport const mutationRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user',\r\n verb: requestVerbs.PATCH,\r\n fetchPolicy: FetchPolicy.NetworkOnly,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n payloadFactoryFn: ccPayloadFactory,\r\n keySelector: variables => variables.locator.descriptor.uid,\r\n parentKeySelector: variables => variables.locator.descriptor.uid,\r\n});\r\n\r\nexport const mutationResponseContract = createResponseContract({\r\n requestContract: mutationRequestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: user => user.id,\r\n processorFn: response => response,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n useMutation,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { environmentLookupFn } from '../../../environment/environment-instance';\r\nimport {\r\n fetchRequestContract,\r\n fetchResponseContract,\r\n} from '../spec/fetch';\r\n\r\nimport {\r\n mutationRequestContract,\r\n mutationResponseContract,\r\n} from '../spec/mutation';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\nconst mutationSpec = createSpec(\r\n mutationRequestContract, mutationResponseContract,\r\n specTypes.MUTATION, null, environmentLookupFn\r\n);\r\n\r\nconst DEFAULT_CONFIG_VALLUE = {};\r\n\r\nexport function useUser(dataLocator, config = DEFAULT_CONFIG_VALLUE) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || DEFAULT_CONFIG_VALLUE,\r\n refetch: config.refetch || DEFAULT_CONFIG_VALLUE,\r\n mutation: config.mutation || DEFAULT_CONFIG_VALLUE,\r\n }), [config]);\r\n\r\n const { fetch: fetchConfig, refetch, mutation } = defaultConfig;\r\n\r\n const fetch = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetch);\r\n\r\n const read = useCallback((param = {}, requestConfig) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n const updateFn = useMutation(dataRefId, mutationSpec, mutation.update);\r\n\r\n const update = useCallback((data, ...rest) => {\r\n updateFn({ ...dataLocator }, data, ...rest);\r\n }, [dataLocator, updateFn]);\r\n\r\n const [data, error] = fetch;\r\n\r\n return [{ data, error }, { read, update }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n FetchPolicy,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper/index';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid } = descriptor;\r\n\r\n const search = {\r\n uid,\r\n cid,\r\n id: cid,\r\n };\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/API/Customer${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user:customer',\r\n verb: requestVerbs.GET,\r\n fetchPolicy: FetchPolicy.StoreOrNetwork,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n keySelector: variables => variables.locator.descriptor.cid,\r\n parentKeySelector: variables => variables.locator.descriptor.uid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: customer => customer.id,\r\n processorFn: response => response,\r\n});\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n FetchPolicy,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid } = descriptor;\r\n\r\n const search = {\r\n uid,\r\n cid,\r\n id: cid,\r\n };\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/API/Customer${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nfunction ccPayloadFactory(params) {\r\n const { data } = params;\r\n return data.Customer ? data : { Customer: data };\r\n}\r\n\r\nexport const mutationRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user:customer',\r\n verb: requestVerbs.PATCH,\r\n fetchPolicy: FetchPolicy.NetworkOnly,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n payloadFactoryFn: ccPayloadFactory,\r\n keySelector: variables => variables.locator.descriptor.cid,\r\n parentKeySelector: variables => variables.locator.descriptor.uid,\r\n});\r\n\r\nexport const mutationResponseContract = createResponseContract({\r\n requestContract: mutationRequestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: customer => customer.id,\r\n processorFn: response => response,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n useMutation,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport {\r\n fetchRequestContract,\r\n fetchResponseContract,\r\n} from '../spec/fetch';\r\n\r\nimport {\r\n mutationRequestContract,\r\n mutationResponseContract,\r\n} from '../spec/mutation';\r\n\r\nimport { environmentLookupFn } from '../../../environment/environment-instance';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\nconst mutationSpec = createSpec(\r\n mutationRequestContract, mutationResponseContract,\r\n specTypes.MUTATION, null, environmentLookupFn\r\n);\r\n\r\nexport function useCustomer(dataLocator, config = {}) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n mutation: config.mutation || {},\r\n }), [config]);\r\n\r\n const { fetch: fetchConfig, refetch, mutation } = defaultConfig;\r\n\r\n const fetch = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetch);\r\n\r\n const read = useCallback((param = {}, requestConfig) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n const updateFn = useMutation(dataRefId, mutationSpec, mutation.update);\r\n\r\n const update = useCallback((data, ...rest) => {\r\n updateFn({ ...dataLocator }, data, ...rest);\r\n }, [dataLocator, updateFn]);\r\n\r\n const [data, error] = fetch;\r\n\r\n return [{ data, error }, { read, update }];\r\n}\r\n\r\nexport function useCustomerWithDefaultSetting({\r\n cid,\r\n uid,\r\n}) {\r\n const customerVariables = useMemo(() => ({\r\n locator: {\r\n descriptor: { cid, uid },\r\n },\r\n }), [cid, uid]);\r\n return useCustomer(customerVariables);\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n FetchPolicy,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper/index';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid, aid } = descriptor;\r\n\r\n const search = {\r\n uid,\r\n cid,\r\n id: aid,\r\n };\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/API/Account${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user:customer:account',\r\n verb: requestVerbs.GET,\r\n fetchPolicy: FetchPolicy.StoreOrNetwork,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n keySelector: variables => variables.locator.descriptor.aid,\r\n parentKeySelector: variables => variables.locator.descriptor.cid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: account => account.id,\r\n processorFn: response => response,\r\n});\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n FetchPolicy,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid, aid } = descriptor;\r\n\r\n const search = {\r\n uid,\r\n cid,\r\n id: aid,\r\n };\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/API/Account${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nfunction ccPayloadFactory(params) {\r\n const { data } = params;\r\n return data.Account ? data : { Account: data };\r\n}\r\n\r\nexport const mutationRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user:customer:account',\r\n verb: requestVerbs.PATCH,\r\n fetchPolicy: FetchPolicy.NetworkOnly,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n payloadFactoryFn: ccPayloadFactory,\r\n keySelector: variables => variables.locator.descriptor.aid,\r\n parentKeySelector: variables => variables.locator.descriptor.cid,\r\n});\r\n\r\nexport const mutationResponseContract = createResponseContract({\r\n requestContract: mutationRequestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: account => account.id,\r\n processorFn: response => response,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n useMutation,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { environmentLookupFn } from '../../../environment/environment-instance';\r\nimport {\r\n fetchRequestContract,\r\n fetchResponseContract,\r\n} from '../spec/fetch';\r\n\r\nimport {\r\n mutationRequestContract,\r\n mutationResponseContract,\r\n} from '../spec/mutation';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\nconst mutationSpec = createSpec(\r\n mutationRequestContract, mutationResponseContract,\r\n specTypes.MUTATION, null, environmentLookupFn\r\n);\r\n\r\nexport function useAccount(dataLocator, config = {}) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n mutation: config.mutation || {},\r\n }), [config]);\r\n\r\n const { fetch: fetchConfig, refetch, mutation } = defaultConfig;\r\n\r\n const fetch = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetch);\r\n\r\n const read = useCallback((param = {}, requestConfig) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n const updateFn = useMutation(dataRefId, mutationSpec, mutation.update);\r\n\r\n const update = useCallback((data, ...rest) => {\r\n updateFn({ ...dataLocator }, data, ...rest);\r\n }, [dataLocator, updateFn]);\r\n\r\n const updateWithVariables = useCallback((data, variables, ...rest) => {\r\n updateFn({ ...dataLocator, ...variables }, data, ...rest);\r\n }, [dataLocator, updateFn]);\r\n\r\n const [data, error] = fetch;\r\n\r\n return [{ data, error }, { read, update, updateWithVariables }];\r\n}\r\n\r\nexport function useAccountWithDefaultSetting({\r\n aid,\r\n cid,\r\n uid,\r\n}) {\r\n const accountVariables = useMemo(() => ({\r\n locator: {\r\n descriptor: { cid, aid, uid },\r\n },\r\n }), [aid, uid, cid]);\r\n\r\n return useAccount(accountVariables);\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n FetchPolicy,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper/index';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n top,\r\n skip,\r\n predicates,\r\n name,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid } = descriptor;\r\n\r\n let search = {\r\n uid,\r\n cid,\r\n customerId: cid,\r\n };\r\n if (_.isNumber(top)) {\r\n search = {\r\n ...search,\r\n top,\r\n };\r\n }\r\n if (_.isNumber(skip)) {\r\n search = {\r\n ...search,\r\n skip,\r\n };\r\n }\r\n if (predicates) {\r\n search = {\r\n ...search,\r\n predicates: JSON.stringify(predicates),\r\n };\r\n }\r\n if (name) {\r\n search = {\r\n ...search,\r\n name,\r\n };\r\n }\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/API/Account${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user:customer:account',\r\n verb: requestVerbs.GET,\r\n fetchPolicy: FetchPolicy.StoreOrNetwork,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n parentKeySelector: variables => variables.locator.descriptor.cid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: account => account.id,\r\n processorFn: response => response.value,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { environmentLookupFn } from '../../../environment/environment-instance';\r\nimport {\r\n fetchRequestContract,\r\n fetchResponseContract,\r\n} from '../spec/coll-fetch';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\n\r\nconst DEFAULT_CONFIG = {};\r\n\r\nexport function useAccounts(dataLocator, config = DEFAULT_CONFIG) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n\r\n const { fetch: fetchConfig, refetch } = defaultConfig;\r\n\r\n const fetch = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetch);\r\n\r\n const read = useCallback((param = {}, requestConfig, ...rest) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig, ...rest);\r\n }, [dataLocator, refetchFn]);\r\n\r\n const [data, error] = fetch;\r\n\r\n return [{ data, error }, { read }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper/index';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n countryCode,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid } = descriptor;\r\n\r\n const search = {\r\n uid,\r\n cid,\r\n countryCode,\r\n };\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/API/DomainData/LocalizedMappingSubGeography${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user:customer:sub_geography',\r\n verb: requestVerbs.GET,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n keySelector: variables => variables.countryCode,\r\n parentKeySelector: variables => variables.locator.descriptor.cid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: subGeography => subGeography.Key,\r\n processorFn: response => response.value,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport {\r\n fetchRequestContract,\r\n fetchResponseContract,\r\n} from '../spec/fetch';\r\nimport { environmentLookupFn } from '../../../environment/environment-instance';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\n\r\nexport function useSubGeographies(dataLocator, config = {}) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n\r\n const { fetch: fetchConfig, refetch } = defaultConfig;\r\n\r\n const [data, error] = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetch);\r\n\r\n const read = useCallback((param = {}, requestConfig) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n return [{ data, error }, { read }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper/index';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid } = descriptor;\r\n\r\n const search = {\r\n uid,\r\n cid,\r\n };\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/API/DomainData/TimeZoneMapping${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user:customer:time_zones',\r\n verb: requestVerbs.GET,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n parentKeySelector: variables => variables.locator.descriptor.cid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: timeZones => timeZones.id,\r\n processorFn: response => response,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport {\r\n fetchRequestContract,\r\n fetchResponseContract,\r\n} from '../spec/coll-fetch';\r\n\r\nimport { environmentLookupFn } from '../../../environment/environment-instance';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec =\r\n createSpec(fetchRequestContract, fetchResponseContract, specTypes.REFETCH);\r\n\r\nexport function useTimeZones(dataLocator, config = {}) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n\r\n const { fetch: fetchConfig, refetch } = defaultConfig;\r\n\r\n const [data, error] = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetch);\r\n\r\n const read = useCallback((param = {}, requestConfig) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n return [{ data, error }, { read }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper/index';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid } = descriptor;\r\n\r\n const search = {\r\n uid,\r\n cid,\r\n };\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/API/DomainData/CountryMapping${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user:customer:countries',\r\n verb: requestVerbs.GET,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n parentKeySelector: variables => variables.locator.descriptor.cid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: countries => countries.id,\r\n processorFn: response => response,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport {\r\n fetchRequestContract,\r\n fetchResponseContract,\r\n} from '../spec/coll-fetch';\r\nimport { environmentLookupFn } from '../../../environment/environment-instance';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\n\r\nexport function useCountries(dataLocator, config = {}) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n\r\n const { fetch: fetchConfig, refetch } = defaultConfig;\r\n\r\n const [data, error] = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetch);\r\n\r\n const read = useCallback((param = {}, requestConfig) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n return [{ data, error }, { read }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper/index';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid } = descriptor;\r\n\r\n const search = {\r\n uid,\r\n cid,\r\n };\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/API/DomainData/CurrencyMapping${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user:customer:currencies',\r\n verb: requestVerbs.GET,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n parentKeySelector: variables => variables.locator.descriptor.cid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: currencies => currencies.id,\r\n processorFn: response => response,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport {\r\n fetchRequestContract,\r\n fetchResponseContract,\r\n} from '../spec/coll-fetch';\r\n\r\nimport { environmentLookupFn } from '../../../environment/environment-instance';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\n\r\nexport function useCurrencies(dataLocator, config = {}) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n\r\n const { fetch: fetchConfig, refetch } = defaultConfig;\r\n\r\n const [data, error] = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetch);\r\n\r\n const read = useCallback((param = {}, requestConfig) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n return [{ data, error }, { read }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper/index';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid } = descriptor;\r\n\r\n const search = {\r\n uid,\r\n cid,\r\n };\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/API/Currency/CurrencyCountriesMapping${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user:customer:currency_countries_mappings',\r\n verb: requestVerbs.GET,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n parentKeySelector: variables => variables.locator.descriptor.cid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: currencyCountriesMappings => currencyCountriesMappings.currency,\r\n processorFn: response => response,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport {\r\n fetchRequestContract,\r\n fetchResponseContract,\r\n} from '../spec/coll-fetch';\r\n\r\nimport { environmentLookupFn } from '../../../environment/environment-instance';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\n\r\nexport function useCurrencyCountriesMappings(dataLocator, config = {}) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n\r\n const { fetch: fetchConfig, refetch } = defaultConfig;\r\n\r\n const [data, error] = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetch);\r\n\r\n const read = useCallback((param = {}, requestConfig) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n return [{ data, error }, { read }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper/index';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid } = descriptor;\r\n\r\n const search = {\r\n uid,\r\n cid,\r\n };\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/API/Currency/CountryCurrenciesMapping${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user:customer:country_currencies_mappings',\r\n verb: requestVerbs.GET,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n parentKeySelector: variables => variables.locator.descriptor.cid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: countryCurrenciesMapping => countryCurrenciesMapping.country,\r\n processorFn: response => response,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport {\r\n fetchRequestContract,\r\n fetchResponseContract,\r\n} from '../spec/coll-fetch';\r\n\r\nimport { environmentLookupFn } from '../../../environment/environment-instance';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\n\r\nexport function useCountryCurrenciesMappings(dataLocator, config = {}) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n\r\n const { fetch: fetchConfig, refetch } = defaultConfig;\r\n\r\n const [data, error] = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetch);\r\n\r\n const read = useCallback((param = {}, requestConfig) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n return [{ data, error }, { read }];\r\n}\r\n","import {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper/index';\r\n\r\nfunction ccUrlFactory() {\r\n return 'cc/Account/ValidateAddressAndTax';\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nfunction ccPayloadFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n address,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid, aid } = descriptor;\r\n\r\n return {\r\n uid,\r\n customerId: cid,\r\n accountId: aid,\r\n Account: {\r\n BusinessAddress: address,\r\n },\r\n };\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user:customer:account:validate_address',\r\n verb: requestVerbs.POST,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n payloadFactoryFn: ccPayloadFactory,\r\n parentKeySelector: variables => variables.locator.descriptor.aid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: entity => entity.OriginalAddress.BusinessName,\r\n processorFn: response => response,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { environmentLookupFn } from '../../../environment/environment-instance';\r\nimport {\r\n fetchRequestContract,\r\n fetchResponseContract,\r\n} from '../spec/fetch';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\n\r\nexport function useValidateAddress(dataLocator, config = {}) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n\r\n const { fetch: fetchConfig, refetch } = defaultConfig;\r\n\r\n const [data, error] = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetch);\r\n\r\n const read = useCallback((param = {}, requestConfig) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n return [{ data, error }, { read }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport stringify from 'json-stable-stringify';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n FetchPolicy,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper/index';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n isMca,\r\n isUp,\r\n noupsw,\r\n isExpertStandalone,\r\n isSubscriptionAds,\r\n isStreamlined,\r\n isPMaxLite,\r\n isChinaSignup,\r\n isFullyManagedFacebookAdAccountEnabled,\r\n isBingAdsOptional,\r\n authType,\r\n isSwitchedFromSmart,\r\n } = variables;\r\n\r\n let search = {};\r\n let prefix = '';\r\n const suffix = [];\r\n\r\n if (isMca) {\r\n search = { isMca: true };\r\n } else if (isSubscriptionAds) {\r\n prefix = 'subscription/';\r\n } else if (isUp) {\r\n search = { upse: true, noupsw };\r\n prefix = 'enhanced/';\r\n\r\n if (isFullyManagedFacebookAdAccountEnabled) {\r\n // if mfba=true, customer will be created with ManagedFacebookAdAccount DB pilot set to true\r\n search.mfba = 'true';\r\n }\r\n if (isBingAdsOptional) {\r\n suffix.push('bing-opt-out');\r\n }\r\n } else if (isChinaSignup) {\r\n prefix = 'china/';\r\n } else if (isExpertStandalone) {\r\n prefix = 'expert/';\r\n } else if (isStreamlined) {\r\n // For streamlined signup, we'll create ESC account by default\r\n // If we do need to create expert account, we'll pass search.isExpert='true'\r\n prefix = 'unified/';\r\n } else if (isPMaxLite) {\r\n prefix = 'PMaxLite/';\r\n } else if (isSwitchedFromSmart) {\r\n prefix = 'smart/';\r\n }\r\n\r\n if (!_.isEmpty(authType)) {\r\n search.idp = authType;\r\n }\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n const suffixString = _.isEmpty(suffix) ? '' : suffix.join('&');\r\n\r\n const searchAndSuffixString = searchString ? `${searchString}&${suffixString}` : `?${suffixString}`;\r\n\r\n return `${prefix}Signup/CustomerAccountUserSignup${searchAndSuffixString}`;\r\n}\r\n\r\nfunction ccOptionsFactory(params) {\r\n const { data } = params;\r\n const defaultOptions = getDefaultOptions();\r\n return {\r\n ...defaultOptions,\r\n headers: {\r\n 'X-Requested-With': 'XMLHttpRequest',\r\n },\r\n contentType: 'application/x-www-form-urlencoded',\r\n data,\r\n };\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'sign_up',\r\n verb: requestVerbs.POST,\r\n fetchPolicy: FetchPolicy.NetworkOnly,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n parentKeySelector: variables => stringify(variables),\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: entity => stringify(entity),\r\n processorFn: response => response,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport {\r\n fetchRequestContract,\r\n fetchResponseContract,\r\n} from '../spec/fetch';\r\nimport { environmentLookupFn } from '../../../environment/environment-instance';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\n\r\nexport function useSignUp(dataLocator, config = {}) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n const { fetch: fetchConfig, refetch: refetchConfig } = defaultConfig;\r\n const [data, error] = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetchConfig);\r\n\r\n const read = useCallback((param = {}, requestConfig) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n payload: { ...param.data },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n return [{ data, error }, { read }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport stringify from 'json-stable-stringify';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper/index';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n totalAmount,\r\n isTaxIncluded,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid, aid } = descriptor;\r\n\r\n const search = {\r\n uid,\r\n cid,\r\n accountId: aid,\r\n totalAmount,\r\n isTaxIncluded,\r\n };\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/API/Billing/EstimateTaxesAllPayments${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user:customer:account:estimate_taxes',\r\n verb: requestVerbs.GET,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n parentKeySelector: variables => variables.locator.descriptor.aid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: estimateTaxes => stringify(estimateTaxes),\r\n processorFn: response => response,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport {\r\n fetchRequestContract,\r\n fetchResponseContract,\r\n} from '../spec/fetch';\r\nimport { environmentLookupFn } from '../../../environment/environment-instance';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\n\r\nexport function useEstimateTaxes(dataLocator, config = {}) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n\r\n const { fetch: fetchConfig, refetch } = defaultConfig;\r\n\r\n const [data, error] = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetch);\r\n\r\n const read = useCallback((param = {}, requestConfig) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n return [{ data, error }, { read }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport stringify from 'json-stable-stringify';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper/index';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid, aid } = descriptor;\r\n\r\n const search = {\r\n uid,\r\n cid,\r\n accountId: aid,\r\n customerId: cid,\r\n };\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/API/PaymentUtility/TopUpLimit${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user:customer:account:top_up_limit',\r\n verb: requestVerbs.GET,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n parentKeySelector: variables => variables.locator.descriptor.aid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: topUpLimit => stringify(topUpLimit),\r\n processorFn: response => response,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport {\r\n fetchRequestContract,\r\n fetchResponseContract,\r\n} from '../spec/fetch';\r\nimport { environmentLookupFn } from '../../../environment/environment-instance';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\n\r\nexport function useTopUpLimit(dataLocator, config = {}) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n\r\n const { fetch: fetchConfig, refetch } = defaultConfig;\r\n\r\n const [data, error] = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetch);\r\n\r\n const read = useCallback((param = {}, requestConfig) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n return [{ data, error }, { read }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport stringify from 'json-stable-stringify';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper/index';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n currencyCode,\r\n countryCode,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid } = descriptor;\r\n\r\n const search = {\r\n uid,\r\n cid,\r\n currencyCode,\r\n countryCode,\r\n };\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/Payment/OfflinePaymentInstructions${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user:customer:offline_payment_instructions',\r\n verb: requestVerbs.GET,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n parentKeySelector: variables => variables.locator.descriptor.cid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: OfflinePaymentInstructions => stringify(OfflinePaymentInstructions),\r\n processorFn: response => response,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport {\r\n fetchRequestContract,\r\n fetchResponseContract,\r\n} from '../spec/fetch';\r\nimport { environmentLookupFn } from '../../../environment/environment-instance';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\n\r\nexport function useOfflinePaymentInstructions(dataLocator, config = {}) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n\r\n const { fetch: fetchConfig, refetch } = defaultConfig;\r\n\r\n const [data, error] = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetch);\r\n\r\n const read = useCallback((param = {}, requestConfig) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n return [{ data, error }, { read }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper/index';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid, aid } = descriptor;\r\n\r\n const search = {\r\n uid,\r\n cid,\r\n accountId: aid,\r\n };\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/API/Account/CreateExpertFromSmart${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n const defaultOptions = getDefaultOptions();\r\n return {\r\n ...defaultOptions,\r\n headers: {\r\n 'X-Requested-With': 'XMLHttpRequest',\r\n },\r\n };\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user:customer:account:create_expert_from_smart',\r\n verb: requestVerbs.POST,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n parentKeySelector: variables => variables.locator.descriptor.aid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: entity => entity.id,\r\n processorFn: response => response,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport {\r\n fetchRequestContract,\r\n fetchResponseContract,\r\n} from '../spec/fetch';\r\nimport { environmentLookupFn } from '../../../environment/environment-instance';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\n\r\nexport function useCreateExpertFromSmart(dataLocator, config = {}) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n const { fetch: fetchConfig, refetch: refetchConfig } = defaultConfig;\r\n const [data, error] = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetchConfig);\r\n\r\n const read = useCallback((param = {}, requestConfig) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n return [{ data, error }, { read }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n FetchPolicy,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper/index';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n Id,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid } = descriptor;\r\n\r\n const search = {\r\n Id,\r\n cid,\r\n uid,\r\n };\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/API/PaymentInstrument${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user:customer:payment_instrument',\r\n verb: requestVerbs.GET,\r\n fetchPolicy: FetchPolicy.StoreOrNetwork,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n keySelector: variables => variables.Id,\r\n parentKeySelector: variables => variables.locator.descriptor.cid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: paymentInstrument => paymentInstrument.Id,\r\n processorFn: response => response,\r\n});\r\n\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { environmentLookupFn } from '../../../environment/environment-instance';\r\nimport {\r\n fetchRequestContract,\r\n fetchResponseContract,\r\n} from '../spec/fetch';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\n\r\nconst DEFAULT_CONFIG = {};\r\n\r\nexport function usePaymentInstrument(dataLocator, config = DEFAULT_CONFIG) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n\r\n const { fetch: fetchConfig, refetch } = defaultConfig;\r\n\r\n const [data, error] = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetch);\r\n\r\n const read = useCallback((param = {}, requestConfig) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n return [{ data, error }, { read }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n FetchPolicy,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper/index';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n ccl,\r\n cco,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid } = descriptor;\r\n\r\n let search = {\r\n cid,\r\n uid,\r\n };\r\n if (ccl) {\r\n search = {\r\n ...search,\r\n ccl,\r\n };\r\n }\r\n if (cco) {\r\n search = {\r\n ...search,\r\n cco,\r\n };\r\n }\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/API/Coupon/GetCouponDetails${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user:customer:get_coupon_details',\r\n verb: requestVerbs.GET,\r\n fetchPolicy: FetchPolicy.NetworkOnly,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n parentKeySelector: variables => variables.locator.descriptor.cid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: coupon => coupon.id,\r\n processorFn: response => response,\r\n});\r\n\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { environmentLookupFn } from '../../../environment/environment-instance';\r\nimport {\r\n fetchRequestContract,\r\n fetchResponseContract,\r\n} from '../spec/fetch';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\n\r\nconst DEFAULT_CONFIG = {};\r\n\r\nexport function useGetCouponDetails(dataLocator, config = DEFAULT_CONFIG) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n\r\n const { fetch: fetchConfig, refetch } = defaultConfig;\r\n\r\n const [data, error] = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetch);\r\n\r\n const read = useCallback((param = {}, requestConfig, ...rest) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig, ...rest);\r\n }, [dataLocator, refetchFn]);\r\n\r\n return [{ data, error }, { read }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n FetchPolicy,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper/index';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid } = descriptor;\r\n\r\n const search = {\r\n cid,\r\n uid,\r\n };\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/API/Coupon/GetCouponStringForSignup${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user:customer:get_coupon_string_for_signup',\r\n verb: requestVerbs.GET,\r\n fetchPolicy: FetchPolicy.NetworkOnly,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n parentKeySelector: variables => variables.locator.descriptor.cid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: coupon => coupon.id,\r\n processorFn: response => response,\r\n});\r\n\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { environmentLookupFn } from '../../../environment/environment-instance';\r\nimport {\r\n fetchRequestContract,\r\n fetchResponseContract,\r\n} from '../spec/fetch';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\n\r\nconst DEFAULT_CONFIG = {};\r\n\r\nexport function useGetCouponStringForSignup(dataLocator, config = DEFAULT_CONFIG) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n\r\n const { fetch: fetchConfig, refetch } = defaultConfig;\r\n\r\n const [data, error] = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetch);\r\n\r\n const read = useCallback((param = {}, requestConfig, ...rest) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig, ...rest);\r\n }, [dataLocator, refetchFn]);\r\n\r\n return [{ data, error }, { read }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n FetchPolicy,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper/index';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n websiteUrl,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid } = descriptor;\r\n\r\n const search = {\r\n cid,\r\n uid,\r\n websiteUrl,\r\n };\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/API/Coupon/GetCouponValidForCustomerWebsite${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user:customer:get_coupon_valid_for_customer_website',\r\n verb: requestVerbs.GET,\r\n fetchPolicy: FetchPolicy.NetworkOnly,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n parentKeySelector: variables => variables.locator.descriptor.cid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: result => result.websiteURL,\r\n processorFn: response => response,\r\n});\r\n\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { environmentLookupFn } from '../../../environment/environment-instance';\r\nimport {\r\n fetchRequestContract,\r\n fetchResponseContract,\r\n} from '../spec/fetch';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\n\r\nconst DEFAULT_CONFIG = {};\r\n\r\nexport function useGetCouponValidForCustomerWebsite(dataLocator, config = DEFAULT_CONFIG) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n\r\n const { fetch: fetchConfig, refetch } = defaultConfig;\r\n\r\n const [data, error] = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetch);\r\n\r\n const read = useCallback((param = {}, requestConfig, ...rest) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig, ...rest);\r\n }, [dataLocator, refetchFn]);\r\n\r\n return [{ data, error }, { read }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n FetchPolicy,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper/index';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n id,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid } = descriptor;\r\n\r\n const search = {\r\n cid,\r\n uid,\r\n id,\r\n };\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/API/Coupon/SaveCouponStringForSignup${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nfunction ccPayloadFactory(params) {\r\n const { data } = params;\r\n return data;\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user:customer:save_coupon_string_for_signup',\r\n verb: requestVerbs.PATCH,\r\n fetchPolicy: FetchPolicy.NetworkOnly,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n payloadFactoryFn: ccPayloadFactory,\r\n parentKeySelector: variables => variables.locator.descriptor.cid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: coupon => coupon.couponString,\r\n processorFn: response => response,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { environmentLookupFn } from '../../../environment/environment-instance';\r\nimport {\r\n fetchRequestContract,\r\n fetchResponseContract,\r\n} from '../spec/fetch';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\n\r\nconst DEFAULT_CONFIG = {};\r\n\r\nexport function useSaveCouponStringForSignup(dataLocator, config = DEFAULT_CONFIG) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n\r\n const { fetch: fetchConfig, refetch } = defaultConfig;\r\n\r\n const [data, error] = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetch);\r\n\r\n const update = useCallback((param = {}, requestConfig, ...rest) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n payload: { ...param.data },\r\n }, requestConfig, ...rest);\r\n }, [dataLocator, refetchFn]);\r\n\r\n return [{ data, error }, { update }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { schema } from '../../../environment/schema';\r\nimport { getDefaultOptions } from '../../../request-contract-helper/index';\r\n\r\nfunction ccUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const { uid, cid } = descriptor;\r\n\r\n const search = {\r\n uid,\r\n cid,\r\n };\r\n\r\n const searchString = _.isEmpty(search) ? '' : `?${queryString.stringify(search)}`;\r\n\r\n return `cc/API/TimeZone/GetTimeZonesPerCountry${searchString}`;\r\n}\r\n\r\nfunction ccOptionsFactory() {\r\n return getDefaultOptions();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'user:customer:country_timezones_mapping',\r\n verb: requestVerbs.GET,\r\n uriFactoryFn: ccUrlFactory,\r\n headerFactoryFn: ccOptionsFactory,\r\n parentKeySelector: variables => variables.locator.descriptor.cid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: timeZones => timeZones.country,\r\n processorFn: response => response,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport {\r\n fetchRequestContract,\r\n fetchResponseContract,\r\n} from '../spec/coll-fetch';\r\n\r\nimport { environmentLookupFn } from '../../../environment/environment-instance';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec =\r\n createSpec(fetchRequestContract, fetchResponseContract, specTypes.REFETCH);\r\n\r\nexport function useCountryTimeZonesMapping(dataLocator, config = {}) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n\r\n const { fetch: fetchConfig, refetch } = defaultConfig;\r\n\r\n const [data, error] = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetch);\r\n\r\n const read = useCallback((param = {}, requestConfig) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n return [{ data, error }, { read }];\r\n}\r\n","import _ from 'underscore';\r\nimport { EDM } from '@bingads-webui/edm-core';\r\nimport { resIdsPlugin } from '@bingads-webui/edm-resource-identifiers';\r\nimport { odataPlugin } from '@bingads-webui/edm-odata';\r\nimport { defineConstProperty } from '@bingads-webui/reflection';\r\nimport { schemas } from '@bingads-webui/campaign-odata-schemas';\r\n\r\nexport const edm = new EDM({\r\n schemas: {\r\n $ROOT: {\r\n $$ref: '$ROOT',\r\n type: 'object',\r\n properties: {\r\n Customers: {\r\n type: 'array',\r\n items: schemas['Model/Customer'],\r\n },\r\n },\r\n $$ODataExtension: {\r\n Name: '$ROOT',\r\n NavigationProperty: [\r\n 'Customers',\r\n ],\r\n },\r\n },\r\n ..._.mapObject(\r\n schemas,\r\n (schema, name) => _.extend(schema, { $$ref: name })\r\n ),\r\n },\r\n});\r\n\r\nresIdsPlugin(edm);\r\n\r\nodataPlugin(edm, '' /* we don't use edm to send request so make host url empty */, {});\r\nconst root = edm.types.resolve('$ROOT');\r\n\r\nconst rootResourceIdentifier = new root.ResourceIdentifier();\r\ndefineConstProperty(edm, 'root', rootResourceIdentifier);\r\ndefineConstProperty(edm, 'Customers', rootResourceIdentifier.Customers);\r\n","import { Schema } from '@bingads-webui-react/overreact';\r\n\r\nimport { edm } from './edm';\r\n\r\nconst schemaToModelMapping = {\r\n customer: 'Model/Customer',\r\n account: 'Model/Account',\r\n campaign: 'Model/Campaign',\r\n ad_group: 'Model/AdGroup',\r\n ad: 'Model/Ad',\r\n keyword: 'Model/Keyword',\r\n campaign_criterion: 'Model/CampaignCriterion',\r\n target_suggestion: 'TargetSuggestion',\r\n rsa_suggestion: 'RsaSuggestion',\r\n ad_strength: 'AdStrength',\r\n extracted_business_info: 'BusinessInfo',\r\n location: 'Model/Location',\r\n budget_suggestion: 'Model/SuggestBudgetResponse',\r\n};\r\n\r\nexport const schema = new Schema(schemaToModelMapping, name => edm.schema.schemas[name]);\r\n","import {\r\n Environment,\r\n middlewareTypes,\r\n createFetchPolicyMiddleware,\r\n createErrorMiddleware,\r\n Store,\r\n} from '@bingads-webui-react/overreact';\r\nimport { schema } from './schema';\r\n\r\nexport { getRequestor } from './requestor';\r\n\r\nconst middlewares = {\r\n [middlewareTypes.FETCH_POLICY]: createFetchPolicyMiddleware({\r\n cacheExpirationDuration: 60 * 60 * 1000,\r\n }),\r\n [middlewareTypes.ERROR]: createErrorMiddleware(),\r\n};\r\n\r\n// TODO: do we really need to export this Store from overreact?\r\nconst store = new Store();\r\nlet env = null;\r\n\r\nexport const EXPERT_ENVIRONMENT_TAG = 'Expert_Endpoint';\r\n\r\nexport function getEnvironmentInstance(requestor, customStore, customMiddlewares) {\r\n if (!env) {\r\n env = new Environment(\r\n requestor,\r\n schema,\r\n customStore || store,\r\n customMiddlewares || middlewares,\r\n EXPERT_ENVIRONMENT_TAG\r\n );\r\n }\r\n // allow caller to update requestor\r\n env.networkRequestor = requestor;\r\n env.middlewares = customMiddlewares || middlewares;\r\n\r\n return env;\r\n}\r\n\r\nexport function environmentLookupFn(environmentTag) {\r\n return environmentTag === EXPERT_ENVIRONMENT_TAG;\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n FetchPolicy,\r\n} from '@bingads-webui-react/overreact';\r\nimport { parseQuery, getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nimport { edm } from '../../../environment/edm';\r\nimport { schema } from '../../../environment/schema';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const { locator } = variables;\r\n const { descriptor } = locator;\r\n const {\r\n cid,\r\n aid,\r\n cpid,\r\n } = descriptor;\r\n\r\n const entity = edm\r\n .Customers.$withKey(cid)\r\n .Accounts.$withKey(aid)\r\n .Campaigns.$withKey(cpid);\r\n\r\n const initialSearch = _.omit(variables, 'locator');\r\n const search = {\r\n ...initialSearch,\r\n select: ['Budget'],\r\n };\r\n\r\n const parsedSearch = {\r\n ...parseQuery(search, entity),\r\n };\r\n const searchCompact = _.omit(parsedSearch, x => _.isNull(x) || _.isUndefined(x));\r\n const searchString = _.isEmpty(searchCompact) ? '' : `?${queryString.stringify(searchCompact)}`;\r\n\r\n return `${entity.path}${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory() {\r\n return getDefaultHeaderObj();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:campaign',\r\n verb: requestVerbs.GET,\r\n fetchPolicy: FetchPolicy.StoreOrNetwork,\r\n uriFactoryFn: odataUrlFactory,\r\n headerFactoryFn: odataHeaderFactory,\r\n keySelector: variables => variables.locator.descriptor.cpid,\r\n parentKeySelector: variables => variables.locator.descriptor.aid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: campaign => campaign.Id.toString(),\r\n processorFn: response => response,\r\n});\r\n","import {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n FetchPolicy,\r\n} from '@bingads-webui-react/overreact';\r\nimport { getBulkUrl, getBulkPayload, getProcessedBulkResult, getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nimport { edm } from '../../../environment/edm';\r\nimport { schema } from '../../../environment/schema';\r\n\r\n\r\nfunction odataUrlFactory(params) {\r\n return getBulkUrl(params);\r\n}\r\n\r\nfunction odataHeaderFactory() {\r\n return getDefaultHeaderObj();\r\n}\r\n\r\nfunction odataPayloadFactory(params) {\r\n const { data } = params;\r\n const campaignSchema = edm.schema.schemas['Model/Campaign'];\r\n campaignSchema.properties.Goal = {\r\n 'bulk-upload-header': 'Campaign Goal',\r\n type: 'string',\r\n };\r\n campaignSchema.properties.Url = {\r\n 'bulk-upload-header': 'Campaign Url',\r\n type: 'string',\r\n };\r\n return {\r\n ...getBulkPayload(campaignSchema, data),\r\n NewExpertSignUp: 1,\r\n };\r\n}\r\n\r\nfunction processor(response, request) {\r\n return getProcessedBulkResult(response, request);\r\n}\r\n\r\nfunction entityProcessor(response, request) {\r\n return getProcessedBulkResult(response, request)[0];\r\n}\r\n\r\nexport const mutationRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:campaign',\r\n verb: requestVerbs.POST,\r\n fetchPolicy: FetchPolicy.NetworkOrStore,\r\n uriFactoryFn: odataUrlFactory,\r\n headerFactoryFn: odataHeaderFactory,\r\n payloadFactoryFn: odataPayloadFactory,\r\n keySelector: variables => variables.locator.descriptor.cpid,\r\n parentKeySelector: variables => variables.locator.descriptor.aid,\r\n});\r\n\r\nexport const mutationResponseContract = createResponseContract({\r\n requestContract: mutationRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: campaign => campaign.Id,\r\n processorFn: processor,\r\n});\r\n\r\nexport const mutationEntityResponseContract = createResponseContract({\r\n requestContract: mutationRequestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: campaign => campaign.Id,\r\n processorFn: entityProcessor,\r\n});\r\n","import _ from 'underscore';\r\nimport { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n useMutation,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { environmentLookupFn } from '../../../environment/index';\r\nimport { fetchRequestContract, fetchResponseContract } from '../spec/fetch';\r\nimport {\r\n mutationRequestContract, mutationResponseContract,\r\n} from '../spec/mutation';\r\n\r\nfunction sideEffectFn(response, request, spec, {\r\n tryMergeItemsToCacheStore,\r\n}) {\r\n const { Ads } = response;\r\n\r\n if (!_.isEmpty(Ads)) {\r\n tryMergeItemsToCacheStore({\r\n items: Ads,\r\n schemaName: 'ad',\r\n itemKeySelector: ad => ad.Id,\r\n parentSchemaName: 'campaign',\r\n parentId: fetchRequestContract.keySelector(request.variables),\r\n });\r\n }\r\n}\r\n\r\nconst fetchSpec =\r\n createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, sideEffectFn, environmentLookupFn\r\n );\r\nconst refetchSpec =\r\n createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, sideEffectFn, environmentLookupFn\r\n );\r\nconst mutationSpec =\r\n createSpec(\r\n mutationRequestContract, mutationResponseContract,\r\n specTypes.MUTATION, null, environmentLookupFn\r\n );\r\n\r\n// TO DO This is only a placeholder. Need to investiate delete expert campaign\r\nconst deleteSpec =\r\n createSpec(\r\n mutationRequestContract, mutationResponseContract,\r\n specTypes.DELETE, null, environmentLookupFn\r\n );\r\n\r\nconst DEFAULT_CONFIG = {};\r\n\r\nexport function useCampaign(dataLocator, config = DEFAULT_CONFIG) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n\r\n const defaultConfig = useMemo(() => ({\r\n mutation: config.mutation || {},\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n const { fetch: fetchConfig, mutation, refetch: refetchConfig } = defaultConfig;\r\n const fetch = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetchConfig);\r\n\r\n const read = useCallback((param = {}, requestConfig) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n const updateFn = useMutation(dataRefId, mutationSpec, mutation.update);\r\n\r\n const update = useCallback((item, ...rest) => {\r\n updateFn({ ...dataLocator }, item, ...rest);\r\n }, [dataLocator, updateFn]);\r\n\r\n const destroyFn = useMutation(dataRefId, deleteSpec, mutation.delete);\r\n\r\n const destroy = useCallback((...rest) => {\r\n destroyFn({ ...dataLocator }, ...rest);\r\n }, [dataLocator, destroyFn]);\r\n\r\n const [data, error] = fetch;\r\n\r\n return [{\r\n data,\r\n error,\r\n }, {\r\n read,\r\n update,\r\n destroy,\r\n }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n} from '@bingads-webui-react/overreact';\r\nimport { parseQuery, getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nimport { edm } from '../../../environment/edm';\r\nimport { schema } from '../../../environment/schema';\r\n\r\nconst DEFAULT_PAGE_SIZE = 50;\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const { locator, cursorIndex } = variables;\r\n const { descriptor } = locator;\r\n const { cid, aid } = descriptor;\r\n\r\n const entity = edm\r\n .Customers.$withKey(cid)\r\n .Accounts.$withKey(aid)\r\n .Campaigns;\r\n\r\n const initialSearch = _.omit(variables, 'locator', 'cursorIndex', 'skip');\r\n const search = {\r\n top: DEFAULT_PAGE_SIZE,\r\n count: true,\r\n skip: cursorIndex,\r\n select: ['Id', 'Name', 'Status', 'CampaignType', 'Budget', 'BiddingScheme', 'Languages', 'CampaignSettings'],\r\n ...initialSearch,\r\n };\r\n\r\n const parsedSearch = {\r\n ...parseQuery(search, entity),\r\n };\r\n const searchCompact = _.omit(parsedSearch, x => _.isNull(x) || _.isUndefined(x));\r\n const searchString = _.isEmpty(searchCompact) ? '' : `?${queryString.stringify(searchCompact)}`;\r\n\r\n return `${entity.path}${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory() {\r\n return getDefaultHeaderObj();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:campaign',\r\n verb: requestVerbs.GET,\r\n uriFactoryFn: odataUrlFactory,\r\n headerFactoryFn: odataHeaderFactory,\r\n keySelector: variables => variables.locator.descriptor.cpid,\r\n parentKeySelector: variables => variables.locator.descriptor.aid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: campaign => campaign.Id,\r\n processorFn: response => response.value,\r\n});\r\n","import _ from 'underscore';\r\nimport { useMemo, useCallback } from 'react';\r\nimport stringify from 'json-stable-stringify';\r\n\r\nimport {\r\n createSpec, specTypes,\r\n usePagination, useMutation,\r\n useDataRefId,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { environmentLookupFn } from '../../../environment/index';\r\nimport { fetchRequestContract, fetchResponseContract } from '../spec/coll-fetch';\r\nimport {\r\n mutationRequestContract, mutationResponseContract,\r\n} from '../spec/mutation';\r\n\r\nconst fetchCollSpec = createSpec(\r\n fetchRequestContract,\r\n fetchResponseContract, specTypes.PAGINATION, null, environmentLookupFn\r\n);\r\nconst addSpec = createSpec(\r\n mutationRequestContract,\r\n mutationResponseContract, specTypes.ADD, null, environmentLookupFn\r\n);\r\n// TO DO Investiate delete expert campaign\r\nconst deleteSpec = createSpec(\r\n mutationRequestContract,\r\n mutationResponseContract, specTypes.DELETE, null, environmentLookupFn\r\n);\r\n\r\nconst DEFAULT_CONFIG = {};\r\n\r\nexport function useCampaigns(dataLocator, config = DEFAULT_CONFIG) {\r\n const dataRefKey = `pagination_${stringify(dataLocator)}`;\r\n const dataRefId = useDataRefId(dataRefKey, environmentLookupFn);\r\n const defaultConfig = useMemo(() => ({\r\n mutation: config.mutation ? config.mutation : {},\r\n pagination: config.pagination ? config.pagination : {},\r\n }), [config]);\r\n\r\n const { pagination, mutation } = defaultConfig;\r\n\r\n const paginationConfig = useMemo(() => ({\r\n fetchVariables: {\r\n ...dataLocator,\r\n },\r\n ...pagination,\r\n }), [dataLocator, pagination]);\r\n\r\n const page = usePagination(dataRefId, fetchCollSpec, paginationConfig);\r\n\r\n const createFn = useMutation(dataRefId, addSpec, mutation.add);\r\n\r\n const create = useCallback((data, ...rest) => {\r\n createFn({ ...dataLocator }, data, ...rest);\r\n }, [createFn, dataLocator]);\r\n\r\n const destroyFn = useMutation(dataRefId, deleteSpec, mutation.delete);\r\n\r\n const destroy = useCallback((data) => {\r\n destroyFn({ ...dataLocator }, data);\r\n }, [dataLocator, destroyFn]);\r\n\r\n const [data, method] = page;\r\n\r\n return [data, _.extend({}, method, { create, destroy })];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n} from '@bingads-webui-react/overreact';\r\nimport { parseQuery, getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nimport { edm } from '../../../environment/edm';\r\nimport { schema } from '../../../environment/schema';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n select = ['Id', 'Name', 'Status'],\r\n pageSize = 1,\r\n includeSmartCampaign = true,\r\n orderby,\r\n count,\r\n startDate,\r\n endDate,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const {\r\n cid,\r\n aid,\r\n cpid,\r\n } = descriptor;\r\n\r\n let entity = edm\r\n .Customers.$withKey(cid)\r\n .Accounts.$withKey(aid);\r\n\r\n if (cpid) {\r\n entity = entity.Campaigns.$withKey(cpid);\r\n }\r\n\r\n entity = entity.AdGroups;\r\n\r\n const search = {\r\n top: pageSize,\r\n select,\r\n orderby,\r\n count,\r\n };\r\n\r\n const parsedSearch = {\r\n ...parseQuery(search, entity),\r\n includesmartcampaign: includeSmartCampaign,\r\n startdate: startDate,\r\n enddate: endDate,\r\n };\r\n const searchCompact = _.omit(parsedSearch, x => _.isNull(x) || _.isUndefined(x));\r\n const searchString = _.isEmpty(searchCompact) ? '' : `?${queryString.stringify(searchCompact)}`;\r\n\r\n return `${entity.path}${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory() {\r\n return getDefaultHeaderObj();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:campaign:ad_group',\r\n verb: requestVerbs.GET,\r\n uriFactoryFn: odataUrlFactory,\r\n headerFactoryFn: odataHeaderFactory,\r\n keySelector: variables => variables.locator.descriptor.adgid,\r\n parentKeySelector: variables => variables.locator.descriptor.cpid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: adGroup => adGroup.Id,\r\n processorFn: response => response.value,\r\n});\r\n","import {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n FetchPolicy,\r\n} from '@bingads-webui-react/overreact';\r\nimport { getBulkUrl, getBulkPayload, getProcessedBulkResult, getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nimport { edm } from '../../../environment/edm';\r\nimport { schema } from '../../../environment/schema';\r\n\r\n\r\nfunction odataUrlFactory(params) {\r\n return getBulkUrl(params);\r\n}\r\n\r\nfunction odataHeaderFactory() {\r\n return getDefaultHeaderObj();\r\n}\r\n\r\nfunction odataPayloadFactory(params) {\r\n const { data } = params;\r\n return getBulkPayload(edm.schema.schemas['Model/AdGroup'], data);\r\n}\r\n\r\nfunction processor(response, request) {\r\n return getProcessedBulkResult(response, request);\r\n}\r\n\r\nfunction entityProcessor(response, request) {\r\n return getProcessedBulkResult(response, request)[0];\r\n}\r\n\r\nexport const mutationRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:campaign:ad_group',\r\n verb: requestVerbs.POST,\r\n fetchPolicy: FetchPolicy.NetworkOrStore,\r\n uriFactoryFn: odataUrlFactory,\r\n headerFactoryFn: odataHeaderFactory,\r\n payloadFactoryFn: odataPayloadFactory,\r\n keySelector: variables => variables.locator.descriptor.adgid,\r\n parentKeySelector: variables => variables.locator.descriptor.cpid,\r\n});\r\n\r\nexport const mutationResponseContract = createResponseContract({\r\n requestContract: mutationRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: adGroup => adGroup.Id,\r\n processorFn: processor,\r\n});\r\n\r\nexport const mutationEntityResponseContract = createResponseContract({\r\n requestContract: mutationRequestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: adGroup => adGroup.Id,\r\n processorFn: entityProcessor,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n useMutation,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { environmentLookupFn } from '../../../environment/index';\r\nimport {\r\n fetchRequestContract as fetchCollRequestContract,\r\n fetchResponseContract as fetchCollResponseContract,\r\n} from '../spec/coll-fetch';\r\nimport {\r\n mutationRequestContract, mutationResponseContract,\r\n} from '../spec/mutation';\r\n\r\nconst fetchCollSpec =\r\n createSpec(\r\n fetchCollRequestContract, fetchCollResponseContract, specTypes.FETCH,\r\n null, environmentLookupFn\r\n );\r\nconst refetchCollSpec =\r\n createSpec(\r\n fetchCollRequestContract, fetchCollResponseContract, specTypes.REFETCH,\r\n null, environmentLookupFn\r\n );\r\nconst addSpec = createSpec(\r\n mutationRequestContract, mutationResponseContract, specTypes.ADD,\r\n null, environmentLookupFn\r\n);\r\n// TO DO Investiate delete expert adgroup\r\nconst deleteSpec = createSpec(\r\n mutationRequestContract, mutationResponseContract, specTypes.DELETE,\r\n null, environmentLookupFn\r\n);\r\n\r\nexport function useAdGroups(dataLocator, config = {}) {\r\n const defaultConfig = useMemo(() => ({\r\n mutation: config.mutation || {},\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n const { fetch: fetchConfig, mutation, refetch: refetchConfig } = defaultConfig;\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n const fetch = useFetch(dataRefId, fetchCollSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchCollSpec, refetchConfig);\r\n\r\n const read = useCallback((param, requestConfig) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n const createFn = useMutation(dataRefId, addSpec, mutation.add);\r\n\r\n const create = useCallback((data, ...rest) => {\r\n createFn({ ...dataLocator }, data, ...rest);\r\n }, [createFn, dataLocator]);\r\n\r\n const destroyFn = useMutation(dataRefId, deleteSpec, mutation.delete);\r\n\r\n const destroy = useCallback((data) => {\r\n destroyFn({ ...dataLocator }, data);\r\n }, [dataLocator, destroyFn]);\r\n\r\n const [data, error] = fetch;\r\n\r\n return [{ data, error }, { read, create, destroy }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n FetchPolicy,\r\n} from '@bingads-webui-react/overreact';\r\nimport { parseQuery, getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nimport { edm } from '../../../environment/edm';\r\nimport { schema } from '../../../environment/schema';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n select = ['Id', 'Name', 'Status'],\r\n startDate,\r\n endDate,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const {\r\n cid,\r\n aid,\r\n cpid,\r\n adgid,\r\n } = descriptor;\r\n\r\n const entity = edm\r\n .Customers.$withKey(cid)\r\n .Accounts.$withKey(aid)\r\n .Campaigns.$withKey(cpid)\r\n .AdGroups.$withKey(adgid);\r\n\r\n const search = {\r\n select,\r\n };\r\n\r\n const parsedSearch = {\r\n ...parseQuery(search, entity),\r\n startdate: startDate,\r\n enddate: endDate,\r\n };\r\n const searchCompact = _.omit(parsedSearch, x => _.isNull(x) || _.isUndefined(x));\r\n const searchString = _.isEmpty(searchCompact) ? '' : `?${queryString.stringify(searchCompact)}`;\r\n\r\n return `${entity.path}${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory() {\r\n return getDefaultHeaderObj();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:campaign:ad_group',\r\n verb: requestVerbs.GET,\r\n fetchPolicy: FetchPolicy.StoreOrNetwork,\r\n uriFactoryFn: odataUrlFactory,\r\n headerFactoryFn: odataHeaderFactory,\r\n keySelector: variables => variables.locator.descriptor.adgid,\r\n parentKeySelector: variables => variables.locator.descriptor.cpid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: adGroup => adGroup.Id.toString(),\r\n processorFn: response => response,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n useMutation,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { environmentLookupFn } from '../../../environment/index';\r\nimport { fetchRequestContract, fetchResponseContract } from '../spec/fetch';\r\nimport {\r\n mutationRequestContract, mutationResponseContract,\r\n} from '../spec/mutation';\r\n\r\n\r\nconst fetchSpec =\r\n createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n );\r\nconst refetchSpec =\r\n createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n );\r\nconst mutationSpec =\r\n createSpec(\r\n mutationRequestContract, mutationResponseContract,\r\n specTypes.MUTATION, null, environmentLookupFn\r\n );\r\n\r\n// TO DO This is only a placeholder. Need to investiate delete expert adgroup\r\nconst deleteSpec =\r\n createSpec(\r\n mutationRequestContract, mutationResponseContract,\r\n specTypes.DELETE, null, environmentLookupFn\r\n );\r\n\r\nexport function useAdGroup(dataLocator, config = {}) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n\r\n const defaultConfig = useMemo(() => ({\r\n mutation: config.mutation || {},\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n const { fetch: fetchConfig, mutation, refetch: refetchConfig } = defaultConfig;\r\n const fetch = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetchConfig);\r\n\r\n const read = useCallback((requestConfig) => {\r\n refetchFn({\r\n variables: { ...dataLocator },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n const updateFn = useMutation(dataRefId, mutationSpec, mutation.update);\r\n\r\n const update = useCallback((item, ...rest) => {\r\n updateFn({ ...dataLocator }, item, ...rest);\r\n }, [dataLocator, updateFn]);\r\n\r\n const destroyFn = useMutation(dataRefId, deleteSpec, mutation.delete);\r\n\r\n const destroy = useCallback((...rest) => {\r\n destroyFn({ ...dataLocator }, {}, ...rest);\r\n }, [dataLocator, destroyFn]);\r\n\r\n const [data, error] = fetch;\r\n\r\n return [{\r\n data,\r\n error,\r\n }, {\r\n read,\r\n update,\r\n destroy,\r\n }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n FetchPolicy,\r\n} from '@bingads-webui-react/overreact';\r\nimport { parseQuery, getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nimport { edm } from '../../../environment/edm';\r\nimport { schema } from '../../../environment/schema';\r\n\r\nconst DEFAULT_PAGE_SIZE = 20;\r\n\r\nfunction odataUrlFactory(params) {\r\n const {\r\n variables,\r\n startDate,\r\n endDate,\r\n } = params;\r\n\r\n const { locator, cursorIndex } = variables;\r\n const { descriptor } = locator;\r\n const {\r\n cid, aid, cpid, adgid,\r\n } = descriptor;\r\n\r\n let entity = edm\r\n .Customers.$withKey(cid)\r\n .Accounts.$withKey(aid);\r\n\r\n if (cpid) {\r\n entity = entity.Campaigns.$withKey(cpid);\r\n }\r\n\r\n if (adgid) {\r\n entity = entity.AdGroups.$withKey(adgid);\r\n }\r\n\r\n entity = entity.Ads['Default.GridData'];\r\n\r\n const initialSearch = _.omit(variables, 'locator', 'cursorIndex', 'skip');\r\n const search = {\r\n top: DEFAULT_PAGE_SIZE,\r\n count: true,\r\n skip: cursorIndex,\r\n ...initialSearch,\r\n select: [\r\n 'Id', 'Type', 'Text', 'TextPart2', 'Title', 'DisplayUrl', 'FinalUrls', 'TitlePart1', 'TitlePart2', 'TitlePart3', 'Path1', 'Path2', 'DestinationUrl',\r\n 'UrlCustomParameters', 'TrackingUrlTemplate', 'MobileFinalUrls', 'NativePreference', 'DevicePreference', 'FinalUrlSuffix',\r\n 'Model.ResponsiveSearchAd/Headlines',\r\n 'Model.ResponsiveSearchAd/Descriptions',\r\n ],\r\n };\r\n\r\n const yesterday = new Date(Date.now() - 864e5);\r\n const dateString = yesterday.toISOString().split('T')[0];\r\n\r\n const parsedSearch = {\r\n ...parseQuery(search, entity),\r\n startDate: startDate || dateString,\r\n endDate: endDate || dateString,\r\n };\r\n const searchCompact = _.omit(parsedSearch, x => _.isNull(x) || _.isUndefined(x));\r\n const searchString = _.isEmpty(searchCompact) ? '' : `?${queryString.stringify(searchCompact)}`;\r\n\r\n return `${entity.path}${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory() {\r\n return getDefaultHeaderObj();\r\n}\r\n\r\nfunction odataPayloadFactory() {\r\n const yesterday = new Date(Date.now() - 864e5);\r\n const dateString = yesterday.toISOString().split('T')[0];\r\n return { gridDataParameters: { DateRange: { StartDate: dateString, EndDate: dateString } } };\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:campaign:ad_group:ad',\r\n verb: requestVerbs.POST,\r\n fetchPolicy: FetchPolicy.StoreOrNetwork,\r\n uriFactoryFn: odataUrlFactory,\r\n headerFactoryFn: odataHeaderFactory,\r\n payloadFactoryFn: odataPayloadFactory,\r\n keySelector: ad => ad.Id,\r\n parentKeySelector: variables => variables.locator.descriptor.adgid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: ad => ad.Id,\r\n processorFn: response => response.value,\r\n});\r\n","import _ from 'underscore';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n FetchPolicy,\r\n} from '@bingads-webui-react/overreact';\r\nimport { getBulkUrl, getBulkPayload, getProcessedBulkResult, getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nimport { edm } from '../../../environment/edm';\r\nimport { schema } from '../../../environment/schema';\r\n\r\nconst fromBulkUpsertToOdata = bulkObjs => _.map(bulkObjs, bulkObj => ({\r\n '@odata.type': bulkObj.Type === 'ExpandedText' ? '#Model.ExpandedTextAd' : '#Model.ResponsiveSearchAd',\r\n ...bulkObj,\r\n}));\r\n\r\nfunction odataUrlFactory(params) {\r\n return getBulkUrl(params);\r\n}\r\n\r\nfunction odataHeaderFactory() {\r\n return getDefaultHeaderObj();\r\n}\r\n\r\nfunction odataPayloadFactory(params) {\r\n const { data } = params;\r\n if ((_.isArray(data) && data[0] && data[0].Type === 'ResponsiveSearch') ||\r\n data.Type === 'ResponsiveSearch'\r\n ) {\r\n return getBulkPayload(edm.schema.schemas['Model/ResponsiveSearchAd'], data);\r\n }\r\n return getBulkPayload(edm.schema.schemas['Model/ExpandedTextAd'], data);\r\n}\r\n\r\nfunction processor(response, request) {\r\n return fromBulkUpsertToOdata(getProcessedBulkResult(response, request));\r\n}\r\n\r\nfunction entityProcessor(response, request) {\r\n return getProcessedBulkResult(response, request)[0];\r\n}\r\n\r\nexport const mutationRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:campaign:ad_group:ad',\r\n verb: requestVerbs.POST,\r\n fetchPolicy: FetchPolicy.NetworkOrStore,\r\n uriFactoryFn: odataUrlFactory,\r\n headerFactoryFn: odataHeaderFactory,\r\n payloadFactoryFn: odataPayloadFactory,\r\n parentKeySelector: variables => variables.locator.descriptor.adgid,\r\n});\r\n\r\nexport const mutationResponseContract = createResponseContract({\r\n requestContract: mutationRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: ad => parseInt(ad.Id, 10),\r\n processorFn: processor,\r\n});\r\n\r\nexport const mutationEntityResponseContract = createResponseContract({\r\n requestContract: mutationRequestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: ad => parseInt(ad.Id, 10),\r\n processorFn: entityProcessor,\r\n});\r\n","import _ from 'underscore';\r\nimport { useMemo, useCallback } from 'react';\r\nimport stringify from 'json-stable-stringify';\r\n\r\nimport {\r\n createSpec, specTypes,\r\n usePagination, useMutation,\r\n useDataRefId, useRefetch\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { fetchRequestContract, fetchResponseContract } from '../spec/ad-coll-fetch';\r\nimport { environmentLookupFn } from '../../../environment/index';\r\nimport {\r\n mutationRequestContract,\r\n mutationResponseContract,\r\n} from '../spec/ad-coll-mutation';\r\n\r\nconst fetchCollSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.PAGINATION, null, environmentLookupFn\r\n);\r\nconst refetchCollSpec =\r\n createSpec(\r\n fetchRequestContract, fetchResponseContract, specTypes.REFETCH,\r\n null, environmentLookupFn\r\n );\r\nconst addSpec = createSpec(\r\n mutationRequestContract, mutationResponseContract, specTypes.ADD,\r\n null, environmentLookupFn\r\n);\r\nconst updateSpec = createSpec(\r\n mutationRequestContract, mutationResponseContract, specTypes.MUTATION,\r\n null, environmentLookupFn\r\n);\r\nconst deleteSpec = createSpec(\r\n mutationRequestContract, mutationResponseContract, specTypes.DELETE,\r\n null, environmentLookupFn\r\n);\r\n\r\nexport function useAds(dataLocator, config = {}) {\r\n const dataRefKey = `pagination_${stringify(dataLocator)}`;\r\n const dataRefId = useDataRefId(dataRefKey, environmentLookupFn); const defaultConfig = useMemo(() => ({\r\n mutation: config.mutation ? config.mutation : {},\r\n pagination: config.pagination ? config.pagination : {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n\r\n const { pagination, mutation, refetch } = defaultConfig;\r\n\r\n const mergeNewRecords = useCallback((records, newRecords) => _.uniq([...records, ...newRecords], 'Id'), []);\r\n const paginationConfig = useMemo(() => ({\r\n fetchVariables: {\r\n ...dataLocator,\r\n },\r\n strictMode: true,\r\n mergeNewRecords,\r\n ...pagination,\r\n }), [dataLocator, mergeNewRecords, pagination]);\r\n\r\n const page = usePagination(dataRefId, fetchCollSpec, paginationConfig);\r\n\r\n const createFn = useMutation(dataRefId, addSpec, mutation.add);\r\n\r\n const create = useCallback((data, ...rest) => {\r\n createFn({ ...dataLocator }, data, ...rest);\r\n }, [createFn, dataLocator]);\r\n\r\n const destroyFn = useMutation(dataRefId, deleteSpec, mutation.delete);\r\n\r\n const destroy = useCallback((data, ...rest) => {\r\n destroyFn({ ...dataLocator }, data, ...rest);\r\n }, [dataLocator, destroyFn]);\r\n\r\n const updateFn = useMutation(dataRefId, updateSpec, mutation.update);\r\n\r\n const update = useCallback((data, ...rest) => {\r\n updateFn({ ...dataLocator }, data, ...rest);\r\n }, [dataLocator, updateFn]);\r\n\r\n const refetchFn = useRefetch(dataRefId, refetchCollSpec, refetch);\r\n\r\n const read = useCallback((...args) => {\r\n let param = {};\r\n let requestConfig = {};\r\n\r\n if (args.length === 1) {\r\n ([requestConfig] = args);\r\n } else if (args.length >= 2) {\r\n ([param, requestConfig] = args);\r\n }\r\n\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n const [data, method] = page;\r\n\r\n return [data, _.extend({}, method, {\r\n create, destroy, update, read,\r\n })];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n FetchPolicy,\r\n requestVerbs,\r\n responseTypes,\r\n} from '@bingads-webui-react/overreact';\r\nimport { parseQuery, getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nimport { edm } from '../../../environment/edm';\r\nimport { schema } from '../../../environment/schema';\r\n\r\nconst DEFAULT_PAGE_SIZE = 20;\r\nconst DEFAULT_SKIP = 0;\r\n\r\nfunction odataUrlFactory(params) {\r\n const {\r\n variables,\r\n startDate,\r\n endDate,\r\n } = params;\r\n\r\n const { locator } = variables;\r\n const { descriptor } = locator;\r\n const {\r\n cid, aid, cpid, adgid,\r\n } = descriptor;\r\n\r\n let entity = edm\r\n .Customers.$withKey(cid)\r\n .Accounts.$withKey(aid);\r\n if (cpid) {\r\n entity = entity.Campaigns.$withKey(cpid);\r\n }\r\n if (adgid) {\r\n entity = entity.AdGroups.$withKey(adgid);\r\n }\r\n entity = entity.Keywords;\r\n\r\n const initialSearch = _.omit(variables, 'locator');\r\n const search = {\r\n top: DEFAULT_PAGE_SIZE,\r\n count: true,\r\n skip: DEFAULT_SKIP,\r\n select: ['AdGroup'],\r\n ...initialSearch,\r\n };\r\n\r\n const yesterday = new Date(Date.now() - 864e5);\r\n const dateString = yesterday.toISOString().split('T')[0];\r\n\r\n const parsedSearch = {\r\n ...parseQuery(search, entity),\r\n startDate: startDate || dateString,\r\n endDate: endDate || dateString,\r\n };\r\n const searchCompact = _.omit(parsedSearch, x => _.isNull(x) || _.isUndefined(x));\r\n const searchString = _.isEmpty(searchCompact) ? '' : `?${queryString.stringify(searchCompact)}`;\r\n\r\n return `${entity.path}${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory() {\r\n return getDefaultHeaderObj();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:campaign:ad_group:keyword',\r\n verb: requestVerbs.GET,\r\n fetchPolicy: FetchPolicy.StoreOrNetwork,\r\n uriFactoryFn: odataUrlFactory,\r\n headerFactoryFn: odataHeaderFactory,\r\n keySelector: keyWord => keyWord.Id,\r\n parentKeySelector: variables => variables.locator.descriptor.adgid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: keyWord => keyWord.Id,\r\n processorFn: response => response.value,\r\n});\r\n","import {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n FetchPolicy,\r\n} from '@bingads-webui-react/overreact';\r\nimport { getBulkUrl, getBulkPayload, getProcessedBulkResult, getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nimport { edm } from '../../../environment/edm';\r\nimport { schema } from '../../../environment/schema';\r\n\r\n\r\nfunction odataUrlFactory(params) {\r\n return getBulkUrl(params);\r\n}\r\n\r\nfunction odataHeaderFactory() {\r\n return getDefaultHeaderObj();\r\n}\r\n\r\nfunction odataPayloadFactory(params) {\r\n const { data } = params;\r\n return getBulkPayload(edm.schema.schemas['Model/Keyword'], data);\r\n}\r\n\r\nfunction processor(response, request) {\r\n return getProcessedBulkResult(response, request);\r\n}\r\n\r\nfunction entityProcessor(response, request) {\r\n return getProcessedBulkResult(response, request)[0];\r\n}\r\n\r\nexport const mutationRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:campaign:ad_group:keyword',\r\n verb: requestVerbs.POST,\r\n fetchPolicy: FetchPolicy.NetworkOrStore,\r\n uriFactoryFn: odataUrlFactory,\r\n headerFactoryFn: odataHeaderFactory,\r\n payloadFactoryFn: odataPayloadFactory,\r\n parentKeySelector: variables => variables.locator.descriptor.adgid,\r\n});\r\n\r\nexport const mutationResponseContract = createResponseContract({\r\n requestContract: mutationRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: keyword => keyword.Id,\r\n processorFn: processor,\r\n});\r\n\r\nexport const mutationEntityResponseContract = createResponseContract({\r\n requestContract: mutationRequestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: keyword => keyword.Id,\r\n processorFn: entityProcessor,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\nimport stringify from 'json-stable-stringify';\r\nimport _ from 'underscore';\r\nimport {\r\n createSpec, specTypes,\r\n usePagination, useRefetch, useMutation,\r\n useDataRefId,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { environmentLookupFn } from '../../../environment/index';\r\nimport { fetchRequestContract, fetchResponseContract } from '../spec/keyword-coll-fetch';\r\nimport {\r\n mutationRequestContract,\r\n mutationResponseContract,\r\n} from '../spec/keyword-coll-mutation';\r\n\r\nconst fetchCollSpec =\r\n createSpec(\r\n fetchRequestContract, fetchResponseContract, specTypes.PAGINATION,\r\n null, environmentLookupFn\r\n );\r\nconst refetchCollSpec =\r\n createSpec(\r\n fetchRequestContract, fetchResponseContract, specTypes.REFETCH,\r\n null, environmentLookupFn\r\n );\r\nconst addSpec = createSpec(\r\n mutationRequestContract, mutationResponseContract, specTypes.ADD,\r\n null, environmentLookupFn\r\n);\r\nconst updateSpec = createSpec(\r\n mutationRequestContract, mutationResponseContract, specTypes.MUTATION,\r\n null, environmentLookupFn\r\n);\r\nconst deleteSpec = createSpec(\r\n mutationRequestContract, mutationResponseContract, specTypes.DELETE,\r\n null, environmentLookupFn\r\n);\r\n\r\nexport function useKeywords(dataLocator, config = {}) {\r\n const dataRefKey = `pagination_${stringify(dataLocator)}`;\r\n const dataRefId = useDataRefId(dataRefKey, environmentLookupFn);\r\n const mergeNewRecords = useCallback((records, newRecords) => _.uniq([...records, ...newRecords], 'Id'), []);\r\n const paginationConfig = useMemo(() => ({\r\n fetchVariables: {\r\n ...dataLocator,\r\n },\r\n mergeNewRecords,\r\n }), [dataLocator, mergeNewRecords]);\r\n const page = usePagination(dataRefId, fetchCollSpec, paginationConfig);\r\n\r\n const defaultConfig = useMemo(() => ({\r\n mutation: config.mutation || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n const { mutation, refetch: refetchConfig } = defaultConfig;\r\n const refetchFn = useRefetch(dataRefId, refetchCollSpec, refetchConfig);\r\n\r\n const read = useCallback((param = {}, requestConfig, ...rest) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig, ...rest);\r\n }, [dataLocator, refetchFn]);\r\n\r\n const createFn = useMutation(dataRefId, addSpec, mutation.add);\r\n\r\n const create = useCallback((data, ...rest) => {\r\n createFn({ ...dataLocator }, data, ...rest);\r\n }, [createFn, dataLocator]);\r\n\r\n const destroyFn = useMutation(dataRefId, deleteSpec, mutation.delete);\r\n\r\n const destroy = useCallback((data, ...rest) => {\r\n destroyFn({ ...dataLocator }, data, ...rest);\r\n }, [dataLocator, destroyFn]);\r\n\r\n const updateFn = useMutation(dataRefId, updateSpec, mutation.update);\r\n\r\n const update = useCallback((data) => {\r\n updateFn({ ...dataLocator }, data);\r\n }, [dataLocator, updateFn]);\r\n\r\n const [{ data, error }, { isLoading, ...method }] = page;\r\n\r\n return [{\r\n data,\r\n error,\r\n }, _.extend({}, method, {\r\n read,\r\n create,\r\n update,\r\n destroy,\r\n })];\r\n}\r\n","import {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n FetchPolicy,\r\n} from '@bingads-webui-react/overreact';\r\nimport { getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nimport { edm } from '../../../environment/edm';\r\nimport { schema } from '../../../environment/schema';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const {\r\n cid,\r\n aid,\r\n locid,\r\n } = descriptor;\r\n\r\n const entity = edm\r\n .Customers.$withKey(cid)\r\n .Accounts.$withKey(aid)\r\n .Locations.$withKey(locid);\r\n\r\n return `${entity.path}`;\r\n}\r\n\r\nfunction odataHeaderFactory() {\r\n return getDefaultHeaderObj();\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:location',\r\n verb: requestVerbs.GET,\r\n fetchPolicy: FetchPolicy.StoreOrNetwork,\r\n uriFactoryFn: odataUrlFactory,\r\n headerFactoryFn: odataHeaderFactory,\r\n parentKeySelector: variables => variables.locator.descriptor.aid,\r\n keySelector: variables => variables.locator.descriptor.locid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: location => location.Id,\r\n processorFn: response => response,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { environmentLookupFn } from '../../../environment/index';\r\nimport { fetchRequestContract, fetchResponseContract } from '../spec/fetch';\r\n\r\nconst fetchSpec =\r\n createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n );\r\nconst refetchSpec =\r\n createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n );\r\n\r\nexport function useLocation(dataLocator, config = {}) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n\r\n const defaultConfig = useMemo(() => ({\r\n mutation: config.mutation || {},\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n const { fetch: fetchConfig, refetch: refetchConfig } = defaultConfig;\r\n const fetch = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetchConfig);\r\n\r\n const read = useCallback((param = {}, requestConfig) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n const [data, error] = fetch;\r\n\r\n return [{\r\n data,\r\n error,\r\n }, {\r\n read,\r\n }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n FetchPolicy,\r\n requestVerbs,\r\n responseTypes,\r\n} from '@bingads-webui-react/overreact';\r\nimport { parseQuery, getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nimport { edm } from '../../../environment/edm';\r\nimport { schema } from '../../../environment/schema';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const {\r\n locator,\r\n pageSize = 20,\r\n cursorIndex,\r\n count = true,\r\n filter = {\r\n where: \"isof(Criterion,'Model.LocationCriterion') or isof(Criterion,'Model.RadiusCriterion') or isof(Criterion,'Model.LocationIntentCriterion')\",\r\n },\r\n } = variables;\r\n\r\n const { descriptor } = locator;\r\n const {\r\n cid,\r\n aid,\r\n cpid,\r\n } = descriptor;\r\n\r\n const entity = edm\r\n .Customers.$withKey(cid)\r\n .Accounts.$withKey(aid)\r\n .Campaigns.$withKey(cpid);\r\n\r\n const search = {\r\n top: pageSize,\r\n skip: cursorIndex,\r\n count,\r\n filter,\r\n };\r\n\r\n const parsedSearch = {\r\n ...parseQuery(search, entity),\r\n };\r\n const searchCompact = _.omit(parsedSearch, x => _.isNull(x) || _.isUndefined(x));\r\n const searchString = _.isEmpty(searchCompact) ? '' : `?${queryString.stringify(searchCompact)}`;\r\n\r\n return `${entity.path}/CampaignCriterions/Model.CampaignCriterion/${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory() {\r\n return getDefaultHeaderObj();\r\n}\r\n\r\nfunction odataPayloadFactory(params) {\r\n const { variables } = params;\r\n const { data } = variables;\r\n\r\n return data;\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:campaign:campaign_criterion',\r\n verb: requestVerbs.GET,\r\n fetchPolicy: FetchPolicy.StoreOrNetwork,\r\n uriFactoryFn: odataUrlFactory,\r\n headerFactoryFn: odataHeaderFactory,\r\n payloadFactoryFn: odataPayloadFactory,\r\n keySelector: campaignCriterion => campaignCriterion.Id,\r\n parentKeySelector: variables => variables.locator.descriptor.cpid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: campaignCriterion => campaignCriterion.Id,\r\n processorFn: response => response.value,\r\n});\r\n","import {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n FetchPolicy,\r\n} from '@bingads-webui-react/overreact';\r\nimport { getBulkUrl, getBulkPayload, getProcessedBulkResult, getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nimport { edm } from '../../../environment/edm';\r\nimport { schema } from '../../../environment/schema';\r\n\r\nfunction odataUrlFactory(params) {\r\n return getBulkUrl(params);\r\n}\r\n\r\nfunction odataHeaderFactory() {\r\n return getDefaultHeaderObj();\r\n}\r\n\r\nfunction odataPayloadFactory(params) {\r\n const { data } = params;\r\n return getBulkPayload(edm.schema.schemas['Model/CampaignCriterion'], data);\r\n}\r\n\r\nfunction processor(response, request) {\r\n const bulkResult = getProcessedBulkResult(response, request);\r\n return request.variables.resultProcessor(bulkResult);\r\n}\r\n\r\nfunction entityProcessor(response, request) {\r\n return getProcessedBulkResult(response, request)[0];\r\n}\r\n\r\nexport const mutationRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:campaign:campaign_criterion',\r\n verb: requestVerbs.POST,\r\n fetchPolicy: FetchPolicy.NetworkOrStore,\r\n uriFactoryFn: odataUrlFactory,\r\n headerFactoryFn: odataHeaderFactory,\r\n payloadFactoryFn: odataPayloadFactory,\r\n keySelector: variables => variables.locator.descriptor.cpid,\r\n parentKeySelector: variables => variables.locator.descriptor.cpid,\r\n});\r\n\r\nexport const mutationResponseContract = createResponseContract({\r\n requestContract: mutationRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: campaignCriterion => campaignCriterion.Id,\r\n processorFn: processor,\r\n});\r\n\r\nexport const mutationEntityResponseContract = createResponseContract({\r\n requestContract: mutationRequestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: campaignCriterion => campaignCriterion.Id,\r\n processorFn: entityProcessor,\r\n});\r\n","import _ from 'underscore';\r\nimport { useMemo, useCallback } from 'react';\r\nimport stringify from 'json-stable-stringify';\r\nimport { postponeReadConfig } from '@bingads-webui/overreact-bingads';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n usePagination,\r\n useDataRefId,\r\n useRefetch,\r\n useMutation,\r\n FetchPolicy\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { environmentLookupFn } from '../../../environment/index';\r\nimport {\r\n fetchRequestContract as fetchCollRequestContract,\r\n fetchResponseContract as fetchCollResponseContract,\r\n} from '../spec/coll-fetch';\r\nimport {\r\n mutationRequestContract, mutationResponseContract,\r\n} from '../spec/mutation';\r\n\r\nconst fetchCollSpec =\r\n createSpec(\r\n fetchCollRequestContract, fetchCollResponseContract,\r\n specTypes.PAGINATION, null, environmentLookupFn\r\n );\r\nconst refetchCollSpec =\r\n createSpec(\r\n fetchCollRequestContract, fetchCollResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n );\r\n\r\nconst addSpec = createSpec(\r\n mutationRequestContract,\r\n mutationResponseContract, specTypes.ADD, null, environmentLookupFn\r\n);\r\n// TO DO Investiate delete expert campaign\r\nconst deleteSpec = createSpec(\r\n mutationRequestContract,\r\n mutationResponseContract, specTypes.DELETE, null, environmentLookupFn\r\n);\r\n\r\nexport function useCampaignCriterions(dataLocator, config = {}) {\r\n const dataRefKey = `pagination_${stringify(dataLocator)}`;\r\n const dataRefId = useDataRefId(dataRefKey, environmentLookupFn);\r\n const mergeNewRecords = useCallback((records, newRecords) => _.uniq([...records, ...newRecords], 'Id'), []);\r\n const paginationConfig = useMemo(() => ({\r\n fetchVariables: {\r\n ...dataLocator,\r\n },\r\n mergeNewRecords,\r\n }), [dataLocator, mergeNewRecords]);\r\n const page = usePagination(dataRefId, fetchCollSpec, paginationConfig);\r\n\r\n const { refetch = {}, mutation = {} } = config;\r\n const refetchFn = useRefetch(dataRefId, refetchCollSpec, refetch);\r\n\r\n const refresh = useCallback((...params) => {\r\n refetchFn({\r\n variables: {\r\n ...dataLocator,\r\n cursorIndex: 0,\r\n options: {\r\n fetchPolicy: FetchPolicy.StoreOrNetwork,\r\n },\r\n },\r\n }, ...params);\r\n }, [dataLocator, refetchFn]);\r\n\r\n const createFn = useMutation(dataRefId, addSpec, mutation.add);\r\n\r\n const create = useCallback((data, ...rest) => {\r\n createFn({ ...dataLocator }, data, ...rest);\r\n }, [createFn, dataLocator]);\r\n\r\n const destroyFn = useMutation(dataRefId, deleteSpec, mutation.delete);\r\n\r\n const destroy = useCallback((data) => {\r\n destroyFn({ ...dataLocator }, data);\r\n }, [dataLocator, destroyFn]);\r\n\r\n\r\n const [{ data, error }, { isLoading, ...method }] = page;\r\n\r\n return [{ data, error }, _.extend({}, method, {\r\n isLoading,\r\n refresh,\r\n create,\r\n destroy,\r\n })];\r\n}\r\n\r\nexport function useCampaignCriterionsWithDefaultSetting({\r\n cid,\r\n aid,\r\n cpid,\r\n}) {\r\n const campaignVariables = useMemo(() => ({\r\n locator: {\r\n descriptor: { cid, aid, cpid },\r\n order: ['cid', 'aid', 'cpid'],\r\n },\r\n }), [aid, cpid, cid]);\r\n\r\n return useCampaignCriterions(campaignVariables, postponeReadConfig);\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n} from '@bingads-webui-react/overreact';\r\nimport { parseQuery, getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nimport { edm } from '../../../environment/edm';\r\nimport { schema } from '../../../environment/schema';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const { locator } = variables;\r\n const { descriptor } = locator;\r\n const {\r\n cid,\r\n aid,\r\n } = descriptor;\r\n\r\n const entity = edm\r\n .Customers.$withKey(cid)\r\n .Accounts.$withKey(aid);\r\n\r\n const initialSearch = _.omit(variables, 'locator');\r\n const search = {\r\n ...initialSearch,\r\n };\r\n\r\n const parsedSearch = {\r\n ...parseQuery(search, entity),\r\n };\r\n const searchCompact = _.omit(parsedSearch, x => _.isNull(x) || _.isUndefined(x));\r\n const searchString = _.isEmpty(searchCompact) ? '' : `?${queryString.stringify(searchCompact)}`;\r\n\r\n return `${entity.path}/Default.GetTargetSuggestions${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory() {\r\n const header = {\r\n ...getDefaultHeaderObj(),\r\n lcid: '1033',\r\n };\r\n return header;\r\n}\r\n\r\nfunction odataPayloadFactory(params) {\r\n const { variables: { data: variableData }, data } = params;\r\n const payloadData = data || variableData;\r\n return { ...payloadData };\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:target_suggestion',\r\n verb: requestVerbs.POST,\r\n uriFactoryFn: odataUrlFactory,\r\n headerFactoryFn: odataHeaderFactory,\r\n payloadFactoryFn: odataPayloadFactory,\r\n parentKeySelector: variables => variables.locator.descriptor.aid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: targetSuggestion => targetSuggestion.BingLocationId,\r\n processorFn: response => response.value,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\nimport stringify from 'json-stable-stringify';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { environmentLookupFn } from '../../../environment/index';\r\nimport { fetchRequestContract, fetchResponseContract } from '../spec/target-suggestion-coll-fetch';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\n\r\nexport function useTargetSuggestions(dataLocator, config = {}) {\r\n const dataRefKey = `${stringify(dataLocator.locator)}`;\r\n const dataRefId = useDataRefId(dataRefKey, environmentLookupFn);\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n const { fetch: fetchConfig, refetch: refetchConfig } = defaultConfig;\r\n\r\n const fetch = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetchConfig);\r\n\r\n const read = useCallback((param = {}, requestConfig, ...rest) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n payload: { ...param.body },\r\n }, requestConfig, ...rest);\r\n }, [dataLocator, refetchFn]);\r\n\r\n const [data, error] = fetch;\r\n\r\n return [{\r\n data,\r\n error,\r\n }, {\r\n read,\r\n }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n FetchPolicy,\r\n requestVerbs,\r\n responseTypes,\r\n} from '@bingads-webui-react/overreact';\r\nimport { parseQuery, getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nimport { edm } from '../../../environment/edm';\r\nimport { schema } from '../../../environment/schema';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const { locator } = variables;\r\n const { descriptor } = locator;\r\n const {\r\n cid,\r\n aid,\r\n } = descriptor;\r\n\r\n const entity = edm\r\n .Customers.$withKey(cid)\r\n .Accounts.$withKey(aid);\r\n\r\n const initialSearch = _.omit(variables, 'locator');\r\n const search = {\r\n ...initialSearch,\r\n };\r\n\r\n const parsedSearch = {\r\n ...parseQuery(search, entity),\r\n };\r\n const searchCompact = _.omit(parsedSearch, x => _.isNull(x) || _.isUndefined(x));\r\n const searchString = _.isEmpty(searchCompact) ? '' : `?${queryString.stringify(searchCompact)}`;\r\n\r\n return `${entity.path}/Default.CreateResponsiveSearchAdRecommendation${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory() {\r\n const header = {\r\n ...getDefaultHeaderObj(),\r\n lcid: '1033',\r\n };\r\n return header;\r\n}\r\n\r\nfunction odataPayloadFactory(params) {\r\n const { data } = params;\r\n return {\r\n ...data,\r\n caller: 'expert',\r\n };\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:campaign:rsa_suggestion',\r\n verb: requestVerbs.POST,\r\n fetchPolicy: FetchPolicy.NetworkOnly,\r\n uriFactoryFn: odataUrlFactory,\r\n headerFactoryFn: odataHeaderFactory,\r\n payloadFactoryFn: odataPayloadFactory,\r\n parentKeySelector: variables => variables.locator.descriptor.cpid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: rsaSuggestion => rsaSuggestion.BingLocationId,\r\n processorFn: response => response.value,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\nimport stringify from 'json-stable-stringify';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { environmentLookupFn } from '../../../environment/index';\r\nimport { fetchRequestContract, fetchResponseContract } from '../spec/rsa-suggestion-coll-fetch';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\n\r\nexport function useRsaSuggestions(dataLocator, config = {}) {\r\n const dataRefKey = `${stringify(dataLocator.locator)}`;\r\n const dataRefId = useDataRefId(dataRefKey, environmentLookupFn);\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n const { fetch: fetchConfig, refetch: refetchConfig } = defaultConfig;\r\n\r\n const fetch = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetchConfig);\r\n\r\n const read = useCallback((param = {}, requestConfig, ...rest) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n payload: { ...param.body },\r\n }, requestConfig, ...rest);\r\n }, [dataLocator, refetchFn]);\r\n\r\n const [data, error] = fetch;\r\n\r\n return [{\r\n data,\r\n error,\r\n }, {\r\n read,\r\n }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n FetchPolicy,\r\n requestVerbs,\r\n responseTypes,\r\n} from '@bingads-webui-react/overreact';\r\nimport { parseQuery, getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nimport { edm } from '../../../environment/edm';\r\nimport { schema } from '../../../environment/schema';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const { locator, adId } = variables;\r\n const { descriptor } = locator;\r\n const {\r\n cid,\r\n aid,\r\n } = descriptor;\r\n\r\n const entity = edm\r\n .Customers.$withKey(cid)\r\n .Accounts.$withKey(aid)\r\n .Ads;\r\n\r\n const search = {\r\n top: 20,\r\n count: true,\r\n };\r\n const parsedSearch = {\r\n ...parseQuery(search, entity),\r\n adId,\r\n };\r\n const searchCompact = _.omit(parsedSearch, x => _.isNull(x) || _.isUndefined(x));\r\n const searchString = _.isEmpty(searchCompact) ? '' : `?${queryString.stringify(searchCompact)}`;\r\n\r\n return `${entity.path}/Default.GetAdStrengthAndActionItems${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory() {\r\n const header = {\r\n ...getDefaultHeaderObj(),\r\n lcid: '1033',\r\n };\r\n return header;\r\n}\r\n\r\nfunction odataPayloadFactory(params) {\r\n const { data } = params;\r\n return { ...data };\r\n}\r\n\r\nfunction processor(response) {\r\n return {\r\n ...response,\r\n createTimestamp: Date.now(),\r\n };\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:ad_strength',\r\n verb: requestVerbs.POST,\r\n fetchPolicy: FetchPolicy.NetworkOnly,\r\n uriFactoryFn: odataUrlFactory,\r\n headerFactoryFn: odataHeaderFactory,\r\n payloadFactoryFn: odataPayloadFactory,\r\n keySelector: adStrength => adStrength.createTimestamp,\r\n parentKeySelector: variables => variables.locator.descriptor.aid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: adStrength => adStrength.createTimestamp,\r\n processorFn: processor,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { environmentLookupFn } from '../../../environment/index';\r\nimport { fetchRequestContract, fetchResponseContract } from '../spec/ad-strength-fetch';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\n\r\nexport function useAdStrength(dataLocator, config = {}) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n const { fetch: fetchConfig, refetch: refetchConfig } = defaultConfig;\r\n\r\n const fetch = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetchConfig);\r\n\r\n const read = useCallback((param = {}, requestConfig, ...rest) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n payload: { ...param.body },\r\n }, requestConfig, ...rest);\r\n }, [dataLocator, refetchFn]);\r\n\r\n const [data, error] = fetch;\r\n\r\n return [{\r\n data,\r\n error,\r\n }, {\r\n read,\r\n }];\r\n}\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n FetchPolicy,\r\n requestVerbs,\r\n responseTypes,\r\n} from '@bingads-webui-react/overreact';\r\nimport { parseQuery, getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nimport { edm } from '../../../environment/edm';\r\nimport { schema } from '../../../environment/schema';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const { locator } = variables;\r\n const { descriptor } = locator;\r\n const {\r\n cid,\r\n aid,\r\n } = descriptor;\r\n\r\n const entity = edm\r\n .Customers.$withKey(cid)\r\n .Accounts.$withKey(aid);\r\n\r\n const initialSearch = _.omit(variables, 'locator');\r\n const search = {\r\n ...initialSearch,\r\n };\r\n\r\n const parsedSearch = {\r\n ...parseQuery(search, entity),\r\n };\r\n const searchCompact = _.omit(parsedSearch, x => _.isNull(x) || _.isUndefined(x));\r\n const searchString = _.isEmpty(searchCompact) ? '' : `?${queryString.stringify(searchCompact)}`;\r\n\r\n return `${entity.path}/Default.GetExtractedBusinessInfo${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory() {\r\n return getDefaultHeaderObj();\r\n}\r\n\r\nfunction odataPayloadFactory(params) {\r\n const { data } = params;\r\n return { ...data };\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:extracted_business_info',\r\n verb: requestVerbs.POST,\r\n fetchPolicy: FetchPolicy.NetworkOnly,\r\n uriFactoryFn: odataUrlFactory,\r\n headerFactoryFn: odataHeaderFactory,\r\n payloadFactoryFn: odataPayloadFactory,\r\n keySelector: extractedBusinessInfo => extractedBusinessInfo.Url,\r\n parentKeySelector: variables => variables.locator.descriptor.aid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: extractedBusinessInfo => extractedBusinessInfo.Url,\r\n processorFn: response => response,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { environmentLookupFn } from '../../../environment/index';\r\nimport { fetchRequestContract, fetchResponseContract } from '../spec/extracted-business-info-fetch';\r\n\r\nconst fetchSpec =\r\n createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n );\r\nconst refetchSpec =\r\n createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n );\r\n\r\nexport function useExtractedBusinessInfo(dataLocator, config = {}) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n const { fetch: fetchConfig, refetch } = defaultConfig;\r\n const fetch = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetch);\r\n\r\n const read = useCallback((param = {}, requestConfig) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n payload: { ...param.payload },\r\n }, requestConfig);\r\n }, [dataLocator, refetchFn]);\r\n\r\n const [data, error] = fetch;\r\n\r\n return [{\r\n data,\r\n error,\r\n }, {\r\n read,\r\n }];\r\n}\r\n\r\n","import _ from 'underscore';\r\nimport queryString from 'query-string';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n} from '@bingads-webui-react/overreact';\r\nimport { parseQuery, getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nimport { edm } from '../../../environment/edm';\r\nimport { schema } from '../../../environment/schema';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n\r\n const { locator } = variables;\r\n const { descriptor } = locator;\r\n const {\r\n cid,\r\n aid,\r\n cpid,\r\n } = descriptor;\r\n\r\n const entity = edm\r\n .Customers.$withKey(cid)\r\n .Accounts.$withKey(aid)\r\n .Campaigns.$withKey(cpid);\r\n\r\n const initialSearch = _.omit(variables, 'locator');\r\n const search = {\r\n ...initialSearch,\r\n };\r\n\r\n const parsedSearch = {\r\n ...parseQuery(search, entity),\r\n };\r\n const searchCompact = _.omit(parsedSearch, x => _.isNull(x) || _.isUndefined(x));\r\n const searchString = _.isEmpty(searchCompact) ? '' : `?${queryString.stringify(searchCompact)}`;\r\n\r\n return `${entity.path}/Default.GetOriginalBudgetSuggestions${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory() {\r\n return getDefaultHeaderObj();\r\n}\r\n\r\nfunction odataPayloadFactory(params) {\r\n const { data } = params;\r\n return data;\r\n}\r\n\r\nfunction processor(response) {\r\n return {\r\n ...response,\r\n createTimestamp: Date.now(),\r\n };\r\n}\r\n\r\nexport const fetchRequestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:budget_suggestion',\r\n verb: requestVerbs.POST,\r\n uriFactoryFn: odataUrlFactory,\r\n headerFactoryFn: odataHeaderFactory,\r\n payloadFactoryFn: odataPayloadFactory,\r\n keySelector: budgetSuggestion => budgetSuggestion.createTimestamp,\r\n parentKeySelector: variables => variables.locator.descriptor.aid,\r\n});\r\n\r\nexport const fetchResponseContract = createResponseContract({\r\n requestContract: fetchRequestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: budgetSuggestion => budgetSuggestion.createTimestamp,\r\n processorFn: processor,\r\n});\r\n","import { useCallback, useMemo } from 'react';\r\n\r\nimport {\r\n createSpec,\r\n specTypes,\r\n useFetch,\r\n useDataRefId,\r\n useRefetch,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { environmentLookupFn } from '../../../environment/index';\r\nimport { fetchRequestContract, fetchResponseContract } from '../spec/budget-suggestion-fetch';\r\n\r\nconst fetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.FETCH, null, environmentLookupFn\r\n);\r\nconst refetchSpec = createSpec(\r\n fetchRequestContract, fetchResponseContract,\r\n specTypes.REFETCH, null, environmentLookupFn\r\n);\r\n\r\nexport function useBudgetSuggestion(dataLocator, config = {}) {\r\n const dataRefId = useDataRefId(null, environmentLookupFn);\r\n const defaultConfig = useMemo(() => ({\r\n fetch: config.fetch || {},\r\n refetch: config.refetch || {},\r\n }), [config]);\r\n const { fetch: fetchConfig, refetch: refetchConfig } = defaultConfig;\r\n\r\n const fetch = useFetch(dataRefId, fetchSpec, dataLocator, fetchConfig);\r\n const refetchFn = useRefetch(dataRefId, refetchSpec, refetchConfig);\r\n\r\n const read = useCallback((param = {}, requestConfig, ...rest) => {\r\n refetchFn({\r\n variables: { ...dataLocator, ...param.variables },\r\n payload: { ...param.payload },\r\n }, requestConfig, ...rest);\r\n }, [dataLocator, refetchFn]);\r\n\r\n const [data, error] = fetch;\r\n\r\n return [{\r\n data,\r\n error,\r\n }, {\r\n read,\r\n }];\r\n}\r\n","import _ from 'underscore';\r\nimport {\r\n EDM,\r\n resIdsPlugin,\r\n defineConstProperty,\r\n} from '@bingads-webui-react/overreact-odata';\r\n\r\n// import { odataPlugin } from '@bingads-webui/edm-odata';\r\nimport { schemas } from '@bingads-webui/campaign-odata-schemas';\r\n\r\nexport const edm = new EDM({\r\n schemas: {\r\n $ROOT: {\r\n $$ref: '$ROOT',\r\n type: 'object',\r\n properties: {\r\n Customers: {\r\n type: 'array',\r\n items: schemas['Model/Customer'],\r\n },\r\n },\r\n $$ODataExtension: {\r\n Name: '$ROOT',\r\n NavigationProperty: [\r\n 'Customers',\r\n ],\r\n },\r\n },\r\n ..._.mapObject(\r\n schemas,\r\n (schema, name) => _.extend(schema, { $$ref: name })\r\n ),\r\n },\r\n});\r\n\r\nresIdsPlugin(edm);\r\n\r\n// odataPlugin(edm, '', {});\r\nconst root = edm.types.resolve('$ROOT');\r\n\r\nconst rootResourceIdentifier = new root.ResourceIdentifier();\r\ndefineConstProperty(edm, 'root', rootResourceIdentifier);\r\ndefineConstProperty(edm, 'Customers', rootResourceIdentifier.Customers);\r\n","import { Schema } from '@bingads-webui-react/overreact';\r\n\r\nimport { edm } from './edm';\r\n\r\nconst schemaToModelMapping = {\r\n customer: 'Model/Customer',\r\n account: 'Model/Account',\r\n app: 'Model/App',\r\n campaign: 'Model/Campaign',\r\n ad_group: 'Model/AdGroup',\r\n keyword: 'Model/Keyword',\r\n ad: 'Model/Ad',\r\n negative_keyword_list: 'Model/NegativeKeywordList',\r\n negative_keyword: 'Model/NegativeKeyword',\r\n bulk_edit_session: 'Model/BulkEditSession',\r\n bulk_edit_result: 'Model/BulkEditResult',\r\n audience: 'Model/Audience',\r\n remessaging_audience: 'Model/RemessagingAudience',\r\n tag: 'Model/Tag',\r\n task_item: 'Model/TaskItem',\r\n goal: 'Model/Goal',\r\n conversion_advice: 'Model/ConversionAdvice',\r\n task_item_execution: 'Model/TaskItemExecution',\r\n ad_group_criterion: 'Model/AdGroupCriterion',\r\n audience_ad_group_criterion: 'Model/AudienceAdGroupCriterion',\r\n ad_group_audience_association: 'Model/AdGroupAudienceAssociation',\r\n audience_association: 'Model/AudienceAssociation',\r\n audience_criterion_with_b_i: 'Model/AudienceCriterionWithBI',\r\n ad_group_audience_criterion_with_b_i: 'Model/AdGroupAudienceCriterionWithBI',\r\n ad_group_audience_criterion: 'Model/AdGroupAudienceCriterion',\r\n campaign_criterion: 'Model/CampaignCriterion',\r\n campaign_audience_criterion: 'Model/CampaignAudienceCriterion',\r\n product_offer: 'Model/ProductOffer',\r\n product_partition: 'Model/ProductPartition',\r\n preference: 'Model/Preference',\r\n product_offer_store: 'Model/ProductOfferStore',\r\n image: 'Model/Image',\r\n ad_extension: 'Model/AdExtension',\r\n image_ad_extension: 'Model/ImageAdExtension',\r\n location_ad_extension: 'Model/LocationAdExtension',\r\n ad_extension_association: 'Model/AdExtensionAssociation',\r\n annotation_opt_out_info: 'Model/AnnotationOptOutInfo',\r\n automated_extension: 'Model/AutomatedExtension',\r\n label: 'Model/Label',\r\n budget: 'Model/Budget',\r\n portfolio_bid_strategy: 'Model/PortfolioBidStrategy',\r\n location: 'Model/Location',\r\n biddable_ad_group_criterion: 'Model/BiddableAdGroupCriterion',\r\n dsa_target: 'Model/DsaTarget',\r\n domain_category: 'Model/DomainCategory',\r\n negative_ad_group_criterion: 'Model/NegativeAdGroupCriterion',\r\n negative_ad_group_dsa_target: 'Model/NegativeAdGroupDsaTarget',\r\n negative_campaign_criterion: 'Model/NegativeCampaignCriterion',\r\n negative_campaign_dsa_target: 'Model/NegativeCampaignDsaTarget',\r\n dsa_search_term: 'Model/DsaSearchTerm',\r\n category: 'Model/Category',\r\n negative_keyword_conflict: 'Model/NegativeKeywordConflict',\r\n search_term: 'Model/SearchTerm',\r\n demographic: 'Model/Demographic',\r\n feed: 'Model/Feed',\r\n ad_customizer_attribute: 'Model/AdCustomizerAttribute',\r\n ad_customizer_attribute_value: 'Model/AdCustomizerAttributeValue',\r\n feed_item: 'Model/FeedItem',\r\n feed_upload_history: 'Model/FeedUploadHistory',\r\n feed_association: 'Model/FeedAssociation',\r\n recommendation: 'Model/Recommendation',\r\n performance_target: 'Model/PerformanceTarget',\r\n performance_target_instance: 'Model/PerformanceTargetInstance',\r\n experiment: 'Model/Experiment',\r\n performance_time_series: 'Model/PerformanceTimeSeries',\r\n language_detect: 'Model/LanguageDetect',\r\n responsive_search_ad_instance: 'Model/ResponsiveSearchAdInstance',\r\n smart_listing: 'Model/SmartListing',\r\n business: 'Model/Business',\r\n search_phrase: 'Model/SearchPhrase',\r\n product_group: 'Model/ProductGroup',\r\n product_attribute_statistic: 'Model/ProductAttributeStatistic',\r\n stock_image: 'Model/StockImage',\r\n placement_exclusion_list: 'Model/PlacementExclusionList',\r\n negative_site: 'Model/NegativeSite',\r\n asset_link: 'Model/AssetLink',\r\n asset_with_b_i_data: 'Model/AssetWithBIData',\r\n shared_entity_association: 'Model/SharedEntityAssociation',\r\n promotion_ad_extension: 'Model/PromotionAdExtension',\r\n note: 'Model/Note',\r\n note_segment: 'Model/NoteSegment',\r\n video: 'Model/Video',\r\n video_resource: 'Model/VideoResource',\r\n video_caption_file: 'Model/VideoCaptionFile',\r\n filter_link_ad_extension: 'Model/FilterLinkAdExtension',\r\n smart_page: 'Model/SmartPage',\r\n flyer_ad_extension: 'Model/FlyerAdExtension',\r\n reparenting_user_setting: 'Model/ReparentingUserSetting',\r\n video_ad_extension: 'Model/VideoAdExtension',\r\n account_label_association_count: 'Model/AccountLabelAssociationCount',\r\n location_targeting_info: 'Model/LocationTargetingInfo',\r\n responsive_search_ad: 'Model/ResponsiveSearchAd',\r\n import_recommendation: 'Model/ImportRecommendation',\r\n seasonality_adjustment: 'Model/SeasonalityAdjustment',\r\n r_s_a_ad_customizer_attribute: 'Model/RSAAdCustomizerAttribute',\r\n dimension_row: 'Model/DimensionRow',\r\n multi_account_overview: 'Model/MultiAccountOverview',\r\n report_data_report_info: 'Model/ReportDataReportInfo',\r\n upload_url: 'Model/UploadUrl',\r\n app_install_ad: 'Model/AppInstallAd',\r\n dynamic_search_ad: 'Model/DynamicSearchAd',\r\n expanded_text_ad: 'Model/ExpandedTextAd',\r\n mobile_ad: 'Model/MobileAd',\r\n product_ad: 'Model/ProductAd',\r\n responsive_ad: 'Model/ResponsiveAd',\r\n text_ad: 'Model/TextAd',\r\n ad_group_criterion_grid_data: 'Model/AdGroupCriterionGridData',\r\n order_item_bid_info: 'Model/OrderItemBidInfo',\r\n biddable_campaign_criterion: 'Model/BiddableCampaignCriterion',\r\n campaign_criterion_grid_data: 'Model/CampaignCriterionGridData',\r\n vertical_sub_account: 'Model/VerticalSubAccount',\r\n vertical_hotel_group: 'Model/VerticalHotelGroup',\r\n action_ad_extension: 'Model/ActionAdExtension',\r\n app_ad_extension: 'Model/AppAdExtension',\r\n call_ad_extension: 'Model/CallAdExtension',\r\n callout_ad_extension: 'Model/CalloutAdExtension',\r\n disclaimer_ad_extension: 'Model/DisclaimerAdExtension',\r\n dynamic_data_ad_extension: 'Model/DynamicDataAdExtension',\r\n price_ad_extension: 'Model/PriceAdExtension',\r\n review_ad_extension: 'Model/ReviewAdExtension',\r\n sitelink2_ad_extension: 'Model/Sitelink2AdExtension',\r\n structured_snippet_ad_extension: 'Model/StructuredSnippetAdExtension',\r\n application_install_goal: 'Model/ApplicationInstallGoal',\r\n destination_goal: 'Model/DestinationGoal',\r\n duration_goal: 'Model/DurationGoal',\r\n event_goal: 'Model/EventGoal',\r\n in_store_transaction_goal: 'Model/InStoreTransactionGoal',\r\n in_store_visit_goal: 'Model/InStoreVisitGoal',\r\n multi_stage_goal: 'Model/MultiStageGoal',\r\n offline_conversion_goal: 'Model/OfflineConversionGoal',\r\n page_views_per_visit_goal: 'Model/PageViewsPerVisitGoal',\r\n product_conversion_goal: 'Model/ProductConversionGoal',\r\n smart_goal: 'Model/SmartGoal',\r\n combined_list_audience: 'Model/CombinedListAudience',\r\n custom_audience: 'Model/CustomAudience',\r\n customer_list_audience: 'Model/CustomerListAudience',\r\n in_market_audience: 'Model/InMarketAudience',\r\n product_audience: 'Model/ProductAudience',\r\n remarketing_similar_audience: 'Model/RemarketingSimilarAudience',\r\n customer_shared_entity_association: 'Model/CustomerSharedEntityAssociation',\r\n bulk_download_task_item_execution: 'Model/BulkDownloadTaskItemExecution',\r\n bulk_upsert_task_item_execution: 'Model/BulkUpsertTaskItemExecution',\r\n offline_conversion_upload_task_item_execution: 'Model/OfflineConversionUploadTaskItemExecution',\r\n pps_reconciliation_report_manager_task_item_execution: 'Model/PpsReconciliationReportManagerTaskItemExecution',\r\n pps_reconciliation_report_upload_task_item_execution: 'Model/PpsReconciliationReportUploadTaskItemExecution',\r\n feed_upload_result: 'Model/FeedUploadResult',\r\n feed_import_result: 'Model/FeedImportResult',\r\n cloud_import_result: 'Model/CloudImportResult',\r\n cloud_import_v2_result: 'Model/CloudImportV2Result',\r\n google_tag_manager_import_result: 'Model/GoogleTagManagerImportResult',\r\n import_result: 'Model/ImportResult',\r\n multi_account_google_import_result: 'Model/MultiAccountGoogleImportResult',\r\n smart_import_scheduler_result: 'Model/SmartImportSchedulerResult',\r\n multi_account_download_result: 'Model/MultiAccountDownloadResult',\r\n bulk_upload_task_item_execution: 'Model/BulkUploadTaskItemExecution',\r\n report_data_task_item_execution: 'Model/ReportDataTaskItemExecution',\r\n script_task_item_execution: 'Model/ScriptTaskItemExecution',\r\n script_item_change: 'Model/ScriptItemChange',\r\n script_changes_summary: 'Model/ScriptChangesSummary',\r\n bing_places_task_item: 'Model/BingPlacesTaskItem',\r\n bulk_download_task_item: 'Model/BulkDownloadTaskItem',\r\n bulk_upsert_task_item: 'Model/BulkUpsertTaskItem',\r\n email_rule: 'Model/EmailRule',\r\n offline_conversion_upload_task_item: 'Model/OfflineConversionUploadTaskItem',\r\n pps_reconciliation_report_manager_task_item: 'Model/PpsReconciliationReportManagerTaskItem',\r\n pps_reconciliation_report_upload_task_item: 'Model/PpsReconciliationReportUploadTaskItem',\r\n facebook_task_item: 'Model/FacebookTaskItem',\r\n feed_upload_task_item_base: 'Model/FeedUploadTaskItemBase',\r\n create_feed_upload_task_item: 'Model/CreateFeedUploadTaskItem',\r\n import_feed_and_feed_mapping_upload_task_item: 'Model/ImportFeedAndFeedMappingUploadTaskItem',\r\n import_feed_item_upload_task_item: 'Model/ImportFeedItemUploadTaskItem',\r\n replace_feed_upload_task_item: 'Model/ReplaceFeedUploadTaskItem',\r\n r_s_a_ad_customizer_feed_upload_task_item: 'Model/RSAAdCustomizerFeedUploadTaskItem',\r\n update_feed_upload_task_item: 'Model/UpdateFeedUploadTaskItem',\r\n google_my_business_task_item: 'Model/GoogleMyBusinessTaskItem',\r\n amazon_import_task_item: 'Model/AmazonImportTaskItem',\r\n cloud_import_task_item: 'Model/CloudImportTaskItem',\r\n google_tag_manager_import_task_item: 'Model/GoogleTagManagerImportTaskItem',\r\n import_task_item: 'Model/ImportTaskItem',\r\n multi_account_google_import_task_item: 'Model/MultiAccountGoogleImportTaskItem',\r\n smart_import_scheduler_task_item: 'Model/SmartImportSchedulerTaskItem',\r\n multi_account_download_task_item: 'Model/MultiAccountDownloadTaskItem',\r\n multi_account_bulk_upload_task_item: 'Model/MultiAccountBulkUploadTaskItem',\r\n report_task_item: 'Model/ReportTaskItem',\r\n report_data_task_item: 'Model/ReportDataTaskItem',\r\n report_rule: 'Model/ReportRule',\r\n report_email_rule: 'Model/ReportEmailRule',\r\n script_task_item: 'Model/ScriptTaskItem',\r\n update_campaign_store_id_task_item: 'Model/UpdateCampaignStoreIdTaskItem',\r\n advertiser_rule: 'Model/AdvertiserRule',\r\n mca_schedule_post_task_item: 'Model/McaSchedulePostTaskItem',\r\n mca_social_metrics_sync_up_task_item: 'Model/McaSocialMetricsSyncUpTaskItem',\r\n mca_social_profile_init_task_item: 'Model/McaSocialProfileInitTaskItem',\r\n mca_report_job_task_item: 'Model/McaReportJobTaskItem',\r\n tip: 'Model/Tip',\r\n custom_column: 'Model/CustomColumn',\r\n company: 'Model/Company',\r\n industry: 'Model/Industry',\r\n job_function: 'Model/JobFunction',\r\n advice_event: 'Model/AdviceEvent',\r\n custom_event_for_event: 'Model/CustomEventForEvent',\r\n custom_event_for_value: 'Model/CustomEventForValue',\r\n page_load_event: 'Model/PageLoadEvent',\r\n travel_dimension_row: 'Model/TravelDimensionRow',\r\n report_data_column_info: 'Model/ReportDataColumnInfo',\r\n fb_event_owner: 'Model/FbEventOwner',\r\n fb_place: 'Model/FbPlace',\r\n http_request_message: 'Model/HttpRequestMessage',\r\n stock_image_asset: 'Model/StockImageAsset',\r\n report_data_enum_filter: 'Model/ReportDataEnumFilter',\r\n report_data_text_filter: 'Model/ReportDataTextFilter',\r\n report_data_column_set: 'Model/ReportDataColumnSet',\r\n ads_api_error: 'Model/AdsApiError',\r\n totals_with_performance_metrics: 'Model/TotalsWithPerformanceMetrics',\r\n account_totals: 'Model/AccountTotals',\r\n campaign_totals: 'Model/CampaignTotals',\r\n aggregate_budget: 'Model/AggregateBudget',\r\n performance_metrics: 'Model/PerformanceMetrics',\r\n custom_column_error_response: 'Model/CustomColumnErrorResponse',\r\n custom_column_error_detail_item: 'Model/CustomColumnErrorDetailItem',\r\n goal_performance_metrics: 'Model/GoalPerformanceMetrics',\r\n performance_metrics_totals_by_network_split: 'Model/PerformanceMetricsTotalsByNetworkSplit',\r\n custom_column_output_value: 'Model/CustomColumnOutputValue',\r\n insertion_order: 'Model/InsertionOrder',\r\n insertion_order_details: 'Model/InsertionOrderDetails',\r\n user: 'Model/User',\r\n product_condition: 'Model/ProductCondition',\r\n attribute_statistic: 'Model/AttributeStatistic',\r\n base_expression: 'Model/BaseExpression',\r\n filter: 'Model/Filter',\r\n entity_filter: 'Model/EntityFilter',\r\n child_entity_filter: 'Model/ChildEntityFilter',\r\n bulk_edit_action: 'Model/BulkEditAction',\r\n ad_group_audience_criterion_complex: 'Model/AdGroupAudienceCriterionComplex',\r\n ad_extension_association_complex: 'Model/AdExtensionAssociationComplex',\r\n dictionary_2_of_string__string: 'Model/Dictionary_2OfString_String',\r\n dictionary_2_of_string__import_statistics: 'Model/Dictionary_2OfString_ImportStatistics',\r\n target_totals: 'Model/TargetTotals',\r\n key_value_pair_2_of_int64__string: 'Model/KeyValuePair_2OfInt64_String',\r\n delivery_status_detail: 'Model/DeliveryStatusDetail',\r\n d_b_null: 'Model/DBNull',\r\n experiment_metrics: 'Model/ExperimentMetrics',\r\n dictionary_2_of_string__dictionary_2_of_string__int64: 'Model/Dictionary_2OfString_Dictionary_2OfString_Int64',\r\n asset: 'Model/Asset',\r\n manager_account: 'Model/ManagerAccount',\r\n entity_id_parent_id: 'Model/EntityIdParentId',\r\n owner: 'Model/Owner',\r\n rerun_run_report_result: 'Model/RerunRunReportResult',\r\n single_account_google_import_task_item: 'Model/SingleAccountGoogleImportTaskItem',\r\n single_account_import_result: 'Model/SingleAccountImportResult',\r\n image_asset: 'Model/ImageAsset',\r\n smart_estimation_point: 'Model/SmartEstimationPoint',\r\n budget_kpi_estimations_response: 'Model/BudgetKpiEstimationsResponse',\r\n ads_count: 'Model/AdsCount',\r\n ad_groups_count: 'Model/AdGroupsCount',\r\n dictionary_2_of_ad_type__int32: 'Model/Dictionary_2OfAdType_Int32',\r\n fb_business: 'Model/FbBusiness',\r\n fb_cover: 'Model/FbCover',\r\n fb_location: 'Model/FbLocation',\r\n fb_page: 'Model/FbPage',\r\n fb_picture: 'Model/FbPicture',\r\n fb_post: 'Model/FbPost',\r\n fb_rating: 'Model/FbRating',\r\n fb_photo: 'Model/FbPhoto',\r\n fb_call_to_action: 'Model/FbCallToAction',\r\n fb_event: 'Model/FbEvent',\r\n fb_event_time: 'Model/FbEventTime',\r\n fb_user: 'Model/FbUser',\r\n fb_id_name_map: 'Model/FbIdNameMap',\r\n smart_page_fb_error: 'Model/SmartPageFbError',\r\n smart_page_fb_errors: 'Model/SmartPageFbErrors',\r\n smart_page_metric: 'Model/SmartPageMetric',\r\n click_metric: 'Model/ClickMetric',\r\n smart_page_business_hours: 'Model/SmartPageBusinessHours',\r\n smart_page_time_slots: 'Model/SmartPageTimeSlots',\r\n smart_page_suggestion: 'Model/SmartPageSuggestion',\r\n smart_page_image: 'Model/SmartPageImage',\r\n multi_account_recommendation: 'Model/MultiAccountRecommendation',\r\n dictionary_2_of_verified_tracking_vendor_field__string: 'Model/Dictionary_2OfVerifiedTrackingVendorField_String',\r\n b_i_data_status: 'Model/BIDataStatus',\r\n http_response_message: 'Model/HttpResponseMessage',\r\n i_enumerable_1_of_attribute_statistic: 'Model/IEnumerable_1OfAttributeStatistic',\r\n grid_data_parameters: 'Model/GridDataParameters',\r\n conversion_goal_details: 'Model/ConversionGoalDetails',\r\n criterion: 'Model/Criterion',\r\n list_1_of_b_i_data_status: 'Model/List_1OfBIDataStatus',\r\n key_value_pair_2_of_string__string: 'Model/KeyValuePair_2OfString_String',\r\n blob: 'Model/Blob',\r\n i_enumerable_1_of_i_enumerable_1_of_string: 'Model/IEnumerable_1OfIEnumerable_1OfString',\r\n data_availability: 'Model/DataAvailability',\r\n report_parameters: 'Model/ReportParameters',\r\n report_preview_parameters: 'Model/ReportPreviewParameters',\r\n multi_account_overview_parameters: 'Model/MultiAccountOverviewParameters',\r\n multi_account_recommendation_parameters: 'Model/MultiAccountRecommendationParameters',\r\n key_value_pair_2_of_int32__boolean: 'Model/KeyValuePair_2OfInt32_Boolean',\r\n search_term_selection_item: 'Model/SearchTermSelectionItem',\r\n alert_information: 'Model/AlertInformation',\r\n fb_page_authorization_data: 'Model/FbPageAuthorizationData',\r\n i_enumerable_1_of_fb_page: 'Model/IEnumerable_1OfFbPage',\r\n ads_api_batch_errors: 'Model/AdsApiBatchErrors',\r\n smart_page_association: 'Model/SmartPageAssociation',\r\n smart_page_metric_set: 'Model/SmartPageMetricSet',\r\n smart_page_details: 'Model/SmartPageDetails',\r\n smart_page_partner_details: 'Model/SmartPagePartnerDetails',\r\n website_source_data: 'Model/WebsiteSourceData',\r\n entity_editorial_reasons_collection: 'Model/EntityEditorialReasonsCollection',\r\n ad_resource_not_eligible_reasons_collection: 'Model/AdResourceNotEligibleReasonsCollection',\r\n set_smart_listings_result: 'Model/SetSmartListingsResult',\r\n ad_strength_and_action_items: 'Model/AdStrengthAndActionItems',\r\n medias: 'Model/Medias',\r\n recommendation_media_option: 'Model/RecommendationMediaOption',\r\n recommendation_page_defination: 'Model/RecommendationPageDefination',\r\n media_generation_result: 'Model/MediaGenerationResult',\r\n image_generation: 'Model/ImageGeneration',\r\n media_output: 'Model/MediaOutput',\r\n budget_recommendation_response: 'Model/BudgetRecommendationResponse',\r\n target: 'Model/Target',\r\n mca_keyword: 'Model/McaKeyword',\r\n mca_ad: 'Model/McaAd',\r\n extracted_business_info: 'Model/ExtractedBusinessInfo',\r\n target_recommendation: 'Model/TargetRecommendation',\r\n a_b_testing_flight_log: 'Model/ABTestingFlightLog',\r\n a_b_testing_event_log: 'Model/ABTestingEventLog',\r\n date_range: 'Model/DateRange',\r\n tag_setting: 'Model/TagSetting',\r\n file_content_result: 'Model/FileContentResult',\r\n version: 'Model/Version',\r\n http_content: 'Model/HttpContent',\r\n key_value_pair_2_of_string__i_enumerable_1_of_string: 'Model/KeyValuePair_2OfString_IEnumerable_1OfString',\r\n stream_content: 'Model/StreamContent',\r\n read_only_memory_content: 'Model/ReadOnlyMemoryContent',\r\n multipart_content: 'Model/MultipartContent',\r\n multipart_form_data_content: 'Model/MultipartFormDataContent',\r\n byte_array_content: 'Model/ByteArrayContent',\r\n string_content: 'Model/StringContent',\r\n json_content: 'Model/JsonContent',\r\n header_encoding_selector_1_of_http_content: 'Model/HeaderEncodingSelector_1OfHttpContent',\r\n form_url_encoded_content: 'Model/FormUrlEncodedContent',\r\n http_method: 'Model/HttpMethod',\r\n uri: 'Model/Uri',\r\n account_inactive_reason: 'Model/AccountInactiveReason',\r\n quality_score_data: 'Model/QualityScoreData',\r\n segmented_performance_metrics: 'Model/SegmentedPerformanceMetrics',\r\n segmentation_key: 'Model/SegmentationKey',\r\n year_segmentation_key: 'Model/YearSegmentationKey',\r\n week_segmentation_key: 'Model/WeekSegmentationKey',\r\n top_vs_other_segmentation_key: 'Model/TopVsOtherSegmentationKey',\r\n quarter_segmentation_key: 'Model/QuarterSegmentationKey',\r\n network_segmentation_key: 'Model/NetworkSegmentationKey',\r\n month_segmentation_key: 'Model/MonthSegmentationKey',\r\n medium_segmentation_key: 'Model/MediumSegmentationKey',\r\n hour_of_the_day_segmentation_key: 'Model/HourOfTheDaySegmentationKey',\r\n goal_type_segmentation_key: 'Model/GoalTypeSegmentationKey',\r\n goal_name_segmentation_key: 'Model/GoalNameSegmentationKey',\r\n goal_category_segmentation_key: 'Model/GoalCategorySegmentationKey',\r\n device_type_segmentation_key: 'Model/DeviceTypeSegmentationKey',\r\n device_o_s_segmentation_key: 'Model/DeviceOSSegmentationKey',\r\n delivered_match_type_segmentation_key: 'Model/DeliveredMatchTypeSegmentationKey',\r\n day_segmentation_key: 'Model/DaySegmentationKey',\r\n day_of_the_week_segmentation_key: 'Model/DayOfTheWeekSegmentationKey',\r\n currency_segmentation_key: 'Model/CurrencySegmentationKey',\r\n bidded_match_type_segmentation_key: 'Model/BiddedMatchTypeSegmentationKey',\r\n audience_type_segmentation_key: 'Model/AudienceTypeSegmentationKey',\r\n audience_name_segmentation_key: 'Model/AudienceNameSegmentationKey',\r\n ad_scenario_segmentation_key: 'Model/AdScenarioSegmentationKey',\r\n ad_position_segmentation_key: 'Model/AdPositionSegmentationKey',\r\n phone_performance_metrics: 'Model/PhonePerformanceMetrics',\r\n segmented_phone_performance_metrics: 'Model/SegmentedPhonePerformanceMetrics',\r\n custom_parameter: 'Model/CustomParameter',\r\n bidding_scheme: 'Model/BiddingScheme',\r\n unknown_bidding_scheme: 'Model/UnknownBiddingScheme',\r\n target_roas_bidding_scheme: 'Model/TargetRoasBiddingScheme',\r\n target_impression_share_bidding_scheme: 'Model/TargetImpressionShareBiddingScheme',\r\n target_cpa_bidding_scheme: 'Model/TargetCpaBiddingScheme',\r\n percent_cpc_bidding_scheme: 'Model/PercentCpcBiddingScheme',\r\n max_roas_bidding_scheme: 'Model/MaxRoasBiddingScheme',\r\n max_conversion_value_bidding_scheme: 'Model/MaxConversionValueBiddingScheme',\r\n max_conversions_bidding_scheme: 'Model/MaxConversionsBiddingScheme',\r\n bid: 'Model/Bid',\r\n max_clicks_bidding_scheme: 'Model/MaxClicksBiddingScheme',\r\n manual_cpv_bidding_scheme: 'Model/ManualCpvBiddingScheme',\r\n manual_cpm_bidding_scheme: 'Model/ManualCpmBiddingScheme',\r\n manual_bidding_scheme: 'Model/ManualBiddingScheme',\r\n inherit_from_parent_bidding_scheme: 'Model/InheritFromParentBiddingScheme',\r\n enhanced_cpc_bidding_scheme: 'Model/EnhancedCpcBiddingScheme',\r\n cost_per_sale_bidding_scheme: 'Model/CostPerSaleBiddingScheme',\r\n commission_bidding_scheme: 'Model/CommissionBiddingScheme',\r\n campaign_settings: 'Model/CampaignSettings',\r\n smart_settings: 'Model/SmartSettings',\r\n verified_tracking_setting: 'Model/VerifiedTrackingSetting',\r\n verified_tracking_data: 'Model/VerifiedTrackingData',\r\n shopping_settings: 'Model/ShoppingSettings',\r\n expert_mode_settings: 'Model/ExpertModeSettings',\r\n dynamic_search_ads_setting: 'Model/DynamicSearchAdsSetting',\r\n disclaimer_setting: 'Model/DisclaimerSetting',\r\n audience_settings: 'Model/AudienceSettings',\r\n note_campaign_association: 'Model/NoteCampaignAssociation',\r\n note_ad_group_association: 'Model/NoteAdGroupAssociation',\r\n audience_criterion: 'Model/AudienceCriterion',\r\n bid_amount_detail: 'Model/BidAmountDetail',\r\n bid_estimation_data: 'Model/BidEstimationData',\r\n app_url: 'Model/AppUrl',\r\n label_association_counts: 'Model/LabelAssociationCounts',\r\n appeal: 'Model/Appeal',\r\n text_asset: 'Model/TextAsset',\r\n video_asset: 'Model/VideoAsset',\r\n ad_rotation: 'Model/AdRotation',\r\n updatable_date: 'Model/UpdatableDate',\r\n age_criterion: 'Model/AgeCriterion',\r\n day_time_criterion: 'Model/DayTimeCriterion',\r\n device_criterion: 'Model/DeviceCriterion',\r\n gender_criterion: 'Model/GenderCriterion',\r\n location_criterion: 'Model/LocationCriterion',\r\n geo_point: 'Model/GeoPoint',\r\n location_intent_criterion: 'Model/LocationIntentCriterion',\r\n profile_criterion: 'Model/ProfileCriterion',\r\n company_name_criterion: 'Model/CompanyNameCriterion',\r\n industry_criterion: 'Model/IndustryCriterion',\r\n job_function_criterion: 'Model/JobFunctionCriterion',\r\n radius_criterion: 'Model/RadiusCriterion',\r\n store_criterion: 'Model/StoreCriterion',\r\n webpage: 'Model/Webpage',\r\n webpage_parameter: 'Model/WebpageParameter',\r\n webpage_condition: 'Model/WebpageCondition',\r\n criterion_bid: 'Model/CriterionBid',\r\n fixed_bid: 'Model/FixedBid',\r\n bid_multiplier: 'Model/BidMultiplier',\r\n criterion_cashback: 'Model/CriterionCashback',\r\n cashback_adjustment: 'Model/CashbackAdjustment',\r\n bid_adjustment_recommendation: 'Model/BidAdjustmentRecommendation',\r\n schedule: 'Model/Schedule',\r\n day_time: 'Model/DayTime',\r\n key_value_pair_2_of_int64__campaign_editorial_reason_collection: 'Model/KeyValuePair_2OfInt64_CampaignEditorialReasonCollection',\r\n address: 'Model/Address',\r\n price_table_row: 'Model/PriceTableRow',\r\n setting: 'Model/Setting',\r\n target_setting: 'Model/TargetSetting',\r\n target_setting_detail: 'Model/TargetSettingDetail',\r\n co_op_setting: 'Model/CoOpSetting',\r\n recommendation_action: 'Model/RecommendationAction',\r\n metric_change: 'Model/MetricChange',\r\n product_group_cashback: 'Model/ProductGroupCashback',\r\n campaign_cashback: 'Model/CampaignCashback',\r\n ad_group_cashback: 'Model/AdGroupCashback',\r\n campaign_conversion_goal: 'Model/CampaignConversionGoal',\r\n account_item: 'Model/AccountItem',\r\n sharing_scope: 'Model/SharingScope',\r\n used_by: 'Model/UsedBy',\r\n goal_stage: 'Model/GoalStage',\r\n destination_goal_stage: 'Model/DestinationGoalStage',\r\n event_goal_stage: 'Model/EventGoalStage',\r\n selection: 'Model/Selection',\r\n comparison_date_range: 'Model/ComparisonDateRange',\r\n custom_column_definition: 'Model/CustomColumnDefinition',\r\n search_term_selection: 'Model/SearchTermSelection',\r\n performance_target_instance_selection: 'Model/PerformanceTargetInstanceSelection',\r\n dimension_report_selection: 'Model/DimensionReportSelection',\r\n automated_extension_selection: 'Model/AutomatedExtensionSelection',\r\n ad_extension_selection: 'Model/AdExtensionSelection',\r\n bulk_edit_batch_action: 'Model/BulkEditBatchAction',\r\n association_action: 'Model/AssociationAction',\r\n audience_association_action: 'Model/AudienceAssociationAction',\r\n label_association_action: 'Model/LabelAssociationAction',\r\n label_disassociation_action: 'Model/LabelDisassociationAction',\r\n bid_estimate_action: 'Model/BidEstimateAction',\r\n copy_action: 'Model/CopyAction',\r\n list_action: 'Model/ListAction',\r\n numeric_action: 'Model/NumericAction',\r\n query_only_action: 'Model/QueryOnlyAction',\r\n text_action: 'Model/TextAction',\r\n bulk_edit_item_change: 'Model/BulkEditItemChange',\r\n key_value_pair_2_of_string__list_1_of_editorial_error: 'Model/KeyValuePair_2OfString_List_1OfEditorialError',\r\n editorial_error: 'Model/EditorialError',\r\n api_editorial_error: 'Model/ApiEditorialError',\r\n mca_api_editorial_error: 'Model/McaApiEditorialError',\r\n editorial_info: 'Model/EditorialInfo',\r\n mca_editorial_reason: 'Model/McaEditorialReason',\r\n audience_expression: 'Model/AudienceExpression',\r\n page_visitors_who_visited_another_page_expression: 'Model/PageVisitorsWhoVisitedAnotherPageExpression',\r\n expression: 'Model/Expression',\r\n page_visitors_who_did_not_visit_another_page_expression: 'Model/PageVisitorsWhoDidNotVisitAnotherPageExpression',\r\n expression_collection: 'Model/ExpressionCollection',\r\n page_visitors_expression: 'Model/PageVisitorsExpression',\r\n custom_events_expression: 'Model/CustomEventsExpression',\r\n audience_set: 'Model/AudienceSet',\r\n dictionary_2_of_string__int64: 'Model/Dictionary_2OfString_Int64',\r\n annotation_opt_out: 'Model/AnnotationOptOut',\r\n aggregated_negative_keyword: 'Model/AggregatedNegativeKeyword',\r\n offline_conversion_file: 'Model/OfflineConversionFile',\r\n key_value_pair_2_of_int64__i_enumerable_1_of_ads_api_error: 'Model/KeyValuePair_2OfInt64_IEnumerable_1OfAdsApiError',\r\n cloud_import_task_base_result: 'Model/CloudImportTaskBaseResult',\r\n cloud_import_task_result: 'Model/CloudImportTaskResult',\r\n import_statistics: 'Model/ImportStatistics',\r\n entity_count: 'Model/EntityCount',\r\n key_value_pair_2_of_string__i_enumerable_1_of_ads_api_error: 'Model/KeyValuePair_2OfString_IEnumerable_1OfAdsApiError',\r\n key_value_pair_2_of_string__bulk_upload_entity_statistics: 'Model/KeyValuePair_2OfString_BulkUploadEntityStatistics',\r\n bulk_upload_entity_statistics: 'Model/BulkUploadEntityStatistics',\r\n bulk_file: 'Model/BulkFile',\r\n key_value_pair_2_of_string__ads_api_error: 'Model/KeyValuePair_2OfString_AdsApiError',\r\n bing_places_filter: 'Model/BingPlacesFilter',\r\n notification_delivery_option: 'Model/NotificationDeliveryOption',\r\n email_notification_delivery_option: 'Model/EmailNotificationDeliveryOption',\r\n import_user_preference: 'Model/ImportUserPreference',\r\n import_adjustment_for_numeric_property: 'Model/ImportAdjustmentForNumericProperty',\r\n import_prefix_and_suffix_for_string_property: 'Model/ImportPrefixAndSuffixForStringProperty',\r\n import_search_and_replace_for_string_property: 'Model/ImportSearchAndReplaceForStringProperty',\r\n facebook_import_context: 'Model/FacebookImportContext',\r\n google_my_business_filter: 'Model/GoogleMyBusinessFilter',\r\n amazon_import_context: 'Model/AmazonImportContext',\r\n ad_words_import_context: 'Model/AdWordsImportContext',\r\n import_user_preferences: 'Model/ImportUserPreferences',\r\n import_update_entity_preference: 'Model/ImportUpdateEntityPreference',\r\n import_append_dest_url_preference: 'Model/ImportAppendDestUrlPreference',\r\n import_search_and_replace_dest_url_preference: 'Model/ImportSearchAndReplaceDestUrlPreference',\r\n append_preferences_for_tracking_template: 'Model/AppendPreferencesForTrackingTemplate',\r\n search_and_replace_preferences_for_tracking_template: 'Model/SearchAndReplacePreferencesForTrackingTemplate',\r\n g_t_m_import_context: 'Model/GTMImportContext',\r\n g_t_m_tag_draft: 'Model/GTMTagDraft',\r\n google_account_property: 'Model/GoogleAccountProperty',\r\n file_import_context: 'Model/FileImportContext',\r\n smart_import_google_import_context: 'Model/SmartImportGoogleImportContext',\r\n smart_import_facebook_import_context: 'Model/SmartImportFacebookImportContext',\r\n aggregate_filter: 'Model/AggregateFilter',\r\n predicate: 'Model/Predicate',\r\n report_sort: 'Model/ReportSort',\r\n campaign_report_scope: 'Model/CampaignReportScope',\r\n ad_group_report_scope: 'Model/AdGroupReportScope',\r\n conditional_format: 'Model/ConditionalFormat',\r\n crop_settings: 'Model/CropSettings',\r\n seasonality_adjustment_campaign_association: 'Model/SeasonalityAdjustmentCampaignAssociation',\r\n migration_statuses: 'Model/MigrationStatuses',\r\n performance_target_metric: 'Model/PerformanceTargetMetric',\r\n feed_attribute: 'Model/FeedAttribute',\r\n feed_item_attribute_value: 'Model/FeedItemAttributeValue',\r\n feed_item_targets: 'Model/FeedItemTargets',\r\n feed_item_campaign_target: 'Model/FeedItemCampaignTarget',\r\n feed_item_adgroup_target: 'Model/FeedItemAdgroupTarget',\r\n feed_item_audience_target: 'Model/FeedItemAudienceTarget',\r\n feed_item_location_target: 'Model/FeedItemLocationTarget',\r\n feed_item_platform_target: 'Model/FeedItemPlatformTarget',\r\n feed_item_keyword_target: 'Model/FeedItemKeywordTarget',\r\n feed_upload_task_detail_base: 'Model/FeedUploadTaskDetailBase',\r\n update_feed_upload_task_detail: 'Model/UpdateFeedUploadTaskDetail',\r\n replace_feed_upload_task_detail: 'Model/ReplaceFeedUploadTaskDetail',\r\n create_feed_upload_task_detail: 'Model/CreateFeedUploadTaskDetail',\r\n feed_schedule_information: 'Model/FeedScheduleInformation',\r\n advice_summary: 'Model/AdviceSummary',\r\n advice_message: 'Model/AdviceMessage',\r\n goal_advice_summary: 'Model/GoalAdviceSummary',\r\n advice_item: 'Model/AdviceItem',\r\n event_advice_summary: 'Model/EventAdviceSummary',\r\n event_advice_detail: 'Model/EventAdviceDetail',\r\n last_import_info: 'Model/LastImportInfo',\r\n performance_data_point: 'Model/PerformanceDataPoint',\r\n performance_change_percent_metrics: 'Model/PerformanceChangePercentMetrics',\r\n segmented_performance_change_percent_metrics: 'Model/SegmentedPerformanceChangePercentMetrics',\r\n phone_performance_change_percent_metrics: 'Model/PhonePerformanceChangePercentMetrics',\r\n segmented_phone_performance_change_percent_metrics: 'Model/SegmentedPhonePerformanceChangePercentMetrics',\r\n smart_page_data_context: 'Model/SmartPageDataContext',\r\n smart_page_social_urls: 'Model/SmartPageSocialUrls',\r\n smart_page_video: 'Model/SmartPageVideo',\r\n smart_page_call_to_action: 'Model/SmartPageCallToAction',\r\n smart_page_location: 'Model/SmartPageLocation',\r\n uet_user_setting: 'Model/UetUserSetting',\r\n tag_info: 'Model/TagInfo',\r\n audience_item: 'Model/AudienceItem',\r\n goal_item: 'Model/GoalItem',\r\n tag_used_by_info: 'Model/TagUsedByInfo',\r\n used_by_pair: 'Model/UsedByPair',\r\n size: 'Model/Size',\r\n bid_below_first_page_detail: 'Model/BidBelowFirstPageDetail',\r\n negative_keyword_conflict_detail_collection: 'Model/NegativeKeywordConflictDetailCollection',\r\n negative_keyword_conflict_detail: 'Model/NegativeKeywordConflictDetail',\r\n experiment_statistic_1_of_int64: 'Model/ExperimentStatistic_1OfInt64',\r\n experiment_statistic_1_of_double: 'Model/ExperimentStatistic_1OfDouble',\r\n experiment_statistic_1_of_single: 'Model/ExperimentStatistic_1OfSingle',\r\n grid_data_filter: 'Model/GridDataFilter',\r\n ad_extension_association_grid_data_parameters: 'Model/AdExtensionAssociationGridDataParameters',\r\n automated_extension_grid_data_parameters: 'Model/AutomatedExtensionGridDataParameters',\r\n grid_pagination: 'Model/GridPagination',\r\n editorial_language_to_publisher_countries: 'Model/EditorialLanguageToPublisherCountries',\r\n editorial_reason: 'Model/EditorialReason',\r\n ad_resource_not_eligible_reason: 'Model/AdResourceNotEligibleReason',\r\n campaign_management_error_detail: 'Model/CampaignManagementErrorDetail',\r\n editorial_error_detail: 'Model/EditorialErrorDetail',\r\n publisher_country_editorial_errors: 'Model/PublisherCountryEditorialErrors',\r\n recommendation_image: 'Model/RecommendationImage',\r\n recommendation_image_option: 'Model/RecommendationImageOption',\r\n media_asset: 'Model/MediaAsset',\r\n image_filter: 'Model/ImageFilter',\r\n image_filter_parameter: 'Model/ImageFilterParameter',\r\n crop_setting: 'Model/CropSetting',\r\n output_image: 'Model/OutputImage',\r\n budget_info: 'Model/BudgetInfo',\r\n age_target: 'Model/AgeTarget',\r\n gender_target: 'Model/GenderTarget',\r\n geo_target: 'Model/GeoTarget',\r\n location_target: 'Model/LocationTarget',\r\n radius_target: 'Model/RadiusTarget',\r\n channel_appeal_info: 'Model/ChannelAppealInfo',\r\n ad_source: 'Model/AdSource',\r\n offline_ad_identity: 'Model/OfflineAdIdentity',\r\n carousel_ad: 'Model/CarouselAd',\r\n image_ad: 'Model/ImageAd',\r\n lead_image_ad: 'Model/LeadImageAd',\r\n provisioning_editorial_result: 'Model/ProvisioningEditorialResult',\r\n search_ad: 'Model/SearchAd',\r\n lead_ad: 'Model/LeadAd',\r\n video_ad: 'Model/VideoAd',\r\n extracted_address: 'Model/ExtractedAddress',\r\n location_target_recommendation: 'Model/LocationTargetRecommendation',\r\n radius_target_recommendation: 'Model/RadiusTargetRecommendation',\r\n entity_tag_header_value: 'Model/EntityTagHeaderValue',\r\n business_category_recommendations: 'BusinessCategoryRecommendations',\r\n prepare_ad_recommendation: 'PrepareAdRecommendation',\r\n post_a_b_testing_flight_log: 'PostABTestingFlightLog',\r\n post_a_b_testing_event_log: 'PostABTestingEventLog',\r\n};\r\n\r\nexport const schema = new Schema(\r\n schemaToModelMapping,\r\n name => edm.schema.schemas[name]\r\n);\r\n","import { isString } from 'underscore';\r\n\r\nexport function getRequestor(serviceRoot, additionalHeader) {\r\n return function networkRequestor(uri, requestVerb, headers, body) {\r\n const url = `${serviceRoot}${uri}`;\r\n const requestHeader = {\r\n ...additionalHeader,\r\n ...headers,\r\n };\r\n\r\n return fetch(url, {\r\n method: requestVerb,\r\n headers: requestHeader,\r\n body: isString(body) ? body : JSON.stringify(body),\r\n }).then((response) => {\r\n if (isString(body)) {\r\n const reader = response.body.getReader();\r\n return reader.read().then(({ value }) => {\r\n const responseString = new TextDecoder().decode(value);\r\n return responseString;\r\n });\r\n }\r\n if (response.status === 401) {\r\n const error = {\r\n status: response.status,\r\n };\r\n throw error;\r\n } else if (response.status === 204) {\r\n return {};\r\n }\r\n\r\n // read the JSON response in the body\r\n return response.json().catch((responseJSONParseError) => {\r\n // handle JSON parsing error here\r\n const error = {\r\n status: response.status,\r\n responseJSONParseError,\r\n };\r\n throw error;\r\n }).then((responseJSON) => {\r\n if (!response.ok) {\r\n // 400/500 error with JSON body\r\n const error = {\r\n status: response.status,\r\n responseJSON,\r\n };\r\n throw error;\r\n }\r\n\r\n // normal response with JSON body\r\n return responseJSON;\r\n });\r\n });\r\n };\r\n}\r\n","import {\r\n Environment,\r\n middlewareTypes,\r\n createFetchPolicyMiddleware,\r\n createErrorMiddleware,\r\n Store,\r\n} from '@bingads-webui-react/overreact';\r\nimport { schema } from './schema';\r\n\r\nexport { getRequestor } from './requestor';\r\n\r\nexport const middlewares = {\r\n [middlewareTypes.FETCH_POLICY]: createFetchPolicyMiddleware(),\r\n [middlewareTypes.ERROR]: createErrorMiddleware(),\r\n};\r\n\r\nconst store = new Store();\r\nlet env = null;\r\n\r\nexport const ENVIRONMENT_TAG = 'Campaign_Endpoint';\r\n\r\nexport function getEnvironmentInstance(requestor, customStore, customMiddleWares) {\r\n if (!env) {\r\n env = new Environment(\r\n requestor,\r\n schema,\r\n customStore || store,\r\n customMiddleWares || middlewares,\r\n ENVIRONMENT_TAG\r\n );\r\n }\r\n // allow caller to update requestor\r\n env.networkRequestor = requestor;\r\n env.middlewares = customMiddleWares || middlewares;\r\n\r\n return env;\r\n}\r\n\r\nexport function environmentLookupFn(environmentTag) {\r\n return environmentTag === ENVIRONMENT_TAG;\r\n}\r\n","import { FetchPolicy } from '@bingads-webui-react/overreact';\r\n\r\nexport const networkPolicy = FetchPolicy.StoreOrNetwork;\r\n\r\nexport function urlDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function headerDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function payloadDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function keySelectorDecorator(fn) {\r\n function decorator(obj, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return obj => decorator(obj, fn(obj));\r\n}\r\n\r\nexport function processorDecorator(fn) {\r\n function decorator(response, request, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return (response, request) => decorator(response, request, fn(response, request));\r\n}\r\n\r\nexport const sideEffects = {\r\n fetch: null,\r\n refetch: null,\r\n mutation: null,\r\n pagination: null,\r\n add: null,\r\n destroy: null,\r\n};\r\n","/* eslint-disable camelcase */\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n createSpec,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n specTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { composeSearchString } from '@bingads-webui-react/overreact-odata';\r\n\r\nimport { edm } from '../../../../../env/edm';\r\nimport { environmentLookupFn } from '../../../../../env/env-instance';\r\nimport { schema } from '../../../../../env/schema';\r\n\r\nimport {\r\n urlDecorator,\r\n headerDecorator,\r\n processorDecorator,\r\n keySelectorDecorator,\r\n sideEffects,\r\n\r\n networkPolicy,\r\n} from './destroy-decorators';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n const { locator: { descriptor } } = variables;\r\n const {\r\n customer_id,\r\n account_id,\r\n } = descriptor;\r\n\r\n const edmEntity = edm\r\n .Customers.$withKey(customer_id)\r\n .Accounts.$withKey(account_id);\r\n\r\n const searchString = composeSearchString(variables, edmEntity, false);\r\n return `${edmEntity.path}${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory(params) {\r\n const { headers } = params;\r\n return headers;\r\n}\r\n\r\nconst requestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account',\r\n verb: requestVerbs.DELETE,\r\n fetchPolicy: networkPolicy,\r\n uriFactoryFn: urlDecorator(odataUrlFactory),\r\n headerFactoryFn: headerDecorator(odataHeaderFactory),\r\n keySelector: variables => variables.locator.descriptor.account_id,\r\n parentKeySelector: variables => variables.locator.descriptor.customer_id,\r\n});\r\n\r\nconst responseContract = createResponseContract({\r\n requestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: keySelectorDecorator(r => r.Id),\r\n processorFn: processorDecorator(r => r),\r\n});\r\n\r\nexport const destroySpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.DELETE,\r\n sideEffects.destroy,\r\n environmentLookupFn\r\n);\r\n","import _ from 'underscore';\r\nimport { FetchPolicy } from '@bingads-webui-react/overreact';\r\n\r\nexport const networkPolicy = FetchPolicy.StoreOrNetwork;\r\n\r\nexport function urlDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function headerDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function payloadDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function keySelectorDecorator(fn) {\r\n function decorator(obj, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return obj => decorator(obj, fn(obj));\r\n}\r\n\r\nexport function processorDecorator(fn) {\r\n function decorator(response, request, originValue) {\r\n if (_.isArray(originValue.value)) {\r\n // when fetching all account properties, MT will respond with an array with 1 element\r\n return _.first(originValue.value);\r\n }\r\n return originValue;\r\n }\r\n\r\n return (response, request) => decorator(response, request, fn(response, request));\r\n}\r\n\r\nexport const sideEffects = {\r\n fetch: null,\r\n refetch: null,\r\n mutation: null,\r\n pagination: null,\r\n add: null,\r\n destroy: null,\r\n};\r\n","/* eslint-disable camelcase */\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n createSpec,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n specTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { composeSearchString } from '@bingads-webui-react/overreact-odata';\r\n\r\nimport { edm } from '../../../../../env/edm';\r\nimport { environmentLookupFn } from '../../../../../env/env-instance';\r\nimport { schema } from '../../../../../env/schema';\r\n\r\nimport {\r\n urlDecorator,\r\n headerDecorator,\r\n processorDecorator,\r\n keySelectorDecorator,\r\n sideEffects,\r\n\r\n networkPolicy,\r\n} from './fetch-decorators';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n const { locator: { descriptor } } = variables;\r\n const {\r\n customer_id,\r\n account_id,\r\n } = descriptor;\r\n\r\n const edmEntity = edm\r\n .Customers.$withKey(customer_id)\r\n .Accounts.$withKey(account_id);\r\n\r\n const searchString = composeSearchString(variables, edmEntity, false);\r\n return `${edmEntity.path}${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory(params) {\r\n const { headers } = params;\r\n return headers;\r\n}\r\n\r\nconst requestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account',\r\n verb: requestVerbs.GET,\r\n fetchPolicy: networkPolicy,\r\n uriFactoryFn: urlDecorator(odataUrlFactory),\r\n headerFactoryFn: headerDecorator(odataHeaderFactory),\r\n keySelector: variables => variables.locator.descriptor.account_id,\r\n parentKeySelector: variables => variables.locator.descriptor.customer_id,\r\n});\r\n\r\nconst responseContract = createResponseContract({\r\n requestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: keySelectorDecorator(r => r.Id),\r\n processorFn: processorDecorator(r => r),\r\n});\r\n\r\nexport const fetchSpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.FETCH,\r\n sideEffects.fetch,\r\n environmentLookupFn\r\n);\r\n\r\nexport const refetchSpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.REFETCH,\r\n sideEffects.refetch,\r\n environmentLookupFn\r\n);\r\n","import { FetchPolicy } from '@bingads-webui-react/overreact';\r\n\r\nexport const networkPolicy = FetchPolicy.StoreOrNetwork;\r\n\r\nexport function urlDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function headerDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function payloadDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function keySelectorDecorator(fn) {\r\n function decorator(obj, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return obj => decorator(obj, fn(obj));\r\n}\r\n\r\nexport function processorDecorator(fn) {\r\n // removed originValue since it was empty\r\n function decorator(response, request) {\r\n // TODO: Add decoration\r\n return {\r\n ...request.data,\r\n Id: request.variables.locator.descriptor.account_id,\r\n };\r\n }\r\n\r\n return (response, request) => decorator(response, request, fn(response, request));\r\n}\r\n\r\nexport const sideEffects = {\r\n fetch: null,\r\n refetch: null,\r\n mutation: null,\r\n pagination: null,\r\n add: null,\r\n destroy: null,\r\n};\r\n","/* eslint-disable camelcase */\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n createSpec,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n specTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { composeSearchString } from '@bingads-webui-react/overreact-odata';\r\n\r\nimport { edm } from '../../../../../env/edm';\r\nimport { environmentLookupFn } from '../../../../../env/env-instance';\r\nimport { schema } from '../../../../../env/schema';\r\n\r\nimport {\r\n urlDecorator,\r\n headerDecorator,\r\n payloadDecorator,\r\n processorDecorator,\r\n keySelectorDecorator,\r\n sideEffects,\r\n\r\n networkPolicy,\r\n} from './mutation-decorators';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n const { locator: { descriptor } } = variables;\r\n const {\r\n customer_id,\r\n account_id,\r\n } = descriptor;\r\n\r\n const edmEntity = edm\r\n .Customers.$withKey(customer_id)\r\n .Accounts.$withKey(account_id);\r\n\r\n const searchString = composeSearchString(variables, edmEntity, false);\r\n return `${edmEntity.path}${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory(params) {\r\n return params.headers;\r\n}\r\n\r\nfunction odataPayloadFactory(params) {\r\n return params.data;\r\n}\r\n\r\nconst requestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account',\r\n verb: requestVerbs.PATCH,\r\n fetchPolicy: networkPolicy,\r\n uriFactoryFn: urlDecorator(odataUrlFactory),\r\n headerFactoryFn: headerDecorator(odataHeaderFactory),\r\n payloadFactoryFn: payloadDecorator(odataPayloadFactory),\r\n keySelector: variables => variables.locator.descriptor.account_id,\r\n parentKeySelector: variables => variables.locator.descriptor.customer_id,\r\n});\r\n\r\nconst responseContract = createResponseContract({\r\n requestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: keySelectorDecorator(r => r.Id),\r\n processorFn: processorDecorator(r => r),\r\n});\r\n\r\nexport const mutationSpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.MUTATION,\r\n sideEffects.mutation,\r\n environmentLookupFn\r\n);\r\n","import { FetchPolicy } from '@bingads-webui-react/overreact';\r\n\r\nexport const networkPolicy = FetchPolicy.StoreOrNetwork;\r\n\r\nexport function urlDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function headerDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function payloadDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function keySelectorDecorator(fn) {\r\n function decorator(obj, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return obj => decorator(obj, fn(obj));\r\n}\r\n\r\nexport function processorDecorator(fn) {\r\n function decorator(response, request, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return (response, request) => decorator(response, request, fn(response, request));\r\n}\r\n\r\nexport const sideEffects = {\r\n fetch: null,\r\n refetch: null,\r\n mutation: null,\r\n pagination: null,\r\n add: null,\r\n destroy: null,\r\n};\r\n","/* eslint-disable camelcase */\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n createSpec,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n specTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { composeSearchString } from '@bingads-webui-react/overreact-odata';\r\n\r\nimport { edm } from '../../../../../env/edm';\r\nimport { environmentLookupFn } from '../../../../../env/env-instance';\r\nimport { schema } from '../../../../../env/schema';\r\n\r\nimport {\r\n urlDecorator,\r\n headerDecorator,\r\n payloadDecorator,\r\n processorDecorator,\r\n keySelectorDecorator,\r\n sideEffects,\r\n\r\n networkPolicy,\r\n} from './add-decorators';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n const { locator: { descriptor } } = variables;\r\n const {\r\n customer_id,\r\n } = descriptor;\r\n\r\n const edmEntity = edm\r\n .Customers.$withKey(customer_id)\r\n .Accounts;\r\n\r\n const searchString = composeSearchString(variables, edmEntity);\r\n return `${edmEntity.path}${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory(params) {\r\n return params.headers;\r\n}\r\n\r\nfunction odataPayloadFactory(params) {\r\n return params.data;\r\n}\r\n\r\nconst requestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account',\r\n verb: requestVerbs.POST,\r\n fetchPolicy: networkPolicy,\r\n uriFactoryFn: urlDecorator(odataUrlFactory),\r\n headerFactoryFn: headerDecorator(odataHeaderFactory),\r\n payloadFactoryFn: payloadDecorator(odataPayloadFactory),\r\n keySelector: variables => variables.locator.descriptor.account_id,\r\n parentKeySelector: variables => variables.locator.descriptor.customer_id,\r\n});\r\n\r\nconst responseContract = createResponseContract({\r\n requestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: keySelectorDecorator(r => r.Id),\r\n processorFn: processorDecorator(r => r.value),\r\n});\r\n\r\nexport const addSpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.ADD,\r\n sideEffects.add,\r\n environmentLookupFn\r\n);\r\n","import { FetchPolicy } from '@bingads-webui-react/overreact';\r\n\r\nexport const networkPolicy = FetchPolicy.StoreOrNetwork;\r\n\r\nexport function urlDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function headerDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function payloadDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function keySelectorDecorator(fn) {\r\n function decorator(obj, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return obj => decorator(obj, fn(obj));\r\n}\r\n\r\nexport function processorDecorator(fn) {\r\n function decorator(response, request, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return (response, request) => decorator(response, request, fn(response, request));\r\n}\r\n\r\nexport const sideEffects = {\r\n fetch: null,\r\n refetch: null,\r\n mutation: null,\r\n pagination: null,\r\n add: null,\r\n destroy: null,\r\n};\r\n","/* eslint-disable camelcase */\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n createSpec,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n specTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { composeSearchString } from '@bingads-webui-react/overreact-odata';\r\n\r\nimport { edm } from '../../../../../env/edm';\r\nimport { environmentLookupFn } from '../../../../../env/env-instance';\r\nimport { schema } from '../../../../../env/schema';\r\n\r\nimport {\r\n urlDecorator,\r\n headerDecorator,\r\n processorDecorator,\r\n keySelectorDecorator,\r\n sideEffects,\r\n\r\n networkPolicy,\r\n} from './destroy-decorators';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n const { locator: { descriptor } } = variables;\r\n const {\r\n customer_id,\r\n account_id,\r\n } = descriptor;\r\n\r\n const edmEntity = edm\r\n .Customers.$withKey(customer_id)\r\n .Accounts.$withKey(account_id);\r\n\r\n const searchString = composeSearchString(variables, edmEntity, false);\r\n return `${edmEntity.path}${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory(params) {\r\n const { headers } = params;\r\n return headers;\r\n}\r\n\r\nconst requestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account',\r\n verb: requestVerbs.DELETE,\r\n fetchPolicy: networkPolicy,\r\n uriFactoryFn: urlDecorator(odataUrlFactory),\r\n headerFactoryFn: headerDecorator(odataHeaderFactory),\r\n keySelector: variables => variables.locator.descriptor.account_id,\r\n parentKeySelector: variables => variables.locator.descriptor.customer_id,\r\n});\r\n\r\nconst responseContract = createResponseContract({\r\n requestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: keySelectorDecorator(r => r.Id),\r\n processorFn: processorDecorator(r => r),\r\n});\r\n\r\nexport const destroySpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.DELETE,\r\n sideEffects.destroy,\r\n environmentLookupFn\r\n);\r\n","import { FetchPolicy } from '@bingads-webui-react/overreact';\r\n\r\nexport const networkPolicy = FetchPolicy.StoreOrNetwork;\r\n\r\nexport function urlDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function headerDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function payloadDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function keySelectorDecorator(fn) {\r\n function decorator(obj, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return obj => decorator(obj, fn(obj));\r\n}\r\n\r\nexport function processorDecorator(fn) {\r\n function decorator(response, request, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return (response, request) => decorator(response, request, fn(response, request));\r\n}\r\n\r\nexport const sideEffects = {\r\n fetch: null,\r\n refetch: null,\r\n mutation: null,\r\n pagination: null,\r\n add: null,\r\n destroy: null,\r\n};\r\n","/* eslint-disable camelcase */\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n createSpec,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n specTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { composeSearchString } from '@bingads-webui-react/overreact-odata';\r\n\r\nimport { edm } from '../../../../../env/edm';\r\nimport { environmentLookupFn } from '../../../../../env/env-instance';\r\nimport { schema } from '../../../../../env/schema';\r\n\r\nimport {\r\n urlDecorator,\r\n headerDecorator,\r\n processorDecorator,\r\n keySelectorDecorator,\r\n sideEffects,\r\n\r\n networkPolicy,\r\n} from './fetch-decorators';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n const { locator: { descriptor } } = variables;\r\n const {\r\n customer_id,\r\n } = descriptor;\r\n\r\n const edmEntity = edm\r\n .Customers.$withKey(customer_id)\r\n .Accounts;\r\n\r\n const searchString = composeSearchString(variables, edmEntity);\r\n return `${edmEntity.path}${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory(params) {\r\n const { headers } = params;\r\n return headers;\r\n}\r\n\r\nconst requestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account',\r\n verb: requestVerbs.GET,\r\n fetchPolicy: networkPolicy,\r\n uriFactoryFn: urlDecorator(odataUrlFactory),\r\n headerFactoryFn: headerDecorator(odataHeaderFactory),\r\n keySelector: variables => variables.locator.descriptor.account_id,\r\n parentKeySelector: variables => variables.locator.descriptor.customer_id,\r\n});\r\n\r\nconst responseContract = createResponseContract({\r\n requestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: keySelectorDecorator(r => r.Id),\r\n processorFn: processorDecorator(r => r.value),\r\n});\r\n\r\nexport const fetchSpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.PAGINATION,\r\n sideEffects.pagination,\r\n environmentLookupFn\r\n);\r\n\r\nexport const refetchSpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.REFETCH,\r\n sideEffects.refetch,\r\n environmentLookupFn\r\n);\r\n","import { FetchPolicy } from '@bingads-webui-react/overreact';\r\n\r\nexport const networkPolicy = FetchPolicy.StoreOrNetwork;\r\n\r\nexport function urlDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function headerDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function payloadDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function keySelectorDecorator(fn) {\r\n function decorator(obj, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return obj => decorator(obj, fn(obj));\r\n}\r\n\r\nexport function processorDecorator(fn) {\r\n function decorator(response, request, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return (response, request) => decorator(response, request, fn(response, request));\r\n}\r\n\r\nexport const sideEffects = {\r\n fetch: null,\r\n refetch: null,\r\n mutation: null,\r\n pagination: null,\r\n add: null,\r\n destroy: null,\r\n};\r\n","/* eslint-disable camelcase */\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n createSpec,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n specTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { composeSearchString } from '@bingads-webui-react/overreact-odata';\r\n\r\nimport { edm } from '../../../../../env/edm';\r\nimport { environmentLookupFn } from '../../../../../env/env-instance';\r\nimport { schema } from '../../../../../env/schema';\r\n\r\nimport {\r\n urlDecorator,\r\n headerDecorator,\r\n payloadDecorator,\r\n processorDecorator,\r\n keySelectorDecorator,\r\n sideEffects,\r\n\r\n networkPolicy,\r\n} from './mutation-decorators';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n const { locator: { descriptor } } = variables;\r\n const {\r\n customer_id,\r\n } = descriptor;\r\n\r\n const edmEntity = edm\r\n .Customers.$withKey(customer_id)\r\n .Accounts;\r\n\r\n const searchString = composeSearchString(variables, edmEntity, false);\r\n return `${edmEntity.path}${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory(params) {\r\n return params.headers;\r\n}\r\n\r\nfunction odataPayloadFactory(params) {\r\n return params.data;\r\n}\r\n\r\nconst requestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account',\r\n verb: requestVerbs.PATCH,\r\n fetchPolicy: networkPolicy,\r\n uriFactoryFn: urlDecorator(odataUrlFactory),\r\n headerFactoryFn: headerDecorator(odataHeaderFactory),\r\n payloadFactoryFn: payloadDecorator(odataPayloadFactory),\r\n keySelector: variables => variables.locator.descriptor.account_id,\r\n parentKeySelector: variables => variables.locator.descriptor.customer_id,\r\n});\r\n\r\nconst responseContract = createResponseContract({\r\n requestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: keySelectorDecorator(r => r.Id),\r\n processorFn: processorDecorator(r => r.value),\r\n});\r\n\r\nexport const mutationSpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.MUTATION,\r\n sideEffects.mutation,\r\n environmentLookupFn\r\n);\r\n","import stringify from 'json-stable-stringify';\r\nimport { FetchPolicy } from '@bingads-webui-react/overreact';\r\nimport { getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nexport const networkPolicy = FetchPolicy.NetworkOnly;\r\n\r\nexport function urlDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function headerDecorator(fn) {\r\n function decorator() {\r\n return getDefaultHeaderObj();\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function payloadDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function keySelectorDecorator(fn) {\r\n function decorator(obj, originValue) {\r\n return originValue.ClientId;\r\n }\r\n\r\n return obj => decorator(obj, fn(obj));\r\n}\r\n\r\nexport function processorDecorator(fn) {\r\n function decorator(response, request, originValue) {\r\n return {\r\n value: originValue && originValue.value,\r\n ClientId: stringify(request.variables),\r\n };\r\n }\r\n\r\n return (response, request) => decorator(response, request, fn(response, request));\r\n}\r\n\r\nexport const sideEffects = {\r\n fetch: null,\r\n refetch: null,\r\n mutation: null,\r\n pagination: null,\r\n add: null,\r\n destroy: null,\r\n};\r\n","/* eslint-disable camelcase */\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n createSpec,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n specTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { composeSearchString } from '@bingads-webui-react/overreact-odata';\r\n\r\nimport { edm } from '../../../../../../env/edm';\r\nimport { environmentLookupFn } from '../../../../../../env/env-instance';\r\nimport { schema } from '../../../../../../env/schema';\r\n\r\nimport {\r\n urlDecorator,\r\n headerDecorator,\r\n payloadDecorator,\r\n processorDecorator,\r\n keySelectorDecorator,\r\n sideEffects,\r\n\r\n networkPolicy,\r\n} from './action-decorators';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n const { locator: { descriptor }, ...rest } = variables;\r\n const {\r\n customer_id,\r\n account_id,\r\n } = descriptor;\r\n\r\n const edmEntity = edm\r\n .Customers.$withKey(customer_id)\r\n .Accounts.$withKey(account_id)['Default.BusinessCategoryRecommendations']\r\n .$call(rest);\r\n\r\n const searchString = composeSearchString(variables, edmEntity, false);\r\n return `${edmEntity.path}${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory(params) {\r\n return params.headers;\r\n}\r\n\r\nfunction odataPayloadFactory(params) {\r\n return params.data;\r\n}\r\n\r\nconst requestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:business_category_recommendations',\r\n verb: requestVerbs.POST,\r\n fetchPolicy: networkPolicy,\r\n uriFactoryFn: urlDecorator(odataUrlFactory),\r\n headerFactoryFn: headerDecorator(odataHeaderFactory),\r\n payloadFactoryFn: payloadDecorator(odataPayloadFactory),\r\n keySelector: variables => variables.locator.descriptor.account_id,\r\n parentKeySelector: variables => variables.locator.descriptor.customer_id,\r\n});\r\n\r\nconst responseContract = createResponseContract({\r\n requestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: keySelectorDecorator(r => r),\r\n processorFn: processorDecorator(r => r),\r\n});\r\n\r\nexport const fetchSpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.FETCH,\r\n sideEffects.fetch,\r\n environmentLookupFn\r\n);\r\n\r\nexport const actionSpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.MUTATION,\r\n sideEffects.mutation,\r\n environmentLookupFn\r\n);\r\n","import { FetchPolicy } from '@bingads-webui-react/overreact';\r\nimport { getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nexport const networkPolicy = FetchPolicy.NetworkOnly;\r\n\r\nexport function urlDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function headerDecorator(fn) {\r\n function decorator() {\r\n return getDefaultHeaderObj();\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function payloadDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function keySelectorDecorator(fn) {\r\n function decorator(obj, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return obj => decorator(obj, fn(obj));\r\n}\r\n\r\nexport function processorDecorator(fn) {\r\n function decorator(response, request, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return (response, request) => decorator(response, request, fn(response, request));\r\n}\r\n\r\nexport const sideEffects = {\r\n fetch: null,\r\n refetch: null,\r\n mutation: null,\r\n pagination: null,\r\n add: null,\r\n destroy: null,\r\n};\r\n","/* eslint-disable camelcase */\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n createSpec,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n specTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { composeSearchString } from '@bingads-webui-react/overreact-odata';\r\n\r\nimport { edm } from '../../../../../../env/edm';\r\nimport { environmentLookupFn } from '../../../../../../env/env-instance';\r\nimport { schema } from '../../../../../../env/schema';\r\n\r\nimport {\r\n urlDecorator,\r\n headerDecorator,\r\n payloadDecorator,\r\n processorDecorator,\r\n keySelectorDecorator,\r\n sideEffects,\r\n\r\n networkPolicy,\r\n} from './action-decorators';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n const { locator: { descriptor }, ...rest } = variables;\r\n const {\r\n customer_id,\r\n account_id,\r\n } = descriptor;\r\n\r\n const edmEntity = edm\r\n .Customers.$withKey(customer_id)\r\n .Accounts.$withKey(account_id)['Default.GetExtractedBusinessInfo']\r\n .$call(rest);\r\n\r\n const searchString = composeSearchString(variables, edmEntity, false);\r\n return `${edmEntity.path}${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory(params) {\r\n return params.headers;\r\n}\r\n\r\nfunction odataPayloadFactory(params) {\r\n return params.data;\r\n}\r\n\r\nconst requestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:extracted_business_info',\r\n verb: requestVerbs.POST,\r\n fetchPolicy: networkPolicy,\r\n uriFactoryFn: urlDecorator(odataUrlFactory),\r\n headerFactoryFn: headerDecorator(odataHeaderFactory),\r\n payloadFactoryFn: payloadDecorator(odataPayloadFactory),\r\n keySelector: variables => variables.locator.descriptor.account_id,\r\n parentKeySelector: variables => variables.locator.descriptor.customer_id,\r\n});\r\n\r\nconst responseContract = createResponseContract({\r\n requestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: keySelectorDecorator(r => r),\r\n processorFn: processorDecorator(r => r),\r\n});\r\n\r\nexport const fetchSpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.FETCH,\r\n sideEffects.fetch,\r\n environmentLookupFn\r\n);\r\n\r\nexport const actionSpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.MUTATION,\r\n sideEffects.mutation,\r\n environmentLookupFn\r\n);\r\n","import { FetchPolicy } from '@bingads-webui-react/overreact';\r\nimport { getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nexport const networkPolicy = FetchPolicy.StoreOrNetwork;\r\n\r\nexport function urlDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function headerDecorator(fn) {\r\n function decorator() {\r\n return getDefaultHeaderObj();\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function payloadDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function keySelectorDecorator(fn) {\r\n function decorator(obj, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return obj => decorator(obj, fn(obj));\r\n}\r\n\r\nexport function processorDecorator(fn) {\r\n function decorator(response, request, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return (response, request) => decorator(response, request, fn(response, request));\r\n}\r\n\r\nexport const sideEffects = {\r\n fetch: null,\r\n refetch: null,\r\n mutation: null,\r\n pagination: null,\r\n add: null,\r\n destroy: null,\r\n};\r\n","/* eslint-disable camelcase */\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n createSpec,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n specTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { composeSearchString } from '@bingads-webui-react/overreact-odata';\r\n\r\nimport { edm } from '../../../../../../env/edm';\r\nimport { environmentLookupFn } from '../../../../../../env/env-instance';\r\nimport { schema } from '../../../../../../env/schema';\r\n\r\nimport {\r\n urlDecorator,\r\n headerDecorator,\r\n payloadDecorator,\r\n processorDecorator,\r\n keySelectorDecorator,\r\n sideEffects,\r\n\r\n networkPolicy,\r\n} from './action-decorators';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n const { locator: { descriptor }, ...rest } = variables;\r\n const {\r\n customer_id,\r\n account_id,\r\n } = descriptor;\r\n\r\n const edmEntity = edm\r\n .Customers.$withKey(customer_id)\r\n .Accounts.$withKey(account_id)['Default.PostABTestingFlightLog']\r\n .$call(rest);\r\n\r\n const searchString = composeSearchString(variables, edmEntity, false);\r\n return `${edmEntity.path}${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory(params) {\r\n return params.headers;\r\n}\r\n\r\nfunction odataPayloadFactory(params) {\r\n return params.data;\r\n}\r\n\r\nconst requestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:post_a_b_testing_flight_log',\r\n verb: requestVerbs.POST,\r\n fetchPolicy: networkPolicy,\r\n uriFactoryFn: urlDecorator(odataUrlFactory),\r\n headerFactoryFn: headerDecorator(odataHeaderFactory),\r\n payloadFactoryFn: payloadDecorator(odataPayloadFactory),\r\n keySelector: variables => variables.locator.descriptor.account_id,\r\n parentKeySelector: variables => variables.locator.descriptor.customer_id,\r\n});\r\n\r\nconst responseContract = createResponseContract({\r\n requestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: keySelectorDecorator(r => r),\r\n processorFn: processorDecorator(r => r),\r\n});\r\n\r\nexport const fetchSpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.FETCH,\r\n sideEffects.fetch,\r\n environmentLookupFn\r\n);\r\n\r\nexport const actionSpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.MUTATION,\r\n sideEffects.mutation,\r\n environmentLookupFn\r\n);\r\n","import { FetchPolicy } from '@bingads-webui-react/overreact';\r\nimport { getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nexport const networkPolicy = FetchPolicy.NetworkOnly;\r\n\r\nexport function urlDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function headerDecorator(fn) {\r\n function decorator() {\r\n return getDefaultHeaderObj();\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function payloadDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function keySelectorDecorator(fn) {\r\n function decorator(obj, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return obj => decorator(obj, fn(obj));\r\n}\r\n\r\nexport function processorDecorator(fn) {\r\n function decorator(response, request, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return (response, request) => decorator(response, request, fn(response, request));\r\n}\r\n\r\nexport const sideEffects = {\r\n fetch: null,\r\n refetch: null,\r\n mutation: null,\r\n pagination: null,\r\n add: null,\r\n destroy: null,\r\n};\r\n","/* eslint-disable camelcase */\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n createSpec,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n specTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { composeSearchString } from '@bingads-webui-react/overreact-odata';\r\n\r\nimport { edm } from '../../../../../../env/edm';\r\nimport { environmentLookupFn } from '../../../../../../env/env-instance';\r\nimport { schema } from '../../../../../../env/schema';\r\n\r\nimport {\r\n urlDecorator,\r\n headerDecorator,\r\n payloadDecorator,\r\n processorDecorator,\r\n keySelectorDecorator,\r\n sideEffects,\r\n\r\n networkPolicy,\r\n} from './action-decorators';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n const { locator: { descriptor }, ...rest } = variables;\r\n const {\r\n customer_id,\r\n account_id,\r\n } = descriptor;\r\n\r\n const edmEntity = edm\r\n .Customers.$withKey(customer_id)\r\n .Accounts.$withKey(account_id)['Default.PostABTestingEventLog']\r\n .$call(rest);\r\n\r\n const searchString = composeSearchString(variables, edmEntity, false);\r\n return `${edmEntity.path}${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory(params) {\r\n return params.headers;\r\n}\r\n\r\nfunction odataPayloadFactory(params) {\r\n return params.data;\r\n}\r\n\r\nconst requestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:post_a_b_testing_event_log',\r\n verb: requestVerbs.POST,\r\n fetchPolicy: networkPolicy,\r\n uriFactoryFn: urlDecorator(odataUrlFactory),\r\n headerFactoryFn: headerDecorator(odataHeaderFactory),\r\n payloadFactoryFn: payloadDecorator(odataPayloadFactory),\r\n keySelector: variables => variables.locator.descriptor.account_id,\r\n parentKeySelector: variables => variables.locator.descriptor.customer_id,\r\n});\r\n\r\nconst responseContract = createResponseContract({\r\n requestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: keySelectorDecorator(r => r),\r\n processorFn: processorDecorator(r => r),\r\n});\r\n\r\nexport const fetchSpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.FETCH,\r\n sideEffects.fetch,\r\n environmentLookupFn\r\n);\r\n\r\nexport const actionSpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.MUTATION,\r\n sideEffects.mutation,\r\n environmentLookupFn\r\n);\r\n","import { FetchPolicy } from '@bingads-webui-react/overreact';\r\nimport { getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nexport const networkPolicy = FetchPolicy.NetworkOnly;\r\n\r\nexport function urlDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function headerDecorator(fn) {\r\n function decorator() {\r\n return getDefaultHeaderObj();\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function payloadDecorator(fn) {\r\n function decorator(params, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport function keySelectorDecorator(fn) {\r\n function decorator(obj, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return obj => decorator(obj, fn(obj));\r\n}\r\n\r\nexport function processorDecorator(fn) {\r\n function decorator(response, request, originValue) {\r\n // TODO: Add decoration\r\n return originValue;\r\n }\r\n\r\n return (response, request) => decorator(response, request, fn(response, request));\r\n}\r\n\r\nexport const sideEffects = {\r\n fetch: null,\r\n refetch: null,\r\n mutation: null,\r\n pagination: null,\r\n add: null,\r\n destroy: null,\r\n};\r\n","/* eslint-disable camelcase */\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n createSpec,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n specTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { composeSearchString } from '@bingads-webui-react/overreact-odata';\r\n\r\nimport { edm } from '../../../../../../../env/edm';\r\nimport { environmentLookupFn } from '../../../../../../../env/env-instance';\r\nimport { schema } from '../../../../../../../env/schema';\r\n\r\nimport {\r\n urlDecorator,\r\n headerDecorator,\r\n payloadDecorator,\r\n processorDecorator,\r\n keySelectorDecorator,\r\n sideEffects,\r\n\r\n networkPolicy,\r\n} from './action-decorators';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n const { locator: { descriptor }, ...rest } = variables;\r\n const {\r\n customer_id,\r\n account_id,\r\n campaign_id,\r\n } = descriptor;\r\n\r\n const edmEntity = edm\r\n .Customers.$withKey(customer_id)\r\n .Accounts.$withKey(account_id)\r\n .Campaigns.$withKey(campaign_id)['Default.PrepareAdRecommendation']\r\n .$call(rest);\r\n\r\n const searchString = composeSearchString(variables, edmEntity, false);\r\n return `${edmEntity.path}${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory(params) {\r\n return params.headers;\r\n}\r\n\r\nfunction odataPayloadFactory(params) {\r\n return params.data;\r\n}\r\n\r\nconst requestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:campaign:prepare_ad_recommendation',\r\n verb: requestVerbs.POST,\r\n fetchPolicy: networkPolicy,\r\n uriFactoryFn: urlDecorator(odataUrlFactory),\r\n headerFactoryFn: headerDecorator(odataHeaderFactory),\r\n payloadFactoryFn: payloadDecorator(odataPayloadFactory),\r\n keySelector: variables => variables.locator.descriptor.campaign_id,\r\n parentKeySelector: variables => variables.locator.descriptor.account_id,\r\n});\r\n\r\nconst responseContract = createResponseContract({\r\n requestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: keySelectorDecorator(r => r),\r\n processorFn: processorDecorator(r => r),\r\n});\r\n\r\nexport const fetchSpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.FETCH,\r\n sideEffects.fetch,\r\n environmentLookupFn\r\n);\r\n\r\nexport const actionSpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.MUTATION,\r\n sideEffects.mutation,\r\n environmentLookupFn\r\n);\r\n","import { FetchPolicy } from '@bingads-webui-react/overreact';\r\nimport { getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nexport const networkPolicy = FetchPolicy.NetworkOnly;\r\n\r\nexport function headerDecorator(fn) {\r\n function decorator() {\r\n return getDefaultHeaderObj();\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport const sideEffects = {\r\n fetch: null,\r\n refetch: null,\r\n mutation: null,\r\n pagination: null,\r\n add: null,\r\n destroy: null,\r\n};\r\n","import _ from 'underscore';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n createSpec,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n specTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { composeSearchString } from '@bingads-webui-react/overreact-odata';\r\n\r\nimport { edm } from '../../../../../../env/edm';\r\nimport { environmentLookupFn } from '../../../../../../env/env-instance';\r\nimport { schema } from '../../../../../../env/schema';\r\n\r\nimport {\r\n headerDecorator,\r\n sideEffects,\r\n\r\n networkPolicy,\r\n} from './add-decorators';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n const { locator: { descriptor } } = variables;\r\n const {\r\n customer_id: CustomerId,\r\n account_id: AccountId,\r\n } = descriptor;\r\n\r\n const edmEntity = edm\r\n .Customers.$withKey(CustomerId)\r\n .Accounts.$withKey(AccountId)\r\n .Tags;\r\n\r\n const searchString = composeSearchString(variables, edmEntity);\r\n return `${edmEntity.path}${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory(params) {\r\n return params.headers;\r\n}\r\n\r\nfunction odataPayloadFactory(params) {\r\n return params.data;\r\n}\r\n\r\nconst requestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:tag',\r\n verb: requestVerbs.POST,\r\n fetchPolicy: networkPolicy,\r\n uriFactoryFn: odataUrlFactory,\r\n headerFactoryFn: headerDecorator(odataHeaderFactory),\r\n payloadFactoryFn: odataPayloadFactory,\r\n keySelector: variables => variables.locator.descriptor.tag_id,\r\n parentKeySelector: variables => variables.locator.descriptor.account_id,\r\n});\r\n\r\nconst responseContract = createResponseContract({\r\n requestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: _.identity,\r\n processorFn: _.identity,\r\n});\r\n\r\nexport const addSpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.ADD,\r\n sideEffects.add,\r\n environmentLookupFn\r\n);\r\n","import { FetchPolicy } from '@bingads-webui-react/overreact';\r\nimport { getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nexport const networkPolicy = FetchPolicy.NetworkOnly;\r\n\r\nexport function headerDecorator(fn) {\r\n function decorator() {\r\n return getDefaultHeaderObj();\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport const sideEffects = {\r\n fetch: null,\r\n refetch: null,\r\n mutation: null,\r\n pagination: null,\r\n add: null,\r\n destroy: null,\r\n};\r\n","import _ from 'underscore';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n createSpec,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n specTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { composeSearchString } from '@bingads-webui-react/overreact-odata';\r\n\r\nimport { edm } from '../../../../../../env/edm';\r\nimport { environmentLookupFn } from '../../../../../../env/env-instance';\r\nimport { schema } from '../../../../../../env/schema';\r\n\r\nimport {\r\n headerDecorator,\r\n sideEffects,\r\n\r\n networkPolicy,\r\n} from './destroy-decorators';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n const { locator: { descriptor } } = variables;\r\n const {\r\n customer_id: CustomerId,\r\n account_id: AccountId,\r\n tag_id: TagId,\r\n } = descriptor;\r\n\r\n const edmEntity = edm\r\n .Customers.$withKey(CustomerId)\r\n .Accounts.$withKey(AccountId)\r\n .Tags.$withKey(TagId);\r\n\r\n const searchString = composeSearchString(variables, edmEntity, false);\r\n return `${edmEntity.path}${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory(params) {\r\n const { headers } = params;\r\n return headers;\r\n}\r\n\r\nconst requestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:tag',\r\n verb: requestVerbs.DELETE,\r\n fetchPolicy: networkPolicy,\r\n uriFactoryFn: odataUrlFactory,\r\n headerFactoryFn: headerDecorator(odataHeaderFactory),\r\n keySelector: variables => variables.locator.descriptor.tag_id,\r\n parentKeySelector: variables => variables.locator.descriptor.account_id,\r\n});\r\n\r\nconst responseContract = createResponseContract({\r\n requestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: _.identity,\r\n processorFn: _.identity,\r\n});\r\n\r\nexport const destroySpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.DELETE,\r\n sideEffects.destroy,\r\n environmentLookupFn\r\n);\r\n","import { FetchPolicy } from '@bingads-webui-react/overreact';\r\nimport { getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\n\r\nexport const networkPolicy = FetchPolicy.StoreOrNetwork;\r\n\r\nexport function headerDecorator(fn) {\r\n function decorator() {\r\n return getDefaultHeaderObj();\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport const sideEffects = {\r\n fetch: null,\r\n refetch: null,\r\n mutation: null,\r\n pagination: null,\r\n add: null,\r\n destroy: null,\r\n};\r\n","import {\r\n createRequestContract,\r\n createResponseContract,\r\n createSpec,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n specTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { composeSearchString } from '@bingads-webui-react/overreact-odata';\r\n\r\nimport { edm } from '../../../../../../env/edm';\r\nimport { environmentLookupFn } from '../../../../../../env/env-instance';\r\nimport { schema } from '../../../../../../env/schema';\r\n\r\nimport {\r\n headerDecorator,\r\n sideEffects,\r\n\r\n networkPolicy,\r\n} from './fetch-decorators';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n const { locator: { descriptor } } = variables;\r\n const {\r\n customer_id: CustomerId,\r\n account_id: AccountId,\r\n } = descriptor;\r\n\r\n const edmEntity = edm\r\n .Customers.$withKey(CustomerId)\r\n .Accounts.$withKey(AccountId)\r\n .Tags;\r\n\r\n const searchString = composeSearchString(variables, edmEntity);\r\n return `${edmEntity.path}${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory(params) {\r\n const { headers } = params;\r\n return headers;\r\n}\r\n\r\nconst requestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:tag',\r\n verb: requestVerbs.GET,\r\n fetchPolicy: networkPolicy,\r\n uriFactoryFn: odataUrlFactory,\r\n headerFactoryFn: headerDecorator(odataHeaderFactory),\r\n keySelector: variables => variables.locator.descriptor.tag_id,\r\n parentKeySelector: variables => variables.locator.descriptor.account_id,\r\n});\r\n\r\nconst responseContract = createResponseContract({\r\n requestContract,\r\n responseType: responseTypes.COLL,\r\n keySelector: r => r.Id,\r\n processorFn: r => r.value,\r\n});\r\n\r\nexport const fetchSpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.PAGINATION,\r\n sideEffects.pagination,\r\n environmentLookupFn\r\n);\r\n\r\nexport const refetchSpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.REFETCH,\r\n sideEffects.refetch,\r\n environmentLookupFn\r\n);\r\n","import { FetchPolicy } from '@bingads-webui-react/overreact';\r\nimport { getDefaultHeaderObj } from '@bingads-webui/overreact-bingads';\r\nimport { composeSearchString } from '@bingads-webui-react/overreact-odata';\r\n\r\nimport { edm } from '../../../../../../env/edm';\r\n\r\nexport const networkPolicy = FetchPolicy.NetworkOnly;\r\n\r\nexport function urlDecorator() {\r\n function decorator(params) {\r\n const { variables } = params;\r\n const { locator: { descriptor } } = variables;\r\n const {\r\n customer_id: CustomerId,\r\n account_id: AccountId,\r\n tag_id: TagId,\r\n } = descriptor;\r\n\r\n const edmEntity = edm\r\n .Customers.$withKey(CustomerId)\r\n .Accounts.$withKey(AccountId)\r\n .Tags.$withKey(TagId);\r\n\r\n const searchString = composeSearchString(variables, edmEntity, false);\r\n return `${edmEntity.path}${searchString}`;\r\n }\r\n\r\n return params => decorator(params);\r\n}\r\n\r\nexport function headerDecorator(fn) {\r\n function decorator() {\r\n return getDefaultHeaderObj();\r\n }\r\n\r\n return params => decorator(params, fn(params));\r\n}\r\n\r\nexport const sideEffects = {\r\n fetch: null,\r\n refetch: null,\r\n mutation: null,\r\n pagination: null,\r\n add: null,\r\n destroy: null,\r\n};\r\n","import _ from 'underscore';\r\nimport {\r\n createRequestContract,\r\n createResponseContract,\r\n createSpec,\r\n\r\n requestVerbs,\r\n responseTypes,\r\n specTypes,\r\n} from '@bingads-webui-react/overreact';\r\n\r\nimport { composeSearchString } from '@bingads-webui-react/overreact-odata';\r\n\r\nimport { edm } from '../../../../../../env/edm';\r\nimport { environmentLookupFn } from '../../../../../../env/env-instance';\r\nimport { schema } from '../../../../../../env/schema';\r\n\r\nimport {\r\n urlDecorator,\r\n headerDecorator,\r\n sideEffects,\r\n\r\n networkPolicy,\r\n} from './mutation-decorators';\r\n\r\nfunction odataUrlFactory(params) {\r\n const { variables } = params;\r\n const { locator: { descriptor } } = variables;\r\n const {\r\n customer_id: CustomerId,\r\n account_id: AccountId,\r\n } = descriptor;\r\n\r\n const edmEntity = edm\r\n .Customers.$withKey(CustomerId)\r\n .Accounts.$withKey(AccountId)\r\n .Tags;\r\n\r\n const searchString = composeSearchString(variables, edmEntity, false);\r\n return `${edmEntity.path}${searchString}`;\r\n}\r\n\r\nfunction odataHeaderFactory(params) {\r\n return params.headers;\r\n}\r\n\r\nfunction odataPayloadFactory(params) {\r\n return params.data;\r\n}\r\n\r\nconst requestContract = createRequestContract({\r\n schema,\r\n dataPath: 'customer:account:tag',\r\n verb: requestVerbs.PATCH,\r\n fetchPolicy: networkPolicy,\r\n uriFactoryFn: urlDecorator(odataUrlFactory),\r\n headerFactoryFn: headerDecorator(odataHeaderFactory),\r\n payloadFactoryFn: odataPayloadFactory,\r\n keySelector: variables => variables.locator.descriptor.tag_id,\r\n parentKeySelector: variables => variables.locator.descriptor.account_id,\r\n});\r\n\r\nconst responseContract = createResponseContract({\r\n requestContract,\r\n responseType: responseTypes.ENTITY,\r\n keySelector: _.identity,\r\n processorFn: _.identity,\r\n});\r\n\r\nexport const mutationSpec = createSpec(\r\n requestContract,\r\n responseContract,\r\n specTypes.MUTATION,\r\n sideEffects.mutation,\r\n environmentLookupFn\r\n);\r\n","const { EDM } = require('./src/edm/core');\r\nconst { resIdsPlugin } = require('./src/edm/resource-identifiers');\r\nconst { defineConstProperty } = require('./src/edm/reflection');\r\n\r\nconst { useODataCall } = require('./src/hooks/use-odata-call');\r\nconst { useODataCollection } = require('./src/hooks/use-odata-coll');\r\nconst { useODataEntity } = require('./src/hooks/use-odata-entity');\r\n\r\nconst { composeSearchString } = require('./src/helpers/compose-search-string');\r\n\r\nmodule.exports = {\r\n EDM,\r\n resIdsPlugin,\r\n defineConstProperty,\r\n\r\n useODataCall,\r\n useODataCollection,\r\n useODataEntity,\r\n\r\n composeSearchString,\r\n};\r\n","/**\r\n * the Entity Data Model module\r\n */\r\nconst typesPlugin = require('./types-plugin');\r\nconst schemaPlugin = require('./schema-plugin');\r\n\r\nclass EDM {\r\n constructor(options) {\r\n typesPlugin(this);\r\n if (options) {\r\n schemaPlugin(this, options);\r\n }\r\n }\r\n}\r\n\r\nmodule.exports = {\r\n EDM,\r\n};\r\n","const _ = require('underscore');\r\n\r\nfunction castPath(value, object) {\r\n if (_.isArray(value)) {\r\n return value;\r\n }\r\n\r\n if (_.has(object, value)) {\r\n return [value];\r\n }\r\n\r\n return _.compact(value.split(/[[\\].]/));\r\n}\r\n\r\nfunction get(object, path, defaultValue) {\r\n let sub;\r\n let i;\r\n const keyPath = castPath(path, object);\r\n\r\n for (i = 0, sub = object; i < keyPath.length; i += 1) {\r\n if (!_.isObject(sub)) {\r\n return defaultValue;\r\n }\r\n\r\n sub = sub[keyPath[i]];\r\n\r\n if (_.isUndefined(sub)) {\r\n return defaultValue;\r\n }\r\n }\r\n\r\n return sub;\r\n}\r\n\r\nmodule.exports = {\r\n get,\r\n};\r\n","/**\r\n * the reflection module for property defintions\r\n */\r\nconst _ = require('underscore');\r\n\r\n/**\r\n* Define a const property\r\n* @param {Object} obj - the host object of the proprty\r\n* @param {String} name - the name of the property\r\n* @param {Object} value - the value of the property\r\n* @return {Object} the host object\r\n*/\r\nfunction defineConstProperty(obj, name, value) {\r\n return Object.defineProperty(obj, name, {\r\n value,\r\n enumerable: true,\r\n writable: false,\r\n });\r\n}\r\n\r\n/**\r\n* Define a produced property with a factory\r\n* @param {Object} obj - the host object of the proprty\r\n* @param {String} name - the name of the property\r\n* @param {Function} factory - the factory to produce the property value\r\n* @return {Object} the host object\r\n*/\r\nfunction defineProducedProperty(obj, name, factory) {\r\n return Object.defineProperty(obj, name, {\r\n get() {\r\n const value = factory.apply(obj);\r\n\r\n defineConstProperty(obj, name, value);\r\n return value;\r\n },\r\n enumerable: true,\r\n configurable: true,\r\n });\r\n}\r\n\r\n/**\r\n* Define a produced property on a class\r\n* @param {Class} Class - the host class of the proprty\r\n* @param {String} name - the name of the property\r\n* @param {Function} factory - the factory to produce the property value\r\n* @return {Class} the host class\r\n*/\r\nfunction defineProducedPropertyOnClass(Class, name, factory) {\r\n const RAND_MAX = 65535;\r\n const className = Class.name || `Anony${_.random(0, RAND_MAX)}`;\r\n const symbol = `__${className}_${name}`;\r\n\r\n Object.defineProperty(Class.prototype, name, {\r\n get() {\r\n if (!Object.prototype.hasOwnProperty.call(this, symbol)) {\r\n defineConstProperty(this, symbol, factory.apply(this));\r\n }\r\n return this[symbol];\r\n },\r\n enumerable: true,\r\n });\r\n\r\n return Class;\r\n}\r\n\r\n/**\r\n* Define a computed property whose value is computed each time the getter being called\r\n* @param {Object} obj - the host object of the proprty\r\n* @param {String} name - the name of the property\r\n* @param {Function} getter - the getter to compute the property value\r\n* @return {Object} the host object\r\n*/\r\nfunction defineComputedProperty(obj, name, getter) {\r\n return Object.defineProperty(obj, name, {\r\n get: getter,\r\n enumerable: true,\r\n });\r\n}\r\n\r\n// Make the functions chainable with underscorejs\r\n_.mixin({\r\n defineConstProperty,\r\n defineProducedProperty,\r\n defineProducedPropertyOnClass,\r\n defineComputedProperty,\r\n});\r\n\r\n/**\r\n* Detect whether or not a object has certain property without evaluation\r\n* @param {Object} obj - the host class of the proprty\r\n* @param {String} name - the name of the property\r\n* @return {Boolean} whether the property is defined\r\n*/\r\nfunction hasOwnProperty(obj, name) {\r\n return !!Object.getOwnPropertyDescriptor(obj, name);\r\n}\r\n\r\nmodule.exports = {\r\n defineConstProperty,\r\n defineProducedProperty,\r\n defineProducedPropertyOnClass,\r\n defineComputedProperty,\r\n hasOwnProperty,\r\n};\r\n","/* eslint-disable max-classes-per-file */\r\n/* eslint-disable no-mixed-operators */\r\n/* eslint no-param-reassign: 0 */\r\nconst _ = require('underscore');\r\n\r\n/** Class representing a namespace */\r\nclass Namespace {\r\n /**\r\n * Create a namespace\r\n * @param {Namespace|null} parent - The parent namespace\r\n */\r\n constructor(parent) {\r\n this.map = {};\r\n this.parent = parent;\r\n }\r\n\r\n /**\r\n * Resolve an object by name\r\n * @param {String[]} segments - The name segments\r\n * @return {Object} The object registered with the given name\r\n */\r\n resolve(segments) {\r\n const iterator = (ns, seg) => {\r\n if (ns && ns instanceof Namespace) {\r\n return ns.map[seg];\r\n }\r\n return ns;\r\n };\r\n\r\n return _.reduce(segments, iterator, this)\r\n || this.parent && this.parent.resolve(segments);\r\n }\r\n\r\n /**\r\n * Register an object\r\n * @param {Object} obj - The object to be registered\r\n * @param {String[]} segments - The name segments for the object\r\n * @return {Void} Nothing to return\r\n */\r\n register(obj, segments) {\r\n const key = segments.pop();\r\n const iterator = (ns, seg) => {\r\n if (ns instanceof Namespace) {\r\n if (_.isUndefined(ns.map[seg])) {\r\n ns.map[seg] = new Namespace(ns);\r\n }\r\n return ns.map[seg];\r\n }\r\n throw new Error(`There are conflicts when defining registry for ${segments.join('.')}`);\r\n };\r\n\r\n const nsTarget = _.reduce(segments, iterator, this);\r\n\r\n nsTarget.map[key] = obj;\r\n }\r\n\r\n /**\r\n * Iterate through all objects in this namespace\r\n * @param {Function} worker - The callback for each of the objects\r\n * @return {void} Nothing to return\r\n */\r\n each(worker) {\r\n _.each(this.map, obj => {\r\n if (obj instanceof Namespace) {\r\n obj.each(worker);\r\n } else {\r\n worker(obj);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction isObjectWithName(obj) {\r\n return typeof obj.name === 'string';\r\n}\r\n\r\n/** Class representing a namespaced registry */\r\nclass Registry {\r\n /**\r\n * Create a registry\r\n */\r\n constructor() {\r\n this.rootNamespace = new Namespace(null);\r\n // eslint-disable-next-line no-undef\r\n this.qualifiedNames = new Map();\r\n }\r\n\r\n /**\r\n * Resolve an object by name\r\n * @param {String} name - The name of the object\r\n * @param {String} [namespace=this.rootNamespace] - The base namespace to resolve against\r\n * @return {Object|null} The object registered with the name\r\n */\r\n resolve(name, namespace) {\r\n const ns = namespace\r\n ? this.rootNamespace.resolve(namespace.split('.'))\r\n : this.rootNamespace;\r\n const obj = ns instanceof Namespace ? ns.resolve(name.split('.')) : null;\r\n\r\n return obj || null;\r\n }\r\n\r\n resolveQualifiedName(name, namespace) {\r\n const obj = this.resolve(name, namespace);\r\n if (obj instanceof Namespace || !obj) {\r\n return null;\r\n }\r\n\r\n return this.qualifiedNames.get(obj) || null;\r\n }\r\n\r\n /**\r\n * Register an object\r\n * @param {Object} obj - The object to be registered\r\n * @param {String} [name=obj.name] - The qualified name for the object\r\n * @return {void} Nothing to return\r\n */\r\n register(obj, name) {\r\n const realName = !name && isObjectWithName(obj) ? obj.name : name;\r\n if (typeof realName === 'undefined') {\r\n throw new Error(`name not passed in and obj ${JSON.stringify(obj)} doesn't have name property`);\r\n }\r\n this.rootNamespace.register(obj, realName.split('.'));\r\n this.qualifiedNames.set(obj, realName);\r\n }\r\n\r\n /**\r\n * Iterate through all registered objects\r\n * @param {Function} worker - The callback for each of the objects\r\n * @return {void} Nothing to return\r\n */\r\n each(worker) {\r\n this.rootNamespace.each(worker);\r\n }\r\n\r\n /**\r\n * Get namespace from a qualified name\r\n * @param {String} name - The qualified name\r\n * @return {String} The namespace\r\n */\r\n static getNamespace(name) {\r\n const segments = name.split('.');\r\n\r\n segments.pop();\r\n return segments.join('.');\r\n }\r\n\r\n /**\r\n * Get short name from a qualified name\r\n * @param {String} name - The qualified name\r\n * @return {String} The short name\r\n */\r\n static getShortName(name) {\r\n return _.last(name.split('.'));\r\n }\r\n\r\n static getQualifiedName(name, namespace) {\r\n return namespace ? `${namespace}.${name}` : name;\r\n }\r\n}\r\n\r\nmodule.exports = {\r\n Registry,\r\n};\r\n","/* eslint-disable max-classes-per-file */\r\n\r\nconst _ = require('underscore');\r\n\r\nconst { Registry } = require('./registry');\r\nconst {\r\n defineConstProperty,\r\n defineProducedPropertyOnClass,\r\n} = require('./reflection');\r\n\r\nconst url = require('./url-util');\r\n\r\n/**\r\n * @param {EDM} edm - The EDM object to apply this plugin to\r\n * @return {Void} nothing to return\r\n */\r\nfunction resIdsPlugin(edm) {\r\n if (edm.resourceIdentifiers) {\r\n return;\r\n }\r\n\r\n /**\r\n * @name edm\r\n * @property {Registry} resourceIdentifiers - A registry of all resource-identifiers\r\n * @property {Class} resourceIdentifiers.Navigation - The base type of all navigations\r\n * @property {Class} resourceIdentifiers.PropertyNavigation - The navigation following a property\r\n * @property {Class} resourceIdentifiers.CastNavigation - The navigation following a type casting\r\n * @property {Class} resourceIdentifiers.WithKeyNavigation\r\n * - The navigation of selecting a single instance from an entity set\r\n * @property {Class} resourceIdentifiers.CallNavigation - The navigation of calling a callable\r\n * @property {Class} resourceIdentifiers.ResourceIdentifier\r\n * - The base type of all resource-identifiers\r\n */\r\n defineConstProperty(edm, 'resourceIdentifiers', (() => {\r\n const resourceIdentifiers = new Registry();\r\n\r\n /**\r\n * @class Navigation\r\n * @property {ResourceIdentifier} source - The source accessor navigated from\r\n */\r\n class Navigation {\r\n constructor({\r\n source,\r\n }) {\r\n defineConstProperty(this, 'source', source);\r\n }\r\n\r\n toJSON() {\r\n return [...this.source.toJSON(), this.toSelfJSON()];\r\n }\r\n\r\n // eslint-disable-next-line class-methods-use-this\r\n toSelfJSON() {\r\n throw new Error('I\\'m abstract');\r\n }\r\n }\r\n\r\n /**\r\n * @class PropertyNavigation\r\n * @extends Navigation\r\n * @property {Property} property - The property navigated with\r\n */\r\n class PropertyNavigation extends Navigation {\r\n constructor({\r\n source,\r\n property,\r\n name,\r\n }) {\r\n super({\r\n source,\r\n });\r\n defineConstProperty(this, 'property', property);\r\n defineConstProperty(this, 'name', name);\r\n defineConstProperty(this, 'path', url.join(source.path, name));\r\n }\r\n\r\n toSelfJSON() {\r\n return {\r\n type: 'property',\r\n name: this.name,\r\n };\r\n }\r\n\r\n static defineOn(TypeResID, navigationProperties) {\r\n _.each(navigationProperties, (property, name) => {\r\n /**\r\n * Navigation property factory for the defined property\r\n * @memberof TypeResID#\r\n * @this TypeResID\r\n * @returns {ResourceIdentifier} The ResourceIdentifier to access the property\r\n */\r\n function navPropFactory() {\r\n return new property.type.ResourceIdentifier({\r\n navigation: new PropertyNavigation({ source: this, property, name }),\r\n });\r\n }\r\n\r\n defineProducedPropertyOnClass(TypeResID, name, navPropFactory);\r\n });\r\n }\r\n }\r\n\r\n class CallableNavigation extends Navigation {\r\n constructor({\r\n source,\r\n name,\r\n }) {\r\n super({\r\n source,\r\n });\r\n defineConstProperty(this, 'name', name);\r\n defineConstProperty(this, 'path', url.join(source.path, name));\r\n }\r\n\r\n static defineOn(TypeResID, callable) {\r\n function defineCallableOn(resID, callableTypes) {\r\n _.each(callableTypes, type => {\r\n /**\r\n * factory for the callables\r\n * @memberof resID#\r\n * @this resID\r\n * @returns {ResourceIdentifier} The ResourceIdentifier to access the property\r\n */\r\n function factory() {\r\n return new type.ResourceIdentifier({\r\n navigation: new CallableNavigation({ source: this, name: type.callableName }),\r\n });\r\n }\r\n\r\n defineProducedPropertyOnClass(resID, type.callableName, factory);\r\n });\r\n }\r\n defineCallableOn(TypeResID, callable.actions);\r\n defineCallableOn(TypeResID, callable.functions);\r\n }\r\n }\r\n\r\n /**\r\n * @class CastNavigation\r\n * @extends Navigation\r\n * @property {Type} type - The type casting to\r\n * @property {String} name - The type name used for casting\r\n */\r\n class CastNavigation extends Navigation {\r\n constructor({\r\n source,\r\n type,\r\n name = type.name,\r\n }) {\r\n super({\r\n source,\r\n });\r\n\r\n _.chain(this)\r\n .defineConstProperty('type', type)\r\n .defineConstProperty('name', name)\r\n .value();\r\n\r\n defineConstProperty(this, 'path', url.join(source.path, name));\r\n }\r\n\r\n toSelfJSON() {\r\n return {\r\n type: 'function',\r\n name: CastNavigation.navigationName,\r\n parameters: [this.name],\r\n };\r\n }\r\n\r\n static get navigationName() {\r\n return '$cast';\r\n }\r\n\r\n static defineOn(TypeResID) {\r\n /**\r\n * $cast navigation method of the TypeResID\r\n * @memberof TypeResID#\r\n * @this TypeResID\r\n * @param {String} name - The name of the subclass\r\n * @returns {TypeResID} The ResourceIdentifier to access the subclass object\r\n */\r\n function navCastMethod(name) {\r\n const entityType = edm.types.resolve(name, this.type.namespace);\r\n const type = TypeResID.prototype.type instanceof edm.types.CollectionType\r\n ? entityType.collectionType\r\n : entityType;\r\n const navigation = new CastNavigation({ source: this, type: entityType, name });\r\n\r\n return new type.ResourceIdentifier({ navigation });\r\n }\r\n\r\n defineConstProperty(TypeResID.prototype, CastNavigation.navigationName, navCastMethod);\r\n }\r\n }\r\n\r\n /**\r\n * @class WithKeyNavigation\r\n * @extends Navigation\r\n * @property {String|Number} key - The key of the selected entity\r\n */\r\n class WithKeyNavigation extends Navigation {\r\n constructor({\r\n source,\r\n key,\r\n }) {\r\n super({\r\n source,\r\n });\r\n\r\n defineConstProperty(this, 'key', key);\r\n defineConstProperty(this, 'path', (() => {\r\n // In case people pass a decimal string for a integer key\r\n // We cannot use parseInt directly, it would get a wrong number if the\r\n // key is beyond Number.MAX_SAFE_INTEGER\r\n if (_.isString(key)) {\r\n const keyType = _.chain(source)\r\n .result('type')\r\n .result('elementType')\r\n .result('keyProperty')\r\n .result('typeName')\r\n .value();\r\n\r\n if (keyType === 'integer') {\r\n if (key.match(/^[+-]?(0|[1-9][0-9]*)$/)) {\r\n return `${source.path}(${key})`;\r\n }\r\n }\r\n if (keyType === 'string') {\r\n return `${source.path}('${key}')`;\r\n }\r\n }\r\n\r\n return `${source.path}(${JSON.stringify(key)})`;\r\n })());\r\n }\r\n\r\n toSelfJSON() {\r\n return {\r\n type: 'function',\r\n name: WithKeyNavigation.navigationName,\r\n parameters: [this.key],\r\n };\r\n }\r\n\r\n static get navigationName() {\r\n return '$withKey';\r\n }\r\n\r\n static defineOn(TypeResID) {\r\n /**\r\n * $withKey navigation method of the TypeResID\r\n * @memberof TypeResID#\r\n * @this TypeResID\r\n * @param {String} key - The key of the element\r\n * @returns {ResourceIdentifier}\r\n * The ResourceIdentifier to access the element with the given key\r\n */\r\n function navWithKeyMethod(key) {\r\n const navigation = new WithKeyNavigation({ source: this, key });\r\n\r\n return new this.type.elementType.ResourceIdentifier({ navigation });\r\n }\r\n\r\n defineConstProperty(\r\n TypeResID.prototype,\r\n WithKeyNavigation.navigationName,\r\n navWithKeyMethod,\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * @class CallNavigation\r\n * @extends Navigation\r\n * @property {Object} parameters - The parameters for the function call\r\n */\r\n class CallNavigation extends Navigation {\r\n constructor({\r\n source,\r\n parameters = {},\r\n }) {\r\n super({\r\n source,\r\n });\r\n defineConstProperty(this, 'parameters', parameters);\r\n\r\n const path = source.type instanceof edm.types.ActionType\r\n ? source.path : `${source.path}(${_.map(parameters, (value, name) => `${name}=${value}`).join(',')})`;\r\n\r\n defineConstProperty(this, 'path', path);\r\n }\r\n\r\n toSelfJSON() {\r\n return {\r\n type: 'function',\r\n name: CallNavigation.navigationName,\r\n // for callable, parameters are named\r\n parameters: [this.parameters],\r\n };\r\n }\r\n\r\n static get navigationName() {\r\n return '$call';\r\n }\r\n\r\n static defineOn(TypeResID) {\r\n /**\r\n * $call navigation method of the TypeResID\r\n * @memberof TypeResID#\r\n * @this TypeResID\r\n * @param {object} parameters - The parameters to call the callable\r\n * @return {ResourceIdentifier}\r\n * The ResourceIdentifier accessing the return value of the callable\r\n */\r\n function navCallMethod(parameters) {\r\n const navigation = new CallNavigation({ source: this, parameters });\r\n\r\n return new this.type.returnType.ResourceIdentifier({ navigation });\r\n }\r\n\r\n defineConstProperty(TypeResID.prototype, CallNavigation.navigationName, navCallMethod);\r\n }\r\n }\r\n\r\n /**\r\n * @class ResourceIdentifier\r\n * @property {Navigation} navigation\r\n * - The navigation back tracking the parent ResourceIdentifier\r\n */\r\n class ResourceIdentifier {\r\n /**\r\n * Create a ResourceIdentifier\r\n * @param {Object} [options] - The constructor options\r\n * @param {Navigation} [options.navigation]\r\n * - The navigation back tracking the parent ResourceIdentifier\r\n * @return {Void} Nothing to return\r\n */\r\n constructor({\r\n navigation,\r\n } = {}) {\r\n if (navigation) {\r\n defineConstProperty(this, 'navigation', navigation);\r\n defineConstProperty(this, 'path', navigation.path);\r\n } else {\r\n defineConstProperty(this, 'path', '');\r\n }\r\n }\r\n\r\n toJSON() {\r\n if (this.navigation) {\r\n return this.navigation.toJSON();\r\n }\r\n\r\n return [];\r\n }\r\n\r\n identifyEntitySet(json) {\r\n // eslint-disable-next-line\r\n let entitySet = this;\r\n\r\n /* eslint guard-for-in: 0 */\r\n /* eslint no-restricted-syntax: 0 */\r\n for (const i in json) {\r\n const item = json[i];\r\n\r\n if (item.type === 'property') {\r\n entitySet = entitySet[item.name];\r\n } else if (item.type === 'function') {\r\n entitySet = entitySet[item.name](...item.parameters);\r\n }\r\n\r\n if (!entitySet) {\r\n return null;\r\n }\r\n }\r\n\r\n return entitySet;\r\n }\r\n }\r\n /**\r\n * @class CollectionResourceIdentifier\r\n * @property {Navigation} navigation\r\n * - The navigation back tracking the parent ResourceIdentifier\r\n */\r\n class CollectionResourceIdentifier extends ResourceIdentifier {\r\n /**\r\n * Create a ResourceIdentifier\r\n * @param {Object} [options] - The constructor options\r\n * @param {Navigation} [options.navigation]\r\n * - The navigation back tracking the parent ResourceIdentifier\r\n * @return {Void} Nothing to return\r\n */\r\n constructor({\r\n navigation,\r\n } = {}) {\r\n super({ navigation });\r\n }\r\n }\r\n\r\n /**\r\n * define ResourceIdentifier type for the given type\r\n * @param {Type} type - An instance of one of the meta types\r\n * @return {Class} the ResourceIdentifier class\r\n */\r\n function resourceIdentifierForType(type) {\r\n // duck type, if the type has a \"baseType\", use its ResourceIdentifier as the super class\r\n const DefaultBase = type instanceof edm.types.CollectionType\r\n ? CollectionResourceIdentifier\r\n : ResourceIdentifier;\r\n const Base = type.baseType ? type.baseType.ResourceIdentifier : DefaultBase;\r\n\r\n const AccessorType = class extends Base {\r\n };\r\n\r\n /**\r\n * @name resId\r\n * @type ResourceIdentifier\r\n * @property {Type} type - The type associated with the ResourceIdentifier\r\n */\r\n defineConstProperty(AccessorType.prototype, 'type', type);\r\n\r\n resourceIdentifiers.register(AccessorType, type.name);\r\n\r\n return AccessorType;\r\n }\r\n\r\n // For each of the meta types defined by the type mixin, define the\r\n // \"ResourceIdentifier\" property\r\n _.each({\r\n\r\n // the root class 'Type' don't have an ResourceIdentifier property\r\n // Type: { factory() { } },\r\n\r\n PrimitiveType: {\r\n\r\n /**\r\n * PrimitiveType ResourceIdentifier type factory\r\n * @memberof PrimitiveType#\r\n * @this PrimitiveType\r\n * @returns {Class} The ResourceIdentifier type of the PrimitiveType\r\n */\r\n factory() {\r\n const PrimitiveTypeResID = resourceIdentifierForType(this);\r\n\r\n return PrimitiveTypeResID;\r\n },\r\n },\r\n\r\n ObjectType: {\r\n\r\n /**\r\n * ObjectType ResourceIdentifier type factory\r\n * @memberof ObjectType#\r\n * @this ObjectType\r\n * @returns {Class} The ResourceIdentifier type of the ObjectType\r\n */\r\n factory() {\r\n const ObjectTypeResID = resourceIdentifierForType(this);\r\n\r\n CastNavigation.defineOn(ObjectTypeResID);\r\n PropertyNavigation.defineOn(ObjectTypeResID, this.navigationProperties);\r\n if (this.callable) {\r\n CallableNavigation.defineOn(ObjectTypeResID, this.callable);\r\n }\r\n return ObjectTypeResID;\r\n },\r\n },\r\n\r\n // fallback to ObjectType.prototype.ResourceIdentifier\r\n // EntityType: { factory () { } },\r\n\r\n // fallback to ObjectType.prototype.ResourceIdentifier\r\n // ComplexType: { factory () { } },\r\n\r\n CollectionType: {\r\n\r\n /**\r\n * CollectionType ResourceIdentifier type factory\r\n * @memberof CollectionType#\r\n * @this CollectionType\r\n * @returns {Class} the ResourceIdentifier type of the CollectionType\r\n */\r\n factory() {\r\n const CollectionTypeResID = resourceIdentifierForType(this);\r\n\r\n CastNavigation.defineOn(CollectionTypeResID);\r\n // Only the entity sets can be navigated with keys\r\n if (this.elementType instanceof edm.types.EntityType) {\r\n WithKeyNavigation.defineOn(CollectionTypeResID);\r\n }\r\n PropertyNavigation.defineOn(CollectionTypeResID, this.navigationProperties);\r\n if (this.callable) {\r\n CallableNavigation.defineOn(CollectionTypeResID, this.callable);\r\n }\r\n\r\n return CollectionTypeResID;\r\n },\r\n },\r\n\r\n CallableType: {\r\n\r\n /**\r\n * CallableType ResourceIdentifier type factory\r\n * @memberof CallableType#\r\n * @this CallableType\r\n * @returns {Class} The ResourceIdentifier type of the CallableType\r\n */\r\n factory() {\r\n const CallableTypeResID = resourceIdentifierForType(this);\r\n\r\n CallNavigation.defineOn(CallableTypeResID);\r\n\r\n return CallableTypeResID;\r\n },\r\n },\r\n\r\n }, (def, typeName) => {\r\n /**\r\n * @name type\r\n * @type Type\r\n * @property {Class} ResourceIdentifier - The ResourceIdentifier type of the type\r\n */\r\n defineProducedPropertyOnClass(edm.types[typeName], 'ResourceIdentifier', def.factory);\r\n });\r\n\r\n _.chain(resourceIdentifiers)\r\n .defineConstProperty('ResourceIdentifier', ResourceIdentifier)\r\n .defineConstProperty('CollectionResourceIdentifier', CollectionResourceIdentifier)\r\n .defineConstProperty('Navigation', Navigation)\r\n .defineConstProperty('PropertyNavigation', PropertyNavigation)\r\n .defineConstProperty('CastNavigation', CastNavigation)\r\n .defineConstProperty('WithKeyNavigation', WithKeyNavigation)\r\n .defineConstProperty('CallNavigation', CallNavigation)\r\n .defineConstProperty('CallableNavigation', CallableNavigation)\r\n .value();\r\n\r\n return resourceIdentifiers;\r\n })());\r\n}\r\n\r\nmodule.exports = {\r\n resIdsPlugin,\r\n};\r\n","/**\r\n * the schema plugin module\r\n */\r\n\r\nconst _ = require('underscore');\r\nconst { get } = require('./lodash');\r\nconst { Registry } = require('./registry');\r\nconst {\r\n defineConstProperty,\r\n hasOwnProperty,\r\n} = require('./reflection');\r\n\r\nconst typesPlugin = require('./types-plugin');\r\n\r\nfunction getSchemaName(schema) {\r\n const { $$ODataExtension, name } = schema;\r\n if ($$ODataExtension) {\r\n return $$ODataExtension.Name;\r\n }\r\n\r\n // deprecated\r\n // There is no such keyword as \"name\" in JSON Schema, it's specific to OData\r\n // See:\r\n // http://json-schema.org/latest/json-schema-core.html\r\n // http://json-schema.org/latest/json-schema-validation.html\r\n return name;\r\n}\r\n\r\nfunction getSchemaBaseTypeName(schema) {\r\n const { $$ODataExtension, clrTypeBase } = schema;\r\n if ($$ODataExtension) {\r\n return $$ODataExtension.BaseType && $$ODataExtension.BaseType.$ref;\r\n }\r\n\r\n // deprecated\r\n // There is no such keyword as \"clrTypeBase\" in JSON Schema, it's specific to OData\r\n // See:\r\n // http://json-schema.org/latest/json-schema-core.html\r\n // http://json-schema.org/latest/json-schema-validation.html\r\n return clrTypeBase;\r\n}\r\n\r\nfunction getSchemaKey(schema) {\r\n const { $$ODataExtension, key } = schema;\r\n if ($$ODataExtension) {\r\n return $$ODataExtension.Key;\r\n }\r\n\r\n // deprecated\r\n // There is no such keyword as \"key\" in JSON Schema, it's specific to OData\r\n // See:\r\n // http://json-schema.org/latest/json-schema-core.html\r\n // http://json-schema.org/latest/json-schema-validation.html\r\n return key;\r\n}\r\n\r\nfunction getSchemaNavigationPropertyNames(schema) {\r\n const { $$ODataExtension } = schema;\r\n if ($$ODataExtension) {\r\n return $$ODataExtension.NavigationProperty;\r\n }\r\n\r\n return [];\r\n}\r\n\r\nmodule.exports = (edm, {\r\n schemas = {},\r\n // TODO: deprecated, every schemas should be able to have different namespaces\r\n // we are still using it with legacy schemas\r\n namespace = null,\r\n} = {}) => {\r\n if (hasOwnProperty(edm, 'schema')) {\r\n return;\r\n }\r\n\r\n typesPlugin(edm);\r\n\r\n const {\r\n CollectionType,\r\n EntityType,\r\n PrimitiveType,\r\n ComplexType,\r\n OneOfType,\r\n ActionType,\r\n FunctionType,\r\n } = edm.types;\r\n\r\n defineConstProperty(edm, 'schema', (() => {\r\n function getSchemaFullName(schema, path) {\r\n // $$ref exists in resolved schema\r\n const possiblePath = (_.isString(path) && path) || schema.$$ref || schema.$ref;\r\n return possiblePath\r\n ? possiblePath.replace(/\\//g, '.')\r\n : Registry.getQualifiedName(getSchemaName(schema), namespace);\r\n }\r\n\r\n /**\r\n * Get type name object with its information\r\n * @param {Schema[]} dependencies - An output paramter, a queue of dependent schemas\r\n * @param {Object} typeInfo - The schema information of the property\r\n * @return {String} The type name\r\n */\r\n function getTypeName(dependencies, typeInfo) {\r\n let schema = null;\r\n let typeName = null;\r\n\r\n if (!typeInfo) {\r\n return null;\r\n }\r\n\r\n if (typeInfo.type === 'array') {\r\n return CollectionType.collectionTypeName(getTypeName(dependencies, typeInfo.items));\r\n } if (typeInfo.oneOf) {\r\n return OneOfType.oneOfTypeName(typeInfo.oneOf.map(item => getTypeName(dependencies, item)));\r\n } if (typeInfo.type === 'object') {\r\n ({ schema } = typeInfo);\r\n // it's possible for the schema to be undefined, use 'object' type by default\r\n typeName = getSchemaFullName(schema || typeInfo);\r\n } else if (typeInfo.type === 'string' && typeInfo.enum) {\r\n // enum type is string, but we need to get a meanful name for different enum type\r\n // this is to help us disable cache accurately, as enum can be odata call return type now\r\n typeName = (typeInfo.$$ref || 'string').split('/').join('.');\r\n } else {\r\n // primitive types\r\n typeName = typeInfo.type;\r\n }\r\n\r\n if (schema) {\r\n dependencies.push(schema);\r\n }\r\n\r\n return typeName;\r\n }\r\n\r\n function defineCallableOnType(acts, funcs, type, qualifiedName, forEntityType = true) {\r\n const actions = [];\r\n const functions = [];\r\n\r\n function getCallableTypeName(key) {\r\n return `${key}##${qualifiedName}${forEntityType ? '' : '@@COLL'}`;\r\n }\r\n\r\n _.each(_.keys(acts), key => {\r\n const typeName = getCallableTypeName(key);\r\n const parameters = _.mapObject(\r\n acts[key].Parameter,\r\n parameter => getTypeName([], parameter),\r\n );\r\n\r\n actions.push(new ActionType({\r\n name: typeName,\r\n callableName: key,\r\n parameters,\r\n returnTypeName: getTypeName([], acts[key].ReturnType),\r\n }));\r\n });\r\n\r\n _.each(_.keys(funcs), key => {\r\n const typeName = getCallableTypeName(key);\r\n const parameters = _.mapObject(\r\n funcs[key].Parameter,\r\n parameter => getTypeName([], parameter),\r\n );\r\n\r\n functions.push(new FunctionType({\r\n name: typeName,\r\n callableName: key,\r\n parameters,\r\n returnTypeName: getTypeName([], funcs[key].ReturnType),\r\n }));\r\n });\r\n\r\n defineConstProperty(type, 'callable', {\r\n actions,\r\n functions,\r\n });\r\n }\r\n\r\n /**\r\n * Define an entity type, and its dependencies\r\n *\r\n * @param {Schema} schema - The schema for the entity type\r\n * @param {string} [path] - Possible full path of the schema\r\n * @return {Void} Nothing to return\r\n */\r\n function defineSchemaType(schema, path) {\r\n const qualifiedName = getSchemaFullName(schema, path);\r\n\r\n if (!edm.types.resolve(qualifiedName)) {\r\n const dependencies = [];\r\n const properties = _.mapObject(schema.properties, typeInfo => ({\r\n typeName: getTypeName(dependencies, typeInfo),\r\n }));\r\n\r\n const type = new EntityType({\r\n name: qualifiedName,\r\n baseTypeName: getSchemaBaseTypeName(schema) || 'object',\r\n key: getSchemaKey(schema),\r\n properties,\r\n navigationPropertyNames: getSchemaNavigationPropertyNames(schema),\r\n });\r\n\r\n defineConstProperty(type, 'schema', schema);\r\n\r\n _.each(dependencies, defineSchemaType);\r\n\r\n const entityActions = get(schema, '$$ODataExtension.Action', null);\r\n const entityFunctions = get(schema, '$$ODataExtension.Function', null);\r\n\r\n if (entityActions || entityFunctions) {\r\n defineCallableOnType(entityActions, entityFunctions, type, qualifiedName);\r\n }\r\n\r\n const collCallable = get(schema, '$$ODataExtension.Collection', null);\r\n\r\n if (collCallable) {\r\n defineCallableOnType(\r\n collCallable.Action,\r\n collCallable.Function,\r\n type.collectionType,\r\n qualifiedName,\r\n false,\r\n );\r\n }\r\n }\r\n }\r\n\r\n // Define all the primitive types\r\n _.each({\r\n string: String,\r\n integer: Number,\r\n number: Number,\r\n datetime: Date,\r\n boolean: Boolean,\r\n null: null,\r\n }, (jsType, name) => new PrimitiveType({ name, jsType }));\r\n\r\n // Define the base object type\r\n /* eslint no-new: 0 */\r\n new ComplexType({\r\n name: 'object',\r\n properties: {},\r\n });\r\n\r\n _.each(schemas, (schema, index) => {\r\n if (_.isString(index)) {\r\n defineSchemaType(schema, index);\r\n } else {\r\n defineSchemaType(schema);\r\n }\r\n });\r\n\r\n return _.chain({})\r\n .defineConstProperty('schemas', schemas)\r\n .defineConstProperty('namespace', namespace)\r\n .value();\r\n })());\r\n};\r\n","/* eslint-disable max-classes-per-file */\r\n\r\nconst _ = require('underscore');\r\nconst { Registry } = require('./registry');\r\nconst {\r\n defineConstProperty,\r\n defineProducedProperty,\r\n defineProducedPropertyOnClass,\r\n} = require('./reflection');\r\n\r\nconst ONEOF_TYPE_PREFIX = '@ONEOF';\r\nconst COLLECTION_TYPE_POSTFIX = '@COLL';\r\n\r\nfunction isOneOfType(typeName) {\r\n return typeName.indexOf(ONEOF_TYPE_PREFIX) === 0;\r\n}\r\n\r\nfunction hasPostfix(str, postfix) {\r\n return str.slice(-postfix.length) === postfix;\r\n}\r\n\r\nfunction removePostfix(str, postfix) {\r\n return str.slice(0, -postfix.length);\r\n}\r\n\r\n/**\r\n * @param {EDM} edm - The EDM object to apply this plugin to\r\n * @return {void}\r\n */\r\nmodule.exports = edm => {\r\n if (edm.types) {\r\n return;\r\n }\r\n\r\n // eslint-disable-next-line no-undef\r\n const oneOfTypes = new Map();\r\n\r\n /**\r\n * @name edm\r\n * @type {EDM}\r\n * @property {Registry} types - A registry of all types\r\n * @property {Class} types.Type - The base type of all meta Types\r\n * @property {Class} types.PrimitiveType - The meta type of primitive types\r\n * @property {Class} types.ObjectType - The meta type of the key/value types\r\n * @property {Class} types.ComplexType - The meta type of the complex types\r\n * @property {Class} types.EntityType - The meta type of the entity types\r\n * @property {Class} types.CollectionType - The meta type of the collection types\r\n * @property {Class} types.CallableType - The meta type of the callable types\r\n */\r\n defineConstProperty(edm, 'types', (() => {\r\n const types = new Registry();\r\n\r\n function resolveType(name, namespace) {\r\n if (hasPostfix(name, COLLECTION_TYPE_POSTFIX)) {\r\n return resolveType(removePostfix(name, COLLECTION_TYPE_POSTFIX), namespace).collectionType;\r\n }\r\n\r\n if (isOneOfType(name)) {\r\n if (!oneOfTypes.has(name)) {\r\n const prefixLength = ONEOF_TYPE_PREFIX.length + 1;\r\n const typeNames = name.substr(prefixLength, name.length - prefixLength - 1).split(',');\r\n // eslint-disable-next-line no-use-before-define\r\n oneOfTypes.set(name, new OneOfType({ typeNames }));\r\n }\r\n\r\n return oneOfTypes.get(name);\r\n }\r\n\r\n return types.resolve(name, namespace);\r\n }\r\n\r\n /**\r\n * @class Property\r\n * @property {String} name - The name of the property\r\n * @property {String} typeName - The name of the property's type\r\n * @property {Type} type - The type of the property\r\n */\r\n class Property {\r\n /**\r\n * Create a property\r\n * @param {Object} options - The constructor options\r\n * @param {String} options.name - The name of the property\r\n * @param {String} options.typeName - The name of the propertie's type\r\n * @param {String} options.namespace - The namespace of the propertie's type\r\n * @return {void}\r\n */\r\n constructor({\r\n name,\r\n typeName,\r\n namespace,\r\n }) {\r\n defineConstProperty(this, 'name', name);\r\n defineConstProperty(this, 'typeName', typeName);\r\n defineProducedProperty(this, 'type', () => resolveType(typeName, namespace));\r\n }\r\n }\r\n\r\n /**\r\n * @class Parameter\r\n * @property {String} name - The name of the parameter\r\n * @property {String} typeName - The name of the paramter's type\r\n * @property {type} type - The type of the parameter\r\n */\r\n class Parameter {\r\n /**\r\n * Create a parameter\r\n * @param {Object} options - The constructor options\r\n * @param {String} options.name - The name of the parameter\r\n * @param {String} options.typeName - The name of the parameter's type\r\n * @param {String} options.namespace - The namespace of the parameter's type\r\n * @return {void}\r\n */\r\n constructor({\r\n name,\r\n typeName,\r\n namespace,\r\n }) {\r\n defineConstProperty(this, 'name', name);\r\n defineConstProperty(this, 'typeName', typeName);\r\n defineProducedProperty(this, 'type', () => resolveType(typeName, namespace));\r\n }\r\n }\r\n\r\n /**\r\n * @class Type\r\n * @property {String} name - The qualified name of the type\r\n * @property {String} namespace - The namespace of the type\r\n * @property {String} shortName - The short name of the type\r\n */\r\n class Type {\r\n /**\r\n * Create and register a type\r\n * A side effect of Type creation is registering itself to the type registry\r\n * @param {Object} options - The constructor options\r\n * @param {String} options.name - The name of the type\r\n * @return {void}\r\n */\r\n constructor({\r\n name,\r\n }) {\r\n defineConstProperty(this, 'name', name);\r\n defineConstProperty(this, 'namespace', Registry.getNamespace(name));\r\n defineConstProperty(this, 'shortName', Registry.getShortName(name));\r\n types.register(this);\r\n }\r\n }\r\n\r\n /**\r\n * @class PrimitiveType\r\n * @extends Type\r\n * @property {Class} jsType - The corresponding JavaScript type\r\n */\r\n class PrimitiveType extends Type {\r\n /**\r\n * Create a PrimitiveType\r\n * @param {Object} options - The constructor options\r\n * @param {String} options.name - The name of the type\r\n * @param {Class} options.jsType - The JavaScript type of the primitive type\r\n * @return {void}\r\n */\r\n constructor({\r\n name,\r\n jsType,\r\n }) {\r\n super({ name });\r\n defineConstProperty(this, 'jsType', jsType);\r\n }\r\n }\r\n\r\n /**\r\n * @class OneOfType\r\n * @extends Type\r\n * @property {Class} types - Data could be one of these types\r\n * @see {@link http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.7.3}\r\n */\r\n class OneOfType extends Type {\r\n /**\r\n * Create a PrimitiveType\r\n * @param {Object} options - The constructor options\r\n * @param {String} options.name - The name of the type\r\n * @param {Type[]} options.types - The JavaScript type of the primitive type\r\n * @return {void}\r\n */\r\n constructor({\r\n typeNames,\r\n }) {\r\n super({\r\n name: OneOfType.oneOfTypeName(typeNames),\r\n });\r\n\r\n defineConstProperty(this, 'typeNames', typeNames);\r\n defineConstProperty(this, 'types', typeNames.map(typeName => resolveType(typeName, this.namespace)));\r\n }\r\n\r\n /**\r\n * Get the OneOfType's name from it's elements type name\r\n * @param {String[]} typeNames - The name of the elementTypes\r\n * @return {String} The name of the OneOfType\r\n */\r\n static oneOfTypeName(typeNames) {\r\n // We don't support nested one for now\r\n const sortedNames = typeNames\r\n .map(name => types.resolveQualifiedName(name, this.namespace))\r\n .sort();\r\n\r\n return `${ONEOF_TYPE_PREFIX}(${sortedNames.join(',')})`;\r\n }\r\n }\r\n\r\n /**\r\n * @typedef {Object} PropertyInfo\r\n * @property {String} typeName - The name of the propertie's type\r\n *\r\n * @memberof ObjectType#\r\n * @this ObjectType\r\n * @param {Object.} properties - The properties to be compiled\r\n * @return {Object.} a mapping for name to compiled Properties\r\n */\r\n function compileProperties(properties) {\r\n const { namespace } = this;\r\n\r\n return _.mapObject(properties, ({\r\n typeName,\r\n }, name) => new Property({\r\n name,\r\n typeName,\r\n namespace,\r\n }));\r\n }\r\n\r\n /**\r\n * @class ObjectType\r\n * @extends Type\r\n * @property {Object.} properties - The properties of the object type\r\n * @property {String} baseTypeName - The name of the base type\r\n * @property {Type} baseType - The base type\r\n */\r\n class ObjectType extends Type {\r\n /**\r\n * Create an ObjectType\r\n * @param {Object} options - The constructor options\r\n * @param {String} options.name - The name of the type\r\n * @param {Object.} options.properties - The property definition\r\n * @param {string[]} [options.navigationPropertyNames] - Navigation properties names\r\n * @param {String} options.baseTypeName - The name of the base type\r\n * @return {void}\r\n */\r\n constructor({\r\n name,\r\n properties,\r\n navigationPropertyNames = [],\r\n baseTypeName,\r\n }) {\r\n super({ name });\r\n\r\n defineConstProperty(this, 'properties', compileProperties.call(this, properties));\r\n defineConstProperty(this, 'navigationPropertyNames', navigationPropertyNames.slice());\r\n defineProducedProperty(this, 'navigationProperties', () => _.pick(this.properties, (property, propertyName) => _.contains(this.navigationPropertyNames, propertyName)));\r\n if (baseTypeName) {\r\n defineConstProperty(this, 'baseTypeName', baseTypeName);\r\n defineProducedProperty(this, 'baseType', () => resolveType(this.baseTypeName, this.namespace));\r\n }\r\n }\r\n\r\n addProperties(properties) {\r\n _.extend(this.properties, compileProperties.call(this, properties));\r\n // only for backward compability, should use addNavigationProperties for this case\r\n this.navigationPropertyNames.push(..._.keys(properties));\r\n }\r\n\r\n addNavigationProperties(properties) {\r\n this.addProperties(properties);\r\n }\r\n }\r\n\r\n /**\r\n * @class ComplexType\r\n * @extends ObjectType\r\n */\r\n class ComplexType extends ObjectType {\r\n\r\n }\r\n\r\n /**\r\n * @class EntityType\r\n * @extends ObjectType\r\n * @property {String} key - The name of the key property\r\n * @property {Property} keyProperty - The key property of the entity type\r\n * @return {void}\r\n */\r\n class EntityType extends ObjectType {\r\n /**\r\n * Create an EntityType\r\n * @param {Object} options - The constructor options\r\n * @param {String} options.name - The name of the type\r\n * @param {Object.} options.properties - The property definition\r\n * @param {String} options.baseTypeName - The name of the base type\r\n * @param {String} [options.key] - The name of the key property\r\n * @return {void}\r\n */\r\n constructor({\r\n name,\r\n properties,\r\n navigationPropertyNames,\r\n baseTypeName,\r\n key,\r\n }) {\r\n super({\r\n name,\r\n properties,\r\n navigationPropertyNames,\r\n baseTypeName,\r\n });\r\n\r\n if (key) {\r\n defineConstProperty(this, 'key', key);\r\n defineConstProperty(this, 'keyProperty', this.properties[this.key]);\r\n } else if (baseTypeName) {\r\n // The key property is inherited if there's a base type\r\n defineProducedProperty(this, 'key', () => this.baseType.key);\r\n defineProducedProperty(this, 'keyProperty', () => this.baseType.keyProperty);\r\n } else {\r\n throw new Error('The \"key\" property is required for an EntityType');\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @class CollectionType\r\n * @extends ObjectType\r\n * @property {String} elementTypeName - The name of the element type\r\n * @property {Type} elementType - The type of the elements\r\n */\r\n class CollectionType extends ObjectType {\r\n /**\r\n * Create a CollectionType\r\n * @param {Object} options - The constructor options\r\n * @param {Object.} options.properties - The property definition\r\n * @param {String} options.baseTypeName - The name of the base type\r\n * @param {String} options.elementTypeName - The name of the element type\r\n * @return {void}\r\n */\r\n constructor({\r\n properties,\r\n baseTypeName,\r\n elementTypeName,\r\n }) {\r\n super({\r\n name: CollectionType.collectionTypeName(elementTypeName),\r\n properties,\r\n baseTypeName,\r\n });\r\n defineConstProperty(this, 'elementTypeName', elementTypeName);\r\n defineProducedProperty(this, 'elementType', () => resolveType(this.elementTypeName, this.namespace));\r\n }\r\n\r\n /**\r\n * Get the CollectionType's name from it's element type name\r\n * @param {String} typeName - The name of the elementType\r\n * @return {String} The name of the CollectionType\r\n */\r\n static collectionTypeName(typeName) {\r\n return `${typeName}${COLLECTION_TYPE_POSTFIX}`;\r\n }\r\n }\r\n\r\n /**\r\n * @memberof Type#\r\n * @this Type\r\n * @returns {CollectionType} The CollectionType of the given Type\r\n */\r\n function collectionTypeFactory() {\r\n return new CollectionType({ elementTypeName: this.name });\r\n }\r\n\r\n /**\r\n * @name type\r\n * @type Type\r\n * @property {CollectionType} collectionType - The collection type of the given type\r\n */\r\n defineProducedPropertyOnClass(Type, 'collectionType', collectionTypeFactory);\r\n\r\n /**\r\n * @typedef {Object} ParameterInfo\r\n * @property {String} typeName - The name of the parameter's type\r\n *\r\n * @memberof CallableType#\r\n * @this CallableType\r\n * @param {Object.} parameters - The parameters to compile\r\n * @return {Object.} A mapping for name to compiled Parameters\r\n */\r\n function compileParameters(parameters) {\r\n const { namespace } = this;\r\n\r\n return _.mapObject(\r\n parameters,\r\n ({ typeName }, name) => new Parameter({ name, namespace, typeName }),\r\n );\r\n }\r\n\r\n /**\r\n * @class CallableType\r\n * @property {Parameter[]} parameters - The parameters required to call the callable\r\n * @property {String} returnTypeName - The name of the return type\r\n * @property {Type} returnType - The return type of the callable\r\n */\r\n class CallableType extends Type {\r\n /**\r\n * Create a CallableType\r\n * @param {Object} options - The constructor options\r\n * @param {String} options.name - The name of the type\r\n * @param {Object.} parameters - The parameter definitions\r\n * @param {String} returnTypeName - The name of the return type\r\n * @return {void}\r\n */\r\n constructor({\r\n name,\r\n callableName,\r\n parameters,\r\n returnTypeName,\r\n }) {\r\n super({ name });\r\n\r\n defineConstProperty(this, 'callableName', callableName);\r\n defineConstProperty(this, 'parameters', compileParameters.call(this, parameters));\r\n defineConstProperty(this, 'returnTypeName', returnTypeName);\r\n defineProducedProperty(this, 'returnType', () => resolveType(returnTypeName, this.namespace));\r\n }\r\n }\r\n\r\n /**\r\n * @class ActionType\r\n * @property {Parameter[]} parameters - The parameters required to call the callable\r\n * @property {String} returnTypeName - The name of the return type\r\n * @property {Type} returnType - The return type of the callable\r\n */\r\n class ActionType extends CallableType {\r\n /**\r\n * Create a CallableType\r\n * @param {Object} options - The constructor options\r\n * @param {String} options.name - The name of the type\r\n * @param {Object.} parameters - The parameter definitions\r\n * @param {String} returnTypeName - The name of the return type\r\n * @return {void}\r\n */\r\n constructor({\r\n name,\r\n callableName,\r\n parameters,\r\n returnTypeName,\r\n }) {\r\n super({\r\n name,\r\n callableName,\r\n parameters,\r\n returnTypeName,\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * @class FunctionType\r\n * @property {Parameter[]} parameters - The parameters required to call the callable\r\n * @property {String} returnTypeName - The name of the return type\r\n * @property {Type} returnType - The return type of the callable\r\n */\r\n class FunctionType extends CallableType {\r\n /**\r\n * Create a CallableType\r\n * @param {Object} options - The constructor options\r\n * @param {String} options.name - The name of the type\r\n * @param {Object.} parameters - The parameter definitions\r\n * @param {String} returnTypeName - The name of the return type\r\n * @return {void}\r\n */\r\n constructor({\r\n name,\r\n callableName,\r\n parameters,\r\n returnTypeName,\r\n }) {\r\n super({\r\n name,\r\n callableName,\r\n parameters,\r\n returnTypeName,\r\n });\r\n }\r\n }\r\n\r\n // TODO: wewei, support EnumType\r\n\r\n defineConstProperty(types, 'Property', Property);\r\n defineConstProperty(types, 'Parameter', Parameter);\r\n defineConstProperty(types, 'Type', Type);\r\n defineConstProperty(types, 'PrimitiveType', PrimitiveType);\r\n defineConstProperty(types, 'OneOfType', OneOfType);\r\n defineConstProperty(types, 'ObjectType', ObjectType);\r\n defineConstProperty(types, 'ComplexType', ComplexType);\r\n defineConstProperty(types, 'EntityType', EntityType);\r\n defineConstProperty(types, 'CollectionType', CollectionType);\r\n defineConstProperty(types, 'CallableType', CallableType);\r\n defineConstProperty(types, 'ActionType', ActionType);\r\n defineConstProperty(types, 'FunctionType', FunctionType);\r\n\r\n return types;\r\n })());\r\n};\r\n","const _ = require('underscore');\r\n\r\nfunction join(first, ...frags) {\r\n return frags.reduce((memo, frag) => {\r\n if (_.isEmpty(frag)) {\r\n return memo;\r\n }\r\n const eSlash = /\\/$/.test(memo);\r\n const sSlash = /^\\//.test(frag);\r\n\r\n if (!eSlash && !sSlash) {\r\n return `${memo}/${frag}`;\r\n }\r\n if (eSlash && sSlash) {\r\n return memo + frag.substring(1);\r\n }\r\n return memo + frag;\r\n }, first);\r\n}\r\n\r\nmodule.exports = {\r\n join,\r\n};\r\n","const _ = require('underscore');\r\nconst queryString = require('query-string');\r\n\r\nconst { parseSearch } = require('./parse-search');\r\n\r\nconst DEFAULT_PAGE_SIZE = 20;\r\n\r\nfunction composeSearchString(variables, edmEntity, isColl = true) {\r\n const { cursorIndex } = variables;\r\n const initialSearch = _.omit(variables, ['locator', 'cursorIndex', 'skip', 'options']);\r\n let search = {\r\n top: DEFAULT_PAGE_SIZE,\r\n count: true,\r\n skip: cursorIndex,\r\n ...initialSearch,\r\n };\r\n\r\n if (!isColl) {\r\n // $filter, $orderby, $count, $skip, and $top are only valid for collections.\r\n search = _.omit(search, ['filter', 'orderby', 'count', 'skip', 'top']);\r\n }\r\n\r\n const parsedSearch = parseSearch(search, edmEntity);\r\n const searchCompact = _.omit(parsedSearch, x => _.isNull(x) || _.isUndefined(x));\r\n const searchString = _.isEmpty(searchCompact) ? '' : `?${queryString.stringify(searchCompact)}`;\r\n\r\n return searchString;\r\n}\r\n\r\nmodule.exports = {\r\n composeSearchString,\r\n};\r\n","const _ = require('underscore');\r\n// support a mongoDB like orderby object for now: { age : -1, name: 1 }\r\n// for backward compatibility, support array format: [['age', 'desc'], ['name', 'asc]]\r\nfunction parseOrderBy(orderby) {\r\n function lowerCaseOrderValue(value) {\r\n return _.map(value, (v, index) => (index === 1 ? v.toLowerCase() : v));\r\n }\r\n\r\n if (_.isEmpty(orderby)) {\r\n return {};\r\n }\r\n\r\n let $orderby;\r\n if (_.isArray(orderby)) {\r\n $orderby = _.map(orderby, value => lowerCaseOrderValue(value).join(' ')).join(',');\r\n } else {\r\n $orderby = _.map(orderby, (value, key) => `${key} ${value > 0 ? 'asc' : 'desc'}`).join(',');\r\n }\r\n\r\n return {\r\n $orderby,\r\n };\r\n}\r\n\r\nfunction parseFilter(filter) {\r\n if (_.isEmpty(filter) || _.isEmpty(filter.where)) {\r\n return {};\r\n }\r\n\r\n return {\r\n $filter: filter.where,\r\n };\r\n}\r\n\r\nfunction parseTop(top) {\r\n if (!top) {\r\n return {};\r\n }\r\n\r\n return {\r\n $top: top,\r\n };\r\n}\r\n\r\nfunction parseSkip(skip) {\r\n if (!skip) {\r\n return {};\r\n }\r\n\r\n return {\r\n $skip: skip,\r\n };\r\n}\r\n\r\nfunction parseCount(count) {\r\n if (count === undefined) {\r\n return {};\r\n }\r\n\r\n return {\r\n $count: count,\r\n };\r\n}\r\n\r\nfunction parseSelect(select, resource) {\r\n if (!select) return {};\r\n const parsed = {};\r\n const elementType = resource.type.elementType ? resource.type.elementType : resource.type;\r\n const { navigationPropertyNames } = elementType;\r\n const $select = select.filter(item => !_.contains(navigationPropertyNames, item)).join(',');\r\n const $expand = select.filter(item => _.contains(navigationPropertyNames, item)).join(',');\r\n\r\n if ($select.length) {\r\n parsed.$select = $select;\r\n }\r\n\r\n if ($expand.length) {\r\n parsed.$expand = $expand;\r\n }\r\n\r\n return parsed;\r\n}\r\n\r\nfunction parseSearchString(search) {\r\n if (!search) {\r\n return {};\r\n }\r\n\r\n return {\r\n $search: search,\r\n };\r\n}\r\n\r\nfunction parseSearch(search, edmResource) {\r\n const {\r\n orderby,\r\n filter,\r\n top,\r\n skip,\r\n count,\r\n select,\r\n search: searchString,\r\n ...nonODataSearch\r\n } = search;\r\n\r\n return {\r\n ...parseOrderBy(orderby),\r\n ...parseFilter(filter),\r\n ...parseTop(top),\r\n ...parseSkip(skip),\r\n ...parseCount(count),\r\n ...parseSelect(select, edmResource),\r\n ...parseSearchString(searchString),\r\n ...nonODataSearch,\r\n };\r\n}\r\n\r\nmodule.exports = {\r\n parseSearch,\r\n};\r\n","const {\r\n useFetch,\r\n useDataRefId,\r\n} = require('@bingads-webui-react/overreact');\r\n\r\nconst { useSpecs } = require('./use-specs');\r\n\r\nfunction useODataCall(specs, path, sideEffectFn, variables) {\r\n const dataRefId = useDataRefId();\r\n const { actionSpec } = useSpecs(specs, path);\r\n\r\n return useFetch(dataRefId, actionSpec, variables);\r\n}\r\n\r\nmodule.exports = {\r\n useODataCall,\r\n};\r\n","const { useCallback, useMemo } = require('react');\r\nconst { useDataRefId, usePagination, useMutation } = require('@bingads-webui-react/overreact');\r\n\r\nconst { useSpecs } = require('./use-specs');\r\n\r\nfunction useODataCollection(specs, path, variables, config) {\r\n const dataRefId = useDataRefId();\r\n const { collSpecs } = useSpecs(specs, path);\r\n\r\n const {\r\n fetch: fetchSpec,\r\n mutation: mutationSpec,\r\n destroy: destroySpec,\r\n add: addSpec,\r\n } = collSpecs;\r\n\r\n // FIXME: extract fetchVariables out from the config\r\n const paginationConfig = useMemo(() => ({\r\n fetchVariables: {\r\n ...variables,\r\n },\r\n ...config,\r\n }), [config, variables]);\r\n\r\n const [data, methods] = usePagination(dataRefId, fetchSpec, paginationConfig);\r\n\r\n const mutateFn = useMutation(dataRefId, mutationSpec, config);\r\n const destroyFn = useMutation(dataRefId, destroySpec, config);\r\n const createFn = useMutation(dataRefId, addSpec, config);\r\n\r\n const update = useCallback((newData, ...rest) => {\r\n mutateFn(variables, newData, ...rest);\r\n }, [mutateFn, variables]);\r\n\r\n // FIXME: likezh: Why would destroy need data?\r\n const destroy = useCallback((newData, ...rest) => {\r\n destroyFn(variables, newData, ...rest);\r\n }, [destroyFn, variables]);\r\n\r\n const create = useCallback((newData, ...rest) => {\r\n createFn(variables, newData, ...rest);\r\n }, [createFn, variables]);\r\n\r\n const { loadMore, hasMore, isLoading } = methods;\r\n\r\n return [data, {\r\n loadMore,\r\n hasMore,\r\n isLoading,\r\n create,\r\n update,\r\n destroy,\r\n }];\r\n}\r\n\r\nmodule.exports = {\r\n useODataCollection,\r\n};\r\n","const { useCallback } = require('react');\r\n\r\nconst { useDataRefId, useFetch, useMutation } = require('@bingads-webui-react/overreact');\r\nconst { useSpecs } = require('./use-specs');\r\n\r\nfunction useODataEntity(specs, path, variables, config = {}) {\r\n const dataRefId = useDataRefId();\r\n const { entitySpecs } = useSpecs(specs, path);\r\n\r\n const {\r\n fetch: fetchSpec,\r\n mutation: mutationSpec,\r\n destroy: destroySpec,\r\n } = entitySpecs;\r\n\r\n const [data, error] = useFetch(dataRefId, fetchSpec, variables, config);\r\n const mutateFn = useMutation(dataRefId, mutationSpec, config);\r\n const destroyFn = useMutation(dataRefId, destroySpec, config);\r\n\r\n const update = useCallback((newData, ...rest) => {\r\n mutateFn(variables, newData, ...rest);\r\n }, [mutateFn, variables]);\r\n\r\n // FIXME: likezh: Why would destroy need data?\r\n const destroy = useCallback((newData, ...rest) => {\r\n destroyFn(variables, newData, ...rest);\r\n }, [destroyFn, variables]);\r\n\r\n return [{ data, error }, { update, destroy }];\r\n}\r\n\r\nmodule.exports = {\r\n useODataEntity,\r\n};\r\n","const { useMemo } = require('react');\r\n\r\nfunction useSpecs(specs, path) {\r\n // find the spec needed from path\r\n return useMemo(() => {\r\n const selectedSpecs = specs[path];\r\n\r\n if (!selectedSpecs) {\r\n return [{ error: `specs for path ${path} not found` }];\r\n }\r\n\r\n return selectedSpecs;\r\n }, [path, specs]);\r\n}\r\n\r\nmodule.exports = {\r\n useSpecs,\r\n};\r\n","import React from 'react';\r\n\r\nexport const EnvironmentContext = React.createContext();\r\n","/* eslint-disable react-hooks/rules-of-hooks */\r\nimport _ from 'underscore';\r\nimport React, { useRef, memo } from 'react';\r\nimport PropTypes from 'prop-types';\r\n\r\nimport { EnvironmentContext } from '../environment/context';\r\n\r\nconst MAX_REQUEST_BATCH_SIZE = 10;\r\nconst FETCH_INTERVAL = 50;\r\nconst INIT_MIDDLEWARE_STATES = { isResponseFromStore: false };\r\n\r\nfunction executeRequests(environment, requests) {\r\n const pendingRequests = [\r\n ...requests,\r\n ];\r\n while (pendingRequests.length > 0) {\r\n const req = pendingRequests.shift();\r\n\r\n const {\r\n requestContract,\r\n spec,\r\n variables,\r\n data,\r\n id,\r\n componentName,\r\n } = req;\r\n\r\n req.middlewareStates = {\r\n ...INIT_MIDDLEWARE_STATES,\r\n };\r\n\r\n const { responseContract } = spec;\r\n const {\r\n verb, uriFactoryFn, headerFactoryFn, payloadFactoryFn,\r\n } = requestContract;\r\n\r\n const uri = uriFactoryFn({ requestContract, variables, data });\r\n const header = headerFactoryFn && headerFactoryFn({ requestContract, variables, data });\r\n const payload = payloadFactoryFn && payloadFactoryFn({ requestContract, variables, data });\r\n\r\n const requestor = environment.getRequestor(\r\n id,\r\n spec,\r\n variables,\r\n req.middlewareStates,\r\n { componentName }\r\n );\r\n\r\n requestor(uri, verb, header, payload).execute({\r\n onComplete: response => {\r\n responseContract.onGetResponse(environment, response, req);\r\n },\r\n onError: error => {\r\n responseContract.onGetError(environment, req, error);\r\n },\r\n });\r\n }\r\n}\r\n\r\nfunction batchRequests(environment, batchSize) {\r\n // console.log(`executing requests for batch size ${batchSize}`);\r\n\r\n // we'll try to batch requests\r\n const requests = [];\r\n while (requests.length < batchSize) {\r\n const request = environment.removeRequest();\r\n requests.push(request);\r\n }\r\n\r\n executeRequests(environment, requests);\r\n}\r\n\r\nexport function useEnvironmentInitialization(environment) {\r\n // const [currentEnvironment, setCurrEnv] = useState(environment);\r\n const timer = useRef(null);\r\n\r\n // TODO: we need better way to subscribe here\r\n // current way will result in memory leak or other bugs when environment change\r\n environment.subscribe(() => {\r\n if (!timer.current) {\r\n clearTimeout(timer.current);\r\n }\r\n\r\n if (environment.requestCount() >= MAX_REQUEST_BATCH_SIZE) {\r\n // immediately execute requests to reduce queue size\r\n batchRequests(environment, MAX_REQUEST_BATCH_SIZE);\r\n } else {\r\n // a few requests outstanding, wait a bit to accumulate more.\r\n timer.current = setTimeout(() => {\r\n batchRequests(environment, environment.requestCount());\r\n }, FETCH_INTERVAL);\r\n }\r\n });\r\n}\r\n\r\n// default top-level data fetcher\r\nexport const DataFetcher = memo(props => {\r\n const {\r\n environment,\r\n environments,\r\n children,\r\n } = props;\r\n useEnvironmentInitialization(environment);\r\n _.each(environments, env => useEnvironmentInitialization(env));\r\n\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n});\r\n\r\nDataFetcher.propTypes = {\r\n // eslint-disable-next-line react/forbid-prop-types\r\n environment: PropTypes.object.isRequired,\r\n environments: PropTypes.arrayOf(PropTypes.object),\r\n children: PropTypes.oneOfType([\r\n PropTypes.arrayOf(PropTypes.node),\r\n PropTypes.node,\r\n ]).isRequired,\r\n};\r\n\r\nDataFetcher.defaultProps = {\r\n environments: null,\r\n};\r\n","// Use the basic APIs of ES6 Set. If your site supports browsers not\r\n// having Set natively, you should use a polyfill\r\n\r\n/* Subject to observe */\r\nexport class Subject {\r\n constructor() {\r\n // eslint-disable-next-line no-undef\r\n this.observers = new Set();\r\n }\r\n\r\n /**\r\n * Subscribe an observer to the subject\r\n * @param {Object} observer - The observer subscribing to the subject\r\n * @returns {void}\r\n */\r\n subscribe(observer) {\r\n if (!(observer instanceof Object)) {\r\n throw new Error('Invalid observer');\r\n }\r\n this.observers.add(observer);\r\n }\r\n\r\n /**\r\n * Unsubscribe an observer from the subject\r\n * @param {Object} observer - The observer to unsubscribe\r\n * @returns {void}\r\n */\r\n unsubscribe(observer) {\r\n this.observers.delete(observer);\r\n }\r\n\r\n /**\r\n * Notify the observers for a certain action\r\n * @param {string} action -\r\n * Name of the action, it will map to the handler method name on the observer\r\n * @param {...*} args - Additional arguments\r\n * @returns {void}\r\n */\r\n notify(action, ...args) {\r\n this.observers.forEach(observer => {\r\n if (typeof observer[action] === 'function') {\r\n observer[action](this, ...args);\r\n }\r\n });\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { Subject } from '../../utils/observer-pattern';\r\n\r\nexport class DataRef extends Subject {\r\n constructor(key) {\r\n super();\r\n this.key = key;\r\n this.idRefs = [];\r\n this.status = {\r\n previousVariables: undefined,\r\n lastUpdateTimestamp: Date.now(),\r\n error: undefined,\r\n };\r\n\r\n this.includes = this.includes.bind(this);\r\n this.push = this.push.bind(this);\r\n this.add = this.add.bind(this);\r\n this.delete = this.delete.bind(this);\r\n this.onUpdate = this.onUpdate.bind(this);\r\n this.updateStatus = this.updateStatus.bind(this);\r\n this.onError = this.onError.bind(this);\r\n this.clearError = this.clearError.bind(this);\r\n this.onEntitiesCreated = this.onEntitiesCreated.bind(this);\r\n this.onEntitiesDeleted = this.onEntitiesDeleted.bind(this);\r\n this.reset = this.reset.bind(this);\r\n\r\n // TODO: use \"cursor\" for specific pagination needs\r\n this.cursor = {};\r\n\r\n this.UiComponents = [];\r\n }\r\n\r\n registerComponent({\r\n componentName,\r\n }) {\r\n this.UiComponents = _.uniq([...this.UiComponents, componentName]);\r\n this.updateDevTools();\r\n }\r\n\r\n unregisterComponent({\r\n componentName,\r\n }) {\r\n this.UiComponents = _.without(this.UiComponents, componentName);\r\n this.updateDevTools();\r\n }\r\n\r\n updateDevTools() {\r\n if (window.__OVERREACT_DEVTOOLS__) {\r\n const { onDataRefChange } = window.__OVERREACT_DEVTOOLS__;\r\n onDataRefChange({\r\n components: this.UiComponents,\r\n key: this.key,\r\n idRefs: this.idRefs,\r\n });\r\n }\r\n }\r\n\r\n includes(id) {\r\n return this.idRefs.includes(id);\r\n }\r\n\r\n push(id) {\r\n const ret = this.idRefs.push(id);\r\n\r\n return ret;\r\n }\r\n\r\n add(id) {\r\n // add/merge an id. If id exists in idRefs, do nothing\r\n if (this.includes(id)) {\r\n return;\r\n }\r\n\r\n this.push(id);\r\n }\r\n\r\n delete(ids) {\r\n if (_.intersection(this.idRefs, ids).length > 0) {\r\n this.idRefs = _.difference(this.idRefs, ids);\r\n }\r\n }\r\n\r\n onError(error, ...args) {\r\n this.status.error = error;\r\n this.notify('onError', error, ...args);\r\n }\r\n\r\n clearError() {\r\n this.onError(undefined);\r\n }\r\n\r\n // currently, we will always add something to this data ref after clear, and trigger event then\r\n // so here we don't trigger a notification anymore: this.notify('update', []);\r\n // otherwise UI component will get a incorrect empty status for short time\r\n clear() {\r\n this.idRefs = [];\r\n this.clearError();\r\n }\r\n\r\n reset(ids) {\r\n this.idRefs = ids;\r\n this.notify('update', ids);\r\n }\r\n\r\n updateStatus(newStatus) {\r\n this.status = {\r\n ...this.status,\r\n ...newStatus,\r\n };\r\n }\r\n\r\n onUpdate(updatedIds, request) {\r\n if (_.intersection(this.idRefs, updatedIds).length > 0) {\r\n this.notify('update', updatedIds, request);\r\n }\r\n }\r\n\r\n onEntitiesCreated(ids) {\r\n if (!_.isEmpty(ids)) {\r\n this.notify('onEntitiesCreated', ids);\r\n }\r\n }\r\n\r\n onEntitiesDeleted(ids) {\r\n if (_.intersection(this.idRefs, ids).length > 0) {\r\n this.delete(ids);\r\n this.notify('update', this.idRefs);\r\n }\r\n }\r\n\r\n toJson() {\r\n return ({\r\n key: this.key,\r\n idRefs: this.idRefs,\r\n status: this.status,\r\n });\r\n }\r\n}\r\n","import { DataRef } from './data-ref';\r\n\r\n// this will be attached to the schema node as an extension\r\n// and represent all data stored under the data path given by the schema node\r\n// each data node contains an array of data IDs\r\n// which refers to the actual data record in the store.\r\nexport class DataNode {\r\n constructor() {\r\n this.dataRefs = {};\r\n\r\n this.getDataRef = this.getDataRef.bind(this);\r\n this.dataRefIdsUpdate = this.dataRefIdsUpdate.bind(this);\r\n this.entitiesCreated = this.entitiesCreated.bind(this);\r\n this.entitiesDeleted = this.entitiesDeleted.bind(this);\r\n }\r\n\r\n getDataRef(key) {\r\n if (!this.dataRefs[key]) {\r\n this.dataRefs[key] = new DataRef(key);\r\n }\r\n\r\n return this.dataRefs[key];\r\n }\r\n\r\n dataRefIdsUpdate(recordGroup, updatedIds, request) {\r\n Object.keys(this.dataRefs).forEach(key => this.dataRefs[key].onUpdate(updatedIds, request));\r\n }\r\n\r\n entitiesCreated(recordGroup, ids) {\r\n Object.keys(this.dataRefs).forEach(key => this.dataRefs[key].onEntitiesCreated(ids));\r\n }\r\n\r\n entitiesDeleted(recordGroup, ids) {\r\n Object.keys(this.dataRefs).forEach(key => this.dataRefs[key].onEntitiesDeleted(ids));\r\n }\r\n\r\n toJson() {\r\n return ({\r\n dataRefs: Object.keys(this.dataRefs).map(k => this.dataRefs[k].toJson()),\r\n });\r\n }\r\n}\r\n","import { DataNode } from './data-node';\r\n\r\nconst EXTENSION_NAME = 'DATA';\r\n\r\nexport function createDataNode(schemaNode, store) {\r\n if (!schemaNode) {\r\n throw new Error('Invalid schema node');\r\n }\r\n\r\n const dataNode = new DataNode();\r\n store.getRecordGroup(schemaNode.modelName).subscribe(dataNode);\r\n\r\n schemaNode.setExtension(EXTENSION_NAME, dataNode);\r\n\r\n return dataNode;\r\n}\r\n\r\nexport function getDataNode(schemaNode) {\r\n if (!schemaNode) {\r\n return null;\r\n }\r\n\r\n return schemaNode.getExtension(EXTENSION_NAME);\r\n}\r\n","export class Record {\r\n constructor(id, type, data) {\r\n this.id = id;\r\n this.type = type;\r\n this.data = data;\r\n\r\n this.setValue = this.setValue.bind(this);\r\n this.getValue = this.getValue.bind(this);\r\n this.setData = this.setData.bind(this);\r\n this.getData = this.getData.bind(this);\r\n }\r\n\r\n setValue(key, value) {\r\n this.data = {\r\n ...this.data,\r\n [key]: value,\r\n };\r\n }\r\n\r\n getValue(key) {\r\n return this.data[key];\r\n }\r\n\r\n setData(data) {\r\n this.data = {\r\n ...this.data,\r\n ...data,\r\n };\r\n }\r\n\r\n getData() {\r\n return this.data;\r\n }\r\n}\r\n","export const OVERREACT_ID_FIELD_NAME = '_OVERREACT_ID';\r\n\r\nexport function createOverreactId(id, parentId, parentType) {\r\n return `${parentType}:${parentId}:${id}`;\r\n}\r\n","import _ from 'underscore';\r\nimport { Record } from './record';\r\nimport { OVERREACT_ID_FIELD_NAME } from './consts';\r\nimport { Subject } from '../utils/observer-pattern';\r\n\r\nexport class RecordGroup extends Subject {\r\n constructor({\r\n schemaType,\r\n store,\r\n }) {\r\n super();\r\n\r\n this.schemaType = schemaType;\r\n this.store = store;\r\n\r\n // records will be kept in chronological order\r\n // new records will always be kept at the end of the list\r\n this.records = [];\r\n\r\n this.addOrUpdateRecords = this.addOrUpdateRecords.bind(this);\r\n\r\n this.getRecords = this.getRecords.bind(this);\r\n this.getRecordsByEntityKeys = this.getRecordsByEntityKeys.bind(this);\r\n }\r\n\r\n findIndex(dataId) {\r\n return this.records.findIndex(r => r.id === dataId);\r\n }\r\n\r\n addOrUpdateRecordInternal(data) {\r\n const dataId = data[OVERREACT_ID_FIELD_NAME];\r\n const recordId = this.findIndex(dataId);\r\n\r\n if (recordId > -1) {\r\n // we're updating\r\n this.records[recordId].setData(data.rawData);\r\n } else {\r\n // \"add\" record - because we'll be appending\r\n const newRecord = new Record(dataId, this.schemaType, data.rawData);\r\n this.records.push(newRecord);\r\n }\r\n\r\n return dataId;\r\n }\r\n\r\n addOrUpdateRecords(dataItems, request) {\r\n const updatedDataIDs = dataItems.map(data => this.addOrUpdateRecordInternal(data));\r\n this.notify('dataRefIdsUpdate', updatedDataIDs, request);\r\n this.notifyUpdate();\r\n }\r\n\r\n deleteRecords(ids) {\r\n this.records = this.records.filter(record => !_.contains(ids, record.id));\r\n this.notifyUpdate();\r\n }\r\n\r\n getRecords(ids) {\r\n return ids.map(id => this.records.find(r => r.id === id));\r\n }\r\n\r\n getRecordsByEntityKeys(keySelector, keys) {\r\n return _.chain(keys)\r\n .map(key => this.records.find(r => keySelector(r.getData()) === key))\r\n .compact()\r\n .value();\r\n }\r\n\r\n notifyUpdate() {\r\n if (window.__OVERREACT_DEVTOOLS__) {\r\n const { onRecordGroupChange } = window.__OVERREACT_DEVTOOLS__;\r\n onRecordGroupChange({\r\n storeId: this.store.uniqueId,\r\n schemaType: this.schemaType,\r\n records: JSON.parse(JSON.stringify(this.records)),\r\n });\r\n }\r\n }\r\n}\r\n","import _ from 'underscore';\r\n// Use the basic APIs of ES6 Map. If your site supports browsers not\r\n// having Map natively, you should use a polyfill\r\nimport { RecordGroup } from './record-group';\r\n\r\nexport class Store {\r\n constructor(uniqueId) {\r\n this.uniqueId = uniqueId || _.uniqueId('Overreact_store_');\r\n this.recordGroups = {};\r\n // eslint-disable-next-line no-undef\r\n this.preemptiveRecords = new Map();\r\n\r\n this.getRecordGroup = this.getRecordGroup.bind(this);\r\n\r\n if (window.__OVERREACT_DEVTOOLS__) {\r\n window.__OVERREACT_DEVTOOLS__.store = this;\r\n window.__OVERREACT_DEVTOOLS__.getStore(this);\r\n }\r\n }\r\n\r\n getRecordGroup(modelName) {\r\n if (!this.recordGroups[modelName]) {\r\n this.recordGroups[modelName] = new RecordGroup({\r\n schemaType: modelName,\r\n store: this,\r\n });\r\n }\r\n return this.recordGroups[modelName];\r\n }\r\n\r\n addPreemptiveRecords(key, records) {\r\n this.preemptiveRecords.set(key, records);\r\n }\r\n\r\n removePreemptiveRecords(key) {\r\n const records = this.preemptiveRecords.get(key);\r\n this.preemptiveRecords.delete(key);\r\n return records;\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { getDataNode, createDataNode } from './schema-extension/schema-extension';\r\n\r\nexport function getRecordGroup(store, requestContract) {\r\n if (store) {\r\n const schemaNode = requestContract.getSchemaNode();\r\n const recordGroup = store.getRecordGroup(schemaNode.modelName);\r\n\r\n return recordGroup;\r\n }\r\n return null;\r\n}\r\n\r\nexport function getRecordsById(store, requestContract, ids) {\r\n const recordGroup = getRecordGroup(store, requestContract);\r\n return recordGroup.getRecords(ids);\r\n}\r\n\r\nexport function getRecordsByEntityKey(store, spec, keys) {\r\n const { requestContract, responseContract } = spec;\r\n const recordGroup = getRecordGroup(store, requestContract);\r\n const { keySelector } = responseContract;\r\n return recordGroup.getRecordsByEntityKeys(keySelector, keys);\r\n}\r\n\r\nexport function getRecordsFromResponseDataArray(store, spec, dataArray) {\r\n const { responseContract } = spec;\r\n const { keySelector } = responseContract;\r\n const entityKeys = _.map(dataArray, d => keySelector(d));\r\n return getRecordsByEntityKey(store, spec, entityKeys);\r\n}\r\n\r\nexport function getRecords(store, requestContract, key) {\r\n if (store) {\r\n const schemaNode = requestContract.getSchemaNode();\r\n const dataNode = getDataNode(schemaNode) || createDataNode(schemaNode, store);\r\n\r\n const dataIds = dataNode.getDataRef(key).idRefs;\r\n const recordGroup = getRecordGroup(store, requestContract);\r\n\r\n return recordGroup.getRecords(dataIds);\r\n }\r\n return null;\r\n}\r\n\r\nexport function getDataRef(store, requestContract, dataRefId) {\r\n if (store) {\r\n const schemaNode = requestContract.getSchemaNode();\r\n const dataNode = getDataNode(schemaNode) || createDataNode(schemaNode, store);\r\n return dataNode && dataNode.getDataRef(dataRefId);\r\n }\r\n return null;\r\n}\r\n\r\nexport function updateDataRefWithIds(dataRef, ids) {\r\n dataRef.clear();\r\n _.map(ids, id => {\r\n dataRef.add(id);\r\n });\r\n dataRef.onUpdate(ids);\r\n}\r\n","export const specTypes = {\r\n ADD: 'ADD',\r\n DELETE: 'DELETE',\r\n FETCH: 'FETCH',\r\n MUTATION: 'MUTATION',\r\n PAGINATION: 'PAGINATION',\r\n REFETCH: 'REFETCH',\r\n};\r\n","export const responseTypes = {\r\n ENTITY: 'ENTITY',\r\n COLL: 'COLL',\r\n NONE: 'NONE', // useful when deleting\r\n};\r\n","import _ from 'underscore';\r\nimport stringify from 'json-stable-stringify';\r\n\r\nimport { getRecords, getDataRef } from '../../store';\r\nimport { specTypes } from '../../spec/spec-types';\r\nimport { responseTypes } from '../../spec/response-types';\r\n\r\nexport const DEFAULT_STORE_EXPIRATION_DURATION = 5 * 60 * 1000;\r\n\r\nexport const FetchPolicy = {\r\n StoreOnly: 'StoreOnly',\r\n NetworkOnly: 'NetworkOnly',\r\n StoreOrNetwork: 'StoreOrNetwork',\r\n NetworkOrStore: 'NetworkOrStore',\r\n};\r\n\r\nexport function IsNetworkPolicy(fetchPolicy) {\r\n return fetchPolicy === FetchPolicy.NetworkOnly\r\n || fetchPolicy === FetchPolicy.NetworkOrStore\r\n || fetchPolicy === FetchPolicy.StoreOrNetwork;\r\n}\r\n\r\nexport function IsStorePolicy(fetchPolicy) {\r\n return fetchPolicy === FetchPolicy.StoreOnly\r\n || fetchPolicy === FetchPolicy.StoreOrNetwork\r\n || fetchPolicy === FetchPolicy.NetworkOrStore;\r\n}\r\n\r\nexport function IsStoreSecondaryPolicy(fetchPolicy) {\r\n return fetchPolicy === FetchPolicy.NetworkOrStore;\r\n}\r\n\r\nexport function getFetchPolicy(specType, fetchPolicyOption, fetchPolicyInEnv) {\r\n if (specType === specTypes.FETCH\r\n || specType === specTypes.PAGINATION\r\n || fetchPolicyOption !== FetchPolicy.StoreOnly) {\r\n return fetchPolicyOption || fetchPolicyInEnv;\r\n }\r\n\r\n return fetchPolicyInEnv;\r\n}\r\n\r\nexport function getDataFromStore(store, spec, dataRefId) {\r\n const { requestContract } = spec;\r\n const records = getRecords(store, requestContract, dataRefId);\r\n\r\n const dataInStore = _.map(records, record => record.getData());\r\n if (spec.responseContract.responseType === responseTypes.ENTITY\r\n && !_.isEmpty(dataInStore) && _.isArray(dataInStore)) {\r\n return dataInStore[0];\r\n }\r\n return dataInStore;\r\n}\r\n\r\nexport function shouldForceNetwork({\r\n store, spec, dataRefId, variables, storeExpirationDuration, currentTimestamp, requestFetchPolicy,\r\n}) {\r\n const { requestContract, specType } = spec;\r\n const dataRef = getDataRef(store, requestContract, dataRefId);\r\n const {\r\n status: {\r\n previousVariables,\r\n lastUpdateTimestamp,\r\n } = {},\r\n } = dataRef || {};\r\n\r\n return requestFetchPolicy !== FetchPolicy.StoreOnly\r\n && (stringify(variables) !== stringify(previousVariables)\r\n || currentTimestamp - lastUpdateTimestamp > storeExpirationDuration\r\n || specType === specTypes.ADD\r\n || specType === specTypes.DELETE\r\n || specType === specTypes.MUTATION);\r\n}\r\n\r\nexport function updateDataRefStatus({\r\n store, spec, dataRefId, variables, currentTimestamp,\r\n}) {\r\n const { requestContract } = spec;\r\n const dataRef = getDataRef(store, requestContract, dataRefId);\r\n if (dataRef) {\r\n dataRef.updateStatus({\r\n previousVariables: variables,\r\n lastUpdateTimestamp: currentTimestamp,\r\n });\r\n }\r\n}\r\n","import _ from 'underscore';\r\n\r\nimport {\r\n FetchPolicy,\r\n IsNetworkPolicy,\r\n IsStorePolicy,\r\n IsStoreSecondaryPolicy,\r\n getFetchPolicy,\r\n getDataFromStore,\r\n shouldForceNetwork,\r\n updateDataRefStatus,\r\n DEFAULT_STORE_EXPIRATION_DURATION,\r\n} from './fetch-policy-utils';\r\n\r\nexport function createFetchPolicyMiddleware(fetchPolicyMiddlewareOptions) {\r\n const {\r\n fetchPolicy = FetchPolicy.StoreOrNetwork,\r\n cacheExpirationDuration = DEFAULT_STORE_EXPIRATION_DURATION,\r\n } = fetchPolicyMiddlewareOptions || {};\r\n\r\n return next => async req => {\r\n const fetchPolicyInReq = (req.variables\r\n && req.variables.options\r\n && req.variables.options.fetchPolicy)\r\n || req.spec.requestContract.fetchPolicy;\r\n const requestFetchPolicy = getFetchPolicy(req.spec.specType, fetchPolicyInReq, fetchPolicy);\r\n\r\n const isStoreSecondaryPolicy = IsStoreSecondaryPolicy(requestFetchPolicy);\r\n let dataInStore = null;\r\n const isNetworkPolicy = IsNetworkPolicy(requestFetchPolicy);\r\n const isStorePolicy = IsStorePolicy(requestFetchPolicy);\r\n\r\n const currentTimestamp = Date.now();\r\n const isForceNetwork = shouldForceNetwork({\r\n store: req.store,\r\n spec: req.spec,\r\n dataRefId: req.dataRefId,\r\n variables: _.omit(req.variables, 'options'),\r\n storeExpirationDuration: cacheExpirationDuration,\r\n currentTimestamp,\r\n requestFetchPolicy,\r\n });\r\n\r\n if (isStorePolicy && !isForceNetwork && !isStoreSecondaryPolicy) {\r\n dataInStore = getDataFromStore(req.store, req.spec, req.dataRefId);\r\n if (!_.isEmpty(dataInStore)) {\r\n req.middlewareStates.isResponseFromStore = true;\r\n return dataInStore;\r\n }\r\n }\r\n\r\n if (isNetworkPolicy) {\r\n const res = await next(req)\r\n .then(response => {\r\n updateDataRefStatus({\r\n store: req.store,\r\n spec: req.spec,\r\n dataRefId: req.dataRefId,\r\n variables: _.omit(req.variables, 'options'),\r\n currentTimestamp,\r\n });\r\n return response;\r\n })\r\n .catch(error => {\r\n // we only try roll back to previous data if policy is networkOrStore\r\n // if policy is storeOrNetwork and we go here, it means we already miss the cache\r\n // or we decided to not trust the cache.\r\n if (requestFetchPolicy === FetchPolicy.NetworkOrStore) {\r\n dataInStore = getDataFromStore(req.store, req.spec, req.dataRefId);\r\n if (!_.isEmpty(dataInStore)) {\r\n req.middlewareStates.isResponseFromStore = true;\r\n return dataInStore;\r\n }\r\n }\r\n throw error;\r\n });\r\n return res;\r\n }\r\n\r\n return next(req);\r\n };\r\n}\r\n","export const middlewareTypes = {\r\n ERROR: 'ERROR',\r\n FETCH_POLICY: 'FETCH_POLICY',\r\n INSTRUMENTATION: 'INSTRUMENTATION',\r\n};\r\n","import {\r\n compose, omit, values, pick,\r\n} from 'underscore';\r\nimport { middlewareTypes } from './middleware-types';\r\n\r\nfunction executeRequestor(wrappedRequestor) {\r\n return wrappedRequestor.executeRequest();\r\n}\r\n\r\nexport function requestWithMiddleware(wrappedRequestor, middlewares) {\r\n const baseMiddlewares = values(omit(middlewares, middlewareTypes.INSTRUMENTATION));\r\n const instrumentationMiddleware = values(pick(middlewares, middlewareTypes.INSTRUMENTATION));\r\n const wrappedRequest = compose(\r\n ...baseMiddlewares,\r\n ...instrumentationMiddleware,\r\n )(executeRequestor);\r\n\r\n // eslint-disable-next-line arrow-body-style\r\n return wrappedRequest(wrappedRequestor).then(response => {\r\n return response;\r\n }).catch(error => {\r\n throw error;\r\n });\r\n}\r\n","export class WrappedRequestor {\r\n constructor(parameter) {\r\n const {\r\n requestor,\r\n uri,\r\n verb,\r\n headers,\r\n payload,\r\n spec,\r\n variables,\r\n store,\r\n dataRefId,\r\n middlewareStates,\r\n } = parameter;\r\n\r\n this.requestor = requestor;\r\n this.uri = uri;\r\n this.verb = verb;\r\n this.headers = headers;\r\n this.payload = payload;\r\n this.variables = variables;\r\n this.spec = spec;\r\n this.store = store;\r\n this.dataRefId = dataRefId;\r\n this.middlewareStates = middlewareStates;\r\n\r\n this.executeRequest = this.executeRequest.bind(this);\r\n }\r\n\r\n executeRequest() {\r\n return this.requestor(this.uri, this.verb, this.headers, this.payload);\r\n }\r\n}\r\n","import _ from 'underscore';\r\n\r\nexport function createErrorMiddleware(errorMiddlewareOptions) {\r\n const {\r\n errorProcessor = _.noop,\r\n errorConvertor: envErrorConverter = _.noop,\r\n } = errorMiddlewareOptions || {};\r\n return next => async req => {\r\n const {\r\n spec: {\r\n responseContract: {\r\n errorConvertFn,\r\n } = {},\r\n } = {},\r\n } = req || {};\r\n const errorConvertor = errorConvertFn || envErrorConverter;\r\n\r\n const response = next(req).then(res => {\r\n const error = errorConvertor(res);\r\n if (error) {\r\n throw error;\r\n }\r\n return res;\r\n }).catch(error => {\r\n const processedError = errorConvertor(error) || error;\r\n errorProcessor(processedError);\r\n throw error;\r\n });\r\n\r\n return response;\r\n };\r\n}\r\n","/**\r\n * Get the current timestamp\r\n * @returns {number} - the timestamp since epoch in milliseconds\r\n*/\r\nexport function getTimestamp() {\r\n return Date.now();\r\n}\r\n","import _ from 'underscore';\r\nimport { useRef, useEffect, useDebugValue } from 'react';\r\n\r\nexport function usePrevious(value) {\r\n const ref = useRef();\r\n\r\n useEffect(() => {\r\n ref.current = value;\r\n }, [value]);\r\n\r\n return ref.current;\r\n}\r\n\r\n\r\nexport function useDeepMemo(value) {\r\n const ref = useRef();\r\n\r\n if (!_.isEqual(value, ref.current)) {\r\n ref.current = value;\r\n }\r\n\r\n return ref.current;\r\n}\r\n\r\nexport function useDeepEqualEffect(fn, deps) {\r\n const isFirst = useRef(true);\r\n const prevDeps = useRef(deps);\r\n\r\n useEffect(() => {\r\n const isSame = prevDeps.current.every((obj, key) => _.isEqual(obj, deps[key]));\r\n\r\n if (isFirst.current || !isSame) {\r\n fn();\r\n }\r\n\r\n isFirst.current = false;\r\n prevDeps.current = deps;\r\n }, [deps, fn]);\r\n\r\n useDebugValue('useDeepEqualEffect');\r\n}\r\n","/* eslint-disable no-param-reassign */\r\nimport _ from 'underscore';\r\n\r\nimport { getTimestamp } from '../../utils/primitive-utilities';\r\n\r\nconst errorToString = error => {\r\n const stringError = error && error.toString();\r\n const stringifiedJson = JSON.stringify(error);\r\n\r\n if ((!_.isEmpty(stringifiedJson) && stringifiedJson !== '{}') || stringError === '[object Object]') {\r\n return stringifiedJson;\r\n }\r\n return stringError;\r\n};\r\n\r\nexport const defaultStubOptions = {\r\n serverErrorCodes: [-1],\r\n\r\n detectError(respData, serverErrorCodes) {\r\n const result = {\r\n pass: true,\r\n status: 400, // hard code to 400 for user-defined error\r\n };\r\n\r\n if (respData\r\n && respData.Errors\r\n && respData.Errors[0]\r\n && respData.Errors[0].Code\r\n && _.isArray(serverErrorCodes)\r\n && _.contains(serverErrorCodes, respData.Errors[0].Code)) {\r\n result.pass = false;\r\n result.message = respData.Errors[0].Message;\r\n result.impactUser = true;\r\n }\r\n return result;\r\n },\r\n\r\n getServerPerf(response) {\r\n if (response && _.isFunction(response.getResponseHeader)) {\r\n const perfTimings = response.getResponseHeader('PerfTimings');\r\n if (perfTimings) {\r\n return perfTimings;\r\n }\r\n const perf = {};\r\n _.each(\r\n ['x-ms-mte2eelapsedtimems', 'x-ms-odataapie2eelapsedtimems', 'x-ms-odataapionlye2eelapsedtimems'],\r\n header => {\r\n const value = response.getResponseHeader(header);\r\n if (value) {\r\n perf[header] = value;\r\n }\r\n },\r\n );\r\n\r\n return JSON.stringify(perf);\r\n }\r\n return '';\r\n },\r\n};\r\n\r\nexport function beforeSendHandler(instrumentationContext, req, perfFunc, shouldAddHeaders) {\r\n instrumentationContext.requestStartTime = getTimestamp();\r\n\r\n if (shouldAddHeaders(instrumentationContext) === true) {\r\n req.headers = {\r\n ...req.headers,\r\n 'x-ms-pagetrackingid': instrumentationContext.pageTrackingId,\r\n 'x-ms-lcid': instrumentationContext.stubOptions.lcid,\r\n lcid: instrumentationContext.stubOptions.lcid,\r\n 'x-ms-requestid': instrumentationContext.requestId,\r\n };\r\n }\r\n\r\n perfFunc({\r\n requestId: instrumentationContext.requestId,\r\n api: instrumentationContext.url,\r\n isMethodEnter: true,\r\n httpMethod: instrumentationContext.httpMethod,\r\n timeTaken: 0,\r\n pass: true,\r\n message: '',\r\n });\r\n}\r\n\r\nexport function successHandler(instrumentationContext, response, errorFunc, perfFunc) {\r\n const requestTimeTaken = getTimestamp() - instrumentationContext.requestStartTime;\r\n const result = instrumentationContext.stubOptions.detectError(response);\r\n instrumentationContext.requestTimeTaken = requestTimeTaken;\r\n\r\n if (!result.pass) {\r\n instrumentationContext.requestResult = false;\r\n instrumentationContext.error = result.message;\r\n\r\n errorFunc({\r\n message: instrumentationContext.error,\r\n api: instrumentationContext.url,\r\n requestId: instrumentationContext.requestId,\r\n impactUser: result.impactUser,\r\n httpMethod: instrumentationContext.httpMethod,\r\n statusCode: result.status,\r\n });\r\n }\r\n\r\n perfFunc({\r\n requestId: instrumentationContext.requestId,\r\n api: instrumentationContext.url,\r\n isMethodEnter: false,\r\n httpMethod: instrumentationContext.httpMethod,\r\n timeTaken: instrumentationContext.requestTimeTaken,\r\n pass: instrumentationContext.requestResult,\r\n message: instrumentationContext.stubOptions.getServerPerf(response),\r\n statusCode: 200,\r\n });\r\n}\r\n\r\nexport function errorHandler(\r\n instrumentationContext, error, isUserError,\r\n traceFunc, errorFunc, perfFunc,\r\n) {\r\n const requestTimeTaken = getTimestamp() - instrumentationContext.requestStartTime;\r\n instrumentationContext.requestTimeTaken = requestTimeTaken;\r\n\r\n if (error && error.status !== 0 && error.status) {\r\n instrumentationContext.responseJSON = error.responseJSON;\r\n instrumentationContext.requestResult = false;\r\n\r\n instrumentationContext.error = `Overreact server response error: [${error.status}], error: ${JSON.stringify(error)}`;\r\n\r\n if (error.responseJSON) {\r\n instrumentationContext.error += (`, responseJSON: ${errorToString(error.responseJSON)}`);\r\n }\r\n\r\n switch (error.status) {\r\n case 400:\r\n case 404:\r\n // If error maps to a user error, log at trace level\r\n if (isUserError(error)) {\r\n instrumentationContext.requestResult = true;\r\n }\r\n break;\r\n case 401:\r\n // Log 401 unauthorized error at trace level\r\n instrumentationContext.requestResult = true;\r\n break;\r\n default:\r\n instrumentationContext.requestResult = false;\r\n }\r\n } else {\r\n // If error maps to a user error, log at trace level\r\n if (isUserError(error)) {\r\n instrumentationContext.requestResult = true;\r\n } else {\r\n instrumentationContext.requestResult = false;\r\n }\r\n const errMsg = _.isError(error) ? error : JSON.stringify(error);\r\n instrumentationContext.error = `Overreact general error: ${errMsg}`;\r\n }\r\n\r\n const logFunc = instrumentationContext.requestResult ? traceFunc : errorFunc;\r\n logFunc({\r\n message: instrumentationContext.error,\r\n api: instrumentationContext.url,\r\n requestId: instrumentationContext.requestId,\r\n httpMethod: instrumentationContext.httpMethod,\r\n statusCode: error.status,\r\n });\r\n\r\n perfFunc({\r\n requestId: instrumentationContext.requestId,\r\n api: instrumentationContext.url,\r\n isMethodEnter: false,\r\n httpMethod: instrumentationContext.httpMethod,\r\n timeTaken: instrumentationContext.requestTimeTaken,\r\n pass: instrumentationContext.requestResult,\r\n statusCode: error.status,\r\n });\r\n}\r\n","import _ from 'underscore';\r\n\r\nimport { defaultStubOptions } from './instrumentation-utils';\r\n\r\nexport class InstrumentationContext {\r\n constructor(parameter) {\r\n const {\r\n pageTrackingId,\r\n errorMappers,\r\n url,\r\n requestId,\r\n httpMethod,\r\n stubOptions,\r\n } = parameter;\r\n\r\n this.pageTrackingId = pageTrackingId;\r\n this.errorMappers = errorMappers;\r\n this.url = url;\r\n this.requestId = requestId;\r\n this.httpMethod = httpMethod;\r\n this.stubOptions = _.defaults(stubOptions || {}, defaultStubOptions);\r\n }\r\n}\r\n","/* eslint-disable no-param-reassign */\r\nimport _ from 'underscore';\r\nimport { v4 as uuidv4 } from 'uuid';\r\n\r\nimport { InstrumentationContext } from './instrumentation-context';\r\nimport { beforeSendHandler, successHandler, errorHandler } from './instrumentation-utils';\r\n\r\nexport function createInstrumentationMiddleware(instrumentationOptions) {\r\n const {\r\n pageTrackingId,\r\n errorMappers,\r\n stubOptions,\r\n loggerFunc: {\r\n traceFunc = _.noop,\r\n errorFunc = _.noop,\r\n perfFunc = _.noop,\r\n } = {},\r\n } = instrumentationOptions || {};\r\n\r\n const shouldAddHeaders = instrumentationOptions.shouldAddHeaders || _.constant(true);\r\n\r\n function isUserError(error) {\r\n return _.any(errorMappers, errorMapper => errorMapper.check(error));\r\n }\r\n\r\n return next => async req => {\r\n const {\r\n headers: {\r\n 'x-ms-requestid': requestId = uuidv4(),\r\n } = {},\r\n } = req;\r\n\r\n const instrumentationContext = new InstrumentationContext({\r\n pageTrackingId,\r\n errorMappers,\r\n url: req.uri,\r\n requestId,\r\n httpMethod: req.spec.requestContract.verb,\r\n stubOptions,\r\n });\r\n\r\n beforeSendHandler(instrumentationContext, req, perfFunc, shouldAddHeaders);\r\n\r\n const response = next(req).then(res => {\r\n successHandler(instrumentationContext, res, errorFunc, perfFunc);\r\n return res;\r\n }).catch(error => {\r\n errorHandler(instrumentationContext, error, isUserError, traceFunc, errorFunc, perfFunc);\r\n throw error;\r\n });\r\n\r\n return response;\r\n };\r\n}\r\n","import 'regenerator-runtime/runtime';\r\n\r\nimport { requestWithMiddleware, WrappedRequestor } from '../middleware';\r\n\r\nexport class Environment {\r\n constructor(networkRequestor, schema, store, middlewares, tag) {\r\n this.networkRequestor = networkRequestor;\r\n\r\n this.schema = schema;\r\n\r\n // an FIFO queue\r\n this.requestQueue = [];\r\n this.dataFetcherSubscriber = [];\r\n\r\n // initialize the store\r\n this.store = store;\r\n\r\n this.middlewares = middlewares || {};\r\n\r\n this.tag = tag;\r\n\r\n this.notifyObservers = this.notifyObservers.bind(this);\r\n this.pushRequest = this.pushRequest.bind(this);\r\n this.removeRequest = this.removeRequest.bind(this);\r\n this.requestCount = this.requestCount.bind(this);\r\n\r\n this.subscribe = this.subscribe.bind(this);\r\n this.unsubscribe = this.unsubscribe.bind(this);\r\n\r\n this.getSchema = this.getSchema.bind(this);\r\n this.getRequestor = this.getRequestor.bind(this);\r\n\r\n this.dataRefIdPool = {};\r\n }\r\n\r\n getRequestor(id, spec, variables, middlewareStates, additionalParams) {\r\n const requestorWithDevTools = (uri, verb, headers, payload) => {\r\n const requestor = this.networkRequestor(uri, verb, headers, payload);\r\n\r\n if (window.__OVERREACT_DEVTOOLS__) {\r\n const { onRequest, onError } = window.__OVERREACT_DEVTOOLS__;\r\n const { componentName } = additionalParams;\r\n return requestor\r\n .then(value => {\r\n onRequest({\r\n id,\r\n uri,\r\n verb,\r\n headers,\r\n payload,\r\n spec: spec.toString(),\r\n componentName,\r\n responseValue: value,\r\n });\r\n return value;\r\n })\r\n .catch(ex => {\r\n onError({\r\n id,\r\n uri,\r\n verb,\r\n headers,\r\n payload,\r\n spec: spec.toString(),\r\n componentName,\r\n exception: ex,\r\n });\r\n\r\n throw ex;\r\n });\r\n }\r\n\r\n return requestor;\r\n };\r\n\r\n return (uri, verb, headers, payload) => ({\r\n execute: sink => {\r\n if (!this.middlewares || this.middlewares.length === 0) {\r\n requestorWithDevTools(uri, verb, headers, payload)\r\n .then(value => sink.onComplete(value))\r\n .catch(err => sink.onError(err));\r\n } else {\r\n const wrappedRequestor = new WrappedRequestor({\r\n requestor: requestorWithDevTools,\r\n uri,\r\n verb,\r\n headers,\r\n payload,\r\n spec,\r\n variables,\r\n store: this.store,\r\n dataRefId: id,\r\n middlewareStates,\r\n });\r\n const res = requestWithMiddleware(wrappedRequestor, this.middlewares);\r\n\r\n res\r\n .then(value => sink.onComplete(value))\r\n .catch(err => sink.onError(err));\r\n }\r\n },\r\n });\r\n }\r\n\r\n getSchema() {\r\n return this.schema;\r\n }\r\n\r\n notifyObservers() {\r\n for (let i = 0; i < this.dataFetcherSubscriber.length; i += 1) {\r\n this.dataFetcherSubscriber[i].notify(this.requestQueue);\r\n }\r\n }\r\n\r\n /*\r\n The request will have the following shape:\r\n\r\n {\r\n id,\r\n requestContract,\r\n spec,\r\n variables,\r\n data,\r\n dataCb,\r\n }\r\n */\r\n pushRequest(request) {\r\n this.requestQueue.push(request);\r\n\r\n this.notifyObservers();\r\n }\r\n\r\n removeRequest() {\r\n return this.requestQueue.shift();\r\n }\r\n\r\n requestCount() {\r\n return this.requestQueue.length;\r\n }\r\n\r\n subscribe(notifyCb) {\r\n this.dataFetcherSubscriber.push({\r\n notify: notifyCb,\r\n });\r\n\r\n return this.dataFetcherSubscriber.length - 1;\r\n }\r\n\r\n unsubscribe(id) {\r\n return this.dataFetcherSubscriber.splice(id, 1).length;\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { useContext } from 'react';\r\nimport { EnvironmentContext } from './context';\r\n\r\nexport function useEnvironment(environmentLookupFn) {\r\n const [environment, environments] = useContext(EnvironmentContext);\r\n if (_.isFunction(environmentLookupFn)) {\r\n const specificEnv = _.find(environments, env => env && env.tag && environmentLookupFn(env.tag));\r\n if (!_.isEmpty(specificEnv)) {\r\n return specificEnv;\r\n }\r\n }\r\n return environment || _.first(environments);\r\n}\r\n","export const requestVerbs = {\r\n GET: 'GET',\r\n POST: 'POST',\r\n DELETE: 'DELETE',\r\n PATCH: 'PATCH',\r\n PUT: 'PUT',\r\n};\r\n","export class RequestContract {\r\n constructor({\r\n schema,\r\n dataPath,\r\n verb,\r\n fetchPolicy,\r\n uriFactoryFn,\r\n headerFactoryFn,\r\n payloadFactoryFn,\r\n keySelector,\r\n parentKeySelector,\r\n }) {\r\n this.schema = schema;\r\n this.dataPath = dataPath;\r\n this.verb = verb;\r\n this.fetchPolicy = fetchPolicy;\r\n this.uriFactoryFn = uriFactoryFn;\r\n this.headerFactoryFn = headerFactoryFn;\r\n this.payloadFactoryFn = payloadFactoryFn;\r\n this.keySelector = keySelector;\r\n this.parentKeySelector = parentKeySelector;\r\n\r\n this.getSchemaNode = this.getSchemaNode.bind(this);\r\n }\r\n\r\n getSchemaNode() {\r\n // schema is the root of the schema tree that current app has built\r\n // need to either find an existing path in the tree,\r\n // or construct a new path in the tree\r\n\r\n // note that the schema tree is only a sub-tree (or more precisely a sub-graph)\r\n // of the original data schema, such as one found in OData.\r\n return this.schema.insert(this.dataPath);\r\n }\r\n}\r\n\r\nexport function createRequestContract({\r\n schema,\r\n dataPath,\r\n verb,\r\n fetchPolicy,\r\n uriFactoryFn,\r\n headerFactoryFn,\r\n payloadFactoryFn,\r\n keySelector,\r\n parentKeySelector,\r\n}) {\r\n if (!dataPath) {\r\n throw new Error('dataPath cannot be empty');\r\n }\r\n\r\n return new RequestContract({\r\n schema,\r\n dataPath,\r\n verb,\r\n fetchPolicy,\r\n uriFactoryFn,\r\n headerFactoryFn,\r\n payloadFactoryFn,\r\n keySelector,\r\n parentKeySelector,\r\n });\r\n}\r\n","import _ from 'underscore';\r\nimport { OVERREACT_ID_FIELD_NAME, createOverreactId } from '../../store/consts';\r\n\r\nexport function getSideEffectCacheStoreHelpers(environment) {\r\n const { store, schema: { schemaToModelMapping } } = environment;\r\n const tryMergeItemsToCacheStore = ({\r\n items,\r\n schemaName,\r\n itemKeySelector,\r\n parentSchemaName,\r\n parentId,\r\n }) => {\r\n const modelName = schemaToModelMapping[schemaName];\r\n const recordGroup = store.getRecordGroup(modelName);\r\n const keysInCache = recordGroup.records.map(r => itemKeySelector(r.data));\r\n const itemsToAdd = _.filter(items, item => !_.include(keysInCache, itemKeySelector(item)));\r\n const itemsToAddWithOverreactId = itemsToAdd.map(item => {\r\n const overreactId = createOverreactId(\r\n itemKeySelector(item),\r\n parentId,\r\n parentSchemaName,\r\n );\r\n\r\n return {\r\n rawData: item,\r\n [OVERREACT_ID_FIELD_NAME]: overreactId,\r\n };\r\n });\r\n recordGroup.addOrUpdateRecords(itemsToAddWithOverreactId);\r\n const ids = itemsToAddWithOverreactId.map(item => item[OVERREACT_ID_FIELD_NAME]);\r\n recordGroup.notify('entitiesCreated', ids);\r\n\r\n const itemsToMerge = _.filter(items, item => _.include(keysInCache, itemKeySelector(item)));\r\n const itemsMerged = itemsToMerge.map(itemToMerge => {\r\n const key = itemKeySelector(itemToMerge);\r\n const records = recordGroup.getRecordsByEntityKeys(itemKeySelector, [key]);\r\n\r\n return {\r\n rawData: {\r\n ...records[0].data,\r\n ...itemToMerge,\r\n },\r\n [OVERREACT_ID_FIELD_NAME]: records[0].id,\r\n };\r\n });\r\n recordGroup.addOrUpdateRecords(itemsMerged);\r\n };\r\n\r\n const tryDeleteItemsInCacheStore = ({\r\n keysToDelete,\r\n schemaName,\r\n itemKeySelector,\r\n }) => {\r\n const modelName = schemaToModelMapping[schemaName];\r\n const recordGroup = store.getRecordGroup(modelName);\r\n\r\n const recordsToRemove = recordGroup.getRecordsByEntityKeys(itemKeySelector, keysToDelete);\r\n const recordsIdsToRemove = recordsToRemove.map(r => r.id);\r\n\r\n recordGroup.deleteRecords(recordsIdsToRemove);\r\n recordGroup.notify('entitiesDeleted', recordsIdsToRemove);\r\n };\r\n\r\n return {\r\n tryMergeItemsToCacheStore,\r\n tryDeleteItemsInCacheStore,\r\n };\r\n}\r\n","/* eslint-disable no-console */\r\n/* eslint-disable max-len */\r\nimport { OVERREACT_ID_FIELD_NAME, createOverreactId } from '../store/consts';\r\nimport { specTypes } from './spec-types';\r\n\r\nimport fetchResponseHandler from './response-handler/fetch';\r\nimport mutationResponseHandler from './response-handler/mutation';\r\nimport refetchResponseHandler from './response-handler/refetch';\r\nimport errorResponseHandler from './response-handler/error';\r\n\r\nexport class ResponseContract {\r\n constructor({\r\n requestContract, responseType, keySelector, processorFn, errorConvertFn,\r\n }) {\r\n this.requestContract = requestContract;\r\n this.responseType = responseType;\r\n this.keySelector = keySelector;\r\n this.processorFn = processorFn;\r\n this.errorConvertFn = errorConvertFn;\r\n this.schemaNode = this.requestContract.getSchemaNode();\r\n\r\n this.selectKey = this.selectKey.bind(this);\r\n this.onGetResponse = this.onGetResponse.bind(this);\r\n this.onGetError = this.onGetError.bind(this);\r\n\r\n this.applyId = this.applyId.bind(this);\r\n }\r\n\r\n selectKey(variables) {\r\n return this.keySelector(variables);\r\n }\r\n\r\n applyId(entity, parentId) {\r\n // create a new OVERREACT_ID_FIELD,\r\n // this will be used to uniquely identify a Record instance.\r\n // Basically we'll append the entity's parent type and ID\r\n // to the ID of the entity itself, which will comes handy\r\n // during the clean-up if the parent entity is deleted.\r\n\r\n const overreactId = createOverreactId(\r\n this.keySelector(entity),\r\n parentId,\r\n this.schemaNode.parentNode.name,\r\n );\r\n\r\n return {\r\n rawData: entity,\r\n [OVERREACT_ID_FIELD_NAME]: overreactId,\r\n };\r\n }\r\n\r\n onGetResponse(environment, response, request) {\r\n let processedResponse = response;\r\n const { spec } = request;\r\n const { specType } = spec;\r\n\r\n if (!request.middlewareStates.isResponseFromStore && this.processorFn) {\r\n processedResponse = this.processorFn(response, request);\r\n }\r\n\r\n switch (specType) {\r\n case specTypes.FETCH:\r\n case specTypes.PAGINATION: {\r\n return fetchResponseHandler(environment, processedResponse, request)(this);\r\n }\r\n case specTypes.ADD:\r\n case specTypes.DELETE:\r\n case specTypes.MUTATION: {\r\n return mutationResponseHandler(environment, processedResponse, request)(this);\r\n }\r\n case specTypes.REFETCH: {\r\n return refetchResponseHandler(environment, processedResponse, request)(this);\r\n }\r\n default:\r\n return null;\r\n }\r\n }\r\n\r\n onGetError(environment, request, error) {\r\n return errorResponseHandler(environment, request, error)(this);\r\n }\r\n}\r\n\r\nexport function createResponseContract({\r\n requestContract,\r\n responseType,\r\n keySelector,\r\n processorFn,\r\n errorConvertFn,\r\n}) {\r\n return new ResponseContract({\r\n requestContract, responseType, keySelector, processorFn, errorConvertFn,\r\n });\r\n}\r\n","import _ from 'underscore';\r\nimport { getDataNode, createDataNode } from '../../store';\r\nimport { responseTypes } from '../response-types';\r\nimport { OVERREACT_ID_FIELD_NAME } from '../../store/consts';\r\nimport { getSideEffectCacheStoreHelpers } from './sideEffectFnHelper';\r\n\r\nexport default function handler(environment, processedResponse, request) {\r\n return context => {\r\n const { id: dataRefId, variables, spec } = request;\r\n const { locator } = variables;\r\n\r\n const { store } = environment;\r\n\r\n let dataNode = getDataNode(context.schemaNode);\r\n\r\n if (!dataNode) {\r\n dataNode = createDataNode(context.schemaNode, store);\r\n }\r\n\r\n const dataRef = dataNode.getDataRef(dataRefId);\r\n dataRef.clearError();\r\n\r\n const { descriptor, order } = locator;\r\n const { requestContract, sideEffectFn } = spec;\r\n const { parentKeySelector } = requestContract;\r\n let parentId = parentKeySelector ? parentKeySelector(variables) : undefined;\r\n let dataWithOverreactId = null;\r\n\r\n // after the response has been processed, it will either be\r\n // - a single entity\r\n // - an array of entities\r\n if (context.responseType === responseTypes.ENTITY) {\r\n if (!parentId && order.length > 1) {\r\n parentId = descriptor[order[order.length - 2]];\r\n }\r\n\r\n // step 1 - generate _overreact_id\r\n dataWithOverreactId = context.applyId(processedResponse, parentId);\r\n const overreactId = dataWithOverreactId[OVERREACT_ID_FIELD_NAME];\r\n\r\n // step 2 - add/merge _overreact_id to current dataRef\r\n dataRef.add(overreactId);\r\n\r\n // step 3 - insert the data into store, this will trigger callbacks\r\n // in data nodes, which will in turn trigger dataRef refresh.\r\n store.getRecordGroup(context.schemaNode.modelName)\r\n .addOrUpdateRecords([dataWithOverreactId], request);\r\n } else if (context.responseType === responseTypes.COLL) {\r\n // when requests for COLL, the parentId is the last element in the locator\r\n if (!parentId && order.length > 0) {\r\n parentId = descriptor[order[order.length - 1]];\r\n }\r\n dataWithOverreactId = processedResponse.map(entity => {\r\n const data = context.applyId(entity, parentId);\r\n const overreactId = data[OVERREACT_ID_FIELD_NAME];\r\n\r\n dataRef.add(overreactId);\r\n\r\n return data;\r\n });\r\n\r\n store.getRecordGroup(context.schemaNode.modelName)\r\n .addOrUpdateRecords(dataWithOverreactId, request);\r\n\r\n // when the return value is empty, we still need to notify the hook who trigger this call\r\n if (dataWithOverreactId.length === 0) {\r\n dataRef.notify('update', [], request);\r\n }\r\n }\r\n\r\n if (sideEffectFn && !_.isEmpty(dataWithOverreactId)) {\r\n const cacheStoreHelper = getSideEffectCacheStoreHelpers(environment);\r\n sideEffectFn(processedResponse, request, spec, cacheStoreHelper);\r\n }\r\n };\r\n}\r\n","import { responseTypes } from '../response-types';\r\nimport { specTypes } from '../spec-types';\r\nimport { getSideEffectCacheStoreHelpers } from './sideEffectFnHelper';\r\n\r\nexport default function handler(environment, processedResponse, request) {\r\n return context => {\r\n const { variables, dataCb, spec } = request;\r\n const { locator } = variables;\r\n const { requestContract, sideEffectFn } = spec;\r\n const { parentKeySelector } = requestContract;\r\n let parentId = parentKeySelector ? parentKeySelector(variables) : undefined;\r\n let dataWithOverreactId = null;\r\n\r\n const { descriptor, order } = locator;\r\n if (context.responseType === responseTypes.COLL || request.spec.specType === specTypes.ADD) {\r\n // when requests for COLL or create entity, the parentId is the last element in the locator\r\n if (!parentId && order.length > 0) {\r\n parentId = descriptor[order[order.length - 1]];\r\n }\r\n const responseArr = Array.isArray(processedResponse)\r\n ? processedResponse\r\n : [processedResponse];\r\n dataWithOverreactId = responseArr.map(entity => context.applyId(entity, parentId));\r\n\r\n dataCb(dataWithOverreactId, request);\r\n } else if (context.responseType === responseTypes.ENTITY) {\r\n if (!parentId && order.length > 1) {\r\n parentId = descriptor[order[order.length - 2]];\r\n }\r\n\r\n // step 1 - generate _overreact_id\r\n dataWithOverreactId = context.applyId(processedResponse, parentId);\r\n\r\n dataCb([dataWithOverreactId], request);\r\n } else if (context.responseType === responseTypes.NONE) {\r\n // TODO: we need to deal with DELETE\r\n dataCb(null, request);\r\n }\r\n\r\n if (sideEffectFn) {\r\n const cacheStoreHelper = getSideEffectCacheStoreHelpers(environment);\r\n sideEffectFn(processedResponse, request, spec, cacheStoreHelper);\r\n }\r\n };\r\n}\r\n","import { getDataNode, createDataNode } from '../../store';\r\nimport { responseTypes } from '../response-types';\r\nimport { OVERREACT_ID_FIELD_NAME } from '../../store/consts';\r\nimport { getSideEffectCacheStoreHelpers } from './sideEffectFnHelper';\r\n\r\nexport default function handler(environment, processedResponse, request) {\r\n return context => {\r\n const {\r\n id: dataRefId,\r\n variables,\r\n dataCb,\r\n spec,\r\n } = request;\r\n const { locator } = variables;\r\n const { store } = environment;\r\n\r\n let dataNode = getDataNode(context.schemaNode);\r\n\r\n if (!dataNode) {\r\n dataNode = createDataNode(context.schemaNode, store);\r\n }\r\n\r\n const dataRef = dataNode.getDataRef(dataRefId);\r\n dataRef.clear();\r\n\r\n const { descriptor, order } = locator;\r\n const { requestContract, sideEffectFn } = spec;\r\n const { parentKeySelector } = requestContract;\r\n let parentId = parentKeySelector ? parentKeySelector(variables) : undefined;\r\n let dataWithOverreactId = null;\r\n\r\n if (context.responseType === responseTypes.ENTITY) {\r\n if (!parentId && order.length > 1) {\r\n parentId = descriptor[order[order.length - 2]];\r\n }\r\n\r\n dataWithOverreactId = context.applyId(processedResponse, parentId);\r\n const overreactId = dataWithOverreactId[OVERREACT_ID_FIELD_NAME];\r\n\r\n dataRef.add(overreactId);\r\n\r\n store.getRecordGroup(context.schemaNode.modelName)\r\n .addOrUpdateRecords([dataWithOverreactId], request);\r\n\r\n dataCb(processedResponse, request);\r\n } else if (context.responseType === responseTypes.COLL) {\r\n if (!parentId && order.length > 0) {\r\n parentId = descriptor[order[order.length - 1]];\r\n }\r\n dataWithOverreactId = processedResponse.map(entity => {\r\n const data = context.applyId(entity, parentId);\r\n const overreactId = data[OVERREACT_ID_FIELD_NAME];\r\n\r\n dataRef.add(overreactId);\r\n\r\n return data;\r\n });\r\n\r\n store.getRecordGroup(context.schemaNode.modelName)\r\n .addOrUpdateRecords(dataWithOverreactId, request);\r\n\r\n // when the return value is empty, we still need to notify the hook who trigger this call\r\n if (dataWithOverreactId.length === 0) {\r\n dataRef.notify('update', [], request);\r\n }\r\n\r\n dataCb(processedResponse, request);\r\n }\r\n\r\n if (sideEffectFn) {\r\n const cacheStoreHelper = getSideEffectCacheStoreHelpers(environment);\r\n sideEffectFn(processedResponse, request, spec, cacheStoreHelper);\r\n }\r\n };\r\n}\r\n","import _ from 'underscore';\r\n\r\nimport { getDataNode, createDataNode } from '../../store';\r\n\r\nexport default function handler(environment, request, error) {\r\n return context => {\r\n const { id: dataRefId, errorCb } = request;\r\n\r\n const { store } = environment;\r\n\r\n let dataNode = getDataNode(context.schemaNode);\r\n\r\n if (!dataNode) {\r\n dataNode = createDataNode(context.schemaNode, store);\r\n }\r\n\r\n const dataRef = dataNode.getDataRef(dataRefId);\r\n dataRef.onError(error, request);\r\n\r\n if (_.isFunction(errorCb)) {\r\n errorCb(error, request);\r\n }\r\n };\r\n}\r\n","export function createSpec(\r\n requestContract,\r\n responseContract,\r\n specType,\r\n sideEffectFn,\r\n environmentLookupFn,\r\n) {\r\n // FIXME: only the basics. Need to create more based on specType\r\n return {\r\n requestContract,\r\n responseContract,\r\n specType,\r\n sideEffectFn,\r\n environmentLookupFn,\r\n };\r\n}\r\n","export class SchemaNode {\r\n constructor(name, modelName, parentNode, modelSchema) {\r\n this.name = name;\r\n this.childNodes = [];\r\n this.parentNode = parentNode;\r\n this.modelName = modelName;\r\n this.modelSchema = modelSchema;\r\n\r\n // extensions will serve as an extension point\r\n // where we can attach arbitrary information to\r\n // a schema node.\r\n // this is useful when we want to extend the schema\r\n // tree to include data.\r\n this.extensions = {};\r\n\r\n this.append = this.append.bind(this);\r\n this.setExtension = this.setExtension.bind(this);\r\n this.getExtension = this.getExtension.bind(this);\r\n }\r\n\r\n append(node) {\r\n this.childNodes.push(node);\r\n }\r\n\r\n setExtension(name, ext) {\r\n this.extensions[name] = ext;\r\n }\r\n\r\n getExtension(name) {\r\n return this.extensions[name];\r\n }\r\n\r\n toJson() {\r\n return ({\r\n name: this.name,\r\n modelName: this.modelName,\r\n // modelSchema: this.modelSchema, Can contain non-serializable properties\r\n childNodes: this.childNodes.length > 0 ? this.childNodes.map(c => c.toJson()) : undefined,\r\n extensions: Object.keys(this.extensions).length > 0\r\n ? Object.keys(this.extensions).map(k => this.extensions[k].toJson()) : undefined,\r\n });\r\n }\r\n}\r\n","import { SchemaNode } from './schema-node';\r\n\r\nconst PATH_DELIMITER = ':';\r\n\r\nexport class Schema {\r\n constructor(schemaToModelMapping, modelGetter) {\r\n this.root = new SchemaNode('$ROOT', null, null);\r\n this.schemaToModelMapping = schemaToModelMapping;\r\n this.modelGetter = modelGetter;\r\n\r\n this.modelToSchemaMapping = {};\r\n\r\n this.buildModelToSchemaMap();\r\n\r\n this.insert = this.insert.bind(this);\r\n this.getSchemaNames = this.getSchemaNames.bind(this);\r\n }\r\n\r\n buildModelToSchemaMap() {\r\n const keys = Object.keys(this.schemaToModelMapping);\r\n keys.forEach(schemaName => {\r\n const modelName = this.schemaToModelMapping[schemaName];\r\n if (!this.modelToSchemaMapping[modelName]) {\r\n this.modelToSchemaMapping[modelName] = [];\r\n }\r\n this.modelToSchemaMapping[modelName].push(schemaName);\r\n });\r\n }\r\n\r\n getSchemaNames(modelName) {\r\n return this.modelToSchemaMapping[modelName];\r\n }\r\n\r\n insert(path) {\r\n const parts = path.split(PATH_DELIMITER);\r\n let currentNode = this.root;\r\n\r\n for (let i = 0; i < parts.length; i += 1) {\r\n const partName = parts[i];\r\n\r\n let existingPathFound = false;\r\n for (let j = 0; j < currentNode.childNodes.length; j += 1) {\r\n const t = currentNode.childNodes[j];\r\n if (t.name === partName) {\r\n currentNode = t;\r\n existingPathFound = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!existingPathFound) {\r\n const modelName = this.schemaToModelMapping[partName];\r\n if (!modelName) {\r\n throw new Error(`Model name not found for schema name(data path) ${partName}`);\r\n }\r\n const modelSchema = this.modelGetter(this.schemaToModelMapping[partName]);\r\n const newNode = new SchemaNode(partName, modelName, currentNode, modelSchema);\r\n\r\n currentNode.childNodes.push(newNode);\r\n currentNode = newNode;\r\n }\r\n }\r\n\r\n if (window.__OVERREACT_DEVTOOLS__) {\r\n const { getSchema } = window.__OVERREACT_DEVTOOLS__;\r\n\r\n getSchema(this.root.toJson());\r\n }\r\n\r\n return currentNode;\r\n }\r\n}\r\n","export class OverreactRequest {\r\n constructor(options) {\r\n Object.assign(this, options);\r\n\r\n if (!this.id || !this.requestContract) {\r\n throw new Error('id and requestContract are required fields to build request object');\r\n }\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { getRecordGroup } from '../store';\r\n\r\nexport function getCacheIds({\r\n store,\r\n requestContract,\r\n variables,\r\n lookupFn,\r\n}) {\r\n const recordGroup = getRecordGroup(store, requestContract);\r\n const { records } = recordGroup;\r\n const cacheRawItems = _.map(records, record => record.data);\r\n const cacheHit = lookupFn(cacheRawItems, variables);\r\n const overreactIds = _.chain(_.flatten([cacheHit], true))\r\n .map(data => {\r\n const record = _.find(records, r => r.data === data);\r\n return record ? record.id : undefined;\r\n })\r\n .compact()\r\n .value();\r\n\r\n return overreactIds;\r\n}\r\n","import _ from 'underscore';\r\nimport { responseTypes } from '../spec';\r\nimport { FetchPolicy } from '../middleware';\r\n\r\nexport function getDataFromRecords(records, responseContract) {\r\n const values = _.map(records, record => record.getData());\r\n return responseContract.responseType === responseTypes.COLL ? values : values[0];\r\n}\r\n\r\nfunction getDefaultLookupCacheFn(varKeySelector, dataKeySelector) {\r\n return (items, variables) => _.find(items,\r\n item => dataKeySelector(item) === varKeySelector(variables));\r\n}\r\n\r\nexport function getLookupCacheFn(lookupCacheFn, spec, fetchPolicy) {\r\n const { requestContract, responseContract } = spec;\r\n if (fetchPolicy === FetchPolicy.StoreOrNetwork) {\r\n if (lookupCacheFn) {\r\n return lookupCacheFn;\r\n }\r\n\r\n if (_.isFunction(requestContract.keySelector)\r\n && _.isFunction(responseContract.keySelector)\r\n && responseContract.responseType === responseTypes.ENTITY) {\r\n return getDefaultLookupCacheFn(requestContract.keySelector, responseContract.keySelector);\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n","import { useMemo } from 'react';\r\n\r\n/* eslint-disable no-continue */\r\nexport function useComponent() {\r\n // TODO: Detect DEBUG mode\r\n return useMemo(() => {\r\n try {\r\n throw new Error('fake error');\r\n } catch (ex) {\r\n const { stack } = ex;\r\n const stacks = stack.split('\\n');\r\n\r\n for (let i = 0; i < stacks.length; i += 1) {\r\n if (i === 0) {\r\n // first line will be 'Error: fake error'\r\n continue;\r\n }\r\n\r\n // a typical stack line looks like this:\r\n // \"at useComponent (webpack://1:2:3)\"\r\n const stackSegs = stacks[i].trim().split(' ');\r\n\r\n // we only need the 2nd segment, which is the function name\r\n const funcName = stackSegs[1] || '';\r\n\r\n // we'll ignore anything that is a React hook\r\n if (!funcName\r\n || funcName === 'eval'\r\n || funcName === 'mountMemo'\r\n || funcName === 'Object.useMemo'\r\n || funcName.startsWith('use')) {\r\n continue;\r\n }\r\n\r\n // we'll return on the first non-hook function name, which is most likely\r\n // to be our calling component name;\r\n return funcName;\r\n }\r\n }\r\n\r\n return '__noname__';\r\n }, []);\r\n}\r\n","import _ from 'underscore';\r\nimport {\r\n useRef, useReducer, useCallback, useMemo, useEffect,\r\n} from 'react';\r\nimport { useEnvironment } from '../environment';\r\nimport { useDeepEqualEffect, useDeepMemo } from '../utils/primitive-utilities';\r\nimport {\r\n getDataNode, createDataNode, getRecords, getDataRef, getRecordsById, updateDataRefWithIds,\r\n} from '../store';\r\nimport { OverreactRequest } from './overreact-request';\r\nimport { getCacheIds } from './lookup-cache';\r\nimport { getDataFromRecords, getLookupCacheFn } from './helper';\r\nimport { useComponent } from './use-component';\r\n\r\nexport function equalityFn(newData, oldData) {\r\n return _.isEqual(newData, oldData);\r\n}\r\n\r\nexport function useFetch(dataRefId, spec, variables, config) {\r\n // DEBUG ONLY\r\n const componentName = useComponent();\r\n const memoedConfig = useDeepMemo(config);\r\n\r\n const {\r\n requestContract,\r\n responseContract,\r\n environmentLookupFn,\r\n } = spec;\r\n\r\n const requestRequired = useRef(true);\r\n const currentData = useRef(undefined);\r\n const currentError = useRef(undefined);\r\n\r\n const [, forceRender] = useReducer(x => x + 1, 0);\r\n\r\n const environment = useEnvironment(environmentLookupFn);\r\n const { postponeRead, lookupCacheByVariables } = memoedConfig || {};\r\n const { options: { fetchPolicy: fetchPolicyInReq } = {} } = variables || {};\r\n const fetchPolicy = fetchPolicyInReq || requestContract.fetchPolicy;\r\n\r\n const lookupFn = useMemo(\r\n () => getLookupCacheFn(lookupCacheByVariables, spec, fetchPolicy),\r\n [fetchPolicy, lookupCacheByVariables, spec],\r\n );\r\n\r\n // TODO: dataCallback shall take a param, which is a set of\r\n // overreact IDs, to efficiently compare data and force render\r\n const dataCallback = useCallback(() => {\r\n // fetch data from store\r\n if (environment) {\r\n const { store } = environment;\r\n\r\n const records = getRecords(store, requestContract, dataRefId);\r\n const dataRef = getDataRef(store, requestContract, dataRefId);\r\n dataRef.registerComponent({ componentName });\r\n\r\n if (records) {\r\n const data = getDataFromRecords(records, responseContract);\r\n if (equalityFn(data, currentData.current)) {\r\n return;\r\n }\r\n\r\n currentData.current = data;\r\n\r\n forceRender();\r\n }\r\n }\r\n }, [componentName, dataRefId, environment, requestContract, responseContract]);\r\n\r\n const errorCallback = useCallback(() => {\r\n if (environment) {\r\n const { store } = environment;\r\n\r\n const dataRef = getDataRef(store, requestContract, dataRefId);\r\n const {\r\n status: {\r\n error,\r\n } = {},\r\n } = dataRef;\r\n\r\n if (equalityFn(error, currentError.current)) {\r\n return;\r\n }\r\n\r\n currentError.current = error;\r\n forceRender();\r\n }\r\n }, [dataRefId, environment, requestContract]);\r\n\r\n const dataObserver = useMemo(() => ({\r\n update: dataCallback,\r\n onError: errorCallback,\r\n }), [dataCallback, errorCallback]);\r\n\r\n useEffect(() => {\r\n if (environment) {\r\n const schemaNode = requestContract.getSchemaNode();\r\n const { store } = environment;\r\n const dataNode = getDataNode(schemaNode) || createDataNode(schemaNode, store);\r\n const dataRef = dataNode.getDataRef(dataRefId);\r\n dataRef.subscribe(dataObserver);\r\n\r\n return () => dataRef.unsubscribe(dataObserver);\r\n }\r\n return _.noop;\r\n }, [dataObserver, dataRefId, environment, requestContract]);\r\n\r\n useEffect(() => {\r\n if (environment && !currentData.current && _.isFunction(lookupFn)) {\r\n const schemaNode = requestContract.getSchemaNode();\r\n const { store } = environment;\r\n const dataNode = getDataNode(schemaNode) || createDataNode(schemaNode, store);\r\n const dataRef = dataNode.getDataRef(dataRefId);\r\n\r\n try {\r\n const overreactIds = getCacheIds({\r\n store,\r\n requestContract,\r\n variables,\r\n lookupFn,\r\n });\r\n\r\n if (!_.isEmpty(overreactIds)) {\r\n updateDataRefWithIds(dataRef, overreactIds);\r\n const records = getRecordsById(store, requestContract, overreactIds);\r\n currentData.current = getDataFromRecords(records, responseContract);\r\n requestRequired.current = false;\r\n forceRender();\r\n }\r\n } catch (error) {\r\n // TODO: log error and send request\r\n }\r\n }\r\n // we only try hit cache once when environment is ready\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [environment]);\r\n\r\n useDeepEqualEffect(() => {\r\n if (requestRequired.current && environment) {\r\n if (!postponeRead) {\r\n const request = new OverreactRequest({\r\n id: dataRefId,\r\n requestContract,\r\n spec,\r\n variables,\r\n data: null,\r\n componentName,\r\n });\r\n environment.pushRequest(request);\r\n }\r\n requestRequired.current = false;\r\n }\r\n // TODO: need to unregister this request\r\n }, [dataCallback, environment, requestContract, spec, variables]);\r\n\r\n return [currentData.current, currentError.current];\r\n}\r\n","import { isFunction } from 'underscore';\r\n\r\nexport function getMergedConfig(config, origin) {\r\n // create new instance of origin, origin is also required to be an object\r\n const newInstance = { ...origin };\r\n\r\n if (!config) {\r\n return newInstance;\r\n }\r\n\r\n if (isFunction(config)) {\r\n return config(newInstance);\r\n }\r\n\r\n return {\r\n ...origin,\r\n ...config,\r\n };\r\n}\r\n","import _ from 'underscore';\r\nimport { useCallback, useRef } from 'react';\r\nimport { useEnvironment } from '../environment';\r\nimport {\r\n getRecords, getDataRef, getRecordGroup, getRecordsByEntityKey,\r\n} from '../store';\r\nimport { specTypes } from '../spec/spec-types';\r\nimport { OVERREACT_ID_FIELD_NAME } from '../store/consts';\r\nimport { responseTypes } from '../spec/response-types';\r\nimport { OverreactRequest } from './overreact-request';\r\nimport { getMergedConfig } from './merge-config';\r\nimport { useDeepMemo } from '../utils/primitive-utilities';\r\n\r\nimport { useComponent } from './use-component';\r\n\r\nconst getRawData = data => data && _.map(data, d => d.rawData);\r\n\r\nconst getDataWithOverreactIdFromRecords = records => _.map(records, r => ({\r\n rawData: r.getData(),\r\n [OVERREACT_ID_FIELD_NAME]: r.id,\r\n}));\r\n\r\nfunction mutateRecords(\r\n store,\r\n requestContract,\r\n recordsBeforeMutation,\r\n newRecords,\r\n) {\r\n if (store) {\r\n const recordGroup = getRecordGroup(store, requestContract);\r\n\r\n recordGroup.addOrUpdateRecords(recordsBeforeMutation);\r\n recordGroup.addOrUpdateRecords(newRecords);\r\n }\r\n}\r\n\r\nfunction addRecords(\r\n store,\r\n requestContract,\r\n records,\r\n) {\r\n if (store && records && records.length > 0) {\r\n const recordGroup = getRecordGroup(store, requestContract);\r\n recordGroup.addOrUpdateRecords(records);\r\n const ids = records.map(record => record[OVERREACT_ID_FIELD_NAME]);\r\n\r\n // notify hooks, so that they can adjust the refIds accordingly\r\n recordGroup.notify('entitiesCreated', ids);\r\n }\r\n}\r\n\r\nfunction deleteRecords(store, requestContract, records = []) {\r\n if (store) {\r\n const recordGroup = getRecordGroup(store, requestContract);\r\n const ids = records.map(record => record[OVERREACT_ID_FIELD_NAME]);\r\n\r\n recordGroup.deleteRecords(ids);\r\n recordGroup.notify('entitiesDeleted', ids);\r\n }\r\n}\r\n\r\nfunction addPreemptiveRecords(store, requestContract, request, records) {\r\n if (store) {\r\n store.addPreemptiveRecords(request, records);\r\n addRecords(store, requestContract, records);\r\n }\r\n}\r\n\r\nfunction replacePreemptiveRecords(store, requestContract, request, records) {\r\n const preemptiveRecords = store.removePreemptiveRecords(request);\r\n deleteRecords(store, requestContract, preemptiveRecords);\r\n addRecords(store, requestContract, records);\r\n}\r\n\r\nfunction applyId(variables, spec, data, specType) {\r\n const { locator } = variables;\r\n const { requestContract, responseContract } = spec;\r\n const { parentKeySelector } = requestContract;\r\n let parentId = parentKeySelector ? parentKeySelector(variables) : undefined;\r\n\r\n const { descriptor, order } = locator;\r\n\r\n if (responseContract.responseType === responseTypes.COLL || specType === specTypes.ADD) {\r\n // when requests for COLL or create entity, the parentId is the last element in the locator\r\n if (!parentId && order.length > 0) {\r\n parentId = descriptor[order[order.length - 1]];\r\n }\r\n const dataArr = Array.isArray(data) ? data : [data];\r\n return dataArr.map(entity => responseContract.applyId(entity, parentId));\r\n }\r\n\r\n if (responseContract.responseType === responseTypes.ENTITY) {\r\n if (!parentId && order.length > 1) {\r\n parentId = descriptor[order[order.length - 2]];\r\n }\r\n\r\n // step 1 - generate _overreact_id\r\n return responseContract.applyId(data, parentId);\r\n }\r\n\r\n throw new Error('unknown response type, cannot apply id');\r\n}\r\n\r\nexport function useMutation(dataRefId, spec, config) {\r\n // DEBUG ONLY\r\n const componentName = useComponent();\r\n const memoedConfig = useDeepMemo(config);\r\n\r\n const {\r\n requestContract,\r\n responseContract,\r\n specType,\r\n environmentLookupFn,\r\n } = spec;\r\n const recordsBeforeMutationRef = useRef();\r\n const environment = useEnvironment(environmentLookupFn);\r\n\r\n const dataCallback = useCallback((dataWithOverreactId, request) => {\r\n if (environment) {\r\n const { store } = environment;\r\n const dataRef = getDataRef(store, requestContract, dataRefId);\r\n dataRef.clearError();\r\n\r\n const {\r\n onComplete,\r\n preemptiveResponseFn,\r\n } = (request && request.mergedConfig) || {};\r\n\r\n if (preemptiveResponseFn) {\r\n if (specType === specTypes.MUTATION) {\r\n const recordsBeforeMutation = recordsBeforeMutationRef.current || [];\r\n const dataBeforeWithId = getDataWithOverreactIdFromRecords(recordsBeforeMutation);\r\n mutateRecords(\r\n store,\r\n requestContract,\r\n dataBeforeWithId,\r\n dataWithOverreactId,\r\n );\r\n } else if (specType === specTypes.ADD) {\r\n replacePreemptiveRecords(\r\n store,\r\n requestContract,\r\n request,\r\n dataWithOverreactId,\r\n );\r\n }\r\n } else if (specType === specTypes.ADD) {\r\n addRecords(store, requestContract, dataWithOverreactId);\r\n } else if (specType === specTypes.MUTATION) {\r\n mutateRecords(\r\n store,\r\n requestContract,\r\n [],\r\n dataWithOverreactId,\r\n );\r\n }\r\n\r\n if (specType === specTypes.DELETE) {\r\n const { data } = request;\r\n const dataArray = Array.isArray(data) ? data : [data];\r\n const { keySelector } = responseContract;\r\n const keys = dataArray.map(d => keySelector(d));\r\n const records = getRecordsByEntityKey(store, spec, keys);\r\n const dataWithId = getDataWithOverreactIdFromRecords(records);\r\n\r\n deleteRecords(store, requestContract, dataWithId);\r\n }\r\n\r\n const data = getRawData(dataWithOverreactId);\r\n\r\n if (onComplete) {\r\n onComplete(data);\r\n }\r\n }\r\n }, [dataRefId, environment, requestContract, responseContract, spec, specType]);\r\n\r\n const errorCallback = useCallback((error, request) => {\r\n if (environment) {\r\n const { store } = environment;\r\n const {\r\n onError,\r\n preemptiveResponseFn,\r\n } = (request && request.mergedConfig) || {};\r\n\r\n const recordsBeforeMutation = recordsBeforeMutationRef.current || [];\r\n const dataBeforeWithId = getDataWithOverreactIdFromRecords(recordsBeforeMutation);\r\n\r\n if (preemptiveResponseFn) {\r\n if (specType === specTypes.MUTATION) {\r\n mutateRecords(\r\n store,\r\n requestContract,\r\n dataBeforeWithId,\r\n [],\r\n );\r\n } else if (specType === specTypes.ADD) {\r\n replacePreemptiveRecords(\r\n store,\r\n requestContract,\r\n request,\r\n [],\r\n );\r\n }\r\n }\r\n\r\n if (onError) {\r\n onError(error);\r\n }\r\n }\r\n }, [environment, requestContract, specType]);\r\n\r\n const mutateFn = useCallback((variables, mutationData, ...rest) => {\r\n if (environment) {\r\n const { store } = environment;\r\n const requestConfig = rest.slice(-1)[0];\r\n const mergedConfig = getMergedConfig(requestConfig, memoedConfig);\r\n const { preemptiveResponseFn } = mergedConfig;\r\n\r\n // stash current value. This will be useful when preemptive updates is enabled,\r\n // and we need to revert to original state before applying actual response from server.\r\n if (dataRefId) {\r\n const recordsBeforeMutation = getRecords(store, requestContract, dataRefId);\r\n if (recordsBeforeMutation) {\r\n recordsBeforeMutationRef.current = recordsBeforeMutation;\r\n }\r\n }\r\n\r\n const request = new OverreactRequest({\r\n id: dataRefId,\r\n requestContract,\r\n spec,\r\n variables,\r\n data: mutationData,\r\n dataCb: dataCallback,\r\n errorCb: errorCallback,\r\n mergedConfig,\r\n componentName,\r\n });\r\n\r\n // we can perform preemptive updates right now (before actual request)\r\n // the store will be reverted/merged with response in data callbacks - when the response\r\n // comes back.\r\n if (preemptiveResponseFn) {\r\n if (specType === specTypes.MUTATION) {\r\n const recordsBeforeMutation = recordsBeforeMutationRef.current || [];\r\n const dataBeforeWithId = getDataWithOverreactIdFromRecords(recordsBeforeMutation);\r\n const dataBefore = _.map(dataBeforeWithId, d => d.rawData);\r\n const preemptiveData = preemptiveResponseFn(dataBefore, mutationData);\r\n\r\n const { keySelector } = responseContract;\r\n const dataWithOverreactId = _.map(preemptiveData, d => {\r\n const key = keySelector(d);\r\n const [record] = getRecordsByEntityKey(store, spec, [key]);\r\n return {\r\n rawData: d,\r\n [OVERREACT_ID_FIELD_NAME]: record.id,\r\n };\r\n });\r\n\r\n mutateRecords(\r\n store,\r\n requestContract,\r\n dataBeforeWithId,\r\n dataWithOverreactId,\r\n );\r\n } else if (specType === specTypes.ADD) {\r\n const data = preemptiveResponseFn(mutationData);\r\n const records = applyId(request.variables, spec, data, specType);\r\n addPreemptiveRecords(\r\n store,\r\n requestContract,\r\n request,\r\n records,\r\n );\r\n }\r\n }\r\n\r\n // Register the request to be issued - in this implementation the request will go to the\r\n // request queue in DataFetcher, waiting to be invoked. So one shall not assume\r\n // the request will go out immediately.\r\n environment.pushRequest(request);\r\n }\r\n }, [\r\n componentName,\r\n dataCallback,\r\n dataRefId,\r\n environment,\r\n errorCallback,\r\n memoedConfig,\r\n requestContract,\r\n responseContract,\r\n spec,\r\n specType,\r\n ]);\r\n\r\n return mutateFn;\r\n}\r\n","import _ from 'underscore';\r\nimport { useCallback } from 'react';\r\nimport { useEnvironment } from '../environment';\r\nimport { getRecords, getDataRef, updateDataRefWithIds } from '../store';\r\nimport { OverreactRequest } from './overreact-request';\r\nimport { getMergedConfig } from './merge-config';\r\nimport { getCacheIds } from './lookup-cache';\r\nimport { getDataFromRecords, getLookupCacheFn } from './helper';\r\nimport { useDeepMemo } from '../utils/primitive-utilities';\r\n\r\nimport { useComponent } from './use-component';\r\n\r\nexport function useRefetch(dataRefId, spec, config) {\r\n // DEBUG ONLY\r\n const componentName = useComponent();\r\n const memoedConfig = useDeepMemo(config);\r\n\r\n const {\r\n requestContract,\r\n responseContract,\r\n environmentLookupFn,\r\n } = spec;\r\n const environment = useEnvironment(environmentLookupFn);\r\n\r\n const dataCallback = useCallback((dataItems, request) => {\r\n if (environment) {\r\n const {\r\n onComplete,\r\n } = (request && request.mergedConfig) || {};\r\n\r\n const { store } = environment;\r\n const records = getRecords(store, requestContract, dataRefId);\r\n const data = getDataFromRecords(records, responseContract);\r\n\r\n if (onComplete) {\r\n onComplete(data);\r\n }\r\n }\r\n }, [dataRefId, environment, requestContract, responseContract]);\r\n\r\n const errorCallback = useCallback((error, request) => {\r\n const {\r\n onError = _.noop,\r\n } = (request && request.mergedConfig) || {};\r\n onError(error);\r\n }, []);\r\n\r\n const refetchFn = useCallback((parameter, ...rest) => {\r\n if (environment) {\r\n const { store } = environment;\r\n const requestConfig = rest.slice(-1)[0];\r\n const mergedConfig = getMergedConfig(requestConfig, memoedConfig);\r\n const { lookupCacheByVariables } = mergedConfig;\r\n\r\n const {\r\n variables,\r\n payload,\r\n } = parameter;\r\n const { options: { fetchPolicy: fetchPolicyInReq } = {} } = variables || {};\r\n const fetchPolicy = fetchPolicyInReq || requestContract.fetchPolicy;\r\n\r\n const request = new OverreactRequest({\r\n id: dataRefId,\r\n requestContract,\r\n spec,\r\n variables,\r\n data: payload,\r\n dataCb: dataCallback,\r\n errorCb: errorCallback,\r\n mergedConfig,\r\n componentName,\r\n });\r\n\r\n const lookupFn = getLookupCacheFn(lookupCacheByVariables, spec, fetchPolicy);\r\n\r\n if (_.isFunction(lookupFn)) {\r\n try {\r\n const overreactIds = getCacheIds({\r\n store,\r\n requestContract,\r\n variables,\r\n lookupFn,\r\n });\r\n\r\n if (!_.isEmpty(overreactIds)) {\r\n const dataRef = getDataRef(store, requestContract, dataRefId);\r\n\r\n updateDataRefWithIds(dataRef, overreactIds);\r\n\r\n const records = getRecords(store, requestContract, dataRefId);\r\n const data = getDataFromRecords(records, responseContract);\r\n\r\n dataCallback(data, request);\r\n\r\n return;\r\n }\r\n } catch (error) {\r\n // TODO: log error and send request\r\n }\r\n }\r\n environment.pushRequest(request);\r\n }\r\n }, [\r\n componentName,\r\n dataCallback,\r\n dataRefId,\r\n environment,\r\n errorCallback,\r\n memoedConfig,\r\n requestContract,\r\n responseContract,\r\n spec,\r\n ]);\r\n\r\n return refetchFn;\r\n}\r\n","import _ from 'underscore';\r\nimport {\r\n useState, useCallback, useMemo, useRef, useEffect,\r\n} from 'react';\r\n\r\nimport { useEnvironment } from '../environment';\r\nimport {\r\n getDataNode, createDataNode, getRecords, getDataRef, getRecordsById, updateDataRefWithIds,\r\n getRecordsFromResponseDataArray,\r\n} from '../store';\r\nimport { OverreactRequest } from './overreact-request';\r\nimport { getMergedConfig } from './merge-config';\r\nimport { getLookupCacheFn } from './helper';\r\nimport { getCacheIds } from './lookup-cache';\r\nimport { useDeepMemo } from '../utils/primitive-utilities';\r\n\r\nimport { useComponent } from './use-component';\r\n\r\nconst getRecordsDataInDataRef = (store, requestContract, dataRefId) => {\r\n const records = getRecords(store, requestContract, dataRefId);\r\n\r\n return records && records.map(record => record.getData());\r\n};\r\n\r\nconst getRecordsDataById = (store, requestContract, ids) => {\r\n const records = getRecordsById(store, requestContract, ids);\r\n return records && records.map(record => record.getData());\r\n};\r\n\r\nexport function usePagination(dataRefId, spec, config) {\r\n // DEBUG ONLY\r\n const componentName = useComponent();\r\n const memoedConfig = useDeepMemo(config);\r\n\r\n const {\r\n fetchVariables,\r\n strictMode = false,\r\n mergeNewRecords,\r\n lookupCacheByVariables,\r\n } = memoedConfig;\r\n const refId = useRef(dataRefId);\r\n const { requestContract, environmentLookupFn } = spec;\r\n\r\n const cursorIndex = useRef(0);\r\n const loadingId = useRef(null);\r\n const [isLoading, setIsLoading] = useState(false);\r\n const environment = useEnvironment(environmentLookupFn);\r\n\r\n const [data, setData] = useState(undefined);\r\n const [error, setError] = useState(undefined);\r\n\r\n const resetInternalState = useCallback(() => {\r\n loadingId.current = null;\r\n setIsLoading(false);\r\n cursorIndex.current = 0;\r\n }, []);\r\n\r\n if (refId.current !== dataRefId) {\r\n refId.current = dataRefId;\r\n resetInternalState();\r\n }\r\n\r\n const setInternalStateOnResponse = useCallback(records => {\r\n cursorIndex.current = records.length;\r\n }, []);\r\n\r\n // using registerRequest to fire request, we cannot get the total count\r\n // so we set it to true for now\r\n const hasMore = useCallback(() => true, []);\r\n\r\n const loadMoreCallback = useCallback((__, updatedIds, request) => {\r\n const { store } = environment;\r\n const recordsData = getRecordsDataInDataRef(store, requestContract, dataRefId);\r\n const dataRef = getDataRef(store, requestContract, dataRefId);\r\n dataRef.clearError();\r\n setInternalStateOnResponse(recordsData);\r\n setData(recordsData);\r\n\r\n // setData first, then setIsLoading as false\r\n loadingId.current = null;\r\n setIsLoading(false);\r\n\r\n dataRef.registerComponent({ componentName });\r\n\r\n const {\r\n onComplete,\r\n } = (request && request.mergedConfig) || {};\r\n\r\n if (onComplete && request.id === dataRefId) {\r\n onComplete(recordsData);\r\n }\r\n }, [componentName, dataRefId, environment, requestContract, setInternalStateOnResponse]);\r\n\r\n const onErrorCallback = useCallback((__, err, request) => {\r\n if (environment) {\r\n const { store } = environment;\r\n\r\n const dataRef = getDataRef(store, requestContract, dataRefId);\r\n const {\r\n status: {\r\n error: currentError,\r\n } = {},\r\n } = dataRef;\r\n\r\n if (currentError) {\r\n loadingId.current = null;\r\n setIsLoading(false);\r\n }\r\n setError(currentError);\r\n\r\n const {\r\n onError,\r\n } = (request && request.mergedConfig) || {};\r\n\r\n if (onError && request.id === dataRefId && !_.isUndefined(err)) {\r\n onError(err);\r\n }\r\n }\r\n }, [dataRefId, environment, requestContract]);\r\n\r\n const onEntitiesCreated = useCallback((dataRef, newIds) => {\r\n if (_.isFunction(mergeNewRecords)) {\r\n const { store } = environment;\r\n const records = getRecordsDataInDataRef(store, requestContract, dataRefId);\r\n const newRecords = getRecordsDataById(store, requestContract, newIds);\r\n const recordsToShow = mergeNewRecords(records, newRecords);\r\n const storeRecordsToShow = getRecordsFromResponseDataArray(store, spec, recordsToShow);\r\n const overreactIds = _.map(storeRecordsToShow, r => r.id);\r\n\r\n dataRef.reset(overreactIds);\r\n }\r\n }, [dataRefId, environment, mergeNewRecords, requestContract, spec]);\r\n\r\n const dataObserver = useMemo(() => ({\r\n update: loadMoreCallback,\r\n onError: onErrorCallback,\r\n onEntitiesCreated,\r\n }), [loadMoreCallback, onEntitiesCreated, onErrorCallback]);\r\n\r\n useEffect(() => {\r\n if (environment) {\r\n const schemaNode = requestContract.getSchemaNode();\r\n const { store } = environment;\r\n const dataNode = getDataNode(schemaNode) || createDataNode(schemaNode, store);\r\n const dataRef = dataNode.getDataRef(dataRefId);\r\n dataRef.subscribe(dataObserver);\r\n\r\n return () => dataRef.unsubscribe(dataObserver);\r\n }\r\n return _.noop;\r\n }, [dataObserver, dataRefId, environment, requestContract]);\r\n\r\n const loadMore = useCallback(requestConfig => {\r\n if (loadingId.current) {\r\n return;\r\n }\r\n\r\n if (!environment) {\r\n return;\r\n }\r\n const { pageSize, options: { fetchPolicy: fetchPolicyInReq } = {} } = fetchVariables;\r\n const { store } = environment;\r\n const recordsData = getRecordsDataInDataRef(store, requestContract, dataRefId);\r\n const mergedConfig = getMergedConfig(requestConfig, memoedConfig);\r\n\r\n if (recordsData && recordsData.length >= cursorIndex.current + pageSize) {\r\n cursorIndex.current = recordsData.length;\r\n setData(recordsData);\r\n if (mergedConfig && mergedConfig.onComplete) {\r\n mergedConfig.onComplete(recordsData);\r\n }\r\n\r\n return;\r\n }\r\n\r\n const fetchPolicy = fetchPolicyInReq || requestContract.fetchPolicy;\r\n const lookupFn = getLookupCacheFn(lookupCacheByVariables, spec, fetchPolicy);\r\n\r\n if (_.isFunction(lookupFn)) {\r\n try {\r\n const overreactIds = getCacheIds({\r\n store,\r\n requestContract,\r\n variables: fetchVariables,\r\n lookupFn,\r\n });\r\n\r\n if (!_.isEmpty(overreactIds)) {\r\n const dataRef = getDataRef(store, requestContract, dataRefId);\r\n\r\n updateDataRefWithIds(dataRef, overreactIds);\r\n\r\n return;\r\n }\r\n } catch (err) {\r\n // TODO: log error and send request\r\n }\r\n }\r\n\r\n const requestVars = {\r\n ...fetchVariables,\r\n cursorIndex: strictMode\r\n ? cursorIndex.current - (cursorIndex.current % pageSize)\r\n : cursorIndex.current,\r\n };\r\n\r\n const myId = _.uniqueId();\r\n\r\n loadingId.current = myId;\r\n setIsLoading(true);\r\n\r\n const request = new OverreactRequest({\r\n id: dataRefId,\r\n requestContract,\r\n spec,\r\n variables: requestVars,\r\n data: null,\r\n mergedConfig,\r\n componentName,\r\n });\r\n environment.pushRequest(request);\r\n }, [\r\n componentName,\r\n dataRefId,\r\n environment,\r\n fetchVariables,\r\n lookupCacheByVariables,\r\n memoedConfig,\r\n requestContract,\r\n spec,\r\n strictMode,\r\n ]);\r\n\r\n const ret = useMemo(() => [{ data, error }, {\r\n isLoading,\r\n hasMore,\r\n loadMore,\r\n }], [data, error, hasMore, isLoading, loadMore]);\r\n\r\n return ret;\r\n}\r\n","// this hook is used to create/retrieve a dataRefId, which\r\n// will then be used/shared amongst useFetch/useMutation/usePagination/etc hooks.\r\n// In a React component settings, this will act as a \"component ID\", where\r\n// all the custom hooks share a same dataRefId, so they can work on the same\r\n// set of data records.\r\n// For example, a \"usePagination\" hook will retrieve a set of records, and store\r\n// the data IDs in a certain dataRefId \"A\". Consequent \"useMutation\" call\r\n// bound to the same dataRefId will have immediate access to the current data from pagination.\r\n// Next time the mutation call tries to CREATE a new entity, it will now where\r\n// to append the new entity.\r\n\r\n// The hook adds/retrieves dataRefId from a pool in context. An optional \"name\"\r\n// can be given so a compnent can restore previous data state even after unmounting.\r\n// A direct example will be when a Paginated timeline component was unmounted/remounted,\r\n// previously loaded feeds and scroll position can be reinstiated.\r\nimport { useRef } from 'react';\r\nimport { v4 as uuidv4 } from 'uuid';\r\nimport { useEnvironment } from '../environment';\r\n\r\nfunction generateNewDataRefId() {\r\n return uuidv4();\r\n}\r\n\r\nexport function useDataRefId(name, environmentLookupFn) {\r\n const environment = useEnvironment(environmentLookupFn);\r\n const dataRefIdRef = useRef(null);\r\n\r\n if (!name && dataRefIdRef.current) {\r\n return dataRefIdRef.current;\r\n }\r\n\r\n if (environment) {\r\n if (name) {\r\n // when using named dataRefId, we'll want to preserve it.\r\n if (!environment.dataRefIdPool[name]) {\r\n environment.dataRefIdPool[name] = generateNewDataRefId();\r\n }\r\n\r\n dataRefIdRef.current = environment.dataRefIdPool[name];\r\n } else {\r\n dataRefIdRef.current = generateNewDataRefId();\r\n }\r\n }\r\n\r\n return dataRefIdRef.current;\r\n}\r\n","import { useMemo } from 'react';\r\nimport Promise from 'bluebird';\r\n\r\nexport function usePromisify(actions) {\r\n return useMemo(() => actions.map(action => (...args) => new Promise((resolve, reject) => {\r\n const configBuilder = config => ({\r\n ...config,\r\n onComplete: processedResponse => {\r\n if (config.onComplete) {\r\n config.onComplete(processedResponse);\r\n }\r\n resolve(processedResponse);\r\n },\r\n onError: error => {\r\n if (config.onError) {\r\n config.onError(error);\r\n }\r\n reject(error);\r\n },\r\n });\r\n\r\n const mergedArgs = [...args, configBuilder];\r\n action(...mergedArgs);\r\n })), actions); // eslint-disable-line react-hooks/exhaustive-deps\r\n}\r\n","import _ from 'underscore';\r\nimport { useContext, useCallback } from 'react';\r\nimport { EnvironmentContext } from '../environment/context';\r\n\r\nexport function useCleanAllCache() {\r\n const [, environments] = useContext(EnvironmentContext);\r\n\r\n const cleanAllCache = useCallback(() => {\r\n _.each(environments, environment => {\r\n if (environment) {\r\n const { store } = environment;\r\n const allRecordGroups = store.recordGroups;\r\n _.each(allRecordGroups, recordGroup => {\r\n const allRecords = recordGroup && recordGroup.records;\r\n const allRecordsIdsToRemove = _.pluck(allRecords, 'id');\r\n if (allRecordsIdsToRemove && allRecordsIdsToRemove.length > 0) {\r\n recordGroup.deleteRecords(allRecordsIdsToRemove);\r\n recordGroup.notify('entitiesDeleted', allRecordsIdsToRemove);\r\n }\r\n });\r\n }\r\n });\r\n }, [environments]);\r\n\r\n return cleanAllCache;\r\n}\r\n"],"names":["parseOrderBy","orderby","_","$orderby","value","v","index","toLowerCase","lowerCaseOrderValue","join","key","concat","parseQuery","query","edmResource","_objectSpread","filter","where","$filter","top","$top","skip","$skip","undefined","count","$count","select","resource","parsed","navigationPropertyNames","type","elementType","$select","item","$expand","length","parseSelect","search","$search","getDefaultHeaderObj","uuidv4","edm","EDM","schemas","$ROOT","$$ref","properties","Customers","items","$$ODataExtension","Name","NavigationProperty","schema","name","resIdsPlugin","odataPlugin","odataBulkUpsertPlugin","window","campaignODataConfigs","bulkUpsertSchema","rootResourceIdentifier","types","resolve","ResourceIdentifier","defineConstProperty","BulkError","_Error","_ref","_this","entity","errors","_classCallCheck","_callSuper","_inherits","_createClass","_wrapNativeSuper","Error","getBulkUrl","params","descriptor","variables","locator","cid","aid","$withKey","Accounts","path","getBulkPayload","entitySchema","data","CsvRows","serialize","getProcessedBulkResult","response","request","csvData","parse","results","ret","populateIds","Array","isArray","localeParam","localeUs","isCCError","ResultType","Schema","user","customer","account","sub_geography","time_zones","countries","currencies","currency_countries_mappings","country_currencies_mappings","validate_address","sign_up","estimate_taxes","top_up_limit","offline_payment_instructions","create_expert_from_smart","payment_instrument","get_coupon_details","get_coupon_string_for_signup","get_coupon_valid_for_customer_website","save_coupon_string_for_signup","country_timezones_mapping","middlewares","_defineProperty","middlewareTypes","FETCH_POLICY","createFetchPolicyMiddleware","ERROR","createErrorMiddleware","store","Store","env","CC_ENVIRONMENT_TAG","getEnvironmentInstance","requestor","customStore","customMiddlewares","Environment","networkRequestor","environmentLookupFn","environmentTag","useCCEnvironment","serviceRoot","locale","useMemo","overreactRequestor","uri","requestVerb","options","body","restfulService","RestfulServiceBase","cleanedRootUrl","URI","toString","currentLocale","uriWithLocale","addQuery","url","http","ajax","method","JSON","stringify","then","Promise","getRequestor","getDefaultOptions","contentType","dataType","cacheResponse","xhrFields","withCredentials","fetchRequestContract","createRequestContract","dataPath","verb","requestVerbs","GET","uriFactoryFn","uid","id","searchString","queryString","headerFactoryFn","keySelector","parentKeySelector","fetchResponseContract","createResponseContract","requestContract","responseType","responseTypes","ENTITY","processorFn","mutationRequestContract","PATCH","fetchPolicy","FetchPolicy","NetworkOnly","payloadFactoryFn","User","mutationResponseContract","createSpec","specTypes","FETCH","REFETCH","MUTATION","StoreOrNetwork","Customer","Account","predicates","customerId","COLL","countryCode","subGeography","Key","timeZones","fetchSpec","refetchSpec","useCurrencies","dataLocator","config","arguments","dataRefId","useDataRefId","defaultConfig","fetch","refetch","fetchConfig","_useFetch","useFetch","_useFetch2","_slicedToArray","error","refetchFn","useRefetch","read","useCallback","param","requestConfig","currencyCountriesMappings","currency","useCurrencyCountriesMappings","countryCurrenciesMapping","country","useCountryCurrenciesMappings","POST","address","accountId","BusinessAddress","OriginalAddress","BusinessName","isMca","isUp","noupsw","isExpertStandalone","isSubscriptionAds","isStreamlined","isPMaxLite","isChinaSignup","isFullyManagedFacebookAdAccountEnabled","isBingAdsOptional","authType","isSwitchedFromSmart","prefix","suffix","upse","mfba","push","idp","suffixString","searchAndSuffixString","defaultOptions","headers","useSignUp","refetchConfig","payload","totalAmount","isTaxIncluded","estimateTaxes","topUpLimit","currencyCode","OfflinePaymentInstructions","Id","paymentInstrument","ccl","cco","coupon","websiteUrl","result","websiteURL","couponString","campaign","ad_group","ad","keyword","campaign_criterion","target_suggestion","rsa_suggestion","ad_strength","extracted_business_info","location","budget_suggestion","cacheExpirationDuration","EXPERT_ENVIRONMENT_TAG","cpid","Campaigns","initialSearch","parsedSearch","searchCompact","x","NetworkOrStore","campaignSchema","Goal","Url","NewExpertSignUp","sideEffectFn","spec","tryMergeItemsToCacheStore","Ads","schemaName","itemKeySelector","parentSchemaName","parentId","DELETE","cursorIndex","PAGINATION","ADD","_variables$select","_variables$pageSize","pageSize","_variables$includeSma","includeSmartCampaign","startDate","endDate","AdGroups","includesmartcampaign","startdate","enddate","adgid","adGroup","fetchCollRequestContract","fetchCollResponseContract","dateString","Date","now","toISOString","split","gridDataParameters","DateRange","StartDate","EndDate","Type","parseInt","bulkObjs","bulkObj","Keywords","keyWord","locid","Locations","_variables$count","_variables$filter","campaignCriterion","bulkResult","resultProcessor","lcid","variableData","payloadData","targetSuggestion","BingLocationId","caller","rsaSuggestion","adId","adStrength","createTimestamp","extractedBusinessInfo","budgetSuggestion","app","negative_keyword_list","negative_keyword","bulk_edit_session","bulk_edit_result","audience","remessaging_audience","tag","task_item","goal","conversion_advice","task_item_execution","ad_group_criterion","audience_ad_group_criterion","ad_group_audience_association","audience_association","audience_criterion_with_b_i","ad_group_audience_criterion_with_b_i","ad_group_audience_criterion","campaign_audience_criterion","product_offer","product_partition","preference","product_offer_store","image","ad_extension","image_ad_extension","location_ad_extension","ad_extension_association","annotation_opt_out_info","automated_extension","label","budget","portfolio_bid_strategy","biddable_ad_group_criterion","dsa_target","domain_category","negative_ad_group_criterion","negative_ad_group_dsa_target","negative_campaign_criterion","negative_campaign_dsa_target","dsa_search_term","category","negative_keyword_conflict","search_term","demographic","feed","ad_customizer_attribute","ad_customizer_attribute_value","feed_item","feed_upload_history","feed_association","recommendation","performance_target","performance_target_instance","experiment","performance_time_series","language_detect","responsive_search_ad_instance","smart_listing","business","search_phrase","product_group","product_attribute_statistic","stock_image","placement_exclusion_list","negative_site","asset_link","asset_with_b_i_data","shared_entity_association","promotion_ad_extension","note","note_segment","video","video_resource","video_caption_file","filter_link_ad_extension","smart_page","flyer_ad_extension","reparenting_user_setting","video_ad_extension","account_label_association_count","location_targeting_info","responsive_search_ad","import_recommendation","seasonality_adjustment","r_s_a_ad_customizer_attribute","dimension_row","multi_account_overview","report_data_report_info","upload_url","app_install_ad","dynamic_search_ad","expanded_text_ad","mobile_ad","product_ad","responsive_ad","text_ad","ad_group_criterion_grid_data","order_item_bid_info","biddable_campaign_criterion","campaign_criterion_grid_data","vertical_sub_account","vertical_hotel_group","action_ad_extension","app_ad_extension","call_ad_extension","callout_ad_extension","disclaimer_ad_extension","dynamic_data_ad_extension","price_ad_extension","review_ad_extension","sitelink2_ad_extension","structured_snippet_ad_extension","application_install_goal","destination_goal","duration_goal","event_goal","in_store_transaction_goal","in_store_visit_goal","multi_stage_goal","offline_conversion_goal","page_views_per_visit_goal","product_conversion_goal","smart_goal","combined_list_audience","custom_audience","customer_list_audience","in_market_audience","product_audience","remarketing_similar_audience","customer_shared_entity_association","bulk_download_task_item_execution","bulk_upsert_task_item_execution","offline_conversion_upload_task_item_execution","pps_reconciliation_report_manager_task_item_execution","pps_reconciliation_report_upload_task_item_execution","feed_upload_result","feed_import_result","cloud_import_result","cloud_import_v2_result","google_tag_manager_import_result","import_result","multi_account_google_import_result","smart_import_scheduler_result","multi_account_download_result","bulk_upload_task_item_execution","report_data_task_item_execution","script_task_item_execution","script_item_change","script_changes_summary","bing_places_task_item","bulk_download_task_item","bulk_upsert_task_item","email_rule","offline_conversion_upload_task_item","pps_reconciliation_report_manager_task_item","pps_reconciliation_report_upload_task_item","facebook_task_item","feed_upload_task_item_base","create_feed_upload_task_item","import_feed_and_feed_mapping_upload_task_item","import_feed_item_upload_task_item","replace_feed_upload_task_item","r_s_a_ad_customizer_feed_upload_task_item","update_feed_upload_task_item","google_my_business_task_item","amazon_import_task_item","cloud_import_task_item","google_tag_manager_import_task_item","import_task_item","multi_account_google_import_task_item","smart_import_scheduler_task_item","multi_account_download_task_item","multi_account_bulk_upload_task_item","report_task_item","report_data_task_item","report_rule","report_email_rule","script_task_item","update_campaign_store_id_task_item","advertiser_rule","mca_schedule_post_task_item","mca_social_metrics_sync_up_task_item","mca_social_profile_init_task_item","mca_report_job_task_item","tip","custom_column","company","industry","job_function","advice_event","custom_event_for_event","custom_event_for_value","page_load_event","travel_dimension_row","report_data_column_info","fb_event_owner","fb_place","http_request_message","stock_image_asset","report_data_enum_filter","report_data_text_filter","report_data_column_set","ads_api_error","totals_with_performance_metrics","account_totals","campaign_totals","aggregate_budget","performance_metrics","custom_column_error_response","custom_column_error_detail_item","goal_performance_metrics","performance_metrics_totals_by_network_split","custom_column_output_value","insertion_order","insertion_order_details","product_condition","attribute_statistic","base_expression","entity_filter","child_entity_filter","bulk_edit_action","ad_group_audience_criterion_complex","ad_extension_association_complex","dictionary_2_of_string__string","dictionary_2_of_string__import_statistics","target_totals","key_value_pair_2_of_int64__string","delivery_status_detail","d_b_null","experiment_metrics","dictionary_2_of_string__dictionary_2_of_string__int64","asset","manager_account","entity_id_parent_id","owner","rerun_run_report_result","single_account_google_import_task_item","single_account_import_result","image_asset","smart_estimation_point","budget_kpi_estimations_response","ads_count","ad_groups_count","dictionary_2_of_ad_type__int32","fb_business","fb_cover","fb_location","fb_page","fb_picture","fb_post","fb_rating","fb_photo","fb_call_to_action","fb_event","fb_event_time","fb_user","fb_id_name_map","smart_page_fb_error","smart_page_fb_errors","smart_page_metric","click_metric","smart_page_business_hours","smart_page_time_slots","smart_page_suggestion","smart_page_image","multi_account_recommendation","dictionary_2_of_verified_tracking_vendor_field__string","b_i_data_status","http_response_message","i_enumerable_1_of_attribute_statistic","grid_data_parameters","conversion_goal_details","criterion","list_1_of_b_i_data_status","key_value_pair_2_of_string__string","blob","i_enumerable_1_of_i_enumerable_1_of_string","data_availability","report_parameters","report_preview_parameters","multi_account_overview_parameters","multi_account_recommendation_parameters","key_value_pair_2_of_int32__boolean","search_term_selection_item","alert_information","fb_page_authorization_data","i_enumerable_1_of_fb_page","ads_api_batch_errors","smart_page_association","smart_page_metric_set","smart_page_details","smart_page_partner_details","website_source_data","entity_editorial_reasons_collection","ad_resource_not_eligible_reasons_collection","set_smart_listings_result","ad_strength_and_action_items","medias","recommendation_media_option","recommendation_page_defination","media_generation_result","image_generation","media_output","budget_recommendation_response","target","mca_keyword","mca_ad","target_recommendation","a_b_testing_flight_log","a_b_testing_event_log","date_range","tag_setting","file_content_result","version","http_content","key_value_pair_2_of_string__i_enumerable_1_of_string","stream_content","read_only_memory_content","multipart_content","multipart_form_data_content","byte_array_content","string_content","json_content","header_encoding_selector_1_of_http_content","form_url_encoded_content","http_method","account_inactive_reason","quality_score_data","segmented_performance_metrics","segmentation_key","year_segmentation_key","week_segmentation_key","top_vs_other_segmentation_key","quarter_segmentation_key","network_segmentation_key","month_segmentation_key","medium_segmentation_key","hour_of_the_day_segmentation_key","goal_type_segmentation_key","goal_name_segmentation_key","goal_category_segmentation_key","device_type_segmentation_key","device_o_s_segmentation_key","delivered_match_type_segmentation_key","day_segmentation_key","day_of_the_week_segmentation_key","currency_segmentation_key","bidded_match_type_segmentation_key","audience_type_segmentation_key","audience_name_segmentation_key","ad_scenario_segmentation_key","ad_position_segmentation_key","phone_performance_metrics","segmented_phone_performance_metrics","custom_parameter","bidding_scheme","unknown_bidding_scheme","target_roas_bidding_scheme","target_impression_share_bidding_scheme","target_cpa_bidding_scheme","percent_cpc_bidding_scheme","max_roas_bidding_scheme","max_conversion_value_bidding_scheme","max_conversions_bidding_scheme","bid","max_clicks_bidding_scheme","manual_cpv_bidding_scheme","manual_cpm_bidding_scheme","manual_bidding_scheme","inherit_from_parent_bidding_scheme","enhanced_cpc_bidding_scheme","cost_per_sale_bidding_scheme","commission_bidding_scheme","campaign_settings","smart_settings","verified_tracking_setting","verified_tracking_data","shopping_settings","expert_mode_settings","dynamic_search_ads_setting","disclaimer_setting","audience_settings","note_campaign_association","note_ad_group_association","audience_criterion","bid_amount_detail","bid_estimation_data","app_url","label_association_counts","appeal","text_asset","video_asset","ad_rotation","updatable_date","age_criterion","day_time_criterion","device_criterion","gender_criterion","location_criterion","geo_point","location_intent_criterion","profile_criterion","company_name_criterion","industry_criterion","job_function_criterion","radius_criterion","store_criterion","webpage","webpage_parameter","webpage_condition","criterion_bid","fixed_bid","bid_multiplier","criterion_cashback","cashback_adjustment","bid_adjustment_recommendation","schedule","day_time","key_value_pair_2_of_int64__campaign_editorial_reason_collection","price_table_row","setting","target_setting","target_setting_detail","co_op_setting","recommendation_action","metric_change","product_group_cashback","campaign_cashback","ad_group_cashback","campaign_conversion_goal","account_item","sharing_scope","used_by","goal_stage","destination_goal_stage","event_goal_stage","selection","comparison_date_range","custom_column_definition","search_term_selection","performance_target_instance_selection","dimension_report_selection","automated_extension_selection","ad_extension_selection","bulk_edit_batch_action","association_action","audience_association_action","label_association_action","label_disassociation_action","bid_estimate_action","copy_action","list_action","numeric_action","query_only_action","text_action","bulk_edit_item_change","key_value_pair_2_of_string__list_1_of_editorial_error","editorial_error","api_editorial_error","mca_api_editorial_error","editorial_info","mca_editorial_reason","audience_expression","page_visitors_who_visited_another_page_expression","expression","page_visitors_who_did_not_visit_another_page_expression","expression_collection","page_visitors_expression","custom_events_expression","audience_set","dictionary_2_of_string__int64","annotation_opt_out","aggregated_negative_keyword","offline_conversion_file","key_value_pair_2_of_int64__i_enumerable_1_of_ads_api_error","cloud_import_task_base_result","cloud_import_task_result","import_statistics","entity_count","key_value_pair_2_of_string__i_enumerable_1_of_ads_api_error","key_value_pair_2_of_string__bulk_upload_entity_statistics","bulk_upload_entity_statistics","bulk_file","key_value_pair_2_of_string__ads_api_error","bing_places_filter","notification_delivery_option","email_notification_delivery_option","import_user_preference","import_adjustment_for_numeric_property","import_prefix_and_suffix_for_string_property","import_search_and_replace_for_string_property","facebook_import_context","google_my_business_filter","amazon_import_context","ad_words_import_context","import_user_preferences","import_update_entity_preference","import_append_dest_url_preference","import_search_and_replace_dest_url_preference","append_preferences_for_tracking_template","search_and_replace_preferences_for_tracking_template","g_t_m_import_context","g_t_m_tag_draft","google_account_property","file_import_context","smart_import_google_import_context","smart_import_facebook_import_context","aggregate_filter","predicate","report_sort","campaign_report_scope","ad_group_report_scope","conditional_format","crop_settings","seasonality_adjustment_campaign_association","migration_statuses","performance_target_metric","feed_attribute","feed_item_attribute_value","feed_item_targets","feed_item_campaign_target","feed_item_adgroup_target","feed_item_audience_target","feed_item_location_target","feed_item_platform_target","feed_item_keyword_target","feed_upload_task_detail_base","update_feed_upload_task_detail","replace_feed_upload_task_detail","create_feed_upload_task_detail","feed_schedule_information","advice_summary","advice_message","goal_advice_summary","advice_item","event_advice_summary","event_advice_detail","last_import_info","performance_data_point","performance_change_percent_metrics","segmented_performance_change_percent_metrics","phone_performance_change_percent_metrics","segmented_phone_performance_change_percent_metrics","smart_page_data_context","smart_page_social_urls","smart_page_video","smart_page_call_to_action","smart_page_location","uet_user_setting","tag_info","audience_item","goal_item","tag_used_by_info","used_by_pair","size","bid_below_first_page_detail","negative_keyword_conflict_detail_collection","negative_keyword_conflict_detail","experiment_statistic_1_of_int64","experiment_statistic_1_of_double","experiment_statistic_1_of_single","grid_data_filter","ad_extension_association_grid_data_parameters","automated_extension_grid_data_parameters","grid_pagination","editorial_language_to_publisher_countries","editorial_reason","ad_resource_not_eligible_reason","campaign_management_error_detail","editorial_error_detail","publisher_country_editorial_errors","recommendation_image","recommendation_image_option","media_asset","image_filter","image_filter_parameter","crop_setting","output_image","budget_info","age_target","gender_target","geo_target","location_target","radius_target","channel_appeal_info","ad_source","offline_ad_identity","carousel_ad","image_ad","lead_image_ad","provisioning_editorial_result","search_ad","lead_ad","video_ad","extracted_address","location_target_recommendation","radius_target_recommendation","entity_tag_header_value","business_category_recommendations","prepare_ad_recommendation","post_a_b_testing_flight_log","post_a_b_testing_event_log","additionalHeader","requestHeader","isString","getReader","TextDecoder","decode","status","json","catch","responseJSONParseError","responseJSON","ok","ENVIRONMENT_TAG","customMiddleWares","networkPolicy","fn","customer_id","account_id","edmEntity","composeSearchString","headerDecorator","responseContract","obj","keySelectorDecorator","r","processorDecorator","sideEffects","urlDecorator","originValue","payloadDecorator","decorator","rest","_objectWithoutProperties","_excluded","$call","ClientId","campaign_id","CustomerId","AccountId","Tags","tag_id","TagId","require","useODataCall","useODataCollection","useODataEntity","module","exports","typesPlugin","schemaPlugin","this","get","object","defaultValue","sub","i","keyPath","has","compact","castPath","isObject","isUndefined","Object","defineProperty","enumerable","writable","defineProducedProperty","factory","apply","configurable","defineProducedPropertyOnClass","Class","className","random","symbol","prototype","hasOwnProperty","call","defineComputedProperty","getter","mixin","getOwnPropertyDescriptor","Namespace","parent","map","segments","reduce","ns","seg","pop","worker","each","Registry","rootNamespace","qualifiedNames","Map","namespace","realName","isObjectWithName","register","set","last","_require2","resourceIdentifiers","Navigation","source","_toConsumableArray","toJSON","toSelfJSON","PropertyNavigation","_Navigation","_ref2","property","TypeResID","navigationProperties","navigation","CallableNavigation","_Navigation2","_ref3","_this2","callable","defineCallableOn","resID","callableTypes","callableName","actions","functions","CastNavigation","_Navigation3","_ref4","_this3","_ref4$name","chain","navigationName","parameters","entityType","CollectionType","collectionType","WithKeyNavigation","_Navigation4","_ref5","_this4","keyType","match","CallNavigation","_Navigation5","_ref6","_this5","_ref6$parameters","ActionType","returnType","entitySet","_entitySet","CollectionResourceIdentifier","_ResourceIdentifier","resourceIdentifierForType","DefaultBase","AccessorType","_Base","baseType","PrimitiveType","ObjectType","ObjectTypeResID","defineOn","CollectionTypeResID","EntityType","CallableType","CallableTypeResID","def","typeName","_require3","getSchemaBaseTypeName","clrTypeBase","BaseType","$ref","getSchemaKey","getSchemaNavigationPropertyNames","_ref$schemas","_ref$namespace","_edm$types","ComplexType","OneOfType","FunctionType","getSchemaFullName","possiblePath","replace","getQualifiedName","getSchemaName","getTypeName","dependencies","typeInfo","collectionTypeName","oneOf","oneOfTypeName","enum","defineCallableOnType","acts","funcs","qualifiedName","forEntityType","getCallableTypeName","keys","mapObject","Parameter","parameter","returnTypeName","ReturnType","defineSchemaType","baseTypeName","entityActions","entityFunctions","collCallable","Action","Function","string","String","integer","Number","number","datetime","boolean","Boolean","null","jsType","ONEOF_TYPE_PREFIX","COLLECTION_TYPE_POSTFIX","oneOfTypes","resolveType","postfix","slice","str","removePostfix","indexOf","typeNames","substr","Property","getNamespace","getShortName","_Type","_Type2","sortedNames","resolveQualifiedName","sort","compileProperties","_Type3","_ref7","_ref7$navigationPrope","pick","propertyName","contains","_this$navigationPrope","extend","addProperties","_ObjectType","_ObjectType2","_ref8","keyProperty","_ObjectType3","_ref9","_this6","elementTypeName","compileParameters","_ref10","_Type4","_ref11","_this7","_CallableType","_ref12","_CallableType2","_ref13","first","_len","frags","_key","memo","frag","isEmpty","eSlash","test","sSlash","substring","parseSearch","isColl","omit","isNull","nonODataSearch","parseFilter","parseTop","parseSkip","parseCount","parseSearchString","_require","useSpecs","specs","actionSpec","usePagination","useMutation","collSpecs","mutationSpec","mutation","destroySpec","destroy","addSpec","add","paginationConfig","fetchVariables","_usePagination","_usePagination2","methods","mutateFn","destroyFn","createFn","update","newData","_len2","_key2","create","_len3","_key3","loadMore","hasMore","isLoading","entitySpecs","selectedSpecs","EnvironmentContext","React","MAX_REQUEST_BATCH_SIZE","FETCH_INTERVAL","INIT_MIDDLEWARE_STATES","isResponseFromStore","batchRequests","environment","batchSize","requests","removeRequest","pendingRequests","_loop","req","shift","componentName","middlewareStates","header","execute","onComplete","onGetResponse","onError","onGetError","executeRequests","useEnvironmentInitialization","timer","useRef","subscribe","current","clearTimeout","requestCount","setTimeout","DataFetcher","props","environments","children","_jsx","Provider","defaultProps","Subject","observers","Set","observer","delete","action","args","forEach","DataRef","_Subject","idRefs","previousVariables","lastUpdateTimestamp","includes","bind","onUpdate","updateStatus","clearError","onEntitiesCreated","onEntitiesDeleted","reset","cursor","UiComponents","updateDevTools","__OVERREACT_DEVTOOLS__","onDataRefChange","components","ids","notify","newStatus","updatedIds","DataNode","dataRefs","getDataRef","dataRefIdsUpdate","entitiesCreated","entitiesDeleted","recordGroup","k","toJson","EXTENSION_NAME","createDataNode","schemaNode","dataNode","getRecordGroup","modelName","setExtension","getDataNode","getExtension","Record","setValue","getValue","setData","getData","OVERREACT_ID_FIELD_NAME","createOverreactId","parentType","RecordGroup","schemaType","records","addOrUpdateRecords","getRecords","getRecordsByEntityKeys","dataId","findIndex","recordId","rawData","newRecord","dataItems","updatedDataIDs","addOrUpdateRecordInternal","notifyUpdate","record","find","onRecordGroupChange","storeId","uniqueId","recordGroups","preemptiveRecords","getStore","getSchemaNode","getRecordsById","getRecordsByEntityKey","getRecordsFromResponseDataArray","dataArray","d","dataIds","updateDataRefWithIds","dataRef","clear","NONE","DEFAULT_STORE_EXPIRATION_DURATION","StoreOnly","IsNetworkPolicy","IsStorePolicy","IsStoreSecondaryPolicy","getDataFromStore","dataInStore","shouldForceNetwork","storeExpirationDuration","currentTimestamp","requestFetchPolicy","specType","_ref2$status","_ref2$status2","updateDataRefStatus","fetchPolicyMiddlewareOptions","_ref$fetchPolicy","_ref$cacheExpirationD","next","_asyncToGenerator","_regeneratorRuntime","mark","_callee","fetchPolicyInReq","isStoreSecondaryPolicy","isNetworkPolicy","isStorePolicy","isForceNetwork","res","wrap","_context","prev","fetchPolicyOption","fetchPolicyInEnv","abrupt","sent","stop","_x","INSTRUMENTATION","executeRequestor","wrappedRequestor","executeRequest","WrappedRequestor","errorMiddlewareOptions","_ref$errorProcessor","errorProcessor","_ref$errorConvertor","errorConvertor","envErrorConverter","_ref3$spec","_ref3$spec2$responseC","errorConvertFn","processedError","getTimestamp","useDeepMemo","ref","errorToString","stringError","stringifiedJson","defaultStubOptions","serverErrorCodes","detectError","respData","pass","Errors","Code","message","Message","impactUser","getServerPerf","getResponseHeader","perfTimings","perf","beforeSendHandler","instrumentationContext","perfFunc","shouldAddHeaders","requestStartTime","pageTrackingId","stubOptions","requestId","api","isMethodEnter","httpMethod","timeTaken","successHandler","errorFunc","requestTimeTaken","requestResult","statusCode","errorHandler","isUserError","traceFunc","errMsg","InstrumentationContext","errorMappers","createInstrumentationMiddleware","instrumentationOptions","_ref$loggerFunc","loggerFunc","_ref$loggerFunc2","_ref$loggerFunc2$trac","_ref$loggerFunc2$erro","_ref$loggerFunc2$perf","errorMapper","check","_req$headers","_req$headers2$xMsRe","requestQueue","dataFetcherSubscriber","notifyObservers","pushRequest","unsubscribe","getSchema","dataRefIdPool","additionalParams","requestorWithDevTools","_window$__OVERREACT_D","onRequest","responseValue","ex","exception","sink","baseMiddlewares","values","instrumentationMiddleware","compose","wrappedRequest","requestWithMiddleware","err","notifyCb","splice","useEnvironment","_useContext","useContext","_useContext2","specificEnv","PUT","RequestContract","insert","getSideEffectCacheStoreHelpers","schemaToModelMapping","keysInCache","itemsToAddWithOverreactId","overreactId","itemsMerged","itemToMerge","tryDeleteItemsInCacheStore","keysToDelete","recordsIdsToRemove","deleteRecords","ResponseContract","selectKey","applyId","parentNode","processedResponse","context","order","dataWithOverreactId","cacheStoreHelper","fetchResponseHandler","dataCb","mutationResponseHandler","refetchResponseHandler","errorCb","errorResponseHandler","SchemaNode","modelSchema","childNodes","extensions","append","node","ext","c","modelGetter","root","modelToSchemaMapping","buildModelToSchemaMap","getSchemaNames","parts","currentNode","partName","existingPathFound","j","t","newNode","OverreactRequest","assign","getCacheIds","lookupFn","cacheHit","getDataFromRecords","getLookupCacheFn","lookupCacheFn","varKeySelector","dataKeySelector","useComponent","stacks","stack","funcName","trim","startsWith","equalityFn","oldData","memoedConfig","requestRequired","currentData","currentError","_useReducer","useReducer","forceRender","postponeRead","lookupCacheByVariables","_ref2$options","dataCallback","registerComponent","errorCallback","_dataRef$status","dataObserver","useEffect","overreactIds","deps","isFirst","prevDeps","isSame","every","useDebugValue","useDeepEqualEffect","getMergedConfig","origin","newInstance","isFunction","getRawData","getDataWithOverreactIdFromRecords","mutateRecords","recordsBeforeMutation","newRecords","addRecords","replacePreemptiveRecords","removePreemptiveRecords","recordsBeforeMutationRef","mergedConfig","preemptiveResponseFn","dataBeforeWithId","dataWithId","mutationData","preemptiveData","_getRecordsByEntityKe","addPreemptiveRecords","_ref2$onError","_ref3$options","getRecordsDataInDataRef","getRecordsDataById","_memoedConfig$strictM","strictMode","mergeNewRecords","refId","loadingId","_useState","useState","_useState2","setIsLoading","_useState3","_useState4","_useState5","_useState6","setError","resetInternalState","setInternalStateOnResponse","loadMoreCallback","__","recordsData","onErrorCallback","newIds","recordsToShow","storeRecordsToShow","_fetchVariables$optio","requestVars","myId","generateNewDataRefId","dataRefIdRef","usePromisify","reject","mergedArgs","useCleanAllCache","allRecordGroups","allRecords","allRecordsIdsToRemove"],"sourceRoot":""}