@restatedev/restate-sdk-core 1.11.1 → 1.12.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,33 +1,31 @@
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;
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;
16
12
  };
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;
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;
23
19
  };
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;
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;
30
26
  };
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>;
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 };
33
31
  //# sourceMappingURL=core.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,cAAc;CAAG;AAClC,MAAM,WAAW,oBAAoB;CAAG;AACxC,MAAM,WAAW,0BAA0B;CAAG;AAG9C,MAAM,WAAW,4BAA6B,SAAQ,0BAA0B;CAAG;AACnF,MAAM,WAAW,sBACf,SAAQ,oBAAoB,EAAE,4BAA4B;CAAG;AAI/D,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,GAChD,IAAI,GACJ,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,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wD0B,OAxD1B,CAAA,GAAA,CAAA;AACM,KAyDA,eAzDA,CAAA,CAAA,EAAA,IAyDuB,sBAzDvB,CAAA,GAyDiD,CAzDjD,UAAA,CAAA,GAAA,EA0DL,CA1DK,EAAA,KAAA,EAAA,GAAA,EAAA,GA4DP,OA5DO,CAAA,GAAA,CAAA,IA6DR,CA7DQ,GA8DR,CA9DQ,UAAA,CAAA,GAAA,EA8DQ,CA9DR,EAAA,GA8Dc,OA9Dd,CAAA,GAAA,CAAA,IA+DN,CA/DM,GAAA,CAAA,GAAA,EAgEA,CAhEA,EAAA,KAAA,CAAA,EAAA,GAAA,EAAA,GAgEmB,OAhEnB,CAAA,GAAA,CAAA;AAAmB,KAmEnB,kBAnEmB,CAAA,UAAA,MAAA,EAAA,CAAA,CAAA,GAAA;EAAO,IAAA,EAoE9B,CApE8B;AAGtC,CAAA;AAIY,KAgEA,QAhEO,CAAA,CAAA,CAAA,GAgEO,CAhEP,SAgEiB,kBAhEjB,CAAA,MAAA,EAAA,KAAA,EAAA,CAAA,GAgEuD,CAhEvD,GAgE2D,CAhE3D;AAAM,KAkEb,sBAlEa,CAAA,CAAA,CAAA,GAmEvB,CAnEuB,SAmEb,kBAnEa,CAAA,MAAA,EAAA,OAAA,CAAA,GAoEnB,CApEmB,GAqEnB,kBArEmB,CAAA,MAAA,EAqEQ,CArER,CAAA"}
@@ -1,13 +1,16 @@
1
+ //#region src/duration.d.ts
1
2
  /**
2
3
  * Duration type. Note that fields are additive.
3
4
  */
4
- export type Duration = {
5
- days?: number;
6
- hours?: number;
7
- minutes?: number;
8
- seconds?: number;
9
- milliseconds?: number;
5
+ type Duration = {
6
+ days?: number;
7
+ hours?: number;
8
+ minutes?: number;
9
+ seconds?: number;
10
+ milliseconds?: number;
10
11
  };
11
- export declare function millisOrDurationToMillis(duration: number | Duration): number;
12
- export declare function durationToMillis(duration: Duration): number;
12
+ declare function millisOrDurationToMillis(duration: number | Duration): number;
13
+ declare function durationToMillis(duration: Duration): number;
14
+ //#endregion
15
+ export { Duration, durationToMillis, millisOrDurationToMillis };
13
16
  //# sourceMappingURL=duration.d.ts.map
@@ -1 +1 @@
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"}
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"}
package/dist/duration.js CHANGED
@@ -1,26 +1,12 @@
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
- }
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));
18
5
  }
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));
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);
25
8
  }
9
+
10
+ //#endregion
11
+ export { durationToMillis, millisOrDurationToMillis };
26
12
  //# sourceMappingURL=duration.js.map
@@ -1 +1 @@
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
+ {"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,3 +1,4 @@
1
+ //#region src/entry_codec.d.ts
1
2
  /**
2
3
  * Journal values codec.
3
4
  *
@@ -12,24 +13,26 @@
12
13
  *
13
14
  * @experimental
14
15
  */
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>;
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>;
34
35
  };
36
+ //#endregion
37
+ export { JournalValueCodec };
35
38
  //# sourceMappingURL=entry_codec.d.ts.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"entry_codec.d.ts","names":[],"sources":["../src/entry_codec.ts"],"sourcesContent":[],"mappings":";;AAyBA;;;;;;;;;;;;;KAAY,iBAAA;;;;;;;;;cASE,aAAa;;;;;;;;;cAUb,aAAa,QAAQ"}
