@aws-amplify/api
Advanced tools
Comparing version 6.1.8 to 6.1.9-graphql-multi-client.4f8e7a9.0
@@ -7,11 +7,5 @@ 'use strict'; | ||
const core_1 = require("@aws-amplify/core"); | ||
/** | ||
* Generates an API client that can work with models or raw GraphQL | ||
* | ||
* @returns {@link V6Client} | ||
* @throws {@link Error} - Throws error when client cannot be generated due to configuration issues. | ||
*/ | ||
function generateClient(options = {}) { | ||
function generateClient(options) { | ||
return (0, internals_1.generateClient)({ | ||
...options, | ||
...(options || {}), | ||
amplify: core_1.Amplify, | ||
@@ -18,0 +12,0 @@ }); |
@@ -1,2 +0,3 @@ | ||
import { CommonPublicClientOptions, V6Client } from '@aws-amplify/api-graphql'; | ||
import { V6Client } from '@aws-amplify/api-graphql'; | ||
import { CommonPublicClientOptions } from '@aws-amplify/api-graphql/internals'; | ||
/** | ||
@@ -8,2 +9,5 @@ * Generates an API client that can work with models or raw GraphQL | ||
*/ | ||
export declare function generateClient<T extends Record<any, any> = never>(options?: CommonPublicClientOptions): V6Client<T>; | ||
export declare function generateClient<T extends Record<any, any> = never>(options?: CommonPublicClientOptions<false, false>): V6Client<T, false, false>; | ||
export declare function generateClient<T extends Record<any, any> = never>(options?: CommonPublicClientOptions<false, true>): V6Client<T, false, true>; | ||
export declare function generateClient<T extends Record<any, any> = never>(options?: CommonPublicClientOptions<true, false>): V6Client<T, true, false>; | ||
export declare function generateClient<T extends Record<any, any> = never>(options?: CommonPublicClientOptions<true, true>): V6Client<T, true, true>; |
{ | ||
"name": "@aws-amplify/api", | ||
"version": "6.1.8", | ||
"version": "6.1.9-graphql-multi-client.4f8e7a9.0+4f8e7a9", | ||
"description": "Api category of aws-amplify", | ||
@@ -71,2 +71,3 @@ "main": "./dist/cjs/index.js", | ||
"devDependencies": { | ||
"jest-fetch-mock": "3.0.3", | ||
"typescript": "5.0.2" | ||
@@ -83,7 +84,7 @@ }, | ||
"dependencies": { | ||
"@aws-amplify/api-graphql": "4.6.6", | ||
"@aws-amplify/api-rest": "4.0.63", | ||
"@aws-amplify/api-graphql": "4.6.7-graphql-multi-client.4f8e7a9.0+4f8e7a9", | ||
"@aws-amplify/api-rest": "4.0.64-graphql-multi-client.4f8e7a9.0+4f8e7a9", | ||
"tslib": "^2.5.0" | ||
}, | ||
"gitHead": "8a8097a71e5adcafb546e98cf0538ccb51ff8fbc" | ||
"gitHead": "4f8e7a94a1c2540baa7eda530787b248b0fb237a" | ||
} |
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { CommonPublicClientOptions, V6Client } from '@aws-amplify/api-graphql'; | ||
import { generateClient as internalGenerateClient } from '@aws-amplify/api-graphql/internals'; | ||
import { V6Client } from '@aws-amplify/api-graphql'; | ||
import { | ||
CommonPublicClientOptions, | ||
generateClient as internalGenerateClient, | ||
} from '@aws-amplify/api-graphql/internals'; | ||
import { Amplify } from '@aws-amplify/core'; | ||
// NOTE: The type narrowing on CommonPublicClientOptions seems to hinge on | ||
// defining these signatures separately. Not sure why offhand. This is worth | ||
// some investigation later. | ||
/** | ||
@@ -14,8 +21,24 @@ * Generates an API client that can work with models or raw GraphQL | ||
export function generateClient<T extends Record<any, any> = never>( | ||
options: CommonPublicClientOptions = {}, | ||
): V6Client<T> { | ||
options?: CommonPublicClientOptions<false, false>, | ||
): V6Client<T, false, false>; | ||
export function generateClient<T extends Record<any, any> = never>( | ||
options?: CommonPublicClientOptions<false, true>, | ||
): V6Client<T, false, true>; | ||
export function generateClient<T extends Record<any, any> = never>( | ||
options?: CommonPublicClientOptions<true, false>, | ||
): V6Client<T, true, false>; | ||
export function generateClient<T extends Record<any, any> = never>( | ||
options?: CommonPublicClientOptions<true, true>, | ||
): V6Client<T, true, true>; | ||
export function generateClient< | ||
WithCustomEndpoint extends boolean, | ||
WithApiKey extends boolean, | ||
T extends Record<any, any> = never, | ||
>( | ||
options?: CommonPublicClientOptions<WithCustomEndpoint, WithApiKey>, | ||
): V6Client<T, WithCustomEndpoint, WithApiKey> { | ||
return internalGenerateClient({ | ||
...options, | ||
...(options || ({} as any)), | ||
amplify: Amplify, | ||
}) as unknown as V6Client<T>; | ||
}) as unknown as V6Client<T, WithCustomEndpoint, WithApiKey>; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
55644
488
2
1
1
- Removed@aws-amplify/api-graphql@4.6.6(transitive)
- Removed@aws-amplify/api-rest@4.0.63(transitive)
- Removed@aws-amplify/core@6.7.3(transitive)
- Removed@aws-amplify/data-schema@1.17.5(transitive)
- Removed@aws-amplify/data-schema-types@1.2.0(transitive)
- Removed@aws-crypto/sha256-js@5.2.0(transitive)
- Removed@aws-crypto/util@5.2.0(transitive)
- Removed@aws-sdk/types@3.387.03.398.0(transitive)
- Removed@smithy/is-array-buffer@2.2.03.0.0(transitive)
- Removed@smithy/types@2.12.0(transitive)
- Removed@smithy/util-base64@3.0.0(transitive)
- Removed@smithy/util-buffer-from@2.2.03.0.0(transitive)
- Removed@smithy/util-hex-encoding@2.0.0(transitive)
- Removed@smithy/util-utf8@2.3.03.0.0(transitive)
- Removed@types/aws-lambda@8.10.147(transitive)
- Removed@types/json-schema@7.0.15(transitive)
- Removed@types/uuid@9.0.8(transitive)
- Removedgraphql@15.8.0(transitive)
- Removedjs-cookie@3.0.5(transitive)
- Removedrxjs@7.8.1(transitive)
- Removeduuid@9.0.1(transitive)
Updated@aws-amplify/api-graphql@4.6.7-graphql-multi-client.4f8e7a9.0+4f8e7a9
Updated@aws-amplify/api-rest@4.0.64-graphql-multi-client.4f8e7a9.0+4f8e7a9