@lark-base-open/base-database-toolchain 0.0.0-stage → 1.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 (52) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/LICENSE +6 -0
  3. package/README.md +82 -2
  4. package/bin/base-database-dev.mjs +4 -0
  5. package/bin/base-database-toolchain.mjs +22 -0
  6. package/dist/app-builder/core.d.mts +37 -0
  7. package/dist/app-builder/core.mjs +716 -0
  8. package/dist/app-builder/package.json +1 -0
  9. package/dist/app-builder/schema.d.ts +3 -0
  10. package/dist/app-builder/schema.js +71 -0
  11. package/dist/contract-conversion.d.ts +41 -0
  12. package/dist/contract-conversion.js +116 -0
  13. package/dist/contract-extractor.d.ts +23 -0
  14. package/dist/contract-extractor.js +245 -0
  15. package/dist/data/development-pairing.json +11 -0
  16. package/dist/data/template-hmr-scripts.json +9 -0
  17. package/dist/dependency-inputs.d.ts +3 -0
  18. package/dist/dependency-inputs.js +18 -0
  19. package/dist/dev-ipc-worker.d.ts +1 -0
  20. package/dist/dev-ipc-worker.js +35 -0
  21. package/dist/dev-redaction.d.ts +1 -0
  22. package/dist/dev-redaction.js +3 -0
  23. package/dist/dev-snapshot.d.ts +3 -0
  24. package/dist/dev-snapshot.js +98 -0
  25. package/dist/dev-vite-server.d.ts +14 -0
  26. package/dist/dev-vite-server.js +213 -0
  27. package/dist/dev-worker.d.mts +1 -0
  28. package/dist/dev-worker.mjs +134 -0
  29. package/dist/development-pairing.generated.d.ts +11 -0
  30. package/dist/development-pairing.generated.js +12 -0
  31. package/dist/development.d.ts +6 -0
  32. package/dist/development.js +6 -0
  33. package/dist/durable-runner.d.ts +102 -0
  34. package/dist/durable-runner.js +128 -0
  35. package/dist/function-batch.d.ts +48 -0
  36. package/dist/function-batch.js +99 -0
  37. package/dist/go-adapter.d.mts +11 -0
  38. package/dist/go-adapter.mjs +847 -0
  39. package/dist/index.d.ts +8 -0
  40. package/dist/index.js +8 -0
  41. package/dist/page-bootstrap.d.ts +3 -0
  42. package/dist/page-bootstrap.js +178 -0
  43. package/dist/page-inspection.d.ts +11 -0
  44. package/dist/page-inspection.js +49 -0
  45. package/dist/page-link-guard.d.ts +12 -0
  46. package/dist/page-link-guard.js +137 -0
  47. package/dist/sdk-codegen.d.ts +16 -0
  48. package/dist/sdk-codegen.js +208 -0
  49. package/dist/trigger-validation.d.ts +75 -0
  50. package/dist/trigger-validation.js +73 -0
  51. package/npm-shrinkwrap.json +1193 -0
  52. package/package.json +87 -4
