signify-ts 0.3.0-rc1 → 0.3.0

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 (121) hide show
  1. package/README.md +62 -14
  2. package/dist/exports.d.ts +40 -40
  3. package/dist/exports.js +40 -0
  4. package/dist/index.d.ts +2 -2
  5. package/dist/index.js +3 -0
  6. package/dist/keri/app/aiding.d.ts +26 -10
  7. package/{src/keri/app/aiding.ts → dist/keri/app/aiding.js} +100 -235
  8. package/dist/keri/app/clienting.d.ts +37 -15
  9. package/{src/keri/app/clienting.ts → dist/keri/app/clienting.js} +122 -208
  10. package/dist/keri/app/contacting.d.ts +10 -15
  11. package/{src/keri/app/contacting.ts → dist/keri/app/contacting.js} +14 -66
  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 +114 -29
  15. package/{src/keri/app/coring.ts → dist/keri/app/coring.js} +54 -105
  16. package/dist/keri/app/credentialing.d.ts +34 -50
  17. package/dist/keri/app/credentialing.js +540 -0
  18. package/dist/keri/app/delegating.d.ts +2 -2
  19. package/{src/keri/app/delegating.ts → dist/keri/app/delegating.js} +5 -14
  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 +241 -10
  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 +1 -1
  29. package/{src/keri/app/notifying.ts → dist/keri/app/notifying.js} +5 -15
  30. package/dist/keri/core/authing.d.ts +2 -2
  31. package/{src/keri/core/authing.ts → dist/keri/core/authing.js} +23 -46
  32. package/dist/keri/core/base64.d.ts +2 -4
  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} +17 -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 +115 -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/{src/keri/core/eventing.ts → dist/keri/core/eventing.js} +130 -328
  52. package/dist/keri/core/httping.d.ts +9 -4
  53. package/{src/keri/core/httping.ts → dist/keri/core/httping.js} +34 -102
  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 +77 -29
  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/keyState.js +1 -0
  61. package/dist/keri/core/manager.d.ts +147 -12
  62. package/dist/keri/core/manager.js +880 -0
  63. package/dist/keri/core/matter.d.ts +1 -1
  64. package/dist/keri/core/matter.js +460 -0
  65. package/dist/keri/core/number.d.ts +2 -2
  66. package/{src/keri/core/number.ts → dist/keri/core/number.js} +25 -31
  67. package/dist/keri/core/pather.d.ts +2 -2
  68. package/{src/keri/core/pather.ts → dist/keri/core/pather.js} +12 -27
  69. package/dist/keri/core/prefixer.d.ts +10 -10
  70. package/{src/keri/core/prefixer.ts → dist/keri/core/prefixer.js} +71 -122
  71. package/dist/keri/core/saider.d.ts +2 -13
  72. package/dist/keri/core/saider.js +107 -0
  73. package/dist/keri/core/salter.d.ts +44 -9
  74. package/dist/keri/core/salter.js +110 -0
  75. package/dist/keri/core/seqner.d.ts +1 -1
  76. package/{src/keri/core/seqner.ts → dist/keri/core/seqner.js} +20 -21
  77. package/dist/keri/core/serder.d.ts +25 -12
  78. package/dist/keri/core/serder.js +133 -0
  79. package/dist/keri/core/siger.d.ts +2 -2
  80. package/{src/keri/core/siger.ts → dist/keri/core/siger.js} +4 -14
  81. package/dist/keri/core/signer.d.ts +4 -4
  82. package/dist/keri/core/signer.js +84 -0
  83. package/{src/keri/core/tholder.ts → dist/keri/core/tholder.js} +65 -89
  84. package/dist/keri/core/utils.d.ts +1 -1
  85. package/{src/keri/core/utils.ts → dist/keri/core/utils.js} +30 -60
  86. package/dist/keri/core/vdring.d.ts +2 -2
  87. package/dist/keri/core/vdring.js +61 -0
  88. package/dist/keri/core/verfer.d.ts +2 -6
  89. package/dist/keri/core/verfer.js +37 -0
  90. package/dist/keri/end/ending.d.ts +2 -2
  91. package/dist/keri/end/ending.js +136 -0
  92. package/{src/ready.ts → dist/ready.js} +1 -2
  93. package/dist/types/keria-api-schema.d.ts +1158 -0
  94. package/dist/types/keria-api-schema.js +34 -0
  95. package/package.json +29 -51
  96. package/dist/keri/core/state.d.ts +0 -62
  97. package/dist/signify-ts.cjs +0 -7980
  98. package/dist/signify-ts.cjs.map +0 -7
  99. package/dist/signify-ts.mjs +0 -7956
  100. package/dist/signify-ts.mjs.map +0 -7
  101. package/src/exports.ts +0 -44
  102. package/src/index.ts +0 -3
  103. package/src/keri/app/credentialing.ts +0 -1005
  104. package/src/keri/app/exchanging.ts +0 -223
  105. package/src/keri/app/habery.ts +0 -185
  106. package/src/keri/core/base64.ts +0 -28
  107. package/src/keri/core/cigar.ts +0 -18
  108. package/src/keri/core/core.ts +0 -328
  109. package/src/keri/core/counter.ts +0 -273
  110. package/src/keri/core/indexer.ts +0 -509
  111. package/src/keri/core/keeping.ts +0 -722
  112. package/src/keri/core/manager.ts +0 -1183
  113. package/src/keri/core/matter.ts +0 -521
  114. package/src/keri/core/saider.ts +0 -186
  115. package/src/keri/core/salter.ts +0 -120
  116. package/src/keri/core/serder.ts +0 -163
  117. package/src/keri/core/signer.ts +0 -133
  118. package/src/keri/core/state.ts +0 -69
  119. package/src/keri/core/vdring.ts +0 -94
  120. package/src/keri/core/verfer.ts +0 -47
  121. package/src/keri/end/ending.ts +0 -167
