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GAEjBy8C,EAAOz8C,EACT,GAAC,IAIHylC,EAAM5lC,WAAC,GAAD41B,EAAAA,EAAAA,GAAIinB,GACZ,GAAE,IAAC,GAAE9lB,EACP,CCpBO,SAAS+lB,KACd,IAAAvJ,GAAyBC,EAAAA,EAAAA,YAAWxQ,GAA3BkC,GAA8ChlC,EAAAA,GAAAA,GAAAqzC,EAAA,GAAlC,GAmBrB,OAjBsBh0C,EAAAA,EAAAA,cAAY,WAChCvO,IAAAA,KAAOk0C,GAAc,SAAA3B,GACnB,GAAIA,EAAa,CACf,IACMwZ,EADYxZ,EAAVlqC,MACsB+wC,aAC9Bp5C,IAAAA,KAAO+rD,GAAiB,SAAAnV,GACtB,IAAMoV,EAAapV,GAAeA,EAAYsB,QACxC+T,EAAwBjsD,IAAAA,MAAQgsD,EAAY,MAC9CC,GAAyBA,EAAsBhqD,OAAS,IAC1D20C,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","fetchSpec","refetchSpec","mutationSpec","useCustomer","dataLocator","config","arguments","dataRefId","useDataRefId","defaultConfig","fetch","refetch","mutation","fetchConfig","useFetch","refetchFn","useRefetch","read","useCallback","param","requestConfig","updateFn","useMutation","update","_len","rest","_key","apply","_fetch","_slicedToArray","error","Account","predicates","customerId","COLL","countryCode","subGeography","Key","timeZones","useCurrencies","_useFetch","_useFetch2","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","_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","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","frags","memo","frag","isEmpty","eSlash","test","sSlash","substring","parseSearch","isColl","omit","isNull","nonODataSearch","parseFilter","parseTop","parseSkip","parseCount","parseSearchString","_require","useSpecs","specs","actionSpec","usePagination","collSpecs","destroySpec","destroy","addSpec","add","paginationConfig","fetchVariables","_usePagination","_usePagination2","methods","mutateFn","destroyFn","createFn","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":""}