{"code":"import { CoreStitchAppClient, StitchAppClientInfo, StitchRequestClient } from \"mongodb-stitch-core-sdk\";\r\nimport StitchServiceImpl from \"../../services/internal/StitchServiceImpl\";\r\nimport StitchAuthImpl from \"../auth/internal/StitchAuthImpl\";\r\nimport StitchBrowserAppRoutes from \"../auth/internal/StitchBrowserAppRoutes\";\r\nvar StitchAppClientImpl = (function () {\r\n    function StitchAppClientImpl(clientAppId, config) {\r\n        this.info = new StitchAppClientInfo(clientAppId, config.dataDirectory, config.localAppName, config.localAppVersion);\r\n        this.routes = new StitchBrowserAppRoutes(this.info.clientAppId, config.baseUrl);\r\n        var requestClient = new StitchRequestClient(config.baseUrl, config.transport);\r\n        this.auth = new StitchAuthImpl(requestClient, this.routes.authRoutes, config.storage, this.info);\r\n        this.coreClient = new CoreStitchAppClient(this.auth, this.routes);\r\n    }\r\n    StitchAppClientImpl.prototype.getServiceClient = function (factory, serviceName) {\r\n        if (isServiceClientFactory(factory)) {\r\n            return factory.getClient(new StitchServiceImpl(this.auth, this.routes.serviceRoutes, \"\"), this.info);\r\n        }\r\n        else {\r\n            return factory.getNamedClient(new StitchServiceImpl(this.auth, this.routes.serviceRoutes, serviceName), this.info);\r\n        }\r\n    };\r\n    StitchAppClientImpl.prototype.callFunction = function (name, args) {\r\n        return this.coreClient.callFunctionInternal(name, args);\r\n    };\r\n    return StitchAppClientImpl;\r\n}());\r\nexport default StitchAppClientImpl;\r\nfunction isServiceClientFactory(factory) {\r\n    return factory.getClient !== undefined;\r\n}\r\n//# sourceMappingURL=StitchAppClientImpl.js.map","map":"{\"version\":3,\"file\":\"StitchAppClientImpl.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../src/core/internal/StitchAppClientImpl.ts\"],\"names\":[],\"mappings\":\"AAgBA,OAAO,EACL,mBAAmB,EAEnB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,iBAAiB,MAAM,2CAA2C,CAAC;AAC1E,OAAO,cAAc,MA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AAU,CAAC,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1D,CAAC;IACH,0BAAC;AAAD,CAAC,AA1DD,IA0DC;;AAED,gCACE,OAA+D;IAE/D,OAAQ,OAAmC,CAAC,SAAS,KAAK,SAAS,CAAC;AACtE,CAAC\"}","dts":{"name":"/Users/eric/stitch/stitch-js-sdk/packages/browser/core/.rpt2_cache/placeholder/core/internal/StitchAppClientImpl.d.ts","text":"import { StitchAppClientConfiguration } from \"mongodb-stitch-core-sdk\";\r\nimport NamedServiceClientFactory from \"../../services/internal/NamedServiceClientFactory\";\r\nimport ServiceClientFactory from \"../../services/internal/ServiceClientFactory\";\r\nimport StitchAuthImpl from \"../auth/internal/StitchAuthImpl\";\r\nimport StitchAppClient from \"../StitchAppClient\";\r\nexport default class StitchAppClientImpl implements StitchAppClient {\r\n    readonly auth: StitchAuthImpl;\r\n    private readonly coreClient;\r\n    private readonly info;\r\n    private readonly routes;\r\n    constructor(clientAppId: string, config: StitchAppClientConfiguration);\r\n    getServiceClient<T>(factory: ServiceClientFactory<T> | NamedServiceClientFactory<T>, serviceName?: string): T;\r\n    callFunction(name: string, args: any[]): Promise<any>;\r\n}\r\n"}}
