signify-ts 0.2.0 → 0.3.0-dev.e31e78d

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 (129) hide show
  1. package/README.md +104 -34
  2. package/dist/exports.d.ts +40 -40
  3. package/dist/exports.js +40 -0
  4. package/dist/index.d.ts +2 -3
  5. package/dist/index.js +3 -8
  6. package/dist/keri/app/aiding.d.ts +54 -18
  7. package/{src/keri/app/aiding.ts → dist/keri/app/aiding.js} +130 -236
  8. package/dist/keri/app/clienting.d.ts +59 -22
  9. package/{src/keri/app/clienting.ts → dist/keri/app/clienting.js} +146 -235
  10. package/dist/keri/app/contacting.d.ts +30 -23
  11. package/{src/keri/app/contacting.ts → dist/keri/app/contacting.js} +26 -63
  12. package/dist/keri/app/controller.d.ts +49 -6
  13. package/{src/keri/app/controller.ts → dist/keri/app/controller.js} +80 -186
  14. package/dist/keri/app/coring.d.ts +134 -25
  15. package/{src/keri/app/coring.ts → dist/keri/app/coring.js} +83 -56
  16. package/dist/keri/app/credentialing.d.ts +191 -67
  17. package/dist/keri/app/credentialing.js +540 -0
  18. package/dist/keri/app/delegating.d.ts +18 -0
  19. package/dist/keri/app/delegating.js +24 -0
  20. package/dist/keri/app/escrowing.d.ts +5 -3
  21. package/{src/keri/app/escrowing.ts → dist/keri/app/escrowing.js} +3 -9
  22. package/dist/keri/app/exchanging.d.ts +243 -11
  23. package/dist/keri/app/exchanging.js +242 -0
  24. package/dist/keri/app/grouping.d.ts +11 -9
  25. package/{src/keri/app/grouping.ts → dist/keri/app/grouping.js} +10 -29
  26. package/dist/keri/app/habery.d.ts +2 -2
  27. package/dist/keri/app/habery.js +117 -0
  28. package/dist/keri/app/notifying.d.ts +2 -2
  29. package/{src/keri/app/notifying.ts → dist/keri/app/notifying.js} +7 -17
  30. package/dist/keri/core/authing.d.ts +2 -2
  31. package/{src/keri/core/authing.ts → dist/keri/core/authing.js} +26 -42
  32. package/dist/keri/core/base64.d.ts +2 -0
  33. package/dist/keri/core/base64.js +16 -0
  34. package/dist/keri/core/bexter.d.ts +1 -1
  35. package/{src/keri/core/bexter.ts → dist/keri/core/bexter.js} +18 -32
  36. package/dist/keri/core/cigar.d.ts +2 -2
  37. package/dist/keri/core/cigar.js +13 -0
  38. package/dist/keri/core/cipher.d.ts +1 -1
  39. package/{src/keri/core/cipher.ts → dist/keri/core/cipher.js} +10 -19
  40. package/dist/keri/core/core.d.ts +117 -9
  41. package/dist/keri/core/core.js +385 -0
  42. package/dist/keri/core/counter.d.ts +2 -2
  43. package/dist/keri/core/counter.js +221 -0
  44. package/dist/keri/core/decrypter.d.ts +4 -4
  45. package/{src/keri/core/decrypter.ts → dist/keri/core/decrypter.js} +23 -40
  46. package/dist/keri/core/diger.d.ts +3 -3
  47. package/{src/keri/core/diger.ts → dist/keri/core/diger.js} +18 -33
  48. package/dist/keri/core/encrypter.d.ts +2 -2
  49. package/{src/keri/core/encrypter.ts → dist/keri/core/encrypter.js} +18 -38
  50. package/dist/keri/core/eventing.d.ts +6 -6
  51. package/dist/keri/core/eventing.js +383 -0
  52. package/dist/keri/core/httping.d.ts +11 -4
  53. package/{src/keri/core/httping.ts → dist/keri/core/httping.js} +36 -101
  54. package/dist/keri/core/indexer.d.ts +1 -1
  55. package/dist/keri/core/indexer.js +407 -0
  56. package/dist/keri/core/keeping.d.ts +113 -46
  57. package/dist/keri/core/keeping.js +347 -0
  58. package/{src/keri/core/kering.ts → dist/keri/core/kering.js} +1 -3
  59. package/dist/keri/core/keyState.d.ts +98 -0
  60. package/dist/keri/core/manager.d.ts +147 -12
  61. package/dist/keri/core/manager.js +880 -0
  62. package/dist/keri/core/matter.d.ts +1 -1
  63. package/dist/keri/core/matter.js +460 -0
  64. package/dist/keri/core/number.d.ts +2 -2
  65. package/{src/keri/core/number.ts → dist/keri/core/number.js} +26 -32
  66. package/dist/keri/core/pather.d.ts +2 -2
  67. package/{src/keri/core/pather.ts → dist/keri/core/pather.js} +12 -27
  68. package/dist/keri/core/prefixer.d.ts +10 -10
  69. package/dist/keri/core/prefixer.js +182 -0
  70. package/dist/keri/core/saider.d.ts +2 -12
  71. package/dist/keri/core/saider.js +107 -0
  72. package/dist/keri/core/salter.d.ts +44 -9
  73. package/dist/keri/core/salter.js +110 -0
  74. package/dist/keri/core/seqner.d.ts +1 -1
  75. package/{src/keri/core/seqner.ts → dist/keri/core/seqner.js} +20 -21
  76. package/dist/keri/core/serder.d.ts +25 -12
  77. package/dist/keri/core/serder.js +133 -0
  78. package/dist/keri/core/siger.d.ts +2 -2
  79. package/{src/keri/core/siger.ts → dist/keri/core/siger.js} +4 -14
  80. package/dist/keri/core/signer.d.ts +4 -4
  81. package/dist/keri/core/signer.js +84 -0
  82. package/{src/keri/core/tholder.ts → dist/keri/core/tholder.js} +69 -94
  83. package/dist/keri/core/utils.d.ts +1 -1
  84. package/{src/keri/core/utils.ts → dist/keri/core/utils.js} +30 -60
  85. package/dist/keri/core/vdring.d.ts +2 -2
  86. package/dist/keri/core/vdring.js +61 -0
  87. package/dist/keri/core/verfer.d.ts +2 -6
  88. package/dist/keri/core/verfer.js +37 -0
  89. package/dist/keri/end/ending.d.ts +10 -8
  90. package/dist/keri/end/ending.js +136 -0
  91. package/{src/ready.ts → dist/ready.js} +1 -2
  92. package/dist/types/keria-api-schema.d.ts +1158 -0
  93. package/dist/types/keria-api-schema.js +34 -0
  94. package/package.json +53 -52
  95. package/dist/math.d.ts +0 -1
  96. package/dist/signify-ts.cjs +0 -7835
  97. package/dist/signify-ts.cjs.development.js +0 -9501
  98. package/dist/signify-ts.cjs.development.js.map +0 -1
  99. package/dist/signify-ts.cjs.map +0 -7
  100. package/dist/signify-ts.cjs.production.min.js +0 -2
  101. package/dist/signify-ts.cjs.production.min.js.map +0 -1
  102. package/dist/signify-ts.esm.js +0 -9345
  103. package/dist/signify-ts.esm.js.map +0 -1
  104. package/dist/signify-ts.mjs +0 -7811
  105. package/dist/signify-ts.mjs.map +0 -7
  106. package/src/buffer-polyfill.ts +0 -5
  107. package/src/exports.ts +0 -44
  108. package/src/index.ts +0 -4
  109. package/src/keri/app/credentialing.ts +0 -820
  110. package/src/keri/app/exchanging.ts +0 -220
  111. package/src/keri/app/habery.ts +0 -185
  112. package/src/keri/core/cigar.ts +0 -18
  113. package/src/keri/core/core.ts +0 -326
  114. package/src/keri/core/counter.ts +0 -273
  115. package/src/keri/core/eventing.ts +0 -581
  116. package/src/keri/core/indexer.ts +0 -509
  117. package/src/keri/core/keeping.ts +0 -684
  118. package/src/keri/core/manager.ts +0 -1183
  119. package/src/keri/core/matter.ts +0 -521
  120. package/src/keri/core/prefixer.ts +0 -233
  121. package/src/keri/core/saider.ts +0 -186
  122. package/src/keri/core/salter.ts +0 -120
  123. package/src/keri/core/serder.ts +0 -163
  124. package/src/keri/core/signer.ts +0 -133
  125. package/src/keri/core/vdring.ts +0 -94
  126. package/src/keri/core/verfer.ts +0 -47
  127. package/src/keri/end/ending.ts +0 -170
  128. package/src/math.ts +0 -3
  129. /package/dist/{buffer-polyfill.d.ts → keri/core/keyState.js} +0 -0
