@synonymdev/react-native-pubky 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_result","LINKING_ERROR","Platform","select","ios","default","Pubky","NativeModules","Proxy","get","Error","auth","url","secretKey","res","err","ok","parseAuthUrl","parsed","JSON","parse","e","stringify","publish","recordName","recordContent","resolve","publicKey","signUp","homeserver","signIn","signOut","put","content","publishHttps","target","resolveHttps","list","generateSecretKey","getPublicKeyFromSecretKey","createRecoveryFile","passphrase","decryptRecoveryFile","recoveryFile"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,MAAME,aAAa,GACjB,6EAA6E,GAC7EC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,KAAK,GAAGC,0BAAa,CAACD,KAAK,GAC7BC,0BAAa,CAACD,KAAK,GACnB,IAAIE,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACT,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEE,eAAeU,IAAIA,CACxBC,GAAW,EACXC,SAAiB,EACU;EAC3B,MAAMC,GAAG,GAAG,MAAMR,KAAK,CAACK,IAAI,CAACC,GAAG,EAAEC,SAAS,CAAC;EAC5C,IAAIC,GAAG,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE;IACtB,OAAO,IAAAC,WAAG,EAACD,GAAG,CAAC,CAAC,CAAC,CAAC;EACpB;EACA,OAAO,IAAAE,UAAE,EAACF,GAAG,CAAC,CAAC,CAAC,CAAC;AACnB;AAaO,eAAeG,YAAYA,CAChCL,GAAW,EACwB;EACnC,IAAI;IACF,MAAME,GAAG,G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B,OAAO,IAAAC,WAAG,EAACD,GAAG,CAAC,CAAC,CAAC,CAAC;IACpB;IACA,OAAO,IAAAE,UAAE,EAACF,GAAG,CAAC,CAAC,CAAC,CAAC;EACnB,CAAC,CAAC,OAAOO,CAAC,EAAE;IACV,OAAO,IAAAN,WAAG,EAACI,IAAI,CAACG,SAAS,CAACD,CAAC,CAAC,CAAC;EAC/B;AACF;AAEO,eAAeqB,mBAAmBA,CACvCC,YAAoB,EACpBF,UAAkB,EACO;EACzB,IAAI;IACF,MAAM3B,GAAG,GAAG,MAAMR,KAAK,CAACoC,mBAAmB,CAACC,YAAY,EAAEF,UAAU,CAAC;IACrE,IAAI3B,GAAG,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE;MACtB,OAAO,IAAAC,WAAG,EAACD,GAAG,CAAC,CAAC,CAAC,CAAC;IACpB;IACA,OAAO,IAAAE,UAAE,EAACF,GAAG,CAAC,CAAC,CAAC,CAAC;EACnB,CAAC,CAAC,OAAOO,CAAC,EAAE;IACV,OAAO,IAAAN,WAAG,EAACI,IAAI,CAACG,SAAS,CAACD,CAAC,CAAC,CAAC;EAC/B;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_result","LINKING_ERROR","Platform","select","ios","default","Pubky","NativeModules","Proxy","get","Error","eventEmitter","NativeEventEmitter","setEventListener","callback","addListener","ok","undefined","e","err","JSON","stringify","removeEventListener","removeAllListeners","auth","url","secretKey","res","parseAuthUrl","parsed","parse","publish","recordName","recordContent","resolve","publicKey","signUp","homeserver","signIn","signOut","put","content","publishHttps","target","resolveHttps","list","deleteFile","session","pubky","generateSecretKey","getPublicKeyFromSecretKey","createRecoveryFile","passphrase","decryptRecoveryFile","recoveryFile"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,MAAME,aAAa,GACjB,6EAA6E,GAC7EC,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AC,WAAG,EAACC,IAAI,CAACC,SAAS,CAACH,CAAC,CAAC,CAAC;EAC/B;AACF;AAEO,eAAemC,mBAAmBA,CACvCC,YAAoB,EACpBF,UAAkB,EACO;EACzB,IAAI;IACF,MAAMzB,GAAG,GAAG,MAAMrB,KAAK,CAAC+C,mBAAmB,CAACC,YAAY,EAAEF,UAAU,CAAC;IACrE,IAAIzB,GAAG,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE;MACtB,OAAO,IAAAR,WAAG,EAACQ,GAAG,CAAC,CAAC,CAAC,CAAC;IACpB;IACA,OAAO,IAAAX,UAAE,EAACW,GAAG,CAAC,CAAC,CAAC,CAAC;EACnB,CAAC,CAAC,OAAOT,CAAC,EAAE;IACV,OAAO,IAAAC,WAAG,EAACC,IAAI,CAACC,SAAS,CAACH,CAAC,CAAC,CAAC;EAC/B;AACF","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- import { NativeModules, Platform } from 'react-native';
3
+ import { NativeModules, Platform, NativeEventEmitter } from 'react-native';
4
4
  import { ok, err } from '@synonymdev/result';
