@fabriktor/client 0.0.101 → 0.0.102

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.
@@ -1,6 +1,6 @@
1
- import { type Event, type InEvent, type OperationResult, type PLCallsMintVideoToken } from "@fabriktor/schema";
1
+ import { type Event, type PLCallsMintVideoToken } from "@fabriktor/schema";
2
2
  import type { TokenProvider } from "../core/auth.js";
3
- import type { DeleteOneOptionsCRUD, FindOneOptionsCRUD, InsertOneOptionsCRUD, OperationResultOf, QueryOptionsCRUD, ReplaceOneOptionsCRUD } from "../core/crud.js";
3
+ import type { FindOneOptionsCRUD, OperationResultOf, QueryOptionsCRUD } from "../core/crud.js";
4
4
  import type { HTTPDoer } from "../core/http.js";
5
5
  import type { CompletePayload } from "../core/type.js";
6
6
  export type MintVideoTokenOptions = CompletePayload<PLCallsMintVideoToken>;
@@ -11,10 +11,7 @@ export type CallsClientOptions = {
11
11
  };
12
12
  export interface CallsOperator {
13
13
  queryEvents(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Event[]>>;
14
- insertOneEvent(opts: InsertOneOptionsCRUD<InEvent>): Promise<OperationResult>;
15
14
  findOneEvent(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Event>>;
16
- replaceOneEvent(opts: ReplaceOneOptionsCRUD<InEvent>): Promise<OperationResult>;
17
- deleteOneEvent(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
18
15
  mintVideoToken(opts: MintVideoTokenOptions): Promise<OperationResultOf<string>>;
19
16
  }
20
17
  export declare class CallsClient implements CallsOperator {
@@ -24,10 +21,7 @@ export declare class CallsClient implements CallsOperator {
24
21
  private get_token?;
25
22
  constructor(opts: CallsClientOptions);
26
23
  queryEvents(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Event[]>>;
27
- insertOneEvent(opts: InsertOneOptionsCRUD<InEvent>): Promise<OperationResult>;
28
24
  findOneEvent(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Event>>;
29
- replaceOneEvent(opts: ReplaceOneOptionsCRUD<InEvent>): Promise<OperationResult>;
30
- deleteOneEvent(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
31
25
  mintVideoToken(opts: MintVideoTokenOptions): Promise<OperationResultOf<string>>;
32
26
  }
33
27
  export declare function newCallsClient(opts: CallsClientOptions): CallsClient;
@@ -27,18 +27,9 @@ export class CallsClient {
27
27
  async queryEvents(opts) {
28
28
  return await this.events.query(opts);
29
29
  }
30
- async insertOneEvent(opts) {
31
- return await this.events.insertOne(opts);
32
- }
33
30
  async findOneEvent(opts) {
34
31
  return await this.events.findOne(opts);
35
32
  }
36
- async replaceOneEvent(opts) {
37
- return await this.events.replaceOne(opts);
38
- }
39
- async deleteOneEvent(opts) {
40
- return await this.events.deleteOne(opts);
41
- }
42
33
  async mintVideoToken(opts) {
43
34
  const token = await requiredToken(this.get_token);
44
35
  return await this.http.do({
@@ -1,6 +1,6 @@
1
- import { type InDTok, type PLNotificationsRelay, type UpsertResult } from "@fabriktor/schema";
1
+ import { type InDTok, type OperationResult, type PLNotificationsRelay, type UpsertResult } from "@fabriktor/schema";
2
2
  import type { TokenProvider } from "../core/auth.js";
3
- import type { OperationResultOf, UpsertOneOptionsCRUD } from "../core/crud.js";
3
+ import type { DeleteOneOptionsCRUD, OperationResultOf, UpsertOneOptionsCRUD } from "../core/crud.js";
4
4
  import type { HTTPDoer } from "../core/http.js";
5
5
  import type { CompletePayload } from "../core/type.js";
6
6
  export type RelayNotificationOptions = CompletePayload<PLNotificationsRelay>;
@@ -11,6 +11,7 @@ export type NotificationsClientOptions = {
11
11
  };
12
12
  export interface NotificationsOperator {
13
13
  upsertOneDTok(opts: UpsertOneOptionsCRUD<InDTok>): Promise<OperationResultOf<UpsertResult>>;
14
+ deleteOneDTok(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
14
15
  relayNotification(opts: RelayNotificationOptions): Promise<void>;
15
16
  }
16
17
  export declare class NotificationsClient implements NotificationsOperator {
@@ -20,6 +21,7 @@ export declare class NotificationsClient implements NotificationsOperator {
20
21
  private get_token?;
21
22
  constructor(opts: NotificationsClientOptions);
22
23
  upsertOneDTok(opts: UpsertOneOptionsCRUD<InDTok>): Promise<OperationResultOf<UpsertResult>>;
24
+ deleteOneDTok(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
23
25
  relayNotification(opts: RelayNotificationOptions): Promise<void>;
24
26
  }
25
27
  export declare function newNotificationsClient(opts: NotificationsClientOptions): NotificationsClient;
@@ -27,6 +27,9 @@ export class NotificationsClient {
27
27
  async upsertOneDTok(opts) {
28
28
  return await this.dtoks.upsertOne(opts);
29
29
  }
30
+ async deleteOneDTok(opts) {
31
+ return await this.dtoks.deleteOne(opts);
32
+ }
30
33
  async relayNotification(opts) {
31
34
  const token = await requiredToken(this.get_token);
32
35
  return await this.http.do({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabriktor/client",
3
- "version": "0.0.101",
3
+ "version": "0.0.102",
4
4
  "description": "![Fabriktor Logo](./img/fabriktor-character.gif)",
5
5
  "type": "module",
6
6
  "exports": {
@@ -17,6 +17,6 @@
17
17
  "typescript": "^6.0.3"
18
18
  },
19
19
  "dependencies": {
20
- "@fabriktor/schema": "0.0.70"
20
+ "@fabriktor/schema": "0.0.74"
21
21
  }
22
22
  }