ivy-kit
Version:
Ivy Kit is a CLI migrator tool for [Ivy ORM](https://www.npmjs.com/package/ivy-orm), a fully type-safe "ORM" for Azure AI Search. Use Ivy Kit to manage your AI Search data plane, like creating indexes and indexers.
2 lines (1 loc) • 2.94 kB
JavaScript
;var D=Object.create;var c=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var v=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),w=(e,t)=>{for(var r in t)c(e,r,{get:t[r],enumerable:!0})},h=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of E(t))!I.call(e,n)&&n!==r&&c(e,n,{get:()=>t[n],enumerable:!(s=C(t,n))||s.enumerable});return e};var N=(e,t,r)=>(r=e!=null?D(F(e)):{},h(t||!e||!e.__esModule?c(r,"default",{value:e,enumerable:!0}):r,e)),T=e=>h(c({},"__esModule",{value:!0}),e);var x=v((J,y)=>{"use strict";var d=Object.defineProperty,O=Object.getOwnPropertyDescriptor,R=Object.getOwnPropertyNames,P=Object.prototype.hasOwnProperty,j=(e,t)=>{for(var r in t)d(e,r,{get:t[r],enumerable:!0})},M=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of R(t))!P.call(e,n)&&n!==r&&d(e,n,{get:()=>t[n],enumerable:!(s=O(t,n))||s.enumerable});return e},_=e=>M(d({},"__esModule",{value:!0}),e),g={};j(g,{isComplexFieldDataType:()=>k,isDataSource:()=>K,isSearchIndex:()=>B,isSearchIndexer:()=>A,isSimpleField:()=>z,isSimpleFieldDataType:()=>f});y.exports=_(g);var f=e=>["Edm.String","Edm.Int32","Edm.Int64","Edm.Double","Edm.Boolean","Edm.DateTimeOffset","Edm.GeographyPoint","Collection(Edm.String)","Collection(Edm.Int32)","Collection(Edm.Int64)","Collection(Edm.Double)","Collection(Edm.Boolean)","Collection(Edm.DateTimeOffset)","Collection(Edm.GeographyPoint)","Collection(Edm.Single)"].includes(e),k=e=>e==="Edm.ComplexType"||e==="Collection(Edm.ComplexType)",z=e=>{let{type:t,name:r}=e;return!(!t||!r||!f(t))},B=e=>e.name&&e.fields,A=e=>e.name&&e.dataSourceName,K=e=>e.name&&e.container.name});var Z={};w(Z,{isResource:()=>b});module.exports=T(Z);var l=N(x());function G(e){return["adlsgen2","azureblob","azuresql","azuretable","cosmosdb","mysql"].includes(e)}function S(e){return!!e.name&&G(e.type)}var i=require("zod"),V=i.z.object({id:i.z.string(),migrationName:i.z.string(),checksum:i.z.string(),startedAt:i.z.date(),finishedAt:i.z.date().nullish(),logs:i.z.string().nullish()}),o=i.z.object({id:i.z.string(),name:i.z.string(),checksum:i.z.string()}),u=o.extend({type:i.z.literal("index")}),m=o.extend({type:i.z.literal("indexer")}),p=o.extend({type:i.z.literal("dataSource")}),H=i.z.object({indexes:i.z.object({create:i.z.any().refine(l.isSearchIndex).array(),delete:u.omit({id:!0}).array()}),indexers:i.z.object({create:i.z.any().refine(l.isSearchIndexer).array(),delete:m.omit({id:!0}).array()}),dataSources:i.z.object({create:i.z.any().refine(S).array(),delete:p.omit({id:!0}).array()})});var a=class{constructor(t){this.schema=t}guard(t){try{return this.schema.parse(t),!0}catch{return!1}}},q=new a(o);function b(e){return q.guard(e)&&["index","indexer","dataSource"].includes(e.type)}var X=new a(u);var Y=new a(m);var ee=new a(p);0&&(module.exports={isResource});