package/README.md CHANGED
@@ -30,22 +30,36 @@ encoded strings for the initial implementation. Support for binary CESR can be a
30
30
 
31
31
  The code is built using Typescript and running code locally requires a Mac or Linux OS.
32
32
 
33
- - Install [Node.js](https://nodejs.org)
33
+ - Install [Node.js](https://nodejs.org)
34
34
 
35
- - Install dependencies:
35
+ - Install dependencies:
36
36
  ```bash
37
37
  npm install
38
38
  ```
39
39
 
40
40
  Typescript source files needs to be transpiled before running scripts or integration tests
41
41
 
42
- - 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:
43
57
 
44
58
  ```bash
45
59
  npm run build
46
60
  ```
47
61
 
48
- - ready() must be called before library is useable. Example minimum viable client code.
62
+ - ready() must be called before library is useable. Example minimum viable client code.
49
63
 
50
64
  ```javascript
51
65
  import { randomPasscode, ready, SignifyClient, Tier } from 'signify-ts';
@@ -81,7 +95,7 @@ The integration tests depends on a local instance of KERIA, vLEI-Server and Witn
81
95
  docker compose up --wait
82
96
  ```
83
97
 
84
- If successful, it should print someting like this:
98
+ If successful, it should print something like this:
85
99
 
86
100
  ```bash
87
101
  $ docker compose up --wait
@@ -108,28 +122,22 @@ docker compose pull
108
122
  docker compose up --wait
109
123
  ```
110
124
 
111
- **Important!** The integration tests runs on the build output in `dist/` directory. Make sure to run build before running the integration tests.
112
-
113
- ```bash
114
- npm run build
115
- ```
116
-
117
125
  Use the npm script "test:integration" to run all integration tests in sequence:
118
126
 
119
127
  ```bash
120
128
  npm run test:integration
121
129
  ```
122
130
 
123
- Or, use execute `jest` directly to run a specific integration test, for example:
131
+ To execute a specific integration test, you can use:
124
132
 
125
133
  ```bash
126
- npx jest examples/integration-scripts/credentials.test.ts
134
+ npm run test:integration -- test-integration/credentials.test.ts
127
135
  ```
128
136
 
129
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:
130
138
 
131
139
  ```
132
- TEST_ENVIRONMENT=local npx jest examples/integration-scripts/credentials.test.ts
140
+ TEST_ENVIRONMENT=local npm run test:integration test-integration/credentials.test.ts
133
141
  ```
134
142
 
135
143
  This changes the discovery urls to use `localhost` instead of the hostnames inside the docker network.
@@ -141,3 +149,43 @@ Account Creation Workflow
141
149
  ![Account Creation](/diagrams/account-creation-workflow.png)
142
150
 
143
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 './keri/app/habery';
3
- export * from './keri/app/controller';
4
- export * from './keri/app/aiding';
5
- export * from './keri/app/clienting';
6
- export * from './keri/app/contacting';
7
- export * from './keri/app/coring';
8
- export * from './keri/app/credentialing';
9
- export * from './keri/app/escrowing';
10
- export * from './keri/app/exchanging';
11
- export * from './keri/app/grouping';
12
- export * from './keri/app/notifying';
13
- export * from './keri/core/authing';
14
- export * from './keri/core/cigar';
15
- export * from './keri/core/cipher';
16
- export * from './keri/core/core';
17
- export * from './keri/core/counter';
18
- export * from './keri/core/decrypter';
19
- export * from './keri/core/diger';
20
- export * from './keri/core/encrypter';
21
- export * from './keri/core/eventing';
22
- export * from './keri/core/httping';
23
- export * from './keri/core/indexer';
24
- export * from './keri/core/keeping';
25
- export * from './keri/core/kering';
26
- export * from './keri/core/manager';
27
- export * from './keri/core/matter';
28
- export * from './keri/core/number';
29
- export * from './keri/core/prefixer';
30
- export * from './keri/core/saider';
31
- export * from './keri/core/salter';
32
- export * from './keri/core/seqner';
33
- export * from './keri/core/serder';
34
- export * from './keri/core/siger';
35
- export * from './keri/core/signer';
36
- export * from './keri/core/tholder';
37
- export * from './keri/core/utils';
38
- export * from './keri/core/verfer';
39
- export * from './keri/core/state';
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,3 +1,3 @@
1
- import * as exp from './exports';
2
- export * from './exports';
1
+ import * as exp from './exports.ts';
2
+ export * from './exports.ts';
3
3
  export default exp;
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ import * as exp from "./exports.js";
2
+ export * from "./exports.js";
3
+ export default exp;
@@ -1,13 +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';
5
- import { HabState } from '../core/state';
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';
6
7
  /** Arguments required to create an identfier */
7
8
  export interface CreateIdentiferArgs {
8
9
  transferable?: boolean;
9
- isith?: string | number | string[];
10
- nsith?: string | number | string[];
10
+ isith?: string | number | string[] | string[][];
11
+ nsith?: string | number | string[] | string[][];
11
12
  wits?: string[];
12
13
  toad?: number;
13
14
  proxy?: string;
@@ -50,7 +51,7 @@ export interface RotateIdentifierArgs {
50
51
  export interface IdentifierDeps {
51
52
  fetch(pathname: string, method: string, body: unknown, headers?: Headers): Promise<Response>;
52
53
  pidx: number;
53
- manager: KeyManager | null;
54
+ manager: IdentifierManagerFactory | null;
54
55
  }
55
56
  /**
56
57
  * Updatable information for a managed identifier
@@ -58,6 +59,13 @@ export interface IdentifierDeps {
58
59
  export interface IdentifierInfo {
59
60
  name: string;
60
61
  }
62
+ export interface LocSchemeArgs {
63
+ url: string;
64
+ scheme?: string;
65
+ eid?: string;
66
+ stamp?: string;
67
+ }
68
+ export type GroupMembers = components['schemas']['GroupMember'];
61
69
  /** Identifier */
62
70
  export declare class Identifier {
63
71
  client: IdentifierDeps;
@@ -138,13 +146,21 @@ export declare class Identifier {
138
146
  * @returns {Serder} The reply message
139
147
  */
140
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>;
141
157
  /**
142
158
  * Get the members of a group identifier
143
159
  * @async
144
160
  * @param {string} name - Name or alias of the identifier
145
- * @returns {Promise<any>} - A promise to the list of members
161
+ * @returns {Promise<GroupMembers>} - A promise to the list of members
146
162
  */
147
- members(name: string): Promise<any>;
163
+ members(name: string): Promise<GroupMembers>;
148
164
  }
149
165
  /** Event Result */
150
166
  export declare class EventResult {