@arcforges/proto 1.0.0-ci.89.1 → 1.0.0-ci.92.1
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/NOTICE +3 -3
- package/README.md +7 -0
- package/build-identity.json +6 -6
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/services/gen/catalog.d.ts +8 -0
- package/dist/services/gen/catalog.js +6 -0
- package/dist/wire.d.ts +34 -0
- package/dist/wire.js +49 -0
- package/package.json +1 -1
- package/sbom.cdx.json +4 -4
- package/source.json +2 -2
package/NOTICE
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
ArcForges Contracts
|
|
2
2
|
Copyright 2026 ArcForges contributors
|
|
3
3
|
|
|
4
|
-
@arcforges/proto 1.0.0-ci.
|
|
4
|
+
@arcforges/proto 1.0.0-ci.92.1 (Apache-2.0)
|
|
5
5
|
|
|
6
6
|
Resolved runtime dependency inventory (dependencies retain their own licences):
|
|
7
7
|
- @bufbuild/protobuf 2.15.0: (Apache-2.0 AND BSD-3-Clause) (pkg:npm/%40bufbuild/protobuf@2.15.0)
|
|
@@ -12,8 +12,8 @@ ArcForges source provenance notices
|
|
|
12
12
|
|
|
13
13
|
Generated from reviewed active records. Original licence files and dependency notices remain authoritative.
|
|
14
14
|
|
|
15
|
-
contract-bindings-
|
|
16
|
-
Source: https://github.com/ArcForges/Contracts @
|
|
15
|
+
contract-bindings-r5
|
|
16
|
+
Source: https://github.com/ArcForges/Contracts @ b6795dc55852e16bcd555751a58bd494958e3917
|
|
17
17
|
Material licence: Apache-2.0
|
|
18
18
|
Notice scope: packages
|
|
19
19
|
Copyright 2026 ArcForges contributors.
|
package/README.md
CHANGED
|
@@ -10,6 +10,13 @@ Use `create(SayHelloRequestSchema, { name: "World" })`, `toBinary` and
|
|
|
10
10
|
`fromBinary` from `@bufbuild/protobuf`. Use the exported `HelloService`
|
|
11
11
|
descriptor with a compatible gRPC/gRPC-Web client transport.
|
|
12
12
|
|
|
13
|
+
`decodeContract(schema, bytes, limit)` and `encodeContract` apply the registry size
|
|
14
|
+
classes in `wireLimits` (4 MiB unary/helper, 256 KiB inline page, 32 KiB stream frame,
|
|
15
|
+
64 MiB large projection) and the root-plus-100 nesting bound, retaining unknown fields.
|
|
16
|
+
Refusals are `ContractSerializationError` values with `tooLarge`, `tooDeep` or
|
|
17
|
+
`malformed`. `contractServices` lists the generated services; nothing is discovered
|
|
18
|
+
at runtime.
|
|
19
|
+
|
|
13
20
|
Use `parseId` and `idToWire` to preserve an explicit identifier domain, bigint for
|
|
14
21
|
exact 64-bit values, and `notesDecimal`/`decimalParts` for Notes decimal boundaries.
|
|
15
22
|
The generated `is<Type>` functions check the current supported mutation profile.
|
package/build-identity.json
CHANGED
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
"owner": "Contracts",
|
|
4
4
|
"artifact": {
|
|
5
5
|
"id": "@arcforges/proto",
|
|
6
|
-
"version": "1.0.0-ci.
|
|
6
|
+
"version": "1.0.0-ci.92.1"
|
|
7
7
|
},
|
|
8
8
|
"build": {
|
|
9
|
-
"sourceCommit": "
|
|
9
|
+
"sourceCommit": "e6c4a77f3ba48d70de4bf524623985b29278c784",
|
|
10
10
|
"dirty": false,
|
|
11
11
|
"kind": "ci",
|
|
12
|
-
"buildId": "
|
|
13
|
-
"runId": "
|
|
12
|
+
"buildId": "35797272606.1",
|
|
13
|
+
"runId": "35797272606",
|
|
14
14
|
"runAttempt": 1,
|
|
15
|
-
"pipelineRun": "https://github.com/ArcForges/Contracts/actions/runs/
|
|
16
|
-
"sourceDateEpoch":
|
|
15
|
+
"pipelineRun": "https://github.com/ArcForges/Contracts/actions/runs/35797272606",
|
|
16
|
+
"sourceDateEpoch": 1790119475
|
|
17
17
|
},
|
|
18
18
|
"axes": {
|
|
19
19
|
"AppVersion": {
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Generated services owned by this package, in schema order; nothing is discovered at runtime. */
|
|
2
|
+
export declare const contractServices: readonly [import("@bufbuild/protobuf/codegenv2").GenService<{
|
|
3
|
+
sayHello: {
|
|
4
|
+
methodKind: "unary";
|
|
5
|
+
input: typeof import("../../gen/arcforges/hello/v1/hello_pb.js").SayHelloRequestSchema;
|
|
6
|
+
output: typeof import("../../gen/arcforges/hello/v1/hello_pb.js").SayHelloResponseSchema;
|
|
7
|
+
};
|
|
8
|
+
}>];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// <auto-generated />
|
|
3
|
+
// Generated by eng/contracts.py; do not edit.
|
|
4
|
+
import { HelloService } from "../../gen/arcforges/hello/v1/hello_pb.js";
|
|
5
|
+
/** Generated services owned by this package, in schema order; nothing is discovered at runtime. */
|
|
6
|
+
export const contractServices = Object.freeze([HelloService]);
|
package/dist/wire.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { DescMessage, MessageShape } from "@bufbuild/protobuf";
|
|
2
|
+
/** The registry's fixed decode and encode bounds. */
|
|
3
|
+
export declare const wireLimits: Readonly<{
|
|
4
|
+
readonly unaryMessage: number;
|
|
5
|
+
readonly helperMessage: number;
|
|
6
|
+
readonly inlinePage: number;
|
|
7
|
+
readonly streamFrame: number;
|
|
8
|
+
readonly largeProjection: number;
|
|
9
|
+
/** Message levels permitted below the root message. */
|
|
10
|
+
readonly nestedMessageLevels: 100;
|
|
11
|
+
}>;
|
|
12
|
+
/** Selected transport size classes from the wire registry. */
|
|
13
|
+
export type WireLimit = Exclude<keyof typeof wireLimits, "nestedMessageLevels">;
|
|
14
|
+
/** Why a bounded contract encode or decode was refused. */
|
|
15
|
+
export type ContractSerializationFailure = "tooLarge" | "tooDeep" | "malformed" | "invalid";
|
|
16
|
+
/** A typed refusal from a bounded contract codec; the message never carries payload content. */
|
|
17
|
+
export declare class ContractSerializationError extends Error {
|
|
18
|
+
readonly failure: ContractSerializationFailure;
|
|
19
|
+
constructor(failure: ContractSerializationFailure, options?: {
|
|
20
|
+
cause?: unknown;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* protobuf-es read options matching the C# decoder: unknown fields are retained
|
|
25
|
+
* and the root plus 100 nested message levels are admitted (protobuf-es counts the root).
|
|
26
|
+
*/
|
|
27
|
+
export declare const contractBinaryReadOptions: Readonly<{
|
|
28
|
+
readUnknownFields: true;
|
|
29
|
+
recursionLimit: number;
|
|
30
|
+
}>;
|
|
31
|
+
/** Decodes one complete message or throws a typed refusal. */
|
|
32
|
+
export declare function decodeContract<Desc extends DescMessage>(schema: Desc, bytes: Uint8Array, limit: WireLimit): MessageShape<Desc>;
|
|
33
|
+
/** Encodes a message only when its serialized size fits the selected class. */
|
|
34
|
+
export declare function encodeContract<Desc extends DescMessage>(schema: Desc, message: MessageShape<Desc>, limit: WireLimit): Uint8Array;
|
package/dist/wire.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
import { fromBinary, toBinary } from "@bufbuild/protobuf";
|
|
3
|
+
/** The registry's fixed decode and encode bounds. */
|
|
4
|
+
export const wireLimits = Object.freeze({
|
|
5
|
+
unaryMessage: 4 * 1024 * 1024,
|
|
6
|
+
helperMessage: 4 * 1024 * 1024,
|
|
7
|
+
inlinePage: 256 * 1024,
|
|
8
|
+
streamFrame: 32 * 1024,
|
|
9
|
+
largeProjection: 64 * 1024 * 1024,
|
|
10
|
+
/** Message levels permitted below the root message. */
|
|
11
|
+
nestedMessageLevels: 100,
|
|
12
|
+
});
|
|
13
|
+
/** A typed refusal from a bounded contract codec; the message never carries payload content. */
|
|
14
|
+
export class ContractSerializationError extends Error {
|
|
15
|
+
failure;
|
|
16
|
+
constructor(failure, options) {
|
|
17
|
+
super(`Contract serialization refused: ${failure}.`, options);
|
|
18
|
+
this.name = "ContractSerializationError";
|
|
19
|
+
this.failure = failure;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* protobuf-es read options matching the C# decoder: unknown fields are retained
|
|
24
|
+
* and the root plus 100 nested message levels are admitted (protobuf-es counts the root).
|
|
25
|
+
*/
|
|
26
|
+
export const contractBinaryReadOptions = Object.freeze({
|
|
27
|
+
readUnknownFields: true,
|
|
28
|
+
recursionLimit: wireLimits.nestedMessageLevels + 1,
|
|
29
|
+
});
|
|
30
|
+
/** Decodes one complete message or throws a typed refusal. */
|
|
31
|
+
export function decodeContract(schema, bytes, limit) {
|
|
32
|
+
if (bytes.byteLength > wireLimits[limit])
|
|
33
|
+
throw new ContractSerializationError("tooLarge");
|
|
34
|
+
try {
|
|
35
|
+
return fromBinary(schema, bytes, contractBinaryReadOptions);
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
// protobuf-es reports recursion exhaustion through its fixed depth message.
|
|
39
|
+
const deep = error instanceof Error && error.message.includes("maximum recursion depth");
|
|
40
|
+
throw new ContractSerializationError(deep ? "tooDeep" : "malformed", { cause: error });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** Encodes a message only when its serialized size fits the selected class. */
|
|
44
|
+
export function encodeContract(schema, message, limit) {
|
|
45
|
+
const bytes = toBinary(schema, message, { writeUnknownFields: true });
|
|
46
|
+
if (bytes.byteLength > wireLimits[limit])
|
|
47
|
+
throw new ContractSerializationError("tooLarge");
|
|
48
|
+
return bytes;
|
|
49
|
+
}
|
package/package.json
CHANGED
package/sbom.cdx.json
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
"metadata": {
|
|
6
6
|
"component": {
|
|
7
7
|
"type": "library",
|
|
8
|
-
"bom-ref": "pkg:npm/%40arcforges/proto@1.0.0-ci.
|
|
8
|
+
"bom-ref": "pkg:npm/%40arcforges/proto@1.0.0-ci.92.1",
|
|
9
9
|
"name": "@arcforges/proto",
|
|
10
|
-
"version": "1.0.0-ci.
|
|
11
|
-
"purl": "pkg:npm/%40arcforges/proto@1.0.0-ci.
|
|
10
|
+
"version": "1.0.0-ci.92.1",
|
|
11
|
+
"purl": "pkg:npm/%40arcforges/proto@1.0.0-ci.92.1",
|
|
12
12
|
"licenses": [
|
|
13
13
|
{
|
|
14
14
|
"expression": "Apache-2.0"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"dependsOn": []
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
|
-
"ref": "pkg:npm/%40arcforges/proto@1.0.0-ci.
|
|
39
|
+
"ref": "pkg:npm/%40arcforges/proto@1.0.0-ci.92.1",
|
|
40
40
|
"dependsOn": [
|
|
41
41
|
"pkg:npm/%40bufbuild/protobuf@2.15.0"
|
|
42
42
|
]
|
package/source.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"repository": "https://github.com/ArcForges/Contracts",
|
|
3
|
-
"commit": "
|
|
3
|
+
"commit": "e6c4a77f3ba48d70de4bf524623985b29278c784",
|
|
4
4
|
"dirty": false,
|
|
5
|
-
"version": "1.0.0-ci.
|
|
5
|
+
"version": "1.0.0-ci.92.1",
|
|
6
6
|
"contractAccess": "public",
|
|
7
7
|
"schemaSources": {
|
|
8
8
|
"public/proto/arcforges/events/v1/events.proto": "ea0ac740c06bbb5b81724b4a7e601110424cabc4940b07e579cf97d852880f43",
|