@atproto/api 0.0.3 → 0.0.4

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.
@@ -47,6 +47,9 @@ import * as AppBskyGraphGetFollowers from './types/app/bsky/graph/getFollowers';
47
47
  import * as AppBskyGraphGetFollows from './types/app/bsky/graph/getFollows';
48
48
  import * as AppBskyGraphGetMembers from './types/app/bsky/graph/getMembers';
49
49
  import * as AppBskyGraphGetMemberships from './types/app/bsky/graph/getMemberships';
50
+ import * as AppBskyGraphGetMutes from './types/app/bsky/graph/getMutes';
51
+ import * as AppBskyGraphMute from './types/app/bsky/graph/mute';
52
+ import * as AppBskyGraphUnmute from './types/app/bsky/graph/unmute';
50
53
  import * as AppBskyNotificationGetCount from './types/app/bsky/notification/getCount';
51
54
  import * as AppBskyNotificationList from './types/app/bsky/notification/list';
52
55
  import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen';
@@ -106,6 +109,9 @@ export * as AppBskyGraphGetFollowers from './types/app/bsky/graph/getFollowers';
106
109
  export * as AppBskyGraphGetFollows from './types/app/bsky/graph/getFollows';
107
110
  export * as AppBskyGraphGetMembers from './types/app/bsky/graph/getMembers';
108
111
  export * as AppBskyGraphGetMemberships from './types/app/bsky/graph/getMemberships';
112
+ export * as AppBskyGraphGetMutes from './types/app/bsky/graph/getMutes';
113
+ export * as AppBskyGraphMute from './types/app/bsky/graph/mute';
114
+ export * as AppBskyGraphUnmute from './types/app/bsky/graph/unmute';
109
115
  export * as AppBskyNotificationGetCount from './types/app/bsky/notification/getCount';
110
116
  export * as AppBskyNotificationList from './types/app/bsky/notification/list';
111
117
  export * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen';
@@ -363,6 +369,9 @@ export declare class GraphNS {
363
369
  getFollows(params?: AppBskyGraphGetFollows.QueryParams, opts?: AppBskyGraphGetFollows.CallOptions): Promise<AppBskyGraphGetFollows.Response>;
364
370
  getMembers(params?: AppBskyGraphGetMembers.QueryParams, opts?: AppBskyGraphGetMembers.CallOptions): Promise<AppBskyGraphGetMembers.Response>;
365
371
  getMemberships(params?: AppBskyGraphGetMemberships.QueryParams, opts?: AppBskyGraphGetMemberships.CallOptions): Promise<AppBskyGraphGetMemberships.Response>;
372
+ getMutes(params?: AppBskyGraphGetMutes.QueryParams, opts?: AppBskyGraphGetMutes.CallOptions): Promise<AppBskyGraphGetMutes.Response>;
373
+ mute(data?: AppBskyGraphMute.InputSchema, opts?: AppBskyGraphMute.CallOptions): Promise<AppBskyGraphMute.Response>;
374
+ unmute(data?: AppBskyGraphUnmute.InputSchema, opts?: AppBskyGraphUnmute.CallOptions): Promise<AppBskyGraphUnmute.Response>;
366
375
  }
367
376
  export declare class AssertionRecord {
368
377
  _service: ServiceClient;
@@ -999,6 +999,9 @@ export declare const schemaDict: {
999
999
  member: {
1000
1000
  type: string;
1001
1001
  };
1002
+ muted: {
1003
+ type: string;
1004
+ };
1002
1005
  };
1003
1006
  };
1004
1007
  };
@@ -1163,6 +1166,18 @@ export declare const schemaDict: {
1163
1166
  avatar: {
1164
1167
  type: string;
1165
1168
  };
1169
+ viewer: {
1170
+ type: string;
1171
+ ref: string;
1172
+ };
1173
+ };
1174
+ };
1175
+ viewerState: {
1176
+ type: string;
1177
+ properties: {
1178
+ muted: {
1179
+ type: string;
1180
+ };
1166
1181
  };
1167
1182
  };