package/README.md CHANGED
@@ -9,7 +9,7 @@ Project Name: signify-ts
9
9
 
10
10
  ## Signify - KERI Signing at the Edge
11
11
 
12
- Of the five functions in a KERI agent,
12
+ Of the five functions in a KERI agent,
13
13
 
14
14
  1. Key generation
15
15
  2. Encrypted key storage
@@ -19,33 +19,66 @@ Of the five functions in a KERI agent,
19
19
 
20
20
  Signify-TS splits off two, key generation and event signing into a TypeScript library to provide "signing at the edge".
21
21
  It accomplishes this by using [libsodium](https://doc.libsodium.org/) to generate ed25519 key pairs for signing and x25519 key pairs for encrypting the
22
- private keys, next public keys and salts used to generate the private keys. The encrypted private key and salts are then stored on a
23
- remote cloud agent that never has access to the decryption keys. New key pair sets (current and next) will be generated
22
+ private keys, next public keys and salts used to generate the private keys. The encrypted private key and salts are then stored on a
23
+ remote cloud agent that never has access to the decryption keys. New key pair sets (current and next) will be generated
24
24
  for inception and rotation events with only the public keys and blake3 hash of the next keys made available to the agent.
25
25
 
26
26
  The communication protocol between a Signify client and [KERI](https://github.com/WebOfTrust/keri) agent will encode all cryptographic primitives as CESR base64
27
- encoded strings for the initial implementation. Support for binary CESR can be added in the future.
28
-
27
+ encoded strings for the initial implementation. Support for binary CESR can be added in the future.
29
28
 
30
29
  ### Environment Setup
31
30
 
32
31
  The code is built using Typescript and running code locally requires a Mac or Linux OS.
33
32
 
34
- - Install [Node.js](https://nodejs.org)
35
-
33
+ - Install [Node.js](https://nodejs.org)
36
34
 
37
- - Install dependencies:
35
+ - Install dependencies:
38
36
  ```bash
39
37
  npm install
40
38
  ```
41
39
 
42
40
  Typescript source files needs to be transpiled before running scripts or integration tests
43
41
 
44
- - Build:
42
+ - Generate types:
43
+
44
+ To generate TypeScript types from KERIA OpenAPI docs dynamically
45
+
46
+ ```
47
+ npm run generate:types
48
+ ```
49
+
50
+ We can specify KERIA spec url by this command:
51
+
52
+ ```
53
+ SPEC_URL=http://localhost:3902/spec.yaml npm run generate:types
54
+ ```
55
+
56
+ - Build:
57
+
45
58
  ```bash
46
59
  npm run build
47
60
  ```
48
61
 
62
+ - ready() must be called before library is useable. Example minimum viable client code.
63
+
64
+ ```javascript
65
+ import { randomPasscode, ready, SignifyClient, Tier } from 'signify-ts';
66
+
67
+ await ready();
68
+
69
+ const bran = randomPasscode();
70
+ const url = 'http://127.0.0.1:3901';
71
+ const boot_url = 'http://127.0.0.1:3903';
72
+ const actualSignifyClient = new SignifyClient(
73
+ url,
74
+ bran,
75
+ Tier.low,
76
+ boot_url
77
+ );
78
+
79
+ console.log(actualSignifyClient);
80
+ ```
81
+
49
82
  ### Unit testing
50
83
 
51
84
  To run unit tests
@@ -59,28 +92,34 @@ npm test
59
92
  The integration tests depends on a local instance of KERIA, vLEI-Server and Witness Demo. These are specified in the [Docker Compose](./docker-compose.yaml) file. To start the dependencies, use docker compose:
60
93
 
61
94
  ```bash
62
- docker compose up deps
95
+ docker compose up --wait
63
96
  ```
64
97
 
65
- If successful, it should print someting like this:
98
+ If successful, it should print something like this:
66
99
 
67
100
  ```bash
68
- $ docker compose up deps
69
- [+] Running 5/4
101
+ $ docker compose up --wait
102
+ [+] Running 4/4
70
103
  ✔ Network signify-ts_default Created 0.0s
71
- ✔ Container signify-ts-vlei-server-1 Created 0.1s
72
- ✔ Container signify-ts-keria-1 Created 0.1s
73
- ✔ Container signify-ts-witness-demo-1 Created 0.1s
74
- ✔ Container signify-ts-deps-1 Created 0.0s
75
- Attaching to signify-ts-deps-1
76
- signify-ts-deps-1 | Dependencies running
77
- signify-ts-deps-1 exited with code 0
104
+ ✔ Container signify-ts-vlei-server-1 Healthy 5.7s
105
+ ✔ Container signify-ts-keria-1 Healthy 6.2s
106
+ ✔ Container signify-ts-witness-demo-1 Healthy 6.2s
107
+ ```
108
+
109
+ It is possible to change the keria image by using environment variables. For example, to use weboftrust/keria:0.1.3, do:
110
+
111
+ ```bash
112
+ export KERIA_IMAGE_TAG=0.1.3
113
+ docker compose pull
114
+ docker compose up --wait
78
115
  ```
79
116
 
80
- **Important!** The integration tests runs on the build output in `dist/` directory. Make sure to run build before running the integration tests.
117
+ To use another repository, you can do:
81
118
 
82
119
  ```bash
83
- npm run build
120
+ export KERIA_IMAGE=gleif/keria
121
+ docker compose pull
122
+ docker compose up --wait
84
123
  ```
85
124
 
86
125
  Use the npm script "test:integration" to run all integration tests in sequence:
@@ -89,33 +128,64 @@ Use the npm script "test:integration" to run all integration tests in sequence:
89
128
  npm run test:integration
90
129
  ```
91
130
 
92
- Or, use execute `jest` directly to run a specific integration test, for example:
131
+ To execute a specific integration test, you can use:
93
132
 
94
133
  ```bash
95
- npx jest examples/integration-scripts/credentials.test.ts
134
+ npm run test:integration -- test-integration/credentials.test.ts
96
135
  ```
97
136
 
98
137
  It is also possible to run the tests using local instances of vLEI, Keria, and witness network. Set the environment variable `TEST_ENVIRONMENT` to `local`, e.g:
99
138
 
100
139
  ```
101
- TEST_ENVIRONMENT=local npx jest examples/integration-scripts/credentials.test.ts
140
+ TEST_ENVIRONMENT=local npm run test:integration test-integration/credentials.test.ts
102
141
  ```
103
142
 
104
143
  This changes the discovery urls to use `localhost` instead of the hostnames inside the docker network.
105
144
 
106
- ### Old integration scripts
107
-
108
- To run any of the old integration scripts that has not yet been converted to an integration test. Use `ts-node-esm`
109
-
110
- ```bash
111
- npx ts-node-esm examples/integration-scripts/challenge.ts
112
- ```
113
-
114
145
  # Diagrams
115
146
 
116
147
  Account Creation Workflow
117
148
 
118
149
  ![Account Creation](/diagrams/account-creation-workflow.png)
119
150
 
120
-
121
151
  ![Account Creation Webpage](/diagrams/account-creation-webpage-workflow.png)
152
+
153
+ # Publishing
154
+
155
+ This package is published on npm: https://www.npmjs.com/package/signify-ts.
156
+
157
+ If you need to publish a version under your own scope, you can use the [publish script](./publish.sh). This enables you to create development packages. For example:
158
+
159
+ ```bash
160
+ NPM_PACKAGE_SCOPE=@myorg DRY_RUN=1 ./publish.sh
161
+ npm notice Tarball Details
162
+ npm notice name: @myorg/signify-ts
163
+ npm notice version: 0.3.0-rc1-dev.8fa9919
164
+ npm notice filename: myorg-signify-ts-0.3.0-rc1-dev.8fa9919.tgz
165
+ npm notice package size: 81.0 kB
166
+ npm notice unpacked size: 370.0 kB
167
+ npm notice shasum: 8c160bc99d9ec552e6c478c20922cae3388a8ace
168
+ npm notice integrity: sha512-WRuD5PKFN3WBl[...]xVieCIS0UpVeg==
169
+ npm notice total files: 96
170
+ npm notice
171
+ npm notice Publishing to https://registry.npmjs.org/ with tag dev and default access (dry-run)
172
+ + @myorg/signify-ts@0.3.0-rc1-dev.8fa9919
173
+ ```
174
+
175
+ Set the `NPM_PUBLISH_TAG` to `latest` to skip the commit hash suffix in the version:
176
+
177
+ ```bash
178
+ NPM_PUBLISH_TAG=latest NPM_PACKAGE_SCOPE=@myorg DRY_RUN=1 ./publish.sh
179
+ npm notice Tarball Details
180
+ npm notice name: @myorg/signify-ts
181
+ npm notice version: 0.3.0-rc1
182
+ npm notice filename: myorg-signify-ts-0.3.0-rc1.tgz
183
+ npm notice package size: 80.9 kB
184
+ npm notice unpacked size: 370.0 kB
185
+ npm notice shasum: 8c9e4edcf19802e8acaf5996a36061a9c335b1c4
186
+ npm notice integrity: sha512-V1y2W3zs4Ccsn[...]vKY3WWgalcuBQ==
187
+ npm notice total files: 96
188
+ npm notice
189
+ npm notice Publishing to https://registry.npmjs.org/ with tag latest and default access (dry-run)
190
+ + @myorg/signify-ts@0.3.0-rc1
191
+ ```
package/dist/exports.d.ts CHANGED
@@ -1,40 +1,40 @@
1
- export * from './ready';
2
- export * from './math';
3
- export * from './keri/app/habery';
4
- export * from './keri/app/controller';
5
- export * from './keri/app/aiding';
6
- export * from './keri/app/clienting';
7
- export * from './keri/app/contacting';
8
- export * from './keri/app/coring';
9
- export * from './keri/app/credentialing';
10
- export * from './keri/app/escrowing';
11
- export * from './keri/app/exchanging';
12
- export * from './keri/app/grouping';
13
- export * from './keri/app/notifying';
14
- export * from './keri/core/authing';
15
- export * from './keri/core/cigar';
16
- export * from './keri/core/cipher';
17
- export * from './keri/core/core';
18
- export * from './keri/core/counter';
19
- export * from './keri/core/decrypter';
20
- export * from './keri/core/diger';
21
- export * from './keri/core/encrypter';
22
- export * from './keri/core/eventing';
23
- export * from './keri/core/httping';
24
- export * from './keri/core/indexer';
25
- export * from './keri/core/keeping';
26
- export * from './keri/core/kering';
27
- export * from './keri/core/manager';
28
- export * from './keri/core/matter';
29
- export * from './keri/core/number';
30
- export * from './keri/core/prefixer';
31
- export * from './keri/core/saider';
32
- export * from './keri/core/salter';
33
- export * from './keri/core/seqner';
34
- export * from './keri/core/serder';
35
- export * from './keri/core/siger';
36
- export * from './keri/core/signer';
37
- export * from './keri/core/tholder';
38
- export * from './keri/core/utils';
39
- export * from './keri/core/verfer';
40
- export * from './keri/end/ending';
1
+ export * from './ready.ts';
2
+ export * from './keri/app/habery.ts';
3
+ export * from './keri/app/controller.ts';
4
+ export * from './keri/app/aiding.ts';
5
+ export * from './keri/app/clienting.ts';
6
+ export * from './keri/app/contacting.ts';
7
+ export * from './keri/app/coring.ts';
8
+ export * from './keri/app/credentialing.ts';
9
+ export * from './keri/app/escrowing.ts';
10
+ export * from './keri/app/exchanging.ts';
11
+ export * from './keri/app/grouping.ts';
12
+ export * from './keri/app/notifying.ts';
13
+ export * from './keri/core/authing.ts';
14
+ export * from './keri/core/cigar.ts';
15
+ export * from './keri/core/cipher.ts';
16
+ export * from './keri/core/core.ts';
17
+ export * from './keri/core/counter.ts';
18
+ export * from './keri/core/decrypter.ts';
19
+ export * from './keri/core/diger.ts';
20
+ export * from './keri/core/encrypter.ts';
21
+ export * from './keri/core/eventing.ts';
22
+ export * from './keri/core/httping.ts';
23
+ export * from './keri/core/indexer.ts';
24
+ export * from './keri/core/keeping.ts';
25
+ export * from './keri/core/kering.ts';
26
+ export * from './keri/core/manager.ts';
27
+ export * from './keri/core/matter.ts';
28
+ export * from './keri/core/number.ts';
29
+ export * from './keri/core/prefixer.ts';
30
+ export * from './keri/core/saider.ts';
31
+ export * from './keri/core/salter.ts';
32
+ export * from './keri/core/seqner.ts';
33
+ export * from './keri/core/serder.ts';
34
+ export * from './keri/core/siger.ts';
35
+ export * from './keri/core/signer.ts';
36
+ export * from './keri/core/tholder.ts';
37
+ export * from './keri/core/utils.ts';
38
+ export * from './keri/core/verfer.ts';
39
+ export * from './keri/core/keyState.ts';
40
+ export * from './keri/end/ending.ts';
@@ -0,0 +1,40 @@
1
+ export * from "./ready.js";
2
+ export * from "./keri/app/habery.js";
3
+ export * from "./keri/app/controller.js";
4
+ export * from "./keri/app/aiding.js";
5
+ export * from "./keri/app/clienting.js";
6
+ export * from "./keri/app/contacting.js";
7
+ export * from "./keri/app/coring.js";
8
+ export * from "./keri/app/credentialing.js";
9
+ export * from "./keri/app/escrowing.js";
10
+ export * from "./keri/app/exchanging.js";
11
+ export * from "./keri/app/grouping.js";
12
+ export * from "./keri/app/notifying.js";
13
+ export * from "./keri/core/authing.js";
14
+ export * from "./keri/core/cigar.js";
15
+ export * from "./keri/core/cipher.js";
16
+ export * from "./keri/core/core.js";
17
+ export * from "./keri/core/counter.js";
18
+ export * from "./keri/core/decrypter.js";
19
+ export * from "./keri/core/diger.js";
20
+ export * from "./keri/core/encrypter.js";
21
+ export * from "./keri/core/eventing.js";
22
+ export * from "./keri/core/httping.js";
23
+ export * from "./keri/core/indexer.js";
24
+ export * from "./keri/core/keeping.js";
25
+ export * from "./keri/core/kering.js";
26
+ export * from "./keri/core/manager.js";
27
+ export * from "./keri/core/matter.js";
28
+ export * from "./keri/core/number.js";
29
+ export * from "./keri/core/prefixer.js";
30
+ export * from "./keri/core/saider.js";
31
+ export * from "./keri/core/salter.js";
32
+ export * from "./keri/core/seqner.js";
33
+ export * from "./keri/core/serder.js";
34
+ export * from "./keri/core/siger.js";
35
+ export * from "./keri/core/signer.js";
36
+ export * from "./keri/core/tholder.js";
37
+ export * from "./keri/core/utils.js";
38
+ export * from "./keri/core/verfer.js";
39
+ export * from "./keri/core/keyState.js";
40
+ export * from "./keri/end/ending.js";
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import './buffer-polyfill';
2
- import * as exp from './exports';
3
- export * from './exports';
1
+ import * as exp from './exports.ts';
2
+ export * from './exports.ts';
4
3
  export default exp;
package/dist/index.js CHANGED
@@ -1,8 +1,3 @@
1
-
2
- 'use strict'
3
-
4
- if (process.env.NODE_ENV === 'production') {
5
- module.exports = require('./signify-ts.cjs.production.min.js')
6
- } else {
7
- module.exports = require('./signify-ts.cjs.development.js')
8
- }
1
+ import * as exp from "./exports.js";
2
+ export * from "./exports.js";
3
+ export default exp;
@@ -1,12 +1,14 @@
1
- import { Tier } from '../core/salter';
2
- import { Algos } from '../core/manager';
3
- import { Serder } from '../core/serder';
4
- import { KeyManager } from '../core/keeping';
1
+ import { Tier } from '../core/salter.ts';
2
+ import { Algos } from '../core/manager.ts';
3
+ import { Serder } from '../core/serder.ts';
4
+ import { IdentifierManagerFactory } from '../core/keeping.ts';
5
+ import { HabState } from '../core/keyState.ts';
6
+ import { components } from '../../types/keria-api-schema.ts';
5
7
  /** Arguments required to create an identfier */
6
8
  export interface CreateIdentiferArgs {
7
9
  transferable?: boolean;
8
- isith?: string | number | string[];
9
- nsith?: string | number | string[];
10
+ isith?: string | number | string[] | string[][];
11
+ nsith?: string | number | string[] | string[][];
10
12
  wits?: string[];
11
13
  toad?: number;
12
14
  proxy?: string;
@@ -19,9 +21,9 @@ export interface CreateIdentiferArgs {
19
21
  rstates?: any[];
20
22
  prxs?: any[];
21
23
  nxts?: any[];
22
- mhab?: any;
23
- keys?: any[];
24
- ndigs?: any[];
24
+ mhab?: HabState;
25
+ keys?: string[];
26
+ ndigs?: string[];
25
27
  bran?: string;
26
28
  count?: number;
27
29
  ncount?: number;
@@ -49,8 +51,21 @@ export interface RotateIdentifierArgs {
49
51
  export interface IdentifierDeps {
50
52
  fetch(pathname: string, method: string, body: unknown, headers?: Headers): Promise<Response>;
51
53
  pidx: number;
52
- manager: KeyManager | null;
54
+ manager: IdentifierManagerFactory | null;
55
+ }
56
+ /**
57
+ * Updatable information for a managed identifier
58
+ */
59
+ export interface IdentifierInfo {
60
+ name: string;
61
+ }
62
+ export interface LocSchemeArgs {
63
+ url: string;
64
+ scheme?: string;
65
+ eid?: string;
66
+ stamp?: string;
53
67
  }
68
+ export type GroupMembers = components['schemas']['GroupMember'];
54
69
  /** Identifier */
55
70
  export declare class Identifier {
56
71
  client: IdentifierDeps;
@@ -70,10 +85,18 @@ export declare class Identifier {
70
85
  /**
71
86
  * Get information for a managed identifier
72
87
  * @async
73
- * @param {string} name Name or alias of the identifier
74
- * @returns {Promise<any>} A promise to the identifier information
88
+ * @param {string} name Prefix or alias of the identifier
89
+ * @returns {Promise<HabState>} A promise to the identifier information
75
90
  */
76
- get(name: string): Promise<any>;
91
+ get(name: string): Promise<HabState>;
92
+ /**
93
+ * Update managed identifier
94
+ * @async
95
+ * @param {string} name Prefix or alias of the identifier
96
+ * @param {IdentifierInfo} info Information to update for the given identifier
97
+ * @returns {Promise<HabState>} A promise to the identifier information after updating
98
+ */
99
+ update(name: string, info: IdentifierInfo): Promise<HabState>;
77
100
  /**
78
101
  * Create a managed identifier
79
102
  * @async
@@ -85,11 +108,16 @@ export declare class Identifier {
85
108
  /**
86
109
  * Generate an interaction event in a managed identifier
87
110
  * @async
88
- * @param {string} name Name or alias of the identifier
111
+ * @param {string} name Prefix or alias of the identifier
89
112
  * @param {any} [data] Option data to be anchored in the interaction event
90
113
  * @returns {Promise<EventResult>} A promise to the interaction event result
91
114
  */
92
115
  interact(name: string, data?: any): Promise<EventResult>;
116
+ createInteract(name: string, data?: any): Promise<{
117
+ serder: any;
118
+ sigs: any;
119
+ jsondata: any;
120
+ }>;
93
121
  /**
94
122
  * Generate a rotation event in a managed identifier
95
123
  * @param {string} name Name or alias of the identifier
@@ -118,20 +146,28 @@ export declare class Identifier {
118
146
  * @returns {Serder} The reply message
119
147
  */
120
148
  private makeEndRole;
149
+ /**
150
+ * Authorises a new location scheme (endpoint) for a particular endpoint identifier.
151
+ * @param {LocSchemeArgs} args
152
+ * @param name Name or alias of the identifier to sign reply message
153
+ * @param args Arguments to create authorising reply message from
154
+ * @returns A promise to the result of the authorization
155
+ */
156
+ addLocScheme(name: string, args: LocSchemeArgs): Promise<EventResult>;
121
157
  /**
122
158
  * Get the members of a group identifier
123
159
  * @async
124
160
  * @param {string} name - Name or alias of the identifier
125
- * @returns {Promise<any>} - A promise to the list of members
161
+ * @returns {Promise<GroupMembers>} - A promise to the list of members
126
162
  */
127
- members(name: string): Promise<any>;
163
+ members(name: string): Promise<GroupMembers>;
128
164
  }
129
165
  /** Event Result */
130
166
  export declare class EventResult {
131
167
  private readonly _serder;
132
168
  private readonly _sigs;
133
- private readonly promise;
134
- constructor(serder: Serder, sigs: string[], promise: Promise<Response> | Response);
169
+ private readonly response;
170
+ constructor(serder: Serder, sigs: string[], response: Response);
135
171
  get serder(): Serder;
136
172
  get sigs(): string[];
137
173
  op(): Promise<any>;