@corsair-dev/witai 0.1.0

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.
Files changed (41) hide show
  1. package/LICENSE +191 -0
  2. package/dist/client.d.ts +12 -0
  3. package/dist/client.d.ts.map +1 -0
  4. package/dist/endpoints/apps.d.ts +9 -0
  5. package/dist/endpoints/apps.d.ts.map +1 -0
  6. package/dist/endpoints/entities.d.ts +11 -0
  7. package/dist/endpoints/entities.d.ts.map +1 -0
  8. package/dist/endpoints/index.d.ts +8 -0
  9. package/dist/endpoints/index.d.ts.map +1 -0
  10. package/dist/endpoints/intents.d.ts +6 -0
  11. package/dist/endpoints/intents.d.ts.map +1 -0
  12. package/dist/endpoints/message.d.ts +4 -0
  13. package/dist/endpoints/message.d.ts.map +1 -0
  14. package/dist/endpoints/traits.d.ts +7 -0
  15. package/dist/endpoints/traits.d.ts.map +1 -0
  16. package/dist/endpoints/types.d.ts +1221 -0
  17. package/dist/endpoints/types.d.ts.map +1 -0
  18. package/dist/endpoints/utterances.d.ts +5 -0
  19. package/dist/endpoints/utterances.d.ts.map +1 -0
  20. package/dist/endpoints/voices.d.ts +4 -0
  21. package/dist/endpoints/voices.d.ts.map +1 -0
  22. package/dist/endpoints.test.d.ts +2 -0
  23. package/dist/endpoints.test.d.ts.map +1 -0
  24. package/dist/error-handlers.d.ts +48 -0
  25. package/dist/error-handlers.d.ts.map +1 -0
  26. package/dist/index.d.ts +110 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +1 -0
  29. package/dist/schema/database.d.ts +223 -0
  30. package/dist/schema/database.d.ts.map +1 -0
  31. package/dist/schema/index.d.ts +101 -0
  32. package/dist/schema/index.d.ts.map +1 -0
  33. package/dist/schema.test.d.ts +2 -0
  34. package/dist/schema.test.d.ts.map +1 -0
  35. package/dist/tsup.config.d.ts +3 -0
  36. package/dist/tsup.config.d.ts.map +1 -0
  37. package/dist/webhooks/index.d.ts +1 -0
  38. package/dist/webhooks/index.d.ts.map +1 -0
  39. package/dist/webhooks/types.d.ts +1 -0
  40. package/dist/webhooks/types.d.ts.map +1 -0
  41. package/package.json +44 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../endpoints/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,eAAe;;;kCAKL,CAAC;AAExB,eAAO,MAAM,kBAAkB;;;kCAKR,CAAC;AAExB,eAAO,MAAM,oBAAoB;;;;;;;;;;;kCAaV,CAAC;AAExB,eAAO,MAAM,qBAAqB;;;kCAKX,CAAC;AAExB,eAAO,MAAM,mBAAmB;;;;kCAMT,CAAC;AAExB,eAAO,MAAM,oBAAoB;;;;kCAMV,CAAC;AAExB,eAAO,MAAM,cAAc;;;;;;;;;;;;;kCAeJ,CAAC;AAExB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;kCAQP,CAAC;AAExB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;kCAMP,CAAC;AAExB,eAAO,MAAM,gBAAgB;;;;;;;kCAMN,CAAC;AAExB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;kCAWV,CAAC;AAExB,eAAO,MAAM,qBAAqB;;;;kCAMX,CAAC;AAExB,eAAO,MAAM,gBAAgB;;;;;;;;;;kCAQN,CAAC;AAExB,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;kCAOhB,CAAC;AAExB,eAAO,MAAM,cAAc;;;;;;kCAQJ,CAAC;AAExB,eAAO,MAAM,kBAAkB;;;;;kCAOR,CAAC;AAExB,eAAO,MAAM,yBAAyB;;;kCAKf,CAAC;AAKxB,QAAA,MAAM,mBAAmB;;;iBASvB,CAAC;AAEH,QAAA,MAAM,iBAAiB;;iBAErB,CAAC;AAEH,QAAA,MAAM,oBAAoB;;;;;;iBAYxB,CAAC;AAEH,QAAA,MAAM,oBAAoB;;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AK,CAAC,OAAO,sBAAsB,CAAC,CAAC;IACzD,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;CACrD,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiC5B,CAAC;AAEX,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiC7B,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { WitAiEndpoints } from '..';
