@pryv/delegation 3.12.1 → 3.14.2
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/package.json +1 -1
- package/src/index.d.ts +3 -1
- package/src/index.js +8 -1
- package/test/delegation.test.js +1 -0
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -26,7 +26,8 @@ declare module '@pryv/delegation' {
|
|
|
26
26
|
| 'delegation-unknown-core'
|
|
27
27
|
| 'delegation-creation-failed'
|
|
28
28
|
| 'delegation-personal-token-required'
|
|
29
|
-
| 'delegation-mirror-not-stale'
|
|
29
|
+
| 'delegation-mirror-not-stale'
|
|
30
|
+
| 'delegation-grant-requires-owner';
|
|
30
31
|
|
|
31
32
|
export const errorIds: {
|
|
32
33
|
readonly CLIENTDATA_FORBIDDEN: 'delegation-clientdata-forbidden';
|
|
@@ -46,6 +47,7 @@ declare module '@pryv/delegation' {
|
|
|
46
47
|
readonly CREATION_FAILED: 'delegation-creation-failed';
|
|
47
48
|
readonly PERSONAL_TOKEN_REQUIRED: 'delegation-personal-token-required';
|
|
48
49
|
readonly MIRROR_NOT_STALE: 'delegation-mirror-not-stale';
|
|
50
|
+
readonly GRANT_REQUIRES_OWNER: 'delegation-grant-requires-owner';
|
|
49
51
|
};
|
|
50
52
|
|
|
51
53
|
/** Typed delegation failure surfaced by {@link Delegation} methods. */
|
package/src/index.js
CHANGED
|
@@ -76,7 +76,14 @@ const errorIds = Object.freeze({
|
|
|
76
76
|
UNKNOWN_CORE: 'delegation-unknown-core',
|
|
77
77
|
CREATION_FAILED: 'delegation-creation-failed',
|
|
78
78
|
PERSONAL_TOKEN_REQUIRED: 'delegation-personal-token-required',
|
|
79
|
-
MIRROR_NOT_STALE: 'delegation-mirror-not-stale'
|
|
79
|
+
MIRROR_NOT_STALE: 'delegation-mirror-not-stale',
|
|
80
|
+
/**
|
|
81
|
+
* A delegate token, or an access granted through the delegation, tried to
|
|
82
|
+
* create a durable grant on the controlled account through a path that
|
|
83
|
+
* records no delegation lineage (CMC consent accept / scope update /
|
|
84
|
+
* request). Only the account owner can.
|
|
85
|
+
*/
|
|
86
|
+
GRANT_REQUIRES_OWNER: 'delegation-grant-requires-owner'
|
|
80
87
|
});
|
|
81
88
|
|
|
82
89
|
const DELEGATION_ID_VALUES = new Set(Object.values(errorIds));
|
package/test/delegation.test.js
CHANGED
|
@@ -61,6 +61,7 @@ describe('[DELX] @pryv/delegation Level-0 surface', function () {
|
|
|
61
61
|
it('[DELXEA] is frozen + mirrors the server delegation-* ids', function () {
|
|
62
62
|
expect(errorIds).to.be.frozen;
|
|
63
63
|
expect(errorIds.GENUINE_LOGIN_REQUIRED).to.equal('delegation-genuine-login-required');
|
|
64
|
+
expect(errorIds.GRANT_REQUIRES_OWNER).to.equal('delegation-grant-requires-owner');
|
|
64
65
|
expect(errorIds.NOT_ACTIVE).to.equal('delegation-not-active');
|
|
65
66
|
expect(errorIds.ALREADY_EXISTS).to.equal('delegation-already-exists');
|
|
66
67
|
expect(errorIds.USERNAME_TAKEN).to.equal('delegation-username-taken');
|