1168
1183
  };
@@ -1964,6 +1979,7 @@ export declare const schemaDict: {
1964
1979
  };
1965
1980
  textSlice: {
1966
1981
  type: string;
1982
+ description: string;
1967
1983
  required: string[];
1968
1984
  properties: {
1969
1985
  start: {
@@ -2030,6 +2046,9 @@ export declare const schemaDict: {
2030
2046
  downvote: {
2031
2047
  type: string;
2032
2048
  };
2049
+ muted: {
2050
+ type: string;
2051
+ };
2033
2052
  };
2034
2053
  };
2035
2054
  };
@@ -2662,6 +2681,116 @@ export declare const schemaDict: {
2662
2681
  };
2663
2682
  };
2664
2683
  };
2684
+ AppBskyGraphGetMutes: {
2685
+ lexicon: number;
2686
+ id: string;
2687
+ defs: {
2688
+ main: {
2689
+ type: string;
2690
+ description: string;
2691
+ parameters: {
2692
+ type: string;
2693
+ properties: {
2694
+ limit: {
2695
+ type: string;
2696
+ minimum: number;
2697
+ maximum: number;
2698
+ default: number;
2699
+ };
2700
+ before: {
2701
+ type: string;
2702
+ };
2703
+ };
2704
+ };
2705
+ output: {
2706
+ encoding: string;
2707
+ schema: {
2708
+ type: string;
2709
+ required: string[];
2710
+ properties: {
2711
+ cursor: {
2712
+ type: string;
2713
+ };
2714
+ mutes: {
2715
+ type: string;
2716
+ items: {
2717
+ type: string;
2718
+ ref: string;
2719
+ };
2720
+ };
2721
+ };
2722
+ };
2723
+ };
2724
+ };
2725
+ mute: {
2726
+ type: string;
2727
+ required: string[];
2728
+ properties: {
2729
+ did: {
2730
+ type: string;
2731
+ };
2732
+ declaration: {
2733
+ type: string;
2734
+ ref: string;
2735
+ };
2736
+ handle: {
2737
+ type: string;
2738
+ };
2739
+ displayName: {
2740
+ type: string;
2741
+ maxLength: number;
2742
+ };
2743
+ createdAt: {
2744
+ type: string;
2745
+ };
2746
+ };
2747
+ };
2748
+ };
2749
+ };
2750
+ AppBskyGraphMute: {
2751
+ lexicon: number;
2752
+ id: string;
2753
+ defs: {
2754
+ main: {
2755
+ type: string;
2756
+ description: string;
2757
+ input: {
2758
+ encoding: string;
2759
+ schema: {
2760
+ type: string;
2761
+ required: string[];
2762
+ properties: {
2763
+ user: {
2764
+ type: string;
2765
+ };
2766
+ };
2767
+ };
2768
+ };
2769
+ };
2770
+ };
2771
+ };
2772
+ AppBskyGraphUnmute: {
2773
+ lexicon: number;
2774
+ id: string;
2775
+ defs: {
2776
+ main: {
2777
+ type: string;
2778
+ description: string;
2779
+ input: {
2780
+ encoding: string;
2781
+ schema: {
2782
+ type: string;
2783
+ required: string[];
2784
+ properties: {
2785
+ user: {
2786
+ type: string;
2787
+ };
2788
+ };
2789
+ };
2790
+ };
2791
+ };
2792
+ };
2793
+ };
2665
2794
  AppBskyNotificationGetCount: {
2666
2795
  lexicon: number;
2667
2796
  id: string;
@@ -2900,6 +3029,9 @@ export declare const ids: {
2900
3029
  AppBskyGraphGetFollows: string;
2901
3030
  AppBskyGraphGetMembers: string;
2902
3031
  AppBskyGraphGetMemberships: string;
3032
+ AppBskyGraphGetMutes: string;
3033
+ AppBskyGraphMute: string;
3034
+ AppBskyGraphUnmute: string;
2903
3035
  AppBskyNotificationGetCount: string;
2904
3036
  AppBskyNotificationList: string;
2905
3037
  AppBskyNotificationUpdateSeen: string;
@@ -32,5 +32,6 @@ export declare function toKnownErr(e: any): any;
32
32
  export interface MyState {
33
33
  follow?: string;
34
34
  member?: string;
35
+ muted?: boolean;
35
36
  [k: string]: unknown;
36
37
  }
@@ -10,5 +10,10 @@ export interface WithInfo {
10
10
  handle: string;
11
11
  displayName?: string;
12
12
  avatar?: string;
13
+ viewer?: ViewerState;
14
+ [k: string]: unknown;
15
+ }
16
+ export interface ViewerState {
17
+ muted?: boolean;
13
18
  [k: string]: unknown;
14
19
  }
@@ -50,5 +50,6 @@ export interface ViewerState {
50
50
  repost?: string;
51
51
  upvote?: string;
52
52
  downvote?: string;
53
+ muted?: boolean;
53
54
  [k: string]: unknown;
54
55
  }
@@ -0,0 +1,29 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ import * as AppBskySystemDeclRef from '../system/declRef';
3
+ export interface QueryParams {
4
+ limit?: number;
5
+ before?: string;
6
+ }
7
+ export declare type InputSchema = undefined;
8
+ export interface OutputSchema {
9
+ cursor?: string;
10
+ mutes: Mute[];
11
+ [k: string]: unknown;
12
+ }
13
+ export interface CallOptions {
14
+ headers?: Headers;
15
+ }
16
+ export interface Response {
17
+ success: boolean;
18
+ headers: Headers;
19
+ data: OutputSchema;
20
+ }
21
+ export declare function toKnownErr(e: any): any;
22
+ export interface Mute {
23
+ did: string;
24
+ declaration: AppBskySystemDeclRef.Main;
25
+ handle: string;
26
+ displayName?: string;
27
+ createdAt: string;
28
+ [k: string]: unknown;
29
+ }
@@ -0,0 +1,17 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ export interface QueryParams {
3
+ }
4
+ export interface InputSchema {
5
+ user: string;
6
+ [k: string]: unknown;
7
+ }
8
+ export interface CallOptions {
9
+ headers?: Headers;
10
+ qp?: QueryParams;
11
+ encoding: 'application/json';
12
+ }
13
+ export interface Response {
14
+ success: boolean;
15
+ headers: Headers;
16
+ }
17
+ export declare function toKnownErr(e: any): any;
@@ -0,0 +1,17 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ export interface QueryParams {
3
+ }
4
+ export interface InputSchema {
5
+ user: string;
6
+ [k: string]: unknown;
7
+ }
8
+ export interface CallOptions {
9
+ headers?: Headers;
10
+ qp?: QueryParams;
11
+ encoding: 'application/json';
12
+ }
13
+ export interface Response {
14
+ success: boolean;
15
+ headers: Headers;
16
+ }
17
+ export declare function toKnownErr(e: any): any;
package/dist/index.js CHANGED
@@ -61,6 +61,9 @@ __export(src_exports, {
61
61
  AppBskyGraphGetFollows: () => getFollows_exports,
62
62
  AppBskyGraphGetMembers: () => getMembers_exports,
63
63
  AppBskyGraphGetMemberships: () => getMemberships_exports,
64
+ AppBskyGraphGetMutes: () => getMutes_exports,
65
+ AppBskyGraphMute: () => mute_exports,
66
+ AppBskyGraphUnmute: () => unmute_exports,
64
67
  AppBskyNotificationGetCount: () => getCount_exports,
65
68
  AppBskyNotificationList: () => list_exports,
66
69
  AppBskyNotificationUpdateSeen: () => updateSeen_exports,
@@ -5240,6 +5243,9 @@ var schemaDict = {
5240
5243
  },
5241
5244
  member: {
5242
5245
  type: "string"
5246
+ },
5247
+ muted: {
5248
+ type: "boolean"
5243
5249
  }
5244
5250
  }
5245
5251
  }
@@ -5351,15 +5357,15 @@ var schemaDict = {
5351
5357
  avatar: {
5352
5358
  type: "image",
5353
5359
  accept: ["image/png", "image/jpeg"],
5354
- maxWidth: 500,
5355
- maxHeight: 500,
5360
+ maxWidth: 1e3,
5361
+ maxHeight: 1e3,
5356
5362
  maxSize: 3e5
5357
5363
  },
5358
5364
  banner: {
5359
5365
  type: "image",
5360
5366
  accept: ["image/png", "image/jpeg"],
5361
- maxWidth: 1500,
5362
- maxHeight: 500,
5367
+ maxWidth: 3e3,
5368
+ maxHeight: 1e3,
5363
5369
  maxSize: 5e5
5364
5370
  }
5365
5371
  }
@@ -5404,6 +5410,18 @@ var schemaDict = {
5404
5410
  },
5405
5411
  avatar: {
5406
5412
  type: "string"
5413
+ },
5414
+ viewer: {
5415
+ type: "ref",
5416
+ ref: "lex:app.bsky.actor.ref#viewerState"
5417
+ }
5418
+ }
5419
+ },
5420
+ viewerState: {
5421
+ type: "object",
5422
+ properties: {
5423
+ muted: {
5424
+ type: "boolean"
5407
5425
  }
5408
5426
  }
5409
5427
  }
@@ -5655,9 +5673,9 @@ var schemaDict = {
5655
5673
  thumb: {
5656
5674
  type: "image",
5657
5675
  accept: ["image/*"],
5658
- maxWidth: 250,
5659
- maxHeight: 250,
5660
- maxSize: 1e5
5676
+ maxWidth: 1e3,
5677
+ maxHeight: 1e3,
5678
+ maxSize: 3e5
5661
5679
  }
5662
5680
  }
5663
5681
  },
@@ -5717,8 +5735,8 @@ var schemaDict = {
5717
5735
  image: {
5718
5736
  type: "image",
5719
5737
  accept: ["image/*"],
5720
- maxWidth: 500,
5721
- maxHeight: 500,
5738
+ maxWidth: 1e3,
5739
+ maxHeight: 1e3,
5722
5740
  maxSize: 3e5
5723
5741
  },
5724
5742
  alt: {
@@ -6234,6 +6252,7 @@ var schemaDict = {
6234
6252
  },
6235
6253
  textSlice: {
6236
6254
  type: "object",
6255
+ description: "A text segment. Start is inclusive, end is exclusive.",
6237
6256
  required: ["start", "end"],
6238
6257
  properties: {
6239
6258
  start: {
@@ -6313,6 +6332,9 @@ var schemaDict = {
6313
6332
  },
6314
6333
  downvote: {
6315
6334
  type: "string"
6335
+ },
6336
+ muted: {
6337
+ type: "boolean"
6316
6338
  }
6317
6339
  }
6318
6340
  }
@@ -6954,6 +6976,116 @@ var schemaDict = {
6954
6976
  }
6955
6977
  }
6956
6978
  },
6979
+ AppBskyGraphGetMutes: {
6980
+ lexicon: 1,
6981
+ id: "app.bsky.graph.getMutes",
6982
+ defs: {
6983
+ main: {
6984
+ type: "query",
6985
+ description: "Who does the viewer mute?",
6986
+ parameters: {
6987
+ type: "params",
6988
+ properties: {
6989
+ limit: {
6990
+ type: "integer",
6991
+ minimum: 1,
6992
+ maximum: 100,
6993
+ default: 50
6994
+ },
6995
+ before: {
6996
+ type: "string"
6997
+ }
6998
+ }
6999
+ },
7000
+ output: {
7001
+ encoding: "application/json",
7002
+ schema: {
7003
+ type: "object",
7004
+ required: ["mutes"],
7005
+ properties: {
7006
+ cursor: {
7007
+ type: "string"
7008
+ },
7009
+ mutes: {
7010
+ type: "array",
7011
+ items: {
7012
+ type: "ref",
7013
+ ref: "lex:app.bsky.graph.getMutes#mute"
7014
+ }
7015
+ }
7016
+ }
7017
+ }
7018
+ }
7019
+ },
7020
+ mute: {
7021
+ type: "object",
7022
+ required: ["did", "declaration", "handle", "createdAt"],
7023
+ properties: {
7024
+ did: {
7025
+ type: "string"
7026
+ },
7027
+ declaration: {
7028
+ type: "ref",
7029
+ ref: "lex:app.bsky.system.declRef"
7030
+ },
7031
+ handle: {
7032
+ type: "string"
7033
+ },
7034
+ displayName: {
7035
+ type: "string",
7036
+ maxLength: 64
7037
+ },
7038
+ createdAt: {
7039
+ type: "datetime"
7040
+ }
7041
+ }
7042
+ }
7043
+ }
7044
+ },
7045
+ AppBskyGraphMute: {
7046
+ lexicon: 1,
7047
+ id: "app.bsky.graph.mute",
7048
+ defs: {
7049
+ main: {
7050
+ type: "procedure",
7051
+ description: "Mute an actor by did or handle.",
7052
+ input: {
7053
+ encoding: "application/json",
7054
+ schema: {
7055
+ type: "object",
7056
+ required: ["user"],
7057
+ properties: {
7058
+ user: {
7059
+ type: "string"
7060
+ }
7061
+ }
7062
+ }
7063
+ }
7064
+ }
7065
+ }
7066
+ },
7067
+ AppBskyGraphUnmute: {
7068
+ lexicon: 1,
7069
+ id: "app.bsky.graph.unmute",
7070
+ defs: {
7071
+ main: {
7072
+ type: "procedure",
7073
+ description: "Unmute an actor by did or handle.",
7074
+ input: {
7075
+ encoding: "application/json",
7076
+ schema: {
7077
+ type: "object",
7078
+ required: ["user"],
7079
+ properties: {
7080
+ user: {
7081
+ type: "string"
7082
+ }
7083
+ }
7084
+ }
7085
+ }
7086
+ }
7087
+ }
7088
+ },
6957
7089
  AppBskyNotificationGetCount: {
6958
7090
  lexicon: 1,
6959
7091
  id: "app.bsky.notification.getCount",
@@ -7703,12 +7835,45 @@ function toKnownErr40(e) {
7703
7835
  return e;
7704
7836
  }
7705
7837
 
7838
+ // src/client/types/app/bsky/graph/getMutes.ts
7839
+ var getMutes_exports = {};
7840
+ __export(getMutes_exports, {
7841
+ toKnownErr: () => toKnownErr41
7842
+ });
7843
+ function toKnownErr41(e) {
7844
+ if (e instanceof XRPCError) {
7845
+ }
7846
+ return e;
7847
+ }
7848
+
7849
+ // src/client/types/app/bsky/graph/mute.ts
7850
+ var mute_exports = {};
7851
+ __export(mute_exports, {
7852
+ toKnownErr: () => toKnownErr42
7853
+ });
7854
+ function toKnownErr42(e) {
7855
+ if (e instanceof XRPCError) {
7856
+ }
7857
+ return e;
7858
+ }
7859
+
7860
+ // src/client/types/app/bsky/graph/unmute.ts
7861
+ var unmute_exports = {};
7862
+ __export(unmute_exports, {
7863
+ toKnownErr: () => toKnownErr43
7864
+ });
7865
+ function toKnownErr43(e) {
7866
+ if (e instanceof XRPCError) {
7867
+ }
7868
+ return e;
7869
+ }
7870
+
7706
7871
  // src/client/types/app/bsky/notification/getCount.ts
7707
7872
  var getCount_exports = {};
7708
7873
  __export(getCount_exports, {
7709
- toKnownErr: () => toKnownErr41
7874
+ toKnownErr: () => toKnownErr44
7710
7875
  });
7711
- function toKnownErr41(e) {
7876
+ function toKnownErr44(e) {
7712
7877
  if (e instanceof XRPCError) {
7713
7878
  }
7714
7879
  return e;
@@ -7717,9 +7882,9 @@ function toKnownErr41(e) {
7717
7882
  // src/client/types/app/bsky/notification/list.ts
7718
7883
  var list_exports = {};
7719
7884
  __export(list_exports, {
7720
- toKnownErr: () => toKnownErr42
7885
+ toKnownErr: () => toKnownErr45
7721
7886
  });
7722
- function toKnownErr42(e) {
7887
+ function toKnownErr45(e) {
7723
7888
  if (e instanceof XRPCError) {
7724
7889
  }
7725
7890
  return e;
@@ -7728,9 +7893,9 @@ function toKnownErr42(e) {
7728
7893
  // src/client/types/app/bsky/notification/updateSeen.ts
7729
7894
  var updateSeen_exports = {};
7730
7895
  __export(updateSeen_exports, {
7731
- toKnownErr: () => toKnownErr43
7896
+ toKnownErr: () => toKnownErr46
7732
7897
  });
7733
- function toKnownErr43(e) {
7898
+ function toKnownErr46(e) {
7734
7899
  if (e instanceof XRPCError) {
7735
7900
  }
7736
7901
  return e;
@@ -8322,6 +8487,21 @@ var GraphNS = class {
8322
8487
  throw toKnownErr40(e);
8323
8488
  });
8324
8489
  }
8490
+ getMutes(params2, opts) {
8491
+ return this._service.xrpc.call("app.bsky.graph.getMutes", params2, void 0, opts).catch((e) => {
8492
+ throw toKnownErr41(e);
8493
+ });
8494
+ }
8495
+ mute(data, opts) {
8496
+ return this._service.xrpc.call("app.bsky.graph.mute", opts?.qp, data, opts).catch((e) => {
8497
+ throw toKnownErr42(e);
8498
+ });
8499
+ }
8500
+ unmute(data, opts) {
8501
+ return this._service.xrpc.call("app.bsky.graph.unmute", opts?.qp, data, opts).catch((e) => {
8502
+ throw toKnownErr43(e);
8503
+ });
8504
+ }
8325
8505
  };
8326
8506
  var AssertionRecord = class {
8327
8507
  constructor(service) {
@@ -8440,17 +8620,17 @@ var NotificationNS = class {
8440
8620
  }
8441
8621
  getCount(params2, opts) {
8442
8622
  return this._service.xrpc.call("app.bsky.notification.getCount", params2, void 0, opts).catch((e) => {
8443
- throw toKnownErr41(e);
8623
+ throw toKnownErr44(e);
8444
8624
  });
8445
8625
  }
8446
8626
  list(params2, opts) {
8447
8627
  return this._service.xrpc.call("app.bsky.notification.list", params2, void 0, opts).catch((e) => {
8448
- throw toKnownErr42(e);
8628
+ throw toKnownErr45(e);
8449
8629
  });
8450
8630
  }
8451
8631
  updateSeen(data, opts) {
8452
8632
  return this._service.xrpc.call("app.bsky.notification.updateSeen", opts?.qp, data, opts).catch((e) => {
8453
- throw toKnownErr43(e);
8633
+ throw toKnownErr46(e);
8454
8634
  });
8455
8635
  }
8456
8636
  };
@@ -8658,6 +8838,9 @@ var SessionManager = class extends import_events.default {
8658
8838
  AppBskyGraphGetFollows,
8659
8839
  AppBskyGraphGetMembers,
8660
8840
  AppBskyGraphGetMemberships,
8841
+ AppBskyGraphGetMutes,
8842
+ AppBskyGraphMute,
8843
+ AppBskyGraphUnmute,
8661
8844
  AppBskyNotificationGetCount,
8662
8845
  AppBskyNotificationList,
8663
8846
  AppBskyNotificationUpdateSeen,