@sealcode/sealgen 0.19.16 → 0.19.17

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 (118) hide show
  1. package/@types/app-config/get-app-port.d.ts +1 -0
  2. package/@types/app-config/load-app-config.d.ts +4 -0
  3. package/@types/app-config/resolve-app-config-path.d.ts +1 -0
  4. package/@types/forms/fields/structured-array.d.ts +2 -2
  5. package/@types/utils/translate.d.ts +2 -1
  6. package/lib/forms/controls/tickable.js +1 -3
  7. package/lib/forms/fields/collection-field.js +2 -1
  8. package/lib/generate-routes.js +23 -1
  9. package/lib/utils/translate.js +4 -4
  10. package/package.json +2 -2
  11. package/src/forms/fields/collection-field.ts +2 -1
  12. package/src/forms/fields/structured-array.ts +2 -11
  13. package/src/generate-routes.ts +38 -9
  14. package/.xunit +0 -75
  15. package/@types/add-verbose-crud.d.ts +0 -3
  16. package/@types/builders/colors-builder.d.sync-conflict-20250918-184323-TFDLWFG.ts +0 -10
  17. package/@types/builders/fonts-builder.d.sync-conflict-20250918-184322-TFDLWFG.ts +0 -7
  18. package/@types/controllers/table-add-button.d.ts +0 -6
  19. package/@types/crud-field-snippets.d.ts +0 -1
  20. package/@types/find-css-includes.d.ts +0 -1
  21. package/@types/forms/controls/array.d.sync-conflict-20250918-184306-TFDLWFG.ts +0 -33
  22. package/@types/forms/controls/array.sync-conflict-20250918-222045-TFDLWFG.d.ts +0 -33
  23. package/@types/forms/controls/autocomplete.d.sync-conflict-20250918-222042-TFDLWFG.ts +0 -22
  24. package/@types/forms/controls/checkbox-group.d.sync-conflict-20250918-184319-TFDLWFG.ts +0 -21
  25. package/@types/forms/controls/checkboxed-list-input.d.sync-conflict-20250918-184323-TFDLWFG.ts +0 -21
  26. package/@types/forms/controls/derived-frame.d.sync-conflict-20250918-184314-TFDLWFG.ts +0 -19
  27. package/@types/forms/controls/dropdown.d.sync-conflict-20250918-222044-TFDLWFG.ts +0 -30
  28. package/@types/forms/controls/file.d.sync-conflict-20250918-222045-TFDLWFG.ts +0 -13
  29. package/@types/forms/controls/form-control.d.sync-conflict-20250918-184322-TFDLWFG.ts +0 -19
  30. package/@types/forms/controls/form-control.d.sync-conflict-20250918-222046-TFDLWFG.ts +0 -19
  31. package/@types/forms/controls/multiple-files.d.sync-conflict-20250918-184318-TFDLWFG.ts +0 -42
  32. package/@types/forms/controls/multiple-photos.d.ts +0 -19
  33. package/@types/forms/controls/number.d.sync-conflict-20250918-222046-TFDLWFG.ts +0 -13
  34. package/@types/forms/controls/photo.d.sync-conflict-20250918-184321-TFDLWFG.ts +0 -19
  35. package/@types/forms/controls/photo.d.ts +0 -19
  36. package/@types/forms/controls/photo.test.d.ts +0 -1
  37. package/@types/forms/controls/reverse-single-reference.d.ts +0 -1
  38. package/@types/forms/controls/simple-input.d.sync-conflict-20250918-184310-TFDLWFG.ts +0 -33
  39. package/@types/forms/controls/simple-input.d.sync-conflict-20250918-222042-TFDLWFG.ts +0 -33
  40. package/@types/forms/controls/simple-input.sync-conflict-20250918-222045-TFDLWFG.d.ts +0 -33
  41. package/@types/forms/controls/table.d.sync-conflict-20250918-184302-TFDLWFG.ts +0 -39
  42. package/@types/forms/controls/table.sync-conflict-20250918-222042-TFDLWFG.d.ts +0 -39
  43. package/@types/forms/controls/textarea.d.sync-conflict-20250918-222045-TFDLWFG.ts +0 -25
  44. package/@types/forms/fields/boolean.d.sync-conflict-20250918-184325-TFDLWFG.ts +0 -22
  45. package/@types/forms/fields/boolean.sync-conflict-20250918-222042-TFDLWFG.d.ts +0 -22
  46. package/@types/forms/fields/checkboxed-list.d.sync-conflict-20250918-184325-TFDLWFG.ts +0 -23
  47. package/@types/forms/fields/collection-field.d.sync-conflict-20250918-184319-TFDLWFG.ts +0 -22
  48. package/@types/forms/fields/collection-field.d.sync-conflict-20250918-222047-TFDLWFG.ts +0 -22
  49. package/@types/forms/fields/coordinates.d.sync-conflict-20250918-222044-TFDLWFG.ts +0 -14
  50. package/@types/forms/fields/datetime.d.sync-conflict-20250918-222050-TFDLWFG.ts +0 -4
  51. package/@types/forms/fields/email.d.sync-conflict-20250918-184303-TFDLWFG.ts +0 -8
  52. package/@types/forms/fields/enum-multiple-sealious.sync-conflict-20250918-222047-TFDLWFG.d.ts +0 -16
  53. package/@types/forms/fields/enum-multiple.d.ts +0 -18
  54. package/@types/forms/fields/enum-multiple.test.d.ts +0 -1
  55. package/@types/forms/fields/enum.d.ts +0 -18
  56. package/@types/forms/fields/enum.test.d.ts +0 -1
  57. package/@types/forms/fields/field.d.sync-conflict-20250918-184306-TFDLWFG.ts +0 -70
  58. package/@types/forms/fields/fields.d.sync-conflict-20250918-184314-TFDLWFG.ts +0 -29
  59. package/@types/forms/fields/file.d.sync-conflict-20250918-184310-TFDLWFG.ts +0 -23
  60. package/@types/forms/fields/file.d.sync-conflict-20250918-222046-TFDLWFG.ts +0 -23
  61. package/@types/forms/fields/file.sync-conflict-20250918-222049-TFDLWFG.d.ts +0 -23
  62. package/@types/forms/fields/get-field-for-sealious.d.sync-conflict-20250918-222046-TFDLWFG.ts +0 -29
  63. package/@types/forms/fields/get-field-for-sealious.sync-conflict-20250918-222042-TFDLWFG.d.ts +0 -29
  64. package/@types/forms/fields/image.d.sync-conflict-20250918-222042-TFDLWFG.ts +0 -5
  65. package/@types/forms/fields/multiple-files.d.sync-conflict-20250918-184304-TFDLWFG.ts +0 -16
  66. package/@types/forms/fields/number.d.sync-conflict-20250918-184317-TFDLWFG.ts +0 -25
  67. package/@types/forms/fields/number.d.sync-conflict-20250918-222047-TFDLWFG.ts +0 -25
  68. package/@types/forms/fields/pick-from-list.d.sync-conflict-20250918-184322-TFDLWFG.ts +0 -15
  69. package/@types/forms/fields/proxy-field.d.sync-conflict-20250918-184307-TFDLWFG.ts +0 -15
  70. package/@types/forms/fields/regexp.d.sync-conflict-20250918-184305-TFDLWFG.ts +0 -21
  71. package/@types/forms/fields/regexp.d.sync-conflict-20250918-222045-TFDLWFG.ts +0 -21
  72. package/@types/forms/fields/regexp.sync-conflict-20250918-222047-TFDLWFG.d.ts +0 -21
  73. package/@types/forms/fields/reverse-single-reference.d.ts +0 -13
  74. package/@types/forms/fields/simple-form-field.d.sync-conflict-20250918-184309-TFDLWFG.ts +0 -29
  75. package/@types/forms/fields/simple-form-field.d.sync-conflict-20250918-222044-TFDLWFG.ts +0 -29
  76. package/@types/forms/fields/simple-form-field.sync-conflict-20250918-222049-TFDLWFG.d.ts +0 -29
  77. package/@types/forms/fields/single-reference.sync-conflict-20250918-222043-TFDLWFG.d.ts +0 -10
  78. package/@types/forms/fields/structured-array.d.sync-conflict-20250918-184302-TFDLWFG.ts +0 -27
  79. package/@types/forms/fields/structured-array.d.sync-conflict-20250918-222049-TFDLWFG.ts +0 -27
  80. package/@types/forms/fields/structured-array.sync-conflict-20250918-222047-TFDLWFG.d.ts +0 -27
  81. package/@types/forms/fields/table.d.sync-conflict-20250918-184303-TFDLWFG.ts +0 -16
  82. package/@types/forms/form-types.d.sync-conflict-20250918-222045-TFDLWFG.ts +0 -26
  83. package/@types/forms/form.d.sync-conflict-20250918-184315-TFDLWFG.ts +0 -32
  84. package/@types/forms/form.d.sync-conflict-20250918-222049-TFDLWFG.ts +0 -32
  85. package/@types/forms/form.sync-conflict-20250918-222049-TFDLWFG.d.ts +0 -33
  86. package/@types/forms/form.test.d.sync-conflict-20250918-184318-TFDLWFG.ts +0 -6
  87. package/@types/forms/form.test.d.sync-conflict-20250918-222047-TFDLWFG.ts +0 -6
  88. package/@types/forms/multiform.d.sync-conflict-20250918-184308-TFDLWFG.ts +0 -23
  89. package/@types/forms/multiform.sync-conflict-20250918-222044-TFDLWFG.d.ts +0 -23
  90. package/@types/index.d.sync-conflict-20250918-184316-TFDLWFG.ts +0 -46
  91. package/@types/mount.d.sync-conflict-20250918-184320-TFDLWFG.ts +0 -6
  92. package/@types/page/list.d.sync-conflict-20250918-184318-TFDLWFG.ts +0 -48
  93. package/@types/page/list.d.sync-conflict-20250918-222046-TFDLWFG.ts +0 -48
  94. package/@types/page/list.sync-conflict-20250918-222048-TFDLWFG.d.ts +0 -48
  95. package/@types/page/mountable-with-fields.d.sync-conflict-20250918-184321-TFDLWFG.ts +0 -42
  96. package/@types/page/mountable-with-fields.d.sync-conflict-20250918-222046-TFDLWFG.ts +0 -42
  97. package/@types/page/mountable-with-fields.sync-conflict-20250918-222044-TFDLWFG.d.ts +0 -42
  98. package/@types/page/mountable.d.sync-conflict-20250918-184306-TFDLWFG.ts +0 -10
  99. package/@types/page/page.d.sync-conflict-20250918-184320-TFDLWFG.ts +0 -18
  100. package/@types/page/props-parser.d.sync-conflict-20250918-184305-TFDLWFG.ts +0 -15
  101. package/@types/page/stateful-page.d.sync-conflict-20250918-184326-TFDLWFG.ts +0 -62
  102. package/@types/templates/shared/handlers/boolean.d.ts +0 -2
  103. package/@types/templates/shared/handlers/date.d.ts +0 -2
  104. package/@types/templates/shared/handlers/deep-reverse-single-reference.d.ts +0 -2
  105. package/@types/templates/shared/handlers/default.d.ts +0 -2
  106. package/@types/templates/shared/handlers/enum.d.ts +0 -2
  107. package/@types/templates/shared/handlers/file.d.ts +0 -2
  108. package/@types/templates/shared/handlers/image.d.ts +0 -2
  109. package/@types/templates/shared/handlers/int.d.ts +0 -2
  110. package/@types/templates/shared/handlers/jdd.d.ts +0 -2
  111. package/@types/templates/shared/handlers/single-reference.d.ts +0 -2
  112. package/@types/templates/shared/handlers/structured-array.d.ts +0 -2
  113. package/@types/templates/shared/shared-crud-form-fields.d.sync-conflict-20250918-184306-TFDLWFG.ts +0 -1
  114. package/@types/test_utils/test-on-real-app.d.sync-conflict-20250918-184320-TFDLWFG.ts +0 -26
  115. package/@types/utils/extract-fields-from-collection.d.sync-conflict-20250918-184312-TFDLWFG.ts +0 -18
  116. package/@types/utils/extract-fields-from-collection.sync-conflict-20250918-222045-TFDLWFG.d.ts +0 -18
  117. /package/@types/{add-crud.d.sync-conflict-20250918-184311-TFDLWFG.ts → app-config/get-app-port.test.d.ts} +0 -0
  118. /package/@types/{crud-field-snippets.d.sync-conflict-20250918-184323-TFDLWFG.ts → app-config/load-app-config.test.d.ts} +0 -0
