UNPKG

@aws-amplify/api

Version:
51 lines (49 loc) 1.59 kB
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.InternalAPI = exports.InternalAPIClass = void 0; const internals_1 = require("@aws-amplify/api-graphql/internals"); const core_1 = require("@aws-amplify/core"); const utils_1 = require("@aws-amplify/core/internals/utils"); /** * NOTE! * * This is used only by DataStore. * * This can probably be pruned and/or removed. Just leaving it as much of the same * state as possible for V6 to reduce number of potentially impactful changes to DataStore. */ /** * @deprecated * Use RestApi or GraphQLAPI to reduce your application bundle size * Export Cloud Logic APIs */ class InternalAPIClass { /** * Initialize API */ constructor() { this.Cache = core_1.Cache; this._graphqlApi = new internals_1.InternalGraphQLAPIClass(); } getModuleName() { return 'InternalAPI'; } /** * to get the operation type * @param operation */ getGraphqlOperationType(operation) { return this._graphqlApi.getGraphqlOperationType(operation); } graphql(options, additionalHeaders, customUserAgentDetails) { const apiUserAgentDetails = { category: utils_1.Category.API, action: utils_1.ApiAction.GraphQl, ...customUserAgentDetails, }; return this._graphqlApi.graphql(core_1.Amplify, options, additionalHeaders, apiUserAgentDetails); } } exports.InternalAPIClass = InternalAPIClass; exports.InternalAPI = new InternalAPIClass(); //# sourceMappingURL=InternalAPI.js.map