@aws-amplify/data-schema 1.24.0 → 1.25.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.
Files changed (103) hide show
  1. package/dist/cjs/Authorization.js.map +1 -1
  2. package/dist/cjs/CombineSchema.js.map +1 -1
  3. package/dist/cjs/CustomOperation.js.map +1 -1
  4. package/dist/cjs/Handler.js.map +1 -1
  5. package/dist/cjs/ModelField.js.map +1 -1
  6. package/dist/cjs/ModelIndex.js.map +1 -1
  7. package/dist/cjs/ModelRelationshipField.js.map +1 -1
  8. package/dist/cjs/ModelSchema.js.map +1 -1
  9. package/dist/cjs/ModelType.js.map +1 -1
  10. package/dist/cjs/RefType.js.map +1 -1
  11. package/dist/cjs/SchemaProcessor.js.map +1 -1
  12. package/dist/cjs/Validate.js.map +1 -1
  13. package/dist/cjs/a.js.map +1 -1
  14. package/dist/cjs/ai/ConversationSchemaProcessor.js.map +1 -1
  15. package/dist/cjs/ai/ConversationType.js.map +1 -1
  16. package/dist/cjs/internals/index.js.map +1 -1
  17. package/dist/cjs/runtime/addSchemaToClientWithInstance.js.map +1 -1
  18. package/dist/cjs/runtime/client/index.js.map +1 -1
  19. package/dist/cjs/runtime/client/index.v3.js.map +1 -1
  20. package/dist/cjs/runtime/index.js.map +1 -1
  21. package/dist/cjs/runtime/internals/APIClient.js.map +1 -1
  22. package/dist/cjs/runtime/internals/ai/conversationMessageDeserializers.js.map +1 -1
  23. package/dist/cjs/runtime/internals/ai/conversationMessageSerializers.js.map +1 -1
  24. package/dist/cjs/runtime/internals/ai/conversationStreamEventDeserializers.js.map +1 -1
  25. package/dist/cjs/runtime/internals/ai/convertItemToConversation.js.map +1 -1
  26. package/dist/cjs/runtime/internals/ai/createListConversationsFunction.js.map +1 -1
  27. package/dist/cjs/runtime/internals/ai/createOnStreamEventFunction.js.map +1 -1
  28. package/dist/cjs/runtime/internals/ai/createSendMessageFunction.js.map +1 -1
  29. package/dist/cjs/runtime/internals/cancellation.js.map +1 -1
  30. package/dist/cjs/runtime/internals/clientUtils.js.map +1 -1
  31. package/dist/cjs/runtime/internals/generateCustomOperationsProperty.js.map +1 -1
  32. package/dist/cjs/runtime/internals/index.js.map +1 -1
  33. package/dist/cjs/runtime/internals/operations/custom.js.map +1 -1
  34. package/dist/cjs/runtime/internals/operations/get.js.map +1 -1
  35. package/dist/cjs/runtime/internals/operations/indexQuery.js.map +1 -1
  36. package/dist/cjs/runtime/internals/operations/list.js.map +1 -1
  37. package/dist/cjs/runtime/internals/operations/observeQuery.js.map +1 -1
  38. package/dist/cjs/runtime/internals/operations/subscription.js.map +1 -1
  39. package/dist/cjs/runtime/internals/operations/utils.js.map +1 -1
  40. package/dist/cjs/runtime/internals/server/generateModelsProperty.js.map +1 -1
  41. package/dist/cjs/runtime/internals/utils/clientProperties/generateConversationsProperty.js.map +1 -1
  42. package/dist/cjs/runtime/internals/utils/clientProperties/generateEnumsProperty.js.map +1 -1
  43. package/dist/cjs/runtime/internals/utils/clientProperties/generateGenerationsProperty.js.map +1 -1
  44. package/dist/cjs/runtime/internals/utils/clientProperties/generateModelsProperty.js.map +1 -1
  45. package/dist/cjs/runtime/internals/utils/runtimeTypeGuards/isGraphQLResponseWithErrors.js.map +1 -1
  46. package/dist/cjs/runtime/utils/findIndexByFields.js.map +1 -1
  47. package/dist/cjs/runtime/utils/index.js.map +1 -1
  48. package/dist/cjs/runtime/utils/resolveOwnerFields.js.map +1 -1
  49. package/dist/cjs/runtime/utils/selfAwareAsync.js.map +1 -1
  50. package/dist/cjs/util/index.js.map +1 -1
  51. package/dist/esm/Authorization.mjs.map +1 -1
  52. package/dist/esm/ClientSchema/Core/ClientModel.d.ts +4 -1
  53. package/dist/esm/ClientSchema/utilities/ResolveField.d.ts +33 -3
  54. package/dist/esm/CombineSchema.mjs.map +1 -1
  55. package/dist/esm/CustomOperation.mjs.map +1 -1
  56. package/dist/esm/Handler.mjs.map +1 -1
  57. package/dist/esm/ModelField.mjs.map +1 -1
  58. package/dist/esm/ModelIndex.mjs.map +1 -1
  59. package/dist/esm/ModelRelationshipField.mjs.map +1 -1
  60. package/dist/esm/ModelSchema.mjs.map +1 -1
  61. package/dist/esm/ModelType.mjs.map +1 -1
  62. package/dist/esm/RefType.mjs.map +1 -1
  63. package/dist/esm/SchemaProcessor.mjs.map +1 -1
  64. package/dist/esm/Validate.mjs.map +1 -1
  65. package/dist/esm/ai/ConversationSchemaProcessor.mjs.map +1 -1
  66. package/dist/esm/ai/ConversationType.mjs.map +1 -1
  67. package/dist/esm/runtime/addSchemaToClientWithInstance.mjs.map +1 -1
  68. package/dist/esm/runtime/client/index.d.ts +8 -54
  69. package/dist/esm/runtime/internals/APIClient.mjs.map +1 -1
  70. package/dist/esm/runtime/internals/ai/conversationMessageDeserializers.mjs.map +1 -1
  71. package/dist/esm/runtime/internals/ai/conversationMessageSerializers.mjs.map +1 -1
  72. package/dist/esm/runtime/internals/ai/conversationStreamEventDeserializers.mjs.map +1 -1
  73. package/dist/esm/runtime/internals/ai/convertItemToConversation.mjs.map +1 -1
  74. package/dist/esm/runtime/internals/ai/createListConversationsFunction.mjs.map +1 -1
  75. package/dist/esm/runtime/internals/ai/createOnStreamEventFunction.mjs.map +1 -1
  76. package/dist/esm/runtime/internals/ai/createSendMessageFunction.mjs.map +1 -1
  77. package/dist/esm/runtime/internals/cancellation.mjs.map +1 -1
  78. package/dist/esm/runtime/internals/clientUtils.mjs.map +1 -1
  79. package/dist/esm/runtime/internals/generateCustomOperationsProperty.mjs.map +1 -1
  80. package/dist/esm/runtime/internals/operations/custom.mjs.map +1 -1
  81. package/dist/esm/runtime/internals/operations/get.mjs.map +1 -1
  82. package/dist/esm/runtime/internals/operations/indexQuery.mjs +1 -1
  83. package/dist/esm/runtime/internals/operations/indexQuery.mjs.map +1 -1
  84. package/dist/esm/runtime/internals/operations/list.mjs.map +1 -1
  85. package/dist/esm/runtime/internals/operations/observeQuery.mjs.map +1 -1
  86. package/dist/esm/runtime/internals/operations/subscription.mjs.map +1 -1
  87. package/dist/esm/runtime/internals/operations/utils.mjs.map +1 -1
  88. package/dist/esm/runtime/internals/server/generateModelsProperty.mjs.map +1 -1
  89. package/dist/esm/runtime/internals/utils/clientProperties/generateConversationsProperty.mjs.map +1 -1
  90. package/dist/esm/runtime/internals/utils/clientProperties/generateEnumsProperty.mjs.map +1 -1
  91. package/dist/esm/runtime/internals/utils/clientProperties/generateGenerationsProperty.mjs.map +1 -1
  92. package/dist/esm/runtime/internals/utils/clientProperties/generateModelsProperty.mjs.map +1 -1
  93. package/dist/esm/runtime/internals/utils/runtimeTypeGuards/isGraphQLResponseWithErrors.mjs.map +1 -1
  94. package/dist/esm/runtime/utils/findIndexByFields.mjs.map +1 -1
  95. package/dist/esm/runtime/utils/resolveOwnerFields.mjs.map +1 -1
  96. package/dist/esm/runtime/utils/selfAwareAsync.mjs.map +1 -1
  97. package/dist/esm/util/Filters.d.ts +2 -2
  98. package/dist/meta/cjs.tsbuildinfo +1 -1
  99. package/package.json +2 -2
  100. package/src/ClientSchema/Core/ClientModel.ts +21 -1
  101. package/src/ClientSchema/utilities/ResolveField.ts +85 -11
  102. package/src/runtime/client/index.ts +33 -102
  103. package/src/util/Filters.ts +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"Validate.mjs","sources":["../../src/Validate.ts"],"sourcesContent":["/**\n * The types of validations supported\n */\nexport var ValidationType;\n(function (ValidationType) {\n ValidationType[\"GT\"] = \"gt\";\n ValidationType[\"LT\"] = \"lt\";\n ValidationType[\"GTE\"] = \"gte\";\n ValidationType[\"LTE\"] = \"lte\";\n ValidationType[\"MIN_LENGTH\"] = \"minLength\";\n ValidationType[\"MAX_LENGTH\"] = \"maxLength\";\n ValidationType[\"STARTS_WITH\"] = \"startsWith\";\n ValidationType[\"ENDS_WITH\"] = \"endsWith\";\n ValidationType[\"MATCHES\"] = \"matches\";\n})(ValidationType || (ValidationType = {}));\n/**\n * Creates an internal validation builder for a specific field type\n * @typeParam T - The type of the field being validated\n */\nfunction createValidationBuilderInternal() {\n const rules = [];\n const builder = {\n /**\n * Validates that a numeric field is greater than the specified value\n * @param value - The value that the field must be greater than\n * @param errorMessage - Optional custom error message\n */\n gt(value, errorMessage) {\n rules.push({ type: ValidationType.GT, value, errorMessage });\n return this;\n },\n /**\n * Validates that a numeric field is less than the specified value\n * @param value - The value that the field must be less than\n * @param errorMessage - Optional custom error message\n */\n lt(value, errorMessage) {\n rules.push({ type: ValidationType.LT, value, errorMessage });\n return this;\n },\n /**\n * Validates that a numeric field is greater than or equal to the specified value\n * @param value - The value that the field must be greater than or equal to\n * @param errorMessage - Optional custom error message\n */\n gte(value, errorMessage) {\n rules.push({ type: ValidationType.GTE, value, errorMessage });\n return this;\n },\n /**\n * Validates that a numeric field is less than or equal to the specified value\n * @param value - The value that the field must be less than or equal to\n * @param errorMessage - Optional custom error message\n */\n lte(value, errorMessage) {\n rules.push({ type: ValidationType.LTE, value, errorMessage });\n return this;\n },\n /**\n * Validates that a numeric field is positive. We use gt(0) internally to achieve this.\n * @param errorMessage - Optional custom error message\n */\n positive(errorMessage) {\n rules.push({ type: ValidationType.GT, value: 0, errorMessage });\n return this;\n },\n /**\n * Validates that a numeric field is negative. We use lt(0) internally to achieve this.\n * @param errorMessage - Optional custom error message\n */\n negative(errorMessage) {\n rules.push({ type: ValidationType.LT, value: 0, errorMessage });\n return this;\n },\n /**\n * Validates that a string field has at least the specified length\n * @param length - The minimum length required\n * @param errorMessage - Optional custom error message\n */\n minLength(length, errorMessage) {\n rules.push({ type: ValidationType.MIN_LENGTH, value: length, errorMessage });\n return this;\n },\n /**\n * Validates that a string field does not exceed the specified length\n * @param length - The maximum length allowed\n * @param errorMessage - Optional custom error message\n */\n maxLength(length, errorMessage) {\n rules.push({ type: ValidationType.MAX_LENGTH, value: length, errorMessage });\n return this;\n },\n /**\n * Validates that a string field starts with the specified prefix\n * @param prefix - The prefix the string must start with\n * @param errorMessage - Optional custom error message\n */\n startsWith(prefix, errorMessage) {\n rules.push({ type: ValidationType.STARTS_WITH, value: prefix, errorMessage });\n return this;\n },\n /**\n * Validates that a string field ends with the specified suffix\n * @param suffix - The suffix the string must end with\n * @param errorMessage - Optional custom error message\n */\n endsWith(suffix, errorMessage) {\n rules.push({ type: ValidationType.ENDS_WITH, value: suffix, errorMessage });\n return this;\n },\n /**\n * Validates that a string field matches the specified regular expression pattern\n * @param pattern - The regex pattern the string must match\n * @param errorMessage - Optional custom error message\n */\n matches(pattern, errorMessage) {\n rules.push({ type: ValidationType.MATCHES, value: pattern, errorMessage });\n return this;\n },\n /**\n * Returns all the validation rules defined by this builder\n */\n getRules() {\n return rules;\n }\n };\n return builder;\n}\n/**\n * Creates a type-safe validation builder for a specific field type with access to get the rules\n * @returns An object containing the validation builder and a function to get the rules\n */\nexport function createValidationBuilder() {\n const internalBuilder = createValidationBuilderInternal();\n return {\n builder: internalBuilder,\n getRules: () => internalBuilder.getRules()\n };\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACU,IAAC;AACX,CAAC,UAAU,cAAc,EAAE;AAC3B,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;AAC/B,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;AAC/B,IAAI,cAAc,CAAC,KAAK,CAAC,GAAG,KAAK;AACjC,IAAI,cAAc,CAAC,KAAK,CAAC,GAAG,KAAK;AACjC,IAAI,cAAc,CAAC,YAAY,CAAC,GAAG,WAAW;AAC9C,IAAI,cAAc,CAAC,YAAY,CAAC,GAAG,WAAW;AAC9C,IAAI,cAAc,CAAC,aAAa,CAAC,GAAG,YAAY;AAChD,IAAI,cAAc,CAAC,WAAW,CAAC,GAAG,UAAU;AAC5C,IAAI,cAAc,CAAC,SAAS,CAAC,GAAG,SAAS;AACzC,CAAC,EAAE,cAAc,KAAK,cAAc,GAAG,EAAE,CAAC,CAAC;AAC3C;AACA;AACA;AACA;AACA,SAAS,+BAA+B,GAAG;AAC3C,IAAI,MAAM,KAAK,GAAG,EAAE;AAC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SAAS;AACT;AACA;AACA;AACA,QAAQ,QAAQ,GAAG;AACnB,YAAY,OAAO,KAAK;AACxB;AACA,KAAK;AACL,IAAI,OAAO,OAAO;AAClB;AACA;AACA;AACA;AACA;AACO,SAAS,uBAAuB,GAAG;AAC1C,IAAI,MAAM,eAAe,GAAG,+BAA+B,EAAE;AAC7D,IAAI,OAAO;AACX,QAAQ,OAAO,EAAE,eAAe;AAChC,QAAQ,QAAQ,EAAE,MAAM,eAAe,CAAC,QAAQ;AAChD,KAAK;AACL;;;;"}
