@trylimbo/sdk-plugin-mxf 0.2.24 → 0.2.25-canary.38

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.
@@ -150,14 +150,32 @@ declare const pointerLiteralSymbol: unique symbol;
150
150
  */
151
151
  declare const uniffiTypeNameSymbol: unique symbol;
152
152
  declare namespace trylimbo_plugin_mxf_d_exports {
153
- export { Code, FieldViolation, MxfAuthor, MxfAuthorInterface, MxfAuthorLike, MxfPlugin, MxfPluginInterface, MxfPluginLike, RangeSink, RangeSource, Region, SdkError, SdkError_Tags, _default$1 as default };
153
+ export { ByteRange, Code, FieldViolation, MxfAuthor, MxfAuthorInterface, MxfAuthorLike, MxfPlugin, MxfPluginInterface, MxfPluginLike, RangeSink, RangeSource, SdkError, SdkError_Tags, _default$1 as default };
154
154
  }
155
+ /**
156
+ * A byte window a manifest occupies. Structurally identical to the SDKs' `ByteRange`, so the two
157
+ * cross the boundary without sharing a Rust type.
158
+ */
159
+ export type ByteRange = {
160
+ offset: bigint;
161
+ length: bigint;
162
+ };
163
+ /**
164
+ * Generated factory for {@link ByteRange} record objects.
165
+ */
166
+ export declare const ByteRange: Readonly<{
167
+ create: (partial: Partial<ByteRange> & Required<Omit<ByteRange, never>>) => ByteRange;
168
+ new: (partial: Partial<ByteRange> & Required<Omit<ByteRange, never>>) => ByteRange;
169
+ defaults: () => Partial<ByteRange>;
170
+ }>;
155
171
  /**
156
172
  * One `google.rpc.BadRequest.FieldViolation`: a request field that failed a constraint.
157
173
  */
158
174
  export type FieldViolation = {
159
175
  /**
160
- * A dotted proto path to the offending field (`""` for a message-level rule).
176
+ * The offending field: rooted at the call's argument when an SDK refuses it
177
+ * (`options.soft_bindings[1].alg`), at the request when a service does
178
+ * (`provenance.actions[0].label`).
161
179
  */
162
180
  field: string;
163
181
  /**
@@ -165,7 +183,7 @@ export type FieldViolation = {
165
183
  */
166
184
  description: string;
167
185
  /**
168
- * The constraint id that failed (a protovalidate/CEL rule id), stable across releases.
186
+ * The rule that failed, such as `string.min_len` or `alg.unlisted`: the stable branch key.
169
187
  */
170
188
  reason: string;
171
189
  };
@@ -177,28 +195,8 @@ export declare const FieldViolation: Readonly<{
177
195
  new: (partial: Partial<FieldViolation> & Required<Omit<FieldViolation, never>>) => FieldViolation;
178
196
  defaults: () => Partial<FieldViolation>;
179
197
  }>;
180
- /**
181
- * A byte window a manifest occupies. Structurally identical to the SDKs' `Region`, so the two
182
- * cross the boundary without sharing a Rust type.
183
- */
184
- export type Region = {
185
- offset: bigint;
186
- length: bigint;
187
- };
188
- /**
189
- * Generated factory for {@link Region} record objects.
190
- */
191
- export declare const Region: Readonly<{
192
- create: (partial: Partial<Region> & Required<Omit<Region, never>>) => Region;
193
- new: (partial: Partial<Region> & Required<Omit<Region, never>>) => Region;
194
- defaults: () => Partial<Region>;
195
- }>;
196
198
  /**
197
199
  * A canonical gRPC/Connect status code: the coarse, closed failure class.
198
- *
199
- * The wasm lane projects this as a camelCase string like every other tagged value
200
- * there, so a consumer narrows on `err.code === "resourceExhausted"`; the native lane
201
- * projects an enum.
202
200
  */
