@learncard/network-plugin 2.14.0 → 3.0.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.
- package/README.md +12 -0
- package/dist/inbox-batch.d.ts +5 -0
- package/dist/inbox-batch.d.ts.map +1 -0
- package/dist/inbox-batch.test.d.ts +2 -0
- package/dist/inbox-batch.test.d.ts.map +1 -0
- package/dist/lcn-plugin.cjs.development.cjs +670 -246
- package/dist/lcn-plugin.cjs.development.cjs.map +4 -4
- package/dist/lcn-plugin.cjs.production.min.cjs +36 -36
- package/dist/lcn-plugin.cjs.production.min.cjs.map +4 -4
- package/dist/lcn-plugin.esm.js +672 -246
- package/dist/lcn-plugin.esm.js.map +4 -4
- package/dist/plugin.d.ts +11 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/test/act-as.test.d.ts +2 -0
- package/dist/test/act-as.test.d.ts.map +1 -0
- package/dist/test/refresh-send.test-d.d.ts +2 -0
- package/dist/test/refresh-send.test-d.d.ts.map +1 -0
- package/dist/test/refresh-send.test.d.ts +2 -0
- package/dist/test/refresh-send.test.d.ts.map +1 -0
- package/dist/test/verify-boost-regression.test.d.ts +2 -0
- package/dist/test/verify-boost-regression.test.d.ts.map +1 -0
- package/dist/types.d.ts +93 -19
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/inbox-batch.test.ts +105 -0
- package/src/inbox-batch.ts +66 -0
- package/src/plugin.ts +377 -63
- package/src/test/act-as.test.ts +323 -0
- package/src/test/index.test.ts +161 -10
- package/src/test/refresh-send.test-d.ts +152 -0
- package/src/test/refresh-send.test.ts +646 -0
- package/src/test/verify-boost-regression.test.ts +167 -0
- package/src/types.ts +118 -22
package/README.md
CHANGED
|
@@ -33,6 +33,18 @@ import { initLearnCard } from '@learncard/core';
|
|
|
33
33
|
const wallet = await initLearnCard({ seed: 'a'.repeat(64) });
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
+
### Acting as a Managed Profile
|
|
37
|
+
|
|
38
|
+
Pass `actAs` (a managed profile ID or `did:web`) to `getLearnCardNetworkPlugin`/`initLearnCard` to
|
|
39
|
+
send every network request on behalf of a profile you manage, via the `X-LearnCard-Act-As` header.
|
|
40
|
+
Token scope is unchanged, and the server returns `403` if you don't manage that profile.
|
|
41
|
+
|
|
42
|
+
```js
|
|
43
|
+
const wallet = await initLearnCard({ seed: 'a'.repeat(64), network: true, actAs: childProfileId });
|
|
44
|
+
// or, from an existing wallet:
|
|
45
|
+
const asChild = await wallet.invoke.actAs(childProfileId);
|
|
46
|
+
```
|
|
47
|
+
|
|
36
48
|
### Issuing/Verifying Credentials and Presentations
|
|
37
49
|
|
|
38
50
|
#### Issue a credential
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { InboxBatchStatus } from '@learncard/types';
|
|
2
|
+
import type { WaitForInboxCredentialBatchOptions } from './types';
|
|
3
|
+
/** Poll without resubmitting. Timeout/abort stops waiting; the durable job keeps running. */
|
|
4
|
+
export declare const waitForInboxCredentialBatch: (read: (signal: AbortSignal) => Promise<InboxBatchStatus>, options?: WaitForInboxCredentialBatchOptions) => Promise<InboxBatchStatus>;
|
|
5
|
+
//# sourceMappingURL=inbox-batch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inbox-batch.d.ts","sourceRoot":"","sources":["../src/inbox-batch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,SAAS,CAAC;AAElE,6FAA6F;AAC7F,eAAO,MAAM,2BAA2B,GACpC,MAAM,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,gBAAgB,CAAC,EACxD,UAAS,kCAAuC,KACjD,OAAO,CAAC,gBAAgB,CA0D1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inbox-batch.test.d.ts","sourceRoot":"","sources":["../src/inbox-batch.test.ts"],"names":[],"mappings":""}
|