at-shared-types 1.1.13 → 1.1.15
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/cjs/ai/domain/index.d.ts +3 -0
- package/dist/cjs/ai/domain/index.js +8 -0
- package/dist/cjs/ai/index.d.ts +3 -3
- package/dist/cjs/ai/index.js +6 -17
- package/dist/cjs/ai/transport/chat/chat.request.d.ts +6 -0
- package/dist/{esm/ai/chat/chatResponseDTO.d.ts → cjs/ai/transport/chat/chat.response.d.ts} +2 -2
- package/dist/cjs/ai/transport/chat/chatWithIntent.request.d.ts +6 -0
- package/dist/cjs/ai/transport/chat/chatWithIntent.response.d.ts +5 -0
- package/dist/cjs/ai/transport/chat/index.d.ts +4 -0
- package/dist/cjs/ai/{session → transport/chat}/index.js +4 -1
- package/dist/cjs/ai/transport/index.d.ts +3 -0
- package/dist/cjs/ai/transport/index.js +8 -0
- package/dist/cjs/ai/transport/wire.types.d.ts +11 -0
- package/dist/cjs/at-domain-dto.d.ts +26 -0
- package/dist/cjs/at-domain-dto.js +10 -0
- package/dist/cjs/at-transport-dto.d.ts +28 -0
- package/dist/cjs/at-transport-dto.js +7 -0
- package/dist/cjs/casing/case.runtime.d.ts +4 -0
- package/dist/cjs/casing/case.runtime.js +40 -0
- package/dist/cjs/casing/case.types.d.ts +15 -0
- package/dist/cjs/casing/case.types.js +2 -0
- package/dist/cjs/casing/index.d.ts +5 -0
- package/dist/cjs/{ai/chat → casing}/index.js +9 -4
- package/dist/cjs/core/index.d.ts +2 -2
- package/dist/cjs/core/index.js +4 -16
- package/dist/cjs/core/transport/index.d.ts +2 -0
- package/dist/cjs/core/{routes → transport}/index.js +2 -1
- package/dist/cjs/core/transport/responses.js +2 -0
- package/dist/cjs/index.d.ts +3 -2
- package/dist/cjs/index.js +6 -16
- package/dist/cjs/package.json +3 -0
- package/dist/esm/ai/domain/index.d.ts +3 -0
- package/dist/esm/ai/domain/index.js +4 -0
- package/dist/esm/ai/index.d.ts +3 -3
- package/dist/esm/ai/index.js +4 -3
- package/dist/esm/ai/transport/chat/chat.request.d.ts +6 -0
- package/dist/{cjs/ai/chat/chatResponseDTO.d.ts → esm/ai/transport/chat/chat.response.d.ts} +2 -2
- package/dist/esm/ai/transport/chat/chatWithIntent.request.d.ts +6 -0
- package/dist/esm/ai/transport/chat/chatWithIntent.response.d.ts +5 -0
- package/dist/esm/ai/transport/chat/index.d.ts +4 -0
- package/dist/esm/ai/transport/chat/index.js +4 -0
- package/dist/esm/ai/transport/index.d.ts +3 -0
- package/dist/esm/ai/transport/index.js +4 -0
- package/dist/esm/ai/transport/wire.types.d.ts +11 -0
- package/dist/esm/at-domain-dto.d.ts +26 -0
- package/dist/esm/at-domain-dto.js +7 -0
- package/dist/esm/at-transport-dto.d.ts +28 -0
- package/dist/esm/at-transport-dto.js +4 -0
- package/dist/esm/casing/case.runtime.d.ts +4 -0
- package/dist/esm/casing/case.runtime.js +33 -0
- package/dist/esm/casing/case.types.d.ts +15 -0
- package/dist/esm/casing/case.types.js +1 -0
- package/dist/esm/casing/index.d.ts +5 -0
- package/dist/esm/casing/index.js +7 -0
- package/dist/esm/core/index.d.ts +2 -2
- package/dist/esm/core/index.js +3 -2
- package/dist/esm/core/transport/index.d.ts +2 -0
- package/dist/esm/core/transport/index.js +2 -0
- package/dist/esm/core/transport/responses.js +1 -0
- package/dist/esm/index.d.ts +3 -2
- package/dist/esm/index.js +3 -2
- package/dist/esm/package.json +3 -0
- package/package.json +7 -15
- package/dist/cjs/ai/chat/chatRequestDTO.d.ts +0 -6
- package/dist/cjs/ai/chat/chatWithIntentRequestDTO.d.ts +0 -6
- package/dist/cjs/ai/chat/chatWithIntentResponseDTO.d.ts +0 -5
- package/dist/cjs/ai/chat/index.d.ts +0 -4
- package/dist/cjs/ai/session/index.d.ts +0 -1
- package/dist/cjs/core/errors/index.d.ts +0 -1
- package/dist/cjs/core/errors/index.js +0 -17
- package/dist/cjs/core/routes/index.d.ts +0 -1
- package/dist/esm/ai/chat/chatRequestDTO.d.ts +0 -6
- package/dist/esm/ai/chat/chatWithIntentRequestDTO.d.ts +0 -6
- package/dist/esm/ai/chat/chatWithIntentResponseDTO.d.ts +0 -5
- package/dist/esm/ai/chat/index.d.ts +0 -4
- package/dist/esm/ai/chat/index.js +0 -4
- package/dist/esm/ai/session/index.d.ts +0 -1
- package/dist/esm/ai/session/index.js +0 -1
- package/dist/esm/core/errors/index.d.ts +0 -1
- package/dist/esm/core/errors/index.js +0 -1
- package/dist/esm/core/routes/index.d.ts +0 -1
- package/dist/esm/core/routes/index.js +0 -1
- /package/dist/cjs/ai/{engine.d.ts → domain/engine.d.ts} +0 -0
- /package/dist/cjs/ai/{engine.js → domain/engine.js} +0 -0
- /package/dist/cjs/ai/{session/sessionsDTO.d.ts → domain/session.d.ts} +0 -0
- /package/dist/cjs/ai/{chat/chatRequestDTO.js → domain/session.js} +0 -0
- /package/dist/cjs/ai/{chat/chatResponseDTO.js → transport/chat/chat.request.js} +0 -0
- /package/dist/cjs/ai/{chat/chatWithIntentRequestDTO.js → transport/chat/chat.response.js} +0 -0
- /package/dist/cjs/ai/{chat/chatWithIntentResponseDTO.js → transport/chat/chatWithIntent.request.js} +0 -0
- /package/dist/cjs/ai/{session/sessionsDTO.js → transport/chat/chatWithIntent.response.js} +0 -0
- /package/dist/cjs/{core/routes/formattedResponseDTO.js → ai/transport/wire.types.js} +0 -0
- /package/dist/cjs/core/{errors/errorCodeDTO.d.ts → transport/errors.d.ts} +0 -0
- /package/dist/cjs/core/{errors/errorCodeDTO.js → transport/errors.js} +0 -0
- /package/dist/cjs/core/{routes/formattedResponseDTO.d.ts → transport/responses.d.ts} +0 -0
- /package/dist/esm/ai/{engine.d.ts → domain/engine.d.ts} +0 -0
- /package/dist/esm/ai/{engine.js → domain/engine.js} +0 -0
- /package/dist/esm/ai/{session/sessionsDTO.d.ts → domain/session.d.ts} +0 -0
- /package/dist/esm/ai/{chat/chatRequestDTO.js → domain/session.js} +0 -0
- /package/dist/esm/ai/{chat/chatResponseDTO.js → transport/chat/chat.request.js} +0 -0
- /package/dist/esm/ai/{chat/chatWithIntentRequestDTO.js → transport/chat/chat.response.js} +0 -0
- /package/dist/esm/ai/{chat/chatWithIntentResponseDTO.js → transport/chat/chatWithIntent.request.js} +0 -0
- /package/dist/esm/ai/{session/sessionsDTO.js → transport/chat/chatWithIntent.response.js} +0 -0
- /package/dist/esm/{core/routes/formattedResponseDTO.js → ai/transport/wire.types.js} +0 -0
- /package/dist/esm/core/{errors/errorCodeDTO.d.ts → transport/errors.d.ts} +0 -0
- /package/dist/esm/core/{errors/errorCodeDTO.js → transport/errors.js} +0 -0
- /package/dist/esm/core/{routes/formattedResponseDTO.d.ts → transport/responses.d.ts} +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Session = exports.Engine = void 0;
|
|
4
|
+
// src/ai/domain/index.ts
|
|
5
|
+
const Engine = require("./engine");
|
|
6
|
+
exports.Engine = Engine;
|
|
7
|
+
const Session = require("./session");
|
|
8
|
+
exports.Session = Session;
|
package/dist/cjs/ai/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import * as Domain from "./domain";
|
|
2
|
+
import * as Transport from "./transport";
|
|
3
|
+
export { Domain, Transport };
|
package/dist/cjs/ai/index.js
CHANGED
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
3
|
+
exports.Transport = exports.Domain = void 0;
|
|
4
|
+
// src/ai/index.ts
|
|
5
|
+
const Domain = require("./domain");
|
|
6
|
+
exports.Domain = Domain;
|
|
7
|
+
const Transport = require("./transport");
|
|
8
|
+
exports.Transport = Transport;
|
|
@@ -14,4 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./chat.request"), exports);
|
|
18
|
+
__exportStar(require("./chat.response"), exports);
|
|
19
|
+
__exportStar(require("./chatWithIntent.request"), exports);
|
|
20
|
+
__exportStar(require("./chatWithIntent.response"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Chat = exports.Wire = void 0;
|
|
4
|
+
// src/ai/transport/index.ts
|
|
5
|
+
const Wire = require("./wire.types");
|
|
6
|
+
exports.Wire = Wire;
|
|
7
|
+
const Chat = require("./chat");
|
|
8
|
+
exports.Chat = Chat;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DeepSnakeKeys } from "../../casing";
|
|
2
|
+
import type { AIChatMessageDTO, AIChatWithIntentOptionsDTO, AIChatOptionsDTO, AIRequestContextDTO, AIIntentDTO, AICapabilityDTO, AIPageContextDTO } from "../domain/engine";
|
|
3
|
+
import type { AISessionConfigDTO } from "../domain/session";
|
|
4
|
+
export type AIChatMessageWireDTO = DeepSnakeKeys<AIChatMessageDTO>;
|
|
5
|
+
export type AIChatOptionsWireDTO = DeepSnakeKeys<AIChatOptionsDTO>;
|
|
6
|
+
export type AIRequestContextWireDTO = DeepSnakeKeys<AIRequestContextDTO>;
|
|
7
|
+
export type AIChatWithIntentOptionsWireDTO = DeepSnakeKeys<AIChatWithIntentOptionsDTO>;
|
|
8
|
+
export type AIIntentWireDTO = DeepSnakeKeys<AIIntentDTO>;
|
|
9
|
+
export type AICapabilityWireDTO = DeepSnakeKeys<AICapabilityDTO>;
|
|
10
|
+
export type AIPageContextWireDTO = DeepSnakeKeys<AIPageContextDTO>;
|
|
11
|
+
export type AISessionConfigWireDTO = DeepSnakeKeys<AISessionConfigDTO>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type * as Engine from "./ai/domain/engine";
|
|
2
|
+
import type * as Session from "./ai/domain/session";
|
|
3
|
+
/**
|
|
4
|
+
* Runtime value (empty on purpose) so consumers can:
|
|
5
|
+
* import { ATDomainDTO } from "at-shared-types"
|
|
6
|
+
* and then use:
|
|
7
|
+
* ATDomainDTO.SomeType
|
|
8
|
+
*/
|
|
9
|
+
export declare const ATDomainDTO: {};
|
|
10
|
+
/**
|
|
11
|
+
* Namespace holds ONLY types (and could hold values too if you ever need).
|
|
12
|
+
* TS merges this with the const above.
|
|
13
|
+
*/
|
|
14
|
+
export declare namespace ATDomainDTO {
|
|
15
|
+
type ATChatMessageContentDTO = Engine.ATChatMessageContentDTO;
|
|
16
|
+
type AIChatMessageDTO = Engine.AIChatMessageDTO;
|
|
17
|
+
type AIChatOptionsResponseFormatDTO = Engine.AIChatOptionsResponseFormatDTO;
|
|
18
|
+
type AIRequestContextDTO = Engine.AIRequestContextDTO;
|
|
19
|
+
type AIChatOptionsDTO = Engine.AIChatOptionsDTO;
|
|
20
|
+
type AIIntentDTO = Engine.AIIntentDTO;
|
|
21
|
+
type AICapabilityDTO = Engine.AICapabilityDTO;
|
|
22
|
+
type AIPageContextDTO = Engine.AIPageContextDTO;
|
|
23
|
+
type AIChatWithIntentOptionsDTO = Engine.AIChatWithIntentOptionsDTO;
|
|
24
|
+
type AIPromptRoleDTO = Session.AIPromptRoleDTO;
|
|
25
|
+
type AISessionConfigDTO = Session.AISessionConfigDTO;
|
|
26
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ATDomainDTO = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Runtime value (empty on purpose) so consumers can:
|
|
6
|
+
* import { ATDomainDTO } from "at-shared-types"
|
|
7
|
+
* and then use:
|
|
8
|
+
* ATDomainDTO.SomeType
|
|
9
|
+
*/
|
|
10
|
+
exports.ATDomainDTO = {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type * as AIWire from "./ai/transport/wire.types";
|
|
2
|
+
import type * as AIChat from "./ai/transport/chat";
|
|
3
|
+
import { type ATAPIErrorCodeDTO as ATAPIErrorCodeType } from "./core/transport/errors";
|
|
4
|
+
import type * as CoreResponses from "./core/transport/responses";
|
|
5
|
+
export declare const ATTransportDTO: {
|
|
6
|
+
readonly ATAPIErrorCodeDTO: {
|
|
7
|
+
readonly AI_SESSION_EXPIRED: 4501;
|
|
8
|
+
readonly AI_SESSION_NOT_FOUND: 4502;
|
|
9
|
+
readonly AI_REQUEST_CONTEXT_MISSING: 4503;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare namespace ATTransportDTO {
|
|
13
|
+
type ATAPIErrorCodeDTO = ATAPIErrorCodeType;
|
|
14
|
+
type ResponseSuccessDTO<T> = CoreResponses.ResponseSuccessDTO<T>;
|
|
15
|
+
type ResponseErrorDTO = CoreResponses.ResponseErrorDTO;
|
|
16
|
+
type AIChatRequestDTO = AIChat.AIChatRequestDTO;
|
|
17
|
+
type AIChatResponseDTO = AIChat.AIChatResponseDTO;
|
|
18
|
+
type AIChatWithIntentRequestDTO = AIChat.AIChatWithIntentRequestDTO;
|
|
19
|
+
type AIChatWithIntentResponseDTO = AIChat.AIChatWithIntentResponseDTO;
|
|
20
|
+
type AIChatMessageWireDTO = AIWire.AIChatMessageWireDTO;
|
|
21
|
+
type AIChatOptionsWireDTO = AIWire.AIChatOptionsWireDTO;
|
|
22
|
+
type AIRequestContextWireDTO = AIWire.AIRequestContextWireDTO;
|
|
23
|
+
type AIChatWithIntentOptionsWireDTO = AIWire.AIChatWithIntentOptionsWireDTO;
|
|
24
|
+
type AIIntentWireDTO = AIWire.AIIntentWireDTO;
|
|
25
|
+
type AICapabilityWireDTO = AIWire.AICapabilityWireDTO;
|
|
26
|
+
type AIPageContextWireDTO = AIWire.AIPageContextWireDTO;
|
|
27
|
+
type AISessionConfigWireDTO = AIWire.AISessionConfigWireDTO;
|
|
28
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toCamelKey = exports.toSnakeKey = void 0;
|
|
4
|
+
exports.toSnakeDeep = toSnakeDeep;
|
|
5
|
+
exports.toCamelDeep = toCamelDeep;
|
|
6
|
+
const CAMEL_TO_SNAKE = /[A-Z]/g;
|
|
7
|
+
const SNAKE_TO_CAMEL = /_([a-z])/g;
|
|
8
|
+
const toSnakeKey = (k) => k.replace(CAMEL_TO_SNAKE, m => `_${m.toLowerCase()}`);
|
|
9
|
+
exports.toSnakeKey = toSnakeKey;
|
|
10
|
+
const toCamelKey = (k) => k.replace(SNAKE_TO_CAMEL, (_, c) => c.toUpperCase());
|
|
11
|
+
exports.toCamelKey = toCamelKey;
|
|
12
|
+
function toSnakeDeep(value, exceptions = new Set()) {
|
|
13
|
+
if (Array.isArray(value))
|
|
14
|
+
return value.map(v => toSnakeDeep(v, exceptions));
|
|
15
|
+
if (value instanceof Date)
|
|
16
|
+
return value;
|
|
17
|
+
if (value && typeof value === "object") {
|
|
18
|
+
const out = {};
|
|
19
|
+
for (const [k, v] of Object.entries(value)) {
|
|
20
|
+
const nk = exceptions.has(k) ? k : (0, exports.toSnakeKey)(k);
|
|
21
|
+
out[nk] = toSnakeDeep(v, exceptions);
|
|
22
|
+
}
|
|
23
|
+
return out;
|
|
24
|
+
}
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
function toCamelDeep(value) {
|
|
28
|
+
if (Array.isArray(value))
|
|
29
|
+
return value.map(toCamelDeep);
|
|
30
|
+
if (value instanceof Date)
|
|
31
|
+
return value;
|
|
32
|
+
if (value && typeof value === "object") {
|
|
33
|
+
const out = {};
|
|
34
|
+
for (const [k, v] of Object.entries(value)) {
|
|
35
|
+
out[(0, exports.toCamelKey)(k)] = toCamelDeep(v);
|
|
36
|
+
}
|
|
37
|
+
return out;
|
|
38
|
+
}
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type SnakeCase<S extends string> = S extends `${infer H}${infer T}` ? T extends Uncapitalize<T> ? `${Lowercase<H>}${SnakeCase<T>}` : `${Lowercase<H>}_${SnakeCase<Uncapitalize<T>>}` : S;
|
|
2
|
+
export type CamelCase<S extends string> = S extends `${infer A}_${infer B}` ? `${A}${Capitalize<CamelCase<B>>}` : S;
|
|
3
|
+
type Primitive = string | number | boolean | bigint | symbol | null | undefined;
|
|
4
|
+
type Builtin = Primitive | Date | RegExp | Error;
|
|
5
|
+
export type DeepSnakeKeys<T> = T extends Builtin ? T : T extends (...args: any[]) => any ? T : T extends readonly [any, ...any[]] ? {
|
|
6
|
+
[I in keyof T]: DeepSnakeKeys<T[I]>;
|
|
7
|
+
} : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepSnakeKeys<U>> : T extends Map<infer K, infer V> ? Map<DeepSnakeKeys<K>, DeepSnakeKeys<V>> : T extends Set<infer U> ? Set<DeepSnakeKeys<U>> : T extends object ? {
|
|
8
|
+
[K in keyof T as K extends string ? SnakeCase<K> : K]: DeepSnakeKeys<T[K]>;
|
|
9
|
+
} : T;
|
|
10
|
+
export type DeepCamelKeys<T> = T extends Builtin ? T : T extends (...args: any[]) => any ? T : T extends readonly [any, ...any[]] ? {
|
|
11
|
+
[I in keyof T]: DeepCamelKeys<T[I]>;
|
|
12
|
+
} : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepCamelKeys<U>> : T extends Map<infer K, infer V> ? Map<DeepCamelKeys<K>, DeepCamelKeys<V>> : T extends Set<infer U> ? Set<DeepCamelKeys<U>> : T extends object ? {
|
|
13
|
+
[K in keyof T as K extends string ? CamelCase<K> : K]: DeepCamelKeys<T[K]>;
|
|
14
|
+
} : T;
|
|
15
|
+
export {};
|
|
@@ -14,7 +14,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
__exportStar(require("./
|
|
20
|
-
__exportStar(require("./
|
|
17
|
+
exports.Runtime = exports.Types = void 0;
|
|
18
|
+
// src/casing/index.ts
|
|
19
|
+
__exportStar(require("./case.types"), exports);
|
|
20
|
+
__exportStar(require("./case.runtime"), exports);
|
|
21
|
+
// (optional) if you still like namespaces, keep them too:
|
|
22
|
+
const Types = require("./case.types");
|
|
23
|
+
exports.Types = Types;
|
|
24
|
+
const Runtime = require("./case.runtime");
|
|
25
|
+
exports.Runtime = Runtime;
|
package/dist/cjs/core/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import * as Transport from "./transport";
|
|
2
|
+
export { Transport };
|
package/dist/cjs/core/index.js
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
3
|
+
exports.Transport = void 0;
|
|
4
|
+
// src/core/index.ts
|
|
5
|
+
const Transport = require("./transport");
|
|
6
|
+
exports.Transport = Transport;
|
|
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./responses"), exports);
|
|
18
|
+
__exportStar(require("./errors"), exports);
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export { ATDomainDTO } from "./at-domain-dto";
|
|
2
|
+
export { ATTransportDTO } from "./at-transport-dto";
|
|
3
|
+
export * as Casing from "./casing";
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
3
|
+
exports.Casing = exports.ATTransportDTO = exports.ATDomainDTO = void 0;
|
|
4
|
+
var at_domain_dto_1 = require("./at-domain-dto");
|
|
5
|
+
Object.defineProperty(exports, "ATDomainDTO", { enumerable: true, get: function () { return at_domain_dto_1.ATDomainDTO; } });
|
|
6
|
+
var at_transport_dto_1 = require("./at-transport-dto");
|
|
7
|
+
Object.defineProperty(exports, "ATTransportDTO", { enumerable: true, get: function () { return at_transport_dto_1.ATTransportDTO; } });
|
|
8
|
+
exports.Casing = require("./casing");
|
package/dist/esm/ai/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import * as Domain from "./domain";
|
|
2
|
+
import * as Transport from "./transport";
|
|
3
|
+
export { Domain, Transport };
|
package/dist/esm/ai/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
// src/ai/index.ts
|
|
2
|
+
import * as Domain from "./domain";
|
|
3
|
+
import * as Transport from "./transport";
|
|
4
|
+
export { Domain, Transport };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DeepSnakeKeys } from "../../casing";
|
|
2
|
+
import type { AIChatMessageDTO, AIChatWithIntentOptionsDTO, AIChatOptionsDTO, AIRequestContextDTO, AIIntentDTO, AICapabilityDTO, AIPageContextDTO } from "../domain/engine";
|
|
3
|
+
import type { AISessionConfigDTO } from "../domain/session";
|
|
4
|
+
export type AIChatMessageWireDTO = DeepSnakeKeys<AIChatMessageDTO>;
|
|
5
|
+
export type AIChatOptionsWireDTO = DeepSnakeKeys<AIChatOptionsDTO>;
|
|
6
|
+
export type AIRequestContextWireDTO = DeepSnakeKeys<AIRequestContextDTO>;
|
|
7
|
+
export type AIChatWithIntentOptionsWireDTO = DeepSnakeKeys<AIChatWithIntentOptionsDTO>;
|
|
8
|
+
export type AIIntentWireDTO = DeepSnakeKeys<AIIntentDTO>;
|
|
9
|
+
export type AICapabilityWireDTO = DeepSnakeKeys<AICapabilityDTO>;
|
|
10
|
+
export type AIPageContextWireDTO = DeepSnakeKeys<AIPageContextDTO>;
|
|
11
|
+
export type AISessionConfigWireDTO = DeepSnakeKeys<AISessionConfigDTO>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type * as Engine from "./ai/domain/engine";
|
|
2
|
+
import type * as Session from "./ai/domain/session";
|
|
3
|
+
/**
|
|
4
|
+
* Runtime value (empty on purpose) so consumers can:
|
|
5
|
+
* import { ATDomainDTO } from "at-shared-types"
|
|
6
|
+
* and then use:
|
|
7
|
+
* ATDomainDTO.SomeType
|
|
8
|
+
*/
|
|
9
|
+
export declare const ATDomainDTO: {};
|
|
10
|
+
/**
|
|
11
|
+
* Namespace holds ONLY types (and could hold values too if you ever need).
|
|
12
|
+
* TS merges this with the const above.
|
|
13
|
+
*/
|
|
14
|
+
export declare namespace ATDomainDTO {
|
|
15
|
+
type ATChatMessageContentDTO = Engine.ATChatMessageContentDTO;
|
|
16
|
+
type AIChatMessageDTO = Engine.AIChatMessageDTO;
|
|
17
|
+
type AIChatOptionsResponseFormatDTO = Engine.AIChatOptionsResponseFormatDTO;
|
|
18
|
+
type AIRequestContextDTO = Engine.AIRequestContextDTO;
|
|
19
|
+
type AIChatOptionsDTO = Engine.AIChatOptionsDTO;
|
|
20
|
+
type AIIntentDTO = Engine.AIIntentDTO;
|
|
21
|
+
type AICapabilityDTO = Engine.AICapabilityDTO;
|
|
22
|
+
type AIPageContextDTO = Engine.AIPageContextDTO;
|
|
23
|
+
type AIChatWithIntentOptionsDTO = Engine.AIChatWithIntentOptionsDTO;
|
|
24
|
+
type AIPromptRoleDTO = Session.AIPromptRoleDTO;
|
|
25
|
+
type AISessionConfigDTO = Session.AISessionConfigDTO;
|
|
26
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type * as AIWire from "./ai/transport/wire.types";
|
|
2
|
+
import type * as AIChat from "./ai/transport/chat";
|
|
3
|
+
import { type ATAPIErrorCodeDTO as ATAPIErrorCodeType } from "./core/transport/errors";
|
|
4
|
+
import type * as CoreResponses from "./core/transport/responses";
|
|
5
|
+
export declare const ATTransportDTO: {
|
|
6
|
+
readonly ATAPIErrorCodeDTO: {
|
|
7
|
+
readonly AI_SESSION_EXPIRED: 4501;
|
|
8
|
+
readonly AI_SESSION_NOT_FOUND: 4502;
|
|
9
|
+
readonly AI_REQUEST_CONTEXT_MISSING: 4503;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare namespace ATTransportDTO {
|
|
13
|
+
type ATAPIErrorCodeDTO = ATAPIErrorCodeType;
|
|
14
|
+
type ResponseSuccessDTO<T> = CoreResponses.ResponseSuccessDTO<T>;
|
|
15
|
+
type ResponseErrorDTO = CoreResponses.ResponseErrorDTO;
|
|
16
|
+
type AIChatRequestDTO = AIChat.AIChatRequestDTO;
|
|
17
|
+
type AIChatResponseDTO = AIChat.AIChatResponseDTO;
|
|
18
|
+
type AIChatWithIntentRequestDTO = AIChat.AIChatWithIntentRequestDTO;
|
|
19
|
+
type AIChatWithIntentResponseDTO = AIChat.AIChatWithIntentResponseDTO;
|
|
20
|
+
type AIChatMessageWireDTO = AIWire.AIChatMessageWireDTO;
|
|
21
|
+
type AIChatOptionsWireDTO = AIWire.AIChatOptionsWireDTO;
|
|
22
|
+
type AIRequestContextWireDTO = AIWire.AIRequestContextWireDTO;
|
|
23
|
+
type AIChatWithIntentOptionsWireDTO = AIWire.AIChatWithIntentOptionsWireDTO;
|
|
24
|
+
type AIIntentWireDTO = AIWire.AIIntentWireDTO;
|
|
25
|
+
type AICapabilityWireDTO = AIWire.AICapabilityWireDTO;
|
|
26
|
+
type AIPageContextWireDTO = AIWire.AIPageContextWireDTO;
|
|
27
|
+
type AISessionConfigWireDTO = AIWire.AISessionConfigWireDTO;
|
|
28
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const CAMEL_TO_SNAKE = /[A-Z]/g;
|
|
2
|
+
const SNAKE_TO_CAMEL = /_([a-z])/g;
|
|
3
|
+
export const toSnakeKey = (k) => k.replace(CAMEL_TO_SNAKE, m => `_${m.toLowerCase()}`);
|
|
4
|
+
export const toCamelKey = (k) => k.replace(SNAKE_TO_CAMEL, (_, c) => c.toUpperCase());
|
|
5
|
+
export function toSnakeDeep(value, exceptions = new Set()) {
|
|
6
|
+
if (Array.isArray(value))
|
|
7
|
+
return value.map(v => toSnakeDeep(v, exceptions));
|
|
8
|
+
if (value instanceof Date)
|
|
9
|
+
return value;
|
|
10
|
+
if (value && typeof value === "object") {
|
|
11
|
+
const out = {};
|
|
12
|
+
for (const [k, v] of Object.entries(value)) {
|
|
13
|
+
const nk = exceptions.has(k) ? k : toSnakeKey(k);
|
|
14
|
+
out[nk] = toSnakeDeep(v, exceptions);
|
|
15
|
+
}
|
|
16
|
+
return out;
|
|
17
|
+
}
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
export function toCamelDeep(value) {
|
|
21
|
+
if (Array.isArray(value))
|
|
22
|
+
return value.map(toCamelDeep);
|
|
23
|
+
if (value instanceof Date)
|
|
24
|
+
return value;
|
|
25
|
+
if (value && typeof value === "object") {
|
|
26
|
+
const out = {};
|
|
27
|
+
for (const [k, v] of Object.entries(value)) {
|
|
28
|
+
out[toCamelKey(k)] = toCamelDeep(v);
|
|
29
|
+
}
|
|
30
|
+
return out;
|
|
31
|
+
}
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type SnakeCase<S extends string> = S extends `${infer H}${infer T}` ? T extends Uncapitalize<T> ? `${Lowercase<H>}${SnakeCase<T>}` : `${Lowercase<H>}_${SnakeCase<Uncapitalize<T>>}` : S;
|
|
2
|
+
export type CamelCase<S extends string> = S extends `${infer A}_${infer B}` ? `${A}${Capitalize<CamelCase<B>>}` : S;
|
|
3
|
+
type Primitive = string | number | boolean | bigint | symbol | null | undefined;
|
|
4
|
+
type Builtin = Primitive | Date | RegExp | Error;
|
|
5
|
+
export type DeepSnakeKeys<T> = T extends Builtin ? T : T extends (...args: any[]) => any ? T : T extends readonly [any, ...any[]] ? {
|
|
6
|
+
[I in keyof T]: DeepSnakeKeys<T[I]>;
|
|
7
|
+
} : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepSnakeKeys<U>> : T extends Map<infer K, infer V> ? Map<DeepSnakeKeys<K>, DeepSnakeKeys<V>> : T extends Set<infer U> ? Set<DeepSnakeKeys<U>> : T extends object ? {
|
|
8
|
+
[K in keyof T as K extends string ? SnakeCase<K> : K]: DeepSnakeKeys<T[K]>;
|
|
9
|
+
} : T;
|
|
10
|
+
export type DeepCamelKeys<T> = T extends Builtin ? T : T extends (...args: any[]) => any ? T : T extends readonly [any, ...any[]] ? {
|
|
11
|
+
[I in keyof T]: DeepCamelKeys<T[I]>;
|
|
12
|
+
} : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepCamelKeys<U>> : T extends Map<infer K, infer V> ? Map<DeepCamelKeys<K>, DeepCamelKeys<V>> : T extends Set<infer U> ? Set<DeepCamelKeys<U>> : T extends object ? {
|
|
13
|
+
[K in keyof T as K extends string ? CamelCase<K> : K]: DeepCamelKeys<T[K]>;
|
|
14
|
+
} : T;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/core/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import * as Transport from "./transport";
|
|
2
|
+
export { Transport };
|
package/dist/esm/core/index.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// src/core/index.ts
|
|
2
|
+
import * as Transport from "./transport";
|
|
3
|
+
export { Transport };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export { ATDomainDTO } from "./at-domain-dto";
|
|
2
|
+
export { ATTransportDTO } from "./at-transport-dto";
|
|
3
|
+
export * as Casing from "./casing";
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export { ATDomainDTO } from "./at-domain-dto";
|
|
2
|
+
export { ATTransportDTO } from "./at-transport-dto";
|
|
3
|
+
export * as Casing from "./casing";
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "at-shared-types",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
|
+
"type": "commonjs",
|
|
4
5
|
"main": "./dist/cjs/index.js",
|
|
5
6
|
"module": "./dist/esm/index.js",
|
|
6
7
|
"types": "./dist/esm/index.d.ts",
|
|
@@ -12,27 +13,18 @@
|
|
|
12
13
|
"clean": "rimraf dist",
|
|
13
14
|
"build:cjs": "tsc --project tsconfig.cjs.json",
|
|
14
15
|
"build:esm": "tsc --project tsconfig.json",
|
|
15
|
-
"
|
|
16
|
+
"postbuild": "node scripts/postbuild.mjs",
|
|
17
|
+
"build": "npm run clean && npm run build:cjs && npm run build:esm && npm run postbuild"
|
|
16
18
|
},
|
|
17
19
|
"exports": {
|
|
18
20
|
".": {
|
|
21
|
+
"types": "./dist/esm/index.d.ts",
|
|
19
22
|
"import": "./dist/esm/index.js",
|
|
20
|
-
"require": "./dist/cjs/index.js"
|
|
21
|
-
"types": "./dist/esm/index.d.ts"
|
|
22
|
-
},
|
|
23
|
-
"./ai": {
|
|
24
|
-
"import": "./dist/esm/ai/index.js",
|
|
25
|
-
"require": "./dist/cjs/ai/index.js",
|
|
26
|
-
"types": "./dist/esm/ai/index.d.ts"
|
|
27
|
-
},
|
|
28
|
-
"./core": {
|
|
29
|
-
"import": "./dist/esm/core/index.js",
|
|
30
|
-
"require": "./dist/cjs/core/index.js",
|
|
31
|
-
"types": "./dist/esm/core/index.d.ts"
|
|
23
|
+
"require": "./dist/cjs/index.js"
|
|
32
24
|
}
|
|
33
25
|
},
|
|
34
26
|
"devDependencies": {
|
|
35
27
|
"rimraf": "^6.1.2",
|
|
36
28
|
"typescript": "^5.9.3"
|
|
37
29
|
}
|
|
38
|
-
}
|
|
30
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./sessionsDTO";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./errorCodeDTO";
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./errorCodeDTO"), exports);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./formattedResponseDTO";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./sessionsDTO";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./sessionsDTO";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./errorCodeDTO";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./errorCodeDTO";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./formattedResponseDTO";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./formattedResponseDTO";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/cjs/ai/{chat/chatWithIntentResponseDTO.js → transport/chat/chatWithIntent.request.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/esm/ai/{chat/chatWithIntentResponseDTO.js → transport/chat/chatWithIntent.request.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|