@aws-amplify/api-graphql 4.0.17-unstable.e316a2e.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/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/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 +1 -1
- 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
|
@@ -69,10 +69,10 @@ export class ConnectionStateMonitor {
|
|
|
69
69
|
this._initialNetworkStateSubscription = ReachabilityMonitor().subscribe(
|
|
70
70
|
({ online }) => {
|
|
71
71
|
this.record(
|
|
72
|
-
online ? CONNECTION_CHANGE.ONLINE : CONNECTION_CHANGE.OFFLINE
|
|
72
|
+
online ? CONNECTION_CHANGE.ONLINE : CONNECTION_CHANGE.OFFLINE,
|
|
73
73
|
);
|
|
74
74
|
this._initialNetworkStateSubscription?.unsubscribe();
|
|
75
|
-
}
|
|
75
|
+
},
|
|
76
76
|
);
|
|
77
77
|
|
|
78
78
|
this._linkedConnectionStateObservable =
|
|
@@ -94,9 +94,9 @@ export class ConnectionStateMonitor {
|
|
|
94
94
|
this._networkMonitoringSubscription = ReachabilityMonitor().subscribe(
|
|
95
95
|
({ online }) => {
|
|
96
96
|
this.record(
|
|
97
|
-
online ? CONNECTION_CHANGE.ONLINE : CONNECTION_CHANGE.OFFLINE
|
|
97
|
+
online ? CONNECTION_CHANGE.ONLINE : CONNECTION_CHANGE.OFFLINE,
|
|
98
98
|
);
|
|
99
|
-
}
|
|
99
|
+
},
|
|
100
100
|
);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -126,14 +126,14 @@ export class ConnectionStateMonitor {
|
|
|
126
126
|
.pipe(
|
|
127
127
|
map(value => {
|
|
128
128
|
return this.connectionStatesTranslator(value);
|
|
129
|
-
})
|
|
129
|
+
}),
|
|
130
130
|
)
|
|
131
131
|
.pipe(
|
|
132
132
|
filter(current => {
|
|
133
133
|
const toInclude = current !== previous;
|
|
134
134
|
previous = current;
|
|
135
135
|
return toInclude;
|
|
136
|
-
})
|
|
136
|
+
}),
|
|
137
137
|
);
|
|
138
138
|
}
|
|
139
139
|
|
|
@@ -9,7 +9,7 @@ import { APIValidationErrorCode, validationErrorMap } from './validation';
|
|
|
9
9
|
*/
|
|
10
10
|
export function assertValidationError(
|
|
11
11
|
assertion: boolean,
|
|
12
|
-
name: APIValidationErrorCode
|
|
12
|
+
name: APIValidationErrorCode,
|
|
13
13
|
): asserts assertion {
|
|
14
14
|
const { message, recoverySuggestion } = validationErrorMap[name];
|
|
15
15
|
|
|
@@ -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
|
}
|