@aws-amplify/data-schema
Advanced tools
Comparing version 0.13.18 to 0.14.0
import { schema } from './ModelSchema'; | ||
import { model } from './ModelType'; | ||
import { modelIndex } from './ModelIndex'; | ||
import { id, string, integer, float, boolean, date, time, datetime, timestamp, email, json, phone, url, ipAddress } from './ModelField'; | ||
@@ -12,2 +11,2 @@ import { ref } from './RefType'; | ||
import { handler } from './Handler'; | ||
export { schema, model, modelIndex as index, ref, customType, enumType as enum, query, mutation, subscription, hasOne, hasMany, belongsTo, manyToMany, allow, id, string, integer, float, boolean, date, time, datetime, timestamp, email, json, phone, url, ipAddress, handler, }; | ||
export { schema, model, ref, customType, enumType as enum, query, mutation, subscription, hasOne, hasMany, belongsTo, manyToMany, allow, id, string, integer, float, boolean, date, time, datetime, timestamp, email, json, phone, url, ipAddress, handler, }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.handler = exports.ipAddress = exports.url = exports.phone = exports.json = exports.email = exports.timestamp = exports.datetime = exports.time = exports.date = exports.boolean = exports.float = exports.integer = exports.string = exports.id = exports.allow = exports.manyToMany = exports.belongsTo = exports.hasMany = exports.hasOne = exports.subscription = exports.mutation = exports.query = exports.enum = exports.customType = exports.ref = exports.index = exports.model = exports.schema = void 0; | ||
exports.handler = exports.ipAddress = exports.url = exports.phone = exports.json = exports.email = exports.timestamp = exports.datetime = exports.time = exports.date = exports.boolean = exports.float = exports.integer = exports.string = exports.id = exports.allow = exports.manyToMany = exports.belongsTo = exports.hasMany = exports.hasOne = exports.subscription = exports.mutation = exports.query = exports.enum = exports.customType = exports.ref = exports.model = exports.schema = void 0; | ||
const ModelSchema_1 = require("./ModelSchema"); | ||
@@ -8,4 +8,2 @@ Object.defineProperty(exports, "schema", { enumerable: true, get: function () { return ModelSchema_1.schema; } }); | ||
Object.defineProperty(exports, "model", { enumerable: true, get: function () { return ModelType_1.model; } }); | ||
const ModelIndex_1 = require("./ModelIndex"); | ||
Object.defineProperty(exports, "index", { enumerable: true, get: function () { return ModelIndex_1.modelIndex; } }); | ||
const ModelField_1 = require("./ModelField"); | ||
@@ -12,0 +10,0 @@ Object.defineProperty(exports, "id", { enumerable: true, get: function () { return ModelField_1.id; } }); |
@@ -46,3 +46,3 @@ import type { SetTypeSubArg, SecondaryIndexIrShape } from '@aws-amplify/data-schema-types'; | ||
identifier<ID extends IdentifierType<T> = []>(identifier: ID): ModelType<SetTypeSubArg<T, 'identifier', ID>, K | 'identifier'>; | ||
secondaryIndexes<const Indexes extends readonly ModelIndexType<SecondaryIndexFields<ExtractType<T>>, SecondaryIndexFields<ExtractType<T>>, unknown, never, any>[] = readonly [], const IndexesIR extends readonly any[] = SecondaryIndexToIR<Indexes, ExtractType<T>>>(indexes: Indexes): ModelType<SetTypeSubArg<T, 'secondaryIndexes', IndexesIR>, K | 'secondaryIndexes'>; | ||
secondaryIndexes<const SecondaryIndexPKPool extends string = SecondaryIndexFields<ExtractType<T>>, const Indexes extends readonly ModelIndexType<string, string, unknown, readonly [], any>[] = readonly [], const IndexesIR extends readonly any[] = SecondaryIndexToIR<Indexes, ExtractType<T>>>(callback: (index: <PK extends SecondaryIndexPKPool>(pk: PK) => ModelIndexType<SecondaryIndexPKPool, PK, ReadonlyArray<Exclude<SecondaryIndexPKPool, PK>>>) => Indexes): ModelType<SetTypeSubArg<T, 'secondaryIndexes', IndexesIR>, K | 'secondaryIndexes'>; | ||
authorization<AuthRuleType extends Authorization<any, any, any>>(rules: AuthRuleType[]): ModelType<SetTypeSubArg<T, 'authorization', AuthRuleType[]>, K | 'authorization'>; | ||
@@ -49,0 +49,0 @@ }, K> & Brand<typeof brandName>; |
@@ -5,2 +5,3 @@ "use strict"; | ||
const util_1 = require("./util"); | ||
const ModelIndex_1 = require("./ModelIndex"); | ||
const brandName = 'modelType'; | ||
@@ -19,4 +20,4 @@ function _model(fields) { | ||
}, | ||
secondaryIndexes(indexes) { | ||
data.secondaryIndexes = indexes; | ||
secondaryIndexes(callback) { | ||
data.secondaryIndexes = callback(ModelIndex_1.modelIndex); | ||
return this; | ||
@@ -23,0 +24,0 @@ }, |
{ | ||
"name": "@aws-amplify/data-schema", | ||
"version": "0.13.18", | ||
"version": "0.14.0", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
647779
3961