5
5
  const LINKING_ERROR = `The package 'react-native-pubky' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
6
6
  ios: "- You have run 'pod install'\n",
@@ -11,6 +11,25 @@ const Pubky = NativeModules.Pubky ? NativeModules.Pubky : new Proxy({}, {
11
11
  throw new Error(LINKING_ERROR);
12
12
  }
13
13
  });
14
+ const eventEmitter = new NativeEventEmitter(Pubky);
15
+ export async function setEventListener(callback) {
16
+ try {
17
+ await Pubky.setEventListener();
18
+ eventEmitter.addListener('PubkyEvent', callback);
19
+ return ok(undefined);
20
+ } catch (e) {
21
+ return err(JSON.stringify(e));
22
+ }
23
+ }
24
+ export async function removeEventListener() {
25
+ try {
26
+ //await Pubky.removeEventListener();
27
+ eventEmitter.removeAllListeners('PubkyEvent');
28
+ return ok(undefined);
29
+ } catch (e) {
30
+ return err(JSON.stringify(e));
31
+ }
32
+ }
14
33
  export async function auth(url, secretKey) {
15
34
  const res = await Pubky.auth(url, secretKey);
16
35
  if (res[0] === 'error') {
@@ -140,6 +159,28 @@ export async function list(url) {
140
159
  return err(JSON.stringify(e));
141
160
  }
142
161
  }
162
+ export async function deleteFile(url) {
163
+ try {
164
+ const res = await Pubky.deleteFile(url);
165
+ if (res[0] === 'error') {
166
+ return err(res[1]);
167
+ }
168
+ return ok(res[1]);
169
+ } catch (e) {
170
+ return err(JSON.stringify(e));
171
+ }
172
+ }
173
+ export async function session(pubky) {
174
+ try {
175
+ const res = await Pubky.session(pubky);
176
+ if (res[0] === 'error') {
177
+ return err(res[1]);
178
+ }
179
+ return ok(JSON.parse(res[1]));
180
+ } catch (e) {
181
+ return err(JSON.stringify(e));
182
+ }
183
+ }
143
184
  export async function generateSecretKey() {
144
185
  try {
145
186
  const res = await Pubky.generateSecretKey();
@@ -1 +1 @@
1
- {"version":3,"names":["NativeModules","Platform","ok","err","LINKING_ERROR","select","ios","default","Pubky","Proxy","get","Error","auth","url","secretKey","res","parseAuthUrl","parsed","JSON","parse","e","stringify","publish","recordName","recordContent","resolve","publicKey","signUp","homeserver","signIn","signOut","put","content","publishHttps","target","resolveHttps","list","generateSecretKey","getPublicKeyFromSecretKey","createRecoveryFile","passphrase","decryptRecoveryFile","recoveryFile"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AACtD,SAASC,EAAE,EAAEC,GAAG,QAAqB,oBAAoB;AAEzD,MAAMC,aAAa,GACjB,6EAA6E,GAC7EH,QAAQ,CAACI,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,KAAK,GAAGR,aAAa,CAACQ,KAAK,GAC7BR,aAAa,CAACQ,KAAK,GACnB,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EA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;EAC/B,CAAC,CAAC,OAAOK,CAAC,EAAE;IACV,OAAOjB,GAAG,CAACe,IAAI,CAACG,SAAS,CAACD,CAAC,CAAC,CAAC;EAC/B;AACF;AAEA,OAAO,eAAemB,kBAAkBA,CACtCzB,SAAiB,EACjB0B,UAAkB,EACO;EACzB,IAAI;IACF,MAAMzB,GAAG,GAAG,MAAMP,KAAK,CAAC+B,kBAAkB,CAACzB,SAAS,EAAE0B,UAAU,CAAC;IACjE,IAAIzB,GAAG,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE;MACtB,OAAOZ,GAAG,CAACY,GAAG,CAAC,CAAC,CAAC,CAAC;IACpB;IACA,OAAOb,EAAE,CAACa,GAAG,CAAC,CAAC,CAAC,CAAC;EACnB,CAAC,CAAC,OAAOK,CAAC,EAAE;IACV,OAAOjB,GAAG,CAACe,IAAI,CAACG,SAAS,CAACD,CAAC,CAAC,CAAC;EAC/B;AACF;AAEA,OAAO,eAAeqB,mBAAmBA,CACvCC,YAAoB,EACpBF,UAAkB,EACO;EACzB,IAAI;IACF,MAAMzB,GAAG,GAAG,MAAMP,KAAK,CAACiC,mBAAmB,CAACC,YAAY,EAAEF,UAAU,CAAC;IACrE,IAAIzB,GAAG,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE;MACtB,OAAOZ,GAAG,CAACY,GAAG,CAAC,CAAC,CAAC,CAAC;IACpB;IACA,OAAOb,EAAE,CAACa,GAAG,CAAC,CAAC,CAAC,CAAC;EACnB,CAAC,CAAC,OAAOK,CAAC,EAAE;IACV,OAAOjB,GAAG,CAACe,IAAI,CAACG,SAAS,CAACD,CAAC,CAAC,CAAC;EAC/B;AACF","ignoreList":[]}
1
+ {"version":3,"names":["NativeModules","Platform","NativeEventEmitter","ok","err","LINKING_ERROR","select","ios","default","Pubky","Proxy","get","Error","eventEmitter","setEventListener","callback","addListener","undefined","e","JSON","stringify","removeEventListener","removeAllListeners","auth","url","secretKey","res","parseAuthUrl","parsed","parse","publish","recordName","recordContent","resolve","publicKey","signUp","homeserver","signIn","signOut","put","content","publishHttps","target","resolveHttps","list","deleteFile","session","pubky","generateSecretKey","getPublicKeyFromSecretKey","createRecoveryFile","passphrase","decryptRecoveryFile","recoveryFile"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,QAAQ,EAAEC,kBAAkB,QAAQ,cAAc;AAC1E,SAASC,EAAE,EAAEC,GAAG,QAAqB,oBAAoB;AAEzD,MAAMC,aAAa,GACjB,6EAA6E,GAC7EJ,QAAQ,CAACK,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,KAAK,GAAGT,aAAa,CAACS,KAAK,GAC7BT,aAAa,CAACS,KAAK,GACnB,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACP,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEL,MAAMQ,YAAY,GAAG,IAAIX,kBAAkB,CAACO,KAAK,CAAC;AAElD,OAAO,eAAeK,gBAAgBA,CACpCC,QAAqC,EACd;EACvB,IAAI;IACF,MAAMN,KAAK,CAACK,gBAAgB,CAAC,CAAC;IAC9BD,YAAY,CAACG,WAAW,CAAC,YAAY,EAAED,QAAQ,CAAC;IAChD,OAAOZ,EAAE,CAACc,SAAS,CAAC;EACtB,CAAC,CAAC,OAAOC,CAAC,EAAE;IACV,OAAOd,GAAG,CAACe,IAAI,CAACC,SAAS,CAACF,CAAC,CAAC,CAAC;EAC/B;AACF;AAEA,OAAO,eAAeG,mBAAmBA,CAAA,EAA0B;EACjE,IAAI;IACF;IACAR,YAAY,CAACS,kBAAkB,CAAC,YAAY,CAAC;IAC7C,OAAOnB,EAAE,CAACc,SAAS,CAAC;EACtB,CAAC,CAAC,OAAOC,CAAC,EAAE;IACV,OAAOd,GAAG,CAACe,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AO,EAAE;MACtB,OAAOtB,GAAG,CAACsB,GAAG,CAAC,CAAC,CAAC,CAAC;IACpB;IACA,OAAOvB,EAAE,CAACuB,GAAG,CAAC,CAAC,CAAC,CAAC;EACnB,CAAC,CAAC,OAAOR,CAAC,EAAE;IACV,OAAOd,GAAG,CAACe,IAAI,CAACC,SAAS,CAACF,CAAC,CAAC,CAAC;EAC/B;AACF;AAEA,OAAO,eAAekC,mBAAmBA,CACvCC,YAAoB,EACpBF,UAAkB,EACO;EACzB,IAAI;IACF,MAAMzB,GAAG,GAAG,MAAMjB,KAAK,CAAC2C,mBAAmB,CAACC,YAAY,EAAEF,UAAU,CAAC;IACrE,IAAIzB,GAAG,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE;MACtB,OAAOtB,GAAG,CAACsB,GAAG,CAAC,CAAC,CAAC,CAAC;IACpB;IACA,OAAOvB,EAAE,CAACuB,GAAG,CAAC,CAAC,CAAC,CAAC;EACnB,CAAC,CAAC,OAAOR,CAAC,EAAE;IACV,OAAOd,GAAG,CAACe,IAAI,CAACC,SAAS,CAACF,CAAC,CAAC,CAAC;EAC/B;AACF","ignoreList":[]}
@@ -1,4 +1,6 @@
1
1
  import { type Result } from '@synonymdev/result';
2
+ export declare function setEventListener(callback: (eventData: string) => void): Promise<Result<void>>;
3
+ export declare function removeEventListener(): Promise<Result<void>>;
2
4
  export declare function auth(url: string, secretKey: string): Promise<Result<string[]>>;
3
5
  type Capability = {
4
6
  path: string;
@@ -52,6 +54,12 @@ interface IHttpsResolveResult {
52
54
  }
53
55
  export declare function resolveHttps(publicKey: string): Promise<Result<IHttpsResolveResult>>;
54
56
  export declare function list(url: string): Promise<Result<string[]>>;
57
+ export declare function deleteFile(url: string): Promise<Result<string[]>>;
58
+ interface SessionInfo {
59
+ pubky: string;
60
+ capabilities: string[];
61
+ }
62
+ export declare function session(pubky: string): Promise<Result<SessionInfo>>;
55
63
  interface IPublicKeyInfo {
56
64
  public_key: string;
57
65
  uri: string;
@@ -1 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AsB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAUzE;AAED,UAAU,cAAc;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;CACb;AACD,UAAU,kBAAmB,SAAQ,cAAc;IACjD,UAAU,EAAE,MAAM,CAAC;CACpB;AACD,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAU7E;AAED,wBAAsB,yBAAyB,CAC7C,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAUjC;AAED,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAUzB;AAED,wBAAsB,mBAAmB,CACvC,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAUzB"}
@@ -1,4 +1,6 @@
1
1
  import { type Result } from '@synonymdev/result';
2
+ export declare function setEventListener(callback: (eventData: string) => void): Promise<Result<void>>;
3
+ export declare function removeEventListener(): Promise<Result<void>>;
2
4
  export declare function auth(url: string, secretKey: string): Promise<Result<string[]>>;
3
5
  type Capability = {
4
6
  path: string;
@@ -52,6 +54,12 @@ interface IHttpsResolveResult {
52
54
  }
53
55
  export declare function resolveHttps(publicKey: string): Promise<Result<IHttpsResolveResult>>;
54
56
  export declare function list(url: string): Promise<Result<string[]>>;
57
+ export declare function deleteFile(url: string): Promise<Result<string[]>>;
58
+ interface SessionInfo {
59
+ pubky: string;
60
+ capabilities: string[];
61
+ }
62
+ export declare function session(pubky: string): Promise<Result<SessionInfo>>;
55
63
  interface IPublicKeyInfo {
56
64
  public_key: string;
57
65
  uri: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRo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AG,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAUzE;AAED,UAAU,cAAc;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;CACb;AACD,UAAU,kBAAmB,SAAQ,cAAc;IACjD,UAAU,EAAE,MAAM,CAAC;CACpB;AACD,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAU7E;AAED,wBAAsB,yBAAyB,CAC7C,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAUjC;AAED,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAUzB;AAED,wBAAsB,mBAAmB,CACvC,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAUzB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synonymdev/react-native-pubky",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "React Native Implementation of Pubky",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
package/src/index.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import { NativeModules, Platform } from 'react-native';
1
+ import { NativeModules, Platform, NativeEventEmitter } from 'react-native';
2
2
  import { ok, err, type Result } from '@synonymdev/result';
3
3
 
4
4
  const LINKING_ERROR =
@@ -18,6 +18,30 @@ const Pubky = NativeModules.Pubky
18
18
  }
19
19
  );
20
20
 
21
+ const eventEmitter = new NativeEventEmitter(Pubky);
22
+
23
+ export async function setEventListener(
24
+ callback: (eventData: string) => void
25
+ ): Promise<Result<void>> {
26
+ try {
27
+ await Pubky.setEventListener();
28
+ eventEmitter.addListener('PubkyEvent', callback);
29
+ return ok(undefined);
30
+ } catch (e) {
31
+ return err(JSON.stringify(e));
32
+ }
33
+ }
34
+
35
+ export async function removeEventListener(): Promise<Result<void>> {
36
+ try {
37
+ //await Pubky.removeEventListener();
38
+ eventEmitter.removeAllListeners('PubkyEvent');
39
+ return ok(undefined);
40
+ } catch (e) {
41
+ return err(JSON.stringify(e));
42
+ }
43
+ }
44
+
21
45
  export async function auth(
22
46
  url: string,
23
47
  secretKey: string
@@ -225,6 +249,35 @@ export async function list(url: string): Promise<Result<string[]>> {
225
249
  }
226
250
  }
227
251
 
252
+ export async function deleteFile(url: string): Promise<Result<string[]>> {
253
+ try {
254
+ const res = await Pubky.deleteFile(url);
255
+ if (res[0] === 'error') {
256
+ return err(res[1]);
257
+ }
258
+ return ok(res[1]);
259
+ } catch (e) {
260
+ return err(JSON.stringify(e));
261
+ }
262
+ }
263
+
264
+ interface SessionInfo {
265
+ pubky: string;
266
+ capabilities: string[];
267
+ }
268
+
269
+ export async function session(pubky: string): Promise<Result<SessionInfo>> {
270
+ try {
271
+ const res = await Pubky.session(pubky);
272
+ if (res[0] === 'error') {
273
+ return err(res[1]);
274
+ }
275
+ return ok(JSON.parse(res[1]));
276
+ } catch (e) {
277
+ return err(JSON.stringify(e));
278
+ }
279
+ }
280
+
228
281
  interface IPublicKeyInfo {
229
282
  public_key: string;
230
283
  uri: string;