@redocly/openapi-docs 3.24.0-next.1 → 3.24.0-next.11
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.
- package/dist/redocly-openapi-docs.min.AiChatProvider-B6qZxoKI.js +32 -0
- package/dist/redocly-openapi-docs.min.AiChatSqliteDBStorage-Cy4k7pUw.js +1 -0
- package/dist/redocly-openapi-docs.min.AiPanel-Bwuv-ZH_.js +773 -0
- package/dist/redocly-openapi-docs.min.HistorySqliteDBStorage-DYnaxLim.js +1 -0
- package/dist/redocly-openapi-docs.min.SqliteDBStorage-DlCxvBqX.js +14 -0
- package/dist/redocly-openapi-docs.min.StepContextSqliteDBStorage-DTB5U2yh.js +1 -0
- package/dist/redocly-openapi-docs.min.ai-chat-mappers-C8DaS6ge.js +1 -0
- package/dist/redocly-openapi-docs.min.ai-message-parts.schema-C7fjQhYX.js +1 -0
- package/dist/redocly-openapi-docs.min.external-resolver-CKkEKWzQ.js +2 -0
- package/dist/redocly-openapi-docs.min.history.schema-DzAAX18S.js +1 -0
- package/dist/redocly-openapi-docs.min.index-BsXv-Pjz.js +1 -0
- package/dist/redocly-openapi-docs.min.index-DWajc5Ac.js +7730 -0
- package/dist/redocly-openapi-docs.min.index-We3Hmt3m.js +1 -0
- package/dist/redocly-openapi-docs.min.index-bTUZhh-q.js +1 -0
- package/dist/redocly-openapi-docs.min.indexes-Bp4ld5gB.js +1 -0
- package/dist/redocly-openapi-docs.min.js +1 -20958
- package/dist/redocly-openapi-docs.min.lint-DMpx1vvZ.js +181 -0
- package/dist/redocly-openapi-docs.min.lint-graphql-DH0N_7pS.js +3 -0
- package/dist/redocly-openapi-docs.min.respect-run-JH1Xd21R.js +78 -0
- package/dist/redocly-openapi-docs.min.standalone-DMeytWE9.js +12112 -0
- package/dist/redocly-openapi-docs.min.step-context.schema-DEgzIgw0.js +1 -0
- package/dist/redocly-openapi-docs.min.tauri-path-TzmCcPBx.js +1 -0
- package/dist/redocly-openapi-docs.min.useAiChatQueries-RJxlmgfo.js +381 -0
- package/lib/components/ApiInfo/ApiInfo.d.ts +1 -1
- package/lib/components/Callbacks/CallbackOperation.js +1 -1
- package/lib/components/Callbacks/CallbackSummary.d.ts +1 -1
- package/lib/components/Callbacks/CallbackSummary.js +1 -1
- package/lib/components/Callbacks/CallbacksList.js +1 -1
- package/lib/components/Content/useAutoScroll.js +1 -1
- package/lib/components/ContentItem/useIsExpanded.d.ts +1 -1
- package/lib/components/ContentItem/useIsExpanded.js +1 -1
- package/lib/components/ContentItems/ContentItems.js +1 -1
- package/lib/components/ContentItems/VirtualList.d.ts +4 -2
- package/lib/components/ContentItems/VirtualList.js +1 -1
- package/lib/components/ContentItems/useScrollOnRender.js +1 -1
- package/lib/components/Download/DownloadSpecification.d.ts +1 -1
- package/lib/components/ExpandAllButton/ExpandAllButton.js +2 -2
- package/lib/components/ExpandAllButton/helpers.d.ts +5 -0
- package/lib/components/ExpandAllButton/helpers.js +1 -0
- package/lib/components/McpOverview/McpOverview.d.ts +1 -1
- package/lib/components/PayloadSamples/Example.d.ts +1 -1
- package/lib/components/PayloadSamples/ExampleValue.d.ts +1 -1
- package/lib/components/PropertyDetails/DescriptionEnums.d.ts +1 -1
- package/lib/components/PropertyDetails/SimpleEnums.d.ts +1 -1
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.d.ts +1 -1
- package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsStandalone.d.ts +1 -1
- package/lib/components/Replay/EmbeddedReplay.d.ts +1 -1
- package/lib/components/Replay/Replay.js +1 -1
- package/lib/components/Request/RequestDetails.js +4 -4
- package/lib/components/RequestParameters/RequestParameters.d.ts +1 -1
- package/lib/components/RequestSamples/useCodeSamples.d.ts +1 -1
- package/lib/components/ResponseSamples/ResponseSamples.d.ts +1 -1
- package/lib/components/Responses/OperationResponseList.js +2 -2
- package/lib/components/Schema/ArraySchema.js +1 -1
- package/lib/components/Schema/Schema.js +1 -1
- package/lib/components/Schema/SubSchema.js +1 -1
- package/lib/components/Schema/helpers.d.ts +1 -1
- package/lib/components/Schema/types.d.ts +2 -0
- package/lib/components/Schema/useOneOfLocationIdx.js +1 -1
- package/lib/components/SectionContent/SectionContent.d.ts +1 -1
- package/lib/components/Security/RequiredScopesList.d.ts +1 -1
- package/lib/components/Security/ScopeTagWithTooltip.d.ts +1 -1
- package/lib/components/Security/SecurityFlow.d.ts +1 -1
- package/lib/components/SideMenu/hooks/useMenuItems.js +1 -1
- package/lib/components/StickySidebar/StickyResponsiveSidebar.js +1 -1
- package/lib/components/TagItem/OperationNavigationItems.d.ts +1 -1
- package/lib/components/TagItem/OperationsNavigation.d.ts +1 -1
- package/lib/components/TagItem/OperationsNavigation.js +1 -1
- package/lib/components/TagItem/TagItem.d.ts +1 -1
- package/lib/components/TagItem/TagItem.js +1 -1
- package/lib/components/ViewNested/ViewNested.d.ts +1 -0
- package/lib/components/ViewNested/ViewNested.js +6 -6
- package/lib/components/common/Dropdown/Dropdown.d.ts +1 -1
- package/lib/components/common/LinkToField.js +1 -1
- package/lib/components/common/SchemaSelection/SchemaSelection.d.ts +1 -1
- package/lib/components/common/linkify.js +1 -1
- package/lib/contexts/expand-all-depth.d.ts +2 -0
- package/lib/contexts/expand-all-depth.js +1 -0
- package/lib/hooks/useRouter.js +1 -1
- package/lib/hooks/useUppercase2LowercaseRedirect.js +1 -1
- package/lib/jotai/operation.d.ts +1 -1
- package/lib/models/field.js +1 -1
- package/lib/models/mediaContent.d.ts +1 -1
- package/lib/models/mediaType.d.ts +1 -1
- package/lib/models/request.d.ts +1 -1
- package/lib/models/response.d.ts +1 -1
- package/lib/models/schema.d.ts +1 -1
- package/lib/models/schema.js +2 -2
- package/lib/models/security.d.ts +1 -1
- package/lib/services/OpenAPIParser.js +1 -1
- package/lib/services/code-samples/generator.d.ts +1 -1
- package/lib/services/code-samples/httpsnippet/helpers/code-builder.d.ts +1 -1
- package/lib/services/code-samples/httpsnippet/helpers/code-helpers.d.ts +1 -1
- package/lib/services/config-options/normalizeOptions.js +1 -1
- package/lib/utils/dom.js +1 -1
- package/lib/utils/path.d.ts +1 -1
- package/package.json +14 -14
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aK as a}from"./redocly-openapi-docs.min.index-DWajc5Ac.js";async function t(n,e){await a("plugin:opener|open_url",{url:n,with:e})}async function i(n,e){await a("plugin:opener|open_path",{path:n,with:e})}async function p(n){return a("plugin:opener|reveal_item_in_dir",{paths:typeof n=="string"?[n]:n})}export{i as openPath,t as openUrl,p as revealItemInDir};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aK as t}from"./redocly-openapi-docs.min.index-DWajc5Ac.js";async function a(o={}){return typeof o=="object"&&Object.freeze(o),await t("plugin:dialog|open",{options:o})}export{a as open};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const i=Symbol.for("drizzle:entityKind");function u(t,e){if(!t||typeof t!="object")return!1;if(t instanceof e)return!0;if(!Object.prototype.hasOwnProperty.call(e,i))throw new Error(`Class "${e.name??"<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let n=Object.getPrototypeOf(t).constructor;if(n)for(;n;){if(i in n&&n[i]===e[i])return!0;n=Object.getPrototypeOf(n)}return!1}const L=Symbol.for("drizzle:Name"),F=Symbol.for("drizzle:Schema"),z=Symbol.for("drizzle:Columns"),_=Symbol.for("drizzle:ExtraConfigColumns"),O=Symbol.for("drizzle:OriginalName"),j=Symbol.for("drizzle:BaseName"),C=Symbol.for("drizzle:IsAlias"),J=Symbol.for("drizzle:ExtraConfigBuilder"),Z=Symbol.for("drizzle:IsDrizzleTable");class d{static[i]="Table";static Symbol={Name:L,Schema:F,OriginalName:O,Columns:z,ExtraConfigColumns:_,BaseName:j,IsAlias:C,ExtraConfigBuilder:J};[L];[O];[F];[z];[_];[j];[C]=!1;[Z]=!0;[J]=void 0;constructor(e,n,r){this[L]=this[O]=e,this[F]=n,this[j]=r}}function P(t){return t[L]}function ee(t){return`${t[F]??"public"}.${t[L]}`}class v{constructor(e,n){this.table=e,this.config=n,this.name=n.name,this.keyAsName=n.keyAsName,this.notNull=n.notNull,this.default=n.default,this.defaultFn=n.defaultFn,this.onUpdateFn=n.onUpdateFn,this.hasDefault=n.hasDefault,this.primary=n.primaryKey,this.isUnique=n.isUnique,this.uniqueName=n.uniqueName,this.uniqueType=n.uniqueType,this.dataType=n.dataType,this.columnType=n.columnType,this.generated=n.generated,this.generatedIdentity=n.generatedIdentity}static[i]="Column";name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(e){return e}mapToDriverValue(e){return e}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}class te{static[i]="ColumnBuilder";config;constructor(e,n,r){this.config={name:e,keyAsName:e==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:n,columnType:r,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(e){return this.config.default=e,this.config.hasDefault=!0,this}$defaultFn(e){return this.config.defaultFn=e,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(e){return this.config.onUpdateFn=e,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(e){this.config.name===""&&(this.config.name=e)}}const W=Symbol.for("drizzle:isPgEnum");function ne(t){return!!t&&typeof t=="function"&&W in t&&t[W]===!0}class B{static[i]="Subquery";constructor(e,n,r,a=!1,o=[]){this._={brand:"Subquery",sql:e,selectedFields:n,alias:r,isWith:a,usedTables:o}}}class re extends B{static[i]="WithSubquery"}const se={startActiveSpan(t,e){return e()}},N=Symbol.for("drizzle:ViewBaseConfig");function R(t){return t!=null&&typeof t.getSQL=="function"}function ie(t){const e={sql:"",params:[]};for(const n of t)e.sql+=n.sql,e.params.push(...n.params),n.typings?.length&&(e.typings||(e.typings=[]),e.typings.push(...n.typings));return e}class b{static[i]="StringChunk";value;constructor(e){this.value=Array.isArray(e)?e:[e]}getSQL(){return new c([this])}}class c{constructor(e){this.queryChunks=e;for(const n of e)if(u(n,d)){const r=n[d.Symbol.Schema];this.usedTables.push(r===void 0?n[d.Symbol.Name]:r+"."+n[d.Symbol.Name])}}static[i]="SQL";decoder=ae;shouldInlineParams=!1;usedTables=[];append(e){return this.queryChunks.push(...e.queryChunks),this}toQuery(e){return se.startActiveSpan("drizzle.buildSQL",n=>{const r=this.buildQueryFromSourceParams(this.queryChunks,e);return n?.setAttributes({"drizzle.query.text":r.sql,"drizzle.query.params":JSON.stringify(r.params)}),r})}buildQueryFromSourceParams(e,n){const r=Object.assign({},n,{inlineParams:n.inlineParams||this.shouldInlineParams,paramStartIndex:n.paramStartIndex||{value:0}}),{casing:a,escapeName:o,escapeParam:h,prepareTyping:m,inlineParams:p,paramStartIndex:y}=r;return ie(e.map(s=>{if(u(s,b))return{sql:s.value.join(""),params:[]};if(u(s,V))return{sql:o(s.value),params:[]};if(s===void 0)return{sql:"",params:[]};if(Array.isArray(s)){const f=[new b("(")];for(const[g,$]of s.entries())f.push($),g<s.length-1&&f.push(new b(", "));return f.push(new b(")")),this.buildQueryFromSourceParams(f,r)}if(u(s,c))return this.buildQueryFromSourceParams(s.queryChunks,{...r,inlineParams:p||s.shouldInlineParams});if(u(s,d)){const f=s[d.Symbol.Schema],g=s[d.Symbol.Name];return{sql:f===void 0||s[C]?o(g):o(f)+"."+o(g),params:[]}}if(u(s,v)){const f=a.getColumnCasing(s);if(n.invokeSource==="indexes")return{sql:o(f),params:[]};const g=s.table[d.Symbol.Schema];return{sql:s.table[C]||g===void 0?o(s.table[d.Symbol.Name])+"."+o(f):o(g)+"."+o(s.table[d.Symbol.Name])+"."+o(f),params:[]}}if(u(s,I)){const f=s[N].schema,g=s[N].name;return{sql:f===void 0||s[N].isAlias?o(g):o(f)+"."+o(g),params:[]}}if(u(s,T)){if(u(s.value,q))return{sql:h(y.value++,s),params:[s],typings:["none"]};const f=s.value===null?null:s.encoder.mapToDriverValue(s.value);if(u(f,c))return this.buildQueryFromSourceParams([f],r);if(p)return{sql:this.mapInlineParam(f,r),params:[]};let g=["none"];return m&&(g=[m(s.encoder)]),{sql:h(y.value++,f),params:[f],typings:g}}return u(s,q)?{sql:h(y.value++,s),params:[s],typings:["none"]}:u(s,c.Aliased)&&s.fieldAlias!==void 0?{sql:o(s.fieldAlias),params:[]}:u(s,B)?s._.isWith?{sql:o(s._.alias),params:[]}:this.buildQueryFromSourceParams([new b("("),s._.sql,new b(") "),new V(s._.alias)],r):ne(s)?s.schema?{sql:o(s.schema)+"."+o(s.enumName),params:[]}:{sql:o(s.enumName),params:[]}:R(s)?s.shouldOmitSQLParens?.()?this.buildQueryFromSourceParams([s.getSQL()],r):this.buildQueryFromSourceParams([new b("("),s.getSQL(),new b(")")],r):p?{sql:this.mapInlineParam(s,r),params:[]}:{sql:h(y.value++,s),params:[s],typings:["none"]}}))}mapInlineParam(e,{escapeString:n}){if(e===null)return"null";if(typeof e=="number"||typeof e=="boolean")return e.toString();if(typeof e=="string")return n(e);if(typeof e=="object"){const r=e.toString();return n(r==="[object Object]"?JSON.stringify(e):r)}throw new Error("Unexpected param value: "+e)}getSQL(){return this}as(e){return e===void 0?this:new c.Aliased(this,e)}mapWith(e){return this.decoder=typeof e=="function"?{mapFromDriverValue:e}:e,this}inlineParams(){return this.shouldInlineParams=!0,this}if(e){return e?this:void 0}}class V{constructor(e){this.value=e}static[i]="Name";brand;getSQL(){return new c([this])}}function oe(t){return typeof t=="object"&&t!==null&&"mapToDriverValue"in t&&typeof t.mapToDriverValue=="function"}const ae={mapFromDriverValue:t=>t},ue={mapToDriverValue:t=>t};class T{constructor(e,n=ue){this.value=e,this.encoder=n}static[i]="Param";brand;getSQL(){return new c([this])}}function l(t,...e){const n=[];(e.length>0||t.length>0&&t[0]!=="")&&n.push(new b(t[0]));for(const[r,a]of e.entries())n.push(a,new b(t[r+1]));return new c(n)}(t=>{function e(){return new c([])}t.empty=e;function n(p){return new c(p)}t.fromList=n;function r(p){return new c([new b(p)])}t.raw=r;function a(p,y){const s=[];for(const[f,g]of p.entries())f>0&&y!==void 0&&s.push(y),s.push(g);return new c(s)}t.join=a;function o(p){return new V(p)}t.identifier=o;function h(p){return new q(p)}t.placeholder=h;function m(p,y){return new T(p,y)}t.param=m})(l||(l={})),(t=>{class e{constructor(r,a){this.sql=r,this.fieldAlias=a}static[i]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new e(this.sql,this.fieldAlias)}}t.Aliased=e})(c||(c={}));class q{constructor(e){this.name=e}static[i]="Placeholder";getSQL(){return new c([this])}}function le(t,e){return t.map(n=>{if(u(n,q)){if(!(n.name in e))throw new Error(`No value for placeholder "${n.name}" was provided`);return e[n.name]}if(u(n,T)&&u(n.value,q)){if(!(n.value.name in e))throw new Error(`No value for placeholder "${n.value.name}" was provided`);return n.encoder.mapToDriverValue(e[n.value.name])}return n})}const ce=Symbol.for("drizzle:IsDrizzleView");class I{static[i]="View";[N];[ce]=!0;constructor({name:e,schema:n,selectedFields:r,query:a}){this[N]={name:e,originalName:e,schema:n,selectedFields:r,query:a,isExisting:!a,isAlias:!1}}getSQL(){return new c([this])}}v.prototype.getSQL=function(){return new c([this])},d.prototype.getSQL=function(){return new c([this])},B.prototype.getSQL=function(){return new c([this])};function fe(t,e,n){const r={},a=t.reduce((o,{path:h,field:m},p)=>{let y;u(m,v)?y=m:u(m,c)?y=m.decoder:u(m,B)?y=m._.sql.decoder:y=m.sql.decoder;let s=o;for(const[f,g]of h.entries())if(f<h.length-1)g in s||(s[g]={}),s=s[g];else{const $=e[p],Y=s[g]=$===null?null:y.mapFromDriverValue($);if(n&&u(m,v)&&h.length===2){const x=h[0];x in r?typeof r[x]=="string"&&r[x]!==P(m.table)&&(r[x]=!1):r[x]=Y===null?P(m.table):!1}}return o},{});if(n&&Object.keys(r).length>0)for(const[o,h]of Object.entries(r))typeof h=="string"&&!n[h]&&(a[o]=null);return a}function A(t,e){return Object.entries(t).reduce((n,[r,a])=>{if(typeof r!="string")return n;const o=e?[...e,r]:[r];return u(a,v)||u(a,c)||u(a,c.Aliased)||u(a,B)?n.push({path:o,field:a}):u(a,d)?n.push(...A(a[d.Symbol.Columns],o)):n.push(...A(a,o)),n},[])}function me(t,e){const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const[a,o]of n.entries())if(o!==r[a])return!1;return!0}function de(t,e){const n=Object.entries(e).filter(([,r])=>r!==void 0).map(([r,a])=>u(a,c)||u(a,v)?[r,a]:[r,new T(a,t[d.Symbol.Columns][r])]);if(n.length===0)throw new Error("No values to set");return Object.fromEntries(n)}function pe(t,e){for(const n of e)for(const r of Object.getOwnPropertyNames(n.prototype))r!=="constructor"&&Object.defineProperty(t.prototype,r,Object.getOwnPropertyDescriptor(n.prototype,r)||Object.create(null))}function he(t){return t[d.Symbol.Columns]}function ge(t){return u(t,B)?t._.alias:u(t,I)?t[N].name:u(t,c)?void 0:t[d.Symbol.IsAlias]?t[d.Symbol.Name]:t[d.Symbol.BaseName]}function D(t,e){return{name:typeof t=="string"&&t.length>0?t:"",config:typeof t=="object"?t:e}}const M=typeof TextDecoder>"u"?null:new TextDecoder;function S(t,e){return oe(e)&&!R(t)&&!u(t,T)&&!u(t,q)&&!u(t,v)&&!u(t,d)&&!u(t,I)?new T(t,e):t}const ye=(t,e)=>l`${t} = ${S(e,t)}`,be=(t,e)=>l`${t} <> ${S(e,t)}`;function Se(...t){const e=t.filter(n=>n!==void 0);if(e.length!==0)return e.length===1?new c(e):new c([new b("("),l.join(e,new b(" and ")),new b(")")])}function we(...t){const e=t.filter(n=>n!==void 0);if(e.length!==0)return e.length===1?new c(e):new c([new b("("),l.join(e,new b(" or ")),new b(")")])}function Qe(t){return l`not ${t}`}const ve=(t,e)=>l`${t} > ${S(e,t)}`,Le=(t,e)=>l`${t} >= ${S(e,t)}`,Be=(t,e)=>l`${t} < ${S(e,t)}`,Ne=(t,e)=>l`${t} <= ${S(e,t)}`;function Te(t,e){return Array.isArray(e)?e.length===0?l`false`:l`${t} in ${e.map(n=>S(n,t))}`:l`${t} in ${S(e,t)}`}function qe(t,e){return Array.isArray(e)?e.length===0?l`true`:l`${t} not in ${e.map(n=>S(n,t))}`:l`${t} not in ${S(e,t)}`}function xe(t){return l`${t} is null`}function De(t){return l`${t} is not null`}function $e(t){return l`exists ${t}`}function Fe(t){return l`not exists ${t}`}function Ce(t,e,n){return l`${t} between ${S(e,t)} and ${S(n,t)}`}function Ie(t,e,n){return l`${t} not between ${S(e,t)} and ${S(n,t)}`}function ze(t,e){return l`${t} like ${e}`}function Oe(t,e){return l`${t} not like ${e}`}function je(t,e){return l`${t} ilike ${e}`}function Pe(t,e){return l`${t} not ilike ${e}`}function Ve(t){return l`${t} asc`}function Ae(t){return l`${t} desc`}class Ue{static[i]="SQLiteForeignKeyBuilder";reference;_onUpdate;_onDelete;constructor(e,n){this.reference=()=>{const{name:r,columns:a,foreignColumns:o}=e();return{name:r,columns:a,foreignTable:o[0].table,foreignColumns:o}},n&&(this._onUpdate=n.onUpdate,this._onDelete=n.onDelete)}onUpdate(e){return this._onUpdate=e,this}onDelete(e){return this._onDelete=e,this}build(e){return new ke(e,this)}}class ke{constructor(e,n){this.table=e,this.reference=n.reference,this.onUpdate=n._onUpdate,this.onDelete=n._onDelete}static[i]="SQLiteForeignKey";reference;onUpdate;onDelete;getName(){const{name:e,columns:n,foreignColumns:r}=this.reference(),a=n.map(m=>m.name),o=r.map(m=>m.name),h=[this.table[L],...a,r[0].table[L],...o];return e??`${h.join("_")}_fk`}}function Ee(t,e){return`${t[L]}_${e.join("_")}_unique`}class Q extends te{static[i]="SQLiteColumnBuilder";foreignKeyConfigs=[];references(e,n={}){return this.foreignKeyConfigs.push({ref:e,actions:n}),this}unique(e){return this.config.isUnique=!0,this.config.uniqueName=e,this}generatedAlwaysAs(e,n){return this.config.generated={as:e,type:"always",mode:n?.mode??"virtual"},this}buildForeignKeys(e,n){return this.foreignKeyConfigs.map(({ref:r,actions:a})=>((o,h)=>{const m=new Ue(()=>{const p=o();return{columns:[e],foreignColumns:[p]}});return h.onUpdate&&m.onUpdate(h.onUpdate),h.onDelete&&m.onDelete(h.onDelete),m.build(n)})(r,a))}}class w extends v{constructor(e,n){n.uniqueName||(n.uniqueName=Ee(e,[n.name])),super(e,n),this.table=e}static[i]="SQLiteColumn"}class Ke extends Q{static[i]="SQLiteBigIntBuilder";constructor(e){super(e,"bigint","SQLiteBigInt")}build(e){return new _e(e,this.config)}}class _e extends w{static[i]="SQLiteBigInt";getSQLType(){return"blob"}mapFromDriverValue(e){if(typeof Buffer<"u"&&Buffer.from){const n=Buffer.isBuffer(e)?e:e instanceof ArrayBuffer?Buffer.from(e):e.buffer?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e);return BigInt(n.toString("utf8"))}return BigInt(M.decode(e))}mapToDriverValue(e){return Buffer.from(e.toString())}}class Je extends Q{static[i]="SQLiteBlobJsonBuilder";constructor(e){super(e,"json","SQLiteBlobJson")}build(e){return new We(e,this.config)}}class We extends w{static[i]="SQLiteBlobJson";getSQLType(){return"blob"}mapFromDriverValue(e){if(typeof Buffer<"u"&&Buffer.from){const n=Buffer.isBuffer(e)?e:e instanceof ArrayBuffer?Buffer.from(e):e.buffer?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e);return JSON.parse(n.toString("utf8"))}return JSON.parse(M.decode(e))}mapToDriverValue(e){return Buffer.from(JSON.stringify(e))}}class Re extends Q{static[i]="SQLiteBlobBufferBuilder";constructor(e){super(e,"buffer","SQLiteBlobBuffer")}build(e){return new Me(e,this.config)}}class Me extends w{static[i]="SQLiteBlobBuffer";mapFromDriverValue(e){return Buffer.isBuffer(e)?e:Buffer.from(e)}getSQLType(){return"blob"}}function Ge(t,e){const{name:n,config:r}=D(t,e);return r?.mode==="json"?new Je(n):r?.mode==="bigint"?new Ke(n):new Re(n)}class He extends Q{static[i]="SQLiteCustomColumnBuilder";constructor(e,n,r){super(e,"custom","SQLiteCustomColumn"),this.config.fieldConfig=n,this.config.customTypeParams=r}build(e){return new Xe(e,this.config)}}class Xe extends w{static[i]="SQLiteCustomColumn";sqlName;mapTo;mapFrom;constructor(e,n){super(e,n),this.sqlName=n.customTypeParams.dataType(n.fieldConfig),this.mapTo=n.customTypeParams.toDriver,this.mapFrom=n.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(e){return typeof this.mapFrom=="function"?this.mapFrom(e):e}mapToDriverValue(e){return typeof this.mapTo=="function"?this.mapTo(e):e}}function Ye(t){return(e,n)=>{const{name:r,config:a}=D(e,n);return new He(r,a,t)}}class U extends Q{static[i]="SQLiteBaseIntegerBuilder";constructor(e,n,r){super(e,n,r),this.config.autoIncrement=!1}primaryKey(e){return e?.autoIncrement&&(this.config.autoIncrement=!0),this.config.hasDefault=!0,super.primaryKey()}}class k extends w{static[i]="SQLiteBaseInteger";autoIncrement=this.config.autoIncrement;getSQLType(){return"integer"}}class Ze extends U{static[i]="SQLiteIntegerBuilder";constructor(e){super(e,"number","SQLiteInteger")}build(e){return new et(e,this.config)}}class et extends k{static[i]="SQLiteInteger"}class tt extends U{static[i]="SQLiteTimestampBuilder";constructor(e,n){super(e,"date","SQLiteTimestamp"),this.config.mode=n}defaultNow(){return this.default(l`(cast((julianday('now') - 2440587.5)*86400000 as integer))`)}build(e){return new nt(e,this.config)}}class nt extends k{static[i]="SQLiteTimestamp";mode=this.config.mode;mapFromDriverValue(e){return this.config.mode==="timestamp"?new Date(e*1e3):new Date(e)}mapToDriverValue(e){const n=e.getTime();return this.config.mode==="timestamp"?Math.floor(n/1e3):n}}class rt extends U{static[i]="SQLiteBooleanBuilder";constructor(e,n){super(e,"boolean","SQLiteBoolean"),this.config.mode=n}build(e){return new st(e,this.config)}}class st extends k{static[i]="SQLiteBoolean";mode=this.config.mode;mapFromDriverValue(e){return Number(e)===1}mapToDriverValue(e){return e?1:0}}function G(t,e){const{name:n,config:r}=D(t,e);return r?.mode==="timestamp"||r?.mode==="timestamp_ms"?new tt(n,r.mode):r?.mode==="boolean"?new rt(n,r.mode):new Ze(n)}class it extends Q{static[i]="SQLiteNumericBuilder";constructor(e){super(e,"string","SQLiteNumeric")}build(e){return new ot(e,this.config)}}class ot extends w{static[i]="SQLiteNumeric";mapFromDriverValue(e){return typeof e=="string"?e:String(e)}getSQLType(){return"numeric"}}class at extends Q{static[i]="SQLiteNumericNumberBuilder";constructor(e){super(e,"number","SQLiteNumericNumber")}build(e){return new ut(e,this.config)}}class ut extends w{static[i]="SQLiteNumericNumber";mapFromDriverValue(e){return typeof e=="number"?e:Number(e)}mapToDriverValue=String;getSQLType(){return"numeric"}}class lt extends Q{static[i]="SQLiteNumericBigIntBuilder";constructor(e){super(e,"bigint","SQLiteNumericBigInt")}build(e){return new ct(e,this.config)}}class ct extends w{static[i]="SQLiteNumericBigInt";mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return"numeric"}}function ft(t,e){const{name:n,config:r}=D(t,e),a=r?.mode;return a==="number"?new at(n):a==="bigint"?new lt(n):new it(n)}class mt extends Q{static[i]="SQLiteRealBuilder";constructor(e){super(e,"number","SQLiteReal")}build(e){return new dt(e,this.config)}}class dt extends w{static[i]="SQLiteReal";getSQLType(){return"real"}}function pt(t){return new mt(t??"")}class ht extends Q{static[i]="SQLiteTextBuilder";constructor(e,n){super(e,"string","SQLiteText"),this.config.enumValues=n.enum,this.config.length=n.length}build(e){return new gt(e,this.config)}}class gt extends w{static[i]="SQLiteText";enumValues=this.config.enumValues;length=this.config.length;constructor(e,n){super(e,n)}getSQLType(){return`text${this.config.length?`(${this.config.length})`:""}`}}class yt extends Q{static[i]="SQLiteTextJsonBuilder";constructor(e){super(e,"json","SQLiteTextJson")}build(e){return new bt(e,this.config)}}class bt extends w{static[i]="SQLiteTextJson";getSQLType(){return"text"}mapFromDriverValue(e){return JSON.parse(e)}mapToDriverValue(e){return JSON.stringify(e)}}function H(t,e={}){const{name:n,config:r}=D(t,e);return r.mode==="json"?new yt(n):new ht(n,r)}function St(){return{blob:Ge,customType:Ye,integer:G,numeric:ft,real:pt,text:H}}const E=Symbol.for("drizzle:SQLiteInlineForeignKeys");class K extends d{static[i]="SQLiteTable";static Symbol=Object.assign({},d.Symbol,{InlineForeignKeys:E});[d.Symbol.Columns];[E]=[];[d.Symbol.ExtraConfigBuilder]=void 0}function wt(t,e,n,r,a=t){const o=new K(t,r,a),h=typeof e=="function"?e(St()):e,m=Object.fromEntries(Object.entries(h).map(([y,s])=>{const f=s;f.setName(y);const g=f.build(o);return o[E].push(...f.buildForeignKeys(g,o)),[y,g]})),p=Object.assign(o,m);return p[d.Symbol.Columns]=m,p[d.Symbol.ExtraConfigColumns]=m,n&&(p[K.Symbol.ExtraConfigBuilder]=n),p}const Qt=(t,e,n)=>wt(t,e,n);class X{constructor(e,n){this.name=e,this.unique=n}static[i]="SQLiteIndexBuilderOn";on(...e){return new vt(this.name,e,this.unique)}}class vt{static[i]="SQLiteIndexBuilder";config;constructor(e,n,r){this.config={name:e,columns:n,unique:r,where:void 0}}where(e){return this.config.where=e,this}build(e){return new Lt(this.config,e)}}class Lt{static[i]="SQLiteIndex";config;constructor(e,n){this.config={...e,table:n}}}function Bt(t){return new X(t,!1)}function Nt(t){return new X(t,!0)}export{Ce as A,B,v as C,I as D,K as E,A as F,P as G,w as H,he as I,ge as J,me as K,pe as L,de as M,z as N,le as O,T as P,fe as Q,Qt as R,c as S,d as T,G as U,N as V,re as W,H as X,Bt as Y,Nt as Z,Ve as a,Se as b,i as c,Ae as d,ye as e,Pe as f,ee as g,Oe as h,u as i,Fe as j,Ie as k,Be as l,Qe as m,qe as n,we as o,be as p,Ne as q,ze as r,l as s,De as t,xe as u,Te as v,je as w,Le as x,ve as y,$e as z};
|