@milkio/astra 1.3.3 → 1.3.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milkio/astra",
3
- "version": "1.3.3",
3
+ "version": "1.3.6",
4
4
  "type": "module",
5
5
  "exports": "./index.js",
6
6
  "types": "./index.d.ts",
package/index.d.ts DELETED
@@ -1,63 +0,0 @@
1
- export type AstraOptionsInit = {
2
- stargate: {
3
- $types: any;
4
- execute: any;
5
- ping: any;
6
- __cookbook: any;
7
- __astraEmitEvent: any;
8
- };
9
- bootstrap: () => Promise<Record<string, any>>;
10
- };
11
- type GeneratorGeneric<T> = T extends AsyncGenerator<infer I> ? I : never;
12
- type Mixin<T, U> = U & Omit<T, keyof U>;
13
- type ExecuteOptions = {
14
- headers?: Record<string, string>;
15
- timeout?: number;
16
- type?: "action" | "stream" | "event";
17
- };
18
- type ExecuteResultsOption = {
19
- executeId: string;
20
- };
21
- type Context = {
22
- logger: Logger;
23
- };
24
- type Logger = {
25
- debug: (description: string, ...params: Array<unknown>) => Log;
26
- info: (description: string, ...params: Array<unknown>) => Log;
27
- warn: (description: string, ...params: Array<unknown>) => Log;
28
- error: (description: string, ...params: Array<unknown>) => Log;
29
- response: (description: string, ...params: Array<unknown>) => Log;
30
- };
31
- type Log = [string, "(debug)" | "(info)" | "(warn)" | "(error)" | "(response)", string, string, ...Array<unknown>];
32
- type Reject = (description: string, ...params: Array<unknown>) => Error;
33
- type DeepPartial<T> = T extends Function ? T : T extends object ? {
34
- [P in keyof T]?: DeepPartial<T[P]>;
35
- } : T;
36
- export declare function createAstra<AstraOptions extends AstraOptionsInit, Generated extends AstraOptions["stargate"]["$types"]["generated"]>(astraOptions: AstraOptions): Promise<{
37
- options: AstraOptions;
38
- createMirrorWorld(importMetaUrl: string): Promise<[Context, Reject, Mixin<Awaited<ReturnType<AstraOptions["bootstrap"]>>, {
39
- paths: {
40
- cwd: string;
41
- milkio: string;
42
- generated: string;
43
- };
44
- execute: <Path extends keyof Generated["routeSchema"]>(path: Path, options?: Mixin<ExecuteOptions, {
45
- params?: Generated["routeSchema"][Path]["types"]["params"];
46
- generateParams: false;
47
- } | {
48
- params?: DeepPartial<Generated["routeSchema"][Path]["types"]["params"]>;
49
- generateParams: true;
50
- }>) => Promise<Generated["routeSchema"][Path]["types"]["\uD83E\uDD5B"] extends boolean ? // action
51
- [Partial<Generated["rejectCode"]>, null, ExecuteResultsOption] | [null, Generated["routeSchema"][Path]["types"]["result"], ExecuteResultsOption] : // stream
52
- [Partial<Generated["rejectCode"]>, null, ExecuteResultsOption] | [null, AsyncGenerator<[Partial<Generated["rejectCode"]>, null] | [null, GeneratorGeneric<Generated["routeSchema"][Path]["types"]["result"]>], ExecuteResultsOption>]>;
53
- emit: <Key extends keyof Generated["events"]>(key: Key, options?: {
54
- params?: Omit<Generated["events"][Key], "context">;
55
- headers?: Record<string, string>;
56
- timeout?: number;
57
- }) => Promise<[Partial<Generated["rejectCode"]>, null, ExecuteResultsOption] | [null, Generated["events"][Key], ExecuteResultsOption]>;
58
- }>]>;
59
- }>;
60
- export declare function fetchWithTimeout(url: string, options?: RequestInit & {
61
- timeout?: number;
62
- }): Promise<Response>;
63
- export {};
@@ -1,71 +0,0 @@
1
- /**
2
- * The content of this file is automatically generated by Typia.
3
- * It can be edited in the /packages/cookbook-dto/src/* file, and each time you run bun run dev, the generated file will be synced to another location based on the content of the /develop.ts.
4
- */
5
- export interface CookbookOptions {
6
- projects: Record<string, {
7
- type: "milkio" | "custom";
8
- port: number;
9
- start: string;
10
- build: string;
11
- meta: Partial<{
12
- inspect: boolean;
13
- }>;
14
- runtime?: "node" | "deno" | "bun";
15
- name?: string;
16
- lazyRoutes?: boolean;
17
- watcher?: Array<string>;
18
- autoStart?: boolean;
19
- autoStartDelay?: number;
20
- connectTestUrl?: string;
21
- drizzle?: Array<{
22
- mode: string;
23
- migrateDatabaseUrl: string;
24
- migrateMode: "generate" | "push" | "any";
25
- schemaDir?: string;
26
- }>;
27
- }>;
28
- general: {
29
- start: string;
30
- packageManager: string;
31
- cookbookPort: number;
32
- modes: Array<string>;
33
- };
34
- config: {
35
- [key: string]: string | number | boolean;
36
- };
37
- }
38
- export type CookbookActionParams = {
39
- type: "milkio@ping";
40
- } | {
41
- type: "milkio@logger";
42
- log: Array<any>;
43
- } | {
44
- type: "milkio@template";
45
- name: string;
46
- fsPath: string;
47
- template: string;
48
- } | {
49
- type: "workers@list";
50
- } | {
51
- type: "workers@get";
52
- key: string;
53
- index: number;
54
- };
55
- export type CookbookSubscribeEmits = {
56
- type: "workers@stdout";
57
- key: string;
58
- chunk: string;
59
- } | {
60
- type: "workers@state";
61
- key: string;
62
- state: "running" | "stopped";
63
- code: number | null | "kill" | "running";
64
- } | {
65
- type: "watcher@change";
66
- event: "rename" | "change";
67
- path: string;
68
- } | {
69
- type: "milkio@logger";
70
- log: Array<any>;
71
- };