package/dist/index.d.ts CHANGED
@@ -1,8 +1,6 @@
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
- //# sourceMappingURL=index.d.ts.map
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 };
package/dist/index.js CHANGED
@@ -1,13 +1,4 @@
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
- //# sourceMappingURL=index.js.map
1
+ import { serde } from "./serde_api.js";
2
+ import { durationToMillis, millisOrDurationToMillis } from "./duration.js";
3
+
4
+ export { durationToMillis, millisOrDurationToMillis, serde };
@@ -1,32 +1,36 @@
1
- import type { StandardSchemaV1 } from "./standard_schema.js";
2
- export interface Serde<T> {
3
- contentType?: string;
4
- jsonSchema?: object;
5
- serialize(value: T): Uint8Array;
6
- deserialize(data: Uint8Array): T;
1
+ import { StandardSchemaV1 } from "./standard_schema.js";
2
+
3
+ //#region src/serde_api.d.ts
4
+ interface Serde<T> {
5
+ contentType?: string;
6
+ jsonSchema?: object;
7
+ serialize(value: T): Uint8Array;
8
+ deserialize(data: Uint8Array): T;
7
9
  }
8
- export declare namespace serde {
9
- class JsonSerde<T> implements Serde<T | undefined> {
10
- readonly jsonSchema?: object | undefined;
11
- contentType: string;
12
- constructor(jsonSchema?: object | undefined);
13
- serialize(value: T): Uint8Array;
14
- deserialize(data: Uint8Array): T | undefined;
15
- schema<U>(schema: object): Serde<U>;
16
- }
17
- const json: JsonSerde<any>;
18
- const binary: Serde<Uint8Array>;
19
- const empty: Serde<void>;
20
- /**
21
- * A Standard Schema-based serde.
22
- *
23
- * @param schema the standard schema
24
- * @param validateOptions options passed to `StandardSchemaV1.Options.libraryOptions` when validating
25
- * @param jsonSchemaOptions options passed to `StandardJsonSchemaV1.Options.libraryOptions` for code generation
26
- * @returns a serde that will validate the data with the standard schema
27
- */
28
- const schema: <T extends {
29
- "~standard": StandardSchemaV1.Props;
30
- }>(schema: T, validateOptions?: Record<string, unknown>, jsonSchemaOptions?: Record<string, unknown>) => Serde<StandardSchemaV1.InferOutput<T>>;
10
+ declare namespace serde {
11
+ class JsonSerde<T> implements Serde<T | undefined> {
12
+ readonly jsonSchema?: object | undefined;
13
+ contentType: string;
14
+ constructor(jsonSchema?: object | undefined);
15
+ serialize(value: T): Uint8Array;
16
+ deserialize(data: Uint8Array): T | undefined;
17
+ schema<U>(schema: object): Serde<U>;
18
+ }
19
+ const json: JsonSerde<any>;
20
+ const binary: Serde<Uint8Array>;
21
+ const empty: Serde<void>;
22
+ /**
23
+ * A Standard Schema-based serde.
24
+ *
25
+ * @param schema the standard schema
26
+ * @param validateOptions options passed to `StandardSchemaV1.Options.libraryOptions` when validating
27
+ * @param jsonSchemaOptions options passed to `StandardJsonSchemaV1.Options.libraryOptions` for code generation
28
+ * @returns a serde that will validate the data with the standard schema
29
+ */
30
+ const schema: <T extends {
31
+ "~standard": StandardSchemaV1.Props;
32
+ }>(schema: T, validateOptions?: Record<string, unknown>, jsonSchemaOptions?: Record<string, unknown>) => Serde<StandardSchemaV1.InferOutput<T>>;
31
33
  }
34
+ //#endregion
35
+ export { Serde, serde };
32
36
  //# sourceMappingURL=serde_api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"serde_api.d.ts","sourceRoot":"","sources":["../src/serde_api.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,KAAK,CAAC,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,UAAU,CAAC;IAEhC,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,CAAC,CAAC;CAClC;AAsID,yBAAiB,KAAK,CAAC;IACrB,MAAa,SAAS,CAAC,CAAC,CAAE,YAAW,KAAK,CAAC,CAAC,GAAG,SAAS,CAAC;QAG3C,QAAQ,CAAC,UAAU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AA,KAAA,EAAJ,CAAI,CAAA,EAAA,UAAA;IAOH,WAAA,CAAA,IAAA,EAAA,UAAA,CAAA,EAAa,CAAb,GAAA,SAAA;IAAa,MAAA,CAAA,CAAA,CAAA,CAAA,MAAA,EAAA,MAAA,CAAA,EAOJ,KAPI,CAOE,CAPF,CAAA;EAOE;EAAN,MAAA,IAAA,EAKV,SALU,CAAA,GAAA,CAAA;EAnBQ,MAAA,MAAA,EAyBhB,KAzBgB,CAyBV,UAzBU,CAAA;EAwBlB,MAAA,KAAA,EAEC,KAFD,CAAA,IAAA,CAAA;EACQ;;;;;;;;EAelB,MAAA,MAAA,EAAiB,CAAA,UAAA;IAAvB,WAAA,EAJ6C,gBAAA,CAAiB,KAI9D;EAAK,CAAA,CAAA,CAAA,MAAA,EAHE,CAGF,EAAA,eAAA,CAAA,EAFY,MAEZ,CAAA,MAAA,EAAA,OAAA,CAAA,EAAA,iBAAA,CAAA,EADc,MACd,CAAA,MAAA,EAAA,OAAA,CAAA,EAAA,GAAL,KAAK,CAAC,gBAAA,CAAiB,WAAlB,CAA8B,CAA9B,CAAA,CAAA"}
package/dist/serde_api.js CHANGED
@@ -1,157 +1,93 @@
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
- class BinarySerde {
12
- contentType = "application/octet-stream";
13
- serialize(value) {
14
- return value;
15
- }
16
- deserialize(data) {
17
- return data;
18
- }
19
- }
20
- class VoidSerde {
21
- serialize(value) {
22
- if (value !== undefined) {
23
- throw new Error("Expected undefined value");
24
- }
25
- return new Uint8Array(0);
26
- }
27
- deserialize(data) {
28
- if (data.length !== 0) {
29
- throw new Error("Expected empty data");
30
- }
31
- }
32
- }
33
- class StandardSchemaSerde {
34
- schema;
35
- validateOptions;
36
- contentType = "application/json";
37
- jsonSchema;
38
- constructor(schema, validateOptions, jsonSchemaOptions) {
39
- this.schema = schema;
40
- this.validateOptions = validateOptions;
41
- // Extract JSON schema if available
42
- const standard = schema["~standard"];
43
- if (isStandardJSONSchemaV1(standard)) {
44
- try {
45
- this.jsonSchema = standard.jsonSchema.output({
46
- target: "draft-2020-12",
47
- libraryOptions: jsonSchemaOptions,
48
- });
49
- }
50
- catch {
51
- // If JSON schema generation fails, leave it undefined
52
- this.jsonSchema = undefined;
53
- }
54
- }
55
- // Check if schema is for void/undefined type
56
- // Standard Schema doesn't have a direct way to detect void types,
57
- // so we serialize undefined and check if validation succeeds
58
- const testResult = standard.validate(undefined);
59
- // Handle both sync and async validation results
60
- if (testResult && typeof testResult === "object" && "then" in testResult) {
61
- // If it's a Promise, we can't determine contentType synchronously
62
- // Keep contentType as "application/json"
63
- }
64
- else if (!testResult.issues) {
65
- this.contentType = undefined;
66
- }
67
- }
68
- serialize(value) {
69
- if (value === undefined) {
70
- return new Uint8Array(0);
71
- }
72
- return new TextEncoder().encode(JSON.stringify(value));
73
- }
74
- deserialize(data) {
75
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
76
- const js = data.length === 0
77
- ? undefined
78
- : JSON.parse(new TextDecoder().decode(data));
79
- const result = this.schema["~standard"].validate(js, this.validateOptions);
80
- // Standard Schema validate can return a Promise, but Serde must be synchronous
81
- if (result && typeof result === "object" && "then" in result) {
82
- throw new TypeError("Async validation is not supported in Serde. Restate SDK supports only synchronous validation.");
83
- }
84
- if (result.issues) {
85
- const errorMessages = result.issues
86
- .map(formatStandardSchemaIssue)
87
- .join("\n");
88
- throw new TypeError(`Standard schema validation failed:\n${errorMessages}`);
89
- }
90
- return result.value;
91
- }
92
- }
1
+ //#region src/serde_api.ts
2
+ var BinarySerde = class {
3
+ contentType = "application/octet-stream";
4
+ serialize(value) {
5
+ return value;
6
+ }
7
+ deserialize(data) {
8
+ return data;
9
+ }
10
+ };
11
+ var VoidSerde = class {
12
+ serialize(value) {
13
+ if (value !== void 0) throw new Error("Expected undefined value");
14
+ return new Uint8Array(0);
15
+ }
16
+ deserialize(data) {
17
+ if (data.length !== 0) throw new Error("Expected empty data");
18
+ }
19
+ };
20
+ var StandardSchemaSerde = class {
21
+ contentType = "application/json";
22
+ jsonSchema;
23
+ constructor(schema, validateOptions, jsonSchemaOptions) {
24
+ this.schema = schema;
25
+ this.validateOptions = validateOptions;
26
+ const standard = schema["~standard"];
27
+ if (isStandardJSONSchemaV1(standard)) try {
28
+ this.jsonSchema = standard.jsonSchema.output({
29
+ target: "draft-2020-12",
30
+ libraryOptions: jsonSchemaOptions
31
+ });
32
+ } catch {
33
+ this.jsonSchema = void 0;
34
+ }
35
+ const testResult = standard.validate(void 0);
36
+ if (testResult && typeof testResult === "object" && "then" in testResult) {} else if (!testResult.issues) this.contentType = void 0;
37
+ }
38
+ serialize(value) {
39
+ if (value === void 0) return new Uint8Array(0);
40
+ return new TextEncoder().encode(JSON.stringify(value));
41
+ }
42
+ deserialize(data) {
43
+ const js = data.length === 0 ? void 0 : JSON.parse(new TextDecoder().decode(data));
44
+ const result = this.schema["~standard"].validate(js, this.validateOptions);
45
+ if (result && typeof result === "object" && "then" in result) throw new TypeError("Async validation is not supported in Serde. Restate SDK supports only synchronous validation.");
46
+ if (result.issues) {
47
+ const errorMessages = result.issues.map(formatStandardSchemaIssue).join("\n");
48
+ throw new TypeError(`Standard schema validation failed:\n${errorMessages}`);
49
+ }
50
+ return result.value;
51
+ }
52
+ };
93
53
  function formatStandardSchemaIssue(issue) {
94
- if (issue.path && issue.path.length > 0) {
95
- const jsonPointer = "/" +
96
- issue.path
97
- .map((p) => {
98
- // Handle both PathSegment objects and primitive PropertyKey values
99
- if (typeof p === "object" && p !== null && "key" in p) {
100
- return String(p.key);
101
- }
102
- return String(p);
103
- })
104
- .join("/");
105
- return `* (at ${jsonPointer}) ${issue.message}`;
106
- }
107
- return `* ${issue.message}`;
54
+ if (issue.path && issue.path.length > 0) return `* (at ${"/" + issue.path.map((p) => {
55
+ if (typeof p === "object" && p !== null && "key" in p) return String(p.key);
56
+ return String(p);
57
+ }).join("/")}) ${issue.message}`;
58
+ return `* ${issue.message}`;
108
59
  }
109
60
  function isStandardJSONSchemaV1(standard) {
110
- return (standard != undefined &&
111
- "jsonSchema" in standard &&
112
- typeof standard.jsonSchema === "object" &&
113
- standard.jsonSchema !== null &&
114
- "output" in standard.jsonSchema &&
115
- typeof standard.jsonSchema.output === "function");
61
+ return standard != void 0 && "jsonSchema" in standard && typeof standard.jsonSchema === "object" && standard.jsonSchema !== null && "output" in standard.jsonSchema && typeof standard.jsonSchema.output === "function";
116
62
  }
117
- export var serde;
118
- (function (serde) {
119
- class JsonSerde {
120
- jsonSchema;
121
- contentType = "application/json";
122
- constructor(jsonSchema) {
123
- this.jsonSchema = jsonSchema;
124
- }
125
- serialize(value) {
126
- if (value === undefined) {
127
- return new Uint8Array(0);
128
- }
129
- return new TextEncoder().encode(JSON.stringify(value));
130
- }
131
- deserialize(data) {
132
- if (data.length === 0) {
133
- return undefined;
134
- }
135
- return JSON.parse(new TextDecoder().decode(data));
136
- }
137
- schema(schema) {
138
- return new JsonSerde(schema);
139
- }
140
- }
141
- serde.JsonSerde = JsonSerde;
142
- serde.json = new JsonSerde();
143
- serde.binary = new BinarySerde();
144
- serde.empty = new VoidSerde();
145
- /**
146
- * A Standard Schema-based serde.
147
- *
148
- * @param schema the standard schema
149
- * @param validateOptions options passed to `StandardSchemaV1.Options.libraryOptions` when validating
150
- * @param jsonSchemaOptions options passed to `StandardJsonSchemaV1.Options.libraryOptions` for code generation
151
- * @returns a serde that will validate the data with the standard schema
152
- */
153
- serde.schema = (schema, validateOptions, jsonSchemaOptions) => {
154
- return new StandardSchemaSerde(schema, validateOptions, jsonSchemaOptions);
155
- };
63
+ let serde;
64
+ (function(_serde) {
65
+ class JsonSerde {
66
+ contentType = "application/json";
67
+ constructor(jsonSchema) {
68
+ this.jsonSchema = jsonSchema;
69
+ }
70
+ serialize(value) {
71
+ if (value === void 0) return new Uint8Array(0);
72
+ return new TextEncoder().encode(JSON.stringify(value));
73
+ }
74
+ deserialize(data) {
75
+ if (data.length === 0) return;
76
+ return JSON.parse(new TextDecoder().decode(data));
77
+ }
78
+ schema(schema) {
79
+ return new JsonSerde(schema);
80
+ }
81
+ }
82
+ _serde.JsonSerde = JsonSerde;
83
+ _serde.json = new JsonSerde();
84
+ _serde.binary = new BinarySerde();
85
+ _serde.empty = new VoidSerde();
86
+ _serde.schema = (schema, validateOptions, jsonSchemaOptions) => {
87
+ return new StandardSchemaSerde(schema, validateOptions, jsonSchemaOptions);
88
+ };
156
89
  })(serde || (serde = {}));
90
+
91
+ //#endregion
92
+ export { serde };
157
93
  //# sourceMappingURL=serde_api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"serde_api.js","sourceRoot":"","sources":["../src/serde_api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAmBH,MAAM,WAAW;IACf,WAAW,GAAG,0BAA0B,CAAC;IAEzC,SAAS,CAAC,KAAiB;QACzB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,WAAW,CAAC,IAAgB;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,MAAM,SAAS;IACb,SAAS,CAAC,KAAU;QAClB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAC9C,CAAC;QACD,OAAO,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED,WAAW,CAAC,IAAgB;QAC1B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;CACF;AAED,MAAM,mBAAmB;IAOJ;IACA;IALnB,WAAW,GAAI,kBAAkB,CAAC;IAClC,UAAU,CAAsB;IAEhC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ElD;;;;;;;OAOG;IACU,YAAM,GAAG,CACpB,MAAS,EACT,eAAyC,EACzC,iBAA2C,EACH,EAAE;QAC1C,OAAO,IAAI,mBAAmB,CAAC,MAAM,EAAE,eAAe,EAAE,iBAAiB,CAAC,CAAC;IAC7E,CAAC,CAAC;AACJ,CAAC,EA5CgB,KAAK,KAAL,KAAK,QA4CrB"}
1
+ {"version":3,"file":"serde_api.js","names":["schema: T","validateOptions?: Record<string, unknown>","jsonSchema?: object"],"sources":["../src/serde_api.ts"],"sourcesContent":["/*\n * Copyright (c) 2023-2024 - 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/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-namespace */\n\nimport type {\n StandardJSONSchemaV1,\n StandardSchemaV1,\n} from \"./standard_schema.js\";\n\nexport interface Serde<T> {\n contentType?: string;\n jsonSchema?: object;\n\n serialize(value: T): Uint8Array;\n\n deserialize(data: Uint8Array): T;\n}\n\nclass BinarySerde implements Serde<Uint8Array> {\n contentType = \"application/octet-stream\";\n\n serialize(value: Uint8Array): Uint8Array {\n return value;\n }\n\n deserialize(data: Uint8Array): Uint8Array {\n return data;\n }\n}\n\nclass VoidSerde implements Serde<void> {\n serialize(value: any): Uint8Array {\n if (value !== undefined) {\n throw new Error(\"Expected undefined value\");\n }\n return new Uint8Array(0);\n }\n\n deserialize(data: Uint8Array): void {\n if (data.length !== 0) {\n throw new Error(\"Expected empty data\");\n }\n }\n}\n\nclass StandardSchemaSerde<\n T extends { \"~standard\": StandardSchemaV1.Props },\n> implements Serde<StandardSchemaV1.InferOutput<T>> {\n contentType? = \"application/json\";\n jsonSchema?: object | undefined;\n\n constructor(\n private readonly schema: T,\n private readonly validateOptions?: Record<string, unknown>,\n jsonSchemaOptions?: Record<string, unknown>\n ) {\n // Extract JSON schema if available\n const standard = schema[\"~standard\"];\n if (isStandardJSONSchemaV1(standard)) {\n try {\n this.jsonSchema = (\n standard as unknown as StandardJSONSchemaV1.Props\n ).jsonSchema.output({\n target: \"draft-2020-12\",\n libraryOptions: jsonSchemaOptions,\n });\n } catch {\n // If JSON schema generation fails, leave it undefined\n this.jsonSchema = undefined;\n }\n }\n\n // Check if schema is for void/undefined type\n // Standard Schema doesn't have a direct way to detect void types,\n // so we serialize undefined and check if validation succeeds\n const testResult = standard.validate(undefined);\n // Handle both sync and async validation results\n if (testResult && typeof testResult === \"object\" && \"then\" in testResult) {\n // If it's a Promise, we can't determine contentType synchronously\n // Keep contentType as \"application/json\"\n } else if (!testResult.issues) {\n this.contentType = undefined;\n }\n }\n\n serialize(value: StandardSchemaV1.InferOutput<T>): Uint8Array {\n if (value === undefined) {\n return new Uint8Array(0);\n }\n return new TextEncoder().encode(JSON.stringify(value));\n }\n\n deserialize(data: Uint8Array): StandardSchemaV1.InferOutput<T> {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const js =\n data.length === 0\n ? undefined\n : JSON.parse(new TextDecoder().decode(data));\n\n const result = this.schema[\"~standard\"].validate(js, this.validateOptions);\n\n // Standard Schema validate can return a Promise, but Serde must be synchronous\n if (result && typeof result === \"object\" && \"then\" in result) {\n throw new TypeError(\n \"Async validation is not supported in Serde. Restate SDK supports only synchronous validation.\"\n );\n }\n\n if (result.issues) {\n const errorMessages = result.issues\n .map(formatStandardSchemaIssue)\n .join(\"\\n\");\n throw new TypeError(\n `Standard schema validation failed:\\n${errorMessages}`\n );\n }\n\n return result.value as StandardSchemaV1.InferOutput<T>;\n }\n}\n\nfunction formatStandardSchemaIssue(issue: StandardSchemaV1.Issue): string {\n if (issue.path && issue.path.length > 0) {\n const jsonPointer =\n \"/\" +\n issue.path\n .map((p) => {\n // Handle both PathSegment objects and primitive PropertyKey values\n if (typeof p === \"object\" && p !== null && \"key\" in p) {\n return String(p.key);\n }\n return String(p);\n })\n .join(\"/\");\n return `* (at ${jsonPointer}) ${issue.message}`;\n }\n return `* ${issue.message}`;\n}\n\nfunction isStandardJSONSchemaV1(standard: StandardSchemaV1.Props): boolean {\n return (\n standard != undefined &&\n \"jsonSchema\" in standard &&\n typeof standard.jsonSchema === \"object\" &&\n standard.jsonSchema !== null &&\n \"output\" in standard.jsonSchema &&\n typeof standard.jsonSchema.output === \"function\"\n );\n}\n\nexport namespace serde {\n export class JsonSerde<T> implements Serde<T | undefined> {\n contentType = \"application/json\";\n\n constructor(readonly jsonSchema?: object) {}\n\n serialize(value: T): Uint8Array {\n if (value === undefined) {\n return new Uint8Array(0);\n }\n return new TextEncoder().encode(JSON.stringify(value));\n }\n\n deserialize(data: Uint8Array): T | undefined {\n if (data.length === 0) {\n return undefined;\n }\n return JSON.parse(new TextDecoder().decode(data)) as T;\n }\n\n schema<U>(schema: object): Serde<U> {\n return new JsonSerde<U>(schema) as Serde<U>;\n }\n }\n\n export const json: JsonSerde<any> = new JsonSerde<any>();\n export const binary: Serde<Uint8Array> = new BinarySerde();\n export const empty: Serde<void> = new VoidSerde();\n\n /**\n * A Standard Schema-based serde.\n *\n * @param schema the standard schema\n * @param validateOptions options passed to `StandardSchemaV1.Options.libraryOptions` when validating\n * @param jsonSchemaOptions options passed to `StandardJsonSchemaV1.Options.libraryOptions` for code generation\n * @returns a serde that will validate the data with the standard schema\n */\n export const schema = <T extends { \"~standard\": StandardSchemaV1.Props }>(\n schema: T,\n validateOptions?: Record<string, unknown>,\n jsonSchemaOptions?: Record<string, unknown>\n ): Serde<StandardSchemaV1.InferOutput<T>> => {\n return new StandardSchemaSerde(schema, validateOptions, jsonSchemaOptions);\n };\n}\n"],"mappings":";AA4BA,IAAM,cAAN,MAA+C;CAC7C,cAAc;CAEd,UAAU,OAA+B;AACvC,SAAO;;CAGT,YAAY,MAA8B;AACxC,SAAO;;;AAIX,IAAM,YAAN,MAAuC;CACrC,UAAU,OAAwB;AA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,QAAQ,SAAS,EAClD,QAAO,OAAO,EAAE,IAAI;AAEtB,SAAO,OAAO,EAAE;GAChB,CACD,KAAK,IAAI,CACc,IAAI,MAAM;AAExC,QAAO,KAAK,MAAM;;AAGpB,SAAS,uBAAuB,UAA2C;AACzE,QACE,YAAY,UACZ,gBAAgB,YAChB,OAAO,SAAS,eAAe,YAC/B,SAAS,eAAe,QACxB,YAAY,SAAS,cACrB,OAAO,SAAS,WAAW,WAAW;;;;CAKjC,MAAM,UAA6C;EACxD,cAAc;EAEd,YAAY,AAASC,YAAqB;GAArB;;EAErB,UAAU,OAAsB;AAC9B,OAAI,UAAU,OACZ,QAAO,IAAI,WAAW,EAAE;AAE1B,UAAO,IAAI,aAAa,CAAC,OAAO,KAAK,UAAU,MAAM,CAAC;;EAGxD,YAAY,MAAiC;AAC3C,OAAI,KAAK,WAAW,EAClB;AAEF,UAAO,KAAK,MAAM,IAAI,aAAa,CAAC,OAAO,KAAK,CAAC;;EAGnD,OAAU,QAA0B;AAClC,UAAO,IAAI,UAAa,OAAO;;;;eAIC,IAAI,WAAgB;iBACf,IAAI,aAAa;gBACxB,IAAI,WAAW;kBAW/C,QACA,iBACA,sBAC2C;AAC3C,SAAO,IAAI,oBAAoB,QAAQ,iBAAiB,kBAAkB"}
@@ -1,121 +1,122 @@
1
+ //#region src/standard_schema.d.ts
1
2
  /**
2
3
  * This file is copy pasted as is from https://standardschema.dev/
3
4
  */
4
5
  /** The Standard Typed interface. This is a base type extended by other specs. */
5
- export interface StandardTypedV1<Input = unknown, Output = Input> {
6
- /** The Standard properties. */
7
- readonly "~standard": StandardTypedV1.Props<Input, Output>;
6
+ interface StandardTypedV1<Input = unknown, Output = Input> {
7
+ /** The Standard properties. */
8
+ readonly "~standard": StandardTypedV1.Props<Input, Output>;
8
9
  }
9
- export declare namespace StandardTypedV1 {
10
- /** The Standard Typed properties interface. */
11
- interface Props<Input = unknown, Output = Input> {
12
- /** The version number of the standard. */
13
- readonly version: 1;
14
- /** The vendor name of the schema library. */
15
- readonly vendor: string;
16
- /** Inferred types associated with the schema. */
17
- readonly types?: Types<Input, Output> | undefined;
18
- }
19
- /** The Standard Typed types interface. */
20
- interface Types<Input = unknown, Output = Input> {
21
- /** The input type of the schema. */
22
- readonly input: Input;
23
- /** The output type of the schema. */
24
- readonly output: Output;
25
- }
26
- /** Infers the input type of a Standard Typed. */
27
- type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
28
- /** Infers the output type of a Standard Typed. */
29
- type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
10
+ declare namespace StandardTypedV1 {
11
+ /** The Standard Typed properties interface. */
12
+ interface Props<Input = unknown, Output = Input> {
13
+ /** The version number of the standard. */
14
+ readonly version: 1;
15
+ /** The vendor name of the schema library. */
16
+ readonly vendor: string;
17
+ /** Inferred types associated with the schema. */
18
+ readonly types?: Types<Input, Output> | undefined;
19
+ }
20
+ /** The Standard Typed types interface. */
21
+ interface Types<Input = unknown, Output = Input> {
22
+ /** The input type of the schema. */
23
+ readonly input: Input;
24
+ /** The output type of the schema. */
25
+ readonly output: Output;
26
+ }
27
+ /** Infers the input type of a Standard Typed. */
28
+ type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
29
+ /** Infers the output type of a Standard Typed. */
30
+ type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
30
31
  }
31
32
  /** The Standard Schema interface. */
32
- export interface StandardSchemaV1<Input = unknown, Output = Input> {
33
- /** The Standard Schema properties. */
34
- readonly "~standard": StandardSchemaV1.Props<Input, Output>;
33
+ interface StandardSchemaV1<Input = unknown, Output = Input> {
34
+ /** The Standard Schema properties. */
35
+ readonly "~standard": StandardSchemaV1.Props<Input, Output>;
35
36
  }
36
- export declare namespace StandardSchemaV1 {
37
- /** The Standard Schema properties interface. */
38
- interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
39
- /** Validates unknown input values. */
40
- readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
41
- }
42
- /** The result interface of the validate function. */
43
- type Result<Output> = SuccessResult<Output> | FailureResult;
44
- /** The result interface if validation succeeds. */
45
- interface SuccessResult<Output> {
46
- /** The typed output value. */
47
- readonly value: Output;
48
- /** A falsy value for `issues` indicates success. */
49
- readonly issues?: undefined;
50
- }
51
- interface Options {
52
- /** Explicit support for additional vendor-specific parameters, if needed. */
53
- readonly libraryOptions?: Record<string, unknown> | undefined;
54
- }
55
- /** The result interface if validation fails. */
56
- interface FailureResult {
57
- /** The issues of failed validation. */
58
- readonly issues: ReadonlyArray<Issue>;
59
- }
60
- /** The issue interface of the failure output. */
61
- interface Issue {
62
- /** The error message of the issue. */
63
- readonly message: string;
64
- /** The path of the issue, if any. */
65
- readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
66
- }
67
- /** The path segment interface of the issue. */
68
- interface PathSegment {
69
- /** The key representing a path segment. */
70
- readonly key: PropertyKey;
71
- }
72
- /** The Standard types interface. */
73
- interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {
74
- }
75
- /** Infers the input type of a Standard. */
76
- type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
77
- /** Infers the output type of a Standard. */
78
- type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
37
+ declare namespace StandardSchemaV1 {
38
+ /** The Standard Schema properties interface. */
39
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
40
+ /** Validates unknown input values. */
41
+ readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
42
+ }
43
+ /** The result interface of the validate function. */
44
+ type Result<Output> = SuccessResult<Output> | FailureResult;
45
+ /** The result interface if validation succeeds. */
46
+ interface SuccessResult<Output> {
47
+ /** The typed output value. */
48
+ readonly value: Output;
49
+ /** A falsy value for `issues` indicates success. */
50
+ readonly issues?: undefined;
51
+ }
52
+ interface Options {
53
+ /** Explicit support for additional vendor-specific parameters, if needed. */
54
+ readonly libraryOptions?: Record<string, unknown> | undefined;
55
+ }
56
+ /** The result interface if validation fails. */
57
+ interface FailureResult {
58
+ /** The issues of failed validation. */
59
+ readonly issues: ReadonlyArray<Issue>;
60
+ }
61
+ /** The issue interface of the failure output. */
62
+ interface Issue {
63
+ /** The error message of the issue. */
64
+ readonly message: string;
65
+ /** The path of the issue, if any. */
66
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
67
+ }
68
+ /** The path segment interface of the issue. */
69
+ interface PathSegment {
70
+ /** The key representing a path segment. */
71
+ readonly key: PropertyKey;
72
+ }
73
+ /** The Standard types interface. */
74
+ interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
75
+ /** Infers the input type of a Standard. */
76
+ type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
77
+ /** Infers the output type of a Standard. */
78
+ type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
79
79
  }
80
80
  /** The Standard JSON Schema interface. */
81
- export interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
82
- /** The Standard JSON Schema properties. */
83
- readonly "~standard": StandardJSONSchemaV1.Props<Input, Output>;
81
+ interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
82
+ /** The Standard JSON Schema properties. */
83
+ readonly "~standard": StandardJSONSchemaV1.Props<Input, Output>;
84
84
  }
85
- export declare namespace StandardJSONSchemaV1 {
86
- /** The Standard JSON Schema properties interface. */
87
- interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
88
- /** Methods for generating the input/output JSON Schema. */
89
- readonly jsonSchema: StandardJSONSchemaV1.Converter;
90
- }
91
- /** The Standard JSON Schema converter interface. */
92
- interface Converter {
93
- /** Converts the input type to JSON Schema. May throw if conversion is not supported. */
94
- readonly input: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
95
- /** Converts the output type to JSON Schema. May throw if conversion is not supported. */
96
- readonly output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
97
- }
98
- /**
99
- * The target version of the generated JSON Schema.
100
- *
101
- * It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use. All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target.
102
- *
103
- * The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`.
104
- */
105
- type Target = "draft-2020-12" | "draft-07" | "openapi-3.0" | ({} & string);
106
- /** The options for the input/output methods. */
107
- interface Options {
108
- /** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */
109
- readonly target: Target;
110
- /** Explicit support for additional vendor-specific parameters, if needed. */
111
- readonly libraryOptions?: Record<string, unknown> | undefined;
112
- }
113
- /** The Standard types interface. */
114
- interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {
115
- }
116
- /** Infers the input type of a Standard. */
117
- type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
118
- /** Infers the output type of a Standard. */
119
- type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
85
+ declare namespace StandardJSONSchemaV1 {
86
+ /** The Standard JSON Schema properties interface. */
87
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
88
+ /** Methods for generating the input/output JSON Schema. */
89
+ readonly jsonSchema: StandardJSONSchemaV1.Converter;
90
+ }
91
+ /** The Standard JSON Schema converter interface. */
92
+ interface Converter {
93
+ /** Converts the input type to JSON Schema. May throw if conversion is not supported. */
94
+ readonly input: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
95
+ /** Converts the output type to JSON Schema. May throw if conversion is not supported. */
96
+ readonly output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
97
+ }
98
+ /**
99
+ * The target version of the generated JSON Schema.
100
+ *
101
+ * It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use. All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target.
102
+ *
103
+ * The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`.
104
+ */
105
+ type Target = "draft-2020-12" | "draft-07" | "openapi-3.0" | ({} & string);
106
+ /** The options for the input/output methods. */
107
+ interface Options {
108
+ /** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */
109
+ readonly target: Target;
110
+ /** Explicit support for additional vendor-specific parameters, if needed. */
111
+ readonly libraryOptions?: Record<string, unknown> | undefined;
112
+ }
113
+ /** The Standard types interface. */
114
+ interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
115
+ /** Infers the input type of a Standard. */
116
+ type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
117
+ /** Infers the output type of a Standard. */
118
+ type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
120
119
  }
120
+ //#endregion
121
+ export { StandardJSONSchemaV1, StandardSchemaV1, StandardTypedV1 };
121
122
  //# sourceMappingURL=standard_schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"standard_schema.d.ts","sourceRoot":"","sources":["../src/standard_schema.ts"],"names":[],"mappings":"AAGA;;GAEG;AAEH,iFAAiF;AACjF,MAAM,WAAW,eAAe,CAAC,KAAK,GAAG,OAAO,EAAE,MAAM,GAAG,KAAK;IAC9D,+BAA+B;IAC/B,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;CAC5D;AAED,MAAM,CAAC,OAAO,WAAW,eAAe,CAAC;IACvC,+CAA+C;IAC/C,UAAiB,KAAK,CAAC,KAAK,GAAG,OAAO,EAAE,MAAM,GAAG,K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AAA,KAAgB,CAAA,QAAA,OAAA,EAAA,SAvBf,KAuBe,CAAA,SAtBhB,eAAA,CAAgB,KAsBA,CAtBM,KAsBN,EAtBa,MAsBb,CAAA,CAAA,CASb;EACN;EAGM,KAAA,UAAA,CAAA,eAhCyB,eAgCJ,CAAA,GA/BhC,eAAA,CAAgB,UA+BgB,CA/BL,MA+BK,CAAA;EAC3B;EAoBY,KAAA,WAAA,CAAA,eAjDoB,eAiDpB,CAAA,GAhDjB,eAAA,CAAgB,WAgDC,CAhDW,MAgDX,CAAA;;;AAUa,UAtDjB,oBAsDiB,CAAA,QAAA,OAAA,EAAA,SAtD8B,KAsD9B,CAAA,CAAA;EAAO;EAA7B,SAAA,WAAgB,EApDJ,oBAAA,CAAqB,KAoDjB,CApDuB,KAoDvB,EApD8B,MAoD9B,CAAA;;AAIG,kBArDN,oBAAA,CAqDM;EAA3B;EAGqC,UAAA,KAAA,CAAA,QAAA,OAAA,EAAA,SApD5B,KAoD4B,CAAA,SAnD7B,eAAA,CAAgB,KAmDa,CAnDP,KAmDO,EAnDA,MAmDA,CAAA,CAAA;IACT;IAA5B,SAAgB,UAAA,EAlDK,oBAAA,CAAqB,SAkD1B;EAAW;;;;8BA3ChB,oBAAA,CAAqB,YAC3B;;+BAGM,oBAAA,CAAqB,YAC3B;;;;;;;;;;;;;qBAoBY;;8BAGS;;;4CAMjB,eACD,eAAA,CAAgB,MAAM,OAAO;;iCAGD,mBACpC,eAAA,CAAgB,WAAW;;kCAGU,mBACrC,eAAA,CAAgB,YAAY"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@restatedev/restate-sdk-core",
3
- "version": "1.11.1",
3
+ "version": "1.12.0",
4
4
  "description": "Typescript SDK for Restate",
5
5
  "author": "Restate Developers",
6
6
  "email": "code@restate.dev",