1
+ {"version":3,"file":"Validate.mjs","sources":["../../src/Validate.ts"],"sourcesContent":["/**\n * The types of validations supported\n */\nexport var ValidationType;\n(function (ValidationType) {\n ValidationType[\"GT\"] = \"gt\";\n ValidationType[\"LT\"] = \"lt\";\n ValidationType[\"GTE\"] = \"gte\";\n ValidationType[\"LTE\"] = \"lte\";\n ValidationType[\"MIN_LENGTH\"] = \"minLength\";\n ValidationType[\"MAX_LENGTH\"] = \"maxLength\";\n ValidationType[\"STARTS_WITH\"] = \"startsWith\";\n ValidationType[\"ENDS_WITH\"] = \"endsWith\";\n ValidationType[\"MATCHES\"] = \"matches\";\n})(ValidationType || (ValidationType = {}));\n/**\n * Creates an internal validation builder for a specific field type\n * @typeParam T - The type of the field being validated\n */\nfunction createValidationBuilderInternal() {\n const rules = [];\n const builder = {\n /**\n * Validates that a numeric field is greater than the specified value\n * @param value - The value that the field must be greater than\n * @param errorMessage - Optional custom error message\n */\n gt(value, errorMessage) {\n rules.push({ type: ValidationType.GT, value, errorMessage });\n return this;\n },\n /**\n * Validates that a numeric field is less than the specified value\n * @param value - The value that the field must be less than\n * @param errorMessage - Optional custom error message\n */\n lt(value, errorMessage) {\n rules.push({ type: ValidationType.LT, value, errorMessage });\n return this;\n },\n /**\n * Validates that a numeric field is greater than or equal to the specified value\n * @param value - The value that the field must be greater than or equal to\n * @param errorMessage - Optional custom error message\n */\n gte(value, errorMessage) {\n rules.push({ type: ValidationType.GTE, value, errorMessage });\n return this;\n },\n /**\n * Validates that a numeric field is less than or equal to the specified value\n * @param value - The value that the field must be less than or equal to\n * @param errorMessage - Optional custom error message\n */\n lte(value, errorMessage) {\n rules.push({ type: ValidationType.LTE, value, errorMessage });\n return this;\n },\n /**\n * Validates that a numeric field is positive. We use gt(0) internally to achieve this.\n * @param errorMessage - Optional custom error message\n */\n positive(errorMessage) {\n rules.push({ type: ValidationType.GT, value: 0, errorMessage });\n return this;\n },\n /**\n * Validates that a numeric field is negative. We use lt(0) internally to achieve this.\n * @param errorMessage - Optional custom error message\n */\n negative(errorMessage) {\n rules.push({ type: ValidationType.LT, value: 0, errorMessage });\n return this;\n },\n /**\n * Validates that a string field has at least the specified length\n * @param length - The minimum length required\n * @param errorMessage - Optional custom error message\n */\n minLength(length, errorMessage) {\n rules.push({ type: ValidationType.MIN_LENGTH, value: length, errorMessage });\n return this;\n },\n /**\n * Validates that a string field does not exceed the specified length\n * @param length - The maximum length allowed\n * @param errorMessage - Optional custom error message\n */\n maxLength(length, errorMessage) {\n rules.push({ type: ValidationType.MAX_LENGTH, value: length, errorMessage });\n return this;\n },\n /**\n * Validates that a string field starts with the specified prefix\n * @param prefix - The prefix the string must start with\n * @param errorMessage - Optional custom error message\n */\n startsWith(prefix, errorMessage) {\n rules.push({ type: ValidationType.STARTS_WITH, value: prefix, errorMessage });\n return this;\n },\n /**\n * Validates that a string field ends with the specified suffix\n * @param suffix - The suffix the string must end with\n * @param errorMessage - Optional custom error message\n */\n endsWith(suffix, errorMessage) {\n rules.push({ type: ValidationType.ENDS_WITH, value: suffix, errorMessage });\n return this;\n },\n /**\n * Validates that a string field matches the specified regular expression pattern\n * @param pattern - The regex pattern the string must match\n * @param errorMessage - Optional custom error message\n */\n matches(pattern, errorMessage) {\n rules.push({ type: ValidationType.MATCHES, value: pattern, errorMessage });\n return this;\n },\n /**\n * Returns all the validation rules defined by this builder\n */\n getRules() {\n return rules;\n }\n };\n return builder;\n}\n/**\n * Creates a type-safe validation builder for a specific field type with access to get the rules\n * @returns An object containing the validation builder and a function to get the rules\n */\nexport function createValidationBuilder() {\n const internalBuilder = createValidationBuilderInternal();\n return {\n builder: internalBuilder,\n getRules: () => internalBuilder.getRules()\n };\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACU,IAAC;AACX,CAAC,UAAU,cAAc,EAAE;AAC3B,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;AAC/B,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;AAC/B,IAAI,cAAc,CAAC,KAAK,CAAC,GAAG,KAAK;AACjC,IAAI,cAAc,CAAC,KAAK,CAAC,GAAG,KAAK;AACjC,IAAI,cAAc,CAAC,YAAY,CAAC,GAAG,WAAW;AAC9C,IAAI,cAAc,CAAC,YAAY,CAAC,GAAG,WAAW;AAC9C,IAAI,cAAc,CAAC,aAAa,CAAC,GAAG,YAAY;AAChD,IAAI,cAAc,CAAC,WAAW,CAAC,GAAG,UAAU;AAC5C,IAAI,cAAc,CAAC,SAAS,CAAC,GAAG,SAAS;AACzC,CAAC,EAAE,cAAc,KAAK,cAAc,GAAG,EAAE,CAAC,CAAC;AAC3C;AACA;AACA;AACA;AACA,SAAS,+BAA+B,GAAG;AAC3C,IAAI,MAAM,KAAK,GAAG,EAAE;AACpB,IAAI,MAAM,OAAO,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE;AAChC,YAAY,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;AACxE,YAAY,OAAO,IAAI;AACvB,QAAQ,CAAC;AACT;AACA;AACA;AACA;AACA;AACA,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE;AAChC,YAAY,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;AACxE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version":3,"file":"ConversationSchemaProcessor.mjs","sources":["../../../src/ai/ConversationSchemaProcessor.ts"],"sourcesContent":["import { accessData } from '../Authorization';\nimport { capitalize } from '../runtime/utils';\nexport const createConversationField = (typeDef, typeName) => {\n const { aiModel, systemPrompt, handler, tools } = typeDef;\n const { strategy, provider } = extractAuthorization(typeDef, typeName);\n const args = {\n aiModel: aiModel.resourcePath,\n // This is done to escape newlines in potentially multi-line system prompts\n // e.g.\n // realtorChat: a.conversation({\n // aiModel: a.ai.model('Claude 3 Haiku'),\n // systemPrompt: `You are a helpful real estate assistant\n // Respond in the poetic form of haiku.`,\n // }),\n //\n // It doesn't affect non multi-line string inputs for system prompts\n systemPrompt: systemPrompt.replace(/\\r?\\n/g, '\\\\n'),\n };\n const argsString = Object.entries(args)\n .map(([key, value]) => `${key}: \"${value}\"`)\n .join(', ');\n const authString = `, auth: { strategy: ${strategy}, provider: ${provider} }`;\n const functionHandler = {};\n let handlerString = '';\n if (handler) {\n const functionName = `Fn${capitalize(typeName)}`;\n const eventVersion = handler.eventVersion;\n handlerString = `, handler: { functionName: \"${functionName}\", eventVersion: \"${eventVersion}\" }`;\n functionHandler[functionName] = handler;\n }\n const toolsString = tools?.length\n ? `, tools: [${getConversationToolsString(tools)}]`\n : '';\n const conversationDirective = `@conversation(${argsString}${authString}${handlerString}${toolsString})`;\n const field = `${typeName}(conversationId: ID!, content: [AmplifyAIContentBlockInput], aiContext: AWSJSON, toolConfiguration: AmplifyAIToolConfigurationInput): AmplifyAIConversationMessage ${conversationDirective} @aws_cognito_user_pools`;\n return { field, functionHandler };\n};\nconst isRef = (query) => query?.data?.type === 'ref';\nconst extractAuthorization = (typeDef, typeName) => {\n const { authorization } = typeDef.data;\n if (authorization.length === 0) {\n throw new Error(`Conversation ${typeName} is missing authorization rules. Use .authorization((allow) => allow.owner()) to configure authorization for your conversation route.`);\n }\n const { strategy, provider } = accessData(authorization[0]);\n if (strategy !== 'owner' || provider !== 'userPools') {\n throw new Error(`Conversation ${typeName} must use owner authorization with a user pool provider. Use .authorization((allow) => allow.owner()) to configure authorization for your conversation route.`);\n }\n return { strategy, provider };\n};\nconst getConversationToolsString = (tools) => tools\n .map((tool) => {\n const { name, description } = tool;\n // https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ToolSpecification.html\n // Pattern: ^[a-zA-Z][a-zA-Z0-9_]*$\n // Length Constraints: Minimum length of 1. Maximum length of 64.\n const isValidToolName = /^[a-zA-Z][a-zA-Z0-9_]*$/.test(name) &&\n name.length >= 1 &&\n name.length <= 64;\n if (!isValidToolName) {\n throw new Error(`Tool name must be between 1 and 64 characters, start with a letter, and contain only letters, numbers, and underscores. Found: ${name}`);\n }\n const toolDefinition = extractToolDefinition(tool);\n return `{ name: \"${name}\", description: \"${description}\", ${toolDefinition} }`;\n})\n .join(', ');\nconst extractToolDefinition = (tool) => {\n if ('model' in tool) {\n if (!isRef(tool.model))\n throw new Error(`Unexpected model was found in tool ${tool}.`);\n const { model, modelOperation } = tool;\n return `modelName: \"${model.data.link}\", modelOperation: ${modelOperation}`;\n }\n if (!isRef(tool.query))\n throw new Error(`Unexpected query was found in tool ${tool}.`);\n return `queryName: \"${tool.query.data.link}\"`;\n};\n"],"names":[],"mappings":";;;AAEY,MAAC,uBAAuB,GAAG,CAAC,OAAO,EAAE,QAAQ,KAAK;AAC9D,IAAI,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,OAAO;AAC7D,IAAI,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,oBAAoB,CAAC,OAAO,EAAE,QAAQ,CAAC;AAC1E,IAAI,MAAM,IAAI,GAAG;AACjB,QAAQ,OAAO,EAAE,OAAO,CAAC,YAAY;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,YAAY,EAAE,YAAY,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC;AAC3D,KAAK;AACL,IAAI,MAAM,U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AG,CAAC,IAAI,KAAK;AACxC,IAAI,IAAI,OAAO,IAAI,IAAI,EAAE;AACzB,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AAC9B,YAAY,MAAM,IAAI,KAAK,CAAC,CAAC,mCAAmC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AAC1E,QAAQ,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,IAAI;AAC9C,QAAQ,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;AACnF;AACA,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AAC1B,QAAQ,MAAM,IAAI,KAAK,CAAC,CAAC,mCAAmC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AACtE,IAAI,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACjD,CAAC;;;;"}
1
+ {"version":3,"file":"ConversationSchemaProcessor.mjs","sources":["../../../src/ai/ConversationSchemaProcessor.ts"],"sourcesContent":["import { accessData } from '../Authorization';\nimport { capitalize } from '../runtime/utils';\nexport const createConversationField = (typeDef, typeName) => {\n const { aiModel, systemPrompt, handler, tools } = typeDef;\n const { strategy, provider } = extractAuthorization(typeDef, typeName);\n const args = {\n aiModel: aiModel.resourcePath,\n // This is done to escape newlines in potentially multi-line system prompts\n // e.g.\n // realtorChat: a.conversation({\n // aiModel: a.ai.model('Claude 3 Haiku'),\n // systemPrompt: `You are a helpful real estate assistant\n // Respond in the poetic form of haiku.`,\n // }),\n //\n // It doesn't affect non multi-line string inputs for system prompts\n systemPrompt: systemPrompt.replace(/\\r?\\n/g, '\\\\n'),\n };\n const argsString = Object.entries(args)\n .map(([key, value]) => `${key}: \"${value}\"`)\n .join(', ');\n const authString = `, auth: { strategy: ${strategy}, provider: ${provider} }`;\n const functionHandler = {};\n let handlerString = '';\n if (handler) {\n const functionName = `Fn${capitalize(typeName)}`;\n const eventVersion = handler.eventVersion;\n handlerString = `, handler: { functionName: \"${functionName}\", eventVersion: \"${eventVersion}\" }`;\n functionHandler[functionName] = handler;\n }\n const toolsString = tools?.length\n ? `, tools: [${getConversationToolsString(tools)}]`\n : '';\n const conversationDirective = `@conversation(${argsString}${authString}${handlerString}${toolsString})`;\n const field = `${typeName}(conversationId: ID!, content: [AmplifyAIContentBlockInput], aiContext: AWSJSON, toolConfiguration: AmplifyAIToolConfigurationInput): AmplifyAIConversationMessage ${conversationDirective} @aws_cognito_user_pools`;\n return { field, functionHandler };\n};\nconst isRef = (query) => query?.data?.type === 'ref';\nconst extractAuthorization = (typeDef, typeName) => {\n const { authorization } = typeDef.data;\n if (authorization.length === 0) {\n throw new Error(`Conversation ${typeName} is missing authorization rules. Use .authorization((allow) => allow.owner()) to configure authorization for your conversation route.`);\n }\n const { strategy, provider } = accessData(authorization[0]);\n if (strategy !== 'owner' || provider !== 'userPools') {\n throw new Error(`Conversation ${typeName} must use owner authorization with a user pool provider. Use .authorization((allow) => allow.owner()) to configure authorization for your conversation route.`);\n }\n return { strategy, provider };\n};\nconst getConversationToolsString = (tools) => tools\n .map((tool) => {\n const { name, description } = tool;\n // https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ToolSpecification.html\n // Pattern: ^[a-zA-Z][a-zA-Z0-9_]*$\n // Length Constraints: Minimum length of 1. Maximum length of 64.\n const isValidToolName = /^[a-zA-Z][a-zA-Z0-9_]*$/.test(name) &&\n name.length >= 1 &&\n name.length <= 64;\n if (!isValidToolName) {\n throw new Error(`Tool name must be between 1 and 64 characters, start with a letter, and contain only letters, numbers, and underscores. Found: ${name}`);\n }\n const toolDefinition = extractToolDefinition(tool);\n return `{ name: \"${name}\", description: \"${description}\", ${toolDefinition} }`;\n})\n .join(', ');\nconst extractToolDefinition = (tool) => {\n if ('model' in tool) {\n if (!isRef(tool.model))\n throw new Error(`Unexpected model was found in tool ${tool}.`);\n const { model, modelOperation } = tool;\n return `modelName: \"${model.data.link}\", modelOperation: ${modelOperation}`;\n }\n if (!isRef(tool.query))\n throw new Error(`Unexpected query was found in tool ${tool}.`);\n return `queryName: \"${tool.query.data.link}\"`;\n};\n"],"names":[],"mappings":";;;AAEY,MAAC,uBAAuB,GAAG,CAAC,OAAO,EAAE,QAAQ,KAAK;AAC9D,IAAI,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,OAAO;AAC7D,IAAI,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,oBAAoB,CAAC,OAAO,EAAE,QAAQ,CAAC;AAC1E,IAAI,MAAM,IAAI,GAAG;AACjB,QAAQ,OAAO,EAAE,OAAO,CAAC,YAAY;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,YAAY,EAAE,YAAY,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC;AAC3D,KAAK;AACL,IAAI,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI;AAC1C,SAAS,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;AACnD,SAAS,IAAI,CAAC,IAAI,CAAC;AACnB,IAAI,MAAM,UAAU,GAAG,CAAC,oBAAoB,EAAE,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;AACjF,IAAI,MAAM,eAAe,GAAG,EAAE;AAC9B,IAAI,IAAI,aAAa,GAAG,EAAE;AAC1B,IAAI,IAAI,OAAO,EAAE;AACjB,QAAQ,MAAM,YAAY,GAAG,CAAC,EAAE,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;AACxD,QAAQ,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY;AACjD,QAAQ,aAAa,GAAG,C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AACtE,IAAI,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACjD,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConversationType.mjs","sources":["../../../src/ai/ConversationType.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { allowForConversations } from '../Authorization';\nimport { brand } from '../util';\nexport const brandName = 'conversationCustomOperation';\n/**\n * Define a data tool to be used within an AI conversation route.\n *\n * @remarks\n *\n * Data tools can use a model generated list query or a custom query.\n * The tool's name must satisfy the following requirements:\n * - Be unique across all tools for a given conversation.\n * - Length must be between 1 and 64 characters.\n * - Must start with a letter.\n * - Must contain only letters, numbers, and underscores.\n *\n * The tool's `name` and `description` are used by the LLM to help it understand\n * the tool's purpose.\n *\n * @example\n *\n * realtorChat: a.conversation({\n * aiModel: a.ai.model('Claude 3 Haiku'),\n * systemPrompt: 'You are a helpful real estate assistant',\n * tools: [\n * // Data tools can use a model generated list query.\n * a.ai.dataTool({\n * name: 'get_listed_properties',\n * description: 'Get properties currently listed for sale',\n * model: a.model('RealEstateProperty'),\n * modelOperation: 'list',\n * }),\n * // Data tools can also use a custom query.\n * a.ai.dataTool({\n * name: 'get_oncall_realtor',\n * description: 'Get the oncall realtor',\n * query: a.query('getOnCallRealtor'),\n * }),\n * ],\n * })\n * @returns a data tool definition\n */\nexport function dataTool(input) {\n return input;\n}\nfunction _conversation(input) {\n const data = {\n authorization: [],\n };\n const builder = {\n authorization(callback) {\n const rules = callback(allowForConversations);\n data.authorization = Array.isArray(rules) ? rules : [rules];\n return this;\n },\n };\n return {\n ...brand(brandName),\n ...input,\n ...builder,\n data,\n };\n}\n/**\n * Define an AI conversation route which enables multi-turn conversation APIs for interacting with specified AI model.\n * @example\n * realtorChat: a.conversation({\n * aiModel: { resourcePath },\n * systemPrompt: 'You are a helpful real estate assistant',\n * })\n * @returns a conversation route definition\n */\nexport function conversation(input) {\n return _conversation(input);\n}\n"],"names":[],"mappings":";;;AAAA;AACA;AAGY,MAAC,SAAS,GAAG;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,QAAQ,CAAC,KAAK,EAAE;AAChC,IAAI,OAAO,KAAK;AAChB;AACA,SAAS,aAAa,CAAC,KAAK,EAAE;AAC9B,IAAI,MAAM,IAAI,GAAG;AACjB,QAAQ,aAAa,EAAE,EAAE;AACzB,KAAK;AACL,IAAI,MAAM,OAAO,GAAG;AACpB,QAAQ,aAAa,CAAC,QAAQ,EAAE;AAChC,YAAY,MAAM,KAAK,GAAG,QAAQ,CAAC,qBAAqB,CAAC;AACzD,YAAY,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC;AACvE,YAAY,OAAO,IAAI;AACvB,SAAS;AACT,KAAK;AACL,IAAI,OAAO;AACX,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC;AAC3B,QAAQ,GAAG,KAAK;AAChB,QAAQ,GAAG,OAAO;AAClB,QAAQ,IAAI;AACZ,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY,CAAC,KAAK,EAAE;AACpC,IAAI,OAAO,aAAa,CAAC,KAAK,CAAC;AAC/B;;;;"}
1
+ {"version":3,"file":"ConversationType.mjs","sources":["../../../src/ai/ConversationType.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { allowForConversations } from '../Authorization';\nimport { brand } from '../util';\nexport const brandName = 'conversationCustomOperation';\n/**\n * Define a data tool to be used within an AI conversation route.\n *\n * @remarks\n *\n * Data tools can use a model generated list query or a custom query.\n * The tool's name must satisfy the following requirements:\n * - Be unique across all tools for a given conversation.\n * - Length must be between 1 and 64 characters.\n * - Must start with a letter.\n * - Must contain only letters, numbers, and underscores.\n *\n * The tool's `name` and `description` are used by the LLM to help it understand\n * the tool's purpose.\n *\n * @example\n *\n * realtorChat: a.conversation({\n * aiModel: a.ai.model('Claude 3 Haiku'),\n * systemPrompt: 'You are a helpful real estate assistant',\n * tools: [\n * // Data tools can use a model generated list query.\n * a.ai.dataTool({\n * name: 'get_listed_properties',\n * description: 'Get properties currently listed for sale',\n * model: a.model('RealEstateProperty'),\n * modelOperation: 'list',\n * }),\n * // Data tools can also use a custom query.\n * a.ai.dataTool({\n * name: 'get_oncall_realtor',\n * description: 'Get the oncall realtor',\n * query: a.query('getOnCallRealtor'),\n * }),\n * ],\n * })\n * @returns a data tool definition\n */\nexport function dataTool(input) {\n return input;\n}\nfunction _conversation(input) {\n const data = {\n authorization: [],\n };\n const builder = {\n authorization(callback) {\n const rules = callback(allowForConversations);\n data.authorization = Array.isArray(rules) ? rules : [rules];\n return this;\n },\n };\n return {\n ...brand(brandName),\n ...input,\n ...builder,\n data,\n };\n}\n/**\n * Define an AI conversation route which enables multi-turn conversation APIs for interacting with specified AI model.\n * @example\n * realtorChat: a.conversation({\n * aiModel: { resourcePath },\n * systemPrompt: 'You are a helpful real estate assistant',\n * })\n * @returns a conversation route definition\n */\nexport function conversation(input) {\n return _conversation(input);\n}\n"],"names":[],"mappings":";;;AAAA;AACA;AAGY,MAAC,SAAS,GAAG;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,QAAQ,CAAC,KAAK,EAAE;AAChC,IAAI,OAAO,KAAK;AAChB;AACA,SAAS,aAAa,CAAC,KAAK,EAAE;AAC9B,IAAI,MAAM,IAAI,GAAG;AACjB,QAAQ,aAAa,EAAE,EAAE;AACzB,KAAK;AACL,IAAI,MAAM,OAAO,GAAG;AACpB,QAAQ,aAAa,CAAC,QAAQ,EAAE;AAChC,YAAY,MAAM,KAAK,GAAG,QAAQ,CAAC,qBAAqB,CAAC;AACzD,YAAY,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC;AACvE,YAAY,OAAO,IAAI;AACvB,QAAQ,CAAC;AACT,KAAK;AACL,IAAI,OAAO;AACX,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC;AAC3B,QAAQ,GAAG,KAAK;AAChB,QAAQ,GAAG,OAAO;AAClB,QAAQ,IAAI;AACZ,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY,CAAC,KAAK,EAAE;AACpC,IAAI,OAAO,aAAa,CAAC,KAAK,CAAC;AAC/B;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"addSchemaToClientWithInstance.mjs","sources":["../../../src/runtime/addSchemaToClientWithInstance.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { isApiGraphQLConfig } from './internals/utils/runtimeTypeGuards/isApiGraphQLProviderConfig';\nimport { generateCustomQueriesProperty, generateCustomMutationsProperty, generateEnumsProperty, upgradeClientCancellation, } from './internals';\nimport { generateModelsProperty as generateModelsPropertyServer } from './internals/server';\n// TODO: separate import path\nexport function addSchemaToClientWithInstance(client, params, getInternals) {\n const apiGraphqlConfig = params.config?.API?.GraphQL;\n if (isApiGraphQLConfig(apiGraphqlConfig)) {\n upgradeClientCancellation(client);\n client.models = generateModelsPropertyServer(client, params, getInternals);\n client.enums = generateEnumsProperty(apiGraphqlConfig);\n client.queries = generateCustomQueriesProperty(client, apiGraphqlConfig, getInternals);\n client.mutations = generateCustomMutationsProperty(client, apiGraphqlConfig, getInternals);\n }\n return client;\n}\n"],"names":["generateModelsPropertyServer"],"mappings":";;;;;;;;;AAAA;AACA;AAIA;AACO,SAAS,6BAA6B,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE;AAC5E,IAAI,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO;AACxD,IAAI,IAAI,kBAAkB,CAAC,gBAAgB,CAAC,EAAE;AAC9C,QAAQ,yBAAyB,CAAC,MAAM,CAAC;AACzC,QAAQ,MAAM,CAAC,MAAM,GAAGA,sBAA4B,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC;AAClF,QAAQ,MAAM,CAAC,KAAK,GAAG,qBAAqB,CAAC,gBAAgB,CAAC;AAC9D,QAAQ,MAAM,CAAC,OAAO,GAAG,6BAA6B,CAAC,MAAM,EAAE,gBAAgB,EAAE,YAAY,CAAC;AAC9F,QAAQ,MAAM,CAAC,SAAS,GAAG,+BAA+B,CAAC,MAAM,EAAE,gBAAgB,EAAE,YAAY,CAAC;AAClG;AACA,IAAI,OAAO,MAAM;AACjB;;;;"}
1
+ {"version":3,"file":"addSchemaToClientWithInstance.mjs","sources":["../../../src/runtime/addSchemaToClientWithInstance.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { isApiGraphQLConfig } from './internals/utils/runtimeTypeGuards/isApiGraphQLProviderConfig';\nimport { generateCustomQueriesProperty, generateCustomMutationsProperty, generateEnumsProperty, upgradeClientCancellation, } from './internals';\nimport { generateModelsProperty as generateModelsPropertyServer } from './internals/server';\n// TODO: separate import path\nexport function addSchemaToClientWithInstance(client, params, getInternals) {\n const apiGraphqlConfig = params.config?.API?.GraphQL;\n if (isApiGraphQLConfig(apiGraphqlConfig)) {\n upgradeClientCancellation(client);\n client.models = generateModelsPropertyServer(client, params, getInternals);\n client.enums = generateEnumsProperty(apiGraphqlConfig);\n client.queries = generateCustomQueriesProperty(client, apiGraphqlConfig, getInternals);\n client.mutations = generateCustomMutationsProperty(client, apiGraphqlConfig, getInternals);\n }\n return client;\n}\n"],"names":["generateModelsPropertyServer"],"mappings":";;;;;;;;;AAAA;AACA;AAIA;AACO,SAAS,6BAA6B,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE;AAC5E,IAAI,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO;AACxD,IAAI,IAAI,kBAAkB,CAAC,gBAAgB,CAAC,EAAE;AAC9C,QAAQ,yBAAyB,CAAC,MAAM,CAAC;AACzC,QAAQ,MAAM,CAAC,MAAM,GAAGA,sBAA4B,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC;AAClF,QAAQ,MAAM,CAAC,KAAK,GAAG,qBAAqB,CAAC,gBAAgB,CAAC;AAC9D,QAAQ,MAAM,CAAC,OAAO,GAAG,6BAA6B,CAAC,MAAM,EAAE,gBAAgB,EAAE,YAAY,CAAC;AAC9F,QAAQ,MAAM,CAAC,SAAS,GAAG,+BAA+B,CAAC,MAAM,EAAE,gBAAgB,EAAE,YAAY,CAAC;AAClG,IAAI;AACJ,IAAI,OAAO,MAAM;AACjB;;;;"}
@@ -139,59 +139,13 @@ type FlattenArrays<T> = {
139
139
  * and especially for bi-directional relationships which are infinitely recursable by their nature
140
140
  *
141
141
  */
142
- export type ModelPath<FlatModel extends Record<string, unknown>, Depth extends number = 5, // think of this as the initialization expr. in a for loop (e.g. `let depth = 5`)
142
+ type ModelPathInner<FlatModel extends Record<string, unknown>, Depth extends number = 5, // think of this as the initialization expr. in a for loop (e.g. `let depth = 5`)
143
143
  RecursionLoop extends number[] = [-1, 0, 1, 2, 3, 4], Field = keyof FlatModel> = {
144
144
  done: Field extends string ? `${Field}.*` : never;
145
- recur: Field extends string ? NonNullable<UnwrapArray<FlatModel[Field]>> extends Record<string, unknown> ? `${Field}.${ModelPath<NonNullable<UnwrapArray<FlatModel[Field]>>, RecursionLoop[Depth]>}` | `${Field}.*` : `${Field}` : never;
145
+ recur: Field extends string ? NonNullable<UnwrapArray<FlatModel[Field]>> extends Record<string, unknown> ? `${Field}.${ModelPathInner<NonNullable<UnwrapArray<FlatModel[Field]>>, RecursionLoop[Depth]>}` | `${Field}.*` : `${Field}` : never;
146
146
  }[Depth extends -1 ? 'done' : 'recur'];
147
- /**
148
- * Flattens model instance type and unwraps async functions into resolved GraphQL shape
149
- *
150
- * This type is used for generating the base shape for custom selection set input and its return value
151
- * Uses same pattern as above to limit recursion depth to maximum usable for selection set.
152
- *
153
- * @example
154
- * ### Given
155
- * ```ts
156
- * Model = {
157
- title: string;
158
- comments: () => ListReturnValue<({
159
- content: string;
160
- readonly id: string;
161
- readonly createdAt: string;
162
- readonly updatedAt: string;
163
- } | null | undefined)[]>;
164
- readonly id: string;
165
- readonly createdAt: string;
166
- readonly updatedAt: string;
167
- description?: string | ... 1 more ... | undefined;
168
- }
169
- * ```
170
- * ### Returns
171
- * ```ts
172
- * {
173
- title: string;
174
- comments: {
175
- content: string;
176
- readonly id: string;
177
- readonly createdAt: string;
178
- readonly updatedAt: string;
179
- }[];
180
- readonly id: string;
181
- readonly createdAt: string;
182
- readonly updatedAt: string;
183
- description: string | null | undefined;
184
- }
185
- *
186
- * ```
187
- */
188
- type ResolvedModel<Model extends Record<string, unknown>, Depth extends number = 7, RecursionLoop extends number[] = [-1, 0, 1, 2, 3, 4, 5, 6]> = {
189
- done: NonRelationshipFields<Model>;
190
- recur: {
191
- [Field in keyof Model]: Model[Field] extends (...args: any) => ListReturnValue<infer M> ? NonNullable<M> extends Record<string, any> ? ResolvedModel<NonNullable<M>, RecursionLoop[Depth]>[] : never : Model[Field] extends (...args: any) => SingularReturnValue<infer M> ? NonNullable<M> extends Record<string, any> ? ResolvedModel<NonNullable<M>, RecursionLoop[Depth]> : never : Model[Field];
192
- };
193
- }[Depth extends -1 ? 'done' : 'recur'];
194
- export type SelectionSet<Model extends Record<string, unknown>, Path extends ReadonlyArray<ModelPath<FlatModel>>, FlatModel extends Record<string, unknown> = ResolvedModel<Model>> = WithOptionalsAsNullishOnly<CustomSelectionSetReturnValue<FlatModel, Path[number]>>;
147
+ export type ModelPath<FlatModel extends Record<string, unknown>> = ModelPathInner<FlatModel>;
148
+ export type SelectionSet<Model, Path extends ReadonlyArray<ModelPath<FlatModel>>, FlatModel extends Record<string, unknown> = Model extends ClientSchemaByEntityTypeBaseShape['models'][string] ? Model['__meta']['flatModel'] : Record<string, any>> = Model extends ClientSchemaByEntityTypeBaseShape['models'][string] ? WithOptionalsAsNullishOnly<CustomSelectionSetReturnValue<FlatModel, Path[number]>> : any;
195
149
  /**
196
150
  * See: https://spec.graphql.org/draft/#sec-Errors
197
151
  */
@@ -299,7 +253,7 @@ interface ClientSecondaryIndexField {
299
253
  type IndexQueryMethods<Model extends ClientSchemaByEntityTypeBaseShape['models'][string], Context extends ContextType = 'CLIENT'> = {
300
254
  [K in keyof Select<Model['secondaryIndexes'], ClientSecondaryIndexField>]: IndexQueryMethod<Model, Select<Model['secondaryIndexes'], ClientSecondaryIndexField>[K], Context>;
301
255
  };
302
- type IndexQueryMethod<Model extends ClientSchemaByEntityTypeBaseShape['models'][string], Method extends ClientSecondaryIndexField, Context extends ContextType = 'CLIENT', FlatModel extends Record<string, unknown> = ResolvedModel<Model['type']>> = Context extends 'CLIENT' | 'COOKIES' ? <SelectionSet extends ReadonlyArray<ModelPath<FlatModel>> = never[]>(input: Method['input'], options?: {
256
+ type IndexQueryMethod<Model extends ClientSchemaByEntityTypeBaseShape['models'][string], Method extends ClientSecondaryIndexField, Context extends ContextType = 'CLIENT', FlatModel extends Record<string, unknown> = Model['__meta']['flatModel']> = Context extends 'CLIENT' | 'COOKIES' ? <SelectionSet extends ReadonlyArray<ModelPath<FlatModel>> = never[]>(input: Method['input'], options?: {
303
257
  filter?: ModelFilter<Model>;
304
258
  sortDirection?: ModelSortDirection;
305
259
  limit?: number;
@@ -318,7 +272,7 @@ type IndexQueryMethod<Model extends ClientSchemaByEntityTypeBaseShape['models'][
318
272
  authToken?: string;
319
273
  headers?: CustomHeaders;
320
274
  }) => ListReturnValue<Prettify<ReturnValue<Model, FlatModel, SelectionSet>>>;
321
- type ModelTypesClient<Model extends ClientSchemaByEntityTypeBaseShape['models'][string], FlatModel extends Record<string, unknown> = ResolvedModel<Model['type']>> = IndexQueryMethods<Model> & Omit<{
275
+ type ModelTypesClient<Model extends ClientSchemaByEntityTypeBaseShape['models'][string], FlatModel extends Record<string, unknown> = Model['__meta']['flatModel']> = IndexQueryMethods<Model> & Omit<{
322
276
  create<SelectionSet extends ReadonlyArray<ModelPath<FlatModel>> = never[]>(model: Model['createType'], options?: {
323
277
  selectionSet?: SelectionSet;
324
278
  authMode?: AuthMode;
@@ -380,7 +334,7 @@ type ModelTypesClient<Model extends ClientSchemaByEntityTypeBaseShape['models'][
380
334
  authToken?: string;
381
335
  }): ObserveQueryReturnValue<Prettify<ReturnValue<Model, FlatModel, SelectionSet>>>;
382
336
  }, keyof Model['__meta']['disabledOperations']>;
383
- type ModelTypesSSRCookies<Model extends ClientSchemaByEntityTypeBaseShape['models'][string], FlatModel extends Record<string, unknown> = ResolvedModel<Model['type']>> = IndexQueryMethods<Model> & Omit<{
337
+ type ModelTypesSSRCookies<Model extends ClientSchemaByEntityTypeBaseShape['models'][string], FlatModel extends Record<string, unknown> = Model['__meta']['flatModel']> = IndexQueryMethods<Model> & Omit<{
384
338
  create<SelectionSet extends ReadonlyArray<ModelPath<FlatModel>> = never[]>(model: Model['createType'], options?: {
385
339
  selectionSet?: SelectionSet;
386
340
  authMode?: AuthMode;
@@ -416,7 +370,7 @@ type ModelTypesSSRCookies<Model extends ClientSchemaByEntityTypeBaseShape['model
416
370
  headers?: CustomHeaders;
417
371
  }): ListReturnValue<Prettify<ReturnValue<Model, FlatModel, SelectionSet>>>;
418
372
  }, keyof Model['__meta']['disabledOperations']>;
419
- type ModelTypesSSRRequest<Model extends ClientSchemaByEntityTypeBaseShape['models'][string], FlatModel extends Record<string, unknown> = ResolvedModel<Model['type']>> = IndexQueryMethods<Model, 'REQUEST'> & Omit<{
373
+ type ModelTypesSSRRequest<Model extends ClientSchemaByEntityTypeBaseShape['models'][string], FlatModel extends Record<string, unknown> = Model['__meta']['flatModel']> = IndexQueryMethods<Model, 'REQUEST'> & Omit<{
420
374
  create<SelectionSet extends ReadonlyArray<ModelPath<FlatModel>> = never[]>(contextSpec: AmplifyServer.ContextSpec, model: Model['createType'], options?: {
421
375
  selectionSet?: SelectionSet;
422
376
  authMode?: AuthMode;
@@ -1 +1 @@
1
- {"version":3,"file":"APIClient.mjs","sources":["../../../../src/runtime/internals/APIClient.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\nimport { resolveOwnerFields, capitalize, selfAwareAsync } from '../utils';\nimport { extendCancellability } from './cancellation';\nconst connectionType = {\n HAS_ONE: 'HAS_ONE',\n HAS_MANY: 'HAS_MANY',\n BELONGS_TO: 'BELONGS_TO',\n};\n// When generating an SK's KeyConditionInput name, string-like types map to String\nconst skGraphQlFieldTypeMap = {\n ID: 'ID',\n String: 'String',\n AWSDate: 'String',\n AWSTime: 'String',\n AWSDateTime: 'String',\n AWSTimestamp: 'Int',\n AWSEmail: 'String',\n AWSPhone: 'String',\n AWSURL: 'String',\n AWSIPAddress: 'String',\n AWSJSON: 'String',\n Boolean: 'Boolean',\n Int: 'Int',\n Float: 'Float',\n};\n// move to util\nconst resolvedSkName = (sk) => {\n if (sk.length === 1) {\n return sk[0];\n }\n else {\n return sk.reduce((acc, curr, idx) => {\n if (idx === 0) {\n return curr;\n }\n else {\n return acc + capitalize(curr);\n }\n }, '');\n }\n};\n/**\n * Crawls a model tree, starting with a given **individual** model instance record, looking\n * for related hasMany children to extract from their `items` containers.\n *\n * E.g., if we have a record like this:\n *\n * ```js\n * {\n * id: 'some-id',\n * children: {\n * items: [\n * { name: 'a' }\n * { name: 'b' }\n * { name: 'c' }\n * ]\n * }\n * }\n * ```\n *\n * And if `children` refers to *an array of another model* (as opposed to a custom type),\n * the `items` will be extracted. We do this because `items` is just the mechanism for nesting\n * child records -- we don't want customers to have to dig the items out in application code.\n * Ultimately, we return this \"flattened\" structure:\n *\n * ```js\n * {\n * id: 'some-id',\n * children: [\n * { name: 'a' }\n * { name: 'b' }\n * { name: 'c' }\n * ]\n * }\n * ```\n *\n * Notably, an identical record could be the result of a nested custom type that contains an\n * `items` property. This will *not* be flattened, because in that case the `items` property is\n * actually part of the customer's schema. Similarly if a model contains an explicit `items` field.\n *\n * @param modelIntrospection Top-level model introspection schema.\n * @param modelName The name of the model. Can be `undefined`. E.g., for customOperation return types.\n * @param modelRecord The individual \"model instance record\" to normalize.\n */\nexport const flattenItems = (modelIntrospection, modelName, modelRecord) => {\n if (!modelRecord)\n return null;\n const mapped = {};\n for (const [fieldName, value] of Object.entries(modelRecord)) {\n const fieldDef = modelName\n ? modelIntrospection.models[modelName]?.fields[fieldName]\n : undefined;\n const dvPair = { fieldDef, value };\n if (isRelatedModelItemsArrayPair(dvPair)) {\n mapped[fieldName] = dvPair.value.items.map((itemValue) => flattenItems(modelIntrospection, dvPair.fieldDef.type.model, itemValue));\n }\n else if (isRelatedModelProperty(fieldDef)) {\n mapped[fieldName] = flattenItems(modelIntrospection, fieldDef.type.model, value);\n }\n else {\n mapped[fieldName] = value;\n }\n }\n return mapped;\n};\n/**\n * Determines whether the given field definition and associated result value\n * represent a related model array from a HasMany-type relationship.\n *\n * @param dv Pair of field definition and associated result value\n * @returns\n */\nfunction isRelatedModelItemsArrayPair(dv) {\n return (typeof dv.fieldDef?.type === 'object' &&\n 'model' in dv.fieldDef.type &&\n typeof dv.fieldDef.type.model === 'string' &&\n dv.fieldDef.isArray &&\n Array.isArray(dv.value?.items));\n}\n/**\n * Determines whether the given field definition represents a relationship\n * to another model.\n *\n * @param fieldDef\n * @returns\n */\nfunction isRelatedModelProperty(fieldDef) {\n return (typeof fieldDef?.type === 'object' &&\n 'model' in fieldDef.type &&\n typeof fieldDef.type.model === 'string');\n}\n// TODO: this should accept single result to support CRUD methods; create helper for array/list\nexport function initializeModel(client, modelName, result, modelIntrospection, authMode, authToken, context = false) {\n const introModel = modelIntrospection.models[modelName];\n const introModelFields = introModel.fields;\n const modelFields = Object.entries(introModelFields)\n .filter(([_, field]) => field?.type?.model !== undefined)\n .map(([fieldName]) => fieldName);\n return result.map((record) => {\n if (record === null || record === undefined) {\n return record;\n }\n const initializedRelationshipFields = {};\n for (const fieldName of modelFields) {\n const modelField = introModelFields[fieldName];\n const modelFieldType = modelField?.type;\n const relatedModelName = modelFieldType.model;\n const relatedModel = modelIntrospection.models[relatedModelName];\n const relatedModelPKFieldName = relatedModel.primaryKeyInfo.primaryKeyFieldName;\n const relatedModelSKFieldNames = relatedModel.primaryKeyInfo.sortKeyFieldNames;\n const relationType = modelField.association?.connectionType;\n let connectionFields = [];\n if (modelField.association &&\n 'associatedWith' in modelField.association) {\n connectionFields = modelField.association.associatedWith;\n }\n const targetNames = [];\n if (modelField.association && 'targetNames' in modelField.association) {\n targetNames.push(...modelField.association.targetNames);\n }\n switch (relationType) {\n case connectionType.BELONGS_TO: {\n const sortKeyValues = relatedModelSKFieldNames.reduce(\n // TODO(Eslint): is this implementation correct?\n // eslint-disable-next-line array-callback-return\n (acc, curVal) => {\n if (record[curVal]) {\n acc[curVal] = record[curVal];\n }\n return acc;\n }, {});\n // if get is disabled on the related model\n if (client.models[relatedModelName]?.get === undefined) {\n break;\n }\n if (context) {\n initializedRelationshipFields[fieldName] = (contextSpec, options) => {\n if (record[targetNames[0]]) {\n return client.models[relatedModelName].get(contextSpec, {\n [relatedModelPKFieldName]: record[targetNames[0]],\n ...sortKeyValues,\n }, {\n authMode: options?.authMode || authMode,\n authToken: options?.authToken || authToken,\n });\n }\n return { data: null };\n };\n }\n else {\n initializedRelationshipFields[fieldName] = (options) => {\n if (record[targetNames[0]]) {\n return client.models[relatedModelName].get({\n [relatedModelPKFieldName]: record[targetNames[0]],\n ...sortKeyValues,\n }, {\n authMode: options?.authMode || authMode,\n authToken: options?.authToken || authToken,\n });\n }\n return { data: null };\n };\n }\n break;\n }\n case connectionType.HAS_ONE:\n case connectionType.HAS_MANY: {\n /**\n * If the loader is a HAS_ONE, we just need to attempt to grab the first item\n * from the result.\n */\n const mapResult = relationType === connectionType.HAS_ONE\n ? (result) => {\n return {\n data: result?.data.shift() || null,\n errors: result.errors,\n extensions: result.extensions,\n };\n }\n : (result) => result;\n const parentPk = introModel.primaryKeyInfo.primaryKeyFieldName;\n const parentSK = introModel.primaryKeyInfo.sortKeyFieldNames;\n // M:N check - TODO: refactor\n const relatedModelField = relatedModel.fields[connectionFields[0]];\n const relatedModelFieldType = relatedModelField.type;\n if (relatedModelFieldType.model) {\n let relatedTargetNames = [];\n if (relatedModelField.association &&\n 'targetNames' in relatedModelField.association) {\n relatedTargetNames = relatedModelField.association?.targetNames;\n }\n const hasManyFilter = relatedTargetNames.map((field, idx) => {\n if (idx === 0) {\n return { [field]: { eq: record[parentPk] } };\n }\n return { [field]: { eq: record[parentSK[idx - 1]] } };\n });\n // if list is disabled on the related model\n if (client.models[relatedModelName]?.list === undefined) {\n break;\n }\n if (context) {\n initializedRelationshipFields[fieldName] = (contextSpec, options) => {\n if (record[parentPk]) {\n return selfAwareAsync(async (resultPromise) => {\n const basePromise = client.models[relatedModelName].list(contextSpec, {\n filter: { and: hasManyFilter },\n limit: options?.limit,\n nextToken: options?.nextToken,\n authMode: options?.authMode || authMode,\n authToken: options?.authToken || authToken,\n });\n const extendedBase = extendCancellability(basePromise, resultPromise);\n return mapResult((await extendedBase));\n });\n }\n return [];\n };\n }\n else {\n initializedRelationshipFields[fieldName] = (options) => {\n if (record[parentPk]) {\n return selfAwareAsync(async (resultPromise) => {\n const basePromise = client.models[relatedModelName].list({\n filter: { and: hasManyFilter },\n limit: options?.limit,\n nextToken: options?.nextToken,\n authMode: options?.authMode || authMode,\n authToken: options?.authToken || authToken,\n });\n const extendedBase = extendCancellability(basePromise, resultPromise);\n return mapResult((await extendedBase));\n });\n }\n return [];\n };\n }\n break;\n }\n const hasManyFilter = connectionFields.map((field, idx) => {\n if (idx === 0) {\n return { [field]: { eq: record[parentPk] } };\n }\n return { [field]: { eq: record[parentSK[idx - 1]] } };\n });\n // if list is disabled on the related model\n if (client.models[relatedModelName]?.list === undefined) {\n break;\n }\n if (context) {\n initializedRelationshipFields[fieldName] = (contextSpec, options) => {\n if (record[parentPk]) {\n return selfAwareAsync(async (resultPromise) => {\n const basePromise = client.models[relatedModelName].list(contextSpec, {\n filter: { and: hasManyFilter },\n limit: options?.limit,\n nextToken: options?.nextToken,\n authMode: options?.authMode || authMode,\n authToken: options?.authToken || authToken,\n });\n const extendedBase = extendCancellability(basePromise, resultPromise);\n return mapResult((await extendedBase));\n });\n }\n return [];\n };\n }\n else {\n initializedRelationshipFields[fieldName] = (options) => {\n if (record[parentPk]) {\n return selfAwareAsync(async (resultPromise) => {\n const basePromise = client.models[relatedModelName].list({\n filter: { and: hasManyFilter },\n limit: options?.limit,\n nextToken: options?.nextToken,\n authMode: options?.authMode || authMode,\n authToken: options?.authToken || authToken,\n });\n const extendedBase = extendCancellability(basePromise, resultPromise);\n return mapResult((await extendedBase));\n });\n }\n return [];\n };\n }\n break;\n }\n default:\n break;\n }\n }\n return { ...record, ...initializedRelationshipFields };\n });\n}\nexport const graphQLOperationsInfo = {\n CREATE: { operationPrefix: 'create', usePlural: false },\n GET: { operationPrefix: 'get', usePlural: false },\n UPDATE: { operationPrefix: 'update', usePlural: false },\n DELETE: { operationPrefix: 'delete', usePlural: false },\n LIST: { operationPrefix: 'list', usePlural: true },\n INDEX_QUERY: { operationPrefix: '', usePlural: false },\n ONCREATE: { operationPrefix: 'onCreate', usePlural: false },\n ONUPDATE: { operationPrefix: 'onUpdate', usePlural: false },\n ONDELETE: { operationPrefix: 'onDelete', usePlural: false },\n OBSERVEQUERY: { operationPrefix: 'observeQuery', usePlural: false },\n};\nconst SELECTION_SET_WILDCARD = '*';\nexport const getDefaultSelectionSetForNonModelWithIR = (nonModelDefinition, modelIntrospection) => {\n const { fields } = nonModelDefinition;\n const mappedFields = Object.values(fields)\n .map(({ type, name }) => {\n if (typeof type.enum === 'string') {\n return [name, FIELD_IR];\n }\n if (typeof type.nonModel === 'string') {\n return [\n name,\n getDefaultSelectionSetForNonModelWithIR(modelIntrospection.nonModels[type.nonModel], modelIntrospection),\n ];\n }\n if (typeof type === 'string') {\n return [name, FIELD_IR];\n }\n return undefined;\n })\n .filter((pair) => pair !== undefined);\n return Object.fromEntries(mappedFields);\n};\nconst getDefaultSelectionSetForModelWithIR = (modelDefinition, modelIntrospection) => {\n const { fields } = modelDefinition;\n const mappedFields = Object.values(fields)\n .map(({ type, name }) => {\n if (typeof type.enum === 'string' ||\n typeof type === 'string') {\n return [name, FIELD_IR];\n }\n if (typeof type.nonModel === 'string') {\n return [\n name,\n getDefaultSelectionSetForNonModelWithIR(modelIntrospection.nonModels[type.nonModel], modelIntrospection),\n ];\n }\n return undefined;\n })\n .filter((pair) => pair !== undefined);\n const ownerFields = resolveOwnerFields(modelDefinition).map((field) => [\n field,\n FIELD_IR,\n ]);\n return Object.fromEntries(mappedFields.concat(ownerFields));\n};\nfunction defaultSelectionSetForModel(modelDefinition) {\n // fields that are explicitly part of the graphql schema; not\n // inferred from owner auth rules.\n const { fields } = modelDefinition;\n const explicitFields = Object.values(fields)\n // Default selection set omits model fields\n .map(({ type, name }) => {\n if (typeof type === 'string')\n return name;\n if (typeof type === 'object') {\n if (typeof type?.enum === 'string') {\n return name;\n }\n else if (typeof type?.nonModel === 'string') {\n return `${name}.${SELECTION_SET_WILDCARD}`;\n }\n }\n return undefined;\n })\n .filter(Boolean);\n // fields used for owner auth rules that may or may not also\n // be explicit on the model.\n const ownerFields = resolveOwnerFields(modelDefinition);\n return Array.from(new Set(explicitFields.concat(ownerFields)));\n}\nconst FIELD_IR = '';\n/**\n * Generates nested Custom Selection Set IR from path\n *\n * @param modelDefinitions\n * @param modelName\n * @param selectionSet - array of object paths\n * @example\n * ### Given\n * `selectionSet = ['id', 'comments.post.id']`\n * ### Returns\n * ```ts\n * {\n * id: '',\n * comments: {\n * items: { post: { id: '' } }\n * }\n * }\n * ```\n */\nexport function customSelectionSetToIR(modelIntrospection, modelName, selectionSet) {\n const dotNotationToObject = (path, modelOrNonModelName) => {\n const [fieldName, ...rest] = path.split('.');\n const nested = rest[0];\n const modelOrNonModelDefinition = modelIntrospection.models[modelOrNonModelName] ??\n modelIntrospection.nonModels[modelOrNonModelName];\n const modelOrNonModelFields = modelOrNonModelDefinition?.fields;\n const relatedModel = modelOrNonModelFields?.[fieldName]?.type?.model;\n const relatedModelDefinition = modelIntrospection.models[relatedModel];\n const relatedNonModel = modelOrNonModelFields?.[fieldName]?.type?.nonModel;\n const relatedNonModelDefinition = modelIntrospection.nonModels[relatedNonModel];\n const isModelOrNonModelOrFieldType = relatedModelDefinition\n ? 'model'\n : relatedNonModelDefinition\n ? 'nonModel'\n : 'field';\n if (isModelOrNonModelOrFieldType === 'nonModel') {\n let result = {};\n if (!nested) {\n throw Error(`${fieldName} must declare a wildcard (*) or a field of custom type ${relatedNonModel}`);\n }\n if (nested === SELECTION_SET_WILDCARD) {\n result = {\n [fieldName]: getDefaultSelectionSetForNonModelWithIR(relatedNonModelDefinition, modelIntrospection),\n };\n }\n else {\n result = {\n [fieldName]: dotNotationToObject(rest.join('.'), relatedNonModel),\n };\n }\n return result;\n }\n else if (isModelOrNonModelOrFieldType === 'model') {\n let result = {};\n if (!nested) {\n throw Error(`${fieldName} must declare a wildcard (*) or a field of model ${relatedModel}`);\n }\n if (nested === SELECTION_SET_WILDCARD) {\n const nestedRelatedModelDefinition = modelIntrospection.models[relatedModel];\n result = {\n [fieldName]: getDefaultSelectionSetForModelWithIR(nestedRelatedModelDefinition, modelIntrospection),\n };\n }\n else {\n result = {\n [fieldName]: dotNotationToObject(rest.join('.'), relatedModel),\n };\n }\n if (modelOrNonModelFields[fieldName]?.isArray) {\n result = {\n [fieldName]: {\n items: result[fieldName],\n },\n };\n }\n return result;\n }\n else {\n const modelField = modelOrNonModelFields?.[fieldName];\n const nonModelDefinition = modelIntrospection.nonModels[modelOrNonModelName];\n const nonModelField = nonModelDefinition?.fields?.[fieldName];\n if (!nonModelDefinition) {\n const isOwnerField = resolveOwnerFields(modelOrNonModelDefinition).includes(fieldName);\n if (!modelField && !isOwnerField) {\n throw Error(`${fieldName} is not a field of model ${modelOrNonModelName}`);\n }\n }\n else {\n if (!nonModelField) {\n throw Error(`${fieldName} is not a field of custom type ${modelOrNonModelName}`);\n }\n }\n return { [fieldName]: FIELD_IR };\n }\n };\n return selectionSet.reduce((resultObj, path) => deepMergeSelectionSetObjects(dotNotationToObject(path, modelName), resultObj), {});\n}\n/**\n * Stringifies selection set IR\n * * @example\n * ### Given\n * ```ts\n * {\n * id: '',\n * comments: {\n * items: { post: { id: '' } }\n * }\n * }\n * ```\n * ### Returns\n * `'id comments { items { post { id } } }'`\n */\nexport function selectionSetIRToString(obj) {\n const res = [];\n Object.entries(obj).forEach(([fieldName, value]) => {\n if (value === FIELD_IR) {\n res.push(fieldName);\n }\n else if (typeof value === 'object' && value !== null) {\n if (value?.items) {\n res.push(fieldName, '{', 'items', '{', selectionSetIRToString(value.items), '}', '}');\n }\n else {\n res.push(fieldName, '{', selectionSetIRToString(value), '}');\n }\n }\n });\n return res.join(' ');\n}\n/**\n * Recursively merges selection set objects from `source` onto `target`.\n *\n * `target` will be updated. `source` will be left alone.\n *\n * @param source The object to merge into target.\n * @param target The object to be mutated.\n */\nfunction deepMergeSelectionSetObjects(source, target) {\n const isObject = (obj) => obj && typeof obj === 'object';\n for (const key in source) {\n // This verification avoids 'Prototype Pollution' issue\n if (!Object.prototype.hasOwnProperty.call(source, key))\n continue;\n if (Object.prototype.hasOwnProperty.call(target, key) &&\n isObject(target[key])) {\n deepMergeSelectionSetObjects(source[key], target[key]);\n }\n else {\n target[key] = source[key];\n }\n }\n return target;\n}\nexport function generateSelectionSet(modelIntrospection, modelName, selectionSet) {\n const modelDefinition = modelIntrospection.models[modelName];\n const selSetIr = customSelectionSetToIR(modelIntrospection, modelName, selectionSet ?? defaultSelectionSetForModel(modelDefinition));\n const selSetString = selectionSetIRToString(selSetIr);\n return selSetString;\n}\nexport function generateGraphQLDocument(modelIntrospection, modelDefinition, modelOperation, listArgs, indexMeta) {\n const { name, pluralName, fields, primaryKeyInfo: { isCustomPrimaryKey, primaryKeyFieldName, sortKeyFieldNames, }, attributes, } = modelDefinition;\n // Use pascal case of the model name to generate the operations and the arguments.\n // This is required to be in sync with the resources generated by the GraphQL transformers.\n const namePascalCase = name.charAt(0).toUpperCase() + name.slice(1);\n const pluralNamePascalCase = pluralName.charAt(0).toUpperCase() + pluralName.slice(1);\n const { operationPrefix, usePlural } = graphQLOperationsInfo[modelOperation];\n const { selectionSet } = listArgs || {};\n let graphQLFieldName;\n let indexQueryArgs;\n if (operationPrefix) {\n graphQLFieldName = `${operationPrefix}${usePlural ? pluralNamePascalCase : namePascalCase}`;\n }\n else if (indexMeta) {\n const { queryField, pk, sk = [] } = indexMeta;\n graphQLFieldName = queryField;\n /**\n * **a. Single field SK** -> single arg where name is the field name and the type is `Model${gqlFieldType}KeyConditionInput` (nullable)\n * Note: string-like data types e.g., AWSDateTime, AWSEmail, AWSPhone, etc. should map to String. See `skGraphQlFieldTypeMap` above\n * @example\n * ```\n * sk1: ModelStringKeyConditionInput\n * ```\n *\n * **b. Composite SK** -> single arg where the name is camelCase concatenation of all the field names that comprise the SK\n * and the type is `Model${modelName}${keyAttributeName}CompositeKeyConditionInput` (nullable)\n * @example\n * ```\n * sk1Sk2: ModelMyModelMyModelByPkAndSk1AndSk2CompositeKeyConditionInput\n */\n let skQueryArgs = {};\n if (sk.length === 1) {\n const [skField] = sk;\n const type = (typeof fields[skField].type === 'string'\n ? fields[skField].type\n : 'String');\n const normalizedType = skGraphQlFieldTypeMap[type];\n skQueryArgs = {\n [skField]: `Model${normalizedType}KeyConditionInput`,\n };\n }\n else if (sk.length > 1) {\n const compositeSkArgName = resolvedSkName(sk);\n const keyName = attributes?.find((attr) => attr?.properties?.queryField === queryField)?.properties?.name;\n skQueryArgs = {\n [compositeSkArgName]: `Model${capitalize(name)}${capitalize(keyName)}CompositeKeyConditionInput`,\n };\n }\n indexQueryArgs = {\n [pk]: `${Object.prototype.hasOwnProperty.call(fields[pk].type, 'enum')\n ? fields[pk].type.enum // AppSync schema sets enum type as the type of the enum fields that's used as PK\n : fields[pk].type}!`,\n ...skQueryArgs,\n };\n }\n else {\n throw new Error('Error generating GraphQL Document - invalid operation name');\n }\n let graphQLOperationType;\n let graphQLSelectionSet;\n let graphQLArguments;\n const selectionSetFields = generateSelectionSet(modelIntrospection, name, selectionSet);\n // default PK args for get and list operations\n // modified below for CPK\n const getPkArgs = {\n [primaryKeyFieldName]: `${fields[primaryKeyFieldName].type}!`,\n };\n const listPkArgs = {};\n /**\n * Generate query field args for the SK if it's defined\n *\n * **1. Get queries** require each SK field to be present as a separate arg where the type is the field's GraphQL scalar type (non-nullable)\n * @example\n * ```\n * sk1: String!, sk2: Int!\n * ```\n *\n * **2. List queries**\n *\n * **a. Single field SK** -> single arg where name is the field name and the type is `Model${gqlFieldType}KeyConditionInput` (nullable)\n * Note: string-like data types e.g., AWSDateTime, AWSEmail, AWSPhone, etc. should map to String. See `skGraphQlFieldTypeMap` above\n * @example\n * ```\n * sk1: ModelStringKeyConditionInput\n * ```\n *\n * **b. Composite SK** -> single arg where the name is camelCase concatenation of all the field names that comprise the SK\n * and the type is `Model${modelName}PrimaryCompositeKeyConditionInput` (nullable)\n * @example\n * ```\n * sk1Sk2: ModelMyModelPrimaryCompositeKeyConditionInput\n * ```\n */\n const generateSkArgs = (op) => {\n if (sortKeyFieldNames.length === 0)\n return {};\n if (op === 'get') {\n return sortKeyFieldNames.reduce((acc, fieldName) => {\n const fieldType = fields[fieldName].type;\n if (op === 'get') {\n acc[fieldName] = `${fieldType}!`; // ! - SK args are non-nullable in Get queries\n }\n return acc;\n }, {});\n }\n else {\n // list SK\n if (sortKeyFieldNames.length === 1) {\n // Single SK\n const [sk] = sortKeyFieldNames;\n const type = (typeof fields[sk].type === 'string' ? fields[sk].type : 'String');\n const normalizedType = skGraphQlFieldTypeMap[type];\n return {\n [sk]: `Model${normalizedType}KeyConditionInput`,\n };\n }\n else {\n // Composite SK\n const compositeSkArgName = resolvedSkName(sortKeyFieldNames);\n return {\n [compositeSkArgName]: `Model${capitalize(name)}PrimaryCompositeKeyConditionInput`,\n };\n }\n }\n };\n if (isCustomPrimaryKey) {\n Object.assign(getPkArgs, generateSkArgs('get'));\n Object.assign(listPkArgs, {\n // PK is only included in list query field args in the generated GQL\n // when explicitly specifying PK with .identifier(['fieldName']) or @primaryKey in the schema definition\n [primaryKeyFieldName]: `${fields[primaryKeyFieldName].type}`, // PK is always a nullable arg for list (no `!` after the type)\n sortDirection: 'ModelSortDirection',\n }, generateSkArgs('list'));\n }\n switch (modelOperation) {\n case 'CREATE':\n case 'UPDATE':\n case 'DELETE':\n graphQLArguments ??\n (graphQLArguments = {\n input: `${operationPrefix.charAt(0).toLocaleUpperCase() +\n operationPrefix.slice(1)}${namePascalCase}Input!`,\n });\n graphQLOperationType ?? (graphQLOperationType = 'mutation');\n // TODO(Eslint): this this case clause correct without the break statement?\n // eslint-disable-next-line no-fallthrough\n case 'GET':\n graphQLArguments ?? (graphQLArguments = getPkArgs);\n graphQLSelectionSet ?? (graphQLSelectionSet = selectionSetFields);\n // TODO(Eslint): this this case clause correct without the break statement?\n // eslint-disable-next-line no-fallthrough\n case 'LIST':\n graphQLArguments ??\n (graphQLArguments = {\n ...listPkArgs,\n // eslint doesn't like the ts-ignore, because it thinks it's unnecessary.\n // But TS doesn't like the `filter: ...` because it think it will always be\n // overwritten. (it won't be.) so, we need to ignore the TS error and then\n // ignore the eslint error on the ts-ignore.\n // eslint-disable-next-line\n // @ts-ignore\n filter: `Model${namePascalCase}FilterInput`,\n limit: 'Int',\n nextToken: 'String',\n });\n graphQLOperationType ?? (graphQLOperationType = 'query');\n graphQLSelectionSet ??\n (graphQLSelectionSet = `items { ${selectionSetFields} } nextToken __typename`);\n // TODO(Eslint): this this case clause correct without the break statement?\n // eslint-disable-next-line no-fallthrough\n case 'INDEX_QUERY':\n graphQLArguments ??\n (graphQLArguments = {\n ...indexQueryArgs,\n filter: `Model${namePascalCase}FilterInput`,\n sortDirection: 'ModelSortDirection',\n limit: 'Int',\n nextToken: 'String',\n });\n graphQLOperationType ?? (graphQLOperationType = 'query');\n graphQLSelectionSet ??\n (graphQLSelectionSet = `items { ${selectionSetFields} } nextToken __typename`);\n // TODO(Eslint): this this case clause correct without the break statement?\n // eslint-disable-next-line no-fallthrough\n case 'ONCREATE':\n case 'ONUPDATE':\n case 'ONDELETE':\n graphQLArguments ??\n (graphQLArguments = {\n filter: `ModelSubscription${namePascalCase}FilterInput`,\n });\n graphQLOperationType ?? (graphQLOperationType = 'subscription');\n graphQLSelectionSet ?? (graphQLSelectionSet = selectionSetFields);\n break;\n case 'OBSERVEQUERY':\n default:\n throw new Error('Internal error: Attempted to generate graphql document for observeQuery. Please report this error.');\n }\n const graphQLDocument = `${graphQLOperationType}${graphQLArguments\n ? `(${Object.entries(graphQLArguments).map(([fieldName, type]) => `$${fieldName}: ${type}`)})`\n : ''} { ${graphQLFieldName}${graphQLArguments\n ? `(${Object.keys(graphQLArguments).map((fieldName) => `${fieldName}: $${fieldName}`)})`\n : ''} { ${graphQLSelectionSet} } }`;\n return graphQLDocument;\n}\nexport function buildGraphQLVariables(modelDefinition, operation, arg, modelIntrospection, indexMeta) {\n const { fields, primaryKeyInfo: { isCustomPrimaryKey, primaryKeyFieldName, sortKeyFieldNames, }, } = modelDefinition;\n const skName = sortKeyFieldNames?.length && resolvedSkName(sortKeyFieldNames);\n let variables = {};\n // TODO: process input\n switch (operation) {\n case 'CREATE':\n variables = {\n input: arg\n ? normalizeMutationInput(arg, modelDefinition, modelIntrospection)\n : {},\n };\n break;\n case 'UPDATE':\n // readonly fields are not updated\n variables = {\n input: arg\n ? Object.fromEntries(Object.entries(normalizeMutationInput(arg, modelDefinition, modelIntrospection)).filter(([fieldName]) => {\n // omit field from update input\n // if exists in fields and marked read only\n // if does not exist in fields but implicitly added to schema via ownership\n return fields[fieldName]\n ? !fields[fieldName].isReadOnly\n : !resolveOwnerFields(modelDefinition).includes(fieldName);\n }))\n : {},\n };\n break;\n case 'GET':\n case 'DELETE':\n // only identifiers are sent\n if (arg) {\n variables = isCustomPrimaryKey\n ? [primaryKeyFieldName, ...sortKeyFieldNames].reduce((acc, fieldName) => {\n acc[fieldName] = arg[fieldName];\n return acc;\n }, {})\n : { [primaryKeyFieldName]: arg[primaryKeyFieldName] };\n }\n if (operation === 'DELETE') {\n variables = { input: variables };\n }\n break;\n case 'LIST':\n if (arg?.filter) {\n variables.filter = arg.filter;\n }\n if (arg?.sortDirection) {\n variables.sortDirection = arg.sortDirection;\n }\n if (arg && arg[primaryKeyFieldName]) {\n variables[primaryKeyFieldName] = arg[primaryKeyFieldName];\n }\n if (skName && arg && arg[skName]) {\n variables[skName] = arg[skName];\n }\n if (arg?.nextToken) {\n variables.nextToken = arg.nextToken;\n }\n if (arg?.limit) {\n variables.limit = arg.limit;\n }\n break;\n case 'INDEX_QUERY': {\n const { pk, sk = [] } = indexMeta;\n const indexQuerySkName = sk?.length && resolvedSkName(sk);\n variables[pk] = arg[pk];\n if (indexQuerySkName && arg && arg[indexQuerySkName]) {\n variables[indexQuerySkName] = arg[indexQuerySkName];\n }\n if (arg?.filter) {\n variables.filter = arg.filter;\n }\n if (arg?.sortDirection) {\n variables.sortDirection = arg.sortDirection;\n }\n if (arg?.nextToken) {\n variables.nextToken = arg.nextToken;\n }\n if (arg?.limit) {\n variables.limit = arg.limit;\n }\n break;\n }\n case 'ONCREATE':\n case 'ONUPDATE':\n case 'ONDELETE':\n if (arg?.filter) {\n variables = { filter: arg.filter };\n }\n break;\n case 'OBSERVEQUERY':\n throw new Error('Internal error: Attempted to build variables for observeQuery. Please report this error.');\n default: {\n const exhaustiveCheck = operation;\n throw new Error(`Unhandled operation case: ${exhaustiveCheck}`);\n }\n }\n return variables;\n}\n/**\n * Iterates over mutation input values and resolves any model inputs to their corresponding join fields/values\n *\n * @example\n * ### Usage\n * ```ts\n * const result = normalizeMutationInput({ post: post }, model, modelDefinition);\n * ```\n * ### Result\n * ```ts\n * { postId: \"abc123\" }\n * ```\n *\n */\nexport function normalizeMutationInput(mutationInput, model, modelIntrospection) {\n const { fields } = model;\n const normalized = {};\n Object.entries(mutationInput).forEach(([inputFieldName, inputValue]) => {\n const fieldType = fields[inputFieldName]?.type;\n const relatedModelName = fieldType?.model;\n if (relatedModelName) {\n const association = fields[inputFieldName]?.association;\n const relatedModelDef = modelIntrospection.models[relatedModelName];\n const relatedModelPkInfo = relatedModelDef.primaryKeyInfo;\n if (association?.connectionType === connectionType.HAS_ONE) {\n const associationHasOne = association;\n associationHasOne.targetNames.forEach((targetName, idx) => {\n const associatedFieldName = associationHasOne.associatedWith[idx];\n normalized[targetName] = inputValue[associatedFieldName];\n });\n }\n if (association?.connectionType === connectionType.BELONGS_TO) {\n const associationBelongsTo = association;\n associationBelongsTo.targetNames.forEach((targetName, idx) => {\n if (idx === 0) {\n const associatedFieldName = relatedModelPkInfo.primaryKeyFieldName;\n normalized[targetName] = inputValue[associatedFieldName];\n }\n else {\n const associatedFieldName = relatedModelPkInfo.sortKeyFieldNames[idx - 1];\n normalized[targetName] = inputValue[associatedFieldName];\n }\n });\n }\n }\n else {\n normalized[inputFieldName] = inputValue;\n }\n });\n return normalized;\n}\n/**\n * Produces a parameter object that can contains auth mode/token overrides\n * only if present in either `options` (first) or configured on the `client`\n * as a fallback.\n *\n * @param client Configured client from `generateClient`\n * @param options Args/Options object from call site.\n * @returns\n */\nexport function authModeParams(client, getInternals, options = {}) {\n const internals = getInternals(client);\n return {\n authMode: options.authMode || internals.authMode,\n authToken: options.authToken || internals.authToken,\n };\n}\n/**\n * Retrieves custom headers from either the client or request options.\n * @param client V6Client | V6ClientSSRRequest | V6ClientSSRCookies - for extracting client headers\n * @param requestHeaders {@link CustomHeaders} - request headers\n * @returns custom headers as {@link CustomHeaders}\n */\nexport function getCustomHeaders(client, getInternals, requestHeaders) {\n let headers = getInternals(client).headers || {};\n // Individual request headers will take precedence over client headers.\n // We intentionally do *not* merge client and request headers.\n if (requestHeaders) {\n headers = requestHeaders;\n }\n return headers;\n}\n"],"names":[],"mappings":";;;;;AAAA;AAGA,MAAM,cAAc,GAAG;AACvB,IAAI,OAAO,EAAE,SAAS;AACtB,IAAI,QAAQ,EAAE,UAAU;AACxB,IAAI,UAAU,EAAE,YAAY;AAC5B,CAAC;AACD;AACA,MAAM,qBAAqB,GAAG;AAC9B,IAAI,EAAE,EAAE,IAAI;AACZ,IAAI,MAAM,EAAE,QAAQ;AACpB,IAAI,OAAO,EAAE,QAAQ;AACrB,IAAI,OAAO,EAAE,QAAQ;AACrB,IAAI,WAAW,EAAE,QAAQ;AACzB,IAAI,YAAY,EAAE,KAAK;AACvB,IAAI,QAAQ,EAAE,QAAQ;AACtB,IAAI,QAAQ,EAAE,QAAQ;AACtB,IAAI,MAAM,EAAE,QAAQ;AACpB,IAAI,YAAY,EAAE,QAAQ;AAC1B,IAAI,OAAO,EAAE,QAAQ;AACrB,IAAI,OAAO,EAAE,SAAS;AACtB,IAAI,GAAG,EAAE,KAAK;AACd,IAAI,KAAK,EAAE,OAAO;AAClB,CAAC;AACD;AACA,MAAM,cAAc,GAAG,CAAC,EAAE,KAAK;AAC/B,IAAI,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;AACzB,QAAQ,OAAO,EAAE,CAAC,CAAC,CAAC;AACpB;AACA,SAAS;AACT,QAAQ,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK;AAC7C,YA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IAAI,OAAO,OAAO;AAClB;;;;"}
1
+ {"version":3,"file":"APIClient.mjs","sources":["../../../../src/runtime/internals/APIClient.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\nimport { resolveOwnerFields, capitalize, selfAwareAsync } from '../utils';\nimport { extendCancellability } from './cancellation';\nconst connectionType = {\n HAS_ONE: 'HAS_ONE',\n HAS_MANY: 'HAS_MANY',\n BELONGS_TO: 'BELONGS_TO',\n};\n// When generating an SK's KeyConditionInput name, string-like types map to String\nconst skGraphQlFieldTypeMap = {\n ID: 'ID',\n String: 'String',\n AWSDate: 'String',\n AWSTime: 'String',\n AWSDateTime: 'String',\n AWSTimestamp: 'Int',\n AWSEmail: 'String',\n AWSPhone: 'String',\n AWSURL: 'String',\n AWSIPAddress: 'String',\n AWSJSON: 'String',\n Boolean: 'Boolean',\n Int: 'Int',\n Float: 'Float',\n};\n// move to util\nconst resolvedSkName = (sk) => {\n if (sk.length === 1) {\n return sk[0];\n }\n else {\n return sk.reduce((acc, curr, idx) => {\n if (idx === 0) {\n return curr;\n }\n else {\n return acc + capitalize(curr);\n }\n }, '');\n }\n};\n/**\n * Crawls a model tree, starting with a given **individual** model instance record, looking\n * for related hasMany children to extract from their `items` containers.\n *\n * E.g., if we have a record like this:\n *\n * ```js\n * {\n * id: 'some-id',\n * children: {\n * items: [\n * { name: 'a' }\n * { name: 'b' }\n * { name: 'c' }\n * ]\n * }\n * }\n * ```\n *\n * And if `children` refers to *an array of another model* (as opposed to a custom type),\n * the `items` will be extracted. We do this because `items` is just the mechanism for nesting\n * child records -- we don't want customers to have to dig the items out in application code.\n * Ultimately, we return this \"flattened\" structure:\n *\n * ```js\n * {\n * id: 'some-id',\n * children: [\n * { name: 'a' }\n * { name: 'b' }\n * { name: 'c' }\n * ]\n * }\n * ```\n *\n * Notably, an identical record could be the result of a nested custom type that contains an\n * `items` property. This will *not* be flattened, because in that case the `items` property is\n * actually part of the customer's schema. Similarly if a model contains an explicit `items` field.\n *\n * @param modelIntrospection Top-level model introspection schema.\n * @param modelName The name of the model. Can be `undefined`. E.g., for customOperation return types.\n * @param modelRecord The individual \"model instance record\" to normalize.\n */\nexport const flattenItems = (modelIntrospection, modelName, modelRecord) => {\n if (!modelRecord)\n return null;\n const mapped = {};\n for (const [fieldName, value] of Object.entries(modelRecord)) {\n const fieldDef = modelName\n ? modelIntrospection.models[modelName]?.fields[fieldName]\n : undefined;\n const dvPair = { fieldDef, value };\n if (isRelatedModelItemsArrayPair(dvPair)) {\n mapped[fieldName] = dvPair.value.items.map((itemValue) => flattenItems(modelIntrospection, dvPair.fieldDef.type.model, itemValue));\n }\n else if (isRelatedModelProperty(fieldDef)) {\n mapped[fieldName] = flattenItems(modelIntrospection, fieldDef.type.model, value);\n }\n else {\n mapped[fieldName] = value;\n }\n }\n return mapped;\n};\n/**\n * Determines whether the given field definition and associated result value\n * represent a related model array from a HasMany-type relationship.\n *\n * @param dv Pair of field definition and associated result value\n * @returns\n */\nfunction isRelatedModelItemsArrayPair(dv) {\n return (typeof dv.fieldDef?.type === 'object' &&\n 'model' in dv.fieldDef.type &&\n typeof dv.fieldDef.type.model === 'string' &&\n dv.fieldDef.isArray &&\n Array.isArray(dv.value?.items));\n}\n/**\n * Determines whether the given field definition represents a relationship\n * to another model.\n *\n * @param fieldDef\n * @returns\n */\nfunction isRelatedModelProperty(fieldDef) {\n return (typeof fieldDef?.type === 'object' &&\n 'model' in fieldDef.type &&\n typeof fieldDef.type.model === 'string');\n}\n// TODO: this should accept single result to support CRUD methods; create helper for array/list\nexport function initializeModel(client, modelName, result, modelIntrospection, authMode, authToken, context = false) {\n const introModel = modelIntrospection.models[modelName];\n const introModelFields = introModel.fields;\n const modelFields = Object.entries(introModelFields)\n .filter(([_, field]) => field?.type?.model !== undefined)\n .map(([fieldName]) => fieldName);\n return result.map((record) => {\n if (record === null || record === undefined) {\n return record;\n }\n const initializedRelationshipFields = {};\n for (const fieldName of modelFields) {\n const modelField = introModelFields[fieldName];\n const modelFieldType = modelField?.type;\n const relatedModelName = modelFieldType.model;\n const relatedModel = modelIntrospection.models[relatedModelName];\n const relatedModelPKFieldName = relatedModel.primaryKeyInfo.primaryKeyFieldName;\n const relatedModelSKFieldNames = relatedModel.primaryKeyInfo.sortKeyFieldNames;\n const relationType = modelField.association?.connectionType;\n let connectionFields = [];\n if (modelField.association &&\n 'associatedWith' in modelField.association) {\n connectionFields = modelField.association.associatedWith;\n }\n const targetNames = [];\n if (modelField.association && 'targetNames' in modelField.association) {\n targetNames.push(...modelField.association.targetNames);\n }\n switch (relationType) {\n case connectionType.BELONGS_TO: {\n const sortKeyValues = relatedModelSKFieldNames.reduce(\n // TODO(Eslint): is this implementation correct?\n // eslint-disable-next-line array-callback-return\n (acc, curVal) => {\n if (record[curVal]) {\n acc[curVal] = record[curVal];\n }\n return acc;\n }, {});\n // if get is disabled on the related model\n if (client.models[relatedModelName]?.get === undefined) {\n break;\n }\n if (context) {\n initializedRelationshipFields[fieldName] = (contextSpec, options) => {\n if (record[targetNames[0]]) {\n return client.models[relatedModelName].get(contextSpec, {\n [relatedModelPKFieldName]: record[targetNames[0]],\n ...sortKeyValues,\n }, {\n authMode: options?.authMode || authMode,\n authToken: options?.authToken || authToken,\n });\n }\n return { data: null };\n };\n }\n else {\n initializedRelationshipFields[fieldName] = (options) => {\n if (record[targetNames[0]]) {\n return client.models[relatedModelName].get({\n [relatedModelPKFieldName]: record[targetNames[0]],\n ...sortKeyValues,\n }, {\n authMode: options?.authMode || authMode,\n authToken: options?.authToken || authToken,\n });\n }\n return { data: null };\n };\n }\n break;\n }\n case connectionType.HAS_ONE:\n case connectionType.HAS_MANY: {\n /**\n * If the loader is a HAS_ONE, we just need to attempt to grab the first item\n * from the result.\n */\n const mapResult = relationType === connectionType.HAS_ONE\n ? (result) => {\n return {\n data: result?.data.shift() || null,\n errors: result.errors,\n extensions: result.extensions,\n };\n }\n : (result) => result;\n const parentPk = introModel.primaryKeyInfo.primaryKeyFieldName;\n const parentSK = introModel.primaryKeyInfo.sortKeyFieldNames;\n // M:N check - TODO: refactor\n const relatedModelField = relatedModel.fields[connectionFields[0]];\n const relatedModelFieldType = relatedModelField.type;\n if (relatedModelFieldType.model) {\n let relatedTargetNames = [];\n if (relatedModelField.association &&\n 'targetNames' in relatedModelField.association) {\n relatedTargetNames = relatedModelField.association?.targetNames;\n }\n const hasManyFilter = relatedTargetNames.map((field, idx) => {\n if (idx === 0) {\n return { [field]: { eq: record[parentPk] } };\n }\n return { [field]: { eq: record[parentSK[idx - 1]] } };\n });\n // if list is disabled on the related model\n if (client.models[relatedModelName]?.list === undefined) {\n break;\n }\n if (context) {\n initializedRelationshipFields[fieldName] = (contextSpec, options) => {\n if (record[parentPk]) {\n return selfAwareAsync(async (resultPromise) => {\n const basePromise = client.models[relatedModelName].list(contextSpec, {\n filter: { and: hasManyFilter },\n limit: options?.limit,\n nextToken: options?.nextToken,\n authMode: options?.authMode || authMode,\n authToken: options?.authToken || authToken,\n });\n const extendedBase = extendCancellability(basePromise, resultPromise);\n return mapResult((await extendedBase));\n });\n }\n return [];\n };\n }\n else {\n initializedRelationshipFields[fieldName] = (options) => {\n if (record[parentPk]) {\n return selfAwareAsync(async (resultPromise) => {\n const basePromise = client.models[relatedModelName].list({\n filter: { and: hasManyFilter },\n limit: options?.limit,\n nextToken: options?.nextToken,\n authMode: options?.authMode || authMode,\n authToken: options?.authToken || authToken,\n });\n const extendedBase = extendCancellability(basePromise, resultPromise);\n return mapResult((await extendedBase));\n });\n }\n return [];\n };\n }\n break;\n }\n const hasManyFilter = connectionFields.map((field, idx) => {\n if (idx === 0) {\n return { [field]: { eq: record[parentPk] } };\n }\n return { [field]: { eq: record[parentSK[idx - 1]] } };\n });\n // if list is disabled on the related model\n if (client.models[relatedModelName]?.list === undefined) {\n break;\n }\n if (context) {\n initializedRelationshipFields[fieldName] = (contextSpec, options) => {\n if (record[parentPk]) {\n return selfAwareAsync(async (resultPromise) => {\n const basePromise = client.models[relatedModelName].list(contextSpec, {\n filter: { and: hasManyFilter },\n limit: options?.limit,\n nextToken: options?.nextToken,\n authMode: options?.authMode || authMode,\n authToken: options?.authToken || authToken,\n });\n const extendedBase = extendCancellability(basePromise, resultPromise);\n return mapResult((await extendedBase));\n });\n }\n return [];\n };\n }\n else {\n initializedRelationshipFields[fieldName] = (options) => {\n if (record[parentPk]) {\n return selfAwareAsync(async (resultPromise) => {\n const basePromise = client.models[relatedModelName].list({\n filter: { and: hasManyFilter },\n limit: options?.limit,\n nextToken: options?.nextToken,\n authMode: options?.authMode || authMode,\n authToken: options?.authToken || authToken,\n });\n const extendedBase = extendCancellability(basePromise, resultPromise);\n return mapResult((await extendedBase));\n });\n }\n return [];\n };\n }\n break;\n }\n default:\n break;\n }\n }\n return { ...record, ...initializedRelationshipFields };\n });\n}\nexport const graphQLOperationsInfo = {\n CREATE: { operationPrefix: 'create', usePlural: false },\n GET: { operationPrefix: 'get', usePlural: false },\n UPDATE: { operationPrefix: 'update', usePlural: false },\n DELETE: { operationPrefix: 'delete', usePlural: false },\n LIST: { operationPrefix: 'list', usePlural: true },\n INDEX_QUERY: { operationPrefix: '', usePlural: false },\n ONCREATE: { operationPrefix: 'onCreate', usePlural: false },\n ONUPDATE: { operationPrefix: 'onUpdate', usePlural: false },\n ONDELETE: { operationPrefix: 'onDelete', usePlural: false },\n OBSERVEQUERY: { operationPrefix: 'observeQuery', usePlural: false },\n};\nconst SELECTION_SET_WILDCARD = '*';\nexport const getDefaultSelectionSetForNonModelWithIR = (nonModelDefinition, modelIntrospection) => {\n const { fields } = nonModelDefinition;\n const mappedFields = Object.values(fields)\n .map(({ type, name }) => {\n if (typeof type.enum === 'string') {\n return [name, FIELD_IR];\n }\n if (typeof type.nonModel === 'string') {\n return [\n name,\n getDefaultSelectionSetForNonModelWithIR(modelIntrospection.nonModels[type.nonModel], modelIntrospection),\n ];\n }\n if (typeof type === 'string') {\n return [name, FIELD_IR];\n }\n return undefined;\n })\n .filter((pair) => pair !== undefined);\n return Object.fromEntries(mappedFields);\n};\nconst getDefaultSelectionSetForModelWithIR = (modelDefinition, modelIntrospection) => {\n const { fields } = modelDefinition;\n const mappedFields = Object.values(fields)\n .map(({ type, name }) => {\n if (typeof type.enum === 'string' ||\n typeof type === 'string') {\n return [name, FIELD_IR];\n }\n if (typeof type.nonModel === 'string') {\n return [\n name,\n getDefaultSelectionSetForNonModelWithIR(modelIntrospection.nonModels[type.nonModel], modelIntrospection),\n ];\n }\n return undefined;\n })\n .filter((pair) => pair !== undefined);\n const ownerFields = resolveOwnerFields(modelDefinition).map((field) => [\n field,\n FIELD_IR,\n ]);\n return Object.fromEntries(mappedFields.concat(ownerFields));\n};\nfunction defaultSelectionSetForModel(modelDefinition) {\n // fields that are explicitly part of the graphql schema; not\n // inferred from owner auth rules.\n const { fields } = modelDefinition;\n const explicitFields = Object.values(fields)\n // Default selection set omits model fields\n .map(({ type, name }) => {\n if (typeof type === 'string')\n return name;\n if (typeof type === 'object') {\n if (typeof type?.enum === 'string') {\n return name;\n }\n else if (typeof type?.nonModel === 'string') {\n return `${name}.${SELECTION_SET_WILDCARD}`;\n }\n }\n return undefined;\n })\n .filter(Boolean);\n // fields used for owner auth rules that may or may not also\n // be explicit on the model.\n const ownerFields = resolveOwnerFields(modelDefinition);\n return Array.from(new Set(explicitFields.concat(ownerFields)));\n}\nconst FIELD_IR = '';\n/**\n * Generates nested Custom Selection Set IR from path\n *\n * @param modelDefinitions\n * @param modelName\n * @param selectionSet - array of object paths\n * @example\n * ### Given\n * `selectionSet = ['id', 'comments.post.id']`\n * ### Returns\n * ```ts\n * {\n * id: '',\n * comments: {\n * items: { post: { id: '' } }\n * }\n * }\n * ```\n */\nexport function customSelectionSetToIR(modelIntrospection, modelName, selectionSet) {\n const dotNotationToObject = (path, modelOrNonModelName) => {\n const [fieldName, ...rest] = path.split('.');\n const nested = rest[0];\n const modelOrNonModelDefinition = modelIntrospection.models[modelOrNonModelName] ??\n modelIntrospection.nonModels[modelOrNonModelName];\n const modelOrNonModelFields = modelOrNonModelDefinition?.fields;\n const relatedModel = modelOrNonModelFields?.[fieldName]?.type?.model;\n const relatedModelDefinition = modelIntrospection.models[relatedModel];\n const relatedNonModel = modelOrNonModelFields?.[fieldName]?.type?.nonModel;\n const relatedNonModelDefinition = modelIntrospection.nonModels[relatedNonModel];\n const isModelOrNonModelOrFieldType = relatedModelDefinition\n ? 'model'\n : relatedNonModelDefinition\n ? 'nonModel'\n : 'field';\n if (isModelOrNonModelOrFieldType === 'nonModel') {\n let result = {};\n if (!nested) {\n throw Error(`${fieldName} must declare a wildcard (*) or a field of custom type ${relatedNonModel}`);\n }\n if (nested === SELECTION_SET_WILDCARD) {\n result = {\n [fieldName]: getDefaultSelectionSetForNonModelWithIR(relatedNonModelDefinition, modelIntrospection),\n };\n }\n else {\n result = {\n [fieldName]: dotNotationToObject(rest.join('.'), relatedNonModel),\n };\n }\n return result;\n }\n else if (isModelOrNonModelOrFieldType === 'model') {\n let result = {};\n if (!nested) {\n throw Error(`${fieldName} must declare a wildcard (*) or a field of model ${relatedModel}`);\n }\n if (nested === SELECTION_SET_WILDCARD) {\n const nestedRelatedModelDefinition = modelIntrospection.models[relatedModel];\n result = {\n [fieldName]: getDefaultSelectionSetForModelWithIR(nestedRelatedModelDefinition, modelIntrospection),\n };\n }\n else {\n result = {\n [fieldName]: dotNotationToObject(rest.join('.'), relatedModel),\n };\n }\n if (modelOrNonModelFields[fieldName]?.isArray) {\n result = {\n [fieldName]: {\n items: result[fieldName],\n },\n };\n }\n return result;\n }\n else {\n const modelField = modelOrNonModelFields?.[fieldName];\n const nonModelDefinition = modelIntrospection.nonModels[modelOrNonModelName];\n const nonModelField = nonModelDefinition?.fields?.[fieldName];\n if (!nonModelDefinition) {\n const isOwnerField = resolveOwnerFields(modelOrNonModelDefinition).includes(fieldName);\n if (!modelField && !isOwnerField) {\n throw Error(`${fieldName} is not a field of model ${modelOrNonModelName}`);\n }\n }\n else {\n if (!nonModelField) {\n throw Error(`${fieldName} is not a field of custom type ${modelOrNonModelName}`);\n }\n }\n return { [fieldName]: FIELD_IR };\n }\n };\n return selectionSet.reduce((resultObj, path) => deepMergeSelectionSetObjects(dotNotationToObject(path, modelName), resultObj), {});\n}\n/**\n * Stringifies selection set IR\n * * @example\n * ### Given\n * ```ts\n * {\n * id: '',\n * comments: {\n * items: { post: { id: '' } }\n * }\n * }\n * ```\n * ### Returns\n * `'id comments { items { post { id } } }'`\n */\nexport function selectionSetIRToString(obj) {\n const res = [];\n Object.entries(obj).forEach(([fieldName, value]) => {\n if (value === FIELD_IR) {\n res.push(fieldName);\n }\n else if (typeof value === 'object' && value !== null) {\n if (value?.items) {\n res.push(fieldName, '{', 'items', '{', selectionSetIRToString(value.items), '}', '}');\n }\n else {\n res.push(fieldName, '{', selectionSetIRToString(value), '}');\n }\n }\n });\n return res.join(' ');\n}\n/**\n * Recursively merges selection set objects from `source` onto `target`.\n *\n * `target` will be updated. `source` will be left alone.\n *\n * @param source The object to merge into target.\n * @param target The object to be mutated.\n */\nfunction deepMergeSelectionSetObjects(source, target) {\n const isObject = (obj) => obj && typeof obj === 'object';\n for (const key in source) {\n // This verification avoids 'Prototype Pollution' issue\n if (!Object.prototype.hasOwnProperty.call(source, key))\n continue;\n if (Object.prototype.hasOwnProperty.call(target, key) &&\n isObject(target[key])) {\n deepMergeSelectionSetObjects(source[key], target[key]);\n }\n else {\n target[key] = source[key];\n }\n }\n return target;\n}\nexport function generateSelectionSet(modelIntrospection, modelName, selectionSet) {\n const modelDefinition = modelIntrospection.models[modelName];\n const selSetIr = customSelectionSetToIR(modelIntrospection, modelName, selectionSet ?? defaultSelectionSetForModel(modelDefinition));\n const selSetString = selectionSetIRToString(selSetIr);\n return selSetString;\n}\nexport function generateGraphQLDocument(modelIntrospection, modelDefinition, modelOperation, listArgs, indexMeta) {\n const { name, pluralName, fields, primaryKeyInfo: { isCustomPrimaryKey, primaryKeyFieldName, sortKeyFieldNames, }, attributes, } = modelDefinition;\n // Use pascal case of the model name to generate the operations and the arguments.\n // This is required to be in sync with the resources generated by the GraphQL transformers.\n const namePascalCase = name.charAt(0).toUpperCase() + name.slice(1);\n const pluralNamePascalCase = pluralName.charAt(0).toUpperCase() + pluralName.slice(1);\n const { operationPrefix, usePlural } = graphQLOperationsInfo[modelOperation];\n const { selectionSet } = listArgs || {};\n let graphQLFieldName;\n let indexQueryArgs;\n if (operationPrefix) {\n graphQLFieldName = `${operationPrefix}${usePlural ? pluralNamePascalCase : namePascalCase}`;\n }\n else if (indexMeta) {\n const { queryField, pk, sk = [] } = indexMeta;\n graphQLFieldName = queryField;\n /**\n * **a. Single field SK** -> single arg where name is the field name and the type is `Model${gqlFieldType}KeyConditionInput` (nullable)\n * Note: string-like data types e.g., AWSDateTime, AWSEmail, AWSPhone, etc. should map to String. See `skGraphQlFieldTypeMap` above\n * @example\n * ```\n * sk1: ModelStringKeyConditionInput\n * ```\n *\n * **b. Composite SK** -> single arg where the name is camelCase concatenation of all the field names that comprise the SK\n * and the type is `Model${modelName}${keyAttributeName}CompositeKeyConditionInput` (nullable)\n * @example\n * ```\n * sk1Sk2: ModelMyModelMyModelByPkAndSk1AndSk2CompositeKeyConditionInput\n */\n let skQueryArgs = {};\n if (sk.length === 1) {\n const [skField] = sk;\n const type = (typeof fields[skField].type === 'string'\n ? fields[skField].type\n : 'String');\n const normalizedType = skGraphQlFieldTypeMap[type];\n skQueryArgs = {\n [skField]: `Model${normalizedType}KeyConditionInput`,\n };\n }\n else if (sk.length > 1) {\n const compositeSkArgName = resolvedSkName(sk);\n const keyName = attributes?.find((attr) => attr?.properties?.queryField === queryField)?.properties?.name;\n skQueryArgs = {\n [compositeSkArgName]: `Model${capitalize(name)}${capitalize(keyName)}CompositeKeyConditionInput`,\n };\n }\n indexQueryArgs = {\n [pk]: `${Object.prototype.hasOwnProperty.call(fields[pk].type, 'enum')\n ? fields[pk].type.enum // AppSync schema sets enum type as the type of the enum fields that's used as PK\n : fields[pk].type}!`,\n ...skQueryArgs,\n };\n }\n else {\n throw new Error('Error generating GraphQL Document - invalid operation name');\n }\n let graphQLOperationType;\n let graphQLSelectionSet;\n let graphQLArguments;\n const selectionSetFields = generateSelectionSet(modelIntrospection, name, selectionSet);\n // default PK args for get and list operations\n // modified below for CPK\n const getPkArgs = {\n [primaryKeyFieldName]: `${fields[primaryKeyFieldName].type}!`,\n };\n const listPkArgs = {};\n /**\n * Generate query field args for the SK if it's defined\n *\n * **1. Get queries** require each SK field to be present as a separate arg where the type is the field's GraphQL scalar type (non-nullable)\n * @example\n * ```\n * sk1: String!, sk2: Int!\n * ```\n *\n * **2. List queries**\n *\n * **a. Single field SK** -> single arg where name is the field name and the type is `Model${gqlFieldType}KeyConditionInput` (nullable)\n * Note: string-like data types e.g., AWSDateTime, AWSEmail, AWSPhone, etc. should map to String. See `skGraphQlFieldTypeMap` above\n * @example\n * ```\n * sk1: ModelStringKeyConditionInput\n * ```\n *\n * **b. Composite SK** -> single arg where the name is camelCase concatenation of all the field names that comprise the SK\n * and the type is `Model${modelName}PrimaryCompositeKeyConditionInput` (nullable)\n * @example\n * ```\n * sk1Sk2: ModelMyModelPrimaryCompositeKeyConditionInput\n * ```\n */\n const generateSkArgs = (op) => {\n if (sortKeyFieldNames.length === 0)\n return {};\n if (op === 'get') {\n return sortKeyFieldNames.reduce((acc, fieldName) => {\n const fieldType = fields[fieldName].type;\n if (op === 'get') {\n acc[fieldName] = `${fieldType}!`; // ! - SK args are non-nullable in Get queries\n }\n return acc;\n }, {});\n }\n else {\n // list SK\n if (sortKeyFieldNames.length === 1) {\n // Single SK\n const [sk] = sortKeyFieldNames;\n const type = (typeof fields[sk].type === 'string' ? fields[sk].type : 'String');\n const normalizedType = skGraphQlFieldTypeMap[type];\n return {\n [sk]: `Model${normalizedType}KeyConditionInput`,\n };\n }\n else {\n // Composite SK\n const compositeSkArgName = resolvedSkName(sortKeyFieldNames);\n return {\n [compositeSkArgName]: `Model${capitalize(name)}PrimaryCompositeKeyConditionInput`,\n };\n }\n }\n };\n if (isCustomPrimaryKey) {\n Object.assign(getPkArgs, generateSkArgs('get'));\n Object.assign(listPkArgs, {\n // PK is only included in list query field args in the generated GQL\n // when explicitly specifying PK with .identifier(['fieldName']) or @primaryKey in the schema definition\n [primaryKeyFieldName]: `${fields[primaryKeyFieldName].type}`, // PK is always a nullable arg for list (no `!` after the type)\n sortDirection: 'ModelSortDirection',\n }, generateSkArgs('list'));\n }\n switch (modelOperation) {\n case 'CREATE':\n case 'UPDATE':\n case 'DELETE':\n graphQLArguments ??\n (graphQLArguments = {\n input: `${operationPrefix.charAt(0).toLocaleUpperCase() +\n operationPrefix.slice(1)}${namePascalCase}Input!`,\n });\n graphQLOperationType ?? (graphQLOperationType = 'mutation');\n // TODO(Eslint): this this case clause correct without the break statement?\n // eslint-disable-next-line no-fallthrough\n case 'GET':\n graphQLArguments ?? (graphQLArguments = getPkArgs);\n graphQLSelectionSet ?? (graphQLSelectionSet = selectionSetFields);\n // TODO(Eslint): this this case clause correct without the break statement?\n // eslint-disable-next-line no-fallthrough\n case 'LIST':\n graphQLArguments ??\n (graphQLArguments = {\n ...listPkArgs,\n // eslint doesn't like the ts-ignore, because it thinks it's unnecessary.\n // But TS doesn't like the `filter: ...` because it think it will always be\n // overwritten. (it won't be.) so, we need to ignore the TS error and then\n // ignore the eslint error on the ts-ignore.\n // eslint-disable-next-line\n // @ts-ignore\n filter: `Model${namePascalCase}FilterInput`,\n limit: 'Int',\n nextToken: 'String',\n });\n graphQLOperationType ?? (graphQLOperationType = 'query');\n graphQLSelectionSet ??\n (graphQLSelectionSet = `items { ${selectionSetFields} } nextToken __typename`);\n // TODO(Eslint): this this case clause correct without the break statement?\n // eslint-disable-next-line no-fallthrough\n case 'INDEX_QUERY':\n graphQLArguments ??\n (graphQLArguments = {\n ...indexQueryArgs,\n filter: `Model${namePascalCase}FilterInput`,\n sortDirection: 'ModelSortDirection',\n limit: 'Int',\n nextToken: 'String',\n });\n graphQLOperationType ?? (graphQLOperationType = 'query');\n graphQLSelectionSet ??\n (graphQLSelectionSet = `items { ${selectionSetFields} } nextToken __typename`);\n // TODO(Eslint): this this case clause correct without the break statement?\n // eslint-disable-next-line no-fallthrough\n case 'ONCREATE':\n case 'ONUPDATE':\n case 'ONDELETE':\n graphQLArguments ??\n (graphQLArguments = {\n filter: `ModelSubscription${namePascalCase}FilterInput`,\n });\n graphQLOperationType ?? (graphQLOperationType = 'subscription');\n graphQLSelectionSet ?? (graphQLSelectionSet = selectionSetFields);\n break;\n case 'OBSERVEQUERY':\n default:\n throw new Error('Internal error: Attempted to generate graphql document for observeQuery. Please report this error.');\n }\n const graphQLDocument = `${graphQLOperationType}${graphQLArguments\n ? `(${Object.entries(graphQLArguments).map(([fieldName, type]) => `$${fieldName}: ${type}`)})`\n : ''} { ${graphQLFieldName}${graphQLArguments\n ? `(${Object.keys(graphQLArguments).map((fieldName) => `${fieldName}: $${fieldName}`)})`\n : ''} { ${graphQLSelectionSet} } }`;\n return graphQLDocument;\n}\nexport function buildGraphQLVariables(modelDefinition, operation, arg, modelIntrospection, indexMeta) {\n const { fields, primaryKeyInfo: { isCustomPrimaryKey, primaryKeyFieldName, sortKeyFieldNames, }, } = modelDefinition;\n const skName = sortKeyFieldNames?.length && resolvedSkName(sortKeyFieldNames);\n let variables = {};\n // TODO: process input\n switch (operation) {\n case 'CREATE':\n variables = {\n input: arg\n ? normalizeMutationInput(arg, modelDefinition, modelIntrospection)\n : {},\n };\n break;\n case 'UPDATE':\n // readonly fields are not updated\n variables = {\n input: arg\n ? Object.fromEntries(Object.entries(normalizeMutationInput(arg, modelDefinition, modelIntrospection)).filter(([fieldName]) => {\n // omit field from update input\n // if exists in fields and marked read only\n // if does not exist in fields but implicitly added to schema via ownership\n return fields[fieldName]\n ? !fields[fieldName].isReadOnly\n : !resolveOwnerFields(modelDefinition).includes(fieldName);\n }))\n : {},\n };\n break;\n case 'GET':\n case 'DELETE':\n // only identifiers are sent\n if (arg) {\n variables = isCustomPrimaryKey\n ? [primaryKeyFieldName, ...sortKeyFieldNames].reduce((acc, fieldName) => {\n acc[fieldName] = arg[fieldName];\n return acc;\n }, {})\n : { [primaryKeyFieldName]: arg[primaryKeyFieldName] };\n }\n if (operation === 'DELETE') {\n variables = { input: variables };\n }\n break;\n case 'LIST':\n if (arg?.filter) {\n variables.filter = arg.filter;\n }\n if (arg?.sortDirection) {\n variables.sortDirection = arg.sortDirection;\n }\n if (arg && arg[primaryKeyFieldName]) {\n variables[primaryKeyFieldName] = arg[primaryKeyFieldName];\n }\n if (skName && arg && arg[skName]) {\n variables[skName] = arg[skName];\n }\n if (arg?.nextToken) {\n variables.nextToken = arg.nextToken;\n }\n if (arg?.limit) {\n variables.limit = arg.limit;\n }\n break;\n case 'INDEX_QUERY': {\n const { pk, sk = [] } = indexMeta;\n const indexQuerySkName = sk?.length && resolvedSkName(sk);\n variables[pk] = arg[pk];\n if (indexQuerySkName && arg && arg[indexQuerySkName]) {\n variables[indexQuerySkName] = arg[indexQuerySkName];\n }\n if (arg?.filter) {\n variables.filter = arg.filter;\n }\n if (arg?.sortDirection) {\n variables.sortDirection = arg.sortDirection;\n }\n if (arg?.nextToken) {\n variables.nextToken = arg.nextToken;\n }\n if (arg?.limit) {\n variables.limit = arg.limit;\n }\n break;\n }\n case 'ONCREATE':\n case 'ONUPDATE':\n case 'ONDELETE':\n if (arg?.filter) {\n variables = { filter: arg.filter };\n }\n break;\n case 'OBSERVEQUERY':\n throw new Error('Internal error: Attempted to build variables for observeQuery. Please report this error.');\n default: {\n const exhaustiveCheck = operation;\n throw new Error(`Unhandled operation case: ${exhaustiveCheck}`);\n }\n }\n return variables;\n}\n/**\n * Iterates over mutation input values and resolves any model inputs to their corresponding join fields/values\n *\n * @example\n * ### Usage\n * ```ts\n * const result = normalizeMutationInput({ post: post }, model, modelDefinition);\n * ```\n * ### Result\n * ```ts\n * { postId: \"abc123\" }\n * ```\n *\n */\nexport function normalizeMutationInput(mutationInput, model, modelIntrospection) {\n const { fields } = model;\n const normalized = {};\n Object.entries(mutationInput).forEach(([inputFieldName, inputValue]) => {\n const fieldType = fields[inputFieldName]?.type;\n const relatedModelName = fieldType?.model;\n if (relatedModelName) {\n const association = fields[inputFieldName]?.association;\n const relatedModelDef = modelIntrospection.models[relatedModelName];\n const relatedModelPkInfo = relatedModelDef.primaryKeyInfo;\n if (association?.connectionType === connectionType.HAS_ONE) {\n const associationHasOne = association;\n associationHasOne.targetNames.forEach((targetName, idx) => {\n const associatedFieldName = associationHasOne.associatedWith[idx];\n normalized[targetName] = inputValue[associatedFieldName];\n });\n }\n if (association?.connectionType === connectionType.BELONGS_TO) {\n const associationBelongsTo = association;\n associationBelongsTo.targetNames.forEach((targetName, idx) => {\n if (idx === 0) {\n const associatedFieldName = relatedModelPkInfo.primaryKeyFieldName;\n normalized[targetName] = inputValue[associatedFieldName];\n }\n else {\n const associatedFieldName = relatedModelPkInfo.sortKeyFieldNames[idx - 1];\n normalized[targetName] = inputValue[associatedFieldName];\n }\n });\n }\n }\n else {\n normalized[inputFieldName] = inputValue;\n }\n });\n return normalized;\n}\n/**\n * Produces a parameter object that can contains auth mode/token overrides\n * only if present in either `options` (first) or configured on the `client`\n * as a fallback.\n *\n * @param client Configured client from `generateClient`\n * @param options Args/Options object from call site.\n * @returns\n */\nexport function authModeParams(client, getInternals, options = {}) {\n const internals = getInternals(client);\n return {\n authMode: options.authMode || internals.authMode,\n authToken: options.authToken || internals.authToken,\n };\n}\n/**\n * Retrieves custom headers from either the client or request options.\n * @param client V6Client | V6ClientSSRRequest | V6ClientSSRCookies - for extracting client headers\n * @param requestHeaders {@link CustomHeaders} - request headers\n * @returns custom headers as {@link CustomHeaders}\n */\nexport function getCustomHeaders(client, getInternals, requestHeaders) {\n let headers = getInternals(client).headers || {};\n // Individual request headers will take precedence over client headers.\n // We intentionally do *not* merge client and request headers.\n if (requestHeaders) {\n headers = requestHeaders;\n }\n return headers;\n}\n"],"names":[],"mappings":";;;;;AAAA;AAGA,MAAM,cAAc,GAAG;AACvB,IAAI,OAAO,E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M,EAAE,YAAY,EAAE,OAAO,GAAG,EAAE,EAAE;AACnE,IAAI,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,CAAC;AAC1C,IAAI,OAAO;AACX,QAAQ,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,SAAS,CAAC,QAAQ;AACxD,QAAQ,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,SAAS,CAAC,SAAS;AAC3D,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE;AACvE,IAAI,IAAI,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,OAAO,IAAI,EAAE;AACpD;AACA;AACA,IAAI,IAAI,cAAc,EAAE;AACxB,QAAQ,OAAO,GAAG,cAAc;AAChC,IAAI;AACJ,IAAI,OAAO,OAAO;AAClB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"conversationMessageDeserializers.mjs","sources":["../../../../../src/runtime/internals/ai/conversationMessageDeserializers.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { fromBase64 } from '@smithy/util-base64';\nexport const deserializeContent = (content) => content.map((block) => {\n if (block.image) {\n return deserializeImageBlock(block);\n }\n if (block.document) {\n return deserializeDocumentBlock(block);\n }\n if (block.toolUse) {\n return deserializeToolUseBlock(block);\n }\n if (block.toolResult) {\n return deserializeToolResultBlock(block);\n }\n return removeNullsFromBlock(block);\n});\nconst deserializeImageBlock = ({ image }) => ({\n image: {\n ...image,\n source: {\n ...image.source,\n bytes: fromBase64(image.source.bytes),\n },\n },\n});\nconst deserializeDocumentBlock = ({ document }) => ({\n document: {\n ...document,\n source: {\n ...document.source,\n bytes: fromBase64(document.source.bytes),\n },\n },\n});\nconst deserializeJsonBlock = ({ json }) => ({\n json: JSON.parse(json),\n});\nconst deserializeToolUseBlock = ({ toolUse }) => ({\n toolUse: {\n ...toolUse,\n input: JSON.parse(toolUse.input),\n },\n});\nconst deserializeToolResultBlock = ({ toolResult, }) => ({\n toolResult: {\n toolUseId: toolResult.toolUseId,\n content: toolResult.content.map((toolResultBlock) => {\n if (toolResultBlock.image) {\n return deserializeImageBlock(toolResultBlock);\n }\n if (toolResultBlock.json) {\n return deserializeJsonBlock(toolResultBlock);\n }\n return removeNullsFromBlock(toolResultBlock);\n }),\n },\n});\nconst removeNullsFromBlock = (block) => Object.fromEntries(Object.entries(block).filter(([_, v]) => v !== null));\n"],"names":[],"mappings":";;AAAA;AACA;AAEY,MAAC,kBAAkB,GAAG,CAAC,OAAO,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK;AACtE,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE;AACrB,QAAQ,OAAO,qBAAqB,CAAC,KAAK,CAAC;AAC3C;AACA,IAAI,IAAI,KAAK,CAAC,QAAQ,EAAE;AACxB,QAAQ,OAAO,wBAAwB,CAAC,KAAK,CAAC;AAC9C;AACA,IAAI,IAAI,KAAK,CAAC,OAAO,EAAE;AACvB,QAAQ,OAAO,uBAAuB,CAAC,KAAK,CAAC;AAC7C;AACA,IAAI,IAAI,KAAK,CAAC,UAAU,EAAE;AAC1B,QAAQ,OAAO,0BAA0B,CAAC,KAAK,CAAC;AAChD;AACA,IAAI,OAAO,oBAAoB,CAAC,KAAK,CAAC;AACtC,CAAC;AACD,MAAM,qBAAqB,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM;AAC9C,IAAI,KAAK,EAAE;AACX,QAAQ,GAAG,KAAK;AAChB,QAAQ,MAAM,EAAE;AAChB,YAAY,GAAG,KAAK,CAAC,MAAM;AAC3B,YAAY,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;AACjD,SAAS;AACT,KAAK;AACL,CAAC,CAAC;AACF,MAAM,wBAAwB,GAAG,CAAC,EAAE,QAAQ,EAAE,MAAM;AACpD,IAAI,QAA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;;"}
1
+ {"version":3,"file":"conversationMessageDeserializers.mjs","sources":["../../../../../src/runtime/internals/ai/conversationMessageDeserializers.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { fromBase64 } from '@smithy/util-base64';\nexport const deserializeContent = (content) => content.map((block) => {\n if (block.image) {\n return deserializeImageBlock(block);\n }\n if (block.document) {\n return deserializeDocumentBlock(block);\n }\n if (block.toolUse) {\n return deserializeToolUseBlock(block);\n }\n if (block.toolResult) {\n return deserializeToolResultBlock(block);\n }\n return removeNullsFromBlock(block);\n});\nconst deserializeImageBlock = ({ image }) => ({\n image: {\n ...image,\n source: {\n ...image.source,\n bytes: fromBase64(image.source.bytes),\n },\n },\n});\nconst deserializeDocumentBlock = ({ document }) => ({\n document: {\n ...document,\n source: {\n ...document.source,\n bytes: fromBase64(document.source.bytes),\n },\n },\n});\nconst deserializeJsonBlock = ({ json }) => ({\n json: JSON.parse(json),\n});\nconst deserializeToolUseBlock = ({ toolUse }) => ({\n toolUse: {\n ...toolUse,\n input: JSON.parse(toolUse.input),\n },\n});\nconst deserializeToolResultBlock = ({ toolResult, }) => ({\n toolResult: {\n toolUseId: toolResult.toolUseId,\n content: toolResult.content.map((toolResultBlock) => {\n if (toolResultBlock.image) {\n return deserializeImageBlock(toolResultBlock);\n }\n if (toolResultBlock.json) {\n return deserializeJsonBlock(toolResultBlock);\n }\n return removeNullsFromBlock(toolResultBlock);\n }),\n },\n});\nconst removeNullsFromBlock = (block) => Object.fromEntries(Object.entries(block).filter(([_, v]) => v !== null));\n"],"names":[],"mappings":";;AAAA;AACA;AAEY,MAAC,kBAAkB,GAAG,CAAC,OAAO,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK;AACtE,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE;AACrB,QAAQ,OAAO,qBAAqB,CAAC,KAAK,CAAC;AAC3C,IAAI;AACJ,IAAI,IAAI,KA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