@restatedev/restate-sdk-core 1.16.8 → 1.17.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.
package/dist/core.d.ts CHANGED
@@ -1,31 +1,33 @@
1
- //#region src/core.d.ts
2
- interface RestateContext {}
3
- interface RestateObjectContext {}
4
- interface RestateObjectSharedContext {}
5
- interface RestateWorkflowSharedContext extends RestateObjectSharedContext {}
6
- interface RestateWorkflowContext extends RestateObjectContext, RestateWorkflowSharedContext {}
7
- type ArgType<T> = T extends ((ctx: any) => any) ? void : T extends ((ctx: any, input: infer I) => any) ? I : never;
8
- type HandlerReturnType<T> = T extends ((ctx: any, input: any) => Promise<infer R>) ? R : never;
9
- type ServiceHandler<F, C = RestateContext> = F extends ((ctx: C) => Promise<any>) ? F : F extends ((ctx: C, input: any) => Promise<any>) ? F : (ctx: C, input?: any) => Promise<any>;
10
- type ServiceDefinition<P extends string, M> = {
11
- name: P;
1
+ export interface RestateContext {
2
+ }
3
+ export interface RestateObjectContext {
4
+ }
5
+ export interface RestateObjectSharedContext {
6
+ }
7
+ export interface RestateWorkflowSharedContext extends RestateObjectSharedContext {
8
+ }
9
+ export interface RestateWorkflowContext extends RestateObjectContext, RestateWorkflowSharedContext {
10
+ }
11
+ export type ArgType<T> = T extends (ctx: any) => any ? void : T extends (ctx: any, input: infer I) => any ? I : never;
12
+ export type HandlerReturnType<T> = T extends (ctx: any, input: any) => Promise<infer R> ? R : never;
13
+ export type ServiceHandler<F, C = RestateContext> = F extends (ctx: C) => Promise<any> ? F : F extends (ctx: C, input: any) => Promise<any> ? F : (ctx: C, input?: any) => Promise<any>;
14
+ export type ServiceDefinition<P extends string, M> = {
15
+ name: P;
12
16
  };
13
- type Service<M> = M extends ServiceDefinition<string, infer S> ? S : M;
14
- type ServiceDefinitionFrom<M> = M extends ServiceDefinition<string, unknown> ? M : ServiceDefinition<string, M>;
15
- type ObjectSharedHandler<F, SC = RestateObjectSharedContext> = F extends ((ctx: SC, param: any) => Promise<any>) ? F : F extends ((ctx: SC) => Promise<any>) ? F : (ctx: SC, param?: any) => Promise<any>;
16
- type ObjectHandler<F, C = RestateObjectContext> = F extends ((ctx: C, param: any) => Promise<any>) ? F : F extends ((ctx: C) => Promise<any>) ? F : (ctx: C, param?: any) => Promise<any>;
17
- type VirtualObjectDefinition<P extends string, M> = {
18
- name: P;
17
+ export type Service<M> = M extends ServiceDefinition<string, infer S> ? S : M;
18
+ export type ServiceDefinitionFrom<M> = M extends ServiceDefinition<string, unknown> ? M : ServiceDefinition<string, M>;
19
+ export type ObjectSharedHandler<F, SC = RestateObjectSharedContext> = F extends (ctx: SC, param: any) => Promise<any> ? F : F extends (ctx: SC) => Promise<any> ? F : (ctx: SC, param?: any) => Promise<any>;
20
+ export type ObjectHandler<F, C = RestateObjectContext> = F extends (ctx: C, param: any) => Promise<any> ? F : F extends (ctx: C) => Promise<any> ? F : (ctx: C, param?: any) => Promise<any>;
21
+ export type VirtualObjectDefinition<P extends string, M> = {
22
+ name: P;
19
23
  };
20
- type VirtualObject<M> = M extends VirtualObjectDefinition<string, infer O> ? O : M;
21
- type VirtualObjectDefinitionFrom<M> = M extends VirtualObjectDefinition<string, unknown> ? M : VirtualObjectDefinition<string, M>;
22
- type WorkflowSharedHandler<F, SC = RestateWorkflowSharedContext> = F extends ((ctx: SC, param: any) => Promise<any>) ? F : F extends ((ctx: SC) => Promise<any>) ? F : (ctx: SC, param?: any) => Promise<any>;
23
- type WorkflowHandler<F, C = RestateWorkflowContext> = F extends ((ctx: C, param: any) => Promise<any>) ? F : F extends ((ctx: C) => Promise<any>) ? F : (ctx: C, param?: any) => Promise<any>;
24
- type WorkflowDefinition<P extends string, M> = {
25
- name: P;
24
+ export type VirtualObject<M> = M extends VirtualObjectDefinition<string, infer O> ? O : M;
25
+ export type VirtualObjectDefinitionFrom<M> = M extends VirtualObjectDefinition<string, unknown> ? M : VirtualObjectDefinition<string, M>;
26
+ export type WorkflowSharedHandler<F, SC = RestateWorkflowSharedContext> = F extends (ctx: SC, param: any) => Promise<any> ? F : F extends (ctx: SC) => Promise<any> ? F : (ctx: SC, param?: any) => Promise<any>;
27
+ export type WorkflowHandler<F, C = RestateWorkflowContext> = F extends (ctx: C, param: any) => Promise<any> ? F : F extends (ctx: C) => Promise<any> ? F : (ctx: C, param?: any) => Promise<any>;
28
+ export type WorkflowDefinition<P extends string, M> = {
29
+ name: P;
26
30
  };
27
- type Workflow<M> = M extends WorkflowDefinition<string, infer W> ? W : M;
28
- type WorkflowDefinitionFrom<M> = M extends WorkflowDefinition<string, unknown> ? M : WorkflowDefinition<string, M>;
29
- //#endregion
30
- export { ArgType, HandlerReturnType, ObjectHandler, ObjectSharedHandler, RestateContext, RestateObjectContext, RestateObjectSharedContext, RestateWorkflowContext, RestateWorkflowSharedContext, Service, ServiceDefinition, ServiceDefinitionFrom, ServiceHandler, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, Workflow, WorkflowDefinition, WorkflowDefinitionFrom, WorkflowHandler, WorkflowSharedHandler };
31
+ export type Workflow<M> = M extends WorkflowDefinition<string, infer W> ? W : M;
32
+ export type WorkflowDefinitionFrom<M> = M extends WorkflowDefinition<string, unknown> ? M : WorkflowDefinition<string, M>;
31
33
  //# sourceMappingURL=core.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"core.d.ts","names":[],"sources":["../src/core.ts"],"sourcesContent":[],"mappings":";UAeiB,cAAA,EAAjB;AACiB,UAAA,oBAAA,CAAoB,CACrC;AAGiB,UAHA,0BAAA,CAG6B,CAC9C;AAKY,UANK,4BAAA,SAAqC,0BAMnC,CAAA;AAEf,UAPa,sBAAA,SACP,oBAMN,EAN4B,4BAM5B,CAAA;AACG,KAHK,OAGL,CAAA,CAAA,CAAA,GAHkB,CAGlB,UAAA,CAAA,GAAA,EAAA,GAAA,EAAA,GAAA,GAAA,IAAA,IAAA,GADH,CACG,UAAA,CAAA,GAAA,EAAA,GAAA,EAAA,KAAA,EAAA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,CAAC,GACD,CAAC,GAAG,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;AAE7C,MAAM,MAAM,eAAe,CAAC,CAAC,EAAE,CAAC,GAAG,sBAAsB,IAAI,CAAC,SAAS,CACrE,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,GAAG,KACP,OAAO,CAAC,GAAG,CAAC,GACb,CAAC,GACD,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,GAChC,CAAC,GACD,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;AAG5C,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,IAAI;IACpD,IAAI,EAAE,CAAC,CAAC;CACT,CAAC;AAEF,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEhF,MAAM,MAAM,sBAAsB,CAAC,CAAC,IAClC,CAAC,SAAS,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,GACzC,CAAC,GACD,kBAAkB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC"}
@@ -1,16 +1,13 @@
1
- //#region src/duration.d.ts
2
1
  /**
3
2
  * Duration type. Note that fields are additive.
4
3
  */
5
- type Duration = {
6
- days?: number;
7
- hours?: number;
8
- minutes?: number;
9
- seconds?: number;
10
- milliseconds?: number;
4
+ export type Duration = {
5
+ days?: number;
6
+ hours?: number;
7
+ minutes?: number;
8
+ seconds?: number;
9
+ milliseconds?: number;
11
10
  };
12
- declare function millisOrDurationToMillis(duration: number | Duration): number;
13
- declare function durationToMillis(duration: Duration): number;
14
- //#endregion
15
- export { Duration, durationToMillis, millisOrDurationToMillis };
11
+ export declare function millisOrDurationToMillis(duration: number | Duration): number;
12
+ export declare function durationToMillis(duration: Duration): number;
16
13
  //# sourceMappingURL=duration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"duration.d.ts","names":[],"sources":["../src/duration.ts"],"sourcesContent":[],"mappings":";;AAcA;AAQA;AAQgB,KAhBJ,QAAA,GAgBoB;;;;;;;iBARhB,wBAAA,oBAA4C;iBAQ5C,gBAAA,WAA2B"}
1
+ {"version":3,"file":"duration.d.ts","sourceRoot":"","sources":["../src/duration.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAM5E;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAQ3D"}
package/dist/duration.js CHANGED
@@ -1,12 +1,26 @@
1
- //#region src/duration.ts
2
- function millisOrDurationToMillis(duration) {
3
- if (typeof duration === "number") return Math.trunc(duration);
4
- else return Math.trunc(durationToMillis(duration));
1
+ /*
2
+ * Copyright (c) 2023-2025 - Restate Software, Inc., Restate GmbH
3
+ *
4
+ * This file is part of the Restate SDK for Node.js/TypeScript,
5
+ * which is released under the MIT license.
6
+ *
7
+ * You can find a copy of the license in file LICENSE in the root
8
+ * directory of this repository or package, or at
9
+ * https://github.com/restatedev/sdk-typescript/blob/main/LICENSE
10
+ */
11
+ export function millisOrDurationToMillis(duration) {
12
+ if (typeof duration === "number") {
13
+ return Math.trunc(duration);
14
+ }
15
+ else {
16
+ return Math.trunc(durationToMillis(duration));
17
+ }
5
18
  }
6
- function durationToMillis(duration) {
7
- return (duration.milliseconds ?? 0) + 1e3 * (duration.seconds ?? 0) + 1e3 * 60 * (duration.minutes ?? 0) + 1e3 * 60 * 60 * (duration.hours ?? 0) + 1e3 * 60 * 60 * 24 * (duration.days ?? 0);
19
+ export function durationToMillis(duration) {
20
+ return ((duration.milliseconds ?? 0) +
21
+ 1000 * (duration.seconds ?? 0) +
22
+ 1000 * 60 * (duration.minutes ?? 0) +
23
+ 1000 * 60 * 60 * (duration.hours ?? 0) +
24
+ 1000 * 60 * 60 * 24 * (duration.days ?? 0));
8
25
  }
9
-
10
- //#endregion
11
- export { durationToMillis, millisOrDurationToMillis };
12
26
  //# sourceMappingURL=duration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"duration.js","names":[],"sources":["../src/duration.ts"],"sourcesContent":["/*\n * Copyright (c) 2023-2025 - Restate Software, Inc., Restate GmbH\n *\n * This file is part of the Restate SDK for Node.js/TypeScript,\n * which is released under the MIT license.\n *\n * You can find a copy of the license in file LICENSE in the root\n * directory of this repository or package, or at\n * https://github.com/restatedev/sdk-typescript/blob/main/LICENSE\n */\n\n/**\n * Duration type. Note that fields are additive.\n */\nexport type Duration = {\n days?: number;\n hours?: number;\n minutes?: number;\n seconds?: number;\n milliseconds?: number;\n};\n\nexport function millisOrDurationToMillis(duration: number | Duration): number {\n if (typeof duration === \"number\") {\n return Math.trunc(duration);\n } else {\n return Math.trunc(durationToMillis(duration));\n }\n}\n\nexport function durationToMillis(duration: Duration): number {\n return (\n (duration.milliseconds ?? 0) +\n 1000 * (duration.seconds ?? 0) +\n 1000 * 60 * (duration.minutes ?? 0) +\n 1000 * 60 * 60 * (duration.hours ?? 0) +\n 1000 * 60 * 60 * 24 * (duration.days ?? 0)\n );\n}\n"],"mappings":";AAsBA,SAAgB,yBAAyB,UAAqC;AAC5E,KAAI,OAAO,aAAa,SACtB,QAAO,KAAK,MAAM,SAAS;KAE3B,QAAO,KAAK,MAAM,iBAAiB,SAAS,CAAC;;AAIjD,SAAgB,iBAAiB,UAA4B;AAC3D,SACG,SAAS,gBAAgB,KAC1B,OAAQ,SAAS,WAAW,KAC5B,MAAO,MAAM,SAAS,WAAW,KACjC,MAAO,KAAK,MAAM,SAAS,SAAS,KACpC,MAAO,KAAK,KAAK,MAAM,SAAS,QAAQ"}
1
+ {"version":3,"file":"duration.js","sourceRoot":"","sources":["../src/duration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAaH,MAAM,UAAU,wBAAwB,CAAC,QAA2B;IAClE,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAChD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,QAAkB;IACjD,OAAO,CACL,CAAC,QAAQ,CAAC,YAAY,IAAI,CAAC,CAAC;QAC5B,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;QAC9B,IAAI,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;QACnC,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC,CAAC;QACtC,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,CAAC,CAC3C,CAAC;AACJ,CAAC"}
@@ -1,4 +1,3 @@
1
- //#region src/entry_codec.d.ts
2
1
  /**
3
2
  * Journal values codec.
4
3
  *
@@ -13,26 +12,24 @@
13
12
  *
14
13
  * @experimental
15
14
  */
16
- type JournalValueCodec = {
17
- /**
18
- * Encodes the given buffer.
19
- *
20
- * This will be applied *after* serialization.
21
- *
22
- * @param buf The buffer to encode. Empty byte buffers should be appropriately handled as well.
23
- * @returns The encoded buffer
24
- */
25
- encode(buf: Uint8Array): Uint8Array;
26
- /**
27
- * Decodes the given buffer.
28
- *
29
- * This will be applied *before* deserialization.
30
- *
31
- * @param buf The buffer to decode.
32
- * @returns A promise that resolves to the decoded buffer.
33
- */
34
- decode(buf: Uint8Array): Promise<Uint8Array>;
15
+ export type JournalValueCodec = {
16
+ /**
17
+ * Encodes the given buffer.
18
+ *
19
+ * This will be applied *after* serialization.
20
+ *
21
+ * @param buf The buffer to encode. Empty byte buffers should be appropriately handled as well.
22
+ * @returns The encoded buffer
23
+ */
24
+ encode(buf: Uint8Array): Uint8Array;
25
+ /**
26
+ * Decodes the given buffer.
27
+ *
28
+ * This will be applied *before* deserialization.
29
+ *
30
+ * @param buf The buffer to decode.
31
+ * @returns A promise that resolves to the decoded buffer.
32
+ */
33
+ decode(buf: Uint8Array): Promise<Uint8Array>;
35
34
  };
36
- //#endregion
37
- export { JournalValueCodec };
38
35
  //# sourceMappingURL=entry_codec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"entry_codec.d.ts","names":[],"sources":["../src/entry_codec.ts"],"sourcesContent":[],"mappings":";;AAyBA;;;;;;;;;;;;;KAAY,iBAAA;;;;;;;;;cASE,aAAa;;;;;;;;;cAUb,aAAa,QAAQ"}
1
+ {"version":3,"file":"entry_codec.d.ts","sourceRoot":"","sources":["../src/entry_codec.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;;;;OAOG;IACH,MAAM,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU,CAAC;IAEpC;;;;;;;OAOG;IACH,MAAM,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CAC9C,CAAC"}
package/dist/index.cjs CHANGED
@@ -1,7 +1,10 @@
1
1
  const require_serde_api = require('./serde_api.cjs');
2
2
  const require_duration = require('./duration.cjs');
3
+ const require_interface = require('./interface.cjs');
3
4
 
4
5
  exports.durationToMillis = require_duration.durationToMillis;
6
+ exports.iface = require_interface.iface;
7
+ exports.makeHandlerDescriptor = require_interface.makeHandlerDescriptor;
5
8
  exports.millisOrDurationToMillis = require_duration.millisOrDurationToMillis;
6
9
  Object.defineProperty(exports, 'serde', {
7
10
  enumerable: true,
package/dist/index.d.cts CHANGED
@@ -3,4 +3,5 @@ import { StandardJSONSchemaV1, StandardSchemaV1, StandardTypedV1 } from "./stand
3
3
  import { Serde, serde } from "./serde_api.cjs";
4
4
  import { Duration, durationToMillis, millisOrDurationToMillis } from "./duration.cjs";
5
5
  import { JournalValueCodec } from "./entry_codec.cjs";
6
- export { type ArgType, type Duration, type HandlerReturnType, type JournalValueCodec, type ObjectHandler, type ObjectSharedHandler, type RestateContext, type RestateObjectContext, type RestateObjectSharedContext, type RestateWorkflowContext, type RestateWorkflowSharedContext, type Serde, type Service, type ServiceDefinition, type ServiceDefinitionFrom, type ServiceHandler, type StandardJSONSchemaV1, type StandardSchemaV1, type StandardTypedV1, type VirtualObject, type VirtualObjectDefinition, type VirtualObjectDefinitionFrom, type Workflow, type WorkflowDefinition, type WorkflowDefinitionFrom, type WorkflowHandler, type WorkflowSharedHandler, durationToMillis, millisOrDurationToMillis, serde };
6
+ import { Descriptor, HandlerDescriptor, ImplementedDefinition, ImplementedObjectDefinition, ImplementedServiceDefinition, ImplementedWorkflowDefinition, InferInput, InferOutput, ObjectDescriptor, SerdeType, ServiceDescriptor, ServiceInterface, WorkflowDescriptor, iface, makeHandlerDescriptor } from "./interface.cjs";
7
+ export { type ArgType, type Descriptor, type Duration, type HandlerDescriptor, type HandlerReturnType, type ImplementedDefinition, type ImplementedObjectDefinition, type ImplementedServiceDefinition, type ImplementedWorkflowDefinition, type InferInput, type InferOutput, type JournalValueCodec, type ObjectDescriptor, type ObjectHandler, type ObjectSharedHandler, type RestateContext, type RestateObjectContext, type RestateObjectSharedContext, type RestateWorkflowContext, type RestateWorkflowSharedContext, type Serde, type SerdeType, type Service, type ServiceDefinition, type ServiceDefinitionFrom, type ServiceDescriptor, type ServiceHandler, type ServiceInterface, type StandardJSONSchemaV1, type StandardSchemaV1, type StandardTypedV1, type VirtualObject, type VirtualObjectDefinition, type VirtualObjectDefinitionFrom, type Workflow, type WorkflowDefinition, type WorkflowDefinitionFrom, type WorkflowDescriptor, type WorkflowHandler, type WorkflowSharedHandler, durationToMillis, iface, makeHandlerDescriptor, millisOrDurationToMillis, serde };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,10 @@
1
- import { ArgType, HandlerReturnType, ObjectHandler, ObjectSharedHandler, RestateContext, RestateObjectContext, RestateObjectSharedContext, RestateWorkflowContext, RestateWorkflowSharedContext, Service, ServiceDefinition, ServiceDefinitionFrom, ServiceHandler, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, Workflow, WorkflowDefinition, WorkflowDefinitionFrom, WorkflowHandler, WorkflowSharedHandler } from "./core.js";
2
- import { StandardJSONSchemaV1, StandardSchemaV1, StandardTypedV1 } from "./standard_schema.js";
3
- import { Serde, serde } from "./serde_api.js";
4
- import { Duration, durationToMillis, millisOrDurationToMillis } from "./duration.js";
5
- import { JournalValueCodec } from "./entry_codec.js";
6
- export { type ArgType, type Duration, type HandlerReturnType, type JournalValueCodec, type ObjectHandler, type ObjectSharedHandler, type RestateContext, type RestateObjectContext, type RestateObjectSharedContext, type RestateWorkflowContext, type RestateWorkflowSharedContext, type Serde, type Service, type ServiceDefinition, type ServiceDefinitionFrom, type ServiceHandler, type StandardJSONSchemaV1, type StandardSchemaV1, type StandardTypedV1, type VirtualObject, type VirtualObjectDefinition, type VirtualObjectDefinitionFrom, type Workflow, type WorkflowDefinition, type WorkflowDefinitionFrom, type WorkflowHandler, type WorkflowSharedHandler, durationToMillis, millisOrDurationToMillis, serde };
1
+ export type { RestateContext, ServiceHandler, ServiceDefinition, Service, ServiceDefinitionFrom, RestateObjectContext, RestateObjectSharedContext, ObjectHandler, ObjectSharedHandler, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, WorkflowDefinition, WorkflowHandler, WorkflowSharedHandler, RestateWorkflowContext, RestateWorkflowSharedContext, Workflow, WorkflowDefinitionFrom, ArgType, HandlerReturnType, } from "./core.js";
2
+ export type { Serde } from "./serde_api.js";
3
+ export { serde } from "./serde_api.js";
4
+ export type { Duration } from "./duration.js";
5
+ export { durationToMillis, millisOrDurationToMillis } from "./duration.js";
6
+ export type { JournalValueCodec } from "./entry_codec.js";
7
+ export type { StandardTypedV1, StandardSchemaV1, StandardJSONSchemaV1, } from "./standard_schema.js";
8
+ export { iface, makeHandlerDescriptor } from "./interface.js";
9
+ export type { ServiceInterface, HandlerDescriptor, Descriptor, ServiceDescriptor, ObjectDescriptor, WorkflowDescriptor, ImplementedServiceDefinition, ImplementedObjectDefinition, ImplementedWorkflowDefinition, ImplementedDefinition, InferInput, InferOutput, SerdeType, } from "./interface.js";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,YAAY,EACV,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,OAAO,EACP,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,EAC1B,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,uBAAuB,EACvB,2BAA2B,EAC3B,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,4BAA4B,EAC5B,QAAQ,EACR,sBAAsB,EACtB,OAAO,EACP,iBAAiB,GAClB,MAAM,WAAW,CAAC;AAEnB,YAAY,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAE3E,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,YAAY,EACV,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,OAAO,EACP,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,EAC1B,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,uBAAuB,EACvB,2BAA2B,EAC3B,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,4BAA4B,EAC5B,QAAQ,EACR,sBAAsB,EACtB,OAAO,EACP,iBAAiB,GAClB,MAAM,WAAW,CAAC;AAEnB,YAAY,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAE3E,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC9D,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,4BAA4B,EAC5B,2BAA2B,EAC3B,6BAA6B,EAC7B,qBAAqB,EACrB,UAAU,EACV,WAAW,EACX,SAAS,GACV,MAAM,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,14 @@
1
- import { serde } from "./serde_api.js";
2
- import { durationToMillis, millisOrDurationToMillis } from "./duration.js";
3
-
4
- export { durationToMillis, millisOrDurationToMillis, serde };
1
+ /*
2
+ * Copyright (c) 2023-2024 - Restate Software, Inc., Restate GmbH
3
+ *
4
+ * This file is part of the Restate SDK for Node.js/TypeScript,
5
+ * which is released under the MIT license.
6
+ *
7
+ * You can find a copy of the license in file LICENSE in the root
8
+ * directory of this repository or package, or at
9
+ * https://github.com/restatedev/sdk-typescript/blob/main/LICENSE
10
+ */
11
+ export { serde } from "./serde_api.js";
12
+ export { durationToMillis, millisOrDurationToMillis } from "./duration.js";
13
+ export { iface, makeHandlerDescriptor } from "./interface.js";
14
+ //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA2BH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGvC,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA2BH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGvC,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAU3E,OAAO,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,71 @@
1
+ const require_serde_api = require('./serde_api.cjs');
2
+
3
+ //#region src/interface.ts
4
+ function makeHandlerDescriptor(inputSerde, outputSerde, shared) {
5
+ return {
6
+ _inputSerde: inputSerde,
7
+ _outputSerde: outputSerde,
8
+ _shared: shared
9
+ };
10
+ }
11
+ /**
12
+ * Declare a service interface (contract) as a runtime value carrying handler
13
+ * names + input/output serdes, without an implementation. Place it in a shared
14
+ * package that both the server (via `implement()`) and callers (via
15
+ * `ctx.serviceClient(iface)` / `connect().serviceClient(iface)`) import.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const greeter = iface.service("greeter", {
20
+ * greet: iface.schemas({ input: GreetReq, output: GreetRes }),
21
+ * ping: iface.json<void, string>(),
22
+ * });
23
+ * ```
24
+ */
25
+ const iface = {
26
+ service: function(name, handlers) {
27
+ return {
28
+ name,
29
+ _kind: "service",
30
+ _handlers: handlers
31
+ };
32
+ },
33
+ object: function(name, handlers) {
34
+ return {
35
+ name,
36
+ _kind: "object",
37
+ _handlers: handlers
38
+ };
39
+ },
40
+ workflow: function(name, handlers) {
41
+ return {
42
+ name,
43
+ _kind: "workflow",
44
+ _handlers: handlers
45
+ };
46
+ },
47
+ json: function() {
48
+ return makeHandlerDescriptor(void 0, void 0, false);
49
+ },
50
+ serdes: function(opts) {
51
+ return makeHandlerDescriptor(opts.input, opts.output, false);
52
+ },
53
+ schemas: function(opts) {
54
+ return makeHandlerDescriptor(opts.input ? require_serde_api.serde.schema(opts.input) : void 0, opts.output ? require_serde_api.serde.schema(opts.output) : void 0, false);
55
+ },
56
+ shared: {
57
+ json: function() {
58
+ return makeHandlerDescriptor(void 0, void 0, true);
59
+ },
60
+ serdes: function(opts) {
61
+ return makeHandlerDescriptor(opts.input, opts.output, true);
62
+ },
63
+ schemas: function(opts) {
64
+ return makeHandlerDescriptor(opts.input ? require_serde_api.serde.schema(opts.input) : void 0, opts.output ? require_serde_api.serde.schema(opts.output) : void 0, true);
65
+ }
66
+ }
67
+ };
68
+
69
+ //#endregion
70
+ exports.iface = iface;
71
+ exports.makeHandlerDescriptor = makeHandlerDescriptor;
@@ -0,0 +1,83 @@
1
+ import { ServiceDefinition, VirtualObjectDefinition, WorkflowDefinition } from "./core.cjs";
2
+ import { StandardSchemaV1 } from "./standard_schema.cjs";
3
+ import { Serde } from "./serde_api.cjs";
4
+
5
+ //#region src/interface.d.ts
6
+
7
+ /**
8
+ * Minimal descriptor stored in {@link Descriptor}._handlers per handler.
9
+ */
10
+ type HandlerDescriptor<I$1 = any, O$1 = any, Shared extends boolean = boolean> = {
11
+ readonly _inputSerde?: Serde<I$1>;
12
+ readonly _outputSerde?: Serde<O$1>;
13
+ /** @internal virtual-object handler shared/exclusive marker (phantom + runtime) */
14
+ readonly _shared?: Shared;
15
+ };
16
+ declare function makeHandlerDescriptor<I$1, O$1, Shared extends boolean = false>(inputSerde?: Serde<I$1>, outputSerde?: Serde<O$1>, shared?: Shared): HandlerDescriptor<I$1, O$1, Shared>;
17
+ /** Recover the input type declared by a {@link HandlerDescriptor}. */
18
+ type InferInput<D> = D extends HandlerDescriptor<infer I, any, any> ? I : any;
19
+ /** Recover the output type declared by a {@link HandlerDescriptor}. */
20
+ type InferOutput<D> = D extends HandlerDescriptor<any, infer O, any> ? O : any;
21
+ /** Recover the value type carried by a {@link Serde}. */
22
+ type SerdeType<S> = S extends Serde<infer T> ? T : never;
23
+ type Descriptor<P extends string = string, H extends Record<string, HandlerDescriptor> = Record<string, HandlerDescriptor>, Kind extends "service" | "object" | "workflow" = "service" | "object" | "workflow"> = {
24
+ readonly name: P;
25
+ readonly _kind: Kind;
26
+ readonly _handlers: H;
27
+ };
28
+ type ServiceDescriptor<P extends string = string, H extends Record<string, HandlerDescriptor> = Record<string, HandlerDescriptor>> = Descriptor<P, H, "service">;
29
+ type ObjectDescriptor<P extends string = string, H extends Record<string, HandlerDescriptor> = Record<string, HandlerDescriptor>> = Descriptor<P, H, "object">;
30
+ type WorkflowDescriptor<P extends string = string, H extends Record<string, HandlerDescriptor> = Record<string, HandlerDescriptor>> = Descriptor<P, H, "workflow">;
31
+ /** Implemented definition — a Descriptor that is also bindable to an endpoint. */
32
+ type ImplementedServiceDefinition<P extends string, H extends Record<string, HandlerDescriptor>> = ServiceDefinition<P, any> & ServiceDescriptor<P, H>;
33
+ type ImplementedObjectDefinition<P extends string, H extends Record<string, HandlerDescriptor>> = VirtualObjectDefinition<P, any> & ObjectDescriptor<P, H>;
34
+ type ImplementedWorkflowDefinition<P extends string, H extends Record<string, HandlerDescriptor>> = WorkflowDefinition<P, any> & WorkflowDescriptor<P, H>;
35
+ type ImplementedDefinition<P extends string, H extends Record<string, HandlerDescriptor>, Kind extends "service" | "object" | "workflow"> = Kind extends "service" ? ImplementedServiceDefinition<P, H> : Kind extends "object" ? ImplementedObjectDefinition<P, H> : ImplementedWorkflowDefinition<P, H>;
36
+ /** The shape of the {@link iface} service-interface declaration API. */
37
+ interface ServiceInterface {
38
+ service<P extends string, H extends Record<string, HandlerDescriptor>>(name: P, handlers: H): ServiceDescriptor<P, H>;
39
+ object<P extends string, H extends Record<string, HandlerDescriptor>>(name: P, handlers: H): ObjectDescriptor<P, H>;
40
+ workflow<P extends string, H extends Record<string, HandlerDescriptor>>(name: P, handlers: H): WorkflowDescriptor<P, H>;
41
+ /** `json<I, O>()` — type params, default JSON serde. */
42
+ json<I$1 = void, O$1 = void>(): HandlerDescriptor<I$1, O$1, false>;
43
+ /** `serdes({ input, output })` — explicit Serde per direction. */
44
+ serdes<SI extends Serde<any>, SO extends Serde<any>>(opts: {
45
+ input?: SI;
46
+ output?: SO;
47
+ }): HandlerDescriptor<SerdeType<SI>, SerdeType<SO>, false>;
48
+ /** `schemas({ input, output })` — Standard Schema per direction. */
49
+ schemas<SI extends StandardSchemaV1<any>, SO extends StandardSchemaV1<any>>(opts: {
50
+ input?: SI;
51
+ output?: SO;
52
+ }): HandlerDescriptor<StandardSchemaV1.InferOutput<NonNullable<SI>>, StandardSchemaV1.InferOutput<NonNullable<SO>>, false>;
53
+ /** Shared (read-only) virtual-object / non-`run` workflow handler declarators. */
54
+ shared: {
55
+ json<I$1 = void, O$1 = void>(): HandlerDescriptor<I$1, O$1, true>;
56
+ serdes<SI extends Serde<any>, SO extends Serde<any>>(opts: {
57
+ input?: SI;
58
+ output?: SO;
59
+ }): HandlerDescriptor<SerdeType<SI>, SerdeType<SO>, true>;
60
+ schemas<SI extends StandardSchemaV1<any>, SO extends StandardSchemaV1<any>>(opts: {
61
+ input?: SI;
62
+ output?: SO;
63
+ }): HandlerDescriptor<StandardSchemaV1.InferOutput<NonNullable<SI>>, StandardSchemaV1.InferOutput<NonNullable<SO>>, true>;
64
+ };
65
+ }
66
+ /**
67
+ * Declare a service interface (contract) as a runtime value carrying handler
68
+ * names + input/output serdes, without an implementation. Place it in a shared
69
+ * package that both the server (via `implement()`) and callers (via
70
+ * `ctx.serviceClient(iface)` / `connect().serviceClient(iface)`) import.
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * const greeter = iface.service("greeter", {
75
+ * greet: iface.schemas({ input: GreetReq, output: GreetRes }),
76
+ * ping: iface.json<void, string>(),
77
+ * });
78
+ * ```
79
+ */
80
+ declare const iface: ServiceInterface;
81
+ //#endregion
82
+ export { Descriptor, HandlerDescriptor, ImplementedDefinition, ImplementedObjectDefinition, ImplementedServiceDefinition, ImplementedWorkflowDefinition, InferInput, InferOutput, ObjectDescriptor, SerdeType, ServiceDescriptor, ServiceInterface, WorkflowDescriptor, iface, makeHandlerDescriptor };
83
+ //# sourceMappingURL=interface.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface.d.cts","names":[],"sources":["../src/interface.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAwBA;AAK+B,KALnB,iBAKmB,CAAA,MAAA,GAAA,EAAA,MAAA,GAAA,EAAA,eAAA,OAAA,GAAA,OAAA,CAAA,GAAA;EAAN,SAAA,WAAA,CAAA,EAAA,KAAA,CAAM,GAAN,CAAA;EACO,SAAA,YAAA,CAAA,EAAN,KAAM,CAAA,GAAA,CAAA;EAAN;EAEL,SAAA,OAAA,CAAA,EAAA,MAAA;CAAM;AAGX,iBAAA,qBAAqB,CAAA,GAAA,EAAA,GAAA,EAAA,eAAA,OAAA,GAAA,KAAA,CAAA,CAAA,UAAA,CAAA,EACtB,KADsB,CAChB,GADgB,CAAA,EAAA,WAAA,CAAA,EAErB,KAFqB,CAEf,GAFe,CAAA,EAAA,MAAA,CAAA,EAG1B,MAH0B,CAAA,EAIlC,iBAJkC,CAIhB,GAJgB,EAIb,GAJa,EAIV,MAJU,CAAA;;AACtB,K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
+ import type { ServiceDefinition, VirtualObjectDefinition, WorkflowDefinition } from "./core.js";
4
+ /**
5
+ * Minimal descriptor stored in {@link Descriptor}._handlers per handler.
6
+ */
7
+ export type HandlerDescriptor<I = any, O = any, Shared extends boolean = boolean> = {
8
+ readonly _inputSerde?: Serde<I>;
9
+ readonly _outputSerde?: Serde<O>;
10
+ /** @internal virtual-object handler shared/exclusive marker (phantom + runtime) */
11
+ readonly _shared?: Shared;
12
+ };
13
+ export declare function makeHandlerDescriptor<I, O, Shared extends boolean = false>(inputSerde?: Serde<I>, outputSerde?: Serde<O>, shared?: Shared): HandlerDescriptor<I, O, Shared>;
14
+ /** Recover the input type declared by a {@link HandlerDescriptor}. */
15
+ export type InferInput<D> = D extends HandlerDescriptor<infer I, any, any> ? I : any;
16
+ /** Recover the output type declared by a {@link HandlerDescriptor}. */
17
+ export type InferOutput<D> = D extends HandlerDescriptor<any, infer O, any> ? O : any;
18
+ /** Recover the value type carried by a {@link Serde}. */
19
+ export type SerdeType<S> = S extends Serde<infer T> ? T : never;
20
+ export type Descriptor<P extends string = string, H extends Record<string, HandlerDescriptor> = Record<string, HandlerDescriptor>, Kind extends "service" | "object" | "workflow" = "service" | "object" | "workflow"> = {
21
+ readonly name: P;
22
+ readonly _kind: Kind;
23
+ readonly _handlers: H;
24
+ };
25
+ export type ServiceDescriptor<P extends string = string, H extends Record<string, HandlerDescriptor> = Record<string, HandlerDescriptor>> = Descriptor<P, H, "service">;
26
+ export type ObjectDescriptor<P extends string = string, H extends Record<string, HandlerDescriptor> = Record<string, HandlerDescriptor>> = Descriptor<P, H, "object">;
27
+ export type WorkflowDescriptor<P extends string = string, H extends Record<string, HandlerDescriptor> = Record<string, HandlerDescriptor>> = Descriptor<P, H, "workflow">;
28
+ /** Implemented definition — a Descriptor that is also bindable to an endpoint. */
29
+ export type ImplementedServiceDefinition<P extends string, H extends Record<string, HandlerDescriptor>> = ServiceDefinition<P, any> & ServiceDescriptor<P, H>;
30
+ export type ImplementedObjectDefinition<P extends string, H extends Record<string, HandlerDescriptor>> = VirtualObjectDefinition<P, any> & ObjectDescriptor<P, H>;
31
+ export type ImplementedWorkflowDefinition<P extends string, H extends Record<string, HandlerDescriptor>> = WorkflowDefinition<P, any> & WorkflowDescriptor<P, H>;
32
+ export type ImplementedDefinition<P extends string, H extends Record<string, HandlerDescriptor>, Kind extends "service" | "object" | "workflow"> = Kind extends "service" ? ImplementedServiceDefinition<P, H> : Kind extends "object" ? ImplementedObjectDefinition<P, H> : ImplementedWorkflowDefinition<P, H>;
33
+ /** The shape of the {@link iface} service-interface declaration API. */
34
+ export interface ServiceInterface {
35
+ service<P extends string, H extends Record<string, HandlerDescriptor>>(name: P, handlers: H): ServiceDescriptor<P, H>;
36
+ object<P extends string, H extends Record<string, HandlerDescriptor>>(name: P, handlers: H): ObjectDescriptor<P, H>;
37
+ workflow<P extends string, H extends Record<string, HandlerDescriptor>>(name: P, handlers: H): WorkflowDescriptor<P, H>;
38
+ /** `json<I, O>()` — type params, default JSON serde. */
39
+ json<I = void, O = void>(): HandlerDescriptor<I, O, false>;
40
+ /** `serdes({ input, output })` — explicit Serde per direction. */
41
+ serdes<SI extends Serde<any>, SO extends Serde<any>>(opts: {
42
+ input?: SI;
43
+ output?: SO;
44
+ }): HandlerDescriptor<SerdeType<SI>, SerdeType<SO>, false>;
45
+ /** `schemas({ input, output })` — Standard Schema per direction. */
46
+ schemas<SI extends StandardSchemaV1<any>, SO extends StandardSchemaV1<any>>(opts: {
47
+ input?: SI;
48
+ output?: SO;
49
+ }): HandlerDescriptor<StandardSchemaV1.InferOutput<NonNullable<SI>>, StandardSchemaV1.InferOutput<NonNullable<SO>>, false>;
50
+ /** Shared (read-only) virtual-object / non-`run` workflow handler declarators. */
51
+ shared: {
52
+ json<I = void, O = void>(): HandlerDescriptor<I, O, true>;
53
+ serdes<SI extends Serde<any>, SO extends Serde<any>>(opts: {
54
+ input?: SI;
55
+ output?: SO;
56
+ }): HandlerDescriptor<SerdeType<SI>, SerdeType<SO>, true>;
57
+ schemas<SI extends StandardSchemaV1<any>, SO extends StandardSchemaV1<any>>(opts: {
58
+ input?: SI;
59
+ output?: SO;
60
+ }): HandlerDescriptor<StandardSchemaV1.InferOutput<NonNullable<SI>>, StandardSchemaV1.InferOutput<NonNullable<SO>>, true>;
61
+ };
62
+ }
63
+ /**
64
+ * Declare a service interface (contract) as a runtime value carrying handler
65
+ * names + input/output serdes, without an implementation. Place it in a shared
66
+ * package that both the server (via `implement()`) and callers (via
67
+ * `ctx.serviceClient(iface)` / `connect().serviceClient(iface)`) import.
68
+ *
69
+ * @example
70
+ * ```ts
71
+ * const greeter = iface.service("greeter", {
72
+ * greet: iface.schemas({ input: GreetReq, output: GreetRes }),
73
+ * ping: iface.json<void, string>(),
74
+ * });
75
+ * ```
76
+ */
77
+ export declare const iface: ServiceInterface;
78
+ //# sourceMappingURL=interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../src/interface.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,WAAW,CAAC;AAEnB;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAC3B,CAAC,GAAG,GAAG,EACP,CAAC,GAAG,GAAG,EACP,MAAM,SAAS,OAAO,GAAG,OAAO,IAC9B;IACF,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAChC,QAAQ,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACjC,mFAAmF;IACnF,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAAE,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