New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@aws-amplify/codegen-ui

Package Overview
Dependencies
Maintainers
8
Versions
645
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-amplify/codegen-ui - npm Package Compare versions

Comparing version 1.2.1-q1-release-87d4a4b.0 to 1.2.1-q1-release-8b9a05d.0

dist/lib/utils/component-mapping-utils.d.ts

1

dist/index.d.ts

@@ -16,1 +16,2 @@ export * from './lib/template-renderer';

export * from './lib/errors';
export * from './lib/utils';

@@ -43,2 +43,3 @@ "use strict";

__exportStar(require("./lib/errors"), exports);
__exportStar(require("./lib/utils"), exports);
//# sourceMappingURL=index.js.map

9

dist/lib/renderer-helper.d.ts

@@ -1,2 +0,2 @@

import { BoundStudioComponentProperty, CollectionStudioComponentProperty, ConcatenatedStudioComponentProperty, ConditionalStudioComponentProperty, FixedStudioComponentProperty, FormStudioComponentProperty, StudioComponent, StudioComponentAuthProperty, StudioComponentChild, StudioComponentDataPropertyBinding, StudioComponentEventPropertyBinding, StudioComponentSimplePropertyBinding, StudioComponentStoragePropertyBinding, StudioComponentPropertyBinding } from './types';
import { StudioComponent, StudioComponentAuthProperty, StudioComponentChild, StudioComponentDataPropertyBinding, StudioComponentEventPropertyBinding, StudioComponentSimplePropertyBinding, StudioComponentStoragePropertyBinding, StudioComponentPropertyBinding, StudioComponentProperty } from './types';
export declare const StudioRendererConstants: {

@@ -6,6 +6,5 @@ unknownName: string;

export declare function isStudioComponentWithBinding(component: StudioComponent | StudioComponentChild): component is StudioComponent;
export declare function hasAuthProperty(component: StudioComponent | StudioComponentChild): component is StudioComponent;
export declare type ComponentPropertyValueTypes = ConcatenatedStudioComponentProperty | ConditionalStudioComponentProperty | FixedStudioComponentProperty | BoundStudioComponentProperty | CollectionStudioComponentProperty | FormStudioComponentProperty | StudioComponentAuthProperty;
export declare function isAuthProperty(prop: ComponentPropertyValueTypes): prop is StudioComponentAuthProperty;
export declare function isStudioComponentWithAuthProperty(component: StudioComponent | StudioComponentChild): component is StudioComponent;
export declare function hasAuthProperty(component: StudioComponent | StudioComponentChild): boolean;
export declare function isAuthProperty(prop: StudioComponentProperty): prop is StudioComponentAuthProperty;
export declare function isStudioComponentWithAuthDependency(component: StudioComponent | StudioComponentChild): component is StudioComponent;
/**

@@ -12,0 +11,0 @@ * Verify if this is 1) a type that has the collectionProperties, and 2) that the collection

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isEventPropertyBinding = exports.isSimplePropertyBinding = exports.isStoragePropertyBinding = exports.isDataPropertyBinding = exports.isStudioComponentWithVariants = exports.isStudioComponentWithCollectionProperties = exports.isStudioComponentWithAuthProperty = exports.isAuthProperty = exports.hasAuthProperty = exports.isStudioComponentWithBinding = exports.StudioRendererConstants = void 0;
exports.isEventPropertyBinding = exports.isSimplePropertyBinding = exports.isStoragePropertyBinding = exports.isDataPropertyBinding = exports.isStudioComponentWithVariants = exports.isStudioComponentWithCollectionProperties = exports.isStudioComponentWithAuthDependency = exports.isAuthProperty = exports.hasAuthProperty = exports.isStudioComponentWithBinding = exports.StudioRendererConstants = void 0;
/*

@@ -31,2 +31,29 @@ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

exports.hasAuthProperty = hasAuthProperty;
function hasAuthAction(component) {
const actions = component.events
? Object.values(component.events).filter((event) => 'action' in event)
: [];
return actions.some(doesActionHaveAuthBinding);
}
/**
* This should be written in a more generic way. Enumerating each case to get it out quickly.
*/
function doesActionHaveAuthBinding(action) {
switch (action.action) {
case 'Amplify.Navigation':
return Object.values(action.parameters).some(isAuthProperty);
case 'Amplify.AuthSignOut':
return Object.values(action.parameters).some(isAuthProperty);
case 'Amplify.DataStoreCreateItemAction':
return Object.values(action.parameters.fields).some(isAuthProperty);
case 'Amplify.DataStoreUpdateItemAction':
return isAuthProperty(action.parameters.id) || Object.values(action.parameters.fields).some(isAuthProperty);
case 'Amplify.DataStoreDeleteItemAction':
return isAuthProperty(action.parameters.id);
case 'Amplify.Mutation':
return action.parameters.state.set && isAuthProperty(action.parameters.state.set);
default:
throw new Error(`Action ${JSON.stringify(action)} could not be scanned for auth bindings.`);
}
}
function isAuthProperty(prop) {

@@ -36,12 +63,12 @@ return 'userAttribute' in prop;

exports.isAuthProperty = isAuthProperty;
function isStudioComponentWithAuthProperty(component) {
if (hasAuthProperty(component)) {
function isStudioComponentWithAuthDependency(component) {
if (hasAuthProperty(component) || hasAuthAction(component)) {
return true;
}
if (component.children) {
return component.children.some((child) => isStudioComponentWithAuthProperty(child));
return component.children.some(isStudioComponentWithAuthDependency);
}
return false;
}
exports.isStudioComponentWithAuthProperty = isStudioComponentWithAuthProperty;
exports.isStudioComponentWithAuthDependency = isStudioComponentWithAuthDependency;
/**

@@ -48,0 +75,0 @@ * Verify if this is 1) a type that has the collectionProperties, and 2) that the collection

@@ -189,3 +189,3 @@ export declare type FigmaMetadata = {

};
export declare type StudioComponentProperty = (FixedStudioComponentProperty | BoundStudioComponentProperty | CollectionStudioComponentProperty | ConcatenatedStudioComponentProperty | ConditionalStudioComponentProperty | FormStudioComponentProperty | StudioComponentAuthProperty) & CommonPropertyValues;
export declare type StudioComponentProperty = (FixedStudioComponentProperty | BoundStudioComponentProperty | CollectionStudioComponentProperty | ConcatenatedStudioComponentProperty | ConditionalStudioComponentProperty | StudioComponentAuthProperty | StateStudioComponentProperty) & CommonPropertyValues;
/**

@@ -260,16 +260,5 @@ * This represents a component property that is configured with either

};
/**
* This is the configuration for a form binding. This is
* technically an extension of Workflows but because it is
* pretty unique, it should be separated out with its own definition
*/
export declare type FormStudioComponentProperty = {
/**
* The model of the DataStore object
*/
model: string;
/**
* The binding configuration for the form
*/
bindings: FormBindings;
export declare type StateStudioComponentProperty = {
componentName: string;
property: string;
};

@@ -319,15 +308,2 @@ /**

};
export declare type FormBindings = {
[key: string]: FormBindingElement;
};
export declare type FormBindingElement = {
/**
* The name of the component to fetch a value from
*/
element: string;
/**
* The property component to get the value from.
*/
property: string;
};
/**

@@ -377,3 +353,17 @@ * This represent the configuration for binding a component property

click = "click",
change = "change"
doubleclick = "doubleclick",
mousedown = "mousedown",
mouseenter = "mouseenter",
mouseleave = "mouseleave",
mousemove = "mousemove",
mouseout = "mouseout",
mouseover = "mouseover",
mouseup = "mouseup",
change = "change",
input = "input",
focus = "focus",
blur = "blur",
keydown = "keydown",
keypress = "keypress",
keyup = "keyup"
}

@@ -415,3 +405,3 @@ /**

};
export declare type ActionStudioComponentEvent = NavigationAction | AuthSignOutAction | AuthUpdateUserAttributesAction | DataStoreCreateItemAction | DataStoreUpdateItemAction | DataStoreDeleteItemAction;
export declare type ActionStudioComponentEvent = NavigationAction | AuthSignOutAction | DataStoreCreateItemAction | DataStoreUpdateItemAction | DataStoreDeleteItemAction | MutationAction;
export declare type NavigationAction = {

@@ -432,10 +422,2 @@ action: 'Amplify.Navigation';

};
export declare type AuthUpdateUserAttributesAction = {
action: 'Amplify.AuthUpdateUserAttributes';
parameters: {
attributes: {
[propertyName: string]: StudioComponentProperty;
};
};
};
export declare type DataStoreCreateItemAction = {

@@ -467,2 +449,14 @@ action: 'Amplify.DataStoreCreateItemAction';

};
export declare type MutationAction = {
action: 'Amplify.Mutation';
parameters: {
state: MutationActionSetStateParameter;
};
};
export declare type MutationActionSetStateParameter = {
componentName: string;
property: string;
set: StudioComponentProperty;
};
export declare type StateReference = StateStudioComponentProperty | MutationActionSetStateParameter;
export declare type StudioComponentEvents = {

@@ -469,0 +463,0 @@ [eventName: string]: StudioComponentEvent;

@@ -27,4 +27,18 @@ "use strict";

StudioGenericEvent["click"] = "click";
StudioGenericEvent["doubleclick"] = "doubleclick";
StudioGenericEvent["mousedown"] = "mousedown";
StudioGenericEvent["mouseenter"] = "mouseenter";
StudioGenericEvent["mouseleave"] = "mouseleave";
StudioGenericEvent["mousemove"] = "mousemove";
StudioGenericEvent["mouseout"] = "mouseout";
StudioGenericEvent["mouseover"] = "mouseover";
StudioGenericEvent["mouseup"] = "mouseup";
StudioGenericEvent["change"] = "change";
StudioGenericEvent["input"] = "input";
StudioGenericEvent["focus"] = "focus";
StudioGenericEvent["blur"] = "blur";
StudioGenericEvent["keydown"] = "keydown";
StudioGenericEvent["keypress"] = "keypress";
StudioGenericEvent["keyup"] = "keyup";
})(StudioGenericEvent = exports.StudioGenericEvent || (exports.StudioGenericEvent = {}));
//# sourceMappingURL=studio-types.js.map
{
"name": "@aws-amplify/codegen-ui",
"version": "1.2.1-q1-release-87d4a4b.0",
"version": "1.2.1-q1-release-8b9a05d.0",
"description": "generic component code generation interface definitions",

@@ -53,3 +53,3 @@ "author": "Amazon Web Services",

},
"gitHead": "108dbc0f25f71ca479c8d4b65800eaeb5f234cf9"
"gitHead": "dee18681f863e777eb7f3f8139977a5c903908c3"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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