@reclaimprotocol/client 0.1.38 → 0.1.40
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/lib/launch/extension.js +7 -3
- package/lib/routes.gen.d.ts +4 -0
- package/lib/routes.gen.js +2 -1
- package/lib/types/openapi.gen.d.ts +40 -1
- package/lib/types/openapi.gen.js +1 -1
- package/package.json +1 -1
- package/src/launch/extension.ts +8 -3
- package/src/routes.gen.ts +2 -1
- package/src/types/openapi.gen.ts +41 -2
package/lib/launch/extension.js
CHANGED
|
@@ -2,6 +2,10 @@ export const RECLAIM_EXTENSION_CHECK = 'RECLAIM_EXTENSION_CHECK';
|
|
|
2
2
|
export const RECLAIM_EXTENSION_RESPONSE = 'RECLAIM_EXTENSION_RESPONSE';
|
|
3
3
|
export const RECLAIM_START_VERIFICATION = 'RECLAIM_START_VERIFICATION';
|
|
4
4
|
export const RECLAIM_CANCEL_VERIFICATION = 'RECLAIM_CANCEL_VERIFICATION';
|
|
5
|
+
/** `postMessage` target for the page's own window, where the extension's
|
|
6
|
+
* content script listens: only a receiver on this page's origin gets the
|
|
7
|
+
* session id, never a frame or opener on another origin. */
|
|
8
|
+
const SAME_ORIGIN = '/';
|
|
5
9
|
function isRecord(value) {
|
|
6
10
|
return typeof value === 'object' && value !== null;
|
|
7
11
|
}
|
|
@@ -39,7 +43,7 @@ export function probeExtension(env, options = {}) {
|
|
|
39
43
|
action: RECLAIM_EXTENSION_CHECK,
|
|
40
44
|
extensionID: options.extensionID,
|
|
41
45
|
messageId,
|
|
42
|
-
},
|
|
46
|
+
}, SAME_ORIGIN);
|
|
43
47
|
});
|
|
44
48
|
}
|
|
45
49
|
/** Hands the session off to the extension. No navigation, no return value —
|
|
@@ -57,7 +61,7 @@ export function sendExtensionStartVerification(env, handoff) {
|
|
|
57
61
|
...(handoff.diag ? { diagnosticMode: true } : {}),
|
|
58
62
|
},
|
|
59
63
|
},
|
|
60
|
-
},
|
|
64
|
+
}, SAME_ORIGIN);
|
|
61
65
|
}
|
|
62
66
|
/** Tears down the extension's in-progress verification UI. This is what
|
|
63
67
|
* `FlowHandle.close()` does for the extension-handoff mechanism — there's
|
|
@@ -68,5 +72,5 @@ export function sendExtensionCancelVerification(env, handoff) {
|
|
|
68
72
|
action: RECLAIM_CANCEL_VERIFICATION,
|
|
69
73
|
messageId: handoff.sessionId,
|
|
70
74
|
extensionID: handoff.extensionID,
|
|
71
|
-
},
|
|
75
|
+
}, SAME_ORIGIN);
|
|
72
76
|
}
|
package/lib/routes.gen.d.ts
CHANGED
|
@@ -667,6 +667,10 @@ export declare const ROUTES: {
|
|
|
667
667
|
readonly method: "put";
|
|
668
668
|
readonly path: "/orgs/{orgId}/icon";
|
|
669
669
|
};
|
|
670
|
+
readonly UpdateOrgKeypair: {
|
|
671
|
+
readonly method: "patch";
|
|
672
|
+
readonly path: "/orgs/{orgId}/keypair";
|
|
673
|
+
};
|
|
670
674
|
readonly UpdateOrgMember: {
|
|
671
675
|
readonly method: "patch";
|
|
672
676
|
readonly path: "/orgs/{orgId}/members/{memberId}";
|
package/lib/routes.gen.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// AUTO-GENERATED by packages/app/scripts/mcp-tools-gen.ts
|
|
2
|
-
// from packages/app/openapi.yaml (spec v0.1.0, source sha256:
|
|
2
|
+
// from packages/app/openapi.yaml (spec v0.1.0, source sha256:ecdb0ee6d82e).
|
|
3
3
|
// The hash catches drift the version misses (a spec can change without a
|
|
4
4
|
// version bump) — do not remove it as "redundant" with the version.
|
|
5
5
|
// Run `npm run openapi:gen --workspace=packages/app` to regenerate. Do not edit by hand.
|
|
@@ -171,6 +171,7 @@ export const ROUTES = {
|
|
|
171
171
|
"UpdateFeatureFlag": { "method": "put", "path": "/admin/feature-flags/{flagKey}" },
|
|
172
172
|
"UpdateOrg": { "method": "patch", "path": "/orgs/{orgId}" },
|
|
173
173
|
"UpdateOrgIcon": { "method": "put", "path": "/orgs/{orgId}/icon" },
|
|
174
|
+
"UpdateOrgKeypair": { "method": "patch", "path": "/orgs/{orgId}/keypair" },
|
|
174
175
|
"UpdateOrgMember": { "method": "patch", "path": "/orgs/{orgId}/members/{memberId}" },
|
|
175
176
|
"UpdateProvider": { "method": "patch", "path": "/providers/{providerId}" },
|
|
176
177
|
"UpdateProviderContributionCampaign": { "method": "patch", "path": "/providers/{providerId}/contributions/{campaignId}" },
|
|
@@ -1789,7 +1789,11 @@ export interface paths {
|
|
|
1789
1789
|
delete: operations["DeleteOrgKeypair"];
|
|
1790
1790
|
options?: never;
|
|
1791
1791
|
head?: never;
|
|
1792
|
-
|
|
1792
|
+
/**
|
|
1793
|
+
* Turn result encryption on or off
|
|
1794
|
+
* @description Turns result encryption on or off for the organization's existing keypair. The call changes only `canEncryptResult`. It keeps the key, eth address, and label. Returns `404` when the organization has no keypair. Authenticated by the org's `OrgToken` or a human `BearerAuth` session for an active member of the org.
|
|
1795
|
+
*/
|
|
1796
|
+
patch: operations["UpdateOrgKeypair"];
|
|
1793
1797
|
trace?: never;
|
|
1794
1798
|
};
|
|
1795
1799
|
"/orgs/{orgId}/token": {
|
|
@@ -4025,6 +4029,11 @@ export interface components {
|
|
|
4025
4029
|
updateMetadata: components["schemas"]["ActorMetadata"];
|
|
4026
4030
|
};
|
|
4027
4031
|
OrgKeypairRequest: components["schemas"]["OrgKeypairHexRequest"] | components["schemas"]["OrgKeypairJwkRequest"];
|
|
4032
|
+
/** @description Body for `PATCH /orgs/{orgId}/keypair`. */
|
|
4033
|
+
OrgKeypairUpdateRequest: {
|
|
4034
|
+
/** @description Set to true to encrypt results to the organization's public key. Set to false to deliver results as plaintext. */
|
|
4035
|
+
canEncryptResult: boolean;
|
|
4036
|
+
};
|
|
4028
4037
|
/** @description Body for `PUT /orgs/{orgId}/keypair`. Carries the org's eth public key as an uncompressed hex string (`0x04` + 128 hex) — the eth-native form wallets/ethers emit. The matching private key never leaves the consumer. */
|
|
4029
4038
|
OrgKeypairHexRequest: {
|
|
4030
4039
|
/** @description Uncompressed secp256k1 public key, `0x04` + 128 hex. */
|
|
@@ -9556,6 +9565,36 @@ export interface operations {
|
|
|
9556
9565
|
default: components["responses"]["ProblemResponse"];
|
|
9557
9566
|
};
|
|
9558
9567
|
};
|
|
9568
|
+
UpdateOrgKeypair: {
|
|
9569
|
+
parameters: {
|
|
9570
|
+
query?: never;
|
|
9571
|
+
header?: never;
|
|
9572
|
+
path: {
|
|
9573
|
+
orgId: components["schemas"]["OrgID"];
|
|
9574
|
+
};
|
|
9575
|
+
cookie?: never;
|
|
9576
|
+
};
|
|
9577
|
+
requestBody: {
|
|
9578
|
+
content: {
|
|
9579
|
+
"application/json": components["schemas"]["OrgKeypairUpdateRequest"];
|
|
9580
|
+
};
|
|
9581
|
+
};
|
|
9582
|
+
responses: {
|
|
9583
|
+
/** @description Updated */
|
|
9584
|
+
200: {
|
|
9585
|
+
headers: {
|
|
9586
|
+
[name: string]: unknown;
|
|
9587
|
+
};
|
|
9588
|
+
content: {
|
|
9589
|
+
"application/json": components["schemas"]["OrgKeypair"];
|
|
9590
|
+
};
|
|
9591
|
+
};
|
|
9592
|
+
400: components["responses"]["ProblemResponse"];
|
|
9593
|
+
403: components["responses"]["ForbiddenResponse"];
|
|
9594
|
+
404: components["responses"]["ProblemResponse"];
|
|
9595
|
+
default: components["responses"]["ProblemResponse"];
|
|
9596
|
+
};
|
|
9597
|
+
};
|
|
9559
9598
|
ListOrgTokens: {
|
|
9560
9599
|
parameters: {
|
|
9561
9600
|
query?: never;
|
package/lib/types/openapi.gen.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// AUTO-GENERATED by packages/app/scripts/openapi-typegen.ts
|
|
2
|
-
// from packages/app/openapi.yaml (spec v0.1.0, source sha256:
|
|
2
|
+
// from packages/app/openapi.yaml (spec v0.1.0, source sha256:ecdb0ee6d82e).
|
|
3
3
|
// The hash catches drift the version misses (a spec can change without a
|
|
4
4
|
// version bump) — do not remove it as "redundant" with the version.
|
|
5
5
|
// Run `npm run openapi:gen --workspace=packages/app` to regenerate. Do not edit by hand.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reclaimprotocol/client",
|
|
3
3
|
"title": "Reclaim Client",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.40",
|
|
5
5
|
"description": "Typed SDK/HTTP client SDK for the Reclaim Protocol — the programmatic way to use Reclaim Protocol to verify **data points** about your users (a follower count, an account balance, an order). Can be directly integrated by apps to request verification for their users using Reclaim Protocol and verify the results.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": false,
|
package/src/launch/extension.ts
CHANGED
|
@@ -27,6 +27,11 @@ export interface ExtensionHandoff {
|
|
|
27
27
|
extensionID?: string
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
/** `postMessage` target for the page's own window, where the extension's
|
|
31
|
+
* content script listens: only a receiver on this page's origin gets the
|
|
32
|
+
* session id, never a frame or opener on another origin. */
|
|
33
|
+
const SAME_ORIGIN = '/'
|
|
34
|
+
|
|
30
35
|
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
31
36
|
return typeof value === 'object' && value !== null
|
|
32
37
|
}
|
|
@@ -76,7 +81,7 @@ export function probeExtension(
|
|
|
76
81
|
extensionID: options.extensionID,
|
|
77
82
|
messageId,
|
|
78
83
|
},
|
|
79
|
-
|
|
84
|
+
SAME_ORIGIN,
|
|
80
85
|
)
|
|
81
86
|
})
|
|
82
87
|
}
|
|
@@ -101,7 +106,7 @@ export function sendExtensionStartVerification(
|
|
|
101
106
|
},
|
|
102
107
|
},
|
|
103
108
|
},
|
|
104
|
-
|
|
109
|
+
SAME_ORIGIN,
|
|
105
110
|
)
|
|
106
111
|
}
|
|
107
112
|
|
|
@@ -119,6 +124,6 @@ export function sendExtensionCancelVerification(
|
|
|
119
124
|
messageId: handoff.sessionId,
|
|
120
125
|
extensionID: handoff.extensionID,
|
|
121
126
|
},
|
|
122
|
-
|
|
127
|
+
SAME_ORIGIN,
|
|
123
128
|
)
|
|
124
129
|
}
|
package/src/routes.gen.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// AUTO-GENERATED by packages/app/scripts/mcp-tools-gen.ts
|
|
2
|
-
// from packages/app/openapi.yaml (spec v0.1.0, source sha256:
|
|
2
|
+
// from packages/app/openapi.yaml (spec v0.1.0, source sha256:ecdb0ee6d82e).
|
|
3
3
|
// The hash catches drift the version misses (a spec can change without a
|
|
4
4
|
// version bump) — do not remove it as "redundant" with the version.
|
|
5
5
|
// Run `npm run openapi:gen --workspace=packages/app` to regenerate. Do not edit by hand.
|
|
@@ -172,6 +172,7 @@ export const ROUTES = {
|
|
|
172
172
|
"UpdateFeatureFlag": {"method":"put","path":"/admin/feature-flags/{flagKey}"},
|
|
173
173
|
"UpdateOrg": {"method":"patch","path":"/orgs/{orgId}"},
|
|
174
174
|
"UpdateOrgIcon": {"method":"put","path":"/orgs/{orgId}/icon"},
|
|
175
|
+
"UpdateOrgKeypair": {"method":"patch","path":"/orgs/{orgId}/keypair"},
|
|
175
176
|
"UpdateOrgMember": {"method":"patch","path":"/orgs/{orgId}/members/{memberId}"},
|
|
176
177
|
"UpdateProvider": {"method":"patch","path":"/providers/{providerId}"},
|
|
177
178
|
"UpdateProviderContributionCampaign": {"method":"patch","path":"/providers/{providerId}/contributions/{campaignId}"},
|
package/src/types/openapi.gen.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// AUTO-GENERATED by packages/app/scripts/openapi-typegen.ts
|
|
2
|
-
// from packages/app/openapi.yaml (spec v0.1.0, source sha256:
|
|
2
|
+
// from packages/app/openapi.yaml (spec v0.1.0, source sha256:ecdb0ee6d82e).
|
|
3
3
|
// The hash catches drift the version misses (a spec can change without a
|
|
4
4
|
// version bump) — do not remove it as "redundant" with the version.
|
|
5
5
|
// Run `npm run openapi:gen --workspace=packages/app` to regenerate. Do not edit by hand.
|
|
@@ -1795,7 +1795,11 @@ export interface paths {
|
|
|
1795
1795
|
delete: operations["DeleteOrgKeypair"];
|
|
1796
1796
|
options?: never;
|
|
1797
1797
|
head?: never;
|
|
1798
|
-
|
|
1798
|
+
/**
|
|
1799
|
+
* Turn result encryption on or off
|
|
1800
|
+
* @description Turns result encryption on or off for the organization's existing keypair. The call changes only `canEncryptResult`. It keeps the key, eth address, and label. Returns `404` when the organization has no keypair. Authenticated by the org's `OrgToken` or a human `BearerAuth` session for an active member of the org.
|
|
1801
|
+
*/
|
|
1802
|
+
patch: operations["UpdateOrgKeypair"];
|
|
1799
1803
|
trace?: never;
|
|
1800
1804
|
};
|
|
1801
1805
|
"/orgs/{orgId}/token": {
|
|
@@ -4031,6 +4035,11 @@ export interface components {
|
|
|
4031
4035
|
updateMetadata: components["schemas"]["ActorMetadata"];
|
|
4032
4036
|
};
|
|
4033
4037
|
OrgKeypairRequest: components["schemas"]["OrgKeypairHexRequest"] | components["schemas"]["OrgKeypairJwkRequest"];
|
|
4038
|
+
/** @description Body for `PATCH /orgs/{orgId}/keypair`. */
|
|
4039
|
+
OrgKeypairUpdateRequest: {
|
|
4040
|
+
/** @description Set to true to encrypt results to the organization's public key. Set to false to deliver results as plaintext. */
|
|
4041
|
+
canEncryptResult: boolean;
|
|
4042
|
+
};
|
|
4034
4043
|
/** @description Body for `PUT /orgs/{orgId}/keypair`. Carries the org's eth public key as an uncompressed hex string (`0x04` + 128 hex) — the eth-native form wallets/ethers emit. The matching private key never leaves the consumer. */
|
|
4035
4044
|
OrgKeypairHexRequest: {
|
|
4036
4045
|
/** @description Uncompressed secp256k1 public key, `0x04` + 128 hex. */
|
|
@@ -9562,6 +9571,36 @@ export interface operations {
|
|
|
9562
9571
|
default: components["responses"]["ProblemResponse"];
|
|
9563
9572
|
};
|
|
9564
9573
|
};
|
|
9574
|
+
UpdateOrgKeypair: {
|
|
9575
|
+
parameters: {
|
|
9576
|
+
query?: never;
|
|
9577
|
+
header?: never;
|
|
9578
|
+
path: {
|
|
9579
|
+
orgId: components["schemas"]["OrgID"];
|
|
9580
|
+
};
|
|
9581
|
+
cookie?: never;
|
|
9582
|
+
};
|
|
9583
|
+
requestBody: {
|
|
9584
|
+
content: {
|
|
9585
|
+
"application/json": components["schemas"]["OrgKeypairUpdateRequest"];
|
|
9586
|
+
};
|
|
9587
|
+
};
|
|
9588
|
+
responses: {
|
|
9589
|
+
/** @description Updated */
|
|
9590
|
+
200: {
|
|
9591
|
+
headers: {
|
|
9592
|
+
[name: string]: unknown;
|
|
9593
|
+
};
|
|
9594
|
+
content: {
|
|
9595
|
+
"application/json": components["schemas"]["OrgKeypair"];
|
|
9596
|
+
};
|
|
9597
|
+
};
|
|
9598
|
+
400: components["responses"]["ProblemResponse"];
|
|
9599
|
+
403: components["responses"]["ForbiddenResponse"];
|
|
9600
|
+
404: components["responses"]["ProblemResponse"];
|
|
9601
|
+
default: components["responses"]["ProblemResponse"];
|
|
9602
|
+
};
|
|
9603
|
+
};
|
|
9565
9604
|
ListOrgTokens: {
|
|
9566
9605
|
parameters: {
|
|
9567
9606
|
query?: never;
|