@atproto/pds 0.3.0 → 0.3.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @atproto/pds
2
2
 
3
+ ## 0.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`772736a0`](https://github.com/bluesky-social/atproto/commit/772736a01081f39504e1b19a1b3687783bb78f07)]:
8
+ - @atproto/api@0.6.23
9
+
10
+ ## 0.3.1
11
+
12
+ ### Patch Changes
13
+
14
+ - [#1788](https://github.com/bluesky-social/atproto/pull/1788) [`84e2d4d2`](https://github.com/bluesky-social/atproto/commit/84e2d4d2b6694f344d80c18672c78b650189d423) Thanks [@bnewbold](https://github.com/bnewbold)! - update license to "MIT or Apache2"
15
+
16
+ - Updated dependencies [[`ce49743d`](https://github.com/bluesky-social/atproto/commit/ce49743d7f8800d33116b88001d7b512553c2c89), [`84e2d4d2`](https://github.com/bluesky-social/atproto/commit/84e2d4d2b6694f344d80c18672c78b650189d423)]:
17
+ - @atproto/lexicon@0.3.0
18
+ - @atproto/xrpc@0.4.0
19
+ - @atproto/xrpc-server@0.4.0
20
+ - @atproto/identity@0.3.1
21
+ - @atproto/common@0.3.3
22
+ - @atproto/crypto@0.2.3
23
+ - @atproto/syntax@0.1.4
24
+ - @atproto/repo@0.3.4
25
+ - @atproto/api@0.6.22
26
+ - @atproto/aws@0.1.4
27
+
3
28
  ## 0.3.0
4
29
 
5
30
  ### Patch Changes
package/LICENSE.txt ADDED
@@ -0,0 +1,7 @@
1
+ Dual MIT/Apache-2.0 License
2
+
3
+ Copyright (c) 2022-2023 Bluesky PBC, and Contributors
4
+
5
+ Except as otherwise noted in individual files, this software is licensed under the MIT license (<http://opensource.org/licenses/MIT>), or the Apache License, Version 2.0 (<http://www.apache.org/licenses/LICENSE-2.0>).
6
+
7
+ Downstream projects and end users may chose either license individually, or both together, at their discretion. The motivation for this dual-licensing is the additional software patent assurance provided by Apache 2.0.
package/README.md CHANGED
@@ -9,4 +9,9 @@ If you are interested in self-hosting a PDS, you probably want this repository i
9
9
 
10
10
  ## License
11
11
 
12
- MIT License
12
+ This project is dual-licensed under MIT and Apache 2.0 terms:
13
+
14
+ - MIT license ([LICENSE-MIT.txt](https://github.com/bluesky-social/atproto/blob/main/LICENSE-MIT.txt) or http://opensource.org/licenses/MIT)
15
+ - Apache License, Version 2.0, ([LICENSE-APACHE.txt](https://github.com/bluesky-social/atproto/blob/main/LICENSE-APACHE.txt) or http://www.apache.org/licenses/LICENSE-2.0)
16
+
17
+ Downstream projects and end users may chose either license individually, or both together, at their discretion. The motivation for this dual-licensing is the additional software patent assurance provided by Apache 2.0.
package/dist/index.js CHANGED
@@ -220318,7 +220318,9 @@ var schemaDict = {
220318
220318
  ref: "lex:com.atproto.moderation.defs#reasonType"
220319
220319
  },
220320
220320
  reason: {
220321
- type: "string"
220321
+ type: "string",
220322
+ maxGraphemes: 2e3,
220323
+ maxLength: 2e4
220322
220324
  },
220323
220325
  subject: {
220324
220326
  type: "union",
@@ -220967,7 +220969,7 @@ var schemaDict = {
220967
220969
  encoding: "application/json",
220968
220970
  schema: {
220969
220971
  type: "object",
220970
- required: ["handle", "email", "password"],
220972
+ required: ["handle"],
220971
220973
  properties: {
220972
220974
  email: {
220973
220975
  type: "string"
@@ -220990,7 +220992,7 @@ var schemaDict = {
220990
220992
  type: "string"
220991
220993
  },
220992
220994
  plcOp: {
220993
- type: "bytes"
220995
+ type: "unknown"
220994
220996
  }
220995
220997
  }
220996
220998
  }
@@ -221482,6 +221484,9 @@ var schemaDict = {
221482
221484
  },
221483
221485
  emailConfirmed: {
221484
221486
  type: "boolean"
221487
+ },
221488
+ didDoc: {
221489
+ type: "unknown"
221485
221490
  }
221486
221491
  }
221487
221492
  }
@@ -221645,6 +221650,18 @@ var schemaDict = {
221645
221650
  main: {
221646
221651
  type: "procedure",
221647
221652
  description: "Reserve a repo signing key for account creation.",
221653
+ input: {
221654
+ encoding: "application/json",
221655
+ schema: {
221656
+ type: "object",
221657
+ properties: {
221658
+ did: {
221659
+ type: "string",
221660
+ description: "The did to reserve a new did:key for"
221661
+ }
221662
+ }
221663
+ }
221664
+ },
221648
221665
  output: {
221649
221666
  encoding: "application/json",
221650
221667
  schema: {
@@ -240527,7 +240544,11 @@ function createAccount_default(server, ctx) {
240527
240544
  },
240528
240545
  handler: async ({ input, req }) => {
240529
240546
  const { email, password, inviteCode } = input.body;
240530
- if (input.body.plcOp) {
240547
+ if (!email) {
240548
+ throw new InvalidRequestError('Missing input: "email"');
240549
+ } else if (!password) {
240550
+ throw new InvalidRequestError('Missing input: "password"');
240551
+ } else if (input.body.plcOp) {
240531
240552
  throw new InvalidRequestError('Unsupported input: "plcOp"');
240532
240553
  }
240533
240554
  if (ctx.cfg.invites.required && !inviteCode) {
@@ -241071,7 +241092,10 @@ function getSession_default(server, ctx) {
241071
241092
  auth: ctx.authVerifier.access,
241072
241093
  handler: async ({ auth }) => {
241073
241094
  const did2 = auth.credentials.did;
241074
- const user = await ctx.services.account(ctx.db).getAccount(did2);
241095
+ const [user, didDoc] = await Promise.all([
241096
+ ctx.services.account(ctx.db).getAccount(did2),
241097
+ didDocForSession(ctx, did2)
241098
+ ]);
241075
241099
  if (!user) {
241076
241100
  throw new InvalidRequestError(`Could not find user info for account: ${did2}`);
241077
241101
  }
@@ -241080,6 +241104,7 @@ function getSession_default(server, ctx) {
241080
241104
  body: {
241081
241105
  handle: user.handle,
241082
241106
  did: user.did,
241107
+ didDoc,
241083
241108
  email: user.email,
241084
241109
  emailConfirmed: !!user.emailConfirmedAt
241085
241110
  }
@@ -244417,7 +244442,7 @@ var schemaDict2 = {
244417
244442
  encoding: "application/json",
244418
244443
  schema: {
244419
244444
  type: "object",
244420
- required: ["handle", "email", "password"],
244445
+ required: ["handle"],
244421
244446
  properties: {
244422
244447
  email: {
244423
244448
  type: "string"
@@ -244440,7 +244465,7 @@ var schemaDict2 = {
244440
244465
  type: "string"
244441
244466
  },
244442
244467
  plcOp: {
244443
- type: "bytes"
244468
+ type: "unknown"
244444
244469
  }
244445
244470
  }
244446
244471
  }
@@ -244932,6 +244957,9 @@ var schemaDict2 = {
244932
244957
  },
244933
244958
  emailConfirmed: {
244934
244959
  type: "boolean"
244960
+ },
244961
+ didDoc: {
244962
+ type: "unknown"
244935
244963
  }
244936
244964
  }
244937
244965
  }
@@ -245095,6 +245123,18 @@ var schemaDict2 = {
245095
245123
  main: {
245096
245124
  type: "procedure",
245097
245125
  description: "Reserve a repo signing key for account creation.",
245126
+ input: {
245127
+ encoding: "application/json",
245128
+ schema: {
245129
+ type: "object",
245130
+ properties: {
245131
+ did: {
245132
+ type: "string",
245133
+ description: "The did to reserve a new did:key for"
245134
+ }
245135
+ }
245136
+ }
245137
+ },
245098
245138
  output: {
245099
245139
  encoding: "application/json",
245100
245140
  schema: {
@@ -251596,6 +251636,7 @@ var _AtpAgent = class {
251596
251636
  this.session.email = res.data.email;
251597
251637
  this.session.handle = res.data.handle;
251598
251638
  this.session.emailConfirmed = res.data.emailConfirmed;
251639
+ this._updateApiEndpoint(res.data.didDoc);
251599
251640
  return res;
251600
251641
  } catch (e) {
251601
251642
  this.session = void 0;
@@ -254738,7 +254779,7 @@ var statusTotakedownRef = (state) => {
254738
254779
  };
254739
254780
 
254740
254781
  // src/services/local/index.ts
254741
- var import_util96 = __toESM(require("util"));
254782
+ var import_util97 = __toESM(require("util"));
254742
254783
 
254743
254784
  // src/lexicon/types/app/bsky/embed/record.ts
254744
254785
  function isMain5(v) {
@@ -254762,7 +254803,7 @@ var LocalService = class {
254762
254803
  if (!this.appviewCdnUrlPattern) {
254763
254804
  return `https://${this.pdsHostname}/xrpc/${ids.ComAtprotoSyncGetBlob}?did=${did2}&cid=${cid2}`;
254764
254805
  }
254765
- return import_util96.default.format(this.appviewCdnUrlPattern, pattern, did2, cid2);
254806
+ return import_util97.default.format(this.appviewCdnUrlPattern, pattern, did2, cid2);
254766
254807
  }
254767
254808
  async serviceAuthHeaders(did2) {
254768
254809
  if (!this.appviewDid) {