@opendatalabs/vana-sdk 4.1.0 → 4.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.
- package/README.md +47 -0
- package/dist/direct/access-request-client.cjs +3 -0
- package/dist/direct/access-request-client.cjs.map +1 -1
- package/dist/direct/access-request-client.js +3 -0
- package/dist/direct/access-request-client.js.map +1 -1
- package/dist/direct/controller.cjs +43 -2
- package/dist/direct/controller.cjs.map +1 -1
- package/dist/direct/controller.d.ts +33 -0
- package/dist/direct/controller.js +46 -2
- package/dist/direct/controller.js.map +1 -1
- package/dist/direct/grant-union.cjs +129 -0
- package/dist/direct/grant-union.cjs.map +1 -0
- package/dist/direct/grant-union.d.ts +138 -0
- package/dist/direct/grant-union.js +102 -0
- package/dist/direct/grant-union.js.map +1 -0
- package/dist/direct/grant-union.test.d.ts +1 -0
- package/dist/direct/types.cjs.map +1 -1
- package/dist/direct/types.d.ts +43 -0
- package/dist/direct/types.js.map +1 -1
- package/dist/errors.cjs +2 -2
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +7 -1
- package/dist/errors.js +2 -2
- package/dist/errors.js.map +1 -1
- package/dist/index.browser.d.ts +2 -1
- package/dist/index.browser.js +99 -0
- package/dist/index.browser.js.map +3 -3
- package/dist/index.node.cjs +945 -418
- package/dist/index.node.cjs.map +4 -4
- package/dist/index.node.d.ts +2 -1
- package/dist/index.node.js +801 -276
- package/dist/index.node.js.map +4 -4
- package/dist/protocol/jobs-client.cjs +196 -25
- package/dist/protocol/jobs-client.cjs.map +1 -1
- package/dist/protocol/jobs-client.d.ts +39 -1
- package/dist/protocol/jobs-client.js +199 -26
- package/dist/protocol/jobs-client.js.map +1 -1
- package/dist/protocol/jobs.cjs.map +1 -1
- package/dist/protocol/jobs.d.ts +71 -1
- package/dist/protocol/jobs.js.map +1 -1
- package/dist/server.cjs +9 -0
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.ts +2 -1
- package/dist/server.js +10 -0
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
package/dist/protocol/jobs.d.ts
CHANGED
|
@@ -21,7 +21,52 @@ export type JobOperation = (typeof JOB_OPERATIONS)[number];
|
|
|
21
21
|
export declare const JOB_STATES: readonly ["queued", "claimed", "running", "completed", "failed", "expired", "cancelled"];
|
|
22
22
|
export type JobState = (typeof JOB_STATES)[number];
|
|
23
23
|
/** Payment lifecycle recorded for a queued job. */
|
|
24
|
-
|
|
24
|
+
/**
|
|
25
|
+
* What actually happened to the money for one read.
|
|
26
|
+
*
|
|
27
|
+
* `none` is the pre-fee literal every job carried before job fees and stays in
|
|
28
|
+
* the union for those rows. `free` is a chain whose `data_access` fee is
|
|
29
|
+
* disabled or zero — priced honestly at nothing, not a placeholder. `unbilled`
|
|
30
|
+
* is a read the Gateway priced but did not charge, either during the fee
|
|
31
|
+
* rollout or on a path with no payer.
|
|
32
|
+
*/
|
|
33
|
+
export type PaymentState = "none" | "free" | "unbilled" | "reserved" | "settling" | "settled" | "released";
|
|
34
|
+
/**
|
|
35
|
+
* The builder's signed authorization for the price of one read.
|
|
36
|
+
*
|
|
37
|
+
* The same EIP-712 `GenericPayment` a legacy Personal Server read signs into
|
|
38
|
+
* its `X-PAYMENT` header, over `opType: "job_access"` and
|
|
39
|
+
* `opId: keccak256(jobId)`. The Gateway stores it verbatim on the payment row.
|
|
40
|
+
*/
|
|
41
|
+
export interface JobPaymentAuthorization {
|
|
42
|
+
signature: Hex;
|
|
43
|
+
/** uint256 decimal; must equal the Gateway's quote for this chain. */
|
|
44
|
+
amount: string;
|
|
45
|
+
asset: Address;
|
|
46
|
+
/** uint256 decimal, unique per (payer, kind). */
|
|
47
|
+
paymentNonce: string;
|
|
48
|
+
}
|
|
49
|
+
/** The price of one delivered read, as `GET /v1/jobs/quote` reports it. */
|
|
50
|
+
export interface JobQuote {
|
|
51
|
+
chainId: number;
|
|
52
|
+
/** uint256 decimal; "0" when this chain charges nothing. */
|
|
53
|
+
price: string;
|
|
54
|
+
asset: Address;
|
|
55
|
+
/** False when the fee is disabled or zero, so no payment is needed. */
|
|
56
|
+
payable: boolean;
|
|
57
|
+
/** Whether the Gateway refuses an unpaid submission today. */
|
|
58
|
+
enforced: boolean;
|
|
59
|
+
}
|
|
60
|
+
/** RecordDataAccess receipt fields plus the enclave signature over them. */
|
|
61
|
+
export interface JobAccessRecord {
|
|
62
|
+
dataPointId: Hex;
|
|
63
|
+
/** uint256 decimal — the data-point version actually served. */
|
|
64
|
+
version: string;
|
|
65
|
+
accessor: Address;
|
|
66
|
+
/** bytes32 per-event replay nonce; the contract pins it. */
|
|
67
|
+
recordId: Hex;
|
|
68
|
+
signature: Hex;
|
|
69
|
+
}
|
|
25
70
|
export declare const DEFAULT_LEASE_SECONDS = 30;
|
|
26
71
|
export declare const MAX_LEASE_SECONDS = 300;
|
|
27
72
|
export declare const MAX_ATTEMPTS = 3;
|
|
@@ -64,6 +109,18 @@ export interface JobSubmission {
|
|
|
64
109
|
deadline?: string;
|
|
65
110
|
/** Base64 ECIES from `sealJobRequest`. */
|
|
66
111
|
requestCiphertext: string;
|
|
112
|
+
/**
|
|
113
|
+
* The most the builder accepts for this read, uint256 decimal. The Gateway
|
|
114
|
+
* refuses a quote above it rather than charging a price nobody agreed to.
|
|
115
|
+
*
|
|
116
|
+
* @remarks
|
|
117
|
+
* This submission is authenticated by a Web3Signed body hash, not by an
|
|
118
|
+
* EIP-712 struct, so these three fields are covered by the builder's existing
|
|
119
|
+
* request signature. No typed-data version changes.
|
|
120
|
+
*/
|
|
121
|
+
maxPrice?: string;
|
|
122
|
+
priceAsset?: Address;
|
|
123
|
+
payment?: JobPaymentAuthorization;
|
|
67
124
|
}
|
|
68
125
|
/** Where a completed job's sealed result lives. Bytes never transit the Gateway. */
|
|
69
126
|
export interface ResultHandle {
|
|
@@ -89,6 +146,12 @@ export interface JobStatus {
|
|
|
89
146
|
pinnedVersion: string | null;
|
|
90
147
|
attempt: number;
|
|
91
148
|
price: string;
|
|
149
|
+
/**
|
|
150
|
+
* Null exactly when the read is free; nothing owed is owed to nobody.
|
|
151
|
+
* Optional so a consumer's existing `JobStatus` fixtures keep compiling; the
|
|
152
|
+
* Gateway always sends it.
|
|
153
|
+
*/
|
|
154
|
+
priceAsset?: Address | null;
|
|
92
155
|
payer: "builder";
|
|
93
156
|
paymentState: PaymentState;
|
|
94
157
|
createdAt: string;
|
|
@@ -139,6 +202,13 @@ export interface CompleteRequest {
|
|
|
139
202
|
resultSize: number;
|
|
140
203
|
/** `jobresults/{chainId}/{jobId}`. */
|
|
141
204
|
resultObjectKey: string;
|
|
205
|
+
/**
|
|
206
|
+
* Server-signed delivery receipt for the read this job served, minted by the
|
|
207
|
+
* node agent with the owner's enclave wallet. Binds the reserved payment to
|
|
208
|
+
* an on-chain `recordDataAccess`, exactly as the legacy paid read does.
|
|
209
|
+
* Required whenever the job reserved a fee.
|
|
210
|
+
*/
|
|
211
|
+
accessRecord?: JobAccessRecord;
|
|
142
212
|
}
|
|
143
213
|
/** Request body for `POST /v1/jobs/:id/fail`. */
|
|
144
214
|
export interface FailRequest {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/protocol/jobs.ts"],"sourcesContent":["/**\n * Job queue protocol types for encrypted Personal Server execution.\n *\n * Builder -> GW -> Agent -> Sandbox\n * Builder -> GW: submit an enclave-encrypted request.\n * GW -> Agent: claim work with a fenced lease and sealed owner identity.\n * Agent -> Sandbox: decrypt, wake the owner sandbox, and execute privately.\n * Sandbox -> Agent: encrypt the result to the builder's public key.\n * Agent -> GW: store the sealed result and complete with its object key, hash, and size.\n * GW -> Builder: return inline or polled status with an object-storage handle.\n * Builder: decrypt and verify the result's job, scope, and version bindings.\n * Full flow: personal-server-ts `docs/260903-jobs-contract.md`, section 1.\n *\n * @category Protocol\n */\n\nimport type { Address, Hex } from \"viem\";\nimport type { SealedEnvelope } from \"./identity\";\n\nexport const JOB_PROTOCOL_VERSION = 1;\nexport const JOB_OPERATIONS = [\"raw_read\", \"inference\"] as const;\nexport type JobOperation = (typeof JOB_OPERATIONS)[number];\nexport const JOB_STATES = [\n \"queued\",\n \"claimed\",\n \"running\",\n \"completed\",\n \"failed\",\n \"expired\",\n \"cancelled\",\n] as const;\nexport type JobState = (typeof JOB_STATES)[number];\n/** Payment lifecycle recorded for a queued job. */\nexport type PaymentState
|
|
1
|
+
{"version":3,"sources":["../../src/protocol/jobs.ts"],"sourcesContent":["/**\n * Job queue protocol types for encrypted Personal Server execution.\n *\n * Builder -> GW -> Agent -> Sandbox\n * Builder -> GW: submit an enclave-encrypted request.\n * GW -> Agent: claim work with a fenced lease and sealed owner identity.\n * Agent -> Sandbox: decrypt, wake the owner sandbox, and execute privately.\n * Sandbox -> Agent: encrypt the result to the builder's public key.\n * Agent -> GW: store the sealed result and complete with its object key, hash, and size.\n * GW -> Builder: return inline or polled status with an object-storage handle.\n * Builder: decrypt and verify the result's job, scope, and version bindings.\n * Full flow: personal-server-ts `docs/260903-jobs-contract.md`, section 1.\n *\n * @category Protocol\n */\n\nimport type { Address, Hex } from \"viem\";\nimport type { SealedEnvelope } from \"./identity\";\n\nexport const JOB_PROTOCOL_VERSION = 1;\nexport const JOB_OPERATIONS = [\"raw_read\", \"inference\"] as const;\nexport type JobOperation = (typeof JOB_OPERATIONS)[number];\nexport const JOB_STATES = [\n \"queued\",\n \"claimed\",\n \"running\",\n \"completed\",\n \"failed\",\n \"expired\",\n \"cancelled\",\n] as const;\nexport type JobState = (typeof JOB_STATES)[number];\n/** Payment lifecycle recorded for a queued job. */\n/**\n * What actually happened to the money for one read.\n *\n * `none` is the pre-fee literal every job carried before job fees and stays in\n * the union for those rows. `free` is a chain whose `data_access` fee is\n * disabled or zero — priced honestly at nothing, not a placeholder. `unbilled`\n * is a read the Gateway priced but did not charge, either during the fee\n * rollout or on a path with no payer.\n */\nexport type PaymentState =\n | \"none\"\n | \"free\"\n | \"unbilled\"\n | \"reserved\"\n | \"settling\"\n | \"settled\"\n | \"released\";\n\n/**\n * The builder's signed authorization for the price of one read.\n *\n * The same EIP-712 `GenericPayment` a legacy Personal Server read signs into\n * its `X-PAYMENT` header, over `opType: \"job_access\"` and\n * `opId: keccak256(jobId)`. The Gateway stores it verbatim on the payment row.\n */\nexport interface JobPaymentAuthorization {\n signature: Hex;\n /** uint256 decimal; must equal the Gateway's quote for this chain. */\n amount: string;\n asset: Address;\n /** uint256 decimal, unique per (payer, kind). */\n paymentNonce: string;\n}\n\n/** The price of one delivered read, as `GET /v1/jobs/quote` reports it. */\nexport interface JobQuote {\n chainId: number;\n /** uint256 decimal; \"0\" when this chain charges nothing. */\n price: string;\n asset: Address;\n /** False when the fee is disabled or zero, so no payment is needed. */\n payable: boolean;\n /** Whether the Gateway refuses an unpaid submission today. */\n enforced: boolean;\n}\n\n/** RecordDataAccess receipt fields plus the enclave signature over them. */\nexport interface JobAccessRecord {\n dataPointId: Hex;\n /** uint256 decimal — the data-point version actually served. */\n version: string;\n accessor: Address;\n /** bytes32 per-event replay nonce; the contract pins it. */\n recordId: Hex;\n signature: Hex;\n}\nexport const DEFAULT_LEASE_SECONDS = 30;\nexport const MAX_LEASE_SECONDS = 300;\nexport const MAX_ATTEMPTS = 3;\nexport const MAX_WAIT_SECONDS = 25;\nexport const CLAIM_POLL_FLOOR_MS = 1000;\nexport const DEFAULT_JOB_DEADLINE_SECONDS = 600;\nexport const MAX_JOB_DEADLINE_SECONDS = 3600;\n\n/** Inner plaintext of the request box (ECIES to the enclave publicKey). */\nexport interface JobRequest {\n v: 1;\n jobId: string;\n owner: Address;\n builder: Address;\n builderPublicKey: Hex;\n grantId: Hex;\n scope: string;\n operation: JobOperation;\n pinnedVersion: string | null;\n deadline: string; /* ISO */\n}\n/** Plaintext of the request box; the Gateway never sees it. */\nexport interface JobRequestEnvelope {\n request: JobRequest;\n /**\n * `Web3Signed <b64>.<sig>` by the builder: `aud` = Gateway origin,\n * `uri` = `/v1/jobs/execute`,\n * `bodyHash` = `sha256(canonicalJobRequestBytes(request))`.\n */\n auth: string;\n}\n/** Outer body of POST /v1/jobs (signed Web3Signed by the builder). */\nexport interface JobSubmission {\n owner: Address;\n grantId: Hex;\n scope: string;\n operation: JobOperation;\n idempotencyKey: string;\n /** Client UUID, echoed in `JobRequest.jobId`. */\n jobId: string;\n deadline?: string;\n /** Base64 ECIES from `sealJobRequest`. */\n requestCiphertext: string;\n /**\n * The most the builder accepts for this read, uint256 decimal. The Gateway\n * refuses a quote above it rather than charging a price nobody agreed to.\n *\n * @remarks\n * This submission is authenticated by a Web3Signed body hash, not by an\n * EIP-712 struct, so these three fields are covered by the builder's existing\n * request signature. No typed-data version changes.\n */\n maxPrice?: string;\n priceAsset?: Address;\n payment?: JobPaymentAuthorization;\n}\n/** Where a completed job's sealed result lives. Bytes never transit the Gateway. */\nexport interface ResultHandle {\n /** Object key in vana-storage, `jobresults/{chainId}/{jobId}`. */\n objectKey: string;\n /** Absolute URL the builder GETs. The Gateway builds it from its storage origin. */\n url: string;\n /** Byte length of the sealed object. */\n size: number;\n /** sha256 of the sealed bytes, 0x-prefixed. */\n hash: Hex;\n /** Logical expiry. After this the Gateway stops serving the handle. */\n expiresAt: string;\n}\n/** Response from `GET /v1/jobs/:id`. */\nexport interface JobStatus {\n jobId: string;\n state: JobState;\n operation: JobOperation;\n owner: Address;\n grantId: Hex;\n scope: string;\n pinnedVersion: string | null;\n attempt: number;\n price: string;\n /**\n * Null exactly when the read is free; nothing owed is owed to nobody.\n * Optional so a consumer's existing `JobStatus` fixtures keep compiling; the\n * Gateway always sends it.\n */\n priceAsset?: Address | null;\n payer: \"builder\";\n paymentState: PaymentState;\n createdAt: string;\n claimedAt: string | null;\n completedAt: string | null;\n failureReason: string | null;\n /** Present only when `state === \"completed\"`. */\n result?: ResultHandle;\n}\n/** Request body for `POST /v1/jobs/claim`. */\nexport interface ClaimRequest {\n leaseSeconds?: number;\n capacity?: number;\n}\n/** Claimed job and owner identity returned by `POST /v1/jobs/claim`. */\nexport interface ClaimResponse {\n job: {\n jobId: string;\n owner: Address;\n builder: Address;\n grantId: Hex;\n scope: string;\n operation: JobOperation;\n pinnedVersion: string | null;\n requestCiphertext: string;\n attempt: number;\n deadlineAt: string | null;\n claimExpiresAt: string;\n fencingToken: number; /* = attempt; every node write echoes it */\n };\n identity: {\n userPsId: Hex;\n epoch: number;\n enclaveAddress: Address;\n enclavePublicKey: Hex;\n sealedEnvelope: SealedEnvelope;\n };\n}\n/** Request body for `POST /v1/jobs/:id/heartbeat`. */\nexport interface HeartbeatRequest {\n leaseSeconds?: number;\n fencingToken: number;\n}\n/** Request body for `POST /v1/jobs/:id/complete`. */\nexport interface CompleteRequest {\n fencingToken: number;\n resultHash: Hex;\n resultSize: number;\n /** `jobresults/{chainId}/{jobId}`. */\n resultObjectKey: string;\n /**\n * Server-signed delivery receipt for the read this job served, minted by the\n * node agent with the owner's enclave wallet. Binds the reserved payment to\n * an on-chain `recordDataAccess`, exactly as the legacy paid read does.\n * Required whenever the job reserved a fee.\n */\n accessRecord?: JobAccessRecord;\n}\n/** Request body for `POST /v1/jobs/:id/fail`. */\nexport interface FailRequest {\n fencingToken: number;\n reason: string; /* <= 1024, fail.ts:16 */\n}\n/** Successful response from a fenced job write endpoint. */\nexport interface FencedResponse {\n success: true;\n jobId: string;\n state: JobState;\n claimExpiresAt: string | null;\n}\n/** Inner plaintext of the result box (ECIES to builderPublicKey). */\nexport interface JobResult {\n v: 1;\n jobId: string;\n scope: string;\n version: string | null;\n contentType: string;\n /** Raw result bytes; callers decode text explicitly when appropriate. */\n body: Uint8Array;\n}\n/** Admission lifecycle of a registered TEE node. */\nexport type TeeNodeState = \"pending\" | \"admitted\" | \"draining\" | \"removed\";\n/** Request body for `POST /v1/tee-nodes`. */\nexport interface TeeNodeRegistration {\n nodeId: string;\n appId: Hex;\n composeHash: Hex;\n publicUrl: string;\n capacity: number;\n secret: string;\n}\n/** Request body for `POST /v1/tee-nodes/:id/heartbeat`. */\nexport interface TeeNodeHeartbeat {\n composeHash: Hex;\n instanceId: string;\n activeSandboxes: number;\n capacity: number;\n}\n/** Public registration and capacity state for a TEE node. */\nexport interface TeeNode {\n nodeId: string;\n appId: Hex;\n composeHash: Hex;\n publicUrl: string;\n state: TeeNodeState;\n capacity: number;\n activeSandboxes: number;\n lastHeartbeatAt: string | null;\n}\n"],"mappings":"AAmBO,MAAM,uBAAuB;AAC7B,MAAM,iBAAiB,CAAC,YAAY,WAAW;AAE/C,MAAM,aAAa;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AA2DO,MAAM,wBAAwB;AAC9B,MAAM,oBAAoB;AAC1B,MAAM,eAAe;AACrB,MAAM,mBAAmB;AACzB,MAAM,sBAAsB;AAC5B,MAAM,+BAA+B;AACrC,MAAM,2BAA2B;","names":[]}
|
package/dist/server.cjs
CHANGED
|
@@ -41,10 +41,13 @@ __export(server_exports, {
|
|
|
41
41
|
createDefaultNonceSource: () => import_escrow_payment.createDefaultNonceSource,
|
|
42
42
|
createDirectDataController: () => import_controller.createDirectDataController,
|
|
43
43
|
dataPathForScope: () => import_personal_server_read.dataPathForScope,
|
|
44
|
+
findLiveGrant: () => import_grant_union.findLiveGrant,
|
|
44
45
|
formatScopeEntry: () => import_scope_actions.formatScopeEntry,
|
|
45
46
|
getDirectEndpoints: () => import_endpoints.getDirectEndpoints,
|
|
46
47
|
grantPermissions: () => import_scope_actions.grantPermissions,
|
|
47
48
|
hasAction: () => import_scope_actions.hasAction,
|
|
49
|
+
liveGrantScopes: () => import_grant_union.liveGrantScopes,
|
|
50
|
+
mergeWithLiveGrant: () => import_grant_union.mergeWithLiveGrant,
|
|
48
51
|
parsePersonalServerPaymentRequired: () => import_personal_server_read.parsePersonalServerPaymentRequired,
|
|
49
52
|
parseScope: () => import_scopes.parseScope,
|
|
50
53
|
parseScopeEntry: () => import_scope_actions.parseScopeEntry,
|
|
@@ -56,11 +59,13 @@ __export(server_exports, {
|
|
|
56
59
|
toDirectFeeBreakdown: () => import_escrow_payment.toDirectFeeBreakdown,
|
|
57
60
|
toDirectPaymentReceipt: () => import_escrow_payment.toDirectPaymentReceipt,
|
|
58
61
|
tryGrantPermissions: () => import_scope_actions.tryGrantPermissions,
|
|
62
|
+
unionGrantScopes: () => import_grant_union.unionGrantScopes,
|
|
59
63
|
validateAccessRequestQuestions: () => import_access_request_client.validateAccessRequestQuestions
|
|
60
64
|
});
|
|
61
65
|
module.exports = __toCommonJS(server_exports);
|
|
62
66
|
var import_controller = require("./direct/controller");
|
|
63
67
|
var import_access_request_client = require("./direct/access-request-client");
|
|
68
|
+
var import_grant_union = require("./direct/grant-union");
|
|
64
69
|
var import_personal_server_read = require("./direct/personal-server-read");
|
|
65
70
|
var import_escrow_payment = require("./direct/escrow-payment");
|
|
66
71
|
var import_endpoints = require("./direct/endpoints");
|
|
@@ -93,10 +98,13 @@ var import_types = require("./direct/types");
|
|
|
93
98
|
createDefaultNonceSource,
|
|
94
99
|
createDirectDataController,
|
|
95
100
|
dataPathForScope,
|
|
101
|
+
findLiveGrant,
|
|
96
102
|
formatScopeEntry,
|
|
97
103
|
getDirectEndpoints,
|
|
98
104
|
grantPermissions,
|
|
99
105
|
hasAction,
|
|
106
|
+
liveGrantScopes,
|
|
107
|
+
mergeWithLiveGrant,
|
|
100
108
|
parsePersonalServerPaymentRequired,
|
|
101
109
|
parseScope,
|
|
102
110
|
parseScopeEntry,
|
|
@@ -108,6 +116,7 @@ var import_types = require("./direct/types");
|
|
|
108
116
|
toDirectFeeBreakdown,
|
|
109
117
|
toDirectPaymentReceipt,
|
|
110
118
|
tryGrantPermissions,
|
|
119
|
+
unionGrantScopes,
|
|
111
120
|
validateAccessRequestQuestions
|
|
112
121
|
});
|
|
113
122
|
//# sourceMappingURL=server.cjs.map
|
package/dist/server.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["/**\n * Server entry point for the Vana SDK direct Data Portability flow.\n *\n * @remarks\n * Exposes {@link createDirectDataController} and its supporting types/errors.\n * This is a Node/server entry point — it owns the app private key and must never\n * be imported into browser code.\n *\n * @example\n * ```typescript\n * import { createDirectDataController } from \"@opendatalabs/vana-sdk/server\";\n *\n * export const vana = createDirectDataController({\n * env: process.env.VANA_ENV === \"dev\" ? \"dev\" : \"production\",\n * appPrivateKey: process.env.VANA_APP_PRIVATE_KEY!,\n * app: { id: \"notes-lens\", name: \"Notes Lens\", homepageUrl: process.env.VANA_APP_URL! },\n * source: \"icloud_notes\",\n * scopes: [\"icloud_notes.notes\"],\n * });\n * ```\n *\n * @category Direct\n * @module server\n */\n\nexport {\n createDirectDataController,\n type DirectDataController,\n type DirectDataControllerConfig,\n type DirectEscrowConfig,\n} from \"./direct/controller\";\n\n// Lower-level building blocks (advanced use / custom transports).\nexport {\n createDefaultAccessRequestClient,\n buildApprovalUrl,\n validateAccessRequestQuestions,\n type DefaultAccessRequestClientOptions,\n type FetchLike,\n} from \"./direct/access-request-client\";\nexport {\n buildPersonalServerDataReadRequest,\n readPersonalServerData,\n parsePersonalServerPaymentRequired,\n dataPathForScope,\n type PersonalServerDataReadRequest,\n type PersonalServerReadResult,\n type PersonalServerFetch,\n type PersonalServerTransportRetryOptions,\n type FetchResponseLike,\n} from \"./direct/personal-server-read\";\n// Escrow-backed payment (built on protocol/escrow).\nexport {\n authorizeEscrowPayment,\n authorizeGrantPayment,\n buildEscrowPaymentHeader,\n buildGrantPaymentHeader,\n paymentResponseMetadataFromHeader,\n toDirectPaymentReceipt,\n toDirectFeeBreakdown,\n createDefaultNonceSource,\n DATA_ACCESS_OP_TYPE,\n GRANT_OP_TYPE,\n type EscrowPaymentConfig,\n type EscrowPaymentHeaderConfig,\n type SignTypedDataFn,\n type PaymentNonceSource,\n} from \"./direct/escrow-payment\";\nexport {\n getDirectEndpoints,\n PRODUCTION_ENDPOINTS,\n DEV_ENDPOINTS,\n} from \"./direct/endpoints\";\n// Grant scope entries: the `[operation:]scope` vocabulary the controller's\n// `scopes` are written in, so a backend can build and read them without\n// reaching for a platform entry point.\nexport {\n ScopeSchema,\n parseScope,\n scopeMatchesPattern,\n scopeCoveredByGrant,\n type Scope,\n type ParsedScope,\n} from \"./protocol/scopes\";\nexport {\n SCOPE_ACTIONS,\n InvalidScopeEntryError,\n parseScopeEntry,\n formatScopeEntry,\n grantPermissions,\n permissionsToScopes,\n tryGrantPermissions,\n hasAction,\n type ScopeAction,\n type ParsedScopeEntry,\n type GrantPermission,\n} from \"./protocol/scope-actions\";\n\n// Errors\nexport {\n DirectConfigError,\n AccessNotApprovedError,\n ScopeNotApprovedError,\n PersonalServerReadError,\n PaymentRequiredError,\n} from \"./direct/errors\";\n\n// Shared types\nexport type {\n DirectEnv,\n DirectNetwork,\n DirectAppConfig,\n ForegroundDelivery,\n AppIdentity,\n DirectServiceEndpoints,\n AccessRequest,\n AccessRequestQuestion,\n AccessRequestStatus,\n AccessRequestStatusValue,\n ApprovedDataResult,\n MultiScopeDataResult,\n AccessRequestClient,\n DirectOpTypeValue,\n PersonalServerDataAccessPaymentOperation,\n PersonalServerGrantPaymentOperation,\n PersonalServerPaymentOperation,\n PersonalServerPaymentRequired,\n DirectPaymentReceipt,\n DirectPaymentResponseMetadata,\n DirectFeeBreakdown,\n} from \"./direct/types\";\n\n// Op-type vocabulary constant.\nexport { DirectOpType } from \"./direct/types\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBA,wBAKO;AAGP,mCAMO;AACP,kCAUO;AAEP,4BAeO;AACP,uBAIO;AAIP,oBAOO;AACP,2BAYO;AAGP,oBAMO;
|
|
1
|
+
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["/**\n * Server entry point for the Vana SDK direct Data Portability flow.\n *\n * @remarks\n * Exposes {@link createDirectDataController} and its supporting types/errors.\n * This is a Node/server entry point — it owns the app private key and must never\n * be imported into browser code.\n *\n * @example\n * ```typescript\n * import { createDirectDataController } from \"@opendatalabs/vana-sdk/server\";\n *\n * export const vana = createDirectDataController({\n * env: process.env.VANA_ENV === \"dev\" ? \"dev\" : \"production\",\n * appPrivateKey: process.env.VANA_APP_PRIVATE_KEY!,\n * app: { id: \"notes-lens\", name: \"Notes Lens\", homepageUrl: process.env.VANA_APP_URL! },\n * source: \"icloud_notes\",\n * scopes: [\"icloud_notes.notes\"],\n * });\n * ```\n *\n * @category Direct\n * @module server\n */\n\nexport {\n createDirectDataController,\n type DirectDataController,\n type DirectDataControllerConfig,\n type DirectEscrowConfig,\n} from \"./direct/controller\";\n\n// Lower-level building blocks (advanced use / custom transports).\nexport {\n createDefaultAccessRequestClient,\n buildApprovalUrl,\n validateAccessRequestQuestions,\n type DefaultAccessRequestClientOptions,\n type FetchLike,\n} from \"./direct/access-request-client\";\n// Grant union: extend the owner's live grant instead of replacing it.\nexport {\n mergeWithLiveGrant,\n liveGrantScopes,\n findLiveGrant,\n unionGrantScopes,\n type GrantUnion,\n type GrantUnionGateway,\n type GrantUnionStatus,\n type MergeWithLiveGrantInput,\n type MergeWithLiveGrantResult,\n} from \"./direct/grant-union\";\nexport {\n buildPersonalServerDataReadRequest,\n readPersonalServerData,\n parsePersonalServerPaymentRequired,\n dataPathForScope,\n type PersonalServerDataReadRequest,\n type PersonalServerReadResult,\n type PersonalServerFetch,\n type PersonalServerTransportRetryOptions,\n type FetchResponseLike,\n} from \"./direct/personal-server-read\";\n// Escrow-backed payment (built on protocol/escrow).\nexport {\n authorizeEscrowPayment,\n authorizeGrantPayment,\n buildEscrowPaymentHeader,\n buildGrantPaymentHeader,\n paymentResponseMetadataFromHeader,\n toDirectPaymentReceipt,\n toDirectFeeBreakdown,\n createDefaultNonceSource,\n DATA_ACCESS_OP_TYPE,\n GRANT_OP_TYPE,\n type EscrowPaymentConfig,\n type EscrowPaymentHeaderConfig,\n type SignTypedDataFn,\n type PaymentNonceSource,\n} from \"./direct/escrow-payment\";\nexport {\n getDirectEndpoints,\n PRODUCTION_ENDPOINTS,\n DEV_ENDPOINTS,\n} from \"./direct/endpoints\";\n// Grant scope entries: the `[operation:]scope` vocabulary the controller's\n// `scopes` are written in, so a backend can build and read them without\n// reaching for a platform entry point.\nexport {\n ScopeSchema,\n parseScope,\n scopeMatchesPattern,\n scopeCoveredByGrant,\n type Scope,\n type ParsedScope,\n} from \"./protocol/scopes\";\nexport {\n SCOPE_ACTIONS,\n InvalidScopeEntryError,\n parseScopeEntry,\n formatScopeEntry,\n grantPermissions,\n permissionsToScopes,\n tryGrantPermissions,\n hasAction,\n type ScopeAction,\n type ParsedScopeEntry,\n type GrantPermission,\n} from \"./protocol/scope-actions\";\n\n// Errors\nexport {\n DirectConfigError,\n AccessNotApprovedError,\n ScopeNotApprovedError,\n PersonalServerReadError,\n PaymentRequiredError,\n} from \"./direct/errors\";\n\n// Shared types\nexport type {\n DirectEnv,\n DirectNetwork,\n DirectAppConfig,\n ForegroundDelivery,\n AppIdentity,\n DirectServiceEndpoints,\n AccessRequest,\n AccessRequestGrantUnion,\n AccessRequestQuestion,\n AccessRequestStatus,\n AccessRequestStatusValue,\n ApprovedDataResult,\n MultiScopeDataResult,\n AccessRequestClient,\n DirectOpTypeValue,\n PersonalServerDataAccessPaymentOperation,\n PersonalServerGrantPaymentOperation,\n PersonalServerPaymentOperation,\n PersonalServerPaymentRequired,\n DirectPaymentReceipt,\n DirectPaymentResponseMetadata,\n DirectFeeBreakdown,\n} from \"./direct/types\";\n\n// Op-type vocabulary constant.\nexport { DirectOpType } from \"./direct/types\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBA,wBAKO;AAGP,mCAMO;AAEP,yBAUO;AACP,kCAUO;AAEP,4BAeO;AACP,uBAIO;AAIP,oBAOO;AACP,2BAYO;AAGP,oBAMO;AA6BP,mBAA6B;","names":[]}
|
package/dist/server.d.ts
CHANGED
|
@@ -24,11 +24,12 @@
|
|
|
24
24
|
*/
|
|
25
25
|
export { createDirectDataController, type DirectDataController, type DirectDataControllerConfig, type DirectEscrowConfig, } from "./direct/controller.js";
|
|
26
26
|
export { createDefaultAccessRequestClient, buildApprovalUrl, validateAccessRequestQuestions, type DefaultAccessRequestClientOptions, type FetchLike, } from "./direct/access-request-client.js";
|
|
27
|
+
export { mergeWithLiveGrant, liveGrantScopes, findLiveGrant, unionGrantScopes, type GrantUnion, type GrantUnionGateway, type GrantUnionStatus, type MergeWithLiveGrantInput, type MergeWithLiveGrantResult, } from "./direct/grant-union.js";
|
|
27
28
|
export { buildPersonalServerDataReadRequest, readPersonalServerData, parsePersonalServerPaymentRequired, dataPathForScope, type PersonalServerDataReadRequest, type PersonalServerReadResult, type PersonalServerFetch, type PersonalServerTransportRetryOptions, type FetchResponseLike, } from "./direct/personal-server-read.js";
|
|
28
29
|
export { authorizeEscrowPayment, authorizeGrantPayment, buildEscrowPaymentHeader, buildGrantPaymentHeader, paymentResponseMetadataFromHeader, toDirectPaymentReceipt, toDirectFeeBreakdown, createDefaultNonceSource, DATA_ACCESS_OP_TYPE, GRANT_OP_TYPE, type EscrowPaymentConfig, type EscrowPaymentHeaderConfig, type SignTypedDataFn, type PaymentNonceSource, } from "./direct/escrow-payment.js";
|
|
29
30
|
export { getDirectEndpoints, PRODUCTION_ENDPOINTS, DEV_ENDPOINTS, } from "./direct/endpoints.js";
|
|
30
31
|
export { ScopeSchema, parseScope, scopeMatchesPattern, scopeCoveredByGrant, type Scope, type ParsedScope, } from "./protocol/scopes.js";
|
|
31
32
|
export { SCOPE_ACTIONS, InvalidScopeEntryError, parseScopeEntry, formatScopeEntry, grantPermissions, permissionsToScopes, tryGrantPermissions, hasAction, type ScopeAction, type ParsedScopeEntry, type GrantPermission, } from "./protocol/scope-actions.js";
|
|
32
33
|
export { DirectConfigError, AccessNotApprovedError, ScopeNotApprovedError, PersonalServerReadError, PaymentRequiredError, } from "./direct/errors.js";
|
|
33
|
-
export type { DirectEnv, DirectNetwork, DirectAppConfig, ForegroundDelivery, AppIdentity, DirectServiceEndpoints, AccessRequest, AccessRequestQuestion, AccessRequestStatus, AccessRequestStatusValue, ApprovedDataResult, MultiScopeDataResult, AccessRequestClient, DirectOpTypeValue, PersonalServerDataAccessPaymentOperation, PersonalServerGrantPaymentOperation, PersonalServerPaymentOperation, PersonalServerPaymentRequired, DirectPaymentReceipt, DirectPaymentResponseMetadata, DirectFeeBreakdown, } from "./direct/types.js";
|
|
34
|
+
export type { DirectEnv, DirectNetwork, DirectAppConfig, ForegroundDelivery, AppIdentity, DirectServiceEndpoints, AccessRequest, AccessRequestGrantUnion, AccessRequestQuestion, AccessRequestStatus, AccessRequestStatusValue, ApprovedDataResult, MultiScopeDataResult, AccessRequestClient, DirectOpTypeValue, PersonalServerDataAccessPaymentOperation, PersonalServerGrantPaymentOperation, PersonalServerPaymentOperation, PersonalServerPaymentRequired, DirectPaymentReceipt, DirectPaymentResponseMetadata, DirectFeeBreakdown, } from "./direct/types.js";
|
|
34
35
|
export { DirectOpType } from "./direct/types.js";
|
package/dist/server.js
CHANGED
|
@@ -6,6 +6,12 @@ import {
|
|
|
6
6
|
buildApprovalUrl,
|
|
7
7
|
validateAccessRequestQuestions
|
|
8
8
|
} from "./direct/access-request-client.js";
|
|
9
|
+
import {
|
|
10
|
+
mergeWithLiveGrant,
|
|
11
|
+
liveGrantScopes,
|
|
12
|
+
findLiveGrant,
|
|
13
|
+
unionGrantScopes
|
|
14
|
+
} from "./direct/grant-union.js";
|
|
9
15
|
import {
|
|
10
16
|
buildPersonalServerDataReadRequest,
|
|
11
17
|
readPersonalServerData,
|
|
@@ -77,10 +83,13 @@ export {
|
|
|
77
83
|
createDefaultNonceSource,
|
|
78
84
|
createDirectDataController,
|
|
79
85
|
dataPathForScope,
|
|
86
|
+
findLiveGrant,
|
|
80
87
|
formatScopeEntry,
|
|
81
88
|
getDirectEndpoints,
|
|
82
89
|
grantPermissions,
|
|
83
90
|
hasAction,
|
|
91
|
+
liveGrantScopes,
|
|
92
|
+
mergeWithLiveGrant,
|
|
84
93
|
parsePersonalServerPaymentRequired,
|
|
85
94
|
parseScope,
|
|
86
95
|
parseScopeEntry,
|
|
@@ -92,6 +101,7 @@ export {
|
|
|
92
101
|
toDirectFeeBreakdown,
|
|
93
102
|
toDirectPaymentReceipt,
|
|
94
103
|
tryGrantPermissions,
|
|
104
|
+
unionGrantScopes,
|
|
95
105
|
validateAccessRequestQuestions
|
|
96
106
|
};
|
|
97
107
|
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["/**\n * Server entry point for the Vana SDK direct Data Portability flow.\n *\n * @remarks\n * Exposes {@link createDirectDataController} and its supporting types/errors.\n * This is a Node/server entry point — it owns the app private key and must never\n * be imported into browser code.\n *\n * @example\n * ```typescript\n * import { createDirectDataController } from \"@opendatalabs/vana-sdk/server\";\n *\n * export const vana = createDirectDataController({\n * env: process.env.VANA_ENV === \"dev\" ? \"dev\" : \"production\",\n * appPrivateKey: process.env.VANA_APP_PRIVATE_KEY!,\n * app: { id: \"notes-lens\", name: \"Notes Lens\", homepageUrl: process.env.VANA_APP_URL! },\n * source: \"icloud_notes\",\n * scopes: [\"icloud_notes.notes\"],\n * });\n * ```\n *\n * @category Direct\n * @module server\n */\n\nexport {\n createDirectDataController,\n type DirectDataController,\n type DirectDataControllerConfig,\n type DirectEscrowConfig,\n} from \"./direct/controller\";\n\n// Lower-level building blocks (advanced use / custom transports).\nexport {\n createDefaultAccessRequestClient,\n buildApprovalUrl,\n validateAccessRequestQuestions,\n type DefaultAccessRequestClientOptions,\n type FetchLike,\n} from \"./direct/access-request-client\";\nexport {\n buildPersonalServerDataReadRequest,\n readPersonalServerData,\n parsePersonalServerPaymentRequired,\n dataPathForScope,\n type PersonalServerDataReadRequest,\n type PersonalServerReadResult,\n type PersonalServerFetch,\n type PersonalServerTransportRetryOptions,\n type FetchResponseLike,\n} from \"./direct/personal-server-read\";\n// Escrow-backed payment (built on protocol/escrow).\nexport {\n authorizeEscrowPayment,\n authorizeGrantPayment,\n buildEscrowPaymentHeader,\n buildGrantPaymentHeader,\n paymentResponseMetadataFromHeader,\n toDirectPaymentReceipt,\n toDirectFeeBreakdown,\n createDefaultNonceSource,\n DATA_ACCESS_OP_TYPE,\n GRANT_OP_TYPE,\n type EscrowPaymentConfig,\n type EscrowPaymentHeaderConfig,\n type SignTypedDataFn,\n type PaymentNonceSource,\n} from \"./direct/escrow-payment\";\nexport {\n getDirectEndpoints,\n PRODUCTION_ENDPOINTS,\n DEV_ENDPOINTS,\n} from \"./direct/endpoints\";\n// Grant scope entries: the `[operation:]scope` vocabulary the controller's\n// `scopes` are written in, so a backend can build and read them without\n// reaching for a platform entry point.\nexport {\n ScopeSchema,\n parseScope,\n scopeMatchesPattern,\n scopeCoveredByGrant,\n type Scope,\n type ParsedScope,\n} from \"./protocol/scopes\";\nexport {\n SCOPE_ACTIONS,\n InvalidScopeEntryError,\n parseScopeEntry,\n formatScopeEntry,\n grantPermissions,\n permissionsToScopes,\n tryGrantPermissions,\n hasAction,\n type ScopeAction,\n type ParsedScopeEntry,\n type GrantPermission,\n} from \"./protocol/scope-actions\";\n\n// Errors\nexport {\n DirectConfigError,\n AccessNotApprovedError,\n ScopeNotApprovedError,\n PersonalServerReadError,\n PaymentRequiredError,\n} from \"./direct/errors\";\n\n// Shared types\nexport type {\n DirectEnv,\n DirectNetwork,\n DirectAppConfig,\n ForegroundDelivery,\n AppIdentity,\n DirectServiceEndpoints,\n AccessRequest,\n AccessRequestQuestion,\n AccessRequestStatus,\n AccessRequestStatusValue,\n ApprovedDataResult,\n MultiScopeDataResult,\n AccessRequestClient,\n DirectOpTypeValue,\n PersonalServerDataAccessPaymentOperation,\n PersonalServerGrantPaymentOperation,\n PersonalServerPaymentOperation,\n PersonalServerPaymentRequired,\n DirectPaymentReceipt,\n DirectPaymentResponseMetadata,\n DirectFeeBreakdown,\n} from \"./direct/types\";\n\n// Op-type vocabulary constant.\nexport { DirectOpType } from \"./direct/types\";\n"],"mappings":"AAyBA;AAAA,EACE;AAAA,OAIK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAIP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;
|
|
1
|
+
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["/**\n * Server entry point for the Vana SDK direct Data Portability flow.\n *\n * @remarks\n * Exposes {@link createDirectDataController} and its supporting types/errors.\n * This is a Node/server entry point — it owns the app private key and must never\n * be imported into browser code.\n *\n * @example\n * ```typescript\n * import { createDirectDataController } from \"@opendatalabs/vana-sdk/server\";\n *\n * export const vana = createDirectDataController({\n * env: process.env.VANA_ENV === \"dev\" ? \"dev\" : \"production\",\n * appPrivateKey: process.env.VANA_APP_PRIVATE_KEY!,\n * app: { id: \"notes-lens\", name: \"Notes Lens\", homepageUrl: process.env.VANA_APP_URL! },\n * source: \"icloud_notes\",\n * scopes: [\"icloud_notes.notes\"],\n * });\n * ```\n *\n * @category Direct\n * @module server\n */\n\nexport {\n createDirectDataController,\n type DirectDataController,\n type DirectDataControllerConfig,\n type DirectEscrowConfig,\n} from \"./direct/controller\";\n\n// Lower-level building blocks (advanced use / custom transports).\nexport {\n createDefaultAccessRequestClient,\n buildApprovalUrl,\n validateAccessRequestQuestions,\n type DefaultAccessRequestClientOptions,\n type FetchLike,\n} from \"./direct/access-request-client\";\n// Grant union: extend the owner's live grant instead of replacing it.\nexport {\n mergeWithLiveGrant,\n liveGrantScopes,\n findLiveGrant,\n unionGrantScopes,\n type GrantUnion,\n type GrantUnionGateway,\n type GrantUnionStatus,\n type MergeWithLiveGrantInput,\n type MergeWithLiveGrantResult,\n} from \"./direct/grant-union\";\nexport {\n buildPersonalServerDataReadRequest,\n readPersonalServerData,\n parsePersonalServerPaymentRequired,\n dataPathForScope,\n type PersonalServerDataReadRequest,\n type PersonalServerReadResult,\n type PersonalServerFetch,\n type PersonalServerTransportRetryOptions,\n type FetchResponseLike,\n} from \"./direct/personal-server-read\";\n// Escrow-backed payment (built on protocol/escrow).\nexport {\n authorizeEscrowPayment,\n authorizeGrantPayment,\n buildEscrowPaymentHeader,\n buildGrantPaymentHeader,\n paymentResponseMetadataFromHeader,\n toDirectPaymentReceipt,\n toDirectFeeBreakdown,\n createDefaultNonceSource,\n DATA_ACCESS_OP_TYPE,\n GRANT_OP_TYPE,\n type EscrowPaymentConfig,\n type EscrowPaymentHeaderConfig,\n type SignTypedDataFn,\n type PaymentNonceSource,\n} from \"./direct/escrow-payment\";\nexport {\n getDirectEndpoints,\n PRODUCTION_ENDPOINTS,\n DEV_ENDPOINTS,\n} from \"./direct/endpoints\";\n// Grant scope entries: the `[operation:]scope` vocabulary the controller's\n// `scopes` are written in, so a backend can build and read them without\n// reaching for a platform entry point.\nexport {\n ScopeSchema,\n parseScope,\n scopeMatchesPattern,\n scopeCoveredByGrant,\n type Scope,\n type ParsedScope,\n} from \"./protocol/scopes\";\nexport {\n SCOPE_ACTIONS,\n InvalidScopeEntryError,\n parseScopeEntry,\n formatScopeEntry,\n grantPermissions,\n permissionsToScopes,\n tryGrantPermissions,\n hasAction,\n type ScopeAction,\n type ParsedScopeEntry,\n type GrantPermission,\n} from \"./protocol/scope-actions\";\n\n// Errors\nexport {\n DirectConfigError,\n AccessNotApprovedError,\n ScopeNotApprovedError,\n PersonalServerReadError,\n PaymentRequiredError,\n} from \"./direct/errors\";\n\n// Shared types\nexport type {\n DirectEnv,\n DirectNetwork,\n DirectAppConfig,\n ForegroundDelivery,\n AppIdentity,\n DirectServiceEndpoints,\n AccessRequest,\n AccessRequestGrantUnion,\n AccessRequestQuestion,\n AccessRequestStatus,\n AccessRequestStatusValue,\n ApprovedDataResult,\n MultiScopeDataResult,\n AccessRequestClient,\n DirectOpTypeValue,\n PersonalServerDataAccessPaymentOperation,\n PersonalServerGrantPaymentOperation,\n PersonalServerPaymentOperation,\n PersonalServerPaymentRequired,\n DirectPaymentReceipt,\n DirectPaymentResponseMetadata,\n DirectFeeBreakdown,\n} from \"./direct/types\";\n\n// Op-type vocabulary constant.\nexport { DirectOpType } from \"./direct/types\";\n"],"mappings":"AAyBA;AAAA,EACE;AAAA,OAIK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAIP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA6BP,SAAS,oBAAoB;","names":[]}
|