@atproto/oauth-client 0.1.2-rc.2 → 0.1.2-rc.3

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,19 +1,5 @@
1
1
  # @atproto/oauth-client
2
2
 
3
- ## 0.1.2-rc.1
4
-
5
- ### Patch Changes
6
-
7
- - Misc fixes for confidential client usage
8
-
9
- ## 0.1.2-rc.0
10
-
11
- ### Patch Changes
12
-
13
- - Updated dependencies [[`2ded0156b`](https://github.com/bluesky-social/atproto/commit/2ded0156b9adf33b9cce66583a375bff922d383b), [`2ded0156b`](https://github.com/bluesky-social/atproto/commit/2ded0156b9adf33b9cce66583a375bff922d383b)]:
14
- - @atproto/xrpc@0.6.0-rc.0
15
- - @atproto/api@0.13.0-rc.0
16
-
17
3
  ## 0.1.1
18
4
 
19
5
  ### Patch Changes
package/README.md CHANGED
@@ -155,8 +155,10 @@ await agent.post({
155
155
  text: 'Hello, world!',
156
156
  })
157
157
 
158
- // revoke credentials on the server (causing sessionStore.del() to be called)
159
- await agent.signOut()
158
+ if (agent instanceof AtpAgent) {
159
+ // revoke credentials on the server (causing sessionStore.del() to be called)
160
+ await agent.logout()
161
+ }
160
162
  ```
161
163
 
162
164
  ## Advances use-cases
@@ -3,7 +3,7 @@ import { OAuthAgent } from './oauth-agent.js';
3
3
  export declare class OAuthAtpAgent extends Agent {
4
4
  readonly oauthAgent: OAuthAgent;
5
5
  constructor(oauthAgent: OAuthAgent);
6
- clone(): this;
6
+ clone(): OAuthAtpAgent;
7
7
  get did(): string;
8
8
  signOut(): Promise<void>;
9
9
  refreshIfNeeded(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-atp-agent.d.ts","sourceRoot":"","sources":["../src/oauth-atp-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAIpC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,qBAAa,aAAc,SAAQ,KAAK;IAC1B,QAAQ,CAAC,UAAU,EAAE,UAAU;gBAAtB,UAAU,EAAE,UAAU;IAyB3C,KAAK,IAAI,IAAI;IAKb,IAAI,GAAG,IAAI,MAAM,CAEhB;IAEK,OAAO;IAIA,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;CAG9C"}
1
+ {"version":3,"file":"oauth-atp-agent.d.ts","sourceRoot":"","sources":["../src/oauth-atp-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAIpC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,qBAAa,aAAc,SAAQ,KAAK;IAC1B,QAAQ,CAAC,UAAU,EAAE,UAAU;gBAAtB,UAAU,EAAE,UAAU;IAyB3C,KAAK,IAAI,aAAa;IAItB,IAAI,GAAG,IAAI,MAAM,CAEhB;IAEK,OAAO;IAIA,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;CAG9C"}
@@ -35,8 +35,7 @@ class OAuthAtpAgent extends api_1.Agent {
35
35
  });
36
36
  }
37
37
  clone() {
38
- const agent = new OAuthAtpAgent(this.oauthAgent);
39
- return this.copyInto(agent);
38
+ return this.copyInto(new OAuthAtpAgent(this.oauthAgent));
40
39
  }
41
40
  get did() {
42
41
  return this.oauthAgent.sub;
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-atp-agent.js","sourceRoot":"","sources":["../src/oauth-atp-agent.ts"],"names":[],"mappings":";;;AAAA,sCAAoC;AACpC,wCAAyC;AACzC,+CAAoE;AAIpE,MAAa,aAAc,SAAQ,WAAK;IACtC,YAAqB,UAAsB;QACzC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;YACxB,IAAI,CAAC;gBACH,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;YACjD,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,KAAK,YAAY,kBAAU,EAA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AAC,UAAU,CAAC,eAAe,EAAE,CAAA;IACzC,CAAC;CACF;AAzCD,sCAyCC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/oauth-client",
3
- "version": "0.1.2-rc.2",
3
+ "version": "0.1.2-rc.3",
4
4
  "license": "MIT",
5
5
  "description": "OAuth client for ATPROTO PDS. This package serves as common base for environment-specific implementations (NodeJS, Browser, React-Native).",
6
6
  "keywords": [
@@ -27,17 +27,17 @@
27
27
  "dependencies": {
28
28
  "multiformats": "^9.9.0",
29
29
  "zod": "^3.23.8",
30
- "@atproto-labs/did-resolver": "0.1.2-rc.0",
30
+ "@atproto-labs/did-resolver": "0.1.2-rc.1",
31
31
  "@atproto-labs/fetch": "0.1.0",
32
- "@atproto-labs/handle-resolver": "0.1.2-rc.0",
33
- "@atproto-labs/identity-resolver": "0.1.2-rc.0",
32
+ "@atproto-labs/handle-resolver": "0.1.2-rc.1",
33
+ "@atproto-labs/identity-resolver": "0.1.2-rc.1",
34
34
  "@atproto-labs/simple-store": "0.1.1",
35
35
  "@atproto-labs/simple-store-memory": "0.1.1",
36
- "@atproto/api": "0.13.0-rc.1",
37
- "@atproto/did": "0.1.1-rc.0",
38
- "@atproto/xrpc": "0.6.0-rc.0",
36
+ "@atproto/did": "0.1.1-rc.1",
37
+ "@atproto/api": "0.13.0-rc.2",
39
38
  "@atproto/jwk": "0.1.1",
40
- "@atproto/oauth-types": "0.1.2-rc.0"
39
+ "@atproto/oauth-types": "0.1.2-rc.1",
40
+ "@atproto/xrpc": "0.5.1-rc.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "typescript": "^5.3.3"
@@ -30,9 +30,8 @@ export class OAuthAtpAgent extends Agent {
30
30
  })
31
31
  }
32
32
 
33
- clone(): this {
34
- const agent = new OAuthAtpAgent(this.oauthAgent) as this
35
- return this.copyInto(agent)
33
+ clone(): OAuthAtpAgent {
34
+ return this.copyInto(new OAuthAtpAgent(this.oauthAgent))
36
35
  }
37
36
 
38
37
  get did(): string {