Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-amplify/data-schema

Package Overview
Dependencies
Maintainers
10
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-amplify/data-schema - npm Package Compare versions

Comparing version 0.12.9 to 0.12.10

3

lib-esm/src/CustomOperation.d.ts

@@ -6,4 +6,5 @@ import { SetTypeSubArg, Brand } from '@aws-amplify/data-schema-types';

import { EnumType, EnumTypeParamShape } from './EnumType';
import { CustomType } from './CustomType';
type CustomArguments = Record<string, ModelField<any, any> | EnumType<EnumTypeParamShape>>;
type CustomReturnType = RefType<any>;
type CustomReturnType = RefType<any> | CustomType<any>;
type CustomFunctionRefType = string;

@@ -10,0 +11,0 @@ type InternalCustomArguments = Record<string, InternalField>;

@@ -10,6 +10,6 @@ import { Brand } from '@aws-amplify/data-schema-types';

export type CustomTypeAllowedModifiers = 'authorization' | 'array' | 'required';
type ModelFields = Record<string, ModelField<ModelFieldTypeParamOuter, CustomTypeAllowedModifiers, any>>;
type CustomTypeFields = Record<string, ModelField<ModelFieldTypeParamOuter, CustomTypeAllowedModifiers, any>>;
type InternalModelFields = Record<string, InternalField>;
type CustomTypeData = {
fields: ModelFields;
fields: CustomTypeFields;
type: 'customType';

@@ -21,3 +21,3 @@ };

export type CustomTypeParamShape = {
fields: ModelFields;
fields: CustomTypeFields;
};

@@ -32,5 +32,5 @@ export type CustomType<T extends CustomTypeParamShape> = Brand<T, 'customType'>;

};
export declare function customType<T extends ModelFields>(fields: T): CustomType<{
export declare function customType<T extends CustomTypeFields>(fields: T): CustomType<{
fields: T;
}>;
export {};

@@ -115,13 +115,26 @@ "use strict";

const { arguments: fieldArgs, returnType, authorization, functionRef, } = typeDef.data;
let callSignature = typeName;
const implicitModels = [];
const { authString } = calculateAuth(authorization);
const resolvedArg = refFieldToGql(returnType.data);
let sig = typeName;
let implicitModels = [];
let returnTypeName;
if (isRefField(returnType)) {
returnTypeName = refFieldToGql(returnType.data);
}
else if (isCustomType(returnType)) {
returnTypeName = `${capitalize(typeName)}ReturnType`;
implicitModels.push([returnTypeName, returnType]);
}
else if (isScalarField(returnType)) {
returnTypeName = scalarFieldToGql(returnType.data);
}
else {
throw new Error(`Unrecognized return type on ${typeName}`);
}
if (Object.keys(fieldArgs).length > 0) {
const { gqlFields, models } = processFields(fieldArgs, {});
sig += `(${gqlFields.join(', ')})`;
implicitModels = models;
callSignature += `(${gqlFields.join(', ')})`;
implicitModels.push(...models);
}
const fnString = functionRef ? `@function(name: "${functionRef}") ` : '';
const gqlField = `${sig}: ${resolvedArg} ${fnString}${authString}`;
const gqlField = `${callSignature}: ${returnTypeName} ${fnString}${authString}`;
return { gqlField, models: implicitModels };

@@ -128,0 +141,0 @@ }

{
"name": "@aws-amplify/data-schema",
"version": "0.12.9",
"version": "0.12.10",
"license": "Apache-2.0",

@@ -5,0 +5,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc