@atproto/api 0.2.2 → 0.2.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.
Files changed (31) hide show
  1. package/dist/client/index.d.ts +10 -0
  2. package/dist/client/lexicons.d.ts +221 -0
  3. package/dist/client/types/com/atproto/admin/defs.d.ts +5 -0
  4. package/dist/client/types/com/atproto/admin/disableInviteCodes.d.ts +18 -0
  5. package/dist/client/types/com/atproto/admin/getInviteCodes.d.ts +22 -0
  6. package/dist/client/types/com/atproto/admin/searchRepos.d.ts +1 -0
  7. package/dist/client/types/com/atproto/repo/listRecords.d.ts +1 -0
  8. package/dist/client/types/com/atproto/server/createInviteCode.d.ts +1 -0
  9. package/dist/client/types/com/atproto/server/createSession.d.ts +1 -0
  10. package/dist/client/types/com/atproto/server/defs.d.ts +20 -0
  11. package/dist/client/types/com/atproto/server/getAccountInviteCodes.d.ts +23 -0
  12. package/dist/client/types/com/atproto/server/getSession.d.ts +1 -0
  13. package/dist/index.js +512 -203
  14. package/dist/index.js.map +4 -4
  15. package/dist/types.d.ts +1 -0
  16. package/package.json +1 -1
  17. package/src/agent.ts +4 -0
  18. package/src/client/index.ts +41 -0
  19. package/src/client/lexicons.ts +237 -7
  20. package/src/client/types/com/atproto/admin/defs.ts +5 -0
  21. package/src/client/types/com/atproto/admin/disableInviteCodes.ts +33 -0
  22. package/src/client/types/com/atproto/admin/getInviteCodes.ts +39 -0
  23. package/src/client/types/com/atproto/admin/searchRepos.ts +1 -0
  24. package/src/client/types/com/atproto/repo/listRecords.ts +1 -0
  25. package/src/client/types/com/atproto/server/createInviteCode.ts +1 -0
  26. package/src/client/types/com/atproto/server/createSession.ts +1 -0
  27. package/src/client/types/com/atproto/server/defs.ts +48 -0
  28. package/src/client/types/com/atproto/server/getAccountInviteCodes.ts +44 -0
  29. package/src/types.ts +1 -0
  30. package/tests/agent.test.ts +2 -0
  31. package/tsconfig.build.tsbuildinfo +1 -1
package/dist/types.d.ts CHANGED
@@ -4,6 +4,7 @@ export interface AtpSessionData {
4
4
  accessJwt: string;
5
5
  handle: string;
6
6
  did: string;
7
+ email?: string;
7
8
  }
8
9
  export declare type AtpPersistSessionHandler = (evt: AtpSessionEvent, session: AtpSessionData | undefined) => void | Promise<void>;
9
10
  export interface AtpAgentOpts {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/api",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "codegen": "lex gen-api ./src/client ../../lexicons/com/atproto/*/* ../../lexicons/app/bsky/*/*",
package/src/agent.ts CHANGED
@@ -95,6 +95,7 @@ export class AtpAgent {
95
95
  refreshJwt: res.data.refreshJwt,
96
96
  handle: res.data.handle,
97
97
  did: res.data.did,
98
+ email: opts.email,
98
99
  }
99
100
  return res
100
101
  } catch (e) {
@@ -125,6 +126,7 @@ export class AtpAgent {
125
126
  refreshJwt: res.data.refreshJwt,
126
127
  handle: res.data.handle,
127
128
  did: res.data.did,
129
+ email: res.data.email,
128
130
  }
129
131
  return res
130
132
  } catch (e) {
@@ -151,6 +153,8 @@ export class AtpAgent {
151
153
  if (!res.success || res.data.did !== this.session.did) {
152
154
  throw new Error('Invalid session')
153
155
  }
156
+ this.session.email = res.data.email
157
+ this.session.handle = res.data.handle
154
158
  return res
155
159
  } catch (e) {
156
160
  this.session = undefined
@@ -8,6 +8,8 @@ import {
8
8
  import { schemas } from './lexicons'
9
9
  import { CID } from 'multiformats/cid'
10
10
  import * as ComAtprotoAdminDefs from './types/com/atproto/admin/defs'
11
+ import * as ComAtprotoAdminDisableInviteCodes from './types/com/atproto/admin/disableInviteCodes'
12
+ import * as ComAtprotoAdminGetInviteCodes from './types/com/atproto/admin/getInviteCodes'
11
13
  import * as ComAtprotoAdminGetModerationAction from './types/com/atproto/admin/getModerationAction'
12
14
  import * as ComAtprotoAdminGetModerationActions from './types/com/atproto/admin/getModerationActions'
13
15
  import * as ComAtprotoAdminGetModerationReport from './types/com/atproto/admin/getModerationReport'
@@ -34,9 +36,11 @@ import * as ComAtprotoRepoUploadBlob from './types/com/atproto/repo/uploadBlob'
34
36
  import * as ComAtprotoServerCreateAccount from './types/com/atproto/server/createAccount'
35
37
  import * as ComAtprotoServerCreateInviteCode from './types/com/atproto/server/createInviteCode'
36
38
  import * as ComAtprotoServerCreateSession from './types/com/atproto/server/createSession'
39
+ import * as ComAtprotoServerDefs from './types/com/atproto/server/defs'
37
40
  import * as ComAtprotoServerDeleteAccount from './types/com/atproto/server/deleteAccount'
38
41
  import * as ComAtprotoServerDeleteSession from './types/com/atproto/server/deleteSession'
39
42
  import * as ComAtprotoServerDescribeServer from './types/com/atproto/server/describeServer'
43
+ import * as ComAtprotoServerGetAccountInviteCodes from './types/com/atproto/server/getAccountInviteCodes'
40
44
  import * as ComAtprotoServerGetSession from './types/com/atproto/server/getSession'
41
45
  import * as ComAtprotoServerRefreshSession from './types/com/atproto/server/refreshSession'
42
46
  import * as ComAtprotoServerRequestAccountDelete from './types/com/atproto/server/requestAccountDelete'
@@ -86,6 +90,8 @@ import * as AppBskyRichtextFacet from './types/app/bsky/richtext/facet'
86
90
  import * as AppBskyUnspeccedGetPopular from './types/app/bsky/unspecced/getPopular'
87
91
 
88
92
  export * as ComAtprotoAdminDefs from './types/com/atproto/admin/defs'
93
+ export * as ComAtprotoAdminDisableInviteCodes from './types/com/atproto/admin/disableInviteCodes'
94
+ export * as ComAtprotoAdminGetInviteCodes from './types/com/atproto/admin/getInviteCodes'
89
95
  export * as ComAtprotoAdminGetModerationAction from './types/com/atproto/admin/getModerationAction'
90
96
  export * as ComAtprotoAdminGetModerationActions from './types/com/atproto/admin/getModerationActions'
91
97
  export * as ComAtprotoAdminGetModerationReport from './types/com/atproto/admin/getModerationReport'
@@ -112,9 +118,11 @@ export * as ComAtprotoRepoUploadBlob from './types/com/atproto/repo/uploadBlob'
112
118
  export * as ComAtprotoServerCreateAccount from './types/com/atproto/server/createAccount'
113
119
  export * as ComAtprotoServerCreateInviteCode from './types/com/atproto/server/createInviteCode'
114
120
  export * as ComAtprotoServerCreateSession from './types/com/atproto/server/createSession'
121
+ export * as ComAtprotoServerDefs from './types/com/atproto/server/defs'
115
122
  export * as ComAtprotoServerDeleteAccount from './types/com/atproto/server/deleteAccount'
116
123
  export * as ComAtprotoServerDeleteSession from './types/com/atproto/server/deleteSession'
117
124
  export * as ComAtprotoServerDescribeServer from './types/com/atproto/server/describeServer'
125
+ export * as ComAtprotoServerGetAccountInviteCodes from './types/com/atproto/server/getAccountInviteCodes'
118
126
  export * as ComAtprotoServerGetSession from './types/com/atproto/server/getSession'
119
127
  export * as ComAtprotoServerRefreshSession from './types/com/atproto/server/refreshSession'
120
128
  export * as ComAtprotoServerRequestAccountDelete from './types/com/atproto/server/requestAccountDelete'
@@ -240,6 +248,28 @@ export class AdminNS {
240
248
  this._service = service
241
249
  }
242
250
 
251
+ disableInviteCodes(
252
+ data?: ComAtprotoAdminDisableInviteCodes.InputSchema,
253
+ opts?: ComAtprotoAdminDisableInviteCodes.CallOptions,
254
+ ): Promise<ComAtprotoAdminDisableInviteCodes.Response> {
255
+ return this._service.xrpc
256
+ .call('com.atproto.admin.disableInviteCodes', opts?.qp, data, opts)
257
+ .catch((e) => {
258
+ throw ComAtprotoAdminDisableInviteCodes.toKnownErr(e)
259
+ })
260
+ }
261
+
262
+ getInviteCodes(
263
+ params?: ComAtprotoAdminGetInviteCodes.QueryParams,
264
+ opts?: ComAtprotoAdminGetInviteCodes.CallOptions,
265
+ ): Promise<ComAtprotoAdminGetInviteCodes.Response> {
266
+ return this._service.xrpc
267
+ .call('com.atproto.admin.getInviteCodes', params, undefined, opts)
268
+ .catch((e) => {
269
+ throw ComAtprotoAdminGetInviteCodes.toKnownErr(e)
270
+ })
271
+ }
272
+
243
273
  getModerationAction(
244
274
  params?: ComAtprotoAdminGetModerationAction.QueryParams,
245
275
  opts?: ComAtprotoAdminGetModerationAction.CallOptions,
@@ -569,6 +599,17 @@ export class ServerNS {
569
599
  })
570
600
  }
571
601
 
602
+ getAccountInviteCodes(
603
+ params?: ComAtprotoServerGetAccountInviteCodes.QueryParams,
604
+ opts?: ComAtprotoServerGetAccountInviteCodes.CallOptions,
605
+ ): Promise<ComAtprotoServerGetAccountInviteCodes.Response> {
606
+ return this._service.xrpc
607
+ .call('com.atproto.server.getAccountInviteCodes', params, undefined, opts)
608
+ .catch((e) => {
609
+ throw ComAtprotoServerGetAccountInviteCodes.toKnownErr(e)
610
+ })
611
+ }
612
+
572
613
  getSession(
573
614
  params?: ComAtprotoServerGetSession.QueryParams,
574
615
  opts?: ComAtprotoServerGetSession.CallOptions,
@@ -299,6 +299,17 @@ export const schemaDict = {
299
299
  type: 'ref',
300
300
  ref: 'lex:com.atproto.admin.defs#moderation',
301
301
  },
302
+ invitedBy: {
303
+ type: 'ref',
304
+ ref: 'lex:com.atproto.server.defs#inviteCode',
305
+ },
306
+ invites: {
307
+ type: 'array',
308
+ items: {
309
+ type: 'ref',
310
+ ref: 'lex:com.atproto.server.defs#inviteCode',
311
+ },
312
+ },
302
313
  },
303
314
  },
304
315
  repoViewDetail: {
@@ -336,6 +347,17 @@ export const schemaDict = {
336
347
  type: 'ref',
337
348
  ref: 'lex:com.atproto.admin.defs#moderationDetail',
338
349
  },
350
+ invitedBy: {
351
+ type: 'ref',
352
+ ref: 'lex:com.atproto.server.defs#inviteCode',
353
+ },
354
+ invites: {
355
+ type: 'array',
356
+ items: {
357
+ type: 'ref',
358
+ ref: 'lex:com.atproto.server.defs#inviteCode',
359
+ },
360
+ },
339
361
  },
340
362
  },
341
363
  repoRef: {
@@ -530,6 +552,85 @@ export const schemaDict = {
530
552
  },
531
553
  },
532
554
  },
555
+ ComAtprotoAdminDisableInviteCodes: {
556
+ lexicon: 1,
557
+ id: 'com.atproto.admin.disableInviteCodes',
558
+ defs: {
559
+ main: {
560
+ type: 'procedure',
561
+ description:
562
+ 'Disable some set of codes and/or all codes associated with a set of users',
563
+ input: {
564
+ encoding: 'application/json',
565
+ schema: {
566
+ type: 'object',
567
+ properties: {
568
+ codes: {
569
+ type: 'array',
570
+ items: {
571
+ type: 'string',
572
+ },
573
+ },
574
+ accounts: {
575
+ type: 'array',
576
+ items: {
577
+ type: 'string',
578
+ },
579
+ },
580
+ },
581
+ },
582
+ },
583
+ },
584
+ },
585
+ },
586
+ ComAtprotoAdminGetInviteCodes: {
587
+ lexicon: 1,
588
+ id: 'com.atproto.admin.getInviteCodes',
589
+ defs: {
590
+ main: {
591
+ type: 'query',
592
+ description: 'Admin view of invite codes',
593
+ parameters: {
594
+ type: 'params',
595
+ properties: {
596
+ sort: {
597
+ type: 'string',
598
+ knownValues: ['recent', 'usage'],
599
+ default: 'recent',
600
+ },
601
+ limit: {
602
+ type: 'integer',
603
+ minimum: 1,
604
+ maximum: 500,
605
+ default: 100,
606
+ },
607
+ cursor: {
608
+ type: 'string',
609
+ },
610
+ },
611
+ },
612
+ output: {
613
+ encoding: 'application/json',
614
+ schema: {
615
+ type: 'object',
616
+ required: ['codes'],
617
+ properties: {
618
+ cursor: {
619
+ type: 'string',
620
+ },
621
+ codes: {
622
+ type: 'array',
623
+ items: {
624
+ type: 'ref',
625
+ ref: 'lex:com.atproto.server.defs#inviteCode',
626
+ },
627
+ },
628
+ },
629
+ },
630
+ },
631
+ },
632
+ },
633
+ },
533
634
  ComAtprotoAdminGetModerationAction: {
534
635
  lexicon: 1,
535
636
  id: 'com.atproto.admin.getModerationAction',
@@ -823,6 +924,9 @@ export const schemaDict = {
823
924
  term: {
824
925
  type: 'string',
825
926
  },
927
+ invitedBy: {
928
+ type: 'string',
929
+ },
826
930
  limit: {
827
931
  type: 'integer',
828
932
  minimum: 1,
@@ -1428,6 +1532,9 @@ export const schemaDict = {
1428
1532
  default: 50,
1429
1533
  description: 'The number of records to return.',
1430
1534
  },
1535
+ cursor: {
1536
+ type: 'string',
1537
+ },
1431
1538
  rkeyStart: {
1432
1539
  type: 'string',
1433
1540
  description:
@@ -1698,6 +1805,10 @@ export const schemaDict = {
1698
1805
  useCount: {
1699
1806
  type: 'integer',
1700
1807
  },
1808
+ forAccount: {
1809
+ type: 'string',
1810
+ format: 'did',
1811
+ },
1701
1812
  },
1702
1813
  },
1703
1814
  },
@@ -1760,6 +1871,9 @@ export const schemaDict = {
1760
1871
  type: 'string',
1761
1872
  format: 'did',
1762
1873
  },
1874
+ email: {
1875
+ type: 'string',
1876
+ },
1763
1877
  },
1764
1878
  },
1765
1879
  },
@@ -1771,6 +1885,66 @@ export const schemaDict = {
1771
1885
  },
1772
1886
  },
1773
1887
  },
1888
+ ComAtprotoServerDefs: {
1889
+ lexicon: 1,
1890
+ id: 'com.atproto.server.defs',
1891
+ defs: {
1892
+ inviteCode: {
1893
+ type: 'object',
1894
+ required: [
1895
+ 'code',
1896
+ 'available',
1897
+ 'disabled',
1898
+ 'forAccount',
1899
+ 'createdBy',
1900
+ 'createdAt',
1901
+ 'uses',
1902
+ ],
1903
+ properties: {
1904
+ code: {
1905
+ type: 'string',
1906
+ },
1907
+ available: {
1908
+ type: 'integer',
1909
+ },
1910
+ disabled: {
1911
+ type: 'boolean',
1912
+ },
1913
+ forAccount: {
1914
+ type: 'string',
1915
+ },
1916
+ createdBy: {
1917
+ type: 'string',
1918
+ },
1919
+ createdAt: {
1920
+ type: 'string',
1921
+ format: 'datetime',
1922
+ },
1923
+ uses: {
1924
+ type: 'array',
1925
+ items: {
1926
+ type: 'ref',
1927
+ ref: 'lex:com.atproto.server.defs#inviteCodeUse',
1928
+ },
1929
+ },
1930
+ },
1931
+ },
1932
+ inviteCodeUse: {
1933
+ type: 'object',
1934
+ required: ['usedBy', 'usedAt'],
1935
+ properties: {
1936
+ usedBy: {
1937
+ type: 'string',
1938
+ format: 'did',
1939
+ },
1940
+ usedAt: {
1941
+ type: 'string',
1942
+ format: 'datetime',
1943
+ },
1944
+ },
1945
+ },
1946
+ },
1947
+ },
1774
1948
  ComAtprotoServerDeleteAccount: {
1775
1949
  lexicon: 1,
1776
1950
  id: 'com.atproto.server.deleteAccount',
@@ -1862,6 +2036,50 @@ export const schemaDict = {
1862
2036
  },
1863
2037
  },