203
201
  export declare enum Code {
204
202
  Canceled = 0,
@@ -604,15 +602,15 @@ export interface MxfAuthorLike {
604
602
  *
605
603
  * [`SdkError`] when the source cannot be read or the MXF structure is malformed.
606
604
  */
607
- locate(src: RangeSource, asyncOpts_?: {
605
+ locate(source: RangeSource, asyncOpts_?: {
608
606
  signal: AbortSignal;
609
- }): Promise<Array<Region>>;
607
+ }): Promise<Array<ByteRange>>;
610
608
  /**
611
609
  * The media types this plugin owns. The SDK asserts any `sniff` result is a member.
612
610
  */
613
611
  mediaTypes(): Array<string>;
614
612
  /**
615
- * Reserve `reserve` bytes of manifest slot by writing MXF structure through `dst`, and
613
+ * Reserve `reserve` bytes of manifest slot by writing MXF structure through `sink`, and
616
614
  * return exactly where it landed. Never embeds: the SDK writes the signed manifest into
617
615
  * the returned regions.
618
616
  *
@@ -620,9 +618,9 @@ export interface MxfAuthorLike {
620
618
  *
621
619
  * [`SdkError`] when the sink cannot be written or `reserve` exceeds a `u32` slot.
622
620
  */
623
- reserveSlot(dst: RangeSink, reserve: bigint, asyncOpts_?: {
621
+ reserveSlot(sink: RangeSink, reserve: bigint, asyncOpts_?: {
624
622
  signal: AbortSignal;
625
- }): Promise<Array<Region>>;
623
+ }): Promise<Array<ByteRange>>;
626
624
  /**
627
625
  * Recognize MXF from the real bytes, or `None` to decline.
628
626
  *
@@ -630,7 +628,7 @@ export interface MxfAuthorLike {
630
628
  *
631
629
  * [`SdkError`] when the source cannot be read.
632
630
  */
633
- sniff(src: RangeSource, asyncOpts_?: {
631
+ sniff(source: RangeSource, asyncOpts_?: {
634
632
  signal: AbortSignal;
635
633
  }): Promise<string | undefined>;
636
634
  }
@@ -659,15 +657,15 @@ export declare class MxfAuthor extends UniffiAbstractObject implements MxfAuthor
659
657
  *
660
658
  * [`SdkError`] when the source cannot be read or the MXF structure is malformed.
661
659
  */
662
- locate(src: RangeSource, asyncOpts_?: {
660
+ locate(source: RangeSource, asyncOpts_?: {
663
661
  signal: AbortSignal;
664
- }): Promise<Array<Region>>;
662
+ }): Promise<Array<ByteRange>>;
665
663
  /**
666
664
  * The media types this plugin owns. The SDK asserts any `sniff` result is a member.
667
665
  */
668
666
  mediaTypes(): Array<string>;
669
667
  /**
670
- * Reserve `reserve` bytes of manifest slot by writing MXF structure through `dst`, and
668
+ * Reserve `reserve` bytes of manifest slot by writing MXF structure through `sink`, and
671
669
  * return exactly where it landed. Never embeds: the SDK writes the signed manifest into
672
670
  * the returned regions.
673
671
  *
@@ -675,9 +673,9 @@ export declare class MxfAuthor extends UniffiAbstractObject implements MxfAuthor
675
673
  *
676
674
  * [`SdkError`] when the sink cannot be written or `reserve` exceeds a `u32` slot.
677
675
  */
678
- reserveSlot(dst: RangeSink, reserve: bigint, asyncOpts_?: {
676
+ reserveSlot(sink: RangeSink, reserve: bigint, asyncOpts_?: {
679
677
  signal: AbortSignal;
680
- }): Promise<Array<Region>>;
678
+ }): Promise<Array<ByteRange>>;
681
679
  /**
682
680
  * Recognize MXF from the real bytes, or `None` to decline.
683
681
  *
@@ -685,7 +683,7 @@ export declare class MxfAuthor extends UniffiAbstractObject implements MxfAuthor
685
683
  *
686
684
  * [`SdkError`] when the source cannot be read.
687
685
  */
688
- sniff(src: RangeSource, asyncOpts_?: {
686
+ sniff(source: RangeSource, asyncOpts_?: {
689
687
  signal: AbortSignal;
690
688
  }): Promise<string | undefined>;
691
689
  uniffiDestroy(): void;
@@ -706,9 +704,9 @@ export interface MxfPluginLike {
706
704
  *
707
705
  * [`SdkError`] when the source cannot be read or the MXF structure is malformed.
708
706
  */
709
- locate(src: RangeSource, asyncOpts_?: {
707
+ locate(source: RangeSource, asyncOpts_?: {
710
708
  signal: AbortSignal;
711
- }): Promise<Array<Region>>;
709
+ }): Promise<Array<ByteRange>>;
712
710
  /**
713
711
  * The media types this plugin owns. The SDK asserts any `sniff` result is a member.
714
712
  */
@@ -720,7 +718,7 @@ export interface MxfPluginLike {
720
718
  *
721
719
  * [`SdkError`] when the source cannot be read.
722
720
  */
723
- sniff(src: RangeSource, asyncOpts_?: {
721
+ sniff(source: RangeSource, asyncOpts_?: {
724
722
  signal: AbortSignal;
725
723
  }): Promise<string | undefined>;
726
724
  }
@@ -747,9 +745,9 @@ export declare class MxfPlugin extends UniffiAbstractObject implements MxfPlugin
747
745
  *
748
746
  * [`SdkError`] when the source cannot be read or the MXF structure is malformed.
749
747
  */
750
- locate(src: RangeSource, asyncOpts_?: {
748
+ locate(source: RangeSource, asyncOpts_?: {
751
749
  signal: AbortSignal;
752
- }): Promise<Array<Region>>;
750
+ }): Promise<Array<ByteRange>>;
753
751
  /**
754
752
  * The media types this plugin owns. The SDK asserts any `sniff` result is a member.
755
753
  */
@@ -761,7 +759,7 @@ export declare class MxfPlugin extends UniffiAbstractObject implements MxfPlugin
761
759
  *
762
760
  * [`SdkError`] when the source cannot be read.
763
761
  */
764
- sniff(src: RangeSource, asyncOpts_?: {
762
+ sniff(source: RangeSource, asyncOpts_?: {
765
763
  signal: AbortSignal;
766
764
  }): Promise<string | undefined>;
767
765
  uniffiDestroy(): void;
@@ -781,6 +779,13 @@ declare function uniffiEnsureInitialized(): void;
781
779
  declare const _default$1: Readonly<{
782
780
  initialize: typeof uniffiEnsureInitialized;
783
781
  converters: {
782
+ FfiConverterTypeByteRange: {
783
+ readFromCursor(c: Cursor): ByteRange;
784
+ writeIntoCursor(value: ByteRange, c: Cursor): void;
785
+ allocationSize(value: ByteRange): number;
786
+ lift(value: UniffiByteArray): ByteRange;
787
+ lower(value: ByteRange, alloc: RustBufferAllocator): UniffiByteArray;
788
+ };
784
789
  FfiConverterTypeCode: {
785
790
  readFromCursor(c: Cursor): Code;
786
791
  writeIntoCursor(value: Code, c: Cursor): void;
@@ -797,13 +802,6 @@ declare const _default$1: Readonly<{
797
802
  };
798
803
  FfiConverterTypeMxfAuthor: FfiConverterObject<MxfAuthorLike>;
799
804
  FfiConverterTypeMxfPlugin: FfiConverterObject<MxfPluginLike>;
800
- FfiConverterTypeRegion: {
801
- readFromCursor(c: Cursor): Region;
802
- writeIntoCursor(value: Region, c: Cursor): void;
803
- allocationSize(value: Region): number;
804
- lift(value: UniffiByteArray): Region;
805
- lower(value: Region, alloc: RustBufferAllocator): UniffiByteArray;
806
- };
807
805
  FfiConverterTypeSdkError: {
808
806
  readFromCursor(c: Cursor): SdkError;
809
807
  writeIntoCursor(value: SdkError, c: Cursor): void;
package/gen/ffi/index.js CHANGED
@@ -658,10 +658,17 @@ const UNIFFI_FOREIGN_FUTURE_HANDLE_MAP = new UniffiHandleMap();
658
658
  function uniffiTraitInterfaceCallAsyncWithError(makeCall, handleSuccess, handleError, isErrorType, lowerError, lowerString, alloc) {
659
659
  const settledHolder = { settled: false };
660
660
  const abortController = new AbortController();
661
+ let onRejected;
661
662
  const promiseHelper = {
662
663
  abortController,
663
664
  settledHolder,
664
- promise: makeCall(abortController.signal).finally(() => settledHolder.settled = true).then(handleSuccess, (error) => {
665
+ promise: makeCall(abortController.signal).finally(() => settledHolder.settled = true).then((value) => {
666
+ try {
667
+ handleSuccess(value);
668
+ } catch (error) {
669
+ onRejected(error);
670
+ }
671
+ }, onRejected = (error) => {
665
672
  let message = error.message ? error.message : error.toString();
666
673
  if (isErrorType(error)) try {
667
674
  handleError(1, lowerError(error, alloc));
@@ -906,16 +913,58 @@ var Cursor = class Cursor {
906
913
  };
907
914
  //#endregion
908
915
  //#region ../../../../../node_modules/@ubjs/core/dist/esm/ffi-converters.js
916
+ function uniffiInvalid(message) {
917
+ return SdkError.Invalid.new({
918
+ code: Code.InvalidArgument,
919
+ message,
920
+ fieldViolations: []
921
+ });
922
+ }
923
+ const uniffiUnsignedBounds = {
924
+ UInt8: 255,
925
+ UInt16: 65535,
926
+ UInt32: 4294967295
927
+ };
928
+ function uniffiChecked(kind, converter) {
929
+ const unsigned = kind.startsWith("UInt");
930
+ const bits = Number(kind.replace(/\D/g, ""));
931
+ const wide = bits === 64;
932
+ const lower = wide ? unsigned ? BigInt("0") : -(BigInt("1") << BigInt("63")) : unsigned ? 0 : -(2 ** (bits - 1));
933
+ const upper = wide ? unsigned ? (BigInt("1") << BigInt("64")) - BigInt("1") : (BigInt("1") << BigInt("63")) - BigInt("1") : unsigned ? uniffiUnsignedBounds[kind] : 2 ** (bits - 1) - 1;
934
+ return {
935
+ ...converter,
936
+ lower: (v, _alloc) => {
937
+ if (wide ? typeof v !== "bigint" : typeof v !== "number" || !Number.isInteger(v)) throw uniffiInvalid(`expected ${wide ? "a bigint" : "an integer number"} for a ${kind}, got ${typeof v === "number" ? v : typeof v}`);
938
+ if (v < lower || v > upper) throw uniffiInvalid(`${v} is outside the range of a ${kind}`);
939
+ return v;
940
+ }
941
+ };
942
+ }
943
+ function uniffiMillis(value) {
944
+ if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 0) throw uniffiInvalid(`a duration is a non-negative whole number of milliseconds, got ${typeof value === "number" ? value : typeof value}`);
945
+ return value;
946
+ }
947
+ function uniffiObject(value) {
948
+ if (value === null || typeof value !== "object" && typeof value !== "function") throw uniffiInvalid(`expected an object, got ${value === null ? "null" : typeof value}`);
949
+ }
950
+ function uniffiBytes(value) {
951
+ if (!(value instanceof ArrayBuffer || value instanceof Uint8Array)) throw uniffiInvalid(`expected an ArrayBuffer or Uint8Array, got ${value === null ? "null" : typeof value}`);
952
+ }
909
953
  var AbstractFfiConverterByteArray = class {
910
954
  lift(value) {
911
955
  const c = Cursor.fromUint8Array(value);
912
956
  return this.readFromCursor(c);
913
957
  }
914
958
  lower(value, alloc) {
915
- const view = alloc(this.allocationSize(value));
916
- const c = Cursor.fromUint8Array(view);
917
- this.writeIntoCursor(value, c);
918
- return view;
959
+ try {
960
+ const view = alloc(this.allocationSize(value));
961
+ const c = Cursor.fromUint8Array(view);
962
+ this.writeIntoCursor(value, c);
963
+ return view;
964
+ } catch (error) {
965
+ if (error != null && SdkError.instanceOf(error)) throw error;
966
+ throw uniffiInvalid(error instanceof Error ? error.message : String(error));
967
+ }
919
968
  }
920
969
  };
921
970
  /**
@@ -935,8 +984,14 @@ function makePrimitive(read, write, byteSize) {
935
984
  writeIntoCursor: write
936
985
  };
937
986
  }
938
- const FfiConverterUInt32 = makePrimitive((c) => c.readU32(), (v, c) => c.writeU32(v), 4);
939
- const FfiConverterUInt64 = makePrimitive((c) => c.readU64(), (v, c) => c.writeU64(v), 8);
987
+ uniffiChecked("Int8", makePrimitive((c) => c.readI8(), (v, c) => c.writeI8(v), 1));
988
+ uniffiChecked("Int16", makePrimitive((c) => c.readI16(), (v, c) => c.writeI16(v), 2));
989
+ uniffiChecked("Int32", makePrimitive((c) => c.readI32(), (v, c) => c.writeI32(v), 4));
990
+ uniffiChecked("Int64", makePrimitive((c) => c.readI64(), (v, c) => c.writeI64(v), 8));
991
+ uniffiChecked("UInt8", makePrimitive((c) => c.readU8(), (v, c) => c.writeU8(v), 1));
992
+ uniffiChecked("UInt16", makePrimitive((c) => c.readU16(), (v, c) => c.writeU16(v), 2));
993
+ const FfiConverterUInt32 = uniffiChecked("UInt32", makePrimitive((c) => c.readU32(), (v, c) => c.writeU32(v), 4));
994
+ const FfiConverterUInt64 = uniffiChecked("UInt64", makePrimitive((c) => c.readU64(), (v, c) => c.writeU64(v), 8));
940
995
  (() => {
941
996
  const msPerSecBigInt = BigInt("1000");
942
997
  const nanosPerMs = 1e6;
@@ -949,7 +1004,7 @@ const FfiConverterUInt64 = makePrimitive((c) => c.readU64(), (v, c) => c.writeU6
949
1004
  return ms + nanos / nanosPerMs;
950
1005
  }
951
1006
  writeIntoCursor(value, c) {
952
- const ms = value.valueOf();
1007
+ const ms = uniffiMillis(value);
953
1008
  const secsBigInt = BigInt(Math.trunc(ms)) / msPerSecBigInt;
954
1009
  const remainingNanos = ms % 1e3 * nanosPerMs;
955
1010
  c.writeU64(secsBigInt);
@@ -1071,6 +1126,7 @@ const FfiConverterArrayBuffer = (() => {
1071
1126
  c.writeBytes(new Uint8Array(value));
1072
1127
  }
1073
1128
  allocationSize(value) {
1129
+ uniffiBytes(value);
1074
1130
  return 4 + value.byteLength;
1075
1131
  }
1076
1132
  }
@@ -1144,6 +1200,7 @@ var FfiConverterCallback = class {
1144
1200
  return this.handleMap.get(value);
1145
1201
  }
1146
1202
  lower(value, _alloc) {
1203
+ uniffiObject(value);
1147
1204
  return this.handleMap.insert(value);
1148
1205
  }
1149
1206
  readFromCursor(c) {
@@ -1206,6 +1263,7 @@ var FfiConverterObject = class {
1206
1263
  pointerConverter.writeIntoCursor(this.lowerHandle(value), c);
1207
1264
  }
1208
1265
  lowerHandle(value) {
1266
+ uniffiObject(value);
1209
1267
  if (this.factory.isConcreteType(value)) return this.factory.clonePointer(value);
1210
1268
  else throw new Error("Cannot lower this object to a pointer");
1211
1269
  }
@@ -1856,35 +1914,21 @@ const getter = () => {
1856
1914
  //#endregion
1857
1915
  //#region ../../../../../target/trylimbo/codegen/ffi-trylimbo_plugin_mxf/trylimbo_plugin_mxf.ts
1858
1916
  var trylimbo_plugin_mxf_exports = /* @__PURE__ */ __exportAll({
1917
+ ByteRange: () => ByteRange,
1859
1918
  Code: () => Code,
1860
1919
  FieldViolation: () => FieldViolation,
1861
1920
  MxfAuthor: () => MxfAuthor,
1862
1921
  MxfPlugin: () => MxfPlugin,
1863
- Region: () => Region,
1864
1922
  SdkError: () => SdkError,
1865
1923
  SdkError_Tags: () => SdkError_Tags,
1866
1924
  default: () => trylimbo_plugin_mxf_default
1867
1925
  });
1868
1926
  const uniffiCaller = new UniffiRustCaller(() => ({ code: 0 }));
1869
1927
  const uniffiIsDebug = typeof process !== "object" || process?.env?.NODE_ENV !== "production" || false;
1870
- const FfiConverterString = uniffiCreateFfiConverterString((() => {
1871
- const encoder = new TextEncoder();
1872
- const decoder = new TextDecoder();
1873
- return {
1874
- stringToBytes: (s) => encoder.encode(s),
1875
- bytesToString: (ab) => decoder.decode(ab),
1876
- stringByteLength: (s) => encoder.encode(s).byteLength,
1877
- writeStringIntoBuffer: (s, buf, offset) => {
1878
- const view = new Uint8Array(buf.arrayBuffer, offset, buf.arrayBuffer.byteLength - offset);
1879
- return encoder.encodeInto(s, view).written;
1880
- },
1881
- readStringFromBuffer: (buf, offset, length) => decoder.decode(new Uint8Array(buf.arrayBuffer, offset, length))
1882
- };
1883
- })());
1884
1928
  /**
1885
- * Generated factory for {@link FieldViolation} record objects.
1929
+ * Generated factory for {@link ByteRange} record objects.
1886
1930
  */
1887
- const FieldViolation = (() => {
1931
+ const ByteRange = (() => {
1888
1932
  const defaults = () => ({});
1889
1933
  const create = (() => {
1890
1934
  return uniffiCreateRecord(defaults);
@@ -1895,30 +1939,42 @@ const FieldViolation = (() => {
1895
1939
  defaults: () => Object.freeze(defaults())
1896
1940
  });
1897
1941
  })();
1898
- const FfiConverterTypeFieldViolation = (() => {
1942
+ const FfiConverterTypeByteRange = (() => {
1899
1943
  class FFIConverter extends AbstractFfiConverterByteArray {
1900
1944
  readFromCursor(c) {
1901
1945
  return {
1902
- field: FfiConverterString.readFromCursor(c),
1903
- description: FfiConverterString.readFromCursor(c),
1904
- reason: FfiConverterString.readFromCursor(c)
1946
+ offset: FfiConverterUInt64.readFromCursor(c),
1947
+ length: FfiConverterUInt64.readFromCursor(c)
1905
1948
  };
1906
1949
  }
1907
1950
  writeIntoCursor(value, c) {
1908
- FfiConverterString.writeIntoCursor(value.field, c);
1909
- FfiConverterString.writeIntoCursor(value.description, c);
1910
- FfiConverterString.writeIntoCursor(value.reason, c);
1951
+ FfiConverterUInt64.writeIntoCursor(value.offset, c);
1952
+ FfiConverterUInt64.writeIntoCursor(value.length, c);
1911
1953
  }
1912
1954
  allocationSize(value) {
1913
- return FfiConverterString.allocationSize(value.field) + FfiConverterString.allocationSize(value.description) + FfiConverterString.allocationSize(value.reason);
1955
+ return FfiConverterUInt64.allocationSize(value.offset) + FfiConverterUInt64.allocationSize(value.length);
1914
1956
  }
1915
1957
  }
1916
1958
  return new FFIConverter();
1917
1959
  })();
1960
+ const FfiConverterString = uniffiCreateFfiConverterString((() => {
1961
+ const encoder = new TextEncoder();
1962
+ const decoder = new TextDecoder();
1963
+ return {
1964
+ stringToBytes: (s) => encoder.encode(s),
1965
+ bytesToString: (ab) => decoder.decode(ab),
1966
+ stringByteLength: (s) => encoder.encode(s).byteLength,
1967
+ writeStringIntoBuffer: (s, buf, offset) => {
1968
+ const view = new Uint8Array(buf.arrayBuffer, offset, buf.arrayBuffer.byteLength - offset);
1969
+ return encoder.encodeInto(s, view).written;
1970
+ },
1971
+ readStringFromBuffer: (buf, offset, length) => decoder.decode(new Uint8Array(buf.arrayBuffer, offset, length))
1972
+ };
1973
+ })());
1918
1974
  /**
1919
- * Generated factory for {@link Region} record objects.
1975
+ * Generated factory for {@link FieldViolation} record objects.
1920
1976
  */
1921
- const Region = (() => {
1977
+ const FieldViolation = (() => {
1922
1978
  const defaults = () => ({});
1923
1979
  const create = (() => {
1924
1980
  return uniffiCreateRecord(defaults);
@@ -1929,30 +1985,28 @@ const Region = (() => {
1929
1985
  defaults: () => Object.freeze(defaults())
1930
1986
  });
1931
1987
  })();
1932
- const FfiConverterTypeRegion = (() => {
1988
+ const FfiConverterTypeFieldViolation = (() => {
1933
1989
  class FFIConverter extends AbstractFfiConverterByteArray {
1934
1990
  readFromCursor(c) {
1935
1991
  return {
1936
- offset: FfiConverterUInt64.readFromCursor(c),
1937
- length: FfiConverterUInt64.readFromCursor(c)
1992
+ field: FfiConverterString.readFromCursor(c),
1993
+ description: FfiConverterString.readFromCursor(c),
1994
+ reason: FfiConverterString.readFromCursor(c)
1938
1995
  };
1939
1996
  }
1940
1997
  writeIntoCursor(value, c) {
1941
- FfiConverterUInt64.writeIntoCursor(value.offset, c);
1942
- FfiConverterUInt64.writeIntoCursor(value.length, c);
1998
+ FfiConverterString.writeIntoCursor(value.field, c);
1999
+ FfiConverterString.writeIntoCursor(value.description, c);
2000
+ FfiConverterString.writeIntoCursor(value.reason, c);
1943
2001
  }
1944
2002
  allocationSize(value) {
1945
- return FfiConverterUInt64.allocationSize(value.offset) + FfiConverterUInt64.allocationSize(value.length);
2003
+ return FfiConverterString.allocationSize(value.field) + FfiConverterString.allocationSize(value.description) + FfiConverterString.allocationSize(value.reason);
1946
2004
  }
1947
2005
  }
1948
2006
  return new FFIConverter();
1949
2007
  })();
1950
2008
  /**
1951
2009
  * A canonical gRPC/Connect status code: the coarse, closed failure class.
1952
- *
1953
- * The wasm lane projects this as a camelCase string like every other tagged value
1954
- * there, so a consumer narrows on `err.code === "resourceExhausted"`; the native lane
1955
- * projects an enum.
1956
2010
  */
1957
2011
  let Code = /* @__PURE__ */ function(Code) {
1958
2012
  Code[Code["Canceled"] = 0] = "Canceled";
@@ -2366,14 +2420,14 @@ var MxfAuthor = class extends UniffiAbstractObject {
2366
2420
  *
2367
2421
  * [`SdkError`] when the source cannot be read or the MXF structure is malformed.
2368
2422
  */
2369
- async locate(src, asyncOpts_) {
2423
+ async locate(source, asyncOpts_) {
2370
2424
  const __stack = uniffiIsDebug ? (/* @__PURE__ */ new Error()).stack : void 0;
2371
2425
  try {
2372
2426
  return await uniffiRustCallAsync(uniffiCaller, () => {
2373
- return getter().uniffi_trylimbo_plugin_mxf_fn_method_mxfauthor_locate(uniffiTypeMxfAuthorObjectFactory.clonePointer(this), FfiConverterTypeRangeSource.lower(src, getter().rustbuffer_alloc));
2427
+ return getter().uniffi_trylimbo_plugin_mxf_fn_method_mxfauthor_locate(uniffiTypeMxfAuthorObjectFactory.clonePointer(this), FfiConverterTypeRangeSource.lower(source, getter().rustbuffer_alloc));
2374
2428
  }, getter().ffi_trylimbo_plugin_mxf_rust_future_poll_rust_buffer, getter().ffi_trylimbo_plugin_mxf_rust_future_cancel_rust_buffer, getter().ffi_trylimbo_plugin_mxf_rust_future_complete_rust_buffer, getter().ffi_trylimbo_plugin_mxf_rust_future_free_rust_buffer, (__rb) => {
2375
2429
  try {
2376
- return FfiConverterSequenceTypeRegion.lift(__rb);
2430
+ return FfiConverterSequenceTypeByteRange.lift(__rb);
2377
2431
  } finally {
2378
2432
  getter().rustbuffer_free(__rb);
2379
2433
  }
@@ -2397,7 +2451,7 @@ var MxfAuthor = class extends UniffiAbstractObject {
2397
2451
  }
2398
2452
  }
2399
2453
  /**
2400
- * Reserve `reserve` bytes of manifest slot by writing MXF structure through `dst`, and
2454
+ * Reserve `reserve` bytes of manifest slot by writing MXF structure through `sink`, and
2401
2455
  * return exactly where it landed. Never embeds: the SDK writes the signed manifest into
2402
2456
  * the returned regions.
2403
2457
  *
@@ -2405,14 +2459,14 @@ var MxfAuthor = class extends UniffiAbstractObject {
2405
2459
  *
2406
2460
  * [`SdkError`] when the sink cannot be written or `reserve` exceeds a `u32` slot.
2407
2461
  */
2408
- async reserveSlot(dst, reserve, asyncOpts_) {
2462
+ async reserveSlot(sink, reserve, asyncOpts_) {
2409
2463
  const __stack = uniffiIsDebug ? (/* @__PURE__ */ new Error()).stack : void 0;
2410
2464
  try {
2411
2465
  return await uniffiRustCallAsync(uniffiCaller, () => {
2412
- return getter().uniffi_trylimbo_plugin_mxf_fn_method_mxfauthor_reserve_slot(uniffiTypeMxfAuthorObjectFactory.clonePointer(this), FfiConverterTypeRangeSink.lower(dst, getter().rustbuffer_alloc), FfiConverterUInt64.lower(reserve, getter().rustbuffer_alloc));
2466
+ return getter().uniffi_trylimbo_plugin_mxf_fn_method_mxfauthor_reserve_slot(uniffiTypeMxfAuthorObjectFactory.clonePointer(this), FfiConverterTypeRangeSink.lower(sink, getter().rustbuffer_alloc), FfiConverterUInt64.lower(reserve, getter().rustbuffer_alloc));
2413
2467
  }, getter().ffi_trylimbo_plugin_mxf_rust_future_poll_rust_buffer, getter().ffi_trylimbo_plugin_mxf_rust_future_cancel_rust_buffer, getter().ffi_trylimbo_plugin_mxf_rust_future_complete_rust_buffer, getter().ffi_trylimbo_plugin_mxf_rust_future_free_rust_buffer, (__rb) => {
2414
2468
  try {
2415
- return FfiConverterSequenceTypeRegion.lift(__rb);
2469
+ return FfiConverterSequenceTypeByteRange.lift(__rb);
2416
2470
  } finally {
2417
2471
  getter().rustbuffer_free(__rb);
2418
2472
  }
@@ -2429,11 +2483,11 @@ var MxfAuthor = class extends UniffiAbstractObject {
2429
2483
  *
2430
2484
  * [`SdkError`] when the source cannot be read.
2431
2485
  */
2432
- async sniff(src, asyncOpts_) {
2486
+ async sniff(source, asyncOpts_) {
2433
2487
  const __stack = uniffiIsDebug ? (/* @__PURE__ */ new Error()).stack : void 0;
2434
2488
  try {
2435
2489
  return await uniffiRustCallAsync(uniffiCaller, () => {
2436
- return getter().uniffi_trylimbo_plugin_mxf_fn_method_mxfauthor_sniff(uniffiTypeMxfAuthorObjectFactory.clonePointer(this), FfiConverterTypeRangeSource.lower(src, getter().rustbuffer_alloc));
2490
+ return getter().uniffi_trylimbo_plugin_mxf_fn_method_mxfauthor_sniff(uniffiTypeMxfAuthorObjectFactory.clonePointer(this), FfiConverterTypeRangeSource.lower(source, getter().rustbuffer_alloc));
2437
2491
  }, getter().ffi_trylimbo_plugin_mxf_rust_future_poll_rust_buffer, getter().ffi_trylimbo_plugin_mxf_rust_future_cancel_rust_buffer, getter().ffi_trylimbo_plugin_mxf_rust_future_complete_rust_buffer, getter().ffi_trylimbo_plugin_mxf_rust_future_free_rust_buffer, (__rb) => {
2438
2492
  try {
2439
2493
  return FfiConverterOptionalString.lift(__rb);
@@ -2525,14 +2579,14 @@ var MxfPlugin = class extends UniffiAbstractObject {
2525
2579
  *
2526
2580
  * [`SdkError`] when the source cannot be read or the MXF structure is malformed.
2527
2581
  */
2528
- async locate(src, asyncOpts_) {
2582
+ async locate(source, asyncOpts_) {
2529
2583
  const __stack = uniffiIsDebug ? (/* @__PURE__ */ new Error()).stack : void 0;
2530
2584
  try {
2531
2585
  return await uniffiRustCallAsync(uniffiCaller, () => {
2532
- return getter().uniffi_trylimbo_plugin_mxf_fn_method_mxfplugin_locate(uniffiTypeMxfPluginObjectFactory.clonePointer(this), FfiConverterTypeRangeSource.lower(src, getter().rustbuffer_alloc));
2586
+ return getter().uniffi_trylimbo_plugin_mxf_fn_method_mxfplugin_locate(uniffiTypeMxfPluginObjectFactory.clonePointer(this), FfiConverterTypeRangeSource.lower(source, getter().rustbuffer_alloc));
2533
2587
  }, getter().ffi_trylimbo_plugin_mxf_rust_future_poll_rust_buffer, getter().ffi_trylimbo_plugin_mxf_rust_future_cancel_rust_buffer, getter().ffi_trylimbo_plugin_mxf_rust_future_complete_rust_buffer, getter().ffi_trylimbo_plugin_mxf_rust_future_free_rust_buffer, (__rb) => {
2534
2588
  try {
2535
- return FfiConverterSequenceTypeRegion.lift(__rb);
2589
+ return FfiConverterSequenceTypeByteRange.lift(__rb);
2536
2590
  } finally {
2537
2591
  getter().rustbuffer_free(__rb);
2538
2592
  }
@@ -2562,11 +2616,11 @@ var MxfPlugin = class extends UniffiAbstractObject {
2562
2616
  *
2563
2617
  * [`SdkError`] when the source cannot be read.
2564
2618
  */
2565
- async sniff(src, asyncOpts_) {
2619
+ async sniff(source, asyncOpts_) {
2566
2620
  const __stack = uniffiIsDebug ? (/* @__PURE__ */ new Error()).stack : void 0;
2567
2621
  try {
2568
2622
  return await uniffiRustCallAsync(uniffiCaller, () => {
2569
- return getter().uniffi_trylimbo_plugin_mxf_fn_method_mxfplugin_sniff(uniffiTypeMxfPluginObjectFactory.clonePointer(this), FfiConverterTypeRangeSource.lower(src, getter().rustbuffer_alloc));
2623
+ return getter().uniffi_trylimbo_plugin_mxf_fn_method_mxfplugin_sniff(uniffiTypeMxfPluginObjectFactory.clonePointer(this), FfiConverterTypeRangeSource.lower(source, getter().rustbuffer_alloc));
2570
2624
  }, getter().ffi_trylimbo_plugin_mxf_rust_future_poll_rust_buffer, getter().ffi_trylimbo_plugin_mxf_rust_future_cancel_rust_buffer, getter().ffi_trylimbo_plugin_mxf_rust_future_complete_rust_buffer, getter().ffi_trylimbo_plugin_mxf_rust_future_free_rust_buffer, (__rb) => {
2571
2625
  try {
2572
2626
  return FfiConverterOptionalString.lift(__rb);
@@ -2634,7 +2688,7 @@ const uniffiTypeMxfPluginObjectFactory = (() => {
2634
2688
  const FfiConverterTypeMxfPlugin = new FfiConverterObject(uniffiTypeMxfPluginObjectFactory);
2635
2689
  const FfiConverterMapStringString = new FfiConverterMap(FfiConverterString, FfiConverterString);
2636
2690
  const FfiConverterSequenceTypeFieldViolation = new FfiConverterArray(FfiConverterTypeFieldViolation);
2637
- const FfiConverterSequenceTypeRegion = new FfiConverterArray(FfiConverterTypeRegion);
2691
+ const FfiConverterSequenceTypeByteRange = new FfiConverterArray(FfiConverterTypeByteRange);
2638
2692
  const FfiConverterSequenceString = new FfiConverterArray(FfiConverterString);
2639
2693
  const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
2640
2694
  /**
@@ -2652,25 +2706,25 @@ function uniffiEnsureInitialized() {
2652
2706
  const scaffoldingContractVersion = getter().ffi_trylimbo_plugin_mxf_uniffi_contract_version();
2653
2707
  if (bindingsContractVersion !== scaffoldingContractVersion) throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
2654
2708
  if (getter().uniffi_trylimbo_plugin_mxf_checksum_constructor_mxfauthor_new() !== 26244) throw new UniffiInternalError.ApiChecksumMismatch("uniffi_trylimbo_plugin_mxf_checksum_constructor_mxfauthor_new");
2655
- if (getter().uniffi_trylimbo_plugin_mxf_checksum_method_mxfauthor_locate() !== 45199) throw new UniffiInternalError.ApiChecksumMismatch("uniffi_trylimbo_plugin_mxf_checksum_method_mxfauthor_locate");
2709
+ if (getter().uniffi_trylimbo_plugin_mxf_checksum_method_mxfauthor_locate() !== 31161) throw new UniffiInternalError.ApiChecksumMismatch("uniffi_trylimbo_plugin_mxf_checksum_method_mxfauthor_locate");
2656
2710
  if (getter().uniffi_trylimbo_plugin_mxf_checksum_method_mxfauthor_media_types() !== 26985) throw new UniffiInternalError.ApiChecksumMismatch("uniffi_trylimbo_plugin_mxf_checksum_method_mxfauthor_media_types");
2657
- if (getter().uniffi_trylimbo_plugin_mxf_checksum_method_mxfauthor_reserve_slot() !== 48309) throw new UniffiInternalError.ApiChecksumMismatch("uniffi_trylimbo_plugin_mxf_checksum_method_mxfauthor_reserve_slot");
2658
- if (getter().uniffi_trylimbo_plugin_mxf_checksum_method_mxfauthor_sniff() !== 42367) throw new UniffiInternalError.ApiChecksumMismatch("uniffi_trylimbo_plugin_mxf_checksum_method_mxfauthor_sniff");
2711
+ if (getter().uniffi_trylimbo_plugin_mxf_checksum_method_mxfauthor_reserve_slot() !== 12744) throw new UniffiInternalError.ApiChecksumMismatch("uniffi_trylimbo_plugin_mxf_checksum_method_mxfauthor_reserve_slot");
2712
+ if (getter().uniffi_trylimbo_plugin_mxf_checksum_method_mxfauthor_sniff() !== 36852) throw new UniffiInternalError.ApiChecksumMismatch("uniffi_trylimbo_plugin_mxf_checksum_method_mxfauthor_sniff");
2659
2713
  if (getter().uniffi_trylimbo_plugin_mxf_checksum_constructor_mxfplugin_new() !== 63791) throw new UniffiInternalError.ApiChecksumMismatch("uniffi_trylimbo_plugin_mxf_checksum_constructor_mxfplugin_new");
2660
- if (getter().uniffi_trylimbo_plugin_mxf_checksum_method_mxfplugin_locate() !== 1210) throw new UniffiInternalError.ApiChecksumMismatch("uniffi_trylimbo_plugin_mxf_checksum_method_mxfplugin_locate");
2714
+ if (getter().uniffi_trylimbo_plugin_mxf_checksum_method_mxfplugin_locate() !== 32154) throw new UniffiInternalError.ApiChecksumMismatch("uniffi_trylimbo_plugin_mxf_checksum_method_mxfplugin_locate");
2661
2715
  if (getter().uniffi_trylimbo_plugin_mxf_checksum_method_mxfplugin_media_types() !== 44782) throw new UniffiInternalError.ApiChecksumMismatch("uniffi_trylimbo_plugin_mxf_checksum_method_mxfplugin_media_types");
2662
- if (getter().uniffi_trylimbo_plugin_mxf_checksum_method_mxfplugin_sniff() !== 48535) throw new UniffiInternalError.ApiChecksumMismatch("uniffi_trylimbo_plugin_mxf_checksum_method_mxfplugin_sniff");
2716
+ if (getter().uniffi_trylimbo_plugin_mxf_checksum_method_mxfplugin_sniff() !== 4832) throw new UniffiInternalError.ApiChecksumMismatch("uniffi_trylimbo_plugin_mxf_checksum_method_mxfplugin_sniff");
2663
2717
  uniffiCallbackInterfaceRangeSource.register();
2664
2718
  uniffiCallbackInterfaceRangeSink.register();
2665
2719
  }
2666
2720
  var trylimbo_plugin_mxf_default = Object.freeze({
2667
2721
  initialize: uniffiEnsureInitialized,
2668
2722
  converters: {
2723
+ FfiConverterTypeByteRange,
2669
2724
  FfiConverterTypeCode,
2670
2725
  FfiConverterTypeFieldViolation,
2671
2726
  FfiConverterTypeMxfAuthor,
2672
2727
  FfiConverterTypeMxfPlugin,
2673
- FfiConverterTypeRegion,
2674
2728
  FfiConverterTypeSdkError
2675
2729
  }
2676
2730
  });
@@ -2684,4 +2738,4 @@ if (!initialized) {
2684
2738
  async function uniffiInitAsync() {}
2685
2739
  var ffi_trylimbo_plugin_mxf_default = { trylimbo_plugin_mxf: trylimbo_plugin_mxf_exports };
2686
2740
  //#endregion
2687
- export { Code, FieldViolation, MxfAuthor, MxfPlugin, Region, SdkError, SdkError_Tags, ffi_trylimbo_plugin_mxf_default as default, uniffiInitAsync };
2741
+ export { ByteRange, Code, FieldViolation, MxfAuthor, MxfPlugin, SdkError, SdkError_Tags, ffi_trylimbo_plugin_mxf_default as default, uniffiInitAsync };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "optionalDependencies": {
3
- "@trylimbo/sdk-plugin-mxf-linux-arm64-gnu": "0.2.24",
4
- "@trylimbo/sdk-plugin-mxf-linux-x64-gnu": "0.2.24",
3
+ "@trylimbo/sdk-plugin-mxf-linux-arm64-gnu": "0.2.25-canary.38",
4
+ "@trylimbo/sdk-plugin-mxf-linux-x64-gnu": "0.2.25-canary.38",
5
5
  "@ubjs/node-linux-arm64-gnu": "0.31.0-5",
6
6
  "@ubjs/node-linux-x64-gnu": "0.31.0-5"
7
7
  },
8
8
  "name": "@trylimbo/sdk-plugin-mxf",
9
- "version": "0.2.24",
9
+ "version": "0.2.25-canary.38",
10
10
  "license": "UNLICENSED",
11
11
  "repository": {
12
12
  "type": "git",