@skipruntime/core 0.0.4 → 0.0.6

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/src/index.ts CHANGED
@@ -39,7 +39,7 @@ import {
39
39
  type Resource,
40
40
  type SkipService,
41
41
  type Watermark,
42
- } from "@skipruntime/api";
42
+ } from "./api.js";
43
43
 
44
44
  import { UnknownCollectionError } from "./errors.js";
45
45
  import {
@@ -52,6 +52,7 @@ import {
52
52
 
53
53
  export { UnknownCollectionError, sk_freeze, isSkManaged };
54
54
  export { Sum, Min, Max, Count } from "./utils.js";
55
+ export * from "./api.js";
55
56
 
56
57
  export type JSONMapper = Mapper<Json, Json, Json, Json>;
57
58
  export type JSONLazyCompute = LazyCompute<Json, Json>;
@@ -963,6 +964,7 @@ export class ToBinding {
963
964
  SkipRuntime_ExternalService__subscribe(
964
965
  sksupplier: Handle<ExternalService>,
965
966
  writerId: string,
967
+ instance: string,
966
968
  resource: string,
967
969
  skparams: Pointer<Internal.CJObject>,
968
970
  ): void {
@@ -970,7 +972,7 @@ export class ToBinding {
970
972
  const supplier = this.handles.get(sksupplier);
971
973
  const writer = new CollectionWriter(writerId, this.refs());
972
974
  const params = skjson.importJSON(skparams, true) as Json;
973
- supplier.subscribe(resource, params, {
975
+ supplier.subscribe(instance, resource, params, {
974
976
  update: writer.update.bind(writer),
975
977
  error: writer.error.bind(writer),
976
978
  loading: writer.loading.bind(writer),
@@ -979,13 +981,10 @@ export class ToBinding {
979
981
 
980
982
  SkipRuntime_ExternalService__unsubscribe(
981
983
  sksupplier: Handle<ExternalService>,
982
- resource: string,
983
- skparams: Pointer<Internal.CJObject>,
984
+ instance: string,
984
985
  ): void {
985
- const skjson = this.getJsonConverter();
986
986
  const supplier = this.handles.get(sksupplier);
987
- const params = skjson.importJSON(skparams, true) as Json;
988
- supplier.unsubscribe(resource, params);
987
+ supplier.unsubscribe(instance);
989
988
  }
990
989
 
991
990
  SkipRuntime_ExternalService__shutdown(
package/src/utils.ts CHANGED
@@ -1,6 +1,5 @@
1
- import type { Nullable } from "@skip-wasm/std";
2
- import { type NativeStub, sknative } from "@skiplang/std";
3
- import type { Reducer, Json } from "@skipruntime/api";
1
+ import { type NativeStub, type Nullable, sknative } from "@skiplang/std";
2
+ import type { Reducer, Json } from "./api.js";
4
3
 
5
4
  /**
6
5
  * `Reducer` to maintain the sum of input values.
package/src/binding.js DELETED
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ResourceBuilder = void 0;
4
- var ResourceBuilder = /** @class */ (function () {
5
- function ResourceBuilder(builder) {
6
- this.builder = builder;
7
- }
8
- ResourceBuilder.prototype.build = function (parameters) {
9
- var builder = this.builder;
10
- return new builder(parameters);
11
- };
12
- return ResourceBuilder;
13
- }());
14
- exports.ResourceBuilder = ResourceBuilder;
package/src/errors.js DELETED
@@ -1,26 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.UnknownCollectionError = void 0;
19
- var UnknownCollectionError = /** @class */ (function (_super) {
20
- __extends(UnknownCollectionError, _super);
21
- function UnknownCollectionError() {
22
- return _super !== null && _super.apply(this, arguments) || this;
23
- }
24
- return UnknownCollectionError;
25
- }(Error));
26
- exports.UnknownCollectionError = UnknownCollectionError;