1864
2038
  },
2039
+ ComAtprotoServerGetAccountInviteCodes: {
2040
+ lexicon: 1,
2041
+ id: 'com.atproto.server.getAccountInviteCodes',
2042
+ defs: {
2043
+ main: {
2044
+ type: 'query',
2045
+ description: 'Get all invite codes for a given account',
2046
+ parameters: {
2047
+ type: 'params',
2048
+ properties: {
2049
+ includeUsed: {
2050
+ type: 'boolean',
2051
+ default: true,
2052
+ },
2053
+ createAvailable: {
2054
+ type: 'boolean',
2055
+ default: true,
2056
+ },
2057
+ },
2058
+ },
2059
+ output: {
2060
+ encoding: 'application/json',
2061
+ schema: {
2062
+ type: 'object',
2063
+ required: ['codes'],
2064
+ properties: {
2065
+ codes: {
2066
+ type: 'array',
2067
+ items: {
2068
+ type: 'ref',
2069
+ ref: 'lex:com.atproto.server.defs#inviteCode',
2070
+ },
2071
+ },
2072
+ },
2073
+ },
2074
+ },
2075
+ errors: [
2076
+ {
2077
+ name: 'DuplicateCreate',
2078
+ },
2079
+ ],
2080
+ },
2081
+ },
2082
+ },
1865
2083
  ComAtprotoServerGetSession: {
1866
2084
  lexicon: 1,
1867
2085
  id: 'com.atproto.server.getSession',
@@ -2533,7 +2751,8 @@ export const schemaDict = {
2533
2751
  },
2534
2752
  displayName: {
2535
2753
  type: 'string',
2536
- maxLength: 64,
2754
+ maxGraphemes: 64,
2755
+ maxLength: 640,
2537
2756
  },
2538
2757
  avatar: {
2539
2758
  type: 'string',
@@ -2558,11 +2777,13 @@ export const schemaDict = {
2558
2777
  },
2559
2778
  displayName: {
2560
2779
  type: 'string',
2561
- maxLength: 64,
2780
+ maxGraphemes: 64,
2781
+ maxLength: 640,
2562
2782
  },
2563
2783
  description: {
2564
2784
  type: 'string',
2565
- maxLength: 256,
2785
+ maxGraphemes: 256,
2786
+ maxLength: 2560,
2566
2787
  },
2567
2788
  avatar: {
2568
2789
  type: 'string',
@@ -2591,11 +2812,13 @@ export const schemaDict = {
2591
2812
  },
2592
2813
  displayName: {
2593
2814
  type: 'string',
2594
- maxLength: 64,
2815
+ maxGraphemes: 64,
2816
+ maxLength: 640,
2595
2817
  },
2596
2818
  description: {
2597
2819
  type: 'string',
2598
- maxLength: 256,
2820
+ maxGraphemes: 256,
2821
+ maxLength: 2560,
2599
2822
  },
2600
2823
  avatar: {
2601
2824
  type: 'string',
@@ -2761,11 +2984,13 @@ export const schemaDict = {
2761
2984
  properties: {
2762
2985
  displayName: {
2763
2986
  type: 'string',
2764
- maxLength: 64,
2987
+ maxGraphemes: 64,
2988
+ maxLength: 640,
2765
2989
  },
2766
2990
  description: {
2767
2991
  type: 'string',
2768
- maxLength: 256,
2992
+ maxGraphemes: 256,
2993
+ maxLength: 2560,
2769
2994
  },
2770
2995
  avatar: {
2771
2996
  type: 'blob',
@@ -4161,6 +4386,8 @@ export const schemas: LexiconDoc[] = Object.values(schemaDict) as LexiconDoc[]
4161
4386
  export const lexicons: Lexicons = new Lexicons(schemas)
4162
4387
  export const ids = {
4163
4388
  ComAtprotoAdminDefs: 'com.atproto.admin.defs',
4389
+ ComAtprotoAdminDisableInviteCodes: 'com.atproto.admin.disableInviteCodes',
4390
+ ComAtprotoAdminGetInviteCodes: 'com.atproto.admin.getInviteCodes',
4164
4391
  ComAtprotoAdminGetModerationAction: 'com.atproto.admin.getModerationAction',
4165
4392
  ComAtprotoAdminGetModerationActions: 'com.atproto.admin.getModerationActions',
4166
4393
  ComAtprotoAdminGetModerationReport: 'com.atproto.admin.getModerationReport',
@@ -4189,9 +4416,12 @@ export const ids = {
4189
4416
  ComAtprotoServerCreateAccount: 'com.atproto.server.createAccount',
4190
4417
  ComAtprotoServerCreateInviteCode: 'com.atproto.server.createInviteCode',
4191
4418
  ComAtprotoServerCreateSession: 'com.atproto.server.createSession',
4419
+ ComAtprotoServerDefs: 'com.atproto.server.defs',
4192
4420
  ComAtprotoServerDeleteAccount: 'com.atproto.server.deleteAccount',
4193
4421
  ComAtprotoServerDeleteSession: 'com.atproto.server.deleteSession',
4194
4422
  ComAtprotoServerDescribeServer: 'com.atproto.server.describeServer',
4423
+ ComAtprotoServerGetAccountInviteCodes:
4424
+ 'com.atproto.server.getAccountInviteCodes',
4195
4425
  ComAtprotoServerGetSession: 'com.atproto.server.getSession',
4196
4426
  ComAtprotoServerRefreshSession: 'com.atproto.server.refreshSession',
4197
4427
  ComAtprotoServerRequestAccountDelete:
@@ -7,6 +7,7 @@ import { lexicons } from '../../../../lexicons'
7
7
  import { CID } from 'multiformats/cid'
8
8
  import * as ComAtprotoRepoStrongRef from '../repo/strongRef'
9
9
  import * as ComAtprotoModerationDefs from '../moderation/defs'
10
+ import * as ComAtprotoServerDefs from '../server/defs'
10
11
 
11
12
  export interface ActionView {
12
13
  id: number
@@ -167,6 +168,8 @@ export interface RepoView {
167
168
  relatedRecords: {}[]
168
169
  indexedAt: string
169
170
  moderation: Moderation
171
+ invitedBy?: ComAtprotoServerDefs.InviteCode
172
+ invites?: ComAtprotoServerDefs.InviteCode[]
170
173
  [k: string]: unknown
171
174
  }
172
175
 
@@ -189,6 +192,8 @@ export interface RepoViewDetail {
189
192
  relatedRecords: {}[]
190
193
  indexedAt: string
191
194
  moderation: ModerationDetail
195
+ invitedBy?: ComAtprotoServerDefs.InviteCode
196
+ invites?: ComAtprotoServerDefs.InviteCode[]
192
197
  [k: string]: unknown
193
198
  }
194
199
 
@@ -0,0 +1,33 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { Headers, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
8
+ import { CID } from 'multiformats/cid'
9
+
10
+ export interface QueryParams {}
11
+
12
+ export interface InputSchema {
13
+ codes?: string[]
14
+ accounts?: string[]
15
+ [k: string]: unknown
16
+ }
17
+
18
+ export interface CallOptions {
19
+ headers?: Headers
20
+ qp?: QueryParams
21
+ encoding: 'application/json'
22
+ }
23
+
24
+ export interface Response {
25
+ success: boolean
26
+ headers: Headers
27
+ }
28
+
29
+ export function toKnownErr(e: any) {
30
+ if (e instanceof XRPCError) {
31
+ }
32
+ return e
33
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { Headers, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
8
+ import { CID } from 'multiformats/cid'
9
+ import * as ComAtprotoServerDefs from '../server/defs'
10
+
11
+ export interface QueryParams {
12
+ sort?: 'recent' | 'usage' | (string & {})
13
+ limit?: number
14
+ cursor?: string
15
+ }
16
+
17
+ export type InputSchema = undefined
18
+
19
+ export interface OutputSchema {
20
+ cursor?: string
21
+ codes: ComAtprotoServerDefs.InviteCode[]
22
+ [k: string]: unknown
23
+ }
24
+
25
+ export interface CallOptions {
26
+ headers?: Headers
27
+ }
28
+
29
+ export interface Response {
30
+ success: boolean
31
+ headers: Headers
32
+ data: OutputSchema
33
+ }
34
+
35
+ export function toKnownErr(e: any) {
36
+ if (e instanceof XRPCError) {
37
+ }
38
+ return e
39
+ }
@@ -10,6 +10,7 @@ import * as ComAtprotoAdminDefs from './defs'
10
10
 
11
11
  export interface QueryParams {
12
12
  term?: string
13
+ invitedBy?: string
13
14
  limit?: number
14
15
  cursor?: string
15
16
  }
@@ -14,6 +14,7 @@ export interface QueryParams {
14
14
  collection: string
15
15
  /** The number of records to return. */
16
16
  limit?: number
17
+ cursor?: string
17
18
  /** The lowest sort-ordered rkey to start from (exclusive) */
18
19
  rkeyStart?: string
19
20
  /** The highest sort-ordered rkey to stop at (exclusive) */
@@ -11,6 +11,7 @@ export interface QueryParams {}
11
11
 
12
12
  export interface InputSchema {
13
13
  useCount: number
14
+ forAccount?: string
14
15
  [k: string]: unknown
15
16
  }
16
17
 
@@ -21,6 +21,7 @@ export interface OutputSchema {
21
21
  refreshJwt: string
22
22
  handle: string
23
23
  did: string
24
+ email?: string
24
25
  [k: string]: unknown
25
26
  }
26
27
 
@@ -0,0 +1,48 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
5
+ import { isObj, hasProp } from '../../../../util'
6
+ import { lexicons } from '../../../../lexicons'
7
+ import { CID } from 'multiformats/cid'
8
+
9
+ export interface InviteCode {
10
+ code: string
11
+ available: number
12
+ disabled: boolean
13
+ forAccount: string
14
+ createdBy: string
15
+ createdAt: string
16
+ uses: InviteCodeUse[]
17
+ [k: string]: unknown
18
+ }
19
+
20
+ export function isInviteCode(v: unknown): v is InviteCode {
21
+ return (
22
+ isObj(v) &&
23
+ hasProp(v, '$type') &&
24
+ v.$type === 'com.atproto.server.defs#inviteCode'
25
+ )
26
+ }
27
+
28
+ export function validateInviteCode(v: unknown): ValidationResult {
29
+ return lexicons.validate('com.atproto.server.defs#inviteCode', v)
30
+ }
31
+
32
+ export interface InviteCodeUse {
33
+ usedBy: string
34
+ usedAt: string
35
+ [k: string]: unknown
36
+ }
37
+
38
+ export function isInviteCodeUse(v: unknown): v is InviteCodeUse {
39
+ return (
40
+ isObj(v) &&
41
+ hasProp(v, '$type') &&
42
+ v.$type === 'com.atproto.server.defs#inviteCodeUse'
43
+ )
44
+ }
45
+
46
+ export function validateInviteCodeUse(v: unknown): ValidationResult {
47
+ return lexicons.validate('com.atproto.server.defs#inviteCodeUse', v)
48
+ }