@aws-amplify/api-graphql 4.0.17-unstable.5c56101.0 → 4.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/internals/APIClient.js +0 -1
- package/dist/cjs/internals/APIClient.js.map +1 -1
- package/dist/cjs/internals/InternalGraphQLAPI.js +7 -2
- package/dist/cjs/internals/InternalGraphQLAPI.js.map +1 -1
- package/dist/cjs/internals/v6.js +1 -1
- package/dist/cjs/internals/v6.js.map +1 -1
- package/dist/esm/internals/APIClient.mjs +0 -1
- package/dist/esm/internals/APIClient.mjs.map +1 -1
- package/dist/esm/internals/InternalGraphQLAPI.mjs +7 -2
- package/dist/esm/internals/InternalGraphQLAPI.mjs.map +1 -1
- package/dist/esm/internals/v6.mjs +1 -1
- package/dist/esm/internals/v6.mjs.map +1 -1
- package/dist/esm/utils/resolveLibraryOptions.d.ts +4 -1
- package/package.json +4 -4
- package/src/GraphQLAPI.ts +2 -2
- package/src/Providers/AWSAppSyncRealTimeProvider/index.ts +20 -20
- package/src/internals/APIClient.ts +6 -8
- package/src/internals/InternalGraphQLAPI.ts +25 -20
- package/src/internals/operations/get.ts +11 -11
- package/src/internals/operations/list.ts +10 -10
- package/src/internals/operations/subscription.ts +6 -6
- package/src/internals/server/generateClientWithAmplifyInstance.ts +1 -1
- package/src/internals/v6.ts +5 -5
- package/src/server/generateClient.ts +2 -2
- package/src/types/index.ts +50 -45
- package/src/utils/ConnectionStateMonitor.ts +6 -6
- package/src/utils/errors/assertValidationError.ts +1 -1
- package/src/utils/findIndexByFields.ts +3 -3
- package/src/utils/resolveConfig.ts +2 -2
- package/src/utils/resolveOwnerFields.ts +1 -1
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
export function findIndexByFields<T>(
|
|
12
12
|
needle: T,
|
|
13
13
|
haystack: T[],
|
|
14
|
-
keyFields: Array<keyof T
|
|
14
|
+
keyFields: Array<keyof T>,
|
|
15
15
|
): number {
|
|
16
16
|
const searchObject = Object.fromEntries(
|
|
17
|
-
keyFields.map(fieldName => [fieldName, needle[fieldName]])
|
|
17
|
+
keyFields.map(fieldName => [fieldName, needle[fieldName]]),
|
|
18
18
|
);
|
|
19
19
|
|
|
20
20
|
for (let i = 0; i < haystack.length; i++) {
|
|
21
21
|
if (
|
|
22
22
|
Object.keys(searchObject).every(
|
|
23
|
-
k => searchObject[k] === (haystack[i] as any)[k]
|
|
23
|
+
k => searchObject[k] === (haystack[i] as any)[k],
|
|
24
24
|
)
|
|
25
25
|
) {
|
|
26
26
|
return i;
|
|
@@ -14,7 +14,7 @@ export const resolveConfig = (amplify: AmplifyClassV6) => {
|
|
|
14
14
|
|
|
15
15
|
if (!config.API?.GraphQL) {
|
|
16
16
|
logger.warn(
|
|
17
|
-
'The API configuration is missing. This is likely due to Amplify.configure() not being called prior to generateClient().'
|
|
17
|
+
'The API configuration is missing. This is likely due to Amplify.configure() not being called prior to generateClient().',
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -31,7 +31,7 @@ export const resolveConfig = (amplify: AmplifyClassV6) => {
|
|
|
31
31
|
// assertValidationError(!!endpoint, APIValidationErrorCode.NoEndpoint);
|
|
32
32
|
assertValidationError(
|
|
33
33
|
!(!customEndpoint && customEndpointRegion),
|
|
34
|
-
APIValidationErrorCode.NoCustomEndpoint
|
|
34
|
+
APIValidationErrorCode.NoCustomEndpoint,
|
|
35
35
|
);
|
|
36
36
|
|
|
37
37
|
return {
|
|
@@ -56,7 +56,7 @@ function isAuthAttribute(attribute: any): attribute is AuthAttribute {
|
|
|
56
56
|
if (typeof attribute?.properties === 'object') {
|
|
57
57
|
if (Array.isArray(attribute?.properties?.rules)) {
|
|
58
58
|
return (attribute?.properties?.rules as Array<any>).every(
|
|
59
|
-
rule => !!rule.allow
|
|
59
|
+
rule => !!rule.allow,
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
62
|
}
|