@parmana/sdk 1.1.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 +284 -0
- package/dist/client/AuditApi.d.ts +18 -0
- package/dist/client/AuditApi.d.ts.map +1 -0
- package/dist/client/AuditApi.js +25 -0
- package/dist/client/AuditApi.js.map +1 -0
- package/dist/client/ExecutionApi.d.ts +39 -0
- package/dist/client/ExecutionApi.d.ts.map +1 -0
- package/dist/client/ExecutionApi.js +58 -0
- package/dist/client/ExecutionApi.js.map +1 -0
- package/dist/client/HealthApi.d.ts +22 -0
- package/dist/client/HealthApi.d.ts.map +1 -0
- package/dist/client/HealthApi.js +24 -0
- package/dist/client/HealthApi.js.map +1 -0
- package/dist/client/ParmanaClient.d.ts +154 -0
- package/dist/client/ParmanaClient.d.ts.map +1 -0
- package/dist/client/ParmanaClient.js +223 -0
- package/dist/client/ParmanaClient.js.map +1 -0
- package/dist/client/PolicyApi.d.ts +53 -0
- package/dist/client/PolicyApi.d.ts.map +1 -0
- package/dist/client/PolicyApi.js +48 -0
- package/dist/client/PolicyApi.js.map +1 -0
- package/dist/client/ReceiptApi.d.ts +29 -0
- package/dist/client/ReceiptApi.d.ts.map +1 -0
- package/dist/client/ReceiptApi.js +38 -0
- package/dist/client/ReceiptApi.js.map +1 -0
- package/dist/client/RefusalApi.d.ts +25 -0
- package/dist/client/RefusalApi.d.ts.map +1 -0
- package/dist/client/RefusalApi.js +38 -0
- package/dist/client/RefusalApi.js.map +1 -0
- package/dist/client/ReplayApi.d.ts +21 -0
- package/dist/client/ReplayApi.d.ts.map +1 -0
- package/dist/client/ReplayApi.js +30 -0
- package/dist/client/ReplayApi.js.map +1 -0
- package/dist/client/TransactionApi.d.ts +43 -0
- package/dist/client/TransactionApi.d.ts.map +1 -0
- package/dist/client/TransactionApi.js +62 -0
- package/dist/client/TransactionApi.js.map +1 -0
- package/dist/client/TrustRecordApi.d.ts +19 -0
- package/dist/client/TrustRecordApi.d.ts.map +1 -0
- package/dist/client/TrustRecordApi.js +25 -0
- package/dist/client/TrustRecordApi.js.map +1 -0
- package/dist/client/VerificationApi.d.ts +27 -0
- package/dist/client/VerificationApi.d.ts.map +1 -0
- package/dist/client/VerificationApi.js +42 -0
- package/dist/client/VerificationApi.js.map +1 -0
- package/dist/config/Configuration.d.ts +66 -0
- package/dist/config/Configuration.d.ts.map +1 -0
- package/dist/config/Configuration.js +17 -0
- package/dist/config/Configuration.js.map +1 -0
- package/dist/config/RetryPolicy.d.ts +66 -0
- package/dist/config/RetryPolicy.d.ts.map +1 -0
- package/dist/config/RetryPolicy.js +27 -0
- package/dist/config/RetryPolicy.js.map +1 -0
- package/dist/config/Transport.d.ts +80 -0
- package/dist/config/Transport.d.ts.map +1 -0
- package/dist/config/Transport.js +17 -0
- package/dist/config/Transport.js.map +1 -0
- package/dist/errors/AuthenticationError.d.ts +12 -0
- package/dist/errors/AuthenticationError.d.ts.map +1 -0
- package/dist/errors/AuthenticationError.js +21 -0
- package/dist/errors/AuthenticationError.js.map +1 -0
- package/dist/errors/AuthorizationError.d.ts +31 -0
- package/dist/errors/AuthorizationError.d.ts.map +1 -0
- package/dist/errors/AuthorizationError.js +42 -0
- package/dist/errors/AuthorizationError.js.map +1 -0
- package/dist/errors/ConfigurationError.d.ts +11 -0
- package/dist/errors/ConfigurationError.d.ts.map +1 -0
- package/dist/errors/ConfigurationError.js +20 -0
- package/dist/errors/ConfigurationError.js.map +1 -0
- package/dist/errors/ConflictError.d.ts +14 -0
- package/dist/errors/ConflictError.d.ts.map +1 -0
- package/dist/errors/ConflictError.js +23 -0
- package/dist/errors/ConflictError.js.map +1 -0
- package/dist/errors/ExecutionRejectedError.d.ts +11 -0
- package/dist/errors/ExecutionRejectedError.d.ts.map +1 -0
- package/dist/errors/ExecutionRejectedError.js +20 -0
- package/dist/errors/ExecutionRejectedError.js.map +1 -0
- package/dist/errors/InternalServerError.d.ts +11 -0
- package/dist/errors/InternalServerError.d.ts.map +1 -0
- package/dist/errors/InternalServerError.js +20 -0
- package/dist/errors/InternalServerError.js.map +1 -0
- package/dist/errors/NetworkError.d.ts +11 -0
- package/dist/errors/NetworkError.d.ts.map +1 -0
- package/dist/errors/NetworkError.js +20 -0
- package/dist/errors/NetworkError.js.map +1 -0
- package/dist/errors/NotFoundError.d.ts +13 -0
- package/dist/errors/NotFoundError.d.ts.map +1 -0
- package/dist/errors/NotFoundError.js +22 -0
- package/dist/errors/NotFoundError.js.map +1 -0
- package/dist/errors/ParmanaError.d.ts +57 -0
- package/dist/errors/ParmanaError.d.ts.map +1 -0
- package/dist/errors/ParmanaError.js +60 -0
- package/dist/errors/ParmanaError.js.map +1 -0
- package/dist/errors/RateLimitError.d.ts +24 -0
- package/dist/errors/RateLimitError.d.ts.map +1 -0
- package/dist/errors/RateLimitError.js +35 -0
- package/dist/errors/RateLimitError.js.map +1 -0
- package/dist/errors/ReplayError.d.ts +11 -0
- package/dist/errors/ReplayError.d.ts.map +1 -0
- package/dist/errors/ReplayError.js +20 -0
- package/dist/errors/ReplayError.js.map +1 -0
- package/dist/errors/TimeoutError.d.ts +11 -0
- package/dist/errors/TimeoutError.d.ts.map +1 -0
- package/dist/errors/TimeoutError.js +20 -0
- package/dist/errors/TimeoutError.js.map +1 -0
- package/dist/errors/ValidationError.d.ts +11 -0
- package/dist/errors/ValidationError.d.ts.map +1 -0
- package/dist/errors/ValidationError.js +20 -0
- package/dist/errors/ValidationError.js.map +1 -0
- package/dist/errors/VerificationError.d.ts +11 -0
- package/dist/errors/VerificationError.d.ts.map +1 -0
- package/dist/errors/VerificationError.js +20 -0
- package/dist/errors/VerificationError.js.map +1 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +56 -0
- package/dist/index.js.map +1 -0
- package/dist/models/audit-event.d.ts +15 -0
- package/dist/models/audit-event.d.ts.map +1 -0
- package/dist/models/audit-event.js +2 -0
- package/dist/models/audit-event.js.map +1 -0
- package/dist/models/authority.d.ts +14 -0
- package/dist/models/authority.d.ts.map +1 -0
- package/dist/models/authority.js +8 -0
- package/dist/models/authority.js.map +1 -0
- package/dist/models/authorization.d.ts +13 -0
- package/dist/models/authorization.d.ts.map +1 -0
- package/dist/models/authorization.js +7 -0
- package/dist/models/authorization.js.map +1 -0
- package/dist/models/business-transaction.d.ts +25 -0
- package/dist/models/business-transaction.d.ts.map +1 -0
- package/dist/models/business-transaction.js +2 -0
- package/dist/models/business-transaction.js.map +1 -0
- package/dist/models/execution.d.ts +36 -0
- package/dist/models/execution.d.ts.map +1 -0
- package/dist/models/execution.js +2 -0
- package/dist/models/execution.js.map +1 -0
- package/dist/models/index.d.ts +15 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +15 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/intent.d.ts +14 -0
- package/dist/models/intent.d.ts.map +1 -0
- package/dist/models/intent.js +7 -0
- package/dist/models/intent.js.map +1 -0
- package/dist/models/override.d.ts +9 -0
- package/dist/models/override.d.ts.map +1 -0
- package/dist/models/override.js +2 -0
- package/dist/models/override.js.map +1 -0
- package/dist/models/policy.d.ts +11 -0
- package/dist/models/policy.d.ts.map +1 -0
- package/dist/models/policy.js +7 -0
- package/dist/models/policy.js.map +1 -0
- package/dist/models/receipt.d.ts +10 -0
- package/dist/models/receipt.d.ts.map +1 -0
- package/dist/models/receipt.js +2 -0
- package/dist/models/receipt.js.map +1 -0
- package/dist/models/refusal-record.d.ts +51 -0
- package/dist/models/refusal-record.d.ts.map +1 -0
- package/dist/models/refusal-record.js +2 -0
- package/dist/models/refusal-record.js.map +1 -0
- package/dist/models/replay-result.d.ts +6 -0
- package/dist/models/replay-result.d.ts.map +1 -0
- package/dist/models/replay-result.js +2 -0
- package/dist/models/replay-result.js.map +1 -0
- package/dist/models/signature.d.ts +16 -0
- package/dist/models/signature.d.ts.map +1 -0
- package/dist/models/signature.js +10 -0
- package/dist/models/signature.js.map +1 -0
- package/dist/models/trust-record.d.ts +20 -0
- package/dist/models/trust-record.d.ts.map +1 -0
- package/dist/models/trust-record.js +2 -0
- package/dist/models/trust-record.js.map +1 -0
- package/dist/models/verification.d.ts +10 -0
- package/dist/models/verification.d.ts.map +1 -0
- package/dist/models/verification.js +2 -0
- package/dist/models/verification.js.map +1 -0
- package/dist/transport/HttpTransport.d.ts +25 -0
- package/dist/transport/HttpTransport.d.ts.map +1 -0
- package/dist/transport/HttpTransport.js +193 -0
- package/dist/transport/HttpTransport.js.map +1 -0
- package/dist/transport/mapHttpErrorResponse.d.ts +52 -0
- package/dist/transport/mapHttpErrorResponse.d.ts.map +1 -0
- package/dist/transport/mapHttpErrorResponse.js +134 -0
- package/dist/transport/mapHttpErrorResponse.js.map +1 -0
- package/dist/version.d.ts +7 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +7 -0
- package/dist/version.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parmana Trust Record API.
|
|
3
|
+
*
|
|
4
|
+
* Retrieve Execution Trust Records.
|
|
5
|
+
*/
|
|
6
|
+
import type { ExecutionTrustRecord } from "../models/index.js";
|
|
7
|
+
import type { Transport } from "../config/Transport.js";
|
|
8
|
+
/**
|
|
9
|
+
* Trust Record API.
|
|
10
|
+
*/
|
|
11
|
+
export declare class TrustRecordApi {
|
|
12
|
+
private readonly transport;
|
|
13
|
+
constructor(transport: Transport);
|
|
14
|
+
/**
|
|
15
|
+
* Retrieve an Execution Trust Record.
|
|
16
|
+
*/
|
|
17
|
+
get(businessTransactionId: string): Promise<ExecutionTrustRecord>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=TrustRecordApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrustRecordApi.d.ts","sourceRoot":"","sources":["../../src/client/TrustRecordApi.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EACV,SAAS,EACV,MAAM,wBAAwB,CAAC;AAEhC;;GAEG;AACH,qBAAa,cAAc;IAEvB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAGvC;;OAEG;IACU,GAAG,CACd,qBAAqB,EAAE,MAAM,GAC5B,OAAO,CAAC,oBAAoB,CAAC;CASjC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parmana Trust Record API.
|
|
3
|
+
*
|
|
4
|
+
* Retrieve Execution Trust Records.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Trust Record API.
|
|
8
|
+
*/
|
|
9
|
+
export class TrustRecordApi {
|
|
10
|
+
transport;
|
|
11
|
+
constructor(transport) {
|
|
12
|
+
this.transport = transport;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Retrieve an Execution Trust Record.
|
|
16
|
+
*/
|
|
17
|
+
async get(businessTransactionId) {
|
|
18
|
+
const response = await this.transport.send({
|
|
19
|
+
method: "GET",
|
|
20
|
+
path: `/trust-records/${businessTransactionId}`,
|
|
21
|
+
});
|
|
22
|
+
return response.body;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=TrustRecordApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrustRecordApi.js","sourceRoot":"","sources":["../../src/client/TrustRecordApi.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH;;GAEG;AACH,MAAM,OAAO,cAAc;IAEN;IADnB,YACmB,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;IACpC,CAAC;IAEJ;;OAEG;IACI,KAAK,CAAC,GAAG,CACd,qBAA6B;QAE7B,MAAM,QAAQ,GACZ,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAuB;YAC9C,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,kBAAkB,qBAAqB,EAAE;SAChD,CAAC,CAAC;QAEL,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parmana SDK
|
|
3
|
+
*
|
|
4
|
+
* Verification API.
|
|
5
|
+
*/
|
|
6
|
+
import type { Verification } from "../models/index.js";
|
|
7
|
+
import type { Transport } from "../config/Transport.js";
|
|
8
|
+
export declare class VerificationApi {
|
|
9
|
+
private readonly transport;
|
|
10
|
+
constructor(transport: Transport);
|
|
11
|
+
/**
|
|
12
|
+
* Runs a fresh verification of an Execution Trust Record. Maps to
|
|
13
|
+
* POST /verify. Each call re-verifies the record and appends a new
|
|
14
|
+
* Verification to its history, distinct from getLatest() (GET
|
|
15
|
+
* /verification/:id), which reads the most recent one without
|
|
16
|
+
* re-verifying.
|
|
17
|
+
*/
|
|
18
|
+
verify(businessTransactionId: string): Promise<Verification>;
|
|
19
|
+
/**
|
|
20
|
+
* Returns the latest Verification for a
|
|
21
|
+
* Business Transaction, without performing a
|
|
22
|
+
* fresh verification. Maps to GET
|
|
23
|
+
* /verification/:id.
|
|
24
|
+
*/
|
|
25
|
+
getLatest(businessTransactionId: string): Promise<Verification>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=VerificationApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VerificationApi.d.ts","sourceRoot":"","sources":["../../src/client/VerificationApi.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,YAAY,EACb,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EACV,SAAS,EACV,MAAM,wBAAwB,CAAC;AAEhC,qBAAa,eAAe;IAExB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAGvC;;;;;;OAMG;IACU,MAAM,CACjB,qBAAqB,EAAE,MAAM,GAC5B,OAAO,CAAC,YAAY,CAAC;IAaxB;;;;;OAKG;IACU,SAAS,CACpB,qBAAqB,EAAE,MAAM,GAC5B,OAAO,CAAC,YAAY,CAAC;CASzB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parmana SDK
|
|
3
|
+
*
|
|
4
|
+
* Verification API.
|
|
5
|
+
*/
|
|
6
|
+
export class VerificationApi {
|
|
7
|
+
transport;
|
|
8
|
+
constructor(transport) {
|
|
9
|
+
this.transport = transport;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Runs a fresh verification of an Execution Trust Record. Maps to
|
|
13
|
+
* POST /verify. Each call re-verifies the record and appends a new
|
|
14
|
+
* Verification to its history, distinct from getLatest() (GET
|
|
15
|
+
* /verification/:id), which reads the most recent one without
|
|
16
|
+
* re-verifying.
|
|
17
|
+
*/
|
|
18
|
+
async verify(businessTransactionId) {
|
|
19
|
+
const response = await this.transport.send({
|
|
20
|
+
method: "POST",
|
|
21
|
+
path: "/verify",
|
|
22
|
+
body: {
|
|
23
|
+
businessTransactionId,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
return response.body;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Returns the latest Verification for a
|
|
30
|
+
* Business Transaction, without performing a
|
|
31
|
+
* fresh verification. Maps to GET
|
|
32
|
+
* /verification/:id.
|
|
33
|
+
*/
|
|
34
|
+
async getLatest(businessTransactionId) {
|
|
35
|
+
const response = await this.transport.send({
|
|
36
|
+
path: `/verification/${businessTransactionId}`,
|
|
37
|
+
method: "GET",
|
|
38
|
+
});
|
|
39
|
+
return response.body;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=VerificationApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VerificationApi.js","sourceRoot":"","sources":["../../src/client/VerificationApi.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,MAAM,OAAO,eAAe;IAEP;IADnB,YACmB,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;IACpC,CAAC;IAEJ;;;;;;OAMG;IACI,KAAK,CAAC,MAAM,CACjB,qBAA6B;QAE7B,MAAM,QAAQ,GACZ,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAe;YACtC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,SAAS;YACf,IAAI,EAAE;gBACJ,qBAAqB;aACtB;SACF,CAAC,CAAC;QAEL,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,SAAS,CACpB,qBAA6B;QAE7B,MAAM,QAAQ,GACZ,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAe;YACtC,IAAI,EAAE,iBAAiB,qBAAqB,EAAE;YAC9C,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;QAEL,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parmana SDK
|
|
3
|
+
*
|
|
4
|
+
* Canonical SDK configuration.
|
|
5
|
+
*
|
|
6
|
+
* Configuration defines how the SDK communicates with
|
|
7
|
+
* the Parmana Runtime.
|
|
8
|
+
*
|
|
9
|
+
* Configuration does NOT define:
|
|
10
|
+
* - policy behavior
|
|
11
|
+
* - runtime behavior
|
|
12
|
+
* - authorization rules
|
|
13
|
+
* - execution behavior
|
|
14
|
+
* - verification behavior
|
|
15
|
+
*/
|
|
16
|
+
import type { RetryPolicy } from "./RetryPolicy.js";
|
|
17
|
+
import type { Transport } from "./Transport.js";
|
|
18
|
+
/**
|
|
19
|
+
* Immutable SDK configuration.
|
|
20
|
+
*
|
|
21
|
+
* The Parmana Runtime gates every route except GET /health, GET /ready,
|
|
22
|
+
* GET /openapi.yaml, and GET /documentation behind a caller bearer key
|
|
23
|
+
* (packages/api/src/middleware/caller-auth.ts). See apiKey below and
|
|
24
|
+
* /api-reference/authentication.
|
|
25
|
+
*/
|
|
26
|
+
export interface Configuration {
|
|
27
|
+
/**
|
|
28
|
+
* Parmana Runtime endpoint.
|
|
29
|
+
*
|
|
30
|
+
* Example:
|
|
31
|
+
* https://runtime.example.com
|
|
32
|
+
*/
|
|
33
|
+
readonly endpoint: string;
|
|
34
|
+
/**
|
|
35
|
+
* Caller bearer key, minted by scripts/generate-api-key.ts.
|
|
36
|
+
*
|
|
37
|
+
* Sent as `Authorization: Bearer <apiKey>` on every request. Omit only
|
|
38
|
+
* against a Runtime started with PARMANA_AUTH_DISABLED=true (local
|
|
39
|
+
* development only); every other deployment rejects an unauthenticated
|
|
40
|
+
* request with a 401 before a Business Transaction is even
|
|
41
|
+
* constructed.
|
|
42
|
+
*/
|
|
43
|
+
readonly apiKey?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Request timeout (milliseconds).
|
|
46
|
+
*
|
|
47
|
+
* Default:
|
|
48
|
+
* 30000
|
|
49
|
+
*/
|
|
50
|
+
readonly timeout?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Retry configuration.
|
|
53
|
+
*/
|
|
54
|
+
readonly retryPolicy?: RetryPolicy;
|
|
55
|
+
/**
|
|
56
|
+
* Transport implementation.
|
|
57
|
+
*
|
|
58
|
+
* If omitted, the SDK uses its default HTTP transport.
|
|
59
|
+
*/
|
|
60
|
+
readonly transport?: Transport;
|
|
61
|
+
/**
|
|
62
|
+
* Optional SDK user agent.
|
|
63
|
+
*/
|
|
64
|
+
readonly userAgent?: string;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=Configuration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Configuration.d.ts","sourceRoot":"","sources":["../../src/config/Configuration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;;;;;;;OAQG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IAEnC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parmana SDK
|
|
3
|
+
*
|
|
4
|
+
* Canonical SDK configuration.
|
|
5
|
+
*
|
|
6
|
+
* Configuration defines how the SDK communicates with
|
|
7
|
+
* the Parmana Runtime.
|
|
8
|
+
*
|
|
9
|
+
* Configuration does NOT define:
|
|
10
|
+
* - policy behavior
|
|
11
|
+
* - runtime behavior
|
|
12
|
+
* - authorization rules
|
|
13
|
+
* - execution behavior
|
|
14
|
+
* - verification behavior
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=Configuration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Configuration.js","sourceRoot":"","sources":["../../src/config/Configuration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parmana SDK
|
|
3
|
+
*
|
|
4
|
+
* Canonical retry policy.
|
|
5
|
+
*
|
|
6
|
+
* A RetryPolicy controls how the SDK retries transient
|
|
7
|
+
* communication failures when interacting with the
|
|
8
|
+
* Parmana Runtime.
|
|
9
|
+
*
|
|
10
|
+
* RetryPolicy does NOT change Runtime behavior.
|
|
11
|
+
* It affects only SDK communication.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Retry backoff strategy.
|
|
15
|
+
*/
|
|
16
|
+
export declare enum RetryStrategy {
|
|
17
|
+
/**
|
|
18
|
+
* Constant delay between retry attempts.
|
|
19
|
+
*/
|
|
20
|
+
FIXED = "FIXED",
|
|
21
|
+
/**
|
|
22
|
+
* Exponential backoff.
|
|
23
|
+
*/
|
|
24
|
+
EXPONENTIAL = "EXPONENTIAL"
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Immutable retry configuration.
|
|
28
|
+
*/
|
|
29
|
+
export interface RetryPolicy {
|
|
30
|
+
/**
|
|
31
|
+
* Enables or disables retries.
|
|
32
|
+
*
|
|
33
|
+
* Default:
|
|
34
|
+
* false
|
|
35
|
+
*/
|
|
36
|
+
readonly enabled?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Maximum retry attempts.
|
|
39
|
+
*
|
|
40
|
+
* Default:
|
|
41
|
+
* 0
|
|
42
|
+
*/
|
|
43
|
+
readonly maxAttempts?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Initial retry delay in milliseconds.
|
|
46
|
+
*
|
|
47
|
+
* Default:
|
|
48
|
+
* 1000
|
|
49
|
+
*/
|
|
50
|
+
readonly initialDelayMs?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Maximum delay between retries.
|
|
53
|
+
*
|
|
54
|
+
* Default:
|
|
55
|
+
* 30000
|
|
56
|
+
*/
|
|
57
|
+
readonly maxDelayMs?: number;
|
|
58
|
+
/**
|
|
59
|
+
* Retry backoff strategy.
|
|
60
|
+
*
|
|
61
|
+
* Default:
|
|
62
|
+
* EXPONENTIAL
|
|
63
|
+
*/
|
|
64
|
+
readonly strategy?: RetryStrategy;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=RetryPolicy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RetryPolicy.d.ts","sourceRoot":"","sources":["../../src/config/RetryPolicy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,oBAAY,aAAa;IACvB;;OAEG;IACH,KAAK,UAAU;IAEf;;OAEG;IACH,WAAW,gBAAgB;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAE9B;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAEjC;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAE7B;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC;CACnC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parmana SDK
|
|
3
|
+
*
|
|
4
|
+
* Canonical retry policy.
|
|
5
|
+
*
|
|
6
|
+
* A RetryPolicy controls how the SDK retries transient
|
|
7
|
+
* communication failures when interacting with the
|
|
8
|
+
* Parmana Runtime.
|
|
9
|
+
*
|
|
10
|
+
* RetryPolicy does NOT change Runtime behavior.
|
|
11
|
+
* It affects only SDK communication.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Retry backoff strategy.
|
|
15
|
+
*/
|
|
16
|
+
export var RetryStrategy;
|
|
17
|
+
(function (RetryStrategy) {
|
|
18
|
+
/**
|
|
19
|
+
* Constant delay between retry attempts.
|
|
20
|
+
*/
|
|
21
|
+
RetryStrategy["FIXED"] = "FIXED";
|
|
22
|
+
/**
|
|
23
|
+
* Exponential backoff.
|
|
24
|
+
*/
|
|
25
|
+
RetryStrategy["EXPONENTIAL"] = "EXPONENTIAL";
|
|
26
|
+
})(RetryStrategy || (RetryStrategy = {}));
|
|
27
|
+
//# sourceMappingURL=RetryPolicy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RetryPolicy.js","sourceRoot":"","sources":["../../src/config/RetryPolicy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,aAUX;AAVD,WAAY,aAAa;IACvB;;OAEG;IACH,gCAAe,CAAA;IAEf;;OAEG;IACH,4CAA2B,CAAA;AAC7B,CAAC,EAVW,aAAa,KAAb,aAAa,QAUxB"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parmana SDK
|
|
3
|
+
*
|
|
4
|
+
* Canonical transport abstraction.
|
|
5
|
+
*
|
|
6
|
+
* A Transport is responsible only for sending requests
|
|
7
|
+
* to the Parmana Runtime and returning responses.
|
|
8
|
+
*
|
|
9
|
+
* It does NOT:
|
|
10
|
+
* - evaluate policy
|
|
11
|
+
* - authorize execution
|
|
12
|
+
* - perform verification
|
|
13
|
+
* - perform replay
|
|
14
|
+
* - implement business logic
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Transport request.
|
|
18
|
+
*/
|
|
19
|
+
export interface TransportRequest {
|
|
20
|
+
/**
|
|
21
|
+
* Relative API path.
|
|
22
|
+
*
|
|
23
|
+
* Example:
|
|
24
|
+
* /execute
|
|
25
|
+
*/
|
|
26
|
+
readonly path: string;
|
|
27
|
+
/**
|
|
28
|
+
* HTTP method.
|
|
29
|
+
*/
|
|
30
|
+
readonly method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
31
|
+
/**
|
|
32
|
+
* Optional request body.
|
|
33
|
+
*/
|
|
34
|
+
readonly body?: unknown;
|
|
35
|
+
/**
|
|
36
|
+
* Optional request headers.
|
|
37
|
+
*/
|
|
38
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
39
|
+
/**
|
|
40
|
+
* HTTP status codes that must be returned as an ordinary
|
|
41
|
+
* TransportResponse instead of being mapped to a thrown ParmanaError
|
|
42
|
+
* subclass, because this specific route's response body at that
|
|
43
|
+
* specific status is not the shared {error, code?} envelope.
|
|
44
|
+
*
|
|
45
|
+
* Default: none (every status >= 400 throws). Today exactly one route
|
|
46
|
+
* needs this: POST /policies/validate returns {valid, errors} — not
|
|
47
|
+
* {error, code?} — at 400 and 404 (but the shared envelope still
|
|
48
|
+
* applies to 401, generated by caller-auth middleware before this
|
|
49
|
+
* route's own handler ever runs). See PolicyApi.validate and
|
|
50
|
+
* /api-reference/error-handling.
|
|
51
|
+
*/
|
|
52
|
+
readonly nonThrowingStatuses?: readonly number[];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Transport response.
|
|
56
|
+
*/
|
|
57
|
+
export interface TransportResponse<T = unknown> {
|
|
58
|
+
/**
|
|
59
|
+
* HTTP status code.
|
|
60
|
+
*/
|
|
61
|
+
readonly status: number;
|
|
62
|
+
/**
|
|
63
|
+
* Response headers.
|
|
64
|
+
*/
|
|
65
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
66
|
+
/**
|
|
67
|
+
* Response body.
|
|
68
|
+
*/
|
|
69
|
+
readonly body: T;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Canonical SDK transport.
|
|
73
|
+
*/
|
|
74
|
+
export interface Transport {
|
|
75
|
+
/**
|
|
76
|
+
* Sends a request to the Parmana Runtime.
|
|
77
|
+
*/
|
|
78
|
+
send<T = unknown>(request: TransportRequest): Promise<TransportResponse<T>>;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=Transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Transport.d.ts","sourceRoot":"","sources":["../../src/config/Transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,MAAM,EACX,KAAK,GACL,MAAM,GACN,KAAK,GACL,OAAO,GACP,QAAQ,CAAC;IAEb;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAEpD;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClD;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,OAAO;IAC5C;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAEnD;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,IAAI,CAAC,CAAC,GAAG,OAAO,EACd,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;CAClC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parmana SDK
|
|
3
|
+
*
|
|
4
|
+
* Canonical transport abstraction.
|
|
5
|
+
*
|
|
6
|
+
* A Transport is responsible only for sending requests
|
|
7
|
+
* to the Parmana Runtime and returning responses.
|
|
8
|
+
*
|
|
9
|
+
* It does NOT:
|
|
10
|
+
* - evaluate policy
|
|
11
|
+
* - authorize execution
|
|
12
|
+
* - perform verification
|
|
13
|
+
* - perform replay
|
|
14
|
+
* - implement business logic
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=Transport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Transport.js","sourceRoot":"","sources":["../../src/config/Transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ParmanaError } from "./ParmanaError.js";
|
|
2
|
+
/**
|
|
3
|
+
* Raised when the Runtime rejects the request for a missing or invalid
|
|
4
|
+
* caller bearer key (HTTP 401). See /api-reference/authentication.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AuthenticationError extends ParmanaError {
|
|
7
|
+
constructor(message: string, options?: {
|
|
8
|
+
requestId?: string;
|
|
9
|
+
cause?: unknown;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=AuthenticationError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthenticationError.d.ts","sourceRoot":"","sources":["../../src/errors/AuthenticationError.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACb,MAAM,mBAAmB,CAAC;AAE3B;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,YAAY;gBAEjD,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QACR,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB;CAkBJ"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ErrorCode, ParmanaError, } from "./ParmanaError.js";
|
|
2
|
+
/**
|
|
3
|
+
* Raised when the Runtime rejects the request for a missing or invalid
|
|
4
|
+
* caller bearer key (HTTP 401). See /api-reference/authentication.
|
|
5
|
+
*/
|
|
6
|
+
export class AuthenticationError extends ParmanaError {
|
|
7
|
+
constructor(message, options) {
|
|
8
|
+
super({
|
|
9
|
+
code: ErrorCode.AUTHENTICATION_ERROR,
|
|
10
|
+
message,
|
|
11
|
+
...(options?.requestId !== undefined && {
|
|
12
|
+
requestId: options.requestId,
|
|
13
|
+
}),
|
|
14
|
+
...(options?.cause !== undefined && {
|
|
15
|
+
cause: options.cause,
|
|
16
|
+
}),
|
|
17
|
+
});
|
|
18
|
+
this.name = "AuthenticationError";
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=AuthenticationError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthenticationError.js","sourceRoot":"","sources":["../../src/errors/AuthenticationError.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,YAAY,GACb,MAAM,mBAAmB,CAAC;AAE3B;;;GAGG;AACH,MAAM,OAAO,mBAAoB,SAAQ,YAAY;IACnD,YACE,OAAe,EACf,OAGC;QAED,KAAK,CAAC;YACJ,IAAI,EAAE,SAAS,CAAC,oBAAoB;YAEpC,OAAO;YAEP,GAAG,CAAC,OAAO,EAAE,SAAS,KAAK,SAAS,IAAI;gBACtC,SAAS,EAAE,OAAO,CAAC,SAAS;aAC7B,CAAC;YAEF,GAAG,CAAC,OAAO,EAAE,KAAK,KAAK,SAAS,IAAI;gBAClC,KAAK,EAAE,OAAO,CAAC,KAAK;aACrB,CAAC;SACH,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ParmanaError } from "./ParmanaError.js";
|
|
2
|
+
/**
|
|
3
|
+
* Raised when the Runtime returns HTTP 403 for a caller that is
|
|
4
|
+
* authenticated but not permitted to do the specific thing it asked
|
|
5
|
+
* for. Covers two distinct denials, both intentionally collapsed to
|
|
6
|
+
* this one SDK error class since both share the same "who you are is
|
|
7
|
+
* known; you can't do this" shape — distinguish them via `serverCode`/
|
|
8
|
+
* `message` if needed, not via `instanceof`:
|
|
9
|
+
* - a caller asserting an authority.principalId it isn't permitted to
|
|
10
|
+
* assert (isPrincipalAllowed, packages/api/src/routes/execute.ts and
|
|
11
|
+
* transactions.ts) — carries no `code` field of its own.
|
|
12
|
+
* - a caller invoking a capability (intent.action) it isn't permitted
|
|
13
|
+
* to invoke (isCapabilityAllowed.ts) — carries
|
|
14
|
+
* `code: "CAPABILITY_NOT_ALLOWED"`, preserved on `serverCode` below.
|
|
15
|
+
* Distinct from AuthenticationError (401, no valid credential at all).
|
|
16
|
+
*/
|
|
17
|
+
export declare class AuthorizationError extends ParmanaError {
|
|
18
|
+
/**
|
|
19
|
+
* The Runtime's own `code` field, when the 403 carried one (currently
|
|
20
|
+
* only the capability-denied case: "CAPABILITY_NOT_ALLOWED"). Undefined
|
|
21
|
+
* for the principal-mismatch case, which the Runtime sends with no
|
|
22
|
+
* `code` at all — see mapHttpErrorResponse.ts for the exact check.
|
|
23
|
+
*/
|
|
24
|
+
readonly serverCode?: string;
|
|
25
|
+
constructor(message: string, options?: {
|
|
26
|
+
requestId?: string;
|
|
27
|
+
cause?: unknown;
|
|
28
|
+
serverCode?: string;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=AuthorizationError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthorizationError.d.ts","sourceRoot":"","sources":["../../src/errors/AuthorizationError.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACb,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;;;GAcG;AACH,qBAAa,kBAAmB,SAAQ,YAAY;IAClD;;;;;OAKG;IACH,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;gBAGlC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QACR,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB;CAsBJ"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ErrorCode, ParmanaError, } from "./ParmanaError.js";
|
|
2
|
+
/**
|
|
3
|
+
* Raised when the Runtime returns HTTP 403 for a caller that is
|
|
4
|
+
* authenticated but not permitted to do the specific thing it asked
|
|
5
|
+
* for. Covers two distinct denials, both intentionally collapsed to
|
|
6
|
+
* this one SDK error class since both share the same "who you are is
|
|
7
|
+
* known; you can't do this" shape — distinguish them via `serverCode`/
|
|
8
|
+
* `message` if needed, not via `instanceof`:
|
|
9
|
+
* - a caller asserting an authority.principalId it isn't permitted to
|
|
10
|
+
* assert (isPrincipalAllowed, packages/api/src/routes/execute.ts and
|
|
11
|
+
* transactions.ts) — carries no `code` field of its own.
|
|
12
|
+
* - a caller invoking a capability (intent.action) it isn't permitted
|
|
13
|
+
* to invoke (isCapabilityAllowed.ts) — carries
|
|
14
|
+
* `code: "CAPABILITY_NOT_ALLOWED"`, preserved on `serverCode` below.
|
|
15
|
+
* Distinct from AuthenticationError (401, no valid credential at all).
|
|
16
|
+
*/
|
|
17
|
+
export class AuthorizationError extends ParmanaError {
|
|
18
|
+
/**
|
|
19
|
+
* The Runtime's own `code` field, when the 403 carried one (currently
|
|
20
|
+
* only the capability-denied case: "CAPABILITY_NOT_ALLOWED"). Undefined
|
|
21
|
+
* for the principal-mismatch case, which the Runtime sends with no
|
|
22
|
+
* `code` at all — see mapHttpErrorResponse.ts for the exact check.
|
|
23
|
+
*/
|
|
24
|
+
serverCode;
|
|
25
|
+
constructor(message, options) {
|
|
26
|
+
super({
|
|
27
|
+
code: ErrorCode.AUTHORIZATION_ERROR,
|
|
28
|
+
message,
|
|
29
|
+
...(options?.requestId !== undefined && {
|
|
30
|
+
requestId: options.requestId,
|
|
31
|
+
}),
|
|
32
|
+
...(options?.cause !== undefined && {
|
|
33
|
+
cause: options.cause,
|
|
34
|
+
}),
|
|
35
|
+
});
|
|
36
|
+
this.name = "AuthorizationError";
|
|
37
|
+
if (options?.serverCode !== undefined) {
|
|
38
|
+
this.serverCode = options.serverCode;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=AuthorizationError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthorizationError.js","sourceRoot":"","sources":["../../src/errors/AuthorizationError.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,YAAY,GACb,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,kBAAmB,SAAQ,YAAY;IAClD;;;;;OAKG;IACa,UAAU,CAAU;IAEpC,YACE,OAAe,EACf,OAIC;QAED,KAAK,CAAC;YACJ,IAAI,EAAE,SAAS,CAAC,mBAAmB;YAEnC,OAAO;YAEP,GAAG,CAAC,OAAO,EAAE,SAAS,KAAK,SAAS,IAAI;gBACtC,SAAS,EAAE,OAAO,CAAC,SAAS;aAC7B,CAAC;YAEF,GAAG,CAAC,OAAO,EAAE,KAAK,KAAK,SAAS,IAAI;gBAClC,KAAK,EAAE,OAAO,CAAC,KAAK;aACrB,CAAC;SACH,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QAEjC,IAAI,OAAO,EAAE,UAAU,KAAK,SAAS,EAAE,CAAC;YACtC,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACvC,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ParmanaError } from "./ParmanaError.js";
|
|
2
|
+
/**
|
|
3
|
+
* Raised when SDK configuration is invalid.
|
|
4
|
+
*/
|
|
5
|
+
export declare class ConfigurationError extends ParmanaError {
|
|
6
|
+
constructor(message: string, options?: {
|
|
7
|
+
requestId?: string;
|
|
8
|
+
cause?: unknown;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=ConfigurationError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigurationError.d.ts","sourceRoot":"","sources":["../../src/errors/ConfigurationError.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACb,MAAM,mBAAmB,CAAC;AAE3B;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,YAAY;gBAEhD,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QACR,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB;CAkBJ"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ErrorCode, ParmanaError, } from "./ParmanaError.js";
|
|
2
|
+
/**
|
|
3
|
+
* Raised when SDK configuration is invalid.
|
|
4
|
+
*/
|
|
5
|
+
export class ConfigurationError extends ParmanaError {
|
|
6
|
+
constructor(message, options) {
|
|
7
|
+
super({
|
|
8
|
+
code: ErrorCode.CONFIGURATION_ERROR,
|
|
9
|
+
message,
|
|
10
|
+
...(options?.requestId !== undefined && {
|
|
11
|
+
requestId: options.requestId,
|
|
12
|
+
}),
|
|
13
|
+
...(options?.cause !== undefined && {
|
|
14
|
+
cause: options.cause,
|
|
15
|
+
}),
|
|
16
|
+
});
|
|
17
|
+
this.name = "ConfigurationError";
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=ConfigurationError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigurationError.js","sourceRoot":"","sources":["../../src/errors/ConfigurationError.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,YAAY,GACb,MAAM,mBAAmB,CAAC;AAE3B;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,YAAY;IAClD,YACE,OAAe,EACf,OAGC;QAED,KAAK,CAAC;YACJ,IAAI,EAAE,SAAS,CAAC,mBAAmB;YAEnC,OAAO;YAEP,GAAG,CAAC,OAAO,EAAE,SAAS,KAAK,SAAS,IAAI;gBACtC,SAAS,EAAE,OAAO,CAAC,SAAS;aAC7B,CAAC;YAEF,GAAG,CAAC,OAAO,EAAE,KAAK,KAAK,SAAS,IAAI;gBAClC,KAAK,EAAE,OAAO,CAAC,KAAK;aACrB,CAAC;SACH,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ParmanaError } from "./ParmanaError.js";
|
|
2
|
+
/**
|
|
3
|
+
* Raised when the Runtime returns HTTP 409: a duplicate
|
|
4
|
+
* businessTransactionId, or an Execution Trust Record not yet in a state
|
|
5
|
+
* that permits the requested operation (e.g. Receipt generation before
|
|
6
|
+
* verification).
|
|
7
|
+
*/
|
|
8
|
+
export declare class ConflictError extends ParmanaError {
|
|
9
|
+
constructor(message: string, options?: {
|
|
10
|
+
requestId?: string;
|
|
11
|
+
cause?: unknown;
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=ConflictError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConflictError.d.ts","sourceRoot":"","sources":["../../src/errors/ConflictError.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACb,MAAM,mBAAmB,CAAC;AAE3B;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,YAAY;gBAE3C,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QACR,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB;CAkBJ"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ErrorCode, ParmanaError, } from "./ParmanaError.js";
|
|
2
|
+
/**
|
|
3
|
+
* Raised when the Runtime returns HTTP 409: a duplicate
|
|
4
|
+
* businessTransactionId, or an Execution Trust Record not yet in a state
|
|
5
|
+
* that permits the requested operation (e.g. Receipt generation before
|
|
6
|
+
* verification).
|
|
7
|
+
*/
|
|
8
|
+
export class ConflictError extends ParmanaError {
|
|
9
|
+
constructor(message, options) {
|
|
10
|
+
super({
|
|
11
|
+
code: ErrorCode.CONFLICT_ERROR,
|
|
12
|
+
message,
|
|
13
|
+
...(options?.requestId !== undefined && {
|
|
14
|
+
requestId: options.requestId,
|
|
15
|
+
}),
|
|
16
|
+
...(options?.cause !== undefined && {
|
|
17
|
+
cause: options.cause,
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
this.name = "ConflictError";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=ConflictError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConflictError.js","sourceRoot":"","sources":["../../src/errors/ConflictError.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,YAAY,GACb,MAAM,mBAAmB,CAAC;AAE3B;;;;;GAKG;AACH,MAAM,OAAO,aAAc,SAAQ,YAAY;IAC7C,YACE,OAAe,EACf,OAGC;QAED,KAAK,CAAC;YACJ,IAAI,EAAE,SAAS,CAAC,cAAc;YAE9B,OAAO;YAEP,GAAG,CAAC,OAAO,EAAE,SAAS,KAAK,SAAS,IAAI;gBACtC,SAAS,EAAE,OAAO,CAAC,SAAS;aAC7B,CAAC;YAEF,GAAG,CAAC,OAAO,EAAE,KAAK,KAAK,SAAS,IAAI;gBAClC,KAAK,EAAE,OAAO,CAAC,KAAK;aACrB,CAAC;SACH,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF"}
|