@@ -1,62 +0,0 @@
1
- import Router from "@koa/router";
2
- import { Context } from "koa";
3
- import { Templatable } from "tempstream";
4
- import { Mountable } from "./mountable.js";
5
- export type StatefulPageActionDescription<ActionName> = {
6
- action: ActionName;
7
- label?: string;
8
- content?: string;
9
- disabled?: boolean;
10
- } | ActionName;
11
- export type StateAndMetadata<State, Actions> = {
12
- state: State;
13
- inputs: Record<string, string>;
14
- action: keyof Actions;
15
- action_args: string;
16
- } | {
17
- state: State;
18
- inputs: Record<string, string>;
19
- action: null;
20
- action_args: null;
21
- $: Record<string, unknown>;
22
- };
23
- export type StatefulPageActionArgument<State extends Record<string, unknown>, Args extends unknown[] = unknown[]> = {
24
- ctx: Context;
25
- state: State;
26
- inputs: Record<string, string>;
27
- args: Args;
28
- page: StatefulPage<any, any>;
29
- };
30
- export type StatefulPageAction<State extends Record<string, unknown>, Args extends unknown[] = unknown[]> = (obj: StatefulPageActionArgument<State, Args>) => State | Promise<State>;
31
- export type ExtractStatefulPageActionArgs<X> = X extends StatefulPageAction<any, infer Args> ? Args : never;
32
- export declare abstract class StatefulPage<State extends Record<string, unknown>, Actions extends Record<string, StatefulPageAction<State>>> extends Mountable {
33
- abstract actions: Actions;
34
- abstract getInitialState(ctx: Context): State | Promise<State>;
35
- abstract render(ctx: Context, state: State, inputs: Record<string, string>): Templatable | Promise<Templatable>;
36
- canAccess(_ctx: Context): Promise<{
37
- canAccess: boolean;
38
- message: string;
39
- }>;
40
- constructor();
41
- abstract wrapInLayout(ctx: Context, content: Templatable, state: State): Templatable;
42
- wrapInForm(context: Context, state: State, content: Templatable): Promise<Templatable>;
43
- extractActionAndLabel<ActionName extends keyof Actions>(action_description: StatefulPageActionDescription<ActionName>): {
44
- action: string;
45
- label: string;
46
- content: string;
47
- disabled: boolean;
48
- };
49
- makeActionURL<ActionName extends keyof Actions>(action_description: StatefulPageActionDescription<ActionName>, ...args: ExtractStatefulPageActionArgs<Actions[ActionName]>): string;
50
- makeActionButton<ActionName extends keyof Actions>(_state: State, action_description: StatefulPageActionDescription<ActionName>, ...args: ExtractStatefulPageActionArgs<Actions[ActionName]>): string;
51
- makeActionCallback<ActionName extends keyof Actions>(action_description: {
52
- action: ActionName;
53
- label?: string;
54
- } | ActionName, ...args: ExtractStatefulPageActionArgs<Actions[ActionName]>): string;
55
- rerender(): string;
56
- preprocessState(values: State): Promise<State>;
57
- preprocessOverrides(_context: Context, _state: State, values: Record<string, unknown>): Promise<Record<string, unknown>>;
58
- serializeState(_context: Context, state: State): Promise<string>;
59
- deserializeState(_context: Context, s: string): Promise<State>;
60
- extractState(ctx: Context): Promise<StateAndMetadata<State, Actions>>;
61
- mount(router: Router, path: string): void;
62
- }
@@ -1,2 +0,0 @@
1
- import { FieldHandler, FieldHandlerResult } from "../shared-crud-form-fields.js";
2
- export declare const boolean_handler: FieldHandler<FieldHandlerResult, Partial<FieldHandlerResult>>;
@@ -1,2 +0,0 @@
1
- import { FieldHandler, FieldHandlerResult } from "../shared-crud-form-fields.js";
2
- export declare const date_handler: FieldHandler<FieldHandlerResult, Partial<FieldHandlerResult>>;
@@ -1,2 +0,0 @@
1
- import { FieldHandler, FieldHandlerResult } from "../shared-crud-form-fields.js";
2
- export declare const deep_reverse_single_reference_handler: FieldHandler<FieldHandlerResult, Partial<FieldHandlerResult>>;
@@ -1,2 +0,0 @@
1
- import { FieldHandler, FieldHandlerResult } from "../shared-crud-form-fields.js";
2
- export declare const default_handler: FieldHandler<Record<string, never>, FieldHandlerResult>;
@@ -1,2 +0,0 @@
1
- import { FieldHandler, FieldHandlerResult } from "../shared-crud-form-fields.js";
2
- export declare const enum_handler: FieldHandler<FieldHandlerResult, Partial<FieldHandlerResult>>;
@@ -1,2 +0,0 @@
1
- import { FieldHandler, FieldHandlerResult } from "../shared-crud-form-fields.js";
2
- export declare const file_handler: FieldHandler<FieldHandlerResult, Partial<FieldHandlerResult>>;
@@ -1,2 +0,0 @@
1
- import { FieldHandler, FieldHandlerResult } from "../shared-crud-form-fields.js";
2
- export declare const image_handler: FieldHandler<FieldHandlerResult, Partial<FieldHandlerResult>>;
@@ -1,2 +0,0 @@
1
- import { FieldHandler, FieldHandlerResult } from "../shared-crud-form-fields.js";
2
- export declare const int_handler: FieldHandler<FieldHandlerResult, Partial<FieldHandlerResult>>;
@@ -1,2 +0,0 @@
1
- import { FieldHandler, FieldHandlerResult } from "../shared-crud-form-fields.js";
2
- export declare const jdd_handler: FieldHandler<FieldHandlerResult, Partial<FieldHandlerResult>>;
@@ -1,2 +0,0 @@
1
- import { FieldHandler, FieldHandlerResult } from "../shared-crud-form-fields.js";
2
- export declare const single_reference_handler: FieldHandler<FieldHandlerResult, Partial<FieldHandlerResult>>;
@@ -1,2 +0,0 @@
1
- import { FieldHandler, FieldHandlerResult } from "../shared-crud-form-fields.js";
2
- export declare const structured_array_handler: FieldHandler<FieldHandlerResult, Partial<FieldHandlerResult>>;
@@ -1 +0,0 @@
1
- export declare function sharedCrudFormFields(collection_name: string, newfilefullpath: string): Promise<string>;
@@ -1,26 +0,0 @@
1
- import EventEmitter from "events";
2
- export declare const callSealgenBin: () => string;
3
- export declare class RealAppTest {
4
- node_pid: number;
5
- app_port: number;
6
- mongo_port: number;
7
- app_path: string;
8
- container_name: string;
9
- emitter: EventEmitter<[never]>;
10
- static init(): Promise<RealAppTest>;
11
- start(): Promise<void>;
12
- close(): Promise<void>;
13
- runSealgenCommand(command: string): Promise<void>;
14
- build(): Promise<void>;
15
- throwIfItKillsTheApp<T>(cb: () => Promise<T>): Promise<T>;
16
- httpGET(path: string): Promise<{
17
- status: number;
18
- response: string;
19
- }>;
20
- httpPOST(path: string, body: Record<string, unknown>): Promise<{
21
- status: number;
22
- response: string;
23
- }>;
24
- addFile(target_path: string, content: string): Promise<void>;
25
- fullURL(path: string): string;
26
- }
@@ -1,18 +0,0 @@
1
- import { FormField } from "../forms/fields/field.js";
2
- export type ExtractedFieldInfo = {
3
- name: string;
4
- type: string;
5
- target: string | null;
6
- referencing_collection: string | null;
7
- referencing_field: string | null;
8
- intermediary_field_that_points_there: string | null;
9
- is_readonly: boolean;
10
- is_required: boolean;
11
- subfields: {
12
- name: string;
13
- }[];
14
- };
15
- export type ExtractedFieldInfoWithFormField = ExtractedFieldInfo & {
16
- form_field: FormField;
17
- };
18
- export default function extract_fields_from_collection(collection_name: string): Promise<ExtractedFieldInfoWithFormField[]>;
@@ -1,18 +0,0 @@
1
- import { FormField } from "../forms/fields/field.js";
2
- export type ExtractedFieldInfo = {
3
- name: string;
4
- type: string;
5
- target: string | null;
6
- referencing_collection: string | null;
7
- referencing_field: string | null;
8
- intermediary_field_that_points_there: string | null;
9
- is_readonly: boolean;
10
- is_required: boolean;
11
- subfields: {
12
- name: string;
13
- }[];
14
- };
15
- export type ExtractedFieldInfoWithFormField = ExtractedFieldInfo & {
16
- form_field: FormField;
17
- };
18
- export default function extract_fields_from_collection(collection_name: string): Promise<ExtractedFieldInfoWithFormField[]>;