@aws-amplify/datastore 5.0.1-unstable.cfbde4c.0 → 5.0.1
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/{lib → dist/cjs}/authModeStrategies/defaultAuthStrategy.js +3 -1
- package/dist/cjs/authModeStrategies/defaultAuthStrategy.js.map +1 -0
- package/{lib → dist/cjs}/authModeStrategies/index.js +3 -1
- package/dist/cjs/authModeStrategies/index.js.map +1 -0
- package/{lib → dist/cjs}/authModeStrategies/multiAuthStrategy.js +3 -3
- package/dist/cjs/authModeStrategies/multiAuthStrategy.js.map +1 -0
- package/{lib → dist/cjs}/datastore/datastore.js +5 -3
- package/dist/cjs/datastore/datastore.js.map +1 -0
- package/{lib → dist/cjs}/index.js +5 -16
- package/dist/cjs/index.js.map +1 -0
- package/{lib → dist/cjs}/predicates/index.js +3 -1
- package/dist/cjs/predicates/index.js.map +1 -0
- package/{lib → dist/cjs}/predicates/next.js +3 -1
- package/dist/cjs/predicates/next.js.map +1 -0
- package/{lib → dist/cjs}/predicates/sort.js +4 -3
- package/dist/cjs/predicates/sort.js.map +1 -0
- package/{lib → dist/cjs}/storage/adapter/AsyncStorageAdapter.js +5 -5
- package/dist/cjs/storage/adapter/AsyncStorageAdapter.js.map +1 -0
- package/{lib → dist/cjs}/storage/adapter/AsyncStorageDatabase.js +3 -1
- package/dist/cjs/storage/adapter/AsyncStorageDatabase.js.map +1 -0
- package/{lib → dist/cjs}/storage/adapter/InMemoryStore.js +3 -1
- package/dist/cjs/storage/adapter/InMemoryStore.js.map +1 -0
- package/{lib → dist/cjs}/storage/adapter/InMemoryStore.native.js +5 -5
- package/dist/cjs/storage/adapter/InMemoryStore.native.js.map +1 -0
- package/{lib → dist/cjs}/storage/adapter/IndexedDBAdapter.js +5 -25
- package/dist/cjs/storage/adapter/IndexedDBAdapter.js.map +1 -0
- package/{lib → dist/cjs}/storage/adapter/StorageAdapterBase.js +3 -1
- package/dist/cjs/storage/adapter/StorageAdapterBase.js.map +1 -0
- package/{lib → dist/cjs}/storage/adapter/getDefaultAdapter/index.js +6 -6
- package/dist/cjs/storage/adapter/getDefaultAdapter/index.js.map +1 -0
- package/dist/cjs/storage/adapter/getDefaultAdapter/index.native.js +10 -0
- package/dist/cjs/storage/adapter/getDefaultAdapter/index.native.js.map +1 -0
- package/{lib → dist/cjs}/storage/adapter/index.js +3 -1
- package/dist/cjs/storage/adapter/index.js.map +1 -0
- package/{lib → dist/cjs}/storage/relationship.js +3 -1
- package/dist/cjs/storage/relationship.js.map +1 -0
- package/{lib → dist/cjs}/storage/storage.js +5 -5
- package/dist/cjs/storage/storage.js.map +1 -0
- package/{lib → dist/cjs}/sync/datastoreConnectivity.js +4 -2
- package/dist/cjs/sync/datastoreConnectivity.js.map +1 -0
- package/{lib → dist/cjs}/sync/datastoreReachability/index.js +3 -1
- package/dist/cjs/sync/datastoreReachability/index.js.map +1 -0
- package/{lib → dist/cjs}/sync/datastoreReachability/index.native.js +3 -1
- package/dist/cjs/sync/datastoreReachability/index.native.js.map +1 -0
- package/{lib → dist/cjs}/sync/index.js +6 -7
- package/dist/cjs/sync/index.js.map +1 -0
- package/{lib → dist/cjs}/sync/merger.js +3 -1
- package/dist/cjs/sync/merger.js.map +1 -0
- package/{lib → dist/cjs}/sync/outbox.js +3 -1
- package/dist/cjs/sync/outbox.js.map +1 -0
- package/{lib → dist/cjs}/sync/processors/errorMaps.js +4 -4
- package/dist/cjs/sync/processors/errorMaps.js.map +1 -0
- package/{lib → dist/cjs}/sync/processors/mutation.js +3 -1
- package/dist/cjs/sync/processors/mutation.js.map +1 -0
- package/{lib → dist/cjs}/sync/processors/subscription.js +4 -4
- package/dist/cjs/sync/processors/subscription.js.map +1 -0
- package/{lib → dist/cjs}/sync/processors/sync.js +3 -1
- package/dist/cjs/sync/processors/sync.js.map +1 -0
- package/{lib → dist/cjs}/sync/utils.js +3 -1
- package/dist/cjs/sync/utils.js.map +1 -0
- package/{lib → dist/cjs}/types.js +12 -21
- package/dist/cjs/types.js.map +1 -0
- package/{lib → dist/cjs}/util.js +3 -1
- package/dist/cjs/util.js.map +1 -0
- package/{lib-esm/authModeStrategies/defaultAuthStrategy.js → dist/esm/authModeStrategies/defaultAuthStrategy.mjs} +4 -1
- package/dist/esm/authModeStrategies/defaultAuthStrategy.mjs.map +1 -0
- package/dist/esm/authModeStrategies/index.mjs +3 -0
- package/dist/esm/authModeStrategies/index.mjs.map +1 -0
- package/{lib-esm/authModeStrategies/multiAuthStrategy.js → dist/esm/authModeStrategies/multiAuthStrategy.mjs} +7 -5
- package/dist/esm/authModeStrategies/multiAuthStrategy.mjs.map +1 -0
- package/{lib-esm/datastore/datastore.js → dist/esm/datastore/datastore.mjs} +30 -26
- package/dist/esm/datastore/datastore.mjs.map +1 -0
- package/dist/esm/index.mjs +19 -0
- package/dist/esm/index.mjs.map +1 -0
- package/{lib-esm/predicates/index.js → dist/esm/predicates/index.mjs} +10 -7
- package/dist/esm/predicates/index.mjs.map +1 -0
- package/{lib-esm/predicates/next.js → dist/esm/predicates/next.mjs} +15 -11
- package/dist/esm/predicates/next.mjs.map +1 -0
- package/{lib-esm/predicates/sort.js → dist/esm/predicates/sort.mjs} +3 -2
- package/dist/esm/predicates/sort.mjs.map +1 -0
- package/{lib-esm/storage/adapter/AsyncStorageAdapter.js → dist/esm/storage/adapter/AsyncStorageAdapter.mjs} +10 -6
- package/dist/esm/storage/adapter/AsyncStorageAdapter.mjs.map +1 -0
- package/{lib-esm/storage/adapter/AsyncStorageDatabase.js → dist/esm/storage/adapter/AsyncStorageDatabase.mjs} +7 -4
- package/dist/esm/storage/adapter/AsyncStorageDatabase.mjs.map +1 -0
- package/{lib-esm/storage/adapter/InMemoryStore.js → dist/esm/storage/adapter/InMemoryStore.mjs} +5 -2
- package/dist/esm/storage/adapter/InMemoryStore.mjs.map +1 -0
- package/{lib-esm/storage/adapter/InMemoryStore.native.js → dist/esm/storage/adapter/InMemoryStore.native.mjs} +6 -2
- package/dist/esm/storage/adapter/InMemoryStore.native.mjs.map +1 -0
- package/{lib-esm/storage/adapter/IndexedDBAdapter.js → dist/esm/storage/adapter/IndexedDBAdapter.mjs} +10 -6
- package/dist/esm/storage/adapter/IndexedDBAdapter.mjs.map +1 -0
- package/{lib-esm/storage/adapter/StorageAdapterBase.js → dist/esm/storage/adapter/StorageAdapterBase.mjs} +9 -5
- package/dist/esm/storage/adapter/StorageAdapterBase.mjs.map +1 -0
- package/dist/esm/storage/adapter/getDefaultAdapter/index.mjs +13 -0
- package/dist/esm/storage/adapter/getDefaultAdapter/index.mjs.map +1 -0
- package/dist/esm/storage/adapter/getDefaultAdapter/index.native.mjs +8 -0
- package/dist/esm/storage/adapter/getDefaultAdapter/index.native.mjs.map +1 -0
- package/dist/esm/storage/adapter/index.mjs +2 -0
- package/dist/esm/storage/adapter/index.mjs.map +1 -0
- package/{lib-esm/storage/relationship.js → dist/esm/storage/relationship.mjs} +6 -2
- package/dist/esm/storage/relationship.mjs.map +1 -0
- package/{lib-esm/storage/storage.js → dist/esm/storage/storage.mjs} +11 -8
- package/dist/esm/storage/storage.mjs.map +1 -0
- package/{lib-esm/sync/datastoreConnectivity.js → dist/esm/sync/datastoreConnectivity.mjs} +9 -5
- package/dist/esm/sync/datastoreConnectivity.mjs.map +1 -0
- package/dist/esm/sync/datastoreReachability/index.d.ts +1 -0
- package/{lib-esm/sync/datastoreReachability/index.js → dist/esm/sync/datastoreReachability/index.mjs} +6 -2
- package/dist/esm/sync/datastoreReachability/index.mjs.map +1 -0
- package/dist/esm/sync/datastoreReachability/index.native.d.ts +1 -0
- package/{lib-esm/sync/datastoreReachability/index.native.js → dist/esm/sync/datastoreReachability/index.native.mjs} +7 -3
- package/dist/esm/sync/datastoreReachability/index.native.mjs.map +1 -0
- package/{lib-esm/sync/index.js → dist/esm/sync/index.mjs} +24 -21
- package/dist/esm/sync/index.mjs.map +1 -0
- package/{lib-esm/sync/merger.js → dist/esm/sync/merger.mjs} +5 -2
- package/dist/esm/sync/merger.mjs.map +1 -0
- package/{lib-esm/sync/outbox.js → dist/esm/sync/outbox.mjs} +7 -4
- package/dist/esm/sync/outbox.mjs.map +1 -0
- package/{lib-esm/sync/processors/errorMaps.js → dist/esm/sync/processors/errorMaps.mjs} +13 -11
- package/dist/esm/sync/processors/errorMaps.mjs.map +1 -0
- package/{lib → dist/esm}/sync/processors/mutation.d.ts +1 -1
- package/{lib-esm/sync/processors/mutation.js → dist/esm/sync/processors/mutation.mjs} +10 -7
- package/dist/esm/sync/processors/mutation.mjs.map +1 -0
- package/{lib-esm/sync/processors/subscription.js → dist/esm/sync/processors/subscription.mjs} +18 -17
- package/dist/esm/sync/processors/subscription.mjs.map +1 -0
- package/{lib-esm/sync/processors/sync.js → dist/esm/sync/processors/sync.mjs} +8 -5
- package/dist/esm/sync/processors/sync.mjs.map +1 -0
- package/{lib-esm/sync/utils.js → dist/esm/sync/utils.mjs} +30 -26
- package/dist/esm/sync/utils.mjs.map +1 -0
- package/{lib-esm/types.js → dist/esm/types.mjs} +34 -30
- package/dist/esm/types.mjs.map +1 -0
- package/{lib-esm/util.js → dist/esm/util.mjs} +61 -57
- package/dist/esm/util.mjs.map +1 -0
- package/package.json +133 -137
- package/lib/authModeStrategies/defaultAuthStrategy.d.ts +0 -2
- package/lib/authModeStrategies/index.d.ts +0 -2
- package/lib/authModeStrategies/multiAuthStrategy.d.ts +0 -13
- package/lib/datastore/datastore.d.ts +0 -231
- package/lib/index.d.ts +0 -16
- package/lib/predicates/index.d.ts +0 -100
- package/lib/predicates/next.d.ts +0 -317
- package/lib/predicates/sort.d.ts +0 -8
- package/lib/ssr/index.d.ts +0 -3
- package/lib/ssr/index.js +0 -18
- package/lib/storage/adapter/AsyncStorageAdapter.d.ts +0 -40
- package/lib/storage/adapter/AsyncStorageDatabase.d.ts +0 -39
- package/lib/storage/adapter/InMemoryStore.d.ts +0 -11
- package/lib/storage/adapter/InMemoryStore.native.d.ts +0 -1
- package/lib/storage/adapter/IndexedDBAdapter.d.ts +0 -70
- package/lib/storage/adapter/StorageAdapterBase.d.ts +0 -134
- package/lib/storage/adapter/getDefaultAdapter/index.d.ts +0 -3
- package/lib/storage/adapter/getDefaultAdapter/index.native.d.ts +0 -3
- package/lib/storage/adapter/getDefaultAdapter/index.native.js +0 -10
- package/lib/storage/adapter/index.d.ts +0 -9
- package/lib/storage/relationship.d.ts +0 -149
- package/lib/storage/storage.d.ts +0 -50
- package/lib/sync/datastoreConnectivity.d.ts +0 -16
- package/lib/sync/datastoreReachability/index.d.ts +0 -1
- package/lib/sync/datastoreReachability/index.native.d.ts +0 -1
- package/lib/sync/index.d.ts +0 -103
- package/lib/sync/merger.d.ts +0 -17
- package/lib/sync/outbox.d.ts +0 -27
- package/lib/sync/processors/errorMaps.d.ts +0 -17
- package/lib/sync/processors/subscription.d.ts +0 -42
- package/lib/sync/processors/sync.d.ts +0 -28
- package/lib/sync/utils.d.ts +0 -107
- package/lib/tsconfig.tsbuildinfo +0 -1
- package/lib/types.d.ts +0 -641
- package/lib/util.d.ts +0 -196
- package/lib-esm/authModeStrategies/index.js +0 -4
- package/lib-esm/index.js +0 -14
- package/lib-esm/ssr/index.d.ts +0 -3
- package/lib-esm/ssr/index.js +0 -13
- package/lib-esm/storage/adapter/getDefaultAdapter/index.js +0 -10
- package/lib-esm/storage/adapter/getDefaultAdapter/index.native.js +0 -5
- package/lib-esm/storage/adapter/index.js +0 -1
- package/lib-esm/sync/datastoreReachability/index.d.ts +0 -1
- package/lib-esm/sync/datastoreReachability/index.native.d.ts +0 -1
- package/lib-esm/sync/processors/mutation.d.ts +0 -67
- package/lib-esm/tsconfig.tsbuildinfo +0 -1
- package/src/ssr/index.ts +0 -27
- package/ssr/package.json +0 -8
- /package/{lib-esm → dist/esm}/authModeStrategies/defaultAuthStrategy.d.ts +0 -0
- /package/{lib-esm → dist/esm}/authModeStrategies/index.d.ts +0 -0
- /package/{lib-esm → dist/esm}/authModeStrategies/multiAuthStrategy.d.ts +0 -0
- /package/{lib-esm → dist/esm}/datastore/datastore.d.ts +0 -0
- /package/{lib-esm → dist/esm}/index.d.ts +0 -0
- /package/{lib-esm → dist/esm}/predicates/index.d.ts +0 -0
- /package/{lib-esm → dist/esm}/predicates/next.d.ts +0 -0
- /package/{lib-esm → dist/esm}/predicates/sort.d.ts +0 -0
- /package/{lib-esm → dist/esm}/storage/adapter/AsyncStorageAdapter.d.ts +0 -0
- /package/{lib-esm → dist/esm}/storage/adapter/AsyncStorageDatabase.d.ts +0 -0
- /package/{lib-esm → dist/esm}/storage/adapter/InMemoryStore.d.ts +0 -0
- /package/{lib-esm → dist/esm}/storage/adapter/InMemoryStore.native.d.ts +0 -0
- /package/{lib-esm → dist/esm}/storage/adapter/IndexedDBAdapter.d.ts +0 -0
- /package/{lib-esm → dist/esm}/storage/adapter/StorageAdapterBase.d.ts +0 -0
- /package/{lib-esm → dist/esm}/storage/adapter/getDefaultAdapter/index.d.ts +0 -0
- /package/{lib-esm → dist/esm}/storage/adapter/getDefaultAdapter/index.native.d.ts +0 -0
- /package/{lib-esm → dist/esm}/storage/adapter/index.d.ts +0 -0
- /package/{lib-esm → dist/esm}/storage/relationship.d.ts +0 -0
- /package/{lib-esm → dist/esm}/storage/storage.d.ts +0 -0
- /package/{lib-esm → dist/esm}/sync/datastoreConnectivity.d.ts +0 -0
- /package/{lib-esm → dist/esm}/sync/index.d.ts +0 -0
- /package/{lib-esm → dist/esm}/sync/merger.d.ts +0 -0
- /package/{lib-esm → dist/esm}/sync/outbox.d.ts +0 -0
- /package/{lib-esm → dist/esm}/sync/processors/errorMaps.d.ts +0 -0
- /package/{lib-esm → dist/esm}/sync/processors/subscription.d.ts +0 -0
- /package/{lib-esm → dist/esm}/sync/processors/sync.d.ts +0 -0
- /package/{lib-esm → dist/esm}/sync/utils.d.ts +0 -0
- /package/{lib-esm → dist/esm}/types.d.ts +0 -0
- /package/{lib-esm → dist/esm}/util.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutation.js","sources":["../../../../src/sync/processors/mutation.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MutationProcessor = exports.safeJitteredBackoff = void 0;\nconst internals_1 = require(\"@aws-amplify/api/internals\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst rxjs_1 = require(\"rxjs\");\nconst types_1 = require(\"../../types\");\nconst util_1 = require(\"../../util\");\nconst utils_2 = require(\"../utils\");\nconst errorMaps_1 = require(\"./errorMaps\");\nconst core_1 = require(\"@aws-amplify/core\");\nconst MAX_ATTEMPTS = 10;\nconst logger = new core_1.ConsoleLogger('DataStore');\nclass MutationProcessor {\n constructor(schema, storage, userClasses, outbox, modelInstanceCreator, MutationEvent, amplifyConfig = {}, authModeStrategy, errorHandler, conflictHandler, amplifyContext) {\n this.schema = schema;\n this.storage = storage;\n this.userClasses = userClasses;\n this.outbox = outbox;\n this.modelInstanceCreator = modelInstanceCreator;\n this.MutationEvent = MutationEvent;\n this.amplifyConfig = amplifyConfig;\n this.authModeStrategy = authModeStrategy;\n this.errorHandler = errorHandler;\n this.conflictHandler = conflictHandler;\n this.amplifyContext = amplifyContext;\n this.typeQuery = new WeakMap();\n this.processing = false;\n this.runningProcesses = new utils_1.BackgroundProcessManager();\n this.amplifyContext.InternalAPI =\n this.amplifyContext.InternalAPI || internals_1.InternalAPI;\n this.generateQueries();\n }\n generateQueries() {\n Object.values(this.schema.namespaces).forEach(namespace => {\n Object.values(namespace.models)\n .filter(({ syncable }) => syncable)\n .forEach(model => {\n const [createMutation] = (0, utils_2.buildGraphQLOperation)(namespace, model, 'CREATE');\n const [updateMutation] = (0, utils_2.buildGraphQLOperation)(namespace, model, 'UPDATE');\n const [deleteMutation] = (0, utils_2.buildGraphQLOperation)(namespace, model, 'DELETE');\n this.typeQuery.set(model, [\n createMutation,\n updateMutation,\n deleteMutation,\n ]);\n });\n });\n }\n isReady() {\n return this.observer !== undefined;\n }\n start() {\n this.runningProcesses = new utils_1.BackgroundProcessManager();\n const observable = new rxjs_1.Observable(observer => {\n this.observer = observer;\n try {\n this.resume();\n }\n catch (error) {\n logger.error('mutations processor start error', error);\n throw error;\n }\n return this.runningProcesses.addCleaner(async () => {\n // The observer has unsubscribed and/or `stop()` has been called.\n this.removeObserver();\n this.pause();\n });\n });\n return observable;\n }\n async stop() {\n this.removeObserver();\n await this.runningProcesses.close();\n await this.runningProcesses.open();\n }\n removeObserver() {\n this.observer?.complete?.();\n this.observer = undefined;\n }\n async resume() {\n if (this.runningProcesses.isOpen) {\n await this.runningProcesses.add(async (onTerminate) => {\n if (this.processing ||\n !this.isReady() ||\n !this.runningProcesses.isOpen) {\n return;\n }\n this.processing = true;\n let head;\n const namespaceName = util_1.USER;\n // start to drain outbox\n while (this.processing &&\n this.runningProcesses.isOpen &&\n (head = await this.outbox.peek(this.storage)) !== undefined) {\n const { model, operation, data, condition } = head;\n const modelConstructor = this.userClasses[model];\n let result = undefined;\n let opName = undefined;\n let modelDefinition = undefined;\n try {\n const modelAuthModes = await (0, utils_2.getModelAuthModes)({\n authModeStrategy: this.authModeStrategy,\n defaultAuthMode: this.amplifyConfig.aws_appsync_authenticationType,\n modelName: model,\n schema: this.schema,\n });\n const operationAuthModes = modelAuthModes[operation.toUpperCase()];\n let authModeAttempts = 0;\n const authModeRetry = async () => {\n try {\n logger.debug(`Attempting mutation with authMode: ${operationAuthModes[authModeAttempts]}`);\n const response = await this.jitteredRetry(namespaceName, model, operation, data, condition, modelConstructor, this.MutationEvent, head, operationAuthModes[authModeAttempts], onTerminate);\n logger.debug(`Mutation sent successfully with authMode: ${operationAuthModes[authModeAttempts]}`);\n return response;\n }\n catch (error) {\n authModeAttempts++;\n if (authModeAttempts >= operationAuthModes.length) {\n logger.debug(`Mutation failed with authMode: ${operationAuthModes[authModeAttempts - 1]}`);\n try {\n await this.errorHandler({\n recoverySuggestion: 'Ensure app code is up to date, auth directives exist and are correct on each model, and that server-side data has not been invalidated by a schema change. If the problem persists, search for or create an issue: https://github.com/aws-amplify/amplify-js/issues',\n localModel: null,\n message: error.message,\n model: modelConstructor.name,\n operation: opName,\n errorType: (0, errorMaps_1.getMutationErrorType)(error),\n process: types_1.ProcessName.sync,\n remoteModel: null,\n cause: error,\n });\n }\n catch (e) {\n logger.error('Mutation error handler failed with:', e);\n }\n throw error;\n }\n logger.debug(`Mutation failed with authMode: ${operationAuthModes[authModeAttempts - 1]}. Retrying with authMode: ${operationAuthModes[authModeAttempts]}`);\n return await authModeRetry();\n }\n };\n [result, opName, modelDefinition] = await authModeRetry();\n }\n catch (error) {\n if (error.message === 'Offline' ||\n error.message === 'RetryMutation') {\n continue;\n }\n }\n if (result === undefined) {\n logger.debug('done retrying');\n await this.storage.runExclusive(async (storage) => {\n await this.outbox.dequeue(storage);\n });\n continue;\n }\n const record = result.data[opName];\n let hasMore = false;\n await this.storage.runExclusive(async (storage) => {\n // using runExclusive to prevent possible race condition\n // when another record gets enqueued between dequeue and peek\n await this.outbox.dequeue(storage, record, operation);\n hasMore = (await this.outbox.peek(storage)) !== undefined;\n });\n this.observer?.next?.({\n operation,\n modelDefinition,\n model: record,\n hasMore,\n });\n }\n // pauses itself\n this.pause();\n }, 'mutation resume loop');\n }\n }\n async jitteredRetry(namespaceName, model, operation, data, condition, modelConstructor, MutationEvent, mutationEvent, authMode, onTerminate) {\n return await (0, utils_1.retry)(async (model, operation, data, condition, modelConstructor, MutationEvent, mutationEvent) => {\n const [query, variables, graphQLCondition, opName, modelDefinition] = this.createQueryVariables(namespaceName, model, operation, data, condition);\n const authToken = await (0, utils_2.getTokenForCustomAuth)(authMode, this.amplifyConfig);\n const tryWith = {\n query,\n variables,\n authMode,\n authToken,\n };\n let attempt = 0;\n const opType = this.opTypeFromTransformerOperation(operation);\n const customUserAgentDetails = {\n category: utils_1.Category.DataStore,\n action: utils_1.DataStoreAction.GraphQl,\n };\n do {\n try {\n const result = (await this.amplifyContext.InternalAPI.graphql(tryWith, undefined, customUserAgentDetails));\n // Use `as any` because TypeScript doesn't seem to like passing tuples\n // through generic params.\n return [result, opName, modelDefinition];\n }\n catch (err) {\n if (err.errors && err.errors.length > 0) {\n const [error] = err.errors;\n const { originalError: { code = null } = {} } = error;\n if (error.errorType === 'Unauthorized') {\n throw new utils_1.NonRetryableError('Unauthorized');\n }\n if (error.message === 'Network Error' ||\n code === 'ECONNABORTED' // refers to axios timeout error caused by device's bad network condition\n ) {\n if (!this.processing) {\n throw new utils_1.NonRetryableError('Offline');\n }\n // TODO: Check errors on different env (react-native or other browsers)\n throw new Error('Network Error');\n }\n if (error.errorType === 'ConflictUnhandled') {\n // TODO: add on ConflictConditionalCheck error query last from server\n attempt++;\n let retryWith;\n if (attempt > MAX_ATTEMPTS) {\n retryWith = types_1.DISCARD;\n }\n else {\n try {\n retryWith = await this.conflictHandler({\n modelConstructor,\n localModel: this.modelInstanceCreator(modelConstructor, variables.input),\n remoteModel: this.modelInstanceCreator(modelConstructor, error.data),\n operation: opType,\n attempts: attempt,\n });\n }\n catch (err) {\n logger.warn('conflict trycatch', err);\n continue;\n }\n }\n if (retryWith === types_1.DISCARD) {\n // Query latest from server and notify merger\n const [[, opName, query]] = (0, utils_2.buildGraphQLOperation)(this.schema.namespaces[namespaceName], modelDefinition, 'GET');\n const authToken = await (0, utils_2.getTokenForCustomAuth)(authMode, this.amplifyConfig);\n const serverData = await this.amplifyContext.InternalAPI.graphql({\n query,\n variables: { id: variables.input.id },\n authMode,\n authToken,\n }, undefined, customUserAgentDetails);\n // onTerminate cancel graphql()\n return [serverData, opName, modelDefinition];\n }\n const namespace = this.schema.namespaces[namespaceName];\n // convert retry with to tryWith\n const updatedMutation = (0, utils_2.createMutationInstanceFromModelOperation)(namespace.relationships, modelDefinition, opType, modelConstructor, retryWith, graphQLCondition, MutationEvent, this.modelInstanceCreator, mutationEvent.id);\n await this.storage.save(updatedMutation);\n throw new utils_1.NonRetryableError('RetryMutation');\n }\n else {\n try {\n this.errorHandler({\n recoverySuggestion: 'Ensure app code is up to date, auth directives exist and are correct on each model, and that server-side data has not been invalidated by a schema change. If the problem persists, search for or create an issue: https://github.com/aws-amplify/amplify-js/issues',\n localModel: variables.input,\n message: error.message,\n operation,\n errorType: (0, errorMaps_1.getMutationErrorType)(error),\n errorInfo: error.errorInfo,\n process: types_1.ProcessName.mutate,\n cause: error,\n remoteModel: error.data\n ? this.modelInstanceCreator(modelConstructor, error.data)\n : null,\n });\n }\n catch (err) {\n logger.warn('Mutation error handler failed with:', err);\n }\n finally {\n // Return empty tuple, dequeues the mutation\n return error.data\n ? [\n { data: { [opName]: error.data } },\n opName,\n modelDefinition,\n ]\n : [];\n }\n }\n }\n else {\n // Catch-all for client-side errors that don't come back in the `GraphQLError` format.\n // These errors should not be retried.\n throw new utils_1.NonRetryableError(err);\n }\n }\n } while (tryWith);\n }, [\n model,\n operation,\n data,\n condition,\n modelConstructor,\n MutationEvent,\n mutationEvent,\n ], exports.safeJitteredBackoff, onTerminate);\n }\n createQueryVariables(namespaceName, model, operation, data, condition) {\n const modelDefinition = this.schema.namespaces[namespaceName].models[model];\n const { primaryKey } = this.schema.namespaces[namespaceName].keys[model];\n const auth = modelDefinition.attributes?.find(a => a.type === 'auth');\n const ownerFields = auth?.properties?.rules\n .map(rule => rule.ownerField)\n .filter(f => f) || ['owner'];\n const queriesTuples = this.typeQuery.get(modelDefinition);\n const [, opName, query] = queriesTuples.find(([transformerMutationType]) => transformerMutationType === operation);\n const { _version, ...parsedData } = JSON.parse(data);\n // include all the fields that comprise a custom PK if one is specified\n const deleteInput = {};\n if (primaryKey && primaryKey.length) {\n for (const pkField of primaryKey) {\n deleteInput[pkField] = parsedData[pkField];\n }\n }\n else {\n deleteInput[util_1.ID] = parsedData.id;\n }\n let mutationInput;\n if (operation === utils_2.TransformerMutationType.DELETE) {\n // For DELETE mutations, only the key(s) are included in the input\n mutationInput = deleteInput;\n }\n else {\n // Otherwise, we construct the mutation input with the following logic\n mutationInput = {};\n const modelFields = Object.values(modelDefinition.fields);\n for (const { name, type, association, isReadOnly } of modelFields) {\n // omit readonly fields. cloud storage doesn't need them and won't take them!\n if (isReadOnly) {\n continue;\n }\n // omit owner fields if it's `null`. cloud storage doesn't allow it.\n if (ownerFields.includes(name) && parsedData[name] === null) {\n continue;\n }\n // model fields should be stripped out from the input\n if ((0, types_1.isModelFieldType)(type)) {\n // except for belongs to relations - we need to replace them with the correct foreign key(s)\n if ((0, types_1.isTargetNameAssociation)(association) &&\n association.connectionType === 'BELONGS_TO') {\n const targetNames = (0, util_1.extractTargetNamesFromSrc)(association);\n if (targetNames) {\n // instead of including the connected model itself, we add its key(s) to the mutation input\n for (const targetName of targetNames) {\n mutationInput[targetName] = parsedData[targetName];\n }\n }\n }\n continue;\n }\n // scalar fields / non-model types\n if (operation === utils_2.TransformerMutationType.UPDATE) {\n if (!parsedData.hasOwnProperty(name)) {\n // for update mutations - strip out a field if it's unchanged\n continue;\n }\n }\n // all other fields are added to the input object\n mutationInput[name] = parsedData[name];\n }\n }\n // Build mutation variables input object\n const input = {\n ...mutationInput,\n _version,\n };\n const graphQLCondition = JSON.parse(condition);\n const variables = {\n input,\n ...(operation === utils_2.TransformerMutationType.CREATE\n ? {}\n : {\n condition: Object.keys(graphQLCondition).length > 0\n ? graphQLCondition\n : null,\n }),\n };\n return [query, variables, graphQLCondition, opName, modelDefinition];\n }\n opTypeFromTransformerOperation(operation) {\n switch (operation) {\n case utils_2.TransformerMutationType.CREATE:\n return types_1.OpType.INSERT;\n case utils_2.TransformerMutationType.DELETE:\n return types_1.OpType.DELETE;\n case utils_2.TransformerMutationType.UPDATE:\n return types_1.OpType.UPDATE;\n case utils_2.TransformerMutationType.GET: // Intentionally blank\n break;\n default:\n throw new Error(`Invalid operation ${operation}`);\n }\n // because it makes TS happy ...\n return undefined;\n }\n pause() {\n this.processing = false;\n }\n}\nexports.MutationProcessor = MutationProcessor;\nconst MAX_RETRY_DELAY_MS = 5 * 60 * 1000;\nconst originalJitteredBackoff = (0, utils_1.jitteredBackoff)(MAX_RETRY_DELAY_MS);\n/**\n * @private\n * Internal use of Amplify only.\n *\n * Wraps the jittered backoff calculation to retry Network Errors indefinitely.\n * Backs off according to original jittered retry logic until the original retry\n * logic hits its max. After this occurs, if the error is a Network Error, we\n * ignore the attempt count and return MAX_RETRY_DELAY_MS to retry forever (until\n * the request succeeds).\n *\n * @param attempt ignored\n * @param _args ignored\n * @param error tested to see if `.message` is 'Network Error'\n * @returns number | false :\n */\nconst safeJitteredBackoff = (attempt, _args, error) => {\n const attemptResult = originalJitteredBackoff(attempt);\n // If this is the last attempt and it is a network error, we retry indefinitively every 5 minutes\n if (attemptResult === false &&\n (error || {}).message === 'Network Error') {\n return MAX_RETRY_DELAY_MS;\n }\n return attemptResult;\n};\nexports.safeJitteredBackoff = safeJitteredBackoff;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,GAAG,KAAK,CAAC,CAAC;AACjE,MAAM,WAAW,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AAC1D,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAC;AAC7D,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC/B,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AACvC,MAAM,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AACrC,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACpC,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAC3C,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC5C,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;AACrD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OAAO,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;AAC9C,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AACzC,MAAM,uBAAuB,GAAG,IAAI,OAAO,CAAC,eAAe,EAAE,kBAAkB,CAAC,CAAC;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,mBAAmB,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,KAAK;AACvD,IAAI,MAAM,aAAa,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;AAC3D;AACA,IAAI,IAAI,aAAa,KAAK,KAAK;AAC/B,QAAQ,CAAC,KAAK,IAAI,EAAE,EAAE,OAAO,KAAK,eAAe,EAAE;AACnD,QAAQ,OAAO,kBAAkB,CAAC;AAClC,KAAK;AACL,IAAI,OAAO,aAAa,CAAC;AACzB,CAAC,CAAC;AACF,OAAO,CAAC,mBAAmB,GAAG,mBAAmB;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.SubscriptionProcessor = exports.USER_CREDENTIALS = exports.CONTROL_MSG = void 0;
|
|
4
5
|
const internals_1 = require("@aws-amplify/api/internals");
|
|
@@ -226,9 +227,7 @@ class SubscriptionProcessor {
|
|
|
226
227
|
this.drainBuffer();
|
|
227
228
|
},
|
|
228
229
|
error: async (subscriptionError) => {
|
|
229
|
-
const { errors: [{ message = '' } = {}], } = (
|
|
230
|
-
errors: [],
|
|
231
|
-
} = subscriptionError);
|
|
230
|
+
const { errors: [{ message = '' } = {}], } = (subscriptionError);
|
|
232
231
|
const isRTFError =
|
|
233
232
|
// only attempt catch if a filter variable was added to the subscription query
|
|
234
233
|
addFilter &&
|
|
@@ -370,3 +369,4 @@ class SubscriptionProcessor {
|
|
|
370
369
|
}
|
|
371
370
|
}
|
|
372
371
|
exports.SubscriptionProcessor = SubscriptionProcessor;
|
|
372
|
+
//# sourceMappingURL=subscription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.js","sources":["../../../../src/sync/processors/subscription.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SubscriptionProcessor = exports.USER_CREDENTIALS = exports.CONTROL_MSG = void 0;\nconst internals_1 = require(\"@aws-amplify/api/internals\");\nconst core_1 = require(\"@aws-amplify/core\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst rxjs_1 = require(\"rxjs\");\nconst types_1 = require(\"../../types\");\nconst utils_2 = require(\"../utils\");\nconst predicates_1 = require(\"../../predicates\");\nconst util_1 = require(\"../../util\");\nconst errorMaps_1 = require(\"./errorMaps\");\nconst api_graphql_1 = require(\"@aws-amplify/api-graphql\");\nconst logger = new core_1.ConsoleLogger('DataStore');\nvar CONTROL_MSG;\n(function (CONTROL_MSG) {\n CONTROL_MSG[\"CONNECTED\"] = \"CONNECTED\";\n})(CONTROL_MSG = exports.CONTROL_MSG || (exports.CONTROL_MSG = {}));\nvar USER_CREDENTIALS;\n(function (USER_CREDENTIALS) {\n USER_CREDENTIALS[USER_CREDENTIALS[\"none\"] = 0] = \"none\";\n USER_CREDENTIALS[USER_CREDENTIALS[\"unauth\"] = 1] = \"unauth\";\n USER_CREDENTIALS[USER_CREDENTIALS[\"auth\"] = 2] = \"auth\";\n})(USER_CREDENTIALS = exports.USER_CREDENTIALS || (exports.USER_CREDENTIALS = {}));\nclass SubscriptionProcessor {\n constructor(schema, syncPredicates, amplifyConfig = {}, authModeStrategy, errorHandler, amplifyContext = {\n InternalAPI: internals_1.InternalAPI,\n }) {\n this.schema = schema;\n this.syncPredicates = syncPredicates;\n this.amplifyConfig = amplifyConfig;\n this.authModeStrategy = authModeStrategy;\n this.errorHandler = errorHandler;\n this.amplifyContext = amplifyContext;\n this.typeQuery = new WeakMap();\n this.buffer = [];\n this.runningProcesses = new utils_1.BackgroundProcessManager();\n }\n buildSubscription(namespace, model, transformerMutationType, userCredentials, oidcTokenPayload, authMode, filterArg = false) {\n const { aws_appsync_authenticationType } = this.amplifyConfig;\n const { isOwner, ownerField, ownerValue } = this.getAuthorizationInfo(model, userCredentials, aws_appsync_authenticationType, oidcTokenPayload, authMode) || {};\n const [opType, opName, query] = (0, utils_2.buildSubscriptionGraphQLOperation)(namespace, model, transformerMutationType, isOwner, ownerField, filterArg);\n return { authMode, opType, opName, query, isOwner, ownerField, ownerValue };\n }\n getAuthorizationInfo(model, userCredentials, defaultAuthType, oidcTokenPayload, authMode) {\n const rules = (0, utils_2.getAuthorizationRules)(model);\n // Return null if user doesn't have proper credentials for private API with IAM auth\n const iamPrivateAuth = authMode === 'iam' &&\n rules.find(rule => rule.authStrategy === 'private' && rule.provider === 'iam');\n if (iamPrivateAuth && userCredentials === USER_CREDENTIALS.unauth) {\n return null;\n }\n // Group auth should take precedence over owner auth, so we are checking\n // if rule(s) have group authorization as well as if either the Cognito or\n // OIDC token has a groupClaim. If so, we are returning auth info before\n // any further owner-based auth checks.\n const groupAuthRules = rules.filter(rule => rule.authStrategy === 'groups' &&\n ['userPools', 'oidc'].includes(rule.provider));\n const validGroup = (authMode === 'oidc' || authMode === 'userPool') &&\n groupAuthRules.find(groupAuthRule => {\n // validate token against groupClaim\n if (oidcTokenPayload) {\n const oidcUserGroups = (0, utils_2.getUserGroupsFromToken)(oidcTokenPayload, groupAuthRule);\n return [...oidcUserGroups].find(userGroup => {\n return groupAuthRule.groups.find(group => group === userGroup);\n });\n }\n });\n if (validGroup) {\n return {\n authMode,\n isOwner: false,\n };\n }\n let ownerAuthInfo;\n if (ownerAuthInfo) {\n return ownerAuthInfo;\n }\n // Owner auth needs additional values to be returned in order to create the subscription with\n // the correct parameters so we are getting the owner value from the OIDC token via the\n // identityClaim from the auth rule.\n const oidcOwnerAuthRules = authMode === 'oidc' || authMode === 'userPool'\n ? rules.filter(rule => rule.authStrategy === 'owner' &&\n (rule.provider === 'oidc' || rule.provider === 'userPools'))\n : [];\n oidcOwnerAuthRules.forEach(ownerAuthRule => {\n const ownerValue = oidcTokenPayload[ownerAuthRule.identityClaim];\n const singleOwner = model.fields[ownerAuthRule.ownerField]?.isArray !== true;\n const isOwnerArgRequired = singleOwner && !ownerAuthRule.areSubscriptionsPublic;\n if (ownerValue) {\n ownerAuthInfo = {\n authMode,\n isOwner: isOwnerArgRequired,\n ownerField: ownerAuthRule.ownerField,\n ownerValue: String(ownerValue),\n };\n }\n });\n if (ownerAuthInfo) {\n return ownerAuthInfo;\n }\n // Fallback: return authMode or default auth type\n return {\n authMode: authMode || defaultAuthType,\n isOwner: false,\n };\n }\n hubQueryCompletionListener(completed, capsule) {\n const { payload: { event }, } = capsule;\n if (event === api_graphql_1.CONTROL_MSG.SUBSCRIPTION_ACK) {\n completed();\n }\n }\n start() {\n this.runningProcesses =\n this.runningProcesses || new utils_1.BackgroundProcessManager();\n const ctlObservable = new rxjs_1.Observable(observer => {\n const promises = [];\n // Creating subs for each model/operation combo so they can be unsubscribed\n // independently, since the auth retry behavior is asynchronous.\n let subscriptions = {};\n let oidcTokenPayload;\n let userCredentials = USER_CREDENTIALS.none;\n this.runningProcesses.add(async () => {\n try {\n // retrieving current AWS Credentials\n const credentials = (await (0, core_1.fetchAuthSession)()).tokens?.accessToken;\n userCredentials = credentials\n ? USER_CREDENTIALS.auth\n : USER_CREDENTIALS.unauth;\n }\n catch (err) {\n // best effort to get AWS credentials\n }\n try {\n // retrieving current token info from Cognito UserPools\n const session = await await (0, core_1.fetchAuthSession)();\n oidcTokenPayload = session.tokens?.idToken?.payload;\n }\n catch (err) {\n // best effort to get jwt from Cognito\n }\n Object.values(this.schema.namespaces).forEach(namespace => {\n Object.values(namespace.models)\n .filter(({ syncable }) => syncable)\n .forEach(modelDefinition => this.runningProcesses.isOpen &&\n this.runningProcesses.add(async () => {\n const modelAuthModes = await (0, utils_2.getModelAuthModes)({\n authModeStrategy: this.authModeStrategy,\n defaultAuthMode: this.amplifyConfig.aws_appsync_authenticationType,\n modelName: modelDefinition.name,\n schema: this.schema,\n });\n // subscriptions are created only based on the READ auth mode(s)\n const readAuthModes = modelAuthModes.READ;\n subscriptions = {\n ...subscriptions,\n [modelDefinition.name]: {\n [utils_2.TransformerMutationType.CREATE]: [],\n [utils_2.TransformerMutationType.UPDATE]: [],\n [utils_2.TransformerMutationType.DELETE]: [],\n },\n };\n const operations = [\n utils_2.TransformerMutationType.CREATE,\n utils_2.TransformerMutationType.UPDATE,\n utils_2.TransformerMutationType.DELETE,\n ];\n const operationAuthModeAttempts = {\n [utils_2.TransformerMutationType.CREATE]: 0,\n [utils_2.TransformerMutationType.UPDATE]: 0,\n [utils_2.TransformerMutationType.DELETE]: 0,\n };\n const predicatesGroup = predicates_1.ModelPredicateCreator.getPredicates(this.syncPredicates.get(modelDefinition), false);\n const addFilterArg = predicatesGroup !== undefined;\n // Retry subscriptions that failed for one of the following reasons:\n // 1. unauthorized - retry with next auth mode (if available)\n // 2. RTF error - retry without sending filter arg. (filtering will fall back to clientside)\n const subscriptionRetry = async (operation, addFilter = addFilterArg) => {\n const { opType: transformerMutationType, opName, query, isOwner, ownerField, ownerValue, authMode, } = this.buildSubscription(namespace, modelDefinition, operation, userCredentials, oidcTokenPayload, readAuthModes[operationAuthModeAttempts[operation]], addFilter);\n const authToken = await (0, utils_2.getTokenForCustomAuth)(authMode, this.amplifyConfig);\n const variables = {};\n const customUserAgentDetails = {\n category: utils_1.Category.DataStore,\n action: utils_1.DataStoreAction.Subscribe,\n };\n if (addFilter && predicatesGroup) {\n variables['filter'] =\n (0, utils_2.predicateToGraphQLFilter)(predicatesGroup);\n }\n if (isOwner) {\n if (!ownerValue) {\n observer.error('Owner field required, sign in is needed in order to perform this operation');\n return;\n }\n variables[ownerField] = ownerValue;\n }\n logger.debug(`Attempting ${operation} subscription with authMode: ${readAuthModes[operationAuthModeAttempts[operation]]}`);\n const queryObservable = this.amplifyContext.InternalAPI.graphql({\n query,\n variables,\n ...{ authMode },\n authToken,\n }, undefined, customUserAgentDetails);\n let subscriptionReadyCallback;\n // TODO: consider onTerminate.then(() => API.cancel(...))\n subscriptions[modelDefinition.name][transformerMutationType].push(queryObservable.subscribe({\n next: result => {\n const { data, errors } = result;\n if (Array.isArray(errors) && errors.length > 0) {\n const messages = errors.map(({ message }) => message);\n logger.warn(`Skipping incoming subscription. Messages: ${messages.join('\\n')}`);\n this.drainBuffer();\n return;\n }\n const predicatesGroup = predicates_1.ModelPredicateCreator.getPredicates(this.syncPredicates.get(modelDefinition), false);\n // @ts-ignore\n const { [opName]: record } = data;\n // checking incoming subscription against syncPredicate.\n // once AppSync implements filters on subscriptions, we'll be\n // able to set these when establishing the subscription instead.\n // Until then, we'll need to filter inbound\n if (this.passesPredicateValidation(record, predicatesGroup)) {\n this.pushToBuffer(transformerMutationType, modelDefinition, record);\n }\n this.drainBuffer();\n },\n error: async (subscriptionError) => {\n const { errors: [{ message = '' } = {}], } = ({\n errors: [],\n } = subscriptionError);\n const isRTFError = \n // only attempt catch if a filter variable was added to the subscription query\n addFilter &&\n this.catchRTFError(message, modelDefinition, predicatesGroup);\n // Catch RTF errors\n if (isRTFError) {\n // Unsubscribe and clear subscription array for model/operation\n subscriptions[modelDefinition.name][transformerMutationType].forEach(subscription => subscription.unsubscribe());\n subscriptions[modelDefinition.name][transformerMutationType] = [];\n // retry subscription connection without filter\n subscriptionRetry(operation, false);\n return;\n }\n if (message.includes(api_graphql_1.CONTROL_MSG.REALTIME_SUBSCRIPTION_INIT_ERROR) ||\n message.includes(api_graphql_1.CONTROL_MSG.CONNECTION_FAILED)) {\n // Unsubscribe and clear subscription array for model/operation\n subscriptions[modelDefinition.name][transformerMutationType].forEach(subscription => subscription.unsubscribe());\n subscriptions[modelDefinition.name][transformerMutationType] = [];\n operationAuthModeAttempts[operation]++;\n if (operationAuthModeAttempts[operation] >=\n readAuthModes.length) {\n // last auth mode retry. Continue with error\n logger.debug(`${operation} subscription failed with authMode: ${readAuthModes[operationAuthModeAttempts[operation] - 1]}`);\n }\n else {\n // retry with different auth mode. Do not trigger\n // observer error or error handler\n logger.debug(`${operation} subscription failed with authMode: ${readAuthModes[operationAuthModeAttempts[operation] - 1]}. Retrying with authMode: ${readAuthModes[operationAuthModeAttempts[operation]]}`);\n subscriptionRetry(operation);\n return;\n }\n }\n logger.warn('subscriptionError', message);\n try {\n await this.errorHandler({\n recoverySuggestion: 'Ensure app code is up to date, auth directives exist and are correct on each model, and that server-side data has not been invalidated by a schema change. If the problem persists, search for or create an issue: https://github.com/aws-amplify/amplify-js/issues',\n localModel: null,\n message,\n model: modelDefinition.name,\n operation,\n errorType: (0, errorMaps_1.getSubscriptionErrorType)(subscriptionError),\n process: types_1.ProcessName.subscribe,\n remoteModel: null,\n cause: subscriptionError,\n });\n }\n catch (e) {\n logger.error('Subscription error handler failed with:', e);\n }\n if (typeof subscriptionReadyCallback === 'function') {\n subscriptionReadyCallback();\n }\n if (message.includes('\"errorType\":\"Unauthorized\"') ||\n message.includes('\"errorType\":\"OperationDisabled\"')) {\n return;\n }\n observer.error(message);\n },\n }));\n promises.push((async () => {\n let boundFunction;\n let removeBoundFunctionListener;\n await new Promise(res => {\n subscriptionReadyCallback = res;\n boundFunction = this.hubQueryCompletionListener.bind(this, res);\n removeBoundFunctionListener = core_1.Hub.listen('api', boundFunction);\n });\n removeBoundFunctionListener();\n })());\n };\n operations.forEach(op => subscriptionRetry(op));\n }));\n });\n this.runningProcesses.isOpen &&\n this.runningProcesses.add(() => Promise.all(promises).then(() => {\n observer.next(CONTROL_MSG.CONNECTED);\n }));\n }, 'subscription processor new subscriber');\n return this.runningProcesses.addCleaner(async () => {\n Object.keys(subscriptions).forEach(modelName => {\n subscriptions[modelName][utils_2.TransformerMutationType.CREATE].forEach(subscription => subscription.unsubscribe());\n subscriptions[modelName][utils_2.TransformerMutationType.UPDATE].forEach(subscription => subscription.unsubscribe());\n subscriptions[modelName][utils_2.TransformerMutationType.DELETE].forEach(subscription => subscription.unsubscribe());\n });\n });\n });\n const dataObservable = new rxjs_1.Observable(observer => {\n this.dataObserver = observer;\n this.drainBuffer();\n return this.runningProcesses.addCleaner(async () => {\n this.dataObserver = null;\n });\n });\n return [ctlObservable, dataObservable];\n }\n async stop() {\n await this.runningProcesses.close();\n await this.runningProcesses.open();\n }\n passesPredicateValidation(record, predicatesGroup) {\n if (!predicatesGroup) {\n return true;\n }\n const { predicates, type } = predicatesGroup;\n return (0, util_1.validatePredicate)(record, type, predicates);\n }\n pushToBuffer(transformerMutationType, modelDefinition, data) {\n this.buffer.push([transformerMutationType, modelDefinition, data]);\n }\n drainBuffer() {\n if (this.dataObserver) {\n this.buffer.forEach(data => this.dataObserver.next(data));\n this.buffer = [];\n }\n }\n /**\n * @returns true if the service returned an RTF subscription error\n * @remarks logs a warning with remediation instructions\n *\n */\n catchRTFError(message, modelDefinition, predicatesGroup) {\n const header = 'Backend subscriptions filtering error.\\n' +\n 'Subscriptions filtering will be applied clientside.\\n';\n const messageErrorTypeMap = {\n 'UnknownArgument: Unknown field argument filter': utils_2.RTFError.UnknownField,\n 'Filters exceed maximum attributes limit': utils_2.RTFError.MaxAttributes,\n 'Filters combination exceed maximum limit': utils_2.RTFError.MaxCombinations,\n 'filter uses same fieldName multiple time': utils_2.RTFError.RepeatedFieldname,\n \"The variables input contains a field name 'not'\": utils_2.RTFError.NotGroup,\n 'The variables input contains a field that is not defined for input object type': utils_2.RTFError.FieldNotInType,\n };\n const [_errorMsg, errorType] = Object.entries(messageErrorTypeMap).find(([errorMsg]) => message.includes(errorMsg)) || [];\n if (errorType !== undefined) {\n const remediationMessage = (0, utils_2.generateRTFRemediation)(errorType, modelDefinition, predicatesGroup);\n logger.warn(`${header}\\n${message}\\n${remediationMessage}`);\n return true;\n }\n return false;\n }\n}\nexports.SubscriptionProcessor = SubscriptionProcessor;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO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,CAAC,cAAc;AAC7H,SAAS,CAAC;AACV,QAAQ,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;AAClI,QAAQ,IAAI,SAAS,KAAK,SAAS,EAAE;AACrC,YAAY,MAAM,kBAAkB,GAAG,IAAI,OAAO,CAAC,sBAAsB,EAAE,SAAS,EAAE,eAAe,EAAE,eAAe,CAAC,CAAC;AACxH,YAAY,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;AACxE,YAAY,OAAO,IAAI,CAAC;AACxB,SAAS;AACT,QAAQ,OAAO,KAAK,CAAC;AACrB,KAAK;AACL,CAAC;AACD,OAAO,CAAC,qBAAqB,GAAG,qBAAqB;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.SyncProcessor = void 0;
|
|
4
5
|
const internals_1 = require("@aws-amplify/api/internals");
|
|
@@ -317,3 +318,4 @@ class SyncProcessor {
|
|
|
317
318
|
}
|
|
318
319
|
}
|
|
319
320
|
exports.SyncProcessor = SyncProcessor;
|
|
321
|
+
//# sourceMappingURL=sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.js","sources":["../../../../src/sync/processors/sync.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SyncProcessor = void 0;\nconst internals_1 = require(\"@aws-amplify/api/internals\");\nconst rxjs_1 = require(\"rxjs\");\nconst types_1 = require(\"../../types\");\nconst utils_1 = require(\"../utils\");\nconst utils_2 = require(\"@aws-amplify/core/internals/utils\");\nconst core_1 = require(\"@aws-amplify/core\");\nconst predicates_1 = require(\"../../predicates\");\nconst errorMaps_1 = require(\"./errorMaps\");\nconst opResultDefaults = {\n items: [],\n nextToken: null,\n startedAt: null,\n};\nconst logger = new core_1.ConsoleLogger('DataStore');\nclass SyncProcessor {\n constructor(schema, syncPredicates, amplifyConfig = {}, authModeStrategy, errorHandler, amplifyContext) {\n this.schema = schema;\n this.syncPredicates = syncPredicates;\n this.amplifyConfig = amplifyConfig;\n this.authModeStrategy = authModeStrategy;\n this.errorHandler = errorHandler;\n this.amplifyContext = amplifyContext;\n this.typeQuery = new WeakMap();\n this.runningProcesses = new utils_2.BackgroundProcessManager();\n amplifyContext.InternalAPI = amplifyContext.InternalAPI || internals_1.InternalAPI;\n this.generateQueries();\n }\n generateQueries() {\n Object.values(this.schema.namespaces).forEach(namespace => {\n Object.values(namespace.models)\n .filter(({ syncable }) => syncable)\n .forEach(model => {\n const [[, ...opNameQuery]] = (0, utils_1.buildGraphQLOperation)(namespace, model, 'LIST');\n this.typeQuery.set(model, opNameQuery);\n });\n });\n }\n graphqlFilterFromPredicate(model) {\n if (!this.syncPredicates) {\n return null;\n }\n const predicatesGroup = predicates_1.ModelPredicateCreator.getPredicates(this.syncPredicates.get(model), false);\n if (!predicatesGroup) {\n return null;\n }\n return (0, utils_1.predicateToGraphQLFilter)(predicatesGroup);\n }\n async retrievePage(modelDefinition, lastSync, nextToken, limit = null, filter, onTerminate) {\n const [opName, query] = this.typeQuery.get(modelDefinition);\n const variables = {\n limit,\n nextToken,\n lastSync,\n filter,\n };\n const modelAuthModes = await (0, utils_1.getModelAuthModes)({\n authModeStrategy: this.authModeStrategy,\n defaultAuthMode: this.amplifyConfig.aws_appsync_authenticationType,\n modelName: modelDefinition.name,\n schema: this.schema,\n });\n // sync only needs the READ auth mode(s)\n const readAuthModes = modelAuthModes.READ;\n let authModeAttempts = 0;\n const authModeRetry = async () => {\n if (!this.runningProcesses.isOpen) {\n throw new Error('sync.retreievePage termination was requested. Exiting.');\n }\n try {\n logger.debug(`Attempting sync with authMode: ${readAuthModes[authModeAttempts]}`);\n const response = await this.jitteredRetry({\n query,\n variables,\n opName,\n modelDefinition,\n authMode: readAuthModes[authModeAttempts],\n onTerminate,\n });\n logger.debug(`Sync successful with authMode: ${readAuthModes[authModeAttempts]}`);\n return response;\n }\n catch (error) {\n authModeAttempts++;\n if (authModeAttempts >= readAuthModes.length) {\n const authMode = readAuthModes[authModeAttempts - 1];\n logger.debug(`Sync failed with authMode: ${authMode}`, error);\n if ((0, utils_1.getClientSideAuthError)(error) || (0, utils_1.getForbiddenError)(error)) {\n // return empty list of data so DataStore will continue to sync other models\n logger.warn(`User is unauthorized to query ${opName} with auth mode ${authMode}. No data could be returned.`);\n return {\n data: {\n [opName]: opResultDefaults,\n },\n };\n }\n throw error;\n }\n logger.debug(`Sync failed with authMode: ${readAuthModes[authModeAttempts - 1]}. Retrying with authMode: ${readAuthModes[authModeAttempts]}`);\n return await authModeRetry();\n }\n };\n const { data } = await authModeRetry();\n const { [opName]: opResult } = data;\n const { items, nextToken: newNextToken, startedAt } = opResult;\n return {\n nextToken: newNextToken,\n startedAt,\n items,\n };\n }\n async jitteredRetry({ query, variables, opName, modelDefinition, authMode, onTerminate, }) {\n return await (0, utils_2.jitteredExponentialRetry)(async (query, variables) => {\n try {\n const authToken = await (0, utils_1.getTokenForCustomAuth)(authMode, this.amplifyConfig);\n const customUserAgentDetails = {\n category: utils_2.Category.DataStore,\n action: utils_2.DataStoreAction.GraphQl,\n };\n return await this.amplifyContext.InternalAPI.graphql({\n query,\n variables,\n authMode,\n authToken,\n }, undefined, customUserAgentDetails);\n // TODO: onTerminate.then(() => API.cancel(...))\n }\n catch (error) {\n // Catch client-side (GraphQLAuthError) & 401/403 errors here so that we don't continue to retry\n const clientOrForbiddenErrorMessage = (0, utils_1.getClientSideAuthError)(error) || (0, utils_1.getForbiddenError)(error);\n if (clientOrForbiddenErrorMessage) {\n logger.error('Sync processor retry error:', error);\n throw new utils_2.NonRetryableError(clientOrForbiddenErrorMessage);\n }\n const hasItems = Boolean(error?.data?.[opName]?.items);\n const unauthorized = error?.errors &&\n error.errors.some(err => err.errorType === 'Unauthorized');\n const otherErrors = error?.errors &&\n error.errors.filter(err => err.errorType !== 'Unauthorized');\n const result = error;\n if (hasItems) {\n result.data[opName].items = result.data[opName].items.filter(item => item !== null);\n }\n if (hasItems && otherErrors?.length) {\n await Promise.all(otherErrors.map(async (err) => {\n try {\n await this.errorHandler({\n recoverySuggestion: 'Ensure app code is up to date, auth directives exist and are correct on each model, and that server-side data has not been invalidated by a schema change. If the problem persists, search for or create an issue: https://github.com/aws-amplify/amplify-js/issues',\n localModel: null,\n message: err.message,\n model: modelDefinition.name,\n operation: opName,\n errorType: (0, errorMaps_1.getSyncErrorType)(err),\n process: types_1.ProcessName.sync,\n remoteModel: null,\n cause: err,\n });\n }\n catch (e) {\n logger.error('Sync error handler failed with:', e);\n }\n }));\n core_1.Hub.dispatch('datastore', {\n event: 'nonApplicableDataReceived',\n data: {\n errors: otherErrors,\n modelName: modelDefinition.name,\n },\n });\n }\n /**\n * Handle $util.unauthorized() in resolver request mapper, which responses with something\n * like this:\n *\n * ```\n * {\n * \tdata: { syncYourModel: null },\n * \terrors: [\n * \t\t{\n * \t\t\tpath: ['syncLegacyJSONComments'],\n * \t\t\tdata: null,\n * \t\t\terrorType: 'Unauthorized',\n * \t\t\terrorInfo: null,\n * \t\t\tlocations: [{ line: 2, column: 3, sourceName: null }],\n * \t\t\tmessage:\n * \t\t\t\t'Not Authorized to access syncYourModel on type Query',\n * \t\t\t},\n * \t\t],\n * \t}\n * ```\n *\n * The correct handling for this is to signal that we've encountered a non-retryable error,\n * since the server has responded with an auth error and *NO DATA* at this point.\n */\n if (unauthorized) {\n this.errorHandler({\n recoverySuggestion: 'Ensure app code is up to date, auth directives exist and are correct on each model, and that server-side data has not been invalidated by a schema change. If the problem persists, search for or create an issue: https://github.com/aws-amplify/amplify-js/issues',\n localModel: null,\n message: error.message,\n model: modelDefinition.name,\n operation: opName,\n errorType: (0, errorMaps_1.getSyncErrorType)(error.errors[0]),\n process: types_1.ProcessName.sync,\n remoteModel: null,\n cause: error,\n });\n throw new utils_2.NonRetryableError(error);\n }\n if (result.data?.[opName]?.items?.length) {\n return result;\n }\n throw error;\n }\n }, [query, variables], undefined, onTerminate);\n }\n start(typesLastSync) {\n const { maxRecordsToSync, syncPageSize } = this.amplifyConfig;\n const parentPromises = new Map();\n const observable = new rxjs_1.Observable(observer => {\n const sortedTypesLastSyncs = Object.values(this.schema.namespaces).reduce((map, namespace) => {\n for (const modelName of Array.from(namespace.modelTopologicalOrdering.keys())) {\n const typeLastSync = typesLastSync.get(namespace.models[modelName]);\n map.set(namespace.models[modelName], typeLastSync);\n }\n return map;\n }, new Map());\n const allModelsReady = Array.from(sortedTypesLastSyncs.entries())\n .filter(([{ syncable }]) => syncable)\n .map(([modelDefinition, [namespace, lastSync]]) => this.runningProcesses.isOpen &&\n this.runningProcesses.add(async (onTerminate) => {\n let done = false;\n let nextToken = null;\n let startedAt = null;\n let items = null;\n let recordsReceived = 0;\n const filter = this.graphqlFilterFromPredicate(modelDefinition);\n const parents = this.schema.namespaces[namespace].modelTopologicalOrdering.get(modelDefinition.name);\n const promises = parents.map(parent => parentPromises.get(`${namespace}_${parent}`));\n const promise = new Promise(async (res) => {\n await Promise.all(promises);\n do {\n /**\n * If `runningProcesses` is not open, it means that the sync processor has been\n * stopped (for example by calling `DataStore.clear()` upstream) and has not yet\n * finished terminating and/or waiting for its background processes to complete.\n */\n if (!this.runningProcesses.isOpen) {\n logger.debug(`Sync processor has been stopped, terminating sync for ${modelDefinition.name}`);\n return res();\n }\n const limit = Math.min(maxRecordsToSync - recordsReceived, syncPageSize);\n /**\n * It's possible that `retrievePage` will fail.\n * If it does fail, continue merging the rest of the data,\n * and invoke the error handler for non-applicable data.\n */\n try {\n ({ items, nextToken, startedAt } = await this.retrievePage(modelDefinition, lastSync, nextToken, limit, filter, onTerminate));\n }\n catch (error) {\n try {\n await this.errorHandler({\n recoverySuggestion: 'Ensure app code is up to date, auth directives exist and are correct on each model, and that server-side data has not been invalidated by a schema change. If the problem persists, search for or create an issue: https://github.com/aws-amplify/amplify-js/issues',\n localModel: null,\n message: error.message,\n model: modelDefinition.name,\n operation: null,\n errorType: (0, errorMaps_1.getSyncErrorType)(error),\n process: types_1.ProcessName.sync,\n remoteModel: null,\n cause: error,\n });\n }\n catch (e) {\n logger.error('Sync error handler failed with:', e);\n }\n /**\n * If there's an error, this model fails, but the rest of the sync should\n * continue. To facilitate this, we explicitly mark this model as `done`\n * with no items and allow the loop to continue organically. This ensures\n * all callbacks (subscription messages) happen as normal, so anything\n * waiting on them knows the model is as done as it can be.\n */\n done = true;\n items = [];\n }\n recordsReceived += items.length;\n done =\n nextToken === null || recordsReceived >= maxRecordsToSync;\n observer.next({\n namespace,\n modelDefinition,\n items,\n done,\n startedAt,\n isFullSync: !lastSync,\n });\n } while (!done);\n res();\n });\n parentPromises.set(`${namespace}_${modelDefinition.name}`, promise);\n await promise;\n }, `adding model ${modelDefinition.name}`));\n Promise.all(allModelsReady).then(() => {\n observer.complete();\n });\n });\n return observable;\n }\n async stop() {\n logger.debug('stopping sync processor');\n await this.runningProcesses.close();\n await this.runningProcesses.open();\n logger.debug('sync processor stopped');\n }\n}\nexports.SyncProcessor = SyncProcessor;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC;AAC/B,MAAM,WAAW,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AAC1D,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC/B,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AACvC,MAAM,OA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getTokenForCustomAuth = exports.getClientSideAuthError = exports.resolveServiceErrorStatusCode = exports.getForbiddenError = exports.getModelAuthModes = exports.getUserGroupsFromToken = exports.generateRTFRemediation = exports.RTFError = exports.repeatedFieldInGroup = exports.countFilterCombinations = exports.dynamicAuthFields = exports.filterFields = exports.predicateToGraphQLFilter = exports.predicateToGraphQLCondition = exports.createMutationInstanceFromModelOperation = exports.buildGraphQLOperation = exports.buildSubscriptionGraphQLOperation = exports.getAuthorizationRules = exports.generateSelectionSet = exports.getMetadataFields = exports.TransformerMutationType = void 0;
|
|
4
5
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
@@ -697,3 +698,4 @@ function getIdentifierValue(modelDefinition, model) {
|
|
|
697
698
|
return idOrPk;
|
|
698
699
|
}
|
|
699
700
|
exports.getIdentifierValue = getIdentifierValue;
|
|
701
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../src/sync/utils.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIdentifierValue = exports.getTokenForCustomAuth = exports.getClientSideAuthError = exports.resolveServiceErrorStatusCode = exports.getForbiddenError = exports.getModelAuthModes = exports.getUserGroupsFromToken = exports.generateRTFRemediation = exports.RTFError = exports.repeatedFieldInGroup = exports.countFilterCombinations = exports.dynamicAuthFields = exports.filterFields = exports.predicateToGraphQLFilter = exports.predicateToGraphQLCondition = exports.createMutationInstanceFromModelOperation = exports.buildGraphQLOperation = exports.buildSubscriptionGraphQLOperation = exports.getAuthorizationRules = exports.generateSelectionSet = exports.getMetadataFields = exports.TransformerMutationType = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst api_1 = require(\"@aws-amplify/api\");\nconst types_1 = require(\"../types\");\nconst util_1 = require(\"../util\");\nconst core_1 = require(\"@aws-amplify/core\");\nconst logger = new core_1.ConsoleLogger('DataStore');\nvar GraphQLOperationType;\n(function (GraphQLOperationType) {\n GraphQLOperationType[\"LIST\"] = \"query\";\n GraphQLOperationType[\"CREATE\"] = \"mutation\";\n GraphQLOperationType[\"UPDATE\"] = \"mutation\";\n GraphQLOperationType[\"DELETE\"] = \"mutation\";\n GraphQLOperationType[\"GET\"] = \"query\";\n})(GraphQLOperationType || (GraphQLOperationType = {}));\nvar TransformerMutationType;\n(function (TransformerMutationType) {\n TransformerMutationType[\"CREATE\"] = \"Create\";\n TransformerMutationType[\"UPDATE\"] = \"Update\";\n TransformerMutationType[\"DELETE\"] = \"Delete\";\n TransformerMutationType[\"GET\"] = \"Get\";\n})(TransformerMutationType = exports.TransformerMutationType || (exports.TransformerMutationType = {}));\nconst dummyMetadata = {\n _version: undefined,\n _lastChangedAt: undefined,\n _deleted: undefined,\n};\nconst metadataFields = (Object.keys(dummyMetadata));\nfunction getMetadataFields() {\n return metadataFields;\n}\nexports.getMetadataFields = getMetadataFields;\nfunction generateSelectionSet(namespace, modelDefinition) {\n const scalarFields = getScalarFields(modelDefinition);\n const nonModelFields = getNonModelFields(namespace, modelDefinition);\n const implicitOwnerField = getImplicitOwnerField(modelDefinition, scalarFields);\n let scalarAndMetadataFields = Object.values(scalarFields)\n .map(({ name }) => name)\n .concat(implicitOwnerField)\n .concat(nonModelFields);\n if ((0, types_1.isSchemaModel)(modelDefinition)) {\n scalarAndMetadataFields = scalarAndMetadataFields\n .concat(getMetadataFields())\n .concat(getConnectionFields(modelDefinition, namespace));\n }\n const result = scalarAndMetadataFields.join('\\n');\n return result;\n}\nexports.generateSelectionSet = generateSelectionSet;\nfunction getImplicitOwnerField(modelDefinition, scalarFields) {\n const ownerFields = getOwnerFields(modelDefinition);\n if (!scalarFields.owner && ownerFields.includes('owner')) {\n return ['owner'];\n }\n return [];\n}\nfunction getOwnerFields(modelDefinition) {\n const ownerFields = [];\n if ((0, types_1.isSchemaModelWithAttributes)(modelDefinition)) {\n modelDefinition.attributes.forEach(attr => {\n if (attr.properties && attr.properties.rules) {\n const rule = attr.properties.rules.find(rule => rule.allow === 'owner');\n if (rule && rule.ownerField) {\n ownerFields.push(rule.ownerField);\n }\n }\n });\n }\n return ownerFields;\n}\nfunction getScalarFields(modelDefinition) {\n const { fields } = modelDefinition;\n const result = Object.values(fields)\n .filter(field => {\n if ((0, types_1.isGraphQLScalarType)(field.type) || (0, types_1.isEnumFieldType)(field.type)) {\n return true;\n }\n return false;\n })\n .reduce((acc, field) => {\n acc[field.name] = field;\n return acc;\n }, {});\n return result;\n}\n// Used for generating the selection set for queries and mutations\nfunction getConnectionFields(modelDefinition, namespace) {\n const result = [];\n Object.values(modelDefinition.fields)\n .filter(({ association }) => association && Object.keys(association).length)\n .forEach(({ name, association }) => {\n const { connectionType } = association || {};\n switch (connectionType) {\n case 'HAS_ONE':\n case 'HAS_MANY':\n // Intentionally blank\n break;\n case 'BELONGS_TO':\n if ((0, types_1.isTargetNameAssociation)(association)) {\n // New codegen (CPK)\n if (association.targetNames && association.targetNames.length > 0) {\n // Need to retrieve relations in order to get connected model keys\n const [relations] = (0, util_1.establishRelationAndKeys)(namespace);\n const connectedModelName = modelDefinition.fields[name].type['model'];\n const byPkIndex = relations[connectedModelName].indexes.find(([name]) => name === 'byPk');\n const keyFields = byPkIndex && byPkIndex[1];\n const keyFieldSelectionSet = keyFields?.join(' ');\n // We rely on `_deleted` when we process the sync query (e.g. in batchSave in the adapters)\n result.push(`${name} { ${keyFieldSelectionSet} _deleted }`);\n }\n else {\n // backwards-compatability for schema generated prior to custom primary key support\n result.push(`${name} { id _deleted }`);\n }\n }\n break;\n default:\n throw new Error(`Invalid connection type ${connectionType}`);\n }\n });\n return result;\n}\nfunction getNonModelFields(namespace, modelDefinition) {\n const result = [];\n Object.values(modelDefinition.fields).forEach(({ name, type }) => {\n if ((0, types_1.isNonModelFieldType)(type)) {\n const typeDefinition = namespace.nonModels[type.nonModel];\n const scalarFields = Object.values(getScalarFields(typeDefinition)).map(({ name }) => name);\n const nested = [];\n Object.values(typeDefinition.fields).forEach(field => {\n const { type, name } = field;\n if ((0, types_1.isNonModelFieldType)(type)) {\n const typeDefinition = namespace.nonModels[type.nonModel];\n nested.push(`${name} { ${generateSelectionSet(namespace, typeDefinition)} }`);\n }\n });\n result.push(`${name} { ${scalarFields.join(' ')} ${nested.join(' ')} }`);\n }\n });\n return result;\n}\nfunction getAuthorizationRules(modelDefinition) {\n // Searching for owner authorization on attributes\n const authConfig = []\n .concat(modelDefinition.attributes || [])\n .find(attr => attr && attr.type === 'auth');\n const { properties: { rules = [] } = {} } = authConfig || {};\n const resultRules = [];\n // Multiple rules can be declared for allow: owner\n rules.forEach(rule => {\n // setting defaults for backwards compatibility with old cli\n const { identityClaim = 'cognito:username', ownerField = 'owner', operations = ['create', 'update', 'delete', 'read'], provider = 'userPools', groupClaim = 'cognito:groups', allow: authStrategy = 'iam', groups = [], groupsField = '', } = rule;\n const isReadAuthorized = operations.includes('read');\n const isOwnerAuth = authStrategy === 'owner';\n if (!isReadAuthorized && !isOwnerAuth) {\n return;\n }\n const authRule = {\n identityClaim,\n ownerField,\n provider,\n groupClaim,\n authStrategy,\n groups,\n groupsField,\n areSubscriptionsPublic: false,\n };\n if (isOwnerAuth) {\n // look for the subscription level override\n // only pay attention to the public level\n const modelConfig = []\n .concat(modelDefinition.attributes || [])\n .find(attr => attr && attr.type === 'model');\n // find the subscriptions level. ON is default\n const { properties: { subscriptions: { level = 'on' } = {} } = {} } = modelConfig || {};\n // treat subscriptions as public for owner auth with unprotected reads\n // when `read` is omitted from `operations`\n authRule.areSubscriptionsPublic =\n !operations.includes('read') || level === 'public';\n }\n if (isOwnerAuth) {\n // owner rules has least priority\n resultRules.push(authRule);\n return;\n }\n resultRules.unshift(authRule);\n });\n return resultRules;\n}\nexports.getAuthorizationRules = getAuthorizationRules;\nfunction buildSubscriptionGraphQLOperation(namespace, modelDefinition, transformerMutationType, isOwnerAuthorization, ownerField, filterArg = false) {\n const selectionSet = generateSelectionSet(namespace, modelDefinition);\n const { name: typeName } = modelDefinition;\n const opName = `on${transformerMutationType}${typeName}`;\n const docArgs = [];\n const opArgs = [];\n if (filterArg) {\n docArgs.push(`$filter: ModelSubscription${typeName}FilterInput`);\n opArgs.push('filter: $filter');\n }\n if (isOwnerAuthorization) {\n docArgs.push(`$${ownerField}: String!`);\n opArgs.push(`${ownerField}: $${ownerField}`);\n }\n const docStr = docArgs.length ? `(${docArgs.join(',')})` : '';\n const opStr = opArgs.length ? `(${opArgs.join(',')})` : '';\n return [\n transformerMutationType,\n opName,\n `subscription operation${docStr}{\n\t\t\t${opName}${opStr}{\n\t\t\t\t${selectionSet}\n\t\t\t}\n\t\t}`,\n ];\n}\nexports.buildSubscriptionGraphQLOperation = buildSubscriptionGraphQLOperation;\nfunction buildGraphQLOperation(namespace, modelDefinition, graphQLOpType) {\n let selectionSet = generateSelectionSet(namespace, modelDefinition);\n const { name: typeName, pluralName: pluralTypeName } = modelDefinition;\n let operation;\n let documentArgs;\n let operationArgs;\n let transformerMutationType;\n switch (graphQLOpType) {\n case 'LIST':\n operation = `sync${pluralTypeName}`;\n documentArgs = `($limit: Int, $nextToken: String, $lastSync: AWSTimestamp, $filter: Model${typeName}FilterInput)`;\n operationArgs =\n '(limit: $limit, nextToken: $nextToken, lastSync: $lastSync, filter: $filter)';\n selectionSet = `items {\n\t\t\t\t\t\t\t${selectionSet}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnextToken\n\t\t\t\t\t\tstartedAt`;\n break;\n case 'CREATE':\n operation = `create${typeName}`;\n documentArgs = `($input: Create${typeName}Input!)`;\n operationArgs = '(input: $input)';\n transformerMutationType = TransformerMutationType.CREATE;\n break;\n case 'UPDATE':\n operation = `update${typeName}`;\n documentArgs = `($input: Update${typeName}Input!, $condition: Model${typeName}ConditionInput)`;\n operationArgs = '(input: $input, condition: $condition)';\n transformerMutationType = TransformerMutationType.UPDATE;\n break;\n case 'DELETE':\n operation = `delete${typeName}`;\n documentArgs = `($input: Delete${typeName}Input!, $condition: Model${typeName}ConditionInput)`;\n operationArgs = '(input: $input, condition: $condition)';\n transformerMutationType = TransformerMutationType.DELETE;\n break;\n case 'GET':\n operation = `get${typeName}`;\n documentArgs = `($id: ID!)`;\n operationArgs = '(id: $id)';\n transformerMutationType = TransformerMutationType.GET;\n break;\n default:\n throw new Error(`Invalid graphQlOpType ${graphQLOpType}`);\n }\n return [\n [\n transformerMutationType,\n operation,\n `${GraphQLOperationType[graphQLOpType]} operation${documentArgs}{\n\t\t${operation}${operationArgs}{\n\t\t\t${selectionSet}\n\t\t}\n\t}`,\n ],\n ];\n}\nexports.buildGraphQLOperation = buildGraphQLOperation;\nfunction createMutationInstanceFromModelOperation(relationships, modelDefinition, opType, model, element, condition, MutationEventConstructor, modelInstanceCreator, id) {\n let operation;\n switch (opType) {\n case types_1.OpType.INSERT:\n operation = TransformerMutationType.CREATE;\n break;\n case types_1.OpType.UPDATE:\n operation = TransformerMutationType.UPDATE;\n break;\n case types_1.OpType.DELETE:\n operation = TransformerMutationType.DELETE;\n break;\n default:\n throw new Error(`Invalid opType ${opType}`);\n }\n // stringify nested objects of type AWSJSON\n // this allows us to return parsed JSON to users (see `castInstanceType()` in datastore.ts),\n // but still send the object correctly over the wire\n const replacer = (k, v) => {\n const isAWSJSON = k &&\n v !== null &&\n typeof v === 'object' &&\n modelDefinition.fields[k] &&\n modelDefinition.fields[k].type === 'AWSJSON';\n if (isAWSJSON) {\n return JSON.stringify(v);\n }\n return v;\n };\n const modelId = getIdentifierValue(modelDefinition, element);\n const optionalId = types_1.OpType.INSERT && id ? { id } : {};\n const mutationEvent = modelInstanceCreator(MutationEventConstructor, {\n ...optionalId,\n data: JSON.stringify(element, replacer),\n modelId,\n model: model.name,\n operation: operation,\n condition: JSON.stringify(condition),\n });\n return mutationEvent;\n}\nexports.createMutationInstanceFromModelOperation = createMutationInstanceFromModelOperation;\nfunction predicateToGraphQLCondition(predicate, modelDefinition) {\n const result = {};\n if (!predicate || !Array.isArray(predicate.predicates)) {\n return result;\n }\n // This is compatible with how the GQL Transform currently generates the Condition Input,\n // i.e. any PK and SK fields are omitted and can't be used as conditions.\n // However, I think this limits usability.\n // What if we want to delete all records where SK > some value\n // Or all records where PK = some value but SKs are different values\n // TODO: if the Transform gets updated we'll need to modify this logic to only omit\n // key fields from the predicate/condition when ALL of the keyFields are present and using `eq` operators\n const keyFields = (0, util_1.extractPrimaryKeyFieldNames)(modelDefinition);\n return predicateToGraphQLFilter(predicate, keyFields);\n}\nexports.predicateToGraphQLCondition = predicateToGraphQLCondition;\n/**\n * @param predicatesGroup - Predicate Group\n @returns GQL Filter Expression from Predicate Group\n \n @remarks Flattens redundant list predicates\n @example\n\n ```js\n { and:[{ and:[{ username: { eq: 'bob' }}] }] }\n ```\n Becomes\n ```js\n { and:[{ username: { eq: 'bob' }}] }\n ```\n */\nfunction predicateToGraphQLFilter(predicatesGroup, fieldsToOmit = [], root = true) {\n const result = {};\n if (!predicatesGroup || !Array.isArray(predicatesGroup.predicates)) {\n return result;\n }\n const { type, predicates } = predicatesGroup;\n const isList = type === 'and' || type === 'or';\n result[type] = isList ? [] : {};\n const children = [];\n predicates.forEach(predicate => {\n if ((0, types_1.isPredicateObj)(predicate)) {\n const { field, operator, operand } = predicate;\n if (fieldsToOmit.includes(field))\n return;\n const gqlField = {\n [field]: { [operator]: operand },\n };\n children.push(gqlField);\n return;\n }\n const child = predicateToGraphQLFilter(predicate, fieldsToOmit, false);\n if (Object.keys(child).length > 0) {\n children.push(child);\n }\n });\n // flatten redundant list predicates\n if (children.length === 1) {\n const [child] = children;\n if (\n // any nested list node\n (isList && !root) ||\n // root list node where the only child is also a list node\n (isList && root && ('and' in child || 'or' in child))) {\n delete result[type];\n Object.assign(result, child);\n return result;\n }\n }\n children.forEach(child => {\n if (isList) {\n result[type].push(child);\n }\n else {\n result[type] = child;\n }\n });\n if (isList) {\n if (result[type].length === 0)\n return {};\n }\n else {\n if (Object.keys(result[type]).length === 0)\n return {};\n }\n return result;\n}\nexports.predicateToGraphQLFilter = predicateToGraphQLFilter;\n/**\n *\n * @param group - selective sync predicate group\n * @returns set of distinct field names in the filter group\n */\nfunction filterFields(group) {\n const fields = new Set();\n if (!group || !Array.isArray(group.predicates))\n return fields;\n const { predicates } = group;\n const stack = [...predicates];\n while (stack.length > 0) {\n const current = stack.pop();\n if ((0, types_1.isPredicateObj)(current)) {\n fields.add(current.field);\n }\n else if ((0, types_1.isPredicateGroup)(current)) {\n stack.push(...current.predicates);\n }\n }\n return fields;\n}\nexports.filterFields = filterFields;\n/**\n *\n * @param modelDefinition\n * @returns set of field names used with dynamic auth modes configured for the provided model definition\n */\nfunction dynamicAuthFields(modelDefinition) {\n const rules = getAuthorizationRules(modelDefinition);\n const fields = new Set();\n for (const rule of rules) {\n if (rule.groupsField && !rule.groups.length) {\n // dynamic group rule will have no values in `rule.groups`\n fields.add(rule.groupsField);\n }\n else if (rule.ownerField) {\n fields.add(rule.ownerField);\n }\n }\n return fields;\n}\nexports.dynamicAuthFields = dynamicAuthFields;\n/**\n *\n * @param group - selective sync predicate group\n * @returns the total number of OR'd predicates in the filter group\n *\n * @example returns 2\n * ```js\n * { type: \"or\", predicates: [\n * { field: \"username\", operator: \"beginsWith\", operand: \"a\" },\n * { field: \"title\", operator: \"contains\", operand: \"abc\" },\n * ]}\n * ```\n */\nfunction countFilterCombinations(group) {\n if (!group || !Array.isArray(group.predicates))\n return 0;\n let count = 0;\n const stack = [group];\n while (stack.length > 0) {\n const current = stack.pop();\n if ((0, types_1.isPredicateGroup)(current)) {\n const { predicates, type } = current;\n // ignore length = 1; groups with 1 predicate will get flattened when converted to gqlFilter\n if (type === 'or' && predicates.length > 1) {\n count += predicates.length;\n }\n stack.push(...predicates);\n }\n }\n // if we didn't encounter any OR groups, default to 1\n return count || 1;\n}\nexports.countFilterCombinations = countFilterCombinations;\n/**\n *\n * @param group - selective sync predicate group\n * @returns name of repeated field | null\n *\n * @example returns \"username\"\n * ```js\n * { type: \"and\", predicates: [\n * \t\t{ field: \"username\", operator: \"beginsWith\", operand: \"a\" },\n * \t\t{ field: \"username\", operator: \"contains\", operand: \"abc\" },\n * ] }\n * ```\n */\nfunction repeatedFieldInGroup(group) {\n if (!group || !Array.isArray(group.predicates))\n return null;\n // convert to filter in order to flatten redundant groups\n const gqlFilter = predicateToGraphQLFilter(group);\n const stack = [gqlFilter];\n const hasGroupRepeatedFields = (fields) => {\n const seen = {};\n for (const f of fields) {\n const [fieldName] = Object.keys(f);\n if (seen[fieldName]) {\n return fieldName;\n }\n seen[fieldName] = true;\n }\n return null;\n };\n while (stack.length > 0) {\n const current = stack.pop();\n const [key] = Object.keys(current);\n const values = current[key];\n if (!Array.isArray(values)) {\n return null;\n }\n // field value will be single object\n const predicateObjects = values.filter(v => !Array.isArray(Object.values(v)[0]));\n // group value will be an array\n const predicateGroups = values.filter(v => Array.isArray(Object.values(v)[0]));\n if (key === 'and') {\n const repeatedField = hasGroupRepeatedFields(predicateObjects);\n if (repeatedField) {\n return repeatedField;\n }\n }\n stack.push(...predicateGroups);\n }\n return null;\n}\nexports.repeatedFieldInGroup = repeatedFieldInGroup;\nvar RTFError;\n(function (RTFError) {\n RTFError[RTFError[\"UnknownField\"] = 0] = \"UnknownField\";\n RTFError[RTFError[\"MaxAttributes\"] = 1] = \"MaxAttributes\";\n RTFError[RTFError[\"MaxCombinations\"] = 2] = \"MaxCombinations\";\n RTFError[RTFError[\"RepeatedFieldname\"] = 3] = \"RepeatedFieldname\";\n RTFError[RTFError[\"NotGroup\"] = 4] = \"NotGroup\";\n RTFError[RTFError[\"FieldNotInType\"] = 5] = \"FieldNotInType\";\n})(RTFError = exports.RTFError || (exports.RTFError = {}));\nfunction generateRTFRemediation(errorType, modelDefinition, predicatesGroup) {\n const selSyncFields = filterFields(predicatesGroup);\n const selSyncFieldStr = [...selSyncFields].join(', ');\n const dynamicAuthModeFields = dynamicAuthFields(modelDefinition);\n const dynamicAuthFieldsStr = [...dynamicAuthModeFields].join(', ');\n const filterCombinations = countFilterCombinations(predicatesGroup);\n const repeatedField = repeatedFieldInGroup(predicatesGroup);\n switch (errorType) {\n case RTFError.UnknownField:\n return (`Your API was generated with an older version of the CLI that doesn't support backend subscription filtering.` +\n 'To enable backend subscription filtering, upgrade your Amplify CLI to the latest version and push your app by running `amplify upgrade` followed by `amplify push`');\n case RTFError.MaxAttributes: {\n let message = `Your selective sync expression for ${modelDefinition.name} contains ${selSyncFields.size} different model fields: ${selSyncFieldStr}.\\n\\n`;\n if (dynamicAuthModeFields.size > 0) {\n message +=\n `Note: the number of fields you can use with selective sync is affected by @auth rules configured on the model.\\n\\n` +\n `Dynamic auth modes, such as owner auth and dynamic group auth each utilize 1 field.\\n` +\n `You currently have ${dynamicAuthModeFields.size} dynamic auth mode(s) configured on this model: ${dynamicAuthFieldsStr}.`;\n }\n return message;\n }\n case RTFError.MaxCombinations: {\n let message = `Your selective sync expression for ${modelDefinition.name} contains ${filterCombinations} field combinations (total number of predicates in an OR expression).\\n\\n`;\n if (dynamicAuthModeFields.size > 0) {\n message +=\n `Note: the number of fields you can use with selective sync is affected by @auth rules configured on the model.\\n\\n` +\n `Dynamic auth modes, such as owner auth and dynamic group auth factor in to the number of combinations you're using.\\n` +\n `You currently have ${dynamicAuthModeFields.size} dynamic auth mode(s) configured on this model: ${dynamicAuthFieldsStr}.`;\n }\n return message;\n }\n case RTFError.RepeatedFieldname:\n return `Your selective sync expression for ${modelDefinition.name} contains multiple entries for ${repeatedField} in the same AND group.`;\n case RTFError.NotGroup:\n return (`Your selective sync expression for ${modelDefinition.name} uses a \\`not\\` group. If you'd like to filter subscriptions in the backend, ` +\n `rewrite your expression using \\`ne\\` or \\`notContains\\` operators.`);\n case RTFError.FieldNotInType:\n // no remediation instructions. We'll surface the message directly\n return '';\n }\n}\nexports.generateRTFRemediation = generateRTFRemediation;\nfunction getUserGroupsFromToken(token, rule) {\n // validate token against groupClaim\n let userGroups = token[rule.groupClaim] || [];\n if (typeof userGroups === 'string') {\n let parsedGroups;\n try {\n parsedGroups = JSON.parse(userGroups);\n }\n catch (e) {\n parsedGroups = userGroups;\n }\n userGroups = [].concat(parsedGroups);\n }\n return userGroups;\n}\nexports.getUserGroupsFromToken = getUserGroupsFromToken;\nasync function getModelAuthModes({ authModeStrategy, defaultAuthMode, modelName, schema, }) {\n const operations = Object.values(types_1.ModelOperation);\n const modelAuthModes = {\n CREATE: [],\n READ: [],\n UPDATE: [],\n DELETE: [],\n };\n try {\n await Promise.all(operations.map(async (operation) => {\n const authModes = await authModeStrategy({\n schema,\n modelName,\n operation,\n });\n if (typeof authModes === 'string') {\n modelAuthModes[operation] = [authModes];\n }\n else if (Array.isArray(authModes) && authModes.length) {\n modelAuthModes[operation] = authModes;\n }\n else {\n // Use default auth mode if nothing is returned from authModeStrategy\n modelAuthModes[operation] = [defaultAuthMode];\n }\n }));\n }\n catch (error) {\n logger.debug(`Error getting auth modes for model: ${modelName}`, error);\n }\n return modelAuthModes;\n}\nexports.getModelAuthModes = getModelAuthModes;\nfunction getForbiddenError(error) {\n const forbiddenErrorCodes = [401, 403];\n let forbiddenError;\n if (error && error.errors) {\n forbiddenError = error.errors.find(err => forbiddenErrorCodes.includes(resolveServiceErrorStatusCode(err)));\n }\n else if (error && error.message) {\n forbiddenError = error;\n }\n if (forbiddenError) {\n return (forbiddenError.message ??\n `Request failed with status code ${resolveServiceErrorStatusCode(forbiddenError)}`);\n }\n return null;\n}\nexports.getForbiddenError = getForbiddenError;\nfunction resolveServiceErrorStatusCode(error) {\n if (error?.['$metadata']?.['httpStatusCode']) {\n return Number(error?.['$metadata']?.['httpStatusCode']);\n }\n else if (error?.originalError) {\n return resolveServiceErrorStatusCode(error?.originalError);\n }\n else {\n return null;\n }\n}\nexports.resolveServiceErrorStatusCode = resolveServiceErrorStatusCode;\nfunction getClientSideAuthError(error) {\n const clientSideAuthErrors = Object.values(api_1.GraphQLAuthError);\n const clientSideError = error &&\n error.message &&\n clientSideAuthErrors.find(clientError => error.message.includes(clientError));\n return clientSideError || null;\n}\nexports.getClientSideAuthError = getClientSideAuthError;\nasync function getTokenForCustomAuth(authMode, amplifyConfig = {}) {\n if (authMode === 'lambda') {\n const { authProviders: { functionAuthProvider } = { functionAuthProvider: null }, } = amplifyConfig;\n if (functionAuthProvider && typeof functionAuthProvider === 'function') {\n try {\n const { token } = await functionAuthProvider();\n return token;\n }\n catch (error) {\n throw new Error(`Error retrieving token from \\`functionAuthProvider\\`: ${error}`);\n }\n }\n else {\n // TODO: add docs link once available\n throw new Error('You must provide a `functionAuthProvider` function to `DataStore.configure` when using lambda');\n }\n }\n}\nexports.getTokenForCustomAuth = getTokenForCustomAuth;\n// Util that takes a modelDefinition and model and returns either the id value(s) or the custom primary key value(s)\nfunction getIdentifierValue(modelDefinition, model) {\n const pkFieldNames = (0, util_1.extractPrimaryKeyFieldNames)(modelDefinition);\n const idOrPk = pkFieldNames.map(f => model[f]).join(util_1.IDENTIFIER_KEY_SEPARATOR);\n return idOrPk;\n}\nexports.getIdentifierValue = getIdentifierValue;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,6BAA6B,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,2BAA2B,GAAG,OAAO,CAAC,wCAAwC,GAAG,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC,iCAAiC,GAAG,OAAO,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,KAAK,CAAC,CAAC,CAAC,CAAC;AAClG,aAAa;AACb,SAAS;AACT,aAAa;AACb;AACA,YAAY,MAAM,IAAI,KAAK,CAAC,+FAA+F,CAAC,CAAC;AAC7H,SAAS;AACT,KAAK;AACL,CAAC;AACD,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;AACtD;AACA,SAAS,kBAAkB,CAAC,eAAe,EAAE,KAAK,EAAE;AACpD,IAAI,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,2BAA2B,EAAE,eAAe,CAAC,CAAC;AAClF,IAAI,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC;AACzF,IAAI,OAAO,MAAM,CAAC;AAClB,CAAC;AACD,OAAO,CAAC,kBAAkB,GAAG,kBAAkB;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.PredicateInternalsKey = exports.LimitTimerRaceResolvedValues = exports.DISCARD = exports.ProcessName = exports.syncExpression = exports.ModelOperation = exports.AuthModeStrategyType = exports.SortDirection = exports.QueryOne = exports.isPredicateGroup = exports.isPredicateObj = exports.OpType = exports.isIdentifierObject = exports.isEnumFieldType = exports.isNonModelFieldType = exports.isModelFieldType = exports.isGraphQLScalarType = exports.GraphQLScalarType = exports.ModelAttributeAuthProvider = exports.ModelAttributeAuthAllow = exports.isModelAttributeCompositeKey = exports.isModelAttributePrimaryKey = exports.isModelAttributeKey = exports.isModelAttributeAuth = exports.isFieldAssociation = exports.isTargetNameAssociation = exports.isAssociatedWith = exports.isSchemaModelWithAttributes = exports.isSchemaModel = void 0;
|
|
4
5
|
const util_1 = require("./util");
|
|
@@ -46,22 +47,20 @@ function isModelAttributeCompositeKey(attr) {
|
|
|
46
47
|
attr.properties.fields.length > 2);
|
|
47
48
|
}
|
|
48
49
|
exports.isModelAttributeCompositeKey = isModelAttributeCompositeKey;
|
|
49
|
-
var ModelAttributeAuthAllow;
|
|
50
50
|
(function (ModelAttributeAuthAllow) {
|
|
51
51
|
ModelAttributeAuthAllow["CUSTOM"] = "custom";
|
|
52
52
|
ModelAttributeAuthAllow["OWNER"] = "owner";
|
|
53
53
|
ModelAttributeAuthAllow["GROUPS"] = "groups";
|
|
54
54
|
ModelAttributeAuthAllow["PRIVATE"] = "private";
|
|
55
55
|
ModelAttributeAuthAllow["PUBLIC"] = "public";
|
|
56
|
-
})(
|
|
57
|
-
var ModelAttributeAuthProvider;
|
|
56
|
+
})(exports.ModelAttributeAuthAllow || (exports.ModelAttributeAuthAllow = {}));
|
|
58
57
|
(function (ModelAttributeAuthProvider) {
|
|
59
58
|
ModelAttributeAuthProvider["FUNCTION"] = "function";
|
|
60
59
|
ModelAttributeAuthProvider["USER_POOLS"] = "userPools";
|
|
61
60
|
ModelAttributeAuthProvider["OIDC"] = "oidc";
|
|
62
61
|
ModelAttributeAuthProvider["IAM"] = "iam";
|
|
63
62
|
ModelAttributeAuthProvider["API_KEY"] = "apiKey";
|
|
64
|
-
})(
|
|
63
|
+
})(exports.ModelAttributeAuthProvider || (exports.ModelAttributeAuthProvider = {}));
|
|
65
64
|
var GraphQLScalarType;
|
|
66
65
|
(function (GraphQLScalarType) {
|
|
67
66
|
GraphQLScalarType[GraphQLScalarType["ID"] = 0] = "ID";
|
|
@@ -161,14 +160,11 @@ function isIdentifierObject(obj, modelDefinition) {
|
|
|
161
160
|
return (typeof obj === 'object' && obj && keys.every(k => obj[k] !== undefined));
|
|
162
161
|
}
|
|
163
162
|
exports.isIdentifierObject = isIdentifierObject;
|
|
164
|
-
//#endregion
|
|
165
|
-
//#region Subscription messages
|
|
166
|
-
var OpType;
|
|
167
163
|
(function (OpType) {
|
|
168
164
|
OpType["INSERT"] = "INSERT";
|
|
169
165
|
OpType["UPDATE"] = "UPDATE";
|
|
170
166
|
OpType["DELETE"] = "DELETE";
|
|
171
|
-
})(
|
|
167
|
+
})(exports.OpType || (exports.OpType = {}));
|
|
172
168
|
function isPredicateObj(obj) {
|
|
173
169
|
return obj && obj.field !== undefined;
|
|
174
170
|
}
|
|
@@ -177,28 +173,24 @@ function isPredicateGroup(obj) {
|
|
|
177
173
|
return obj && obj.type !== undefined;
|
|
178
174
|
}
|
|
179
175
|
exports.isPredicateGroup = isPredicateGroup;
|
|
180
|
-
var QueryOne;
|
|
181
176
|
(function (QueryOne) {
|
|
182
177
|
QueryOne[QueryOne["FIRST"] = 0] = "FIRST";
|
|
183
178
|
QueryOne[QueryOne["LAST"] = 1] = "LAST";
|
|
184
|
-
})(
|
|
185
|
-
var SortDirection;
|
|
179
|
+
})(exports.QueryOne || (exports.QueryOne = {}));
|
|
186
180
|
(function (SortDirection) {
|
|
187
181
|
SortDirection["ASCENDING"] = "ASCENDING";
|
|
188
182
|
SortDirection["DESCENDING"] = "DESCENDING";
|
|
189
|
-
})(
|
|
190
|
-
var AuthModeStrategyType;
|
|
183
|
+
})(exports.SortDirection || (exports.SortDirection = {}));
|
|
191
184
|
(function (AuthModeStrategyType) {
|
|
192
185
|
AuthModeStrategyType["DEFAULT"] = "DEFAULT";
|
|
193
186
|
AuthModeStrategyType["MULTI_AUTH"] = "MULTI_AUTH";
|
|
194
|
-
})(
|
|
195
|
-
var ModelOperation;
|
|
187
|
+
})(exports.AuthModeStrategyType || (exports.AuthModeStrategyType = {}));
|
|
196
188
|
(function (ModelOperation) {
|
|
197
189
|
ModelOperation["CREATE"] = "CREATE";
|
|
198
190
|
ModelOperation["READ"] = "READ";
|
|
199
191
|
ModelOperation["UPDATE"] = "UPDATE";
|
|
200
192
|
ModelOperation["DELETE"] = "DELETE";
|
|
201
|
-
})(
|
|
193
|
+
})(exports.ModelOperation || (exports.ModelOperation = {}));
|
|
202
194
|
async function syncExpression(modelConstructor, conditionProducer) {
|
|
203
195
|
return {
|
|
204
196
|
modelConstructor,
|
|
@@ -206,18 +198,16 @@ async function syncExpression(modelConstructor, conditionProducer) {
|
|
|
206
198
|
};
|
|
207
199
|
}
|
|
208
200
|
exports.syncExpression = syncExpression;
|
|
209
|
-
var ProcessName;
|
|
210
201
|
(function (ProcessName) {
|
|
211
202
|
ProcessName["sync"] = "sync";
|
|
212
203
|
ProcessName["mutate"] = "mutate";
|
|
213
204
|
ProcessName["subscribe"] = "subscribe";
|
|
214
|
-
})(
|
|
205
|
+
})(exports.ProcessName || (exports.ProcessName = {}));
|
|
215
206
|
exports.DISCARD = Symbol('DISCARD');
|
|
216
|
-
var LimitTimerRaceResolvedValues;
|
|
217
207
|
(function (LimitTimerRaceResolvedValues) {
|
|
218
208
|
LimitTimerRaceResolvedValues["LIMIT"] = "LIMIT";
|
|
219
209
|
LimitTimerRaceResolvedValues["TIMER"] = "TIMER";
|
|
220
|
-
})(
|
|
210
|
+
})(exports.LimitTimerRaceResolvedValues || (exports.LimitTimerRaceResolvedValues = {}));
|
|
221
211
|
/**
|
|
222
212
|
* A pointer used by DataStore internally to lookup predicate details
|
|
223
213
|
* that should not be exposed on public customer interfaces.
|
|
@@ -229,3 +219,4 @@ class PredicateInternalsKey {
|
|
|
229
219
|
}
|
|
230
220
|
exports.PredicateInternalsKey = PredicateInternalsKey;
|
|
231
221
|
// #endregion
|
|
222
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../src/types.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PredicateInternalsKey = exports.LimitTimerRaceResolvedValues = exports.DISCARD = exports.ProcessName = exports.syncExpression = exports.ModelOperation = exports.AuthModeStrategyType = exports.SortDirection = exports.QueryOne = exports.isPredicateGroup = exports.isPredicateObj = exports.OpType = exports.isIdentifierObject = exports.isEnumFieldType = exports.isNonModelFieldType = exports.isModelFieldType = exports.isGraphQLScalarType = exports.GraphQLScalarType = exports.ModelAttributeAuthProvider = exports.ModelAttributeAuthAllow = exports.isModelAttributeCompositeKey = exports.isModelAttributePrimaryKey = exports.isModelAttributeKey = exports.isModelAttributeAuth = exports.isFieldAssociation = exports.isTargetNameAssociation = exports.isAssociatedWith = exports.isSchemaModelWithAttributes = exports.isSchemaModel = void 0;\nconst util_1 = require(\"./util\");\nfunction isSchemaModel(obj) {\n return obj && obj.pluralName !== undefined;\n}\nexports.isSchemaModel = isSchemaModel;\nfunction isSchemaModelWithAttributes(m) {\n return isSchemaModel(m) && m.attributes !== undefined;\n}\nexports.isSchemaModelWithAttributes = isSchemaModelWithAttributes;\nfunction isAssociatedWith(obj) {\n return obj && obj.associatedWith;\n}\nexports.isAssociatedWith = isAssociatedWith;\nfunction isTargetNameAssociation(obj) {\n return obj?.targetName || obj?.targetNames;\n}\nexports.isTargetNameAssociation = isTargetNameAssociation;\nfunction isFieldAssociation(obj, fieldName) {\n return obj?.fields[fieldName]?.association?.connectionType;\n}\nexports.isFieldAssociation = isFieldAssociation;\nfunction isModelAttributeAuth(attr) {\n return (attr.type === 'auth' &&\n attr.properties &&\n attr.properties.rules &&\n attr.properties.rules.length > 0);\n}\nexports.isModelAttributeAuth = isModelAttributeAuth;\nfunction isModelAttributeKey(attr) {\n return (attr.type === 'key' &&\n attr.properties &&\n attr.properties.fields &&\n attr.properties.fields.length > 0);\n}\nexports.isModelAttributeKey = isModelAttributeKey;\nfunction isModelAttributePrimaryKey(attr) {\n return isModelAttributeKey(attr) && attr.properties.name === undefined;\n}\nexports.isModelAttributePrimaryKey = isModelAttributePrimaryKey;\nfunction isModelAttributeCompositeKey(attr) {\n return (isModelAttributeKey(attr) &&\n attr.properties.name !== undefined &&\n attr.properties.fields.length > 2);\n}\nexports.isModelAttributeCompositeKey = isModelAttributeCompositeKey;\nvar ModelAttributeAuthAllow;\n(function (ModelAttributeAuthAllow) {\n ModelAttributeAuthAllow[\"CUSTOM\"] = \"custom\";\n ModelAttributeAuthAllow[\"OWNER\"] = \"owner\";\n ModelAttributeAuthAllow[\"GROUPS\"] = \"groups\";\n ModelAttributeAuthAllow[\"PRIVATE\"] = \"private\";\n ModelAttributeAuthAllow[\"PUBLIC\"] = \"public\";\n})(ModelAttributeAuthAllow = exports.ModelAttributeAuthAllow || (exports.ModelAttributeAuthAllow = {}));\nvar ModelAttributeAuthProvider;\n(function (ModelAttributeAuthProvider) {\n ModelAttributeAuthProvider[\"FUNCTION\"] = \"function\";\n ModelAttributeAuthProvider[\"USER_POOLS\"] = \"userPools\";\n ModelAttributeAuthProvider[\"OIDC\"] = \"oidc\";\n ModelAttributeAuthProvider[\"IAM\"] = \"iam\";\n ModelAttributeAuthProvider[\"API_KEY\"] = \"apiKey\";\n})(ModelAttributeAuthProvider = exports.ModelAttributeAuthProvider || (exports.ModelAttributeAuthProvider = {}));\nvar GraphQLScalarType;\n(function (GraphQLScalarType) {\n GraphQLScalarType[GraphQLScalarType[\"ID\"] = 0] = \"ID\";\n GraphQLScalarType[GraphQLScalarType[\"String\"] = 1] = \"String\";\n GraphQLScalarType[GraphQLScalarType[\"Int\"] = 2] = \"Int\";\n GraphQLScalarType[GraphQLScalarType[\"Float\"] = 3] = \"Float\";\n GraphQLScalarType[GraphQLScalarType[\"Boolean\"] = 4] = \"Boolean\";\n GraphQLScalarType[GraphQLScalarType[\"AWSDate\"] = 5] = \"AWSDate\";\n GraphQLScalarType[GraphQLScalarType[\"AWSTime\"] = 6] = \"AWSTime\";\n GraphQLScalarType[GraphQLScalarType[\"AWSDateTime\"] = 7] = \"AWSDateTime\";\n GraphQLScalarType[GraphQLScalarType[\"AWSTimestamp\"] = 8] = \"AWSTimestamp\";\n GraphQLScalarType[GraphQLScalarType[\"AWSEmail\"] = 9] = \"AWSEmail\";\n GraphQLScalarType[GraphQLScalarType[\"AWSJSON\"] = 10] = \"AWSJSON\";\n GraphQLScalarType[GraphQLScalarType[\"AWSURL\"] = 11] = \"AWSURL\";\n GraphQLScalarType[GraphQLScalarType[\"AWSPhone\"] = 12] = \"AWSPhone\";\n GraphQLScalarType[GraphQLScalarType[\"AWSIPAddress\"] = 13] = \"AWSIPAddress\";\n})(GraphQLScalarType = exports.GraphQLScalarType || (exports.GraphQLScalarType = {}));\n(function (GraphQLScalarType) {\n function getJSType(scalar) {\n switch (scalar) {\n case 'Boolean':\n return 'boolean';\n case 'ID':\n case 'String':\n case 'AWSDate':\n case 'AWSTime':\n case 'AWSDateTime':\n case 'AWSEmail':\n case 'AWSURL':\n case 'AWSPhone':\n case 'AWSIPAddress':\n return 'string';\n case 'Int':\n case 'Float':\n case 'AWSTimestamp':\n return 'number';\n case 'AWSJSON':\n return 'object';\n default:\n throw new Error('Invalid scalar type');\n }\n }\n GraphQLScalarType.getJSType = getJSType;\n function getValidationFunction(scalar) {\n switch (scalar) {\n case 'AWSDate':\n return util_1.isAWSDate;\n case 'AWSTime':\n return util_1.isAWSTime;\n case 'AWSDateTime':\n return util_1.isAWSDateTime;\n case 'AWSTimestamp':\n return util_1.isAWSTimestamp;\n case 'AWSEmail':\n return util_1.isAWSEmail;\n case 'AWSJSON':\n return util_1.isAWSJSON;\n case 'AWSURL':\n return util_1.isAWSURL;\n case 'AWSPhone':\n return util_1.isAWSPhone;\n case 'AWSIPAddress':\n return util_1.isAWSIPAddress;\n default:\n return undefined;\n }\n }\n GraphQLScalarType.getValidationFunction = getValidationFunction;\n})(GraphQLScalarType = exports.GraphQLScalarType || (exports.GraphQLScalarType = {}));\nfunction isGraphQLScalarType(obj) {\n return obj && GraphQLScalarType[obj] !== undefined;\n}\nexports.isGraphQLScalarType = isGraphQLScalarType;\nfunction isModelFieldType(obj) {\n const modelField = 'model';\n if (obj && obj[modelField])\n return true;\n return false;\n}\nexports.isModelFieldType = isModelFieldType;\nfunction isNonModelFieldType(obj) {\n const typeField = 'nonModel';\n if (obj && obj[typeField])\n return true;\n return false;\n}\nexports.isNonModelFieldType = isNonModelFieldType;\nfunction isEnumFieldType(obj) {\n const modelField = 'enum';\n if (obj && obj[modelField])\n return true;\n return false;\n}\nexports.isEnumFieldType = isEnumFieldType;\nfunction isIdentifierObject(obj, modelDefinition) {\n const keys = (0, util_1.extractPrimaryKeyFieldNames)(modelDefinition);\n return (typeof obj === 'object' && obj && keys.every(k => obj[k] !== undefined));\n}\nexports.isIdentifierObject = isIdentifierObject;\n//#endregion\n//#region Subscription messages\nvar OpType;\n(function (OpType) {\n OpType[\"INSERT\"] = \"INSERT\";\n OpType[\"UPDATE\"] = \"UPDATE\";\n OpType[\"DELETE\"] = \"DELETE\";\n})(OpType = exports.OpType || (exports.OpType = {}));\nfunction isPredicateObj(obj) {\n return obj && obj.field !== undefined;\n}\nexports.isPredicateObj = isPredicateObj;\nfunction isPredicateGroup(obj) {\n return obj && obj.type !== undefined;\n}\nexports.isPredicateGroup = isPredicateGroup;\nvar QueryOne;\n(function (QueryOne) {\n QueryOne[QueryOne[\"FIRST\"] = 0] = \"FIRST\";\n QueryOne[QueryOne[\"LAST\"] = 1] = \"LAST\";\n})(QueryOne = exports.QueryOne || (exports.QueryOne = {}));\nvar SortDirection;\n(function (SortDirection) {\n SortDirection[\"ASCENDING\"] = \"ASCENDING\";\n SortDirection[\"DESCENDING\"] = \"DESCENDING\";\n})(SortDirection = exports.SortDirection || (exports.SortDirection = {}));\nvar AuthModeStrategyType;\n(function (AuthModeStrategyType) {\n AuthModeStrategyType[\"DEFAULT\"] = \"DEFAULT\";\n AuthModeStrategyType[\"MULTI_AUTH\"] = \"MULTI_AUTH\";\n})(AuthModeStrategyType = exports.AuthModeStrategyType || (exports.AuthModeStrategyType = {}));\nvar ModelOperation;\n(function (ModelOperation) {\n ModelOperation[\"CREATE\"] = \"CREATE\";\n ModelOperation[\"READ\"] = \"READ\";\n ModelOperation[\"UPDATE\"] = \"UPDATE\";\n ModelOperation[\"DELETE\"] = \"DELETE\";\n})(ModelOperation = exports.ModelOperation || (exports.ModelOperation = {}));\nasync function syncExpression(modelConstructor, conditionProducer) {\n return {\n modelConstructor,\n conditionProducer,\n };\n}\nexports.syncExpression = syncExpression;\nvar ProcessName;\n(function (ProcessName) {\n ProcessName[\"sync\"] = \"sync\";\n ProcessName[\"mutate\"] = \"mutate\";\n ProcessName[\"subscribe\"] = \"subscribe\";\n})(ProcessName = exports.ProcessName || (exports.ProcessName = {}));\nexports.DISCARD = Symbol('DISCARD');\nvar LimitTimerRaceResolvedValues;\n(function (LimitTimerRaceResolvedValues) {\n LimitTimerRaceResolvedValues[\"LIMIT\"] = \"LIMIT\";\n LimitTimerRaceResolvedValues[\"TIMER\"] = \"TIMER\";\n})(LimitTimerRaceResolvedValues = exports.LimitTimerRaceResolvedValues || (exports.LimitTimerRaceResolvedValues = {}));\n/**\n * A pointer used by DataStore internally to lookup predicate details\n * that should not be exposed on public customer interfaces.\n */\nclass PredicateInternalsKey {\n constructor() {\n this.__isPredicateInternalsKeySentinel = true;\n }\n}\nexports.PredicateInternalsKey = PredicateInternalsKey;\n// #endregion\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC,4BAA4B,GAAG,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,mBAAmB,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,mBAAmB,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,0BAA0B,GAAG,OAAO,CAAC,uBAAuB,GAAG,OAAO,CAAC,4BAA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