2
+ export declare const listUtterances: WitAiEndpoints['utterancesListUtterances'];
3
+ export declare const createUtterances: WitAiEndpoints['utterancesCreateUtterances'];
4
+ export declare const deleteUtterances: WitAiEndpoints['utterancesDeleteUtterances'];
5
+ //# sourceMappingURL=utterances.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utterances.d.ts","sourceRoot":"","sources":["../../endpoints/utterances.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAIzC,eAAO,MAAM,cAAc,EAAE,cAAc,CAAC,0BAA0B,CAmBpE,CAAC;AAEH,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,4BAA4B,CAqBxE,CAAC;AAEH,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,4BAA4B,CAkBxE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { WitAiEndpoints } from '..';
2
+ export declare const listVoices: WitAiEndpoints['voicesListVoices'];
3
+ export declare const getVoice: WitAiEndpoints['voicesGetVoice'];
4
+ //# sourceMappingURL=voices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voices.d.ts","sourceRoot":"","sources":["../../endpoints/voices.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAIzC,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,kBAAkB,CASzD,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,cAAc,CAAC,gBAAgB,CAgBrD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=endpoints.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoints.test.d.ts","sourceRoot":"","sources":["../endpoints.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,48 @@
1
+ export declare const errorHandlers: {
2
+ RATE_LIMIT_ERROR: {
3
+ match: (error: Error) => boolean;
4
+ handler: (error: Error) => Promise<{
5
+ maxRetries: number;
6
+ retryStrategy: "exponential_backoff_jitter";
7
+ headersRetryAfterMs: number | undefined;
8
+ }>;
9
+ };
10
+ AUTH_ERROR: {
11
+ match: (error: Error) => boolean;
12
+ handler: () => Promise<{
13
+ maxRetries: number;
14
+ }>;
15
+ };
16
+ PERMISSION_ERROR: {
17
+ match: (error: Error) => boolean;
18
+ handler: () => Promise<{
19
+ maxRetries: number;
20
+ }>;
21
+ };
22
+ NOT_FOUND_ERROR: {
23
+ match: (error: Error) => boolean;
24
+ handler: () => Promise<{
25
+ maxRetries: number;
26
+ }>;
27
+ };
28
+ BAD_REQUEST_ERROR: {
29
+ match: (error: Error) => boolean;
30
+ handler: () => Promise<{
31
+ maxRetries: number;
32
+ }>;
33
+ };
34
+ SERVER_ERROR: {
35
+ match: (error: Error) => boolean;
36
+ handler: () => Promise<{
37
+ maxRetries: number;
38
+ retryStrategy: "exponential_backoff";
39
+ }>;
40
+ };
41
+ DEFAULT: {
42
+ match: () => true;
43
+ handler: () => Promise<{
44
+ maxRetries: number;
45
+ }>;
46
+ };
47
+ };
48
+ //# sourceMappingURL=error-handlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-handlers.d.ts","sourceRoot":"","sources":["../error-handlers.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,aAAa;;uBAET,KAAK;yBAWG,KAAK;;;;;;;uBAOb,KAAK;;;;;;uBAeL,KAAK;;;;;;uBAQL,KAAK;;;;;;uBAYL,KAAK;;;;;;uBAaL,KAAK;;;;;;;;;;;;CAeS,CAAC"}
@@ -0,0 +1,110 @@
1
+ import type { AuthTypes, BindEndpoints, CorsairEndpoint, CorsairErrorHandler, CorsairPlugin, CorsairPluginContext, KeyBuilderContext, PickAuth, PluginPermissionsConfig, RequiredPluginEndpointSchemas } from 'corsair/core';
2
+ import type { WitAiEndpointInputs, WitAiEndpointOutputs } from './endpoints/types';
3
+ import { WitAiSchema } from './schema';
4
+ export type WitAiPluginOptions = {
5
+ authType?: PickAuth<'api_key'>;
6
+ key?: string;
7
+ hooks?: InternalWitAiPlugin['hooks'];
8
+ errorHandlers?: CorsairErrorHandler;
9
+ permissions?: PluginPermissionsConfig<typeof witAiEndpointsNested>;
10
+ };
11
+ export type WitAiContext = CorsairPluginContext<typeof WitAiSchema, WitAiPluginOptions>;
12
+ export type WitAiKeyBuilderContext = KeyBuilderContext<WitAiPluginOptions>;
13
+ export type WitAiBoundEndpoints = BindEndpoints<typeof witAiEndpointsNested>;
14
+ type WitAiEndpoint<K extends keyof WitAiEndpointOutputs> = CorsairEndpoint<WitAiContext, WitAiEndpointInputs[K], WitAiEndpointOutputs[K]>;
15
+ export type WitAiEndpoints = {
16
+ appsListApps: WitAiEndpoint<'appsListApps'>;
17
+ appsGetApp: WitAiEndpoint<'appsGetApp'>;
18
+ appsCreateApp: WitAiEndpoint<'appsCreateApp'>;
19
+ appsUpdateApp: WitAiEndpoint<'appsUpdateApp'>;
20
+ appsDeleteApp: WitAiEndpoint<'appsDeleteApp'>;
21
+ appsExportApp: WitAiEndpoint<'appsExportApp'>;
22
+ appsListTags: WitAiEndpoint<'appsListTags'>;
23
+ messageGetMessage: WitAiEndpoint<'messageGetMessage'>;
24
+ messageDetectLanguage: WitAiEndpoint<'messageDetectLanguage'>;
25
+ intentsListIntents: WitAiEndpoint<'intentsListIntents'>;
26
+ intentsGetIntent: WitAiEndpoint<'intentsGetIntent'>;
27
+ intentsCreateIntent: WitAiEndpoint<'intentsCreateIntent'>;
28
+ intentsDeleteIntent: WitAiEndpoint<'intentsDeleteIntent'>;
29
+ entitiesListEntities: WitAiEndpoint<'entitiesListEntities'>;
30
+ entitiesGetEntity: WitAiEndpoint<'entitiesGetEntity'>;
31
+ entitiesCreateEntity: WitAiEndpoint<'entitiesCreateEntity'>;
32
+ entitiesDeleteEntity: WitAiEndpoint<'entitiesDeleteEntity'>;
33
+ entitiesAddKeyword: WitAiEndpoint<'entitiesAddKeyword'>;
34
+ entitiesDeleteKeyword: WitAiEndpoint<'entitiesDeleteKeyword'>;
35
+ entitiesAddSynonym: WitAiEndpoint<'entitiesAddSynonym'>;
36
+ entitiesDeleteSynonym: WitAiEndpoint<'entitiesDeleteSynonym'>;
37
+ entitiesDeleteRole: WitAiEndpoint<'entitiesDeleteRole'>;
38
+ traitsListTraits: WitAiEndpoint<'traitsListTraits'>;
39
+ traitsGetTrait: WitAiEndpoint<'traitsGetTrait'>;
40
+ traitsCreateTrait: WitAiEndpoint<'traitsCreateTrait'>;
41
+ traitsDeleteTrait: WitAiEndpoint<'traitsDeleteTrait'>;
42
+ traitsAddValue: WitAiEndpoint<'traitsAddValue'>;
43
+ utterancesListUtterances: WitAiEndpoint<'utterancesListUtterances'>;
44
+ utterancesCreateUtterances: WitAiEndpoint<'utterancesCreateUtterances'>;
45
+ utterancesDeleteUtterances: WitAiEndpoint<'utterancesDeleteUtterances'>;
46
+ voicesListVoices: WitAiEndpoint<'voicesListVoices'>;
47
+ voicesGetVoice: WitAiEndpoint<'voicesGetVoice'>;
48
+ };
49
+ declare const witAiEndpointsNested: {
50
+ readonly apps: {
51
+ readonly listApps: WitAiEndpoint<"appsListApps">;
52
+ readonly getApp: WitAiEndpoint<"appsGetApp">;
53
+ readonly createApp: WitAiEndpoint<"appsCreateApp">;
54
+ readonly updateApp: WitAiEndpoint<"appsUpdateApp">;
55
+ readonly deleteApp: WitAiEndpoint<"appsDeleteApp">;
56
+ readonly exportApp: WitAiEndpoint<"appsExportApp">;
57
+ readonly listTags: WitAiEndpoint<"appsListTags">;
58
+ };
59
+ readonly message: {
60
+ readonly getMessage: WitAiEndpoint<"messageGetMessage">;
61
+ readonly detectLanguage: WitAiEndpoint<"messageDetectLanguage">;
62
+ };
63
+ readonly intents: {
64
+ readonly listIntents: WitAiEndpoint<"intentsListIntents">;
65
+ readonly getIntent: WitAiEndpoint<"intentsGetIntent">;
66
+ readonly createIntent: WitAiEndpoint<"intentsCreateIntent">;
67
+ readonly deleteIntent: WitAiEndpoint<"intentsDeleteIntent">;
68
+ };
69
+ readonly entities: {
70
+ readonly listEntities: WitAiEndpoint<"entitiesListEntities">;
71
+ readonly getEntity: WitAiEndpoint<"entitiesGetEntity">;
72
+ readonly createEntity: WitAiEndpoint<"entitiesCreateEntity">;
73
+ readonly deleteEntity: WitAiEndpoint<"entitiesDeleteEntity">;
74
+ readonly addKeyword: WitAiEndpoint<"entitiesAddKeyword">;
75
+ readonly deleteKeyword: WitAiEndpoint<"entitiesDeleteKeyword">;
76
+ readonly addSynonym: WitAiEndpoint<"entitiesAddSynonym">;
77
+ readonly deleteSynonym: WitAiEndpoint<"entitiesDeleteSynonym">;
78
+ readonly deleteRole: WitAiEndpoint<"entitiesDeleteRole">;
79
+ };
80
+ readonly traits: {
81
+ readonly listTraits: WitAiEndpoint<"traitsListTraits">;
82
+ readonly getTrait: WitAiEndpoint<"traitsGetTrait">;
83
+ readonly createTrait: WitAiEndpoint<"traitsCreateTrait">;
84
+ readonly deleteTrait: WitAiEndpoint<"traitsDeleteTrait">;
85
+ readonly addValue: WitAiEndpoint<"traitsAddValue">;
86
+ };
87
+ readonly utterances: {
88
+ readonly listUtterances: WitAiEndpoint<"utterancesListUtterances">;
89
+ readonly createUtterances: WitAiEndpoint<"utterancesCreateUtterances">;
90
+ readonly deleteUtterances: WitAiEndpoint<"utterancesDeleteUtterances">;
91
+ };
92
+ readonly voices: {
93
+ readonly listVoices: WitAiEndpoint<"voicesListVoices">;
94
+ readonly getVoice: WitAiEndpoint<"voicesGetVoice">;
95
+ };
96
+ };
97
+ type WitAiEndpointSchemas = RequiredPluginEndpointSchemas<typeof witAiEndpointsNested>;
98
+ export declare const witAiEndpointSchemas: WitAiEndpointSchemas;
99
+ declare const defaultAuthType: AuthTypes;
100
+ export declare const witAiAuthConfig: {
101
+ readonly api_key: {
102
+ readonly account: readonly ["tenant_external_id"];
103
+ };
104
+ };
105
+ export type BaseWitAiPlugin<T extends WitAiPluginOptions> = CorsairPlugin<'witai', typeof WitAiSchema, typeof witAiEndpointsNested, Record<string, never>, T, typeof defaultAuthType>;
106
+ export type InternalWitAiPlugin = BaseWitAiPlugin<WitAiPluginOptions>;
107
+ export type ExternalWitAiPlugin<T extends WitAiPluginOptions> = BaseWitAiPlugin<T>;
108
+ export declare function witai<const T extends WitAiPluginOptions>(incomingOptions?: WitAiPluginOptions & T): ExternalWitAiPlugin<T>;
109
+ export type { WitAiEndpointInputs, WitAiEndpointOutputs, } from './endpoints/types';
110
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,SAAS,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,4BAA4B,CAAC,CAAC;IACxE,0BAA0B,EAAE,aAAa,CAAC,4BAA4B,CAAC,CAAC;IAExE,gBAAgB,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;IACpD,cAAc,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CAChD,CAAC;AAEF,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+ChB,CAAC;AAEX,KAAK,oBAAoB,GAAG,6BAA6B,CACxD,OAAO,oBAAoB,CAC3B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,oBAiIlC,CAAC;AAEF,QAAA,MAAM,eAAe,EAAE,SAA8B,CAAC;AAsItD,eAAO,MAAM,eAAe;;;;CAIS,CAAC;AAEtC,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,kBAAkB,IAAI,aAAa,CACxE,OAAO,EACP,OAAO,WAAW,EAClB,OAAO,oBAAoB,EAC3B,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EACrB,CAAC,EACD,OAAO,eAAe,CACtB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC,kBAAkB,CAAC,CAAC;AAEtE,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,kBAAkB,IAC3D,eAAe,CAAC,CAAC,CAAC,CAAC;AAEpB,wBAAgB,KAAK,CAAC,KAAK,CAAC,CAAC,SAAS,kBAAkB,EACvD,eAAe,GAAE,kBAAkB,GAAG,CAAgC,GACpE,mBAAmB,CAAC,CAAC,CAAC,CAqCxB;AAED,YAAY,EACX,mBAAmB,EACnB,oBAAoB,GACpB,MAAM,mBAAmB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ var X=Object.defineProperty;var E=(e,i)=>{for(var s in i)X(e,s,{get:i[s],enumerable:!0})};var l={};E(l,{createApp:()=>ot,deleteApp:()=>pt,exportApp:()=>ct,getApp:()=>at,listApps:()=>st,listTags:()=>dt,updateApp:()=>rt});import{logEventFromContext as h}from"corsair/core";import{ApiError as Y,request as tt}from"corsair/http";var f=class extends Error{constructor(s,a,c,d){super(s);this.code=a;this.status=c;this.retryAfter=d;this.name="WitAiAPIError"}},et="https://api.wit.ai",it="20240304",nt={enabled:!0,maxRetries:3,initialRetryDelay:1e3,backoffMultiplier:2,headerNames:{retryAfter:"Retry-After"}};async function o(e,i,s={}){let{method:a="GET",body:c,query:d}=s,T={BASE:et,VERSION:"1.0.0",WITH_CREDENTIALS:!1,CREDENTIALS:"omit",HEADERS:{"Content-Type":"application/json",Authorization:`Bearer ${i}`}},Q={v:it,...d},Z={method:a,url:e,body:a==="POST"||a==="PUT"||a==="PATCH"||a==="DELETE"?c:void 0,mediaType:"application/json; charset=utf-8",query:Q};try{return await tt(T,Z,{rateLimitConfig:nt})}catch(D){throw D instanceof Y?D:D instanceof Error?new f(D.message):new f("Unknown error")}}var st=async(e,i)=>{let s=await o("apps",e.key,{method:"GET",query:{limit:i.limit,offset:i.offset}});return await h(e,"witai.apps.listApps",{},"completed"),s},at=async(e,i)=>{let s=await o(`apps/${i.app_id}`,e.key,{method:"GET"});return await h(e,"witai.apps.getApp",{app_id:i.app_id},"completed"),s},ot=async(e,i)=>{let{private:s,...a}=i,c={...a,...s!==void 0?{private:typeof s=="boolean"?s?"true":"false":s}:{}},d=await o("apps",e.key,{method:"POST",body:c});return await h(e,"witai.apps.createApp",{name:i.name},"completed"),d},rt=async(e,i)=>{let{app_id:s,private:a,...c}=i,d={...c,...a!==void 0?{private:typeof a=="boolean"?a?"true":"false":a}:{}},T=await o(`apps/${s}`,e.key,{method:"PUT",body:d});return await h(e,"witai.apps.updateApp",{app_id:s},"completed"),T},pt=async(e,i)=>{let s=await o(`apps/${i.app_id}`,e.key,{method:"DELETE"});return await h(e,"witai.apps.deleteApp",{app_id:i.app_id},"completed"),s},ct=async(e,i)=>{let s=await o(`apps/${i.app_id}/export`,e.key,{method:"GET"});return await h(e,"witai.apps.exportApp",{app_id:i.app_id},"completed"),s},dt=async(e,i)=>{let s=await o(`apps/${i.app_id}/tags`,e.key,{method:"GET"});return await h(e,"witai.apps.listTags",{app_id:i.app_id},"completed"),s};var u={};E(u,{addKeyword:()=>At,addSynonym:()=>Et,createEntity:()=>yt,deleteEntity:()=>mt,deleteKeyword:()=>gt,deleteRole:()=>ht,deleteSynonym:()=>ft,getEntity:()=>lt,listEntities:()=>ut});import{logEventFromContext as y}from"corsair/core";var ut=async(e,i)=>{let s=await o("entities",e.key,{method:"GET"});return await y(e,"witai.entities.listEntities",{},"completed"),s},lt=async(e,i)=>{let s=await o(`entities/${i.entity}`,e.key,{method:"GET"});return await y(e,"witai.entities.getEntity",{entity:i.entity},"completed"),s},yt=async(e,i)=>{let{name:s,roles:a,lookups:c}=i,d={name:s,...a!==void 0?{roles:a}:{},...c!==void 0?{lookups:c}:{}},T=await o("entities",e.key,{method:"POST",body:d});return await y(e,"witai.entities.createEntity",{name:s},"completed"),T},mt=async(e,i)=>{let s=await o(`entities/${i.entity}`,e.key,{method:"DELETE"});return await y(e,"witai.entities.deleteEntity",{entity:i.entity},"completed"),s},At=async(e,i)=>{let{entity:s,keyword:a,synonyms:c}=i,d=await o(`entities/${s}/keywords`,e.key,{method:"POST",body:{keyword:a,synonyms:c}});return await y(e,"witai.entities.addKeyword",{entity:s,keyword:a},"completed"),d},gt=async(e,i)=>{let{entity:s,keyword:a}=i,c=await o(`entities/${s}/keywords/${a}`,e.key,{method:"DELETE"});return await y(e,"witai.entities.deleteKeyword",{entity:s,keyword:a},"completed"),c},Et=async(e,i)=>{let{entity:s,keyword:a,synonym:c}=i,d=await o(`entities/${s}/keywords/${a}/synonyms`,e.key,{method:"POST",body:{synonym:c}});return await y(e,"witai.entities.addSynonym",{entity:s,keyword:a,synonym:c},"completed"),d},ft=async(e,i)=>{let{entity:s,keyword:a,synonym:c}=i,d=await o(`entities/${s}/keywords/${a}/synonyms/${c}`,e.key,{method:"DELETE"});return await y(e,"witai.entities.deleteSynonym",{entity:s,keyword:a,synonym:c},"completed"),d},ht=async(e,i)=>{let{entity:s,role:a}=i,c=await o(`entities/${s}:${a}`,e.key,{method:"DELETE"});return await y(e,"witai.entities.deleteRole",{entity:s,role:a},"completed"),c};var w={};E(w,{createIntent:()=>St,deleteIntent:()=>bt,getIntent:()=>Wt,listIntents:()=>wt});import{logEventFromContext as x}from"corsair/core";var wt=async(e,i)=>{let s=await o("intents",e.key,{method:"GET"});return await x(e,"witai.intents.listIntents",{},"completed"),s},Wt=async(e,i)=>{let s=await o(`intents/${i.intent}`,e.key,{method:"GET"});return await x(e,"witai.intents.getIntent",{intent:i.intent},"completed"),s},St=async(e,i)=>{let s=await o("intents",e.key,{method:"POST",body:{name:i.name}});return await x(e,"witai.intents.createIntent",{name:i.name},"completed"),s},bt=async(e,i)=>{let s=await o(`intents/${i.intent}`,e.key,{method:"DELETE"});return await x(e,"witai.intents.deleteIntent",{intent:i.intent},"completed"),s};var I={};E(I,{detectLanguage:()=>It,getMessage:()=>Tt});import{logEventFromContext as G}from"corsair/core";var Tt=async(e,i)=>{let s=await o("message",e.key,{method:"GET",query:{q:i.q,n:i.n,tag:i.tag,context:i.context}});return await G(e,"witai.message.getMessage",{text:i.q},"completed"),s},It=async(e,i)=>{let s=await o("language",e.key,{method:"GET",query:{q:i.q,n:i.n}});return await G(e,"witai.message.detectLanguage",{text:i.q},"completed"),s};var A={};E(A,{addValue:()=>Ot,createTrait:()=>Dt,deleteTrait:()=>xt,getTrait:()=>kt,listTraits:()=>Lt});import{logEventFromContext as L}from"corsair/core";var Lt=async(e,i)=>{let s=await o("traits",e.key,{method:"GET"});return await L(e,"witai.traits.listTraits",{},"completed"),s},kt=async(e,i)=>{let s=await o(`traits/${i.trait}`,e.key,{method:"GET"});return await L(e,"witai.traits.getTrait",{trait:i.trait},"completed"),s},Dt=async(e,i)=>{let{name:s,values:a}=i,c={name:s,...a!==void 0?{values:a}:{}},d=await o("traits",e.key,{method:"POST",body:c});return await L(e,"witai.traits.createTrait",{name:s},"completed"),d},xt=async(e,i)=>{let s=await o(`traits/${i.trait}`,e.key,{method:"DELETE"});return await L(e,"witai.traits.deleteTrait",{trait:i.trait},"completed"),s},Ot=async(e,i)=>{let{trait:s,value:a}=i,c=await o(`traits/${s}/values`,e.key,{method:"POST",body:{value:a}});return await L(e,"witai.traits.addValue",{trait:s,value:a},"completed"),c};var W={};E(W,{createUtterances:()=>Ct,deleteUtterances:()=>Rt,listUtterances:()=>vt});import{logEventFromContext as v}from"corsair/core";var vt=async(e,i)=>{let s=await o("utterances",e.key,{method:"GET",query:{limit:i.limit,offset:i.offset,intent_id:i.intent_id}});return await v(e,"witai.utterances.listUtterances",{},"completed"),s},Ct=async(e,i)=>{let s=i.utterances.map(c=>({text:c.text,...c.intent!==void 0?{intent:c.intent}:{},entities:c.entities??[],traits:c.traits??[]})),a=await o("utterances",e.key,{method:"POST",body:s});return await v(e,"witai.utterances.createUtterances",{count:i.utterances.length},"completed"),a},Rt=async(e,i)=>{let s=await o("utterances",e.key,{method:"DELETE",body:i.texts.map(a=>({text:a}))});return await v(e,"witai.utterances.deleteUtterances",{count:i.texts.length},"completed"),s};var k={};E(k,{getVoice:()=>Ut,listVoices:()=>Gt});import{logEventFromContext as U}from"corsair/core";var Gt=async(e,i)=>{let s=await o("voices",e.key,{method:"GET"});return await U(e,"witai.voices.listVoices",{},"completed"),s},Ut=async(e,i)=>{let s=await o(`voices/${i.voice}`,e.key,{method:"GET"});return await U(e,"witai.voices.getVoice",{voice:i.voice},"completed"),s};import{z as t}from"zod";var zt=t.object({id:t.string().optional(),name:t.string()}).catchall(t.unknown()),_t=t.object({keyword:t.string(),synonyms:t.array(t.string()).optional()}).catchall(t.unknown()),C=t.object({id:t.string().optional(),name:t.string().optional(),role:t.string().optional(),start:t.number().optional(),end:t.number().optional(),body:t.string().optional(),confidence:t.number().optional(),entities:t.array(t.unknown()).optional(),value:t.unknown().optional(),type:t.string().optional()}).catchall(t.unknown()),Vt=t.object({id:t.string().optional(),value:t.string()}).catchall(t.unknown()),z=t.object({id:t.string().optional(),value:t.string(),confidence:t.number().optional()}).catchall(t.unknown()),jt=t.object({id:t.string().optional(),name:t.string(),confidence:t.number().optional()}).catchall(t.unknown()),_=t.object({id:t.string(),name:t.string(),lang:t.string().optional(),private:t.union([t.boolean(),t.string()]).optional(),timezone:t.string().optional(),desc:t.string().optional(),will_train_at:t.string().nullable().optional(),last_trained_at:t.string().nullable().optional(),last_training_duration_secs:t.number().optional(),training_status:t.string().optional(),created_at:t.string().optional(),updated_at:t.string().optional()}).catchall(t.unknown()),g=t.object({id:t.string(),name:t.string(),roles:t.array(zt).optional(),lookups:t.array(t.string()).optional(),keywords:t.array(_t).optional()}).catchall(t.unknown()),R=t.object({id:t.string(),name:t.string(),entities:t.array(C).optional()}).catchall(t.unknown()),O=t.object({id:t.string(),name:t.string(),values:t.array(Vt).optional()}).catchall(t.unknown()),Kt=t.object({id:t.string().optional(),text:t.string(),intent:t.object({id:t.string().optional(),name:t.string()}).nullable().optional(),entities:t.array(C).optional(),traits:t.array(z).optional()}).catchall(t.unknown()),Pt=t.object({name:t.string(),speed:t.array(t.string()).optional(),pitch:t.array(t.string()).optional()}).catchall(t.unknown()),V=t.object({name:t.string(),locale:t.string().optional(),gender:t.string().optional(),styles:t.array(Pt).optional(),supported_features:t.array(t.string()).optional()}).catchall(t.unknown()),Mt=t.object({text:t.string(),intents:t.array(jt).optional(),entities:t.record(t.string(),t.array(C)).optional(),traits:t.record(t.string(),t.array(z)).optional()}).catchall(t.unknown()),qt=t.object({id:t.string(),name:t.string(),desc:t.string().nullable().optional(),created_at:t.string().optional(),updated_at:t.string().optional()}).catchall(t.unknown()),m=t.object({sent:t.boolean().optional(),n:t.number().optional(),deleted:t.union([t.string(),t.number()]).optional(),success:t.boolean().optional()}).catchall(t.unknown()),$t=t.object({locale:t.string(),confidence:t.number().optional()}).catchall(t.unknown()),Nt=t.object({limit:t.number().int().min(1).max(1e4).optional().describe("Max apps to return (default 100)"),offset:t.number().int().optional().describe("Pagination offset")}),Bt=t.object({app_id:t.string().describe("The Wit.ai app ID")}),Ht=t.object({name:t.string().describe("Name of the app"),lang:t.string().describe('Language code, e.g. "en"'),private:t.union([t.boolean(),t.string()]).optional().describe("Whether the app is private"),timezone:t.string().optional().describe('Timezone, e.g. "America/Los_Angeles"'),desc:t.string().optional().describe("Description of the app")}),Ft=t.object({app_id:t.string().describe("The Wit.ai app ID to update"),name:t.string().optional().describe("New name"),lang:t.string().optional().describe("Language code"),private:t.union([t.boolean(),t.string()]).optional().describe("Whether the app is private"),timezone:t.string().optional().describe("Timezone"),desc:t.string().optional().describe("Description")}),Jt=t.object({app_id:t.string().describe("The Wit.ai app ID to delete")}),Qt=t.object({app_id:t.string().describe("The Wit.ai app ID to export")}),Zt=t.object({app_id:t.string().describe("The Wit.ai app ID")}),Xt=t.object({q:t.string().describe("Text to analyze for intents, entities, and traits"),n:t.number().int().optional().describe("Max number of n-best intents/traits to return"),tag:t.string().optional().describe("App version tag to use"),context:t.string().optional().describe("JSON context object (location, reference_time, etc.)")}),Yt=t.object({q:t.string().describe("Text whose language should be detected"),n:t.number().int().optional().describe("Number of locales to return")}),te=t.object({}),ee=t.object({intent:t.string().describe("Intent name or ID")}),ie=t.object({name:t.string().describe("Name of the new intent")}),ne=t.object({intent:t.string().describe("Intent name to delete")}),se=t.object({}),ae=t.object({entity:t.string().describe("Entity name or ID")}),oe=t.object({name:t.string().describe("Name of the new entity"),roles:t.array(t.string()).optional().describe("Optional role names for the entity"),lookups:t.array(t.string()).optional().describe("Optional lookup strategies (e.g. keywords, free-text)")}),re=t.object({entity:t.string().describe("Entity name to delete")}),pe=t.object({entity:t.string().describe("Entity name"),keyword:t.string().describe("Keyword to add"),synonyms:t.array(t.string()).optional().describe("Optional synonyms for the keyword")}),ce=t.object({entity:t.string().describe("Entity name"),keyword:t.string().describe("Keyword to delete")}),de=t.object({entity:t.string().describe("Entity name"),keyword:t.string().describe("Keyword to add synonym to"),synonym:t.string().describe("Synonym to add")}),ue=t.object({entity:t.string().describe("Entity name"),keyword:t.string().describe("Keyword name"),synonym:t.string().describe("Synonym to delete")}),le=t.object({entity:t.string().describe("Entity name"),role:t.string().describe("Role name to delete")}),ye=t.object({}),me=t.object({trait:t.string().describe("Trait name or ID")}),Ae=t.object({name:t.string().describe("Name of the new trait"),values:t.array(t.string()).optional().describe("Initial values for the trait")}),ge=t.object({trait:t.string().describe("Trait name to delete")}),Ee=t.object({trait:t.string().describe("Trait name"),value:t.string().describe("Value to add")}),fe=t.object({limit:t.number().int().optional().describe("Max utterances to return"),offset:t.number().int().optional().describe("Pagination offset"),intent_id:t.string().optional().describe("Filter by intent ID")}),he=t.object({utterances:t.array(t.object({text:t.string().describe("The utterance text"),intent:t.string().optional().describe("Intent name for this utterance"),entities:t.array(t.object({entity:t.string(),start:t.number().int(),end:t.number().int(),body:t.string(),entities:t.array(t.unknown()).optional()})).optional(),traits:t.array(t.object({trait:t.string(),value:t.string()})).optional()})).describe("Utterances to add (rate limit: 200 samples/min)")}),we=t.object({texts:t.array(t.string()).describe("Utterance texts to delete")}),We=t.object({}),Se=t.object({voice:t.string().describe("Voice name to retrieve details for")}),be=t.array(_),Te=_,Ie=t.object({app_id:t.string(),access_token:t.string().optional()}).catchall(t.unknown()),Le=m,ke=t.object({app_id:t.string().optional(),success:t.boolean().optional()}).catchall(t.unknown()),De=t.object({uri:t.string().optional()}).catchall(t.unknown()),xe=t.array(qt),Oe=Mt,ve=t.object({detected_locales:t.array($t)}).catchall(t.unknown()),Ce=t.array(R),Re=R,Ge=R,Ue=m,ze=t.array(g),_e=g,Ve=g,je=m,Ke=g,Pe=m.or(g),Me=g,qe=m.or(g),$e=m.or(g),Ne=t.array(O),Be=O,He=O,Fe=m,Je=O,Qe=t.array(Kt),Ze=m,Xe=m,Ye=t.record(t.string(),t.array(V)),ti=V,r={appsListApps:Nt,appsGetApp:Bt,appsCreateApp:Ht,appsUpdateApp:Ft,appsDeleteApp:Jt,appsExportApp:Qt,appsListTags:Zt,messageGetMessage:Xt,messageDetectLanguage:Yt,intentsListIntents:te,intentsGetIntent:ee,intentsCreateIntent:ie,intentsDeleteIntent:ne,entitiesListEntities:se,entitiesGetEntity:ae,entitiesCreateEntity:oe,entitiesDeleteEntity:re,entitiesAddKeyword:pe,entitiesDeleteKeyword:ce,entitiesAddSynonym:de,entitiesDeleteSynonym:ue,entitiesDeleteRole:le,traitsListTraits:ye,traitsGetTrait:me,traitsCreateTrait:Ae,traitsDeleteTrait:ge,traitsAddValue:Ee,utterancesListUtterances:fe,utterancesCreateUtterances:he,utterancesDeleteUtterances:we,voicesListVoices:We,voicesGetVoice:Se},p={appsListApps:be,appsGetApp:Te,appsCreateApp:Ie,appsUpdateApp:Le,appsDeleteApp:ke,appsExportApp:De,appsListTags:xe,messageGetMessage:Oe,messageDetectLanguage:ve,intentsListIntents:Ce,intentsGetIntent:Re,intentsCreateIntent:Ge,intentsDeleteIntent:Ue,entitiesListEntities:ze,entitiesGetEntity:_e,entitiesCreateEntity:Ve,entitiesDeleteEntity:je,entitiesAddKeyword:Ke,entitiesDeleteKeyword:Pe,entitiesAddSynonym:Me,entitiesDeleteSynonym:qe,entitiesDeleteRole:$e,traitsListTraits:Ne,traitsGetTrait:Be,traitsCreateTrait:He,traitsDeleteTrait:Fe,traitsAddValue:Je,utterancesListUtterances:Qe,utterancesCreateUtterances:Ze,utterancesDeleteUtterances:Xe,voicesListVoices:Ye,voicesGetVoice:ti};import{ApiError as j}from"corsair/http";function S(e){if(e instanceof f||e instanceof j)return e.status}function ei(e){if(e instanceof f||e instanceof j)return e.retryAfter}function b(e){return e.message.toLowerCase()}var K={RATE_LIMIT_ERROR:{match:e=>{if(S(e)===429)return!0;let i=b(e);return i.includes("429")||i.includes("rate_limited")||i.includes("rate limit")||i.includes("rate-limit")||i.includes("too many requests")},handler:async e=>({maxRetries:5,retryStrategy:"exponential_backoff_jitter",headersRetryAfterMs:ei(e)})},AUTH_ERROR:{match:e=>{if(S(e)===401)return!0;let i=b(e);return i.includes("unauthorized")||i.includes("401")||i.includes("invalid_auth")||i.includes("access token does not match")||i.includes("authentication")||i.includes("token")},handler:async()=>({maxRetries:0})},PERMISSION_ERROR:{match:e=>{if(S(e)===403)return!0;let i=b(e);return i.includes("permission")||i.includes("forbidden")},handler:async()=>({maxRetries:0})},NOT_FOUND_ERROR:{match:e=>{if(S(e)===404)return!0;let i=b(e);return i.includes("404")||i.includes("not found")||i.includes("unknown path")},handler:async()=>({maxRetries:0})},BAD_REQUEST_ERROR:{match:e=>{if(S(e)===400)return!0;let i=b(e);return i.includes("bad request")||i.includes("invalid")||i.includes("json-parse")||i.includes("bad-request")},handler:async()=>({maxRetries:0})},SERVER_ERROR:{match:e=>{let i=S(e);if(i!==void 0&&i>=500)return!0;let s=b(e);return s.includes("503")||s.includes("server error")},handler:async()=>({maxRetries:2,retryStrategy:"exponential_backoff"})},DEFAULT:{match:()=>!0,handler:async()=>({maxRetries:0})}};import{z as n}from"zod";var ii=n.object({id:n.string().optional(),name:n.string()}).catchall(n.unknown()),ni=n.object({keyword:n.string(),synonyms:n.array(n.string()).optional()}).catchall(n.unknown()),P=n.object({id:n.string().optional(),name:n.string().optional(),role:n.string().optional(),start:n.number().optional(),end:n.number().optional(),body:n.string().optional(),confidence:n.number().optional(),entities:n.array(n.unknown()).optional(),value:n.unknown().optional(),type:n.string().optional()}).catchall(n.unknown()),si=n.object({id:n.string().optional(),value:n.string()}).catchall(n.unknown()),ai=n.object({id:n.string().optional(),value:n.string(),confidence:n.number().optional()}).catchall(n.unknown()),oi=n.object({name:n.string(),speed:n.array(n.string()).optional(),pitch:n.array(n.string()).optional()}).catchall(n.unknown()),M=n.object({id:n.string(),name:n.string(),lang:n.string().optional(),private:n.union([n.boolean(),n.string()]).optional(),timezone:n.string().optional(),desc:n.string().optional(),will_train_at:n.string().nullable().optional(),last_trained_at:n.string().nullable().optional(),last_training_duration_secs:n.number().optional(),training_status:n.string().optional(),created_at:n.string().optional(),updated_at:n.string().optional()}).catchall(n.unknown()),q=n.object({id:n.string(),name:n.string(),entities:n.array(P).optional()}).catchall(n.unknown()),$=n.object({id:n.string(),name:n.string(),roles:n.array(ii).optional(),lookups:n.array(n.string()).optional(),keywords:n.array(ni).optional()}).catchall(n.unknown()),N=n.object({id:n.string(),name:n.string(),values:n.array(si).optional()}).catchall(n.unknown()),B=n.object({id:n.string().optional(),text:n.string(),intent:n.object({id:n.string().optional(),name:n.string()}).nullable().optional(),entities:n.array(P).optional(),traits:n.array(ai).optional()}).catchall(n.unknown()),H=n.object({name:n.string(),locale:n.string().optional(),gender:n.string().optional(),styles:n.array(oi).optional(),supported_features:n.array(n.string()).optional()}).catchall(n.unknown()),F=n.object({id:n.string(),name:n.string(),desc:n.string().nullable().optional(),created_at:n.string().optional(),updated_at:n.string().optional()}).catchall(n.unknown());var J={version:"1.0.0",entities:{apps:M,intents:q,entities:$,traits:N,utterances:B,voices:H,tags:F}};var ri={apps:{listApps:l.listApps,getApp:l.getApp,createApp:l.createApp,updateApp:l.updateApp,deleteApp:l.deleteApp,exportApp:l.exportApp,listTags:l.listTags},message:{getMessage:I.getMessage,detectLanguage:I.detectLanguage},intents:{listIntents:w.listIntents,getIntent:w.getIntent,createIntent:w.createIntent,deleteIntent:w.deleteIntent},entities:{listEntities:u.listEntities,getEntity:u.getEntity,createEntity:u.createEntity,deleteEntity:u.deleteEntity,addKeyword:u.addKeyword,deleteKeyword:u.deleteKeyword,addSynonym:u.addSynonym,deleteSynonym:u.deleteSynonym,deleteRole:u.deleteRole},traits:{listTraits:A.listTraits,getTrait:A.getTrait,createTrait:A.createTrait,deleteTrait:A.deleteTrait,addValue:A.addValue},utterances:{listUtterances:W.listUtterances,createUtterances:W.createUtterances,deleteUtterances:W.deleteUtterances},voices:{listVoices:k.listVoices,getVoice:k.getVoice}},pi={"apps.listApps":{input:r.appsListApps,output:p.appsListApps},"apps.getApp":{input:r.appsGetApp,output:p.appsGetApp},"apps.createApp":{input:r.appsCreateApp,output:p.appsCreateApp},"apps.updateApp":{input:r.appsUpdateApp,output:p.appsUpdateApp},"apps.deleteApp":{input:r.appsDeleteApp,output:p.appsDeleteApp},"apps.exportApp":{input:r.appsExportApp,output:p.appsExportApp},"apps.listTags":{input:r.appsListTags,output:p.appsListTags},"message.getMessage":{input:r.messageGetMessage,output:p.messageGetMessage},"message.detectLanguage":{input:r.messageDetectLanguage,output:p.messageDetectLanguage},"intents.listIntents":{input:r.intentsListIntents,output:p.intentsListIntents},"intents.getIntent":{input:r.intentsGetIntent,output:p.intentsGetIntent},"intents.createIntent":{input:r.intentsCreateIntent,output:p.intentsCreateIntent},"intents.deleteIntent":{input:r.intentsDeleteIntent,output:p.intentsDeleteIntent},"entities.listEntities":{input:r.entitiesListEntities,output:p.entitiesListEntities},"entities.getEntity":{input:r.entitiesGetEntity,output:p.entitiesGetEntity},"entities.createEntity":{input:r.entitiesCreateEntity,output:p.entitiesCreateEntity},"entities.deleteEntity":{input:r.entitiesDeleteEntity,output:p.entitiesDeleteEntity},"entities.addKeyword":{input:r.entitiesAddKeyword,output:p.entitiesAddKeyword},"entities.deleteKeyword":{input:r.entitiesDeleteKeyword,output:p.entitiesDeleteKeyword},"entities.addSynonym":{input:r.entitiesAddSynonym,output:p.entitiesAddSynonym},"entities.deleteSynonym":{input:r.entitiesDeleteSynonym,output:p.entitiesDeleteSynonym},"entities.deleteRole":{input:r.entitiesDeleteRole,output:p.entitiesDeleteRole},"traits.listTraits":{input:r.traitsListTraits,output:p.traitsListTraits},"traits.getTrait":{input:r.traitsGetTrait,output:p.traitsGetTrait},"traits.createTrait":{input:r.traitsCreateTrait,output:p.traitsCreateTrait},"traits.deleteTrait":{input:r.traitsDeleteTrait,output:p.traitsDeleteTrait},"traits.addValue":{input:r.traitsAddValue,output:p.traitsAddValue},"utterances.listUtterances":{input:r.utterancesListUtterances,output:p.utterancesListUtterances},"utterances.createUtterances":{input:r.utterancesCreateUtterances,output:p.utterancesCreateUtterances},"utterances.deleteUtterances":{input:r.utterancesDeleteUtterances,output:p.utterancesDeleteUtterances},"voices.listVoices":{input:r.voicesListVoices,output:p.voicesListVoices},"voices.getVoice":{input:r.voicesGetVoice,output:p.voicesGetVoice}},ci="api_key",di={"apps.listApps":{riskLevel:"read",description:"List all Wit.ai apps for the authenticated user"},"apps.getApp":{riskLevel:"read",description:"Retrieve metadata and settings of a Wit.ai app"},"apps.createApp":{riskLevel:"write",description:"Create a new Wit.ai app"},"apps.updateApp":{riskLevel:"write",description:"Update an existing Wit.ai app"},"apps.deleteApp":{riskLevel:"destructive",description:"Delete a specific Wit.ai app"},"apps.exportApp":{riskLevel:"read",description:"Export Wit.ai app data as a ZIP backup"},"apps.listTags":{riskLevel:"read",description:"List all tag groups (versions) for a Wit.ai app"},"message.getMessage":{riskLevel:"read",description:"Analyze text to extract intents, entities, and traits"},"message.detectLanguage":{riskLevel:"read",description:"Detect the language of a given text input"},"intents.listIntents":{riskLevel:"read",description:"List all intents in the Wit.ai app"},"intents.getIntent":{riskLevel:"read",description:"Retrieve details of a specific intent"},"intents.createIntent":{riskLevel:"write",description:"Create a new intent in Wit.ai"},"intents.deleteIntent":{riskLevel:"destructive",description:"Permanently delete an intent by name"},"entities.listEntities":{riskLevel:"read",description:"List all entities in the Wit.ai app"},"entities.getEntity":{riskLevel:"read",description:"Retrieve details of a specific entity"},"entities.createEntity":{riskLevel:"write",description:"Create a new entity in Wit.ai"},"entities.deleteEntity":{riskLevel:"destructive",description:"Permanently delete an entity by name"},"entities.addKeyword":{riskLevel:"write",description:"Add a keyword with optional synonyms to an entity"},"entities.deleteKeyword":{riskLevel:"destructive",description:"Delete a keyword from an entity"},"entities.addSynonym":{riskLevel:"write",description:"Add a synonym to a keyword in an entity"},"entities.deleteSynonym":{riskLevel:"destructive",description:"Delete a synonym from a keyword in an entity"},"entities.deleteRole":{riskLevel:"destructive",description:"Delete a specific role from an entity"},"traits.listTraits":{riskLevel:"read",description:"List all traits in the Wit.ai app"},"traits.getTrait":{riskLevel:"read",description:"Retrieve details of a specific trait"},"traits.createTrait":{riskLevel:"write",description:"Create a new trait in Wit.ai"},"traits.deleteTrait":{riskLevel:"destructive",description:"Delete a trait by name"},"traits.addValue":{riskLevel:"write",description:"Add a new value to an existing trait"},"utterances.listUtterances":{riskLevel:"read",description:"List training utterances from the Wit.ai app"},"utterances.createUtterances":{riskLevel:"write",description:"Add training utterances to the Wit.ai app (rate limit: 200/min)"},"utterances.deleteUtterances":{riskLevel:"destructive",description:"Delete validated utterances from the Wit.ai app"},"voices.listVoices":{riskLevel:"read",description:"List all available text-to-speech voices grouped by locale"},"voices.getVoice":{riskLevel:"read",description:"Retrieve details for a specific text-to-speech voice"}},ui={api_key:{account:["tenant_external_id"]}};function $i(e={}){let i={...e,authType:e.authType??ci};return{id:"witai",authConfig:ui,schema:J,options:i,hooks:i.hooks,webhookHooks:void 0,endpoints:ri,webhooks:{},endpointMeta:di,endpointSchemas:pi,webhookSchemas:{},pluginWebhookMatcher:void 0,pluginTenantWebhookMatcher:void 0,oauthWebhookTenantLinkResolver:void 0,errorHandlers:{...K,...i.errorHandlers},keyBuilder:async(s,a)=>a==="endpoint"&&i.key?i.key:a==="endpoint"&&s.authType==="api_key"?await s.keys.get_api_key()??"":""}}export{ui as witAiAuthConfig,pi as witAiEndpointSchemas,$i as witai};
@@ -0,0 +1,223 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Wit.ai Database Entities Schema Definitions.
4
+ *
5
+ * Schemas mirror the official Wit.ai HTTP API resources for natural language understanding,
6
+ * speech synthesis, and application management.
7
+ *
8
+ * @see https://wit.ai/docs/http/20240304
9
+ */
10
+ /**
11
+ * Wit.ai Entity Role reference.
12
+ *
13
+ * Roles differentiate multiple entities of the same type within utterances
14
+ * (e.g. `location:from` vs `location:to`).
15
+ */
16
+ export declare const WitAiRole: z.ZodObject<{
17
+ id: z.ZodOptional<z.ZodString>;
18
+ name: z.ZodString;
19
+ }, z.core.$catchall<z.ZodUnknown>>;
20
+ export type WitAiRole = z.infer<typeof WitAiRole>;
21
+ /**
22
+ * Wit.ai Keyword with optional synonyms.
23
+ *
24
+ * Used for keyword lookup strategy on entities.
25
+ */
26
+ export declare const WitAiKeyword: z.ZodObject<{
27
+ keyword: z.ZodString;
28
+ synonyms: z.ZodOptional<z.ZodArray<z.ZodString>>;
29
+ }, z.core.$catchall<z.ZodUnknown>>;
30
+ export type WitAiKeyword = z.infer<typeof WitAiKeyword>;
31
+ /**
32
+ * Wit.ai Entity Annotation Reference within utterances and message predictions.
33
+ */
34
+ export declare const WitAiEntityRef: z.ZodObject<{
35
+ id: z.ZodOptional<z.ZodString>;
36
+ name: z.ZodOptional<z.ZodString>;
37
+ role: z.ZodOptional<z.ZodString>;
38
+ start: z.ZodOptional<z.ZodNumber>;
39
+ end: z.ZodOptional<z.ZodNumber>;
40
+ body: z.ZodOptional<z.ZodString>;
41
+ confidence: z.ZodOptional<z.ZodNumber>;
42
+ entities: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
43
+ value: z.ZodOptional<z.ZodUnknown>;
44
+ type: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$catchall<z.ZodUnknown>>;
46
+ export type WitAiEntityRef = z.infer<typeof WitAiEntityRef>;
47
+ /**
48
+ * Wit.ai Trait Value definition.
49
+ */
50
+ export declare const WitAiTraitValue: z.ZodObject<{
51
+ id: z.ZodOptional<z.ZodString>;
52
+ value: z.ZodString;
53
+ }, z.core.$catchall<z.ZodUnknown>>;
54
+ export type WitAiTraitValue = z.infer<typeof WitAiTraitValue>;
55
+ /**
56
+ * Wit.ai Trait Reference within predictions and training samples.
57
+ */
58
+ export declare const WitAiTraitRef: z.ZodObject<{
59
+ id: z.ZodOptional<z.ZodString>;
60
+ value: z.ZodString;
61
+ confidence: z.ZodOptional<z.ZodNumber>;
62
+ }, z.core.$catchall<z.ZodUnknown>>;
63
+ export type WitAiTraitRef = z.infer<typeof WitAiTraitRef>;
64
+ /**
65
+ * Wit.ai Voice Style parameter definition for Text-to-Speech voices.
66
+ */
67
+ export declare const WitAiVoiceStyle: z.ZodObject<{
68
+ name: z.ZodString;
69
+ speed: z.ZodOptional<z.ZodArray<z.ZodString>>;
70
+ pitch: z.ZodOptional<z.ZodArray<z.ZodString>>;
71
+ }, z.core.$catchall<z.ZodUnknown>>;
72
+ export type WitAiVoiceStyle = z.infer<typeof WitAiVoiceStyle>;
73
+ /**
74
+ * Wit.ai App Entity (`GET /apps`, `GET /apps/{app_id}`).
75
+ *
76
+ * Represents an NLP application containing trained models, intents, entities, and settings.
77
+ *
78
+ * @see https://wit.ai/docs/http/20240304#apps
79
+ */
80
+ export declare const WitAiApp: z.ZodObject<{
81
+ id: z.ZodString;
82
+ name: z.ZodString;
83
+ lang: z.ZodOptional<z.ZodString>;
84
+ private: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
85
+ timezone: z.ZodOptional<z.ZodString>;
86
+ desc: z.ZodOptional<z.ZodString>;
87
+ will_train_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
88
+ last_trained_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
89
+ last_training_duration_secs: z.ZodOptional<z.ZodNumber>;
90
+ training_status: z.ZodOptional<z.ZodString>;
91
+ created_at: z.ZodOptional<z.ZodString>;
92
+ updated_at: z.ZodOptional<z.ZodString>;
93
+ }, z.core.$catchall<z.ZodUnknown>>;
94
+ export type WitAiApp = z.infer<typeof WitAiApp>;
95
+ /**
96
+ * Wit.ai Intent Entity (`GET /intents`, `GET /intents/{intent}`).
97
+ *
98
+ * Represents a user goal or intention extracted from natural language utterances.
99
+ *
100
+ * @see https://wit.ai/docs/http/20240304#intents
101
+ */
102
+ export declare const WitAiIntent: z.ZodObject<{
103
+ id: z.ZodString;
104
+ name: z.ZodString;
105
+ entities: z.ZodOptional<z.ZodArray<z.ZodObject<{
106
+ id: z.ZodOptional<z.ZodString>;
107
+ name: z.ZodOptional<z.ZodString>;
108
+ role: z.ZodOptional<z.ZodString>;
109
+ start: z.ZodOptional<z.ZodNumber>;
110
+ end: z.ZodOptional<z.ZodNumber>;
111
+ body: z.ZodOptional<z.ZodString>;
112
+ confidence: z.ZodOptional<z.ZodNumber>;
113
+ entities: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
114
+ value: z.ZodOptional<z.ZodUnknown>;
115
+ type: z.ZodOptional<z.ZodString>;
116
+ }, z.core.$catchall<z.ZodUnknown>>>>;
117
+ }, z.core.$catchall<z.ZodUnknown>>;
118
+ export type WitAiIntent = z.infer<typeof WitAiIntent>;
119
+ /**
120
+ * Wit.ai Entity definition (`GET /entities`, `GET /entities/{entity}`).
121
+ *
122
+ * Represents a concept or data extracted from message text.
123
+ *
124
+ * @see https://wit.ai/docs/http/20240304#entities
125
+ */
126
+ export declare const WitAiEntity: z.ZodObject<{
127
+ id: z.ZodString;
128
+ name: z.ZodString;
129
+ roles: z.ZodOptional<z.ZodArray<z.ZodObject<{
130
+ id: z.ZodOptional<z.ZodString>;
131
+ name: z.ZodString;
132
+ }, z.core.$catchall<z.ZodUnknown>>>>;
133
+ lookups: z.ZodOptional<z.ZodArray<z.ZodString>>;
134
+ keywords: z.ZodOptional<z.ZodArray<z.ZodObject<{
135
+ keyword: z.ZodString;
136
+ synonyms: z.ZodOptional<z.ZodArray<z.ZodString>>;
137
+ }, z.core.$catchall<z.ZodUnknown>>>>;
138
+ }, z.core.$catchall<z.ZodUnknown>>;
139
+ export type WitAiEntity = z.infer<typeof WitAiEntity>;
140
+ /**
141
+ * Wit.ai Trait definition (`GET /traits`, `GET /traits/{trait}`).
142
+ *
143
+ * Traits represent whole-message attributes (e.g. sentiment, politeness) rather than span-level entities.
144
+ *
145
+ * @see https://wit.ai/docs/http/20240304#traits
146
+ */
147
+ export declare const WitAiTrait: z.ZodObject<{
148
+ id: z.ZodString;
149
+ name: z.ZodString;
150
+ values: z.ZodOptional<z.ZodArray<z.ZodObject<{
151
+ id: z.ZodOptional<z.ZodString>;
152
+ value: z.ZodString;
153
+ }, z.core.$catchall<z.ZodUnknown>>>>;
154
+ }, z.core.$catchall<z.ZodUnknown>>;
155
+ export type WitAiTrait = z.infer<typeof WitAiTrait>;
156
+ /**
157
+ * Wit.ai Training Utterance Entity (`GET /utterances`).
158
+ *
159
+ * Labeled training samples with annotations (intents, entities, traits).
160
+ *
161
+ * @see https://wit.ai/docs/http/20240304#utterances
162
+ */
163
+ export declare const WitAiUtterance: z.ZodObject<{
164
+ id: z.ZodOptional<z.ZodString>;
165
+ text: z.ZodString;
166
+ intent: z.ZodOptional<z.ZodNullable<z.ZodObject<{
167
+ id: z.ZodOptional<z.ZodString>;
168
+ name: z.ZodString;
169
+ }, z.core.$strip>>>;
170
+ entities: z.ZodOptional<z.ZodArray<z.ZodObject<{
171
+ id: z.ZodOptional<z.ZodString>;
172
+ name: z.ZodOptional<z.ZodString>;
173
+ role: z.ZodOptional<z.ZodString>;
174
+ start: z.ZodOptional<z.ZodNumber>;
175
+ end: z.ZodOptional<z.ZodNumber>;
176
+ body: z.ZodOptional<z.ZodString>;
177
+ confidence: z.ZodOptional<z.ZodNumber>;
178
+ entities: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
179
+ value: z.ZodOptional<z.ZodUnknown>;
180
+ type: z.ZodOptional<z.ZodString>;
181
+ }, z.core.$catchall<z.ZodUnknown>>>>;
182
+ traits: z.ZodOptional<z.ZodArray<z.ZodObject<{
183
+ id: z.ZodOptional<z.ZodString>;
184
+ value: z.ZodString;
185
+ confidence: z.ZodOptional<z.ZodNumber>;
186
+ }, z.core.$catchall<z.ZodUnknown>>>>;
187
+ }, z.core.$catchall<z.ZodUnknown>>;
188
+ export type WitAiUtterance = z.infer<typeof WitAiUtterance>;
189
+ /**
190
+ * Wit.ai TTS Voice Entity (`GET /voices`, `GET /voices/{voice}`).
191
+ *
192
+ * Text-to-speech synthesized voice options and style controls.
193
+ *
194
+ * @see https://wit.ai/docs/http/20240304#voices
195
+ */
196
+ export declare const WitAiVoice: z.ZodObject<{
197
+ name: z.ZodString;
198
+ locale: z.ZodOptional<z.ZodString>;
199
+ gender: z.ZodOptional<z.ZodString>;
200
+ styles: z.ZodOptional<z.ZodArray<z.ZodObject<{
201
+ name: z.ZodString;
202
+ speed: z.ZodOptional<z.ZodArray<z.ZodString>>;
203
+ pitch: z.ZodOptional<z.ZodArray<z.ZodString>>;
204
+ }, z.core.$catchall<z.ZodUnknown>>>>;
205
+ supported_features: z.ZodOptional<z.ZodArray<z.ZodString>>;
206
+ }, z.core.$catchall<z.ZodUnknown>>;
207
+ export type WitAiVoice = z.infer<typeof WitAiVoice>;
208
+ /**
209
+ * Wit.ai App Tag Entity (`GET /apps/{app_id}/tags`).
210
+ *
211
+ * Version snapshot of a Wit.ai application.
212
+ *
213
+ * @see https://wit.ai/docs/http/20240304#tags
214
+ */
215
+ export declare const WitAiTag: z.ZodObject<{
216
+ id: z.ZodString;
217
+ name: z.ZodString;
218
+ desc: z.ZodOptional<z.ZodNullable<z.ZodString>>;
219
+ created_at: z.ZodOptional<z.ZodString>;
220
+ updated_at: z.ZodOptional<z.ZodString>;
221
+ }, z.core.$catchall<z.ZodUnknown>>;
222
+ export type WitAiTag = z.infer<typeof WitAiTag>;
223
+ //# sourceMappingURL=database.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../schema/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,SAAS;;;kCAKC,CAAC;AACxB,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,YAAY;;;kCAKF,CAAC;AACxB,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;kCAaJ,CAAC;AACxB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;GAMG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;kCAQA,CAAC;AACxB,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ;;;;;;kCAQE,CAAC;AACxB,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC"}
@@ -0,0 +1,101 @@
1
+ export declare const WitAiSchema: {
2
+ readonly version: "1.0.0";
3
+ readonly entities: {
4
+ readonly apps: import("zod").ZodObject<{
5
+ id: import("zod").ZodString;
6
+ name: import("zod").ZodString;
7
+ lang: import("zod").ZodOptional<import("zod").ZodString>;
8
+ private: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodBoolean, import("zod").ZodString]>>;
9
+ timezone: import("zod").ZodOptional<import("zod").ZodString>;
10
+ desc: import("zod").ZodOptional<import("zod").ZodString>;
11
+ will_train_at: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
12
+ last_trained_at: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
13
+ last_training_duration_secs: import("zod").ZodOptional<import("zod").ZodNumber>;
14
+ training_status: import("zod").ZodOptional<import("zod").ZodString>;
15
+ created_at: import("zod").ZodOptional<import("zod").ZodString>;
16
+ updated_at: import("zod").ZodOptional<import("zod").ZodString>;
17
+ }, import("zod/v4/core").$catchall<import("zod").ZodUnknown>>;
18
+ readonly intents: import("zod").ZodObject<{
19
+ id: import("zod").ZodString;
20
+ name: import("zod").ZodString;
21
+ entities: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
22
+ id: import("zod").ZodOptional<import("zod").ZodString>;
23
+ name: import("zod").ZodOptional<import("zod").ZodString>;
24
+ role: import("zod").ZodOptional<import("zod").ZodString>;
25
+ start: import("zod").ZodOptional<import("zod").ZodNumber>;
26
+ end: import("zod").ZodOptional<import("zod").ZodNumber>;
27
+ body: import("zod").ZodOptional<import("zod").ZodString>;
28
+ confidence: import("zod").ZodOptional<import("zod").ZodNumber>;
29
+ entities: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodUnknown>>;
30
+ value: import("zod").ZodOptional<import("zod").ZodUnknown>;
31
+ type: import("zod").ZodOptional<import("zod").ZodString>;
32
+ }, import("zod/v4/core").$catchall<import("zod").ZodUnknown>>>>;
33
+ }, import("zod/v4/core").$catchall<import("zod").ZodUnknown>>;
34
+ readonly entities: import("zod").ZodObject<{
35
+ id: import("zod").ZodString;
36
+ name: import("zod").ZodString;
37
+ roles: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
38
+ id: import("zod").ZodOptional<import("zod").ZodString>;
39
+ name: import("zod").ZodString;
40
+ }, import("zod/v4/core").$catchall<import("zod").ZodUnknown>>>>;
41
+ lookups: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
42
+ keywords: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
43
+ keyword: import("zod").ZodString;
44
+ synonyms: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
45
+ }, import("zod/v4/core").$catchall<import("zod").ZodUnknown>>>>;
46
+ }, import("zod/v4/core").$catchall<import("zod").ZodUnknown>>;
47
+ readonly traits: import("zod").ZodObject<{
48
+ id: import("zod").ZodString;
49
+ name: import("zod").ZodString;
50
+ values: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
51
+ id: import("zod").ZodOptional<import("zod").ZodString>;
52
+ value: import("zod").ZodString;
53
+ }, import("zod/v4/core").$catchall<import("zod").ZodUnknown>>>>;
54
+ }, import("zod/v4/core").$catchall<import("zod").ZodUnknown>>;
55
+ readonly utterances: import("zod").ZodObject<{
56
+ id: import("zod").ZodOptional<import("zod").ZodString>;
57
+ text: import("zod").ZodString;
58
+ intent: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
59
+ id: import("zod").ZodOptional<import("zod").ZodString>;
60
+ name: import("zod").ZodString;
61
+ }, import("zod/v4/core").$strip>>>;
62
+ entities: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
63
+ id: import("zod").ZodOptional<import("zod").ZodString>;
64
+ name: import("zod").ZodOptional<import("zod").ZodString>;
65
+ role: import("zod").ZodOptional<import("zod").ZodString>;
66
+ start: import("zod").ZodOptional<import("zod").ZodNumber>;
67
+ end: import("zod").ZodOptional<import("zod").ZodNumber>;
68
+ body: import("zod").ZodOptional<import("zod").ZodString>;
69
+ confidence: import("zod").ZodOptional<import("zod").ZodNumber>;
70
+ entities: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodUnknown>>;
71
+ value: import("zod").ZodOptional<import("zod").ZodUnknown>;
72
+ type: import("zod").ZodOptional<import("zod").ZodString>;
73
+ }, import("zod/v4/core").$catchall<import("zod").ZodUnknown>>>>;
74
+ traits: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
75
+ id: import("zod").ZodOptional<import("zod").ZodString>;
76
+ value: import("zod").ZodString;
77
+ confidence: import("zod").ZodOptional<import("zod").ZodNumber>;
78
+ }, import("zod/v4/core").$catchall<import("zod").ZodUnknown>>>>;
79
+ }, import("zod/v4/core").$catchall<import("zod").ZodUnknown>>;
80
+ readonly voices: import("zod").ZodObject<{
81
+ name: import("zod").ZodString;
82
+ locale: import("zod").ZodOptional<import("zod").ZodString>;
83
+ gender: import("zod").ZodOptional<import("zod").ZodString>;
84
+ styles: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
85
+ name: import("zod").ZodString;
86
+ speed: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
87
+ pitch: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
88
+ }, import("zod/v4/core").$catchall<import("zod").ZodUnknown>>>>;
89
+ supported_features: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
90
+ }, import("zod/v4/core").$catchall<import("zod").ZodUnknown>>;
91
+ readonly tags: import("zod").ZodObject<{
92
+ id: import("zod").ZodString;
93
+ name: import("zod").ZodString;
94
+ desc: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
95
+ created_at: import("zod").ZodOptional<import("zod").ZodString>;
96
+ updated_at: import("zod").ZodOptional<import("zod").ZodString>;
97
+ }, import("zod/v4/core").$catchall<import("zod").ZodUnknown>>;
98
+ };
99
+ };
100
+ export * from './database';
101
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../schema/index.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWd,CAAC;AAEX,cAAc,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=schema.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.test.d.ts","sourceRoot":"","sources":["../schema.test.ts"],"names":[],"mappings":""}