@milaboratories/pf-spec 1.0.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.
@@ -0,0 +1,57 @@
1
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/usingCtx.js
2
+ function _usingCtx() {
3
+ var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
4
+ var n = Error();
5
+ return n.name = "SuppressedError", n.error = r, n.suppressed = e, n;
6
+ }, e = {}, n = [];
7
+ function using(r, e) {
8
+ if (null != e) {
9
+ if (Object(e) !== e) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
10
+ if (r) var o = e[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")];
11
+ if (void 0 === o && (o = e[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r)) var t = o;
12
+ if ("function" != typeof o) throw new TypeError("Object is not disposable.");
13
+ t && (o = function o() {
14
+ try {
15
+ t.call(e);
16
+ } catch (r) {
17
+ return Promise.reject(r);
18
+ }
19
+ }), n.push({
20
+ v: e,
21
+ d: o,
22
+ a: r
23
+ });
24
+ } else r && n.push({
25
+ d: e,
26
+ a: r
27
+ });
28
+ return e;
29
+ }
30
+ return {
31
+ e,
32
+ u: using.bind(null, !1),
33
+ a: using.bind(null, !0),
34
+ d: function d() {
35
+ var o, t = this.e, s = 0;
36
+ function next() {
37
+ for (; o = n.pop();) try {
38
+ if (!o.a && 1 === s) return s = 0, n.push(o), Promise.resolve().then(next);
39
+ if (o.d) {
40
+ var r = o.d.call(o.v);
41
+ if (o.a) return s |= 2, Promise.resolve(r).then(next, err);
42
+ } else s |= 1;
43
+ } catch (r) {
44
+ return err(r);
45
+ }
46
+ if (1 === s) return t !== e ? Promise.reject(t) : Promise.resolve();
47
+ if (t !== e) throw t;
48
+ }
49
+ function err(n) {
50
+ return t = t !== e ? new r(n, t) : n, next();
51
+ }
52
+ return next();
53
+ }
54
+ };
55
+ }
56
+ //#endregion
57
+ export { _usingCtx as default };
package/dist/axes.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import { AxesId, AxesSpec, SingleAxisSelector } from "@milaboratories/pl-model-common";
2
+
3
+ //#region src/axes.d.ts
4
+ declare function expand(spec: AxesSpec): AxesId;
5
+ declare function collapse(ids: AxesId): AxesSpec;
6
+ declare function find(spec: AxesSpec, selector: SingleAxisSelector): number;
7
+ //#endregion
8
+ export { collapse, expand, find };
9
+ //# sourceMappingURL=axes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"axes.d.ts","names":[],"sources":["../src/axes.ts"],"mappings":";;;iBAGgB,MAAA,CAAO,IAAA,EAAM,QAAA,GAAW,MAAM;AAAA,iBAK9B,QAAA,CAAS,GAAA,EAAK,MAAA,GAAS,QAAQ;AAAA,iBAI/B,IAAA,CAAK,IAAA,EAAM,QAAA,EAAU,QAAA,EAAU,kBAAkB"}
package/dist/axes.js ADDED
@@ -0,0 +1,36 @@
1
+ import { spec } from "./generated/pframes_rs_wasip2.js";
2
+ import _usingCtx from "./_virtual/_@oxc-project_runtime@0.137.0/helpers/esm/usingCtx.js";
3
+ //#region src/axes.ts
4
+ function expand(spec$1) {
5
+ try {
6
+ var _usingCtx$1 = _usingCtx();
7
+ const axes = _usingCtx$1.u(spec.Axes.fromJson(JSON.stringify(spec$1)));
8
+ return JSON.parse(axes.expand());
9
+ } catch (_) {
10
+ _usingCtx$1.e = _;
11
+ } finally {
12
+ _usingCtx$1.d();
13
+ }
14
+ }
15
+ function collapse(ids) {
16
+ return JSON.parse(spec.Axes.collapse(JSON.stringify(ids)));
17
+ }
18
+ function find(spec$2, selector) {
19
+ try {
20
+ var _usingCtx3 = _usingCtx();
21
+ const axes = _usingCtx3.u(spec.Axes.fromJson(JSON.stringify(spec$2)));
22
+ try {
23
+ return JSON.parse(axes.find(JSON.stringify(selector)));
24
+ } catch {
25
+ return -1;
26
+ }
27
+ } catch (_) {
28
+ _usingCtx3.e = _;
29
+ } finally {
30
+ _usingCtx3.d();
31
+ }
32
+ }
33
+ //#endregion
34
+ export { collapse, expand, find };
35
+
36
+ //# sourceMappingURL=axes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"axes.js","names":["bindings","spec"],"sources":["../src/axes.ts"],"sourcesContent":["import type { AxesId, AxesSpec, SingleAxisSelector } from \"@milaboratories/pl-model-common\";\nimport { spec as bindings } from \"./generated/pframes_rs_wasip2.js\";\n\nexport function expand(spec: AxesSpec): AxesId {\n using axes = bindings.Axes.fromJson(JSON.stringify(spec));\n return JSON.parse(axes.expand());\n}\n\nexport function collapse(ids: AxesId): AxesSpec {\n return JSON.parse(bindings.Axes.collapse(JSON.stringify(ids)));\n}\n\nexport function find(spec: AxesSpec, selector: SingleAxisSelector): number {\n using axes = bindings.Axes.fromJson(JSON.stringify(spec));\n try {\n return JSON.parse(axes.find(JSON.stringify(selector)));\n } catch {\n return -1;\n }\n}\n"],"mappings":";;;AAGA,SAAgB,OAAO,QAAwB;;;EAC7C,MAAM,OAAA,YAAA,EAAOA,KAAS,KAAK,SAAS,KAAK,UAAUC,MAAI,CAAC,CAAA;EACxD,OAAO,KAAK,MAAM,KAAK,OAAO,CAAC;;;;;;AACjC;AAEA,SAAgB,SAAS,KAAuB;CAC9C,OAAO,KAAK,MAAMD,KAAS,KAAK,SAAS,KAAK,UAAU,GAAG,CAAC,CAAC;AAC/D;AAEA,SAAgB,KAAK,QAAgB,UAAsC;;;EACzE,MAAM,OAAA,WAAA,EAAOA,KAAS,KAAK,SAAS,KAAK,UAAUC,MAAI,CAAC,CAAA;EACxD,IAAI;GACF,OAAO,KAAK,MAAM,KAAK,KAAK,KAAK,UAAU,QAAQ,CAAC,CAAC;EACvD,QAAQ;GACN,OAAO;EACT;;;;;;AACF"}
@@ -0,0 +1,7 @@
1
+ import { BuildQueryInput, SpecQueryJoinEntry } from "@milaboratories/pl-model-common";
2
+
3
+ //#region src/build-query.d.ts
4
+ declare function build(input: BuildQueryInput): SpecQueryJoinEntry;
5
+ //#endregion
6
+ export { build };
7
+ //# sourceMappingURL=build-query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-query.d.ts","names":[],"sources":["../src/build-query.ts"],"mappings":";;;iBAGgB,KAAA,CAAM,KAAA,EAAO,eAAA,GAAkB,kBAAkB"}
@@ -0,0 +1,9 @@
1
+ import { spec } from "./generated/pframes_rs_wasip2.js";
2
+ //#region src/build-query.ts
3
+ function build(input) {
4
+ return JSON.parse(spec.Frame.buildQuery(JSON.stringify(input)));
5
+ }
6
+ //#endregion
7
+ export { build };
8
+
9
+ //# sourceMappingURL=build-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-query.js","names":["bindings"],"sources":["../src/build-query.ts"],"sourcesContent":["import type { BuildQueryInput, SpecQueryJoinEntry } from \"@milaboratories/pl-model-common\";\nimport { spec as bindings } from \"./generated/pframes_rs_wasip2.js\";\n\nexport function build(input: BuildQueryInput): SpecQueryJoinEntry {\n return JSON.parse(bindings.Frame.buildQuery(JSON.stringify(input)));\n}\n"],"mappings":";;AAGA,SAAgB,MAAM,OAA4C;CAChE,OAAO,KAAK,MAAMA,KAAS,MAAM,WAAW,KAAK,UAAU,KAAK,CAAC,CAAC;AACpE"}