@@ -0,0 +1,75 @@
1
+ /** meta.json declarations; calendar and timezone semantics belong to deployment. */
2
+ export declare const triggerDeclarationsSchema: {
3
+ type: string;
4
+ items: {
5
+ type: string;
6
+ additionalProperties: boolean;
7
+ required: string[];
8
+ properties: {
9
+ id: {
10
+ type: string;
11
+ pattern: string;
12
+ };
13
+ type: {
14
+ const: string;
15
+ };
16
+ enabled: {
17
+ type: string;
18
+ };
19
+ input: {
20
+ type: string;
21
+ };
22
+ timer: {
23
+ type: string;
24
+ additionalProperties: boolean;
25
+ required: string[];
26
+ properties: {
27
+ startAt: {
28
+ type: string;
29
+ minLength: number;
30
+ };
31
+ timezone: {
32
+ type: string;
33
+ minLength: number;
34
+ };
35
+ endDate: {
36
+ type: string;
37
+ minLength: number;
38
+ };
39
+ repeat: {
40
+ type: string;
41
+ additionalProperties: boolean;
42
+ required: string[];
43
+ properties: {
44
+ unit: {
45
+ enum: string[];
46
+ };
47
+ interval: {
48
+ type: string;
49
+ minimum: number;
50
+ maximum: number;
51
+ };
52
+ };
53
+ allOf: {
54
+ if: {
55
+ properties: {
56
+ unit: {
57
+ enum: string[];
58
+ };
59
+ };
60
+ };
61
+ then: {
62
+ properties: {
63
+ interval: {
64
+ const: number;
65
+ };
66
+ };
67
+ };
68
+ }[];
69
+ };
70
+ };
71
+ };
72
+ };
73
+ };
74
+ };
75
+ export declare function validateTriggerDeclarations(value: unknown, inputSchema: Record<string, unknown>, path: string, seen: Set<string>): void;
@@ -0,0 +1,73 @@
1
+ import { Ajv2020 } from 'ajv/dist/2020.js';
2
+ /** meta.json declarations; calendar and timezone semantics belong to deployment. */
3
+ export const triggerDeclarationsSchema = {
4
+ type: 'array',
5
+ items: {
6
+ type: 'object',
7
+ additionalProperties: false,
8
+ required: ['id', 'type', 'timer'],
9
+ properties: {
10
+ id: { type: 'string', pattern: '^[A-Za-z0-9_-]{1,64}$' },
11
+ type: { const: 'timer' },
12
+ enabled: { type: 'boolean' },
13
+ input: { type: 'object' },
14
+ timer: {
15
+ type: 'object',
16
+ additionalProperties: false,
17
+ required: ['startAt', 'timezone', 'repeat'],
18
+ properties: {
19
+ startAt: { type: 'string', minLength: 1 },
20
+ timezone: { type: 'string', minLength: 1 },
21
+ endDate: { type: 'string', minLength: 1 },
22
+ repeat: {
23
+ type: 'object',
24
+ additionalProperties: false,
25
+ required: ['unit', 'interval'],
26
+ properties: {
27
+ unit: {
28
+ enum: [
29
+ 'NONE',
30
+ 'MINUTE',
31
+ 'HOUR',
32
+ 'DAY',
33
+ 'WEEK',
34
+ 'MONTH',
35
+ 'YEAR',
36
+ 'WEEKDAY',
37
+ ],
38
+ },
39
+ interval: { type: 'integer', minimum: 1, maximum: 1000 },
40
+ },
41
+ allOf: [
42
+ {
43
+ if: { properties: { unit: { enum: ['NONE', 'WEEKDAY'] } } },
44
+ then: { properties: { interval: { const: 1 } } },
45
+ },
46
+ ],
47
+ },
48
+ },
49
+ },
50
+ },
51
+ },
52
+ };
53
+ const ajv = new Ajv2020({
54
+ allErrors: true,
55
+ strict: false,
56
+ validateFormats: false,
57
+ });
58
+ const validateDeclarations = ajv.compile(triggerDeclarationsSchema);
59
+ export function validateTriggerDeclarations(value, inputSchema, path, seen) {
60
+ if (value === undefined)
61
+ return;
62
+ if (!validateDeclarations(value))
63
+ throw new Error(`TRIGGER_INVALID: ${path}/triggers: ${ajv.errorsText(validateDeclarations.errors)}`);
64
+ const validateInput = ajv.compile(inputSchema);
65
+ for (const [index, trigger] of value.entries()) {
66
+ const location = `${path}/triggers/${index}`;
67
+ if (seen.has(trigger.id))
68
+ throw new Error(`TRIGGER_ID_DUPLICATE: ${location}/id: ${trigger.id}`);
69
+ seen.add(trigger.id);
70
+ if (!validateInput(trigger.input ?? {}))
71
+ throw new Error(`INPUT_INVALID: ${location}/input: ${ajv.errorsText(validateInput.errors)}`);
72
+ }
73
+ }