@requence/service 1.0.0-alpha.4 → 1.0.0-alpha.40

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 (94) hide show
  1. package/CHANGELOG.md +216 -0
  2. package/build/{chunk-0x9092n4.js → chunk-6w7td62p.js} +5 -44
  3. package/build/chunk-6w7td62p.js.map +10 -0
  4. package/build/cli.js +19 -12
  5. package/build/cli.js.map +3 -3
  6. package/build/index.js +930 -863
  7. package/build/index.js.map +18 -16
  8. package/build/types/helpers/src/files/RequenceFile.d.ts +40 -0
  9. package/build/types/helpers/src/files/RequenceFile.d.ts.map +1 -0
  10. package/build/types/helpers/src/files/RequenceStream.d.ts +32 -0
  11. package/build/types/helpers/src/files/RequenceStream.d.ts.map +1 -0
  12. package/build/types/helpers/src/files/fileObject.d.ts +16 -0
  13. package/build/types/helpers/src/files/fileObject.d.ts.map +1 -0
  14. package/build/types/helpers/src/files/index.d.ts +7 -0
  15. package/build/types/helpers/src/files/index.d.ts.map +1 -0
  16. package/build/types/helpers/src/files/isValidMimeType.d.ts +5 -0
  17. package/build/types/helpers/src/files/isValidMimeType.d.ts.map +1 -0
  18. package/build/types/helpers/src/files/mapOutput.d.ts +10 -0
  19. package/build/types/helpers/src/files/mapOutput.d.ts.map +1 -0
  20. package/build/types/helpers/src/files/streamObject.d.ts +14 -0
  21. package/build/types/helpers/src/files/streamObject.d.ts.map +1 -0
  22. package/build/types/helpers/src/files/types.d.ts +4 -0
  23. package/build/types/helpers/src/files/types.d.ts.map +1 -0
  24. package/build/types/helpers/src/index.d.ts +10 -6
  25. package/build/types/helpers/src/index.d.ts.map +1 -1
  26. package/build/types/helpers/src/jsonschema/mapSchema.d.ts +20 -0
  27. package/build/types/helpers/src/jsonschema/mapSchema.d.ts.map +1 -0
  28. package/build/types/helpers/src/jsonschema/types.d.ts +12 -0
  29. package/build/types/helpers/src/jsonschema/types.d.ts.map +1 -0
  30. package/build/types/helpers/src/jsonschema/validate.d.ts +29 -0
  31. package/build/types/helpers/src/jsonschema/validate.d.ts.map +1 -0
  32. package/build/types/helpers/src/jsonschema/zod.d.ts +12 -0
  33. package/build/types/helpers/src/jsonschema/zod.d.ts.map +1 -0
  34. package/build/types/helpers/src/protocol/NodeTree.d.ts +447 -0
  35. package/build/types/helpers/src/protocol/NodeTree.d.ts.map +1 -0
  36. package/build/types/helpers/src/protocol/command.d.ts +471 -0
  37. package/build/types/helpers/src/protocol/command.d.ts.map +1 -0
  38. package/build/types/helpers/src/protocol/helpers.d.ts +5 -0
  39. package/build/types/helpers/src/protocol/helpers.d.ts.map +1 -0
  40. package/build/types/helpers/src/protocol/index.d.ts +8 -0
  41. package/build/types/helpers/src/protocol/index.d.ts.map +1 -0
  42. package/build/types/helpers/src/protocol/nodeType.d.ts +283 -0
  43. package/build/types/helpers/src/protocol/nodeType.d.ts.map +1 -0
  44. package/build/types/helpers/src/protocol/targetNodes.d.ts +253 -0
  45. package/build/types/helpers/src/protocol/targetNodes.d.ts.map +1 -0
  46. package/build/types/helpers/src/protocol/taskOptions.d.ts +22 -0
  47. package/build/types/helpers/src/protocol/taskOptions.d.ts.map +1 -0
  48. package/build/types/helpers/src/protocol/treeNodes.d.ts +636 -0
  49. package/build/types/helpers/src/protocol/treeNodes.d.ts.map +1 -0
  50. package/build/types/helpers/src/protocol/update.d.ts +354 -0
  51. package/build/types/helpers/src/protocol/update.d.ts.map +1 -0
  52. package/build/types/helpers/src/utils/callbackToAsyncIterator.d.ts +3 -0
  53. package/build/types/helpers/src/utils/callbackToAsyncIterator.d.ts.map +1 -0
  54. package/build/types/helpers/src/utils/clone.d.ts +3 -0
  55. package/build/types/helpers/src/utils/clone.d.ts.map +1 -0
  56. package/build/types/helpers/src/utils/createObjectProxy.d.ts +2 -0
  57. package/build/types/helpers/src/utils/createObjectProxy.d.ts.map +1 -0
  58. package/build/types/helpers/src/{createRemotePromise.d.ts → utils/createRemotePromise.d.ts} +1 -1
  59. package/build/types/helpers/src/utils/createRemotePromise.d.ts.map +1 -0
  60. package/build/types/helpers/src/utils/isRecord.d.ts +2 -0
  61. package/build/types/helpers/src/utils/isRecord.d.ts.map +1 -0
  62. package/build/types/helpers/src/utils/mapData.d.ts +18 -0
  63. package/build/types/helpers/src/utils/mapData.d.ts.map +1 -0
  64. package/build/types/helpers/src/{utils.d.ts → utils/matchSchema.d.ts} +2 -2
  65. package/build/types/helpers/src/utils/matchSchema.d.ts.map +1 -0
  66. package/build/types/helpers/src/utils/obfuscate.d.ts.map +1 -0
  67. package/build/types/helpers/src/utils/requenceCallback.d.ts +17 -0
  68. package/build/types/helpers/src/utils/requenceCallback.d.ts.map +1 -0
  69. package/build/types/helpers/src/utils/resolveRequenceTypes.d.ts +8 -0
  70. package/build/types/helpers/src/utils/resolveRequenceTypes.d.ts.map +1 -0
  71. package/build/types/helpers/src/utils/types.d.ts +4 -0
  72. package/build/types/helpers/src/utils/types.d.ts.map +1 -0
  73. package/build/types/service/src/createAmqpConnection.d.ts +19 -20
  74. package/build/types/service/src/createAmqpConnection.d.ts.map +1 -1
  75. package/build/types/service/src/helpers.d.ts +72 -99
  76. package/build/types/service/src/helpers.d.ts.map +1 -1
  77. package/build/types/service/src/index.d.ts +8 -4
  78. package/build/types/service/src/index.d.ts.map +1 -1
  79. package/build/types/service/src/macro.d.ts +2 -0
  80. package/build/types/service/src/macro.d.ts.map +1 -0
  81. package/build/types/service/src/mapInput.d.ts +2 -0
  82. package/build/types/service/src/mapInput.d.ts.map +1 -0
  83. package/build/types/service/src/utils.d.ts +6 -0
  84. package/build/types/service/src/utils.d.ts.map +1 -0
  85. package/package.json +7 -8
  86. package/build/chunk-0x9092n4.js.map +0 -12
  87. package/build/types/helpers/src/clone.d.ts +0 -3
  88. package/build/types/helpers/src/clone.d.ts.map +0 -1
  89. package/build/types/helpers/src/createObjectProxy.d.ts +0 -2
  90. package/build/types/helpers/src/createObjectProxy.d.ts.map +0 -1
  91. package/build/types/helpers/src/createRemotePromise.d.ts.map +0 -1
  92. package/build/types/helpers/src/obfuscate.d.ts.map +0 -1
  93. package/build/types/helpers/src/utils.d.ts.map +0 -1
  94. /package/build/types/helpers/src/{obfuscate.d.ts → utils/obfuscate.d.ts} +0 -0
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod/v4';
2
+ declare const streamObjectSchema: z.ZodObject<{
3
+ mime: z.ZodString;
4
+ url: z.ZodString;
5
+ __REQUENCE_type: z.ZodLiteral<"RequenceStream">;
6
+ }, z.core.$strip>;
7
+ export type StreamObject = z.infer<typeof streamObjectSchema>;
8
+ export declare function isStreamObject(data: unknown): data is StreamObject;
9
+ export declare function toStreamObject(streamInfo: {
10
+ mime: string;
11
+ url: string;
12
+ }): StreamObject;
13
+ export {};
14
+ //# sourceMappingURL=streamObject.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streamObject.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/files/streamObject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE1B,QAAA,MAAM,kBAAkB;;;;iBAItB,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE7D,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,YAAY,CAElE;AAED,wBAAgB,cAAc,CAAC,UAAU,EAAE;IACzC,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;CACZ,GAAG,YAAY,CAKf"}
@@ -0,0 +1,4 @@
1
+ export type MainMimeType<T extends string> = T extends `${infer V}/${string}` ? V extends '*' ? any : V : any;
2
+ export type SubMimeType<T extends string> = T extends `${string}/${infer V}` ? V extends '*' ? any : V : any;
3
+ export type ValidMimeType<T extends `${string}/${string}`> = T extends `${infer A}/${infer B}` ? A extends '*' | '' | '/' ? never : B extends '*' | '' | '/' ? never : T : never;
4
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/files/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,IAAI,MAAM,EAAE,GACzE,CAAC,SAAS,GAAG,GACX,GAAG,GACH,CAAC,GACH,GAAG,CAAA;AAEP,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,GAAG,MAAM,IAAI,MAAM,CAAC,EAAE,GACxE,CAAC,SAAS,GAAG,GACX,GAAG,GACH,CAAC,GACH,GAAG,CAAA;AAEP,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,GAAG,MAAM,IAAI,MAAM,EAAE,IACvD,CAAC,SAAS,GAAG,MAAM,CAAC,IAAI,MAAM,CAAC,EAAE,GAC7B,CAAC,SAAS,GAAG,GAAG,EAAE,GAAG,GAAG,GACtB,KAAK,GACL,CAAC,SAAS,GAAG,GAAG,EAAE,GAAG,GAAG,GACtB,KAAK,GACL,CAAC,GACL,KAAK,CAAA"}
@@ -1,7 +1,11 @@
1
- export * from './utils.ts';
2
- export * from './obfuscate.ts';
3
- export { default as clone } from './clone.ts';
4
- export { default as createObjectProxy } from './createObjectProxy.ts';
5
- export { default as createRemotePromise } from './createRemotePromise.ts';
6
- export { type RemotePromise } from './createRemotePromise.ts';
1
+ export * from './utils/matchSchema.ts';
2
+ export * from './utils/obfuscate.ts';
3
+ export * from './utils/clone.ts';
4
+ export * from './utils/createObjectProxy.ts';
5
+ export * from './utils/createRemotePromise.ts';
6
+ export * from './utils/callbackToAsyncIterator.ts';
7
+ export * from './utils/mapData.ts';
8
+ export * from './utils/isRecord.ts';
9
+ export * from './utils/resolveRequenceTypes.ts';
10
+ export * from './utils/requenceCallback.ts';
7
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../helpers/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AACzE,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../helpers/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,oCAAoC,CAAA;AAClD,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,6BAA6B,CAAA"}
@@ -0,0 +1,20 @@
1
+ import type { JSONSchema7Definition } from 'json-schema';
2
+ import type { JSONSchema7 } from './types.ts';
3
+ interface Visitor {
4
+ String?: (schema: JSONSchema7) => JSONSchema7 | void;
5
+ Integer?: (schema: JSONSchema7) => JSONSchema7 | void;
6
+ Boolean?: (schema: JSONSchema7) => JSONSchema7 | void;
7
+ Null?: (schema: JSONSchema7) => JSONSchema7 | void;
8
+ Number?: (schema: JSONSchema7) => JSONSchema7 | void;
9
+ Array?: (schema: JSONSchema7) => JSONSchema7 | void;
10
+ Object?: (schema: JSONSchema7) => JSONSchema7 | void;
11
+ AnyOf?: (schema: JSONSchema7) => JSONSchema7 | void;
12
+ AllOf?: (schema: JSONSchema7) => JSONSchema7 | void;
13
+ OneOf?: (schema: JSONSchema7) => JSONSchema7 | void;
14
+ $ref?: (schema: JSONSchema7) => JSONSchema7 | void;
15
+ Enum?: (schema: JSONSchema7) => JSONSchema7 | void;
16
+ RequenceType?: (schema: JSONSchema7) => JSONSchema7 | void;
17
+ }
18
+ export declare function mapSchema<T extends JSONSchema7Definition>(rawSchema: T, visitor: Visitor): T;
19
+ export {};
20
+ //# sourceMappingURL=mapSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapSchema.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/jsonschema/mapSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAExD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE7C,UAAU,OAAO;IACf,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,WAAW,GAAG,IAAI,CAAA;IACpD,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,WAAW,GAAG,IAAI,CAAA;IACrD,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,WAAW,GAAG,IAAI,CAAA;IACrD,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,WAAW,GAAG,IAAI,CAAA;IAClD,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,WAAW,GAAG,IAAI,CAAA;IACpD,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,WAAW,GAAG,IAAI,CAAA;IACnD,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,WAAW,GAAG,IAAI,CAAA;IACpD,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,WAAW,GAAG,IAAI,CAAA;IACnD,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,WAAW,GAAG,IAAI,CAAA;IACnD,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,WAAW,GAAG,IAAI,CAAA;IACnD,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,WAAW,GAAG,IAAI,CAAA;IAClD,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,WAAW,GAAG,IAAI,CAAA;IAClD,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,WAAW,GAAG,IAAI,CAAA;CAC3D;AAMD,wBAAgB,SAAS,CAAC,CAAC,SAAS,qBAAqB,EACvD,SAAS,EAAE,CAAC,EACZ,OAAO,EAAE,OAAO,GACf,CAAC,CAuFH"}
@@ -0,0 +1,12 @@
1
+ import type { JSONSchema7, JSONSchema7TypeName } from 'json-schema';
2
+ declare module 'json-schema' {
3
+ interface JSONSchema7 {
4
+ requenceType?: 'file' | 'stream' | 'callback';
5
+ arg?: JSONSchema7;
6
+ maxByteLength?: number;
7
+ instanceOf?: string;
8
+ accept?: string;
9
+ }
10
+ }
11
+ export type { JSONSchema7, JSONSchema7TypeName };
12
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/jsonschema/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEnE,OAAO,QAAQ,aAAa,CAAC;IAC3B,UAAU,WAAW;QACnB,YAAY,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAA;QAC7C,GAAG,CAAC,EAAE,WAAW,CAAA;QACjB,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB;CACF;AAED,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAA"}
@@ -0,0 +1,29 @@
1
+ import { Ajv as BaseAjv, type KeywordDefinition, type Options } from 'ajv';
2
+ import type { JSONSchema7 } from 'json-schema';
3
+ export declare class ValidationError extends Error {
4
+ readonly property?: string | undefined;
5
+ constructor(message: string, property?: string | undefined);
6
+ }
7
+ export declare const acceptKeyword: KeywordDefinition;
8
+ export declare const acceptKeywordEnforced: KeywordDefinition;
9
+ export declare const requenceTypeKeywords: KeywordDefinition;
10
+ export declare const instanceOfKeyword: KeywordDefinition;
11
+ export declare const maxByteLengthKeyword: KeywordDefinition;
12
+ export declare const maxByteLengthKeywordEnforced: KeywordDefinition;
13
+ export declare class Ajv extends BaseAjv {
14
+ constructor(options?: Options & {
15
+ enforeFileKeywords?: boolean;
16
+ });
17
+ }
18
+ export declare function validate<T extends JSONSchema7>(options: {
19
+ schema: T;
20
+ value: unknown;
21
+ property?: string;
22
+ allowAdditionalProperties?: boolean;
23
+ enforeFileKeywords?: boolean;
24
+ coerceTypes?: boolean;
25
+ removeAdditional?: boolean;
26
+ }): {
27
+ [x: string]: {};
28
+ };
29
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/jsonschema/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,IAAI,OAAO,EAEd,KAAK,iBAAiB,EACtB,KAAK,OAAO,EACb,MAAM,KAAK,CAAA;AAEZ,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAO9C,qBAAa,eAAgB,SAAQ,KAAK;aAGtB,QAAQ,CAAC,EAAE,MAAM;gBADjC,OAAO,EAAE,MAAM,EACC,QAAQ,CAAC,EAAE,MAAM,YAAA;CAIpC;AAED,eAAO,MAAM,aAAa,EAAE,iBAQ3B,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,iBAkBnC,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,iBAKlC,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,iBAkB/B,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,iBAOlC,CAAA;AAED,eAAO,MAAM,4BAA4B,EAAE,iBAmB1C,CAAA;AAMD,qBAAa,GAAI,SAAQ,OAAO;gBAClB,OAAO,CAAC,EAAE,OAAO,GAAG;QAAE,kBAAkB,CAAC,EAAE,OAAO,CAAA;KAAE;CAcjE;AAED,wBAAgB,QAAQ,CAAC,CAAC,SAAS,WAAW,EAAE,OAAO,EAAE;IACvD,MAAM,EAAE,CAAC,CAAA;IACT,KAAK,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,yBAAyB,CAAC,EAAE,OAAO,CAAA;IACnC,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;;EA0DA"}
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod/v4';
2
+ import type { JSONSchema7 } from './types.ts';
3
+ export declare const jsonSchema7Schema: z.ZodCustom<JSONSchema7, JSONSchema7>;
4
+ export declare const jsonSchema7ObjectSchema: z.ZodIntersection<z.ZodObject<{
5
+ type: z.ZodLiteral<"object">;
6
+ }, z.core.$strip>, z.ZodCustom<JSONSchema7, JSONSchema7>>;
7
+ export declare const jsonSchema7NullSchema: z.ZodObject<{
8
+ type: z.ZodLiteral<"null">;
9
+ }, z.core.$strip>;
10
+ export type JSONSchema7Object = z.infer<typeof jsonSchema7ObjectSchema>;
11
+ export type JSONSchema7Null = z.infer<typeof jsonSchema7NullSchema>;
12
+ //# sourceMappingURL=zod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zod.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/jsonschema/zod.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAI7C,eAAO,MAAM,iBAAiB,uCAoC5B,CAAA;AAEF,eAAO,MAAM,uBAAuB;;yDAIX,CAAA;AAEzB,eAAO,MAAM,qBAAqB;;iBAEhC,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AACvE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA"}
@@ -0,0 +1,447 @@
1
+ import { ERROR, type TreeEdge, type TreeNode } from './nodeType.ts';
2
+ export type OutputName = string | null | typeof ERROR;
3
+ type ExtendedTreeEdge = TreeEdge & {
4
+ traversed: number;
5
+ data?: string;
6
+ };
7
+ interface NodeTreeOptions {
8
+ nodes: TreeNode[];
9
+ edges: TreeEdge[] | ExtendedTreeEdge[];
10
+ data?: Map<string, {
11
+ data: unknown;
12
+ overwrite: boolean;
13
+ }>;
14
+ }
15
+ export declare class NodeTree {
16
+ private nodes;
17
+ private edges;
18
+ private data;
19
+ readonly cycles: {
20
+ node: TreeNode;
21
+ name: OutputName;
22
+ }[][];
23
+ readonly entryNode: Extract<TreeNode, {
24
+ type: 'entry';
25
+ }>;
26
+ constructor({ nodes, edges, data }: NodeTreeOptions);
27
+ pack(): (({
28
+ id: string;
29
+ type: "exit";
30
+ alias?: string | undefined;
31
+ } | {
32
+ id: string;
33
+ type: "entry";
34
+ inputSchema: import("json-schema").JSONSchema7;
35
+ outputs: {
36
+ name: string | typeof ERROR | null;
37
+ schema: import("json-schema").JSONSchema7 | null;
38
+ }[];
39
+ alias?: string | undefined;
40
+ } | {
41
+ id: string;
42
+ type: "service";
43
+ inputSchema: ({
44
+ type: "object";
45
+ } & import("json-schema").JSONSchema7) | {
46
+ type: "null";
47
+ };
48
+ name: string;
49
+ version: string;
50
+ configurationSchema: import("json-schema").JSONSchema7;
51
+ outputs: {
52
+ name: string | typeof ERROR | null;
53
+ schema: import("json-schema").JSONSchema7 | null;
54
+ }[];
55
+ alias?: string | undefined;
56
+ configuration?: any;
57
+ ttl?: number | undefined;
58
+ retry?: number | undefined;
59
+ retryDelay?: number | undefined;
60
+ } | {
61
+ id: string;
62
+ type: "logic";
63
+ script: string;
64
+ concurrency: boolean;
65
+ language: "javascript" | "python" | "typescript";
66
+ maxExecutionTime: number;
67
+ outputs: {
68
+ name: string | typeof ERROR | null;
69
+ schema: import("json-schema").JSONSchema7 | null;
70
+ }[];
71
+ alias?: string | undefined;
72
+ } | {
73
+ id: string;
74
+ type: "or";
75
+ outputs: {
76
+ name: string | typeof ERROR | null;
77
+ schema: import("json-schema").JSONSchema7 | null;
78
+ }[];
79
+ alias?: string | undefined;
80
+ } | {
81
+ id: string;
82
+ type: "reference";
83
+ reference: string;
84
+ outputs: {
85
+ name: string | typeof ERROR | null;
86
+ schema: import("json-schema").JSONSchema7 | null;
87
+ }[];
88
+ alias?: string | undefined;
89
+ configuration?: any;
90
+ })[] | ExtendedTreeEdge[] | Map<string, {
91
+ data: unknown;
92
+ overwrite: boolean;
93
+ }>)[];
94
+ static get ERROR(): typeof ERROR;
95
+ getPossiblePathsTo(nodeId: string, allowMultipleOutputs?: boolean): {
96
+ nodeId: string;
97
+ name: OutputName;
98
+ }[][];
99
+ getNodes(condition?: (node: TreeNode) => boolean): ({
100
+ id: string;
101
+ type: "exit";
102
+ alias?: string | undefined;
103
+ } | {
104
+ id: string;
105
+ type: "entry";
106
+ inputSchema: import("json-schema").JSONSchema7;
107
+ outputs: {
108
+ name: string | typeof ERROR | null;
109
+ schema: import("json-schema").JSONSchema7 | null;
110
+ }[];
111
+ alias?: string | undefined;
112
+ } | {
113
+ id: string;
114
+ type: "service";
115
+ inputSchema: ({
116
+ type: "object";
117
+ } & import("json-schema").JSONSchema7) | {
118
+ type: "null";
119
+ };
120
+ name: string;
121
+ version: string;
122
+ configurationSchema: import("json-schema").JSONSchema7;
123
+ outputs: {
124
+ name: string | typeof ERROR | null;
125
+ schema: import("json-schema").JSONSchema7 | null;
126
+ }[];
127
+ alias?: string | undefined;
128
+ configuration?: any;
129
+ ttl?: number | undefined;
130
+ retry?: number | undefined;
131
+ retryDelay?: number | undefined;
132
+ } | {
133
+ id: string;
134
+ type: "logic";
135
+ script: string;
136
+ concurrency: boolean;
137
+ language: "javascript" | "python" | "typescript";
138
+ maxExecutionTime: number;
139
+ outputs: {
140
+ name: string | typeof ERROR | null;
141
+ schema: import("json-schema").JSONSchema7 | null;
142
+ }[];
143
+ alias?: string | undefined;
144
+ } | {
145
+ id: string;
146
+ type: "or";
147
+ outputs: {
148
+ name: string | typeof ERROR | null;
149
+ schema: import("json-schema").JSONSchema7 | null;
150
+ }[];
151
+ alias?: string | undefined;
152
+ } | {
153
+ id: string;
154
+ type: "reference";
155
+ reference: string;
156
+ outputs: {
157
+ name: string | typeof ERROR | null;
158
+ schema: import("json-schema").JSONSchema7 | null;
159
+ }[];
160
+ alias?: string | undefined;
161
+ configuration?: any;
162
+ })[];
163
+ getNode(condition: (node: TreeNode) => boolean): TreeNode | undefined;
164
+ getChildren(nodeId: string, outputName: OutputName): ({
165
+ id: string;
166
+ type: "exit";
167
+ alias?: string | undefined;
168
+ } | {
169
+ id: string;
170
+ type: "entry";
171
+ inputSchema: import("json-schema").JSONSchema7;
172
+ outputs: {
173
+ name: string | typeof ERROR | null;
174
+ schema: import("json-schema").JSONSchema7 | null;
175
+ }[];
176
+ alias?: string | undefined;
177
+ } | {
178
+ id: string;
179
+ type: "service";
180
+ inputSchema: ({
181
+ type: "object";
182
+ } & import("json-schema").JSONSchema7) | {
183
+ type: "null";
184
+ };
185
+ name: string;
186
+ version: string;
187
+ configurationSchema: import("json-schema").JSONSchema7;
188
+ outputs: {
189
+ name: string | typeof ERROR | null;
190
+ schema: import("json-schema").JSONSchema7 | null;
191
+ }[];
192
+ alias?: string | undefined;
193
+ configuration?: any;
194
+ ttl?: number | undefined;
195
+ retry?: number | undefined;
196
+ retryDelay?: number | undefined;
197
+ } | {
198
+ id: string;
199
+ type: "logic";
200
+ script: string;
201
+ concurrency: boolean;
202
+ language: "javascript" | "python" | "typescript";
203
+ maxExecutionTime: number;
204
+ outputs: {
205
+ name: string | typeof ERROR | null;
206
+ schema: import("json-schema").JSONSchema7 | null;
207
+ }[];
208
+ alias?: string | undefined;
209
+ } | {
210
+ id: string;
211
+ type: "or";
212
+ outputs: {
213
+ name: string | typeof ERROR | null;
214
+ schema: import("json-schema").JSONSchema7 | null;
215
+ }[];
216
+ alias?: string | undefined;
217
+ } | {
218
+ id: string;
219
+ type: "reference";
220
+ reference: string;
221
+ outputs: {
222
+ name: string | typeof ERROR | null;
223
+ schema: import("json-schema").JSONSchema7 | null;
224
+ }[];
225
+ alias?: string | undefined;
226
+ configuration?: any;
227
+ })[];
228
+ getParents(nodeId: string): ({
229
+ id: string;
230
+ type: "exit";
231
+ alias?: string | undefined;
232
+ } | {
233
+ id: string;
234
+ type: "entry";
235
+ inputSchema: import("json-schema").JSONSchema7;
236
+ outputs: {
237
+ name: string | typeof ERROR | null;
238
+ schema: import("json-schema").JSONSchema7 | null;
239
+ }[];
240
+ alias?: string | undefined;
241
+ } | {
242
+ id: string;
243
+ type: "service";
244
+ inputSchema: ({
245
+ type: "object";
246
+ } & import("json-schema").JSONSchema7) | {
247
+ type: "null";
248
+ };
249
+ name: string;
250
+ version: string;
251
+ configurationSchema: import("json-schema").JSONSchema7;
252
+ outputs: {
253
+ name: string | typeof ERROR | null;
254
+ schema: import("json-schema").JSONSchema7 | null;
255
+ }[];
256
+ alias?: string | undefined;
257
+ configuration?: any;
258
+ ttl?: number | undefined;
259
+ retry?: number | undefined;
260
+ retryDelay?: number | undefined;
261
+ } | {
262
+ id: string;
263
+ type: "logic";
264
+ script: string;
265
+ concurrency: boolean;
266
+ language: "javascript" | "python" | "typescript";
267
+ maxExecutionTime: number;
268
+ outputs: {
269
+ name: string | typeof ERROR | null;
270
+ schema: import("json-schema").JSONSchema7 | null;
271
+ }[];
272
+ alias?: string | undefined;
273
+ } | {
274
+ id: string;
275
+ type: "or";
276
+ outputs: {
277
+ name: string | typeof ERROR | null;
278
+ schema: import("json-schema").JSONSchema7 | null;
279
+ }[];
280
+ alias?: string | undefined;
281
+ } | {
282
+ id: string;
283
+ type: "reference";
284
+ reference: string;
285
+ outputs: {
286
+ name: string | typeof ERROR | null;
287
+ schema: import("json-schema").JSONSchema7 | null;
288
+ }[];
289
+ alias?: string | undefined;
290
+ configuration?: any;
291
+ })[];
292
+ getAllParents(nodeId: string): ({
293
+ id: string;
294
+ type: "exit";
295
+ alias?: string | undefined;
296
+ } | {
297
+ id: string;
298
+ type: "entry";
299
+ inputSchema: import("json-schema").JSONSchema7;
300
+ outputs: {
301
+ name: string | typeof ERROR | null;
302
+ schema: import("json-schema").JSONSchema7 | null;
303
+ }[];
304
+ alias?: string | undefined;
305
+ } | {
306
+ id: string;
307
+ type: "service";
308
+ inputSchema: ({
309
+ type: "object";
310
+ } & import("json-schema").JSONSchema7) | {
311
+ type: "null";
312
+ };
313
+ name: string;
314
+ version: string;
315
+ configurationSchema: import("json-schema").JSONSchema7;
316
+ outputs: {
317
+ name: string | typeof ERROR | null;
318
+ schema: import("json-schema").JSONSchema7 | null;
319
+ }[];
320
+ alias?: string | undefined;
321
+ configuration?: any;
322
+ ttl?: number | undefined;
323
+ retry?: number | undefined;
324
+ retryDelay?: number | undefined;
325
+ } | {
326
+ id: string;
327
+ type: "logic";
328
+ script: string;
329
+ concurrency: boolean;
330
+ language: "javascript" | "python" | "typescript";
331
+ maxExecutionTime: number;
332
+ outputs: {
333
+ name: string | typeof ERROR | null;
334
+ schema: import("json-schema").JSONSchema7 | null;
335
+ }[];
336
+ alias?: string | undefined;
337
+ } | {
338
+ id: string;
339
+ type: "or";
340
+ outputs: {
341
+ name: string | typeof ERROR | null;
342
+ schema: import("json-schema").JSONSchema7 | null;
343
+ }[];
344
+ alias?: string | undefined;
345
+ } | {
346
+ id: string;
347
+ type: "reference";
348
+ reference: string;
349
+ outputs: {
350
+ name: string | typeof ERROR | null;
351
+ schema: import("json-schema").JSONSchema7 | null;
352
+ }[];
353
+ alias?: string | undefined;
354
+ configuration?: any;
355
+ })[];
356
+ /**
357
+ * normally a node is "reached" when all incoming edges are traversed with the following exceptions:
358
+ *
359
+ * when the incoming edge belongs to a service that is part of a loop where the questioned node is also part of,
360
+ * this incoming edge is considered traversed
361
+ *
362
+ * or nodes are "reaced" when at least one incoming edge is traversed
363
+ *
364
+ * the entry node is "reached" by default
365
+ */
366
+ isReached(nodeId: string): boolean;
367
+ getParentsWithEdgeHandle(nodeId: string): {
368
+ node: {
369
+ id: string;
370
+ type: "exit";
371
+ alias?: string | undefined;
372
+ } | {
373
+ id: string;
374
+ type: "entry";
375
+ inputSchema: import("json-schema").JSONSchema7;
376
+ outputs: {
377
+ name: string | typeof ERROR | null;
378
+ schema: import("json-schema").JSONSchema7 | null;
379
+ }[];
380
+ alias?: string | undefined;
381
+ } | {
382
+ id: string;
383
+ type: "service";
384
+ inputSchema: ({
385
+ type: "object";
386
+ } & import("json-schema").JSONSchema7) | {
387
+ type: "null";
388
+ };
389
+ name: string;
390
+ version: string;
391
+ configurationSchema: import("json-schema").JSONSchema7;
392
+ outputs: {
393
+ name: string | typeof ERROR | null;
394
+ schema: import("json-schema").JSONSchema7 | null;
395
+ }[];
396
+ alias?: string | undefined;
397
+ configuration?: any;
398
+ ttl?: number | undefined;
399
+ retry?: number | undefined;
400
+ retryDelay?: number | undefined;
401
+ } | {
402
+ id: string;
403
+ type: "logic";
404
+ script: string;
405
+ concurrency: boolean;
406
+ language: "javascript" | "python" | "typescript";
407
+ maxExecutionTime: number;
408
+ outputs: {
409
+ name: string | typeof ERROR | null;
410
+ schema: import("json-schema").JSONSchema7 | null;
411
+ }[];
412
+ alias?: string | undefined;
413
+ } | {
414
+ id: string;
415
+ type: "or";
416
+ outputs: {
417
+ name: string | typeof ERROR | null;
418
+ schema: import("json-schema").JSONSchema7 | null;
419
+ }[];
420
+ alias?: string | undefined;
421
+ } | {
422
+ id: string;
423
+ type: "reference";
424
+ reference: string;
425
+ outputs: {
426
+ name: string | typeof ERROR | null;
427
+ schema: import("json-schema").JSONSchema7 | null;
428
+ }[];
429
+ alias?: string | undefined;
430
+ configuration?: any;
431
+ };
432
+ handle: OutputName;
433
+ }[];
434
+ getTriggers(nodeId: string): string[];
435
+ traverse(nodeId: string, outputName: OutputName): void;
436
+ traverseWithData(nodeId: string, outputName: OutputName, data: unknown, overwrite?: boolean): void;
437
+ disconnect(sourceNodeId: string, sourceNodeOutputName: OutputName, targetNodeId: string): void;
438
+ getData(nodeId: string, outputName: OutputName): unknown;
439
+ traversed(sourceNodeId: string, targetNodeId: string): boolean;
440
+ getAllData(): Map<string, Map<OutputName, unknown>>;
441
+ getAggregatedDataByNode(targetNodeId: string): Record<string, unknown>;
442
+ getAggregatedData(targetNodeId: string): Record<string, unknown>;
443
+ reset(): void;
444
+ gc(): void;
445
+ }
446
+ export {};
447
+ //# sourceMappingURL=NodeTree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeTree.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/protocol/NodeTree.ts"],"names":[],"mappings":"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"}