@layervai/qurl 3.1.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +259 -46
- package/dist/cjs/client-connectors.d.ts +44 -0
- package/dist/cjs/client-connectors.js +189 -0
- package/dist/cjs/client-delegated.d.ts +30 -0
- package/dist/cjs/client-delegated.js +312 -0
- package/dist/cjs/client-errors.d.ts +44 -0
- package/dist/cjs/client-errors.js +219 -0
- package/dist/cjs/client-http-types.d.ts +37 -0
- package/dist/cjs/client-http-types.js +2 -0
- package/dist/cjs/client-input-fields.d.ts +53 -0
- package/dist/cjs/client-input-fields.js +262 -0
- package/dist/cjs/client-limits.d.ts +36 -0
- package/dist/cjs/client-limits.js +61 -0
- package/dist/cjs/client-management.d.ts +12 -0
- package/dist/cjs/client-management.js +119 -0
- package/dist/cjs/client-paths.d.ts +21 -0
- package/dist/cjs/client-paths.js +143 -0
- package/dist/cjs/client-portals.d.ts +82 -0
- package/dist/cjs/client-portals.js +244 -0
- package/dist/cjs/client-resources.d.ts +29 -0
- package/dist/cjs/client-resources.js +331 -0
- package/dist/cjs/client-validation.d.ts +35 -0
- package/dist/cjs/client-validation.js +326 -0
- package/dist/cjs/client.d.ts +45 -75
- package/dist/cjs/client.js +621 -2448
- package/dist/cjs/errors.d.ts +9 -1
- package/dist/cjs/errors.js +10 -1
- package/dist/cjs/index.d.ts +4 -2
- package/dist/cjs/index.js +4 -1
- package/dist/cjs/response-metadata.d.ts +13 -0
- package/dist/cjs/response-metadata.js +38 -0
- package/dist/cjs/share.js +2 -0
- package/dist/cjs/target-path.d.ts +2 -0
- package/dist/cjs/target-path.js +34 -0
- package/dist/cjs/types.d.ts +83 -7
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client-connectors.d.ts +44 -0
- package/dist/esm/client-connectors.js +180 -0
- package/dist/esm/client-delegated.d.ts +30 -0
- package/dist/esm/client-delegated.js +295 -0
- package/dist/esm/client-errors.d.ts +44 -0
- package/dist/esm/client-errors.js +206 -0
- package/dist/esm/client-http-types.d.ts +37 -0
- package/dist/esm/client-http-types.js +1 -0
- package/dist/esm/client-input-fields.d.ts +53 -0
- package/dist/esm/client-input-fields.js +258 -0
- package/dist/esm/client-limits.d.ts +36 -0
- package/dist/esm/client-limits.js +58 -0
- package/dist/esm/client-management.d.ts +12 -0
- package/dist/esm/client-management.js +113 -0
- package/dist/esm/client-paths.d.ts +21 -0
- package/dist/esm/client-paths.js +138 -0
- package/dist/esm/client-portals.d.ts +82 -0
- package/dist/esm/client-portals.js +236 -0
- package/dist/esm/client-resources.d.ts +29 -0
- package/dist/esm/client-resources.js +323 -0
- package/dist/esm/client-validation.d.ts +35 -0
- package/dist/esm/client-validation.js +302 -0
- package/dist/esm/client.d.ts +45 -76
- package/dist/esm/client.js +318 -2147
- package/dist/esm/crid.d.ts +0 -1
- package/dist/esm/crid.js +0 -1
- package/dist/esm/errors.d.ts +9 -2
- package/dist/esm/errors.js +9 -1
- package/dist/esm/index.d.ts +4 -3
- package/dist/esm/index.js +2 -2
- package/dist/esm/internal.d.ts +0 -1
- package/dist/esm/internal.js +0 -1
- package/dist/esm/node/agent-runtime.d.ts +0 -1
- package/dist/esm/node/agent-runtime.js +0 -1
- package/dist/esm/node/agent-state.d.ts +0 -1
- package/dist/esm/node/agent-state.js +0 -1
- package/dist/esm/node/agent-transport.d.ts +0 -1
- package/dist/esm/node/agent-transport.js +0 -1
- package/dist/esm/node/deployment.d.ts +0 -1
- package/dist/esm/node/deployment.js +0 -1
- package/dist/esm/node/file-agent-state.d.ts +0 -1
- package/dist/esm/node/file-agent-state.js +0 -1
- package/dist/esm/node/native-udp.d.ts +0 -1
- package/dist/esm/node/native-udp.js +0 -1
- package/dist/esm/node/nhp-wire.d.ts +0 -1
- package/dist/esm/node/nhp-wire.js +0 -1
- package/dist/esm/node/portal-opener.d.ts +0 -1
- package/dist/esm/node/portal-opener.js +0 -1
- package/dist/esm/node/provider.d.ts +0 -1
- package/dist/esm/node/provider.js +0 -1
- package/dist/esm/node/qv2.d.ts +0 -1
- package/dist/esm/node/qv2.js +0 -1
- package/dist/esm/node/relay.d.ts +0 -1
- package/dist/esm/node/relay.js +0 -1
- package/dist/esm/node/sealed-agent-state.d.ts +0 -1
- package/dist/esm/node/sealed-agent-state.js +0 -1
- package/dist/esm/node/strict-json.d.ts +0 -1
- package/dist/esm/node/strict-json.js +0 -1
- package/dist/esm/node.d.ts +0 -1
- package/dist/esm/node.js +0 -1
- package/dist/esm/response-metadata.d.ts +13 -0
- package/dist/esm/response-metadata.js +33 -0
- package/dist/esm/share.d.ts +0 -1
- package/dist/esm/share.js +2 -1
- package/dist/esm/target-path.d.ts +2 -0
- package/dist/esm/target-path.js +30 -0
- package/dist/esm/types.d.ts +83 -8
- package/dist/esm/types.js +0 -1
- package/dist/esm/version.d.ts +1 -2
- package/dist/esm/version.js +1 -2
- package/package.json +9 -7
- package/dist/esm/client.d.ts.map +0 -1
- package/dist/esm/client.js.map +0 -1
- package/dist/esm/crid.d.ts.map +0 -1
- package/dist/esm/crid.js.map +0 -1
- package/dist/esm/errors.d.ts.map +0 -1
- package/dist/esm/errors.js.map +0 -1
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/internal.d.ts.map +0 -1
- package/dist/esm/internal.js.map +0 -1
- package/dist/esm/node/agent-runtime.d.ts.map +0 -1
- package/dist/esm/node/agent-runtime.js.map +0 -1
- package/dist/esm/node/agent-state.d.ts.map +0 -1
- package/dist/esm/node/agent-state.js.map +0 -1
- package/dist/esm/node/agent-transport.d.ts.map +0 -1
- package/dist/esm/node/agent-transport.js.map +0 -1
- package/dist/esm/node/deployment.d.ts.map +0 -1
- package/dist/esm/node/deployment.js.map +0 -1
- package/dist/esm/node/file-agent-state.d.ts.map +0 -1
- package/dist/esm/node/file-agent-state.js.map +0 -1
- package/dist/esm/node/native-udp.d.ts.map +0 -1
- package/dist/esm/node/native-udp.js.map +0 -1
- package/dist/esm/node/nhp-wire.d.ts.map +0 -1
- package/dist/esm/node/nhp-wire.js.map +0 -1
- package/dist/esm/node/portal-opener.d.ts.map +0 -1
- package/dist/esm/node/portal-opener.js.map +0 -1
- package/dist/esm/node/provider.d.ts.map +0 -1
- package/dist/esm/node/provider.js.map +0 -1
- package/dist/esm/node/qv2.d.ts.map +0 -1
- package/dist/esm/node/qv2.js.map +0 -1
- package/dist/esm/node/relay.d.ts.map +0 -1
- package/dist/esm/node/relay.js.map +0 -1
- package/dist/esm/node/sealed-agent-state.d.ts.map +0 -1
- package/dist/esm/node/sealed-agent-state.js.map +0 -1
- package/dist/esm/node/strict-json.d.ts.map +0 -1
- package/dist/esm/node/strict-json.js.map +0 -1
- package/dist/esm/node.d.ts.map +0 -1
- package/dist/esm/node.js.map +0 -1
- package/dist/esm/share.d.ts.map +0 -1
- package/dist/esm/share.js.map +0 -1
- package/dist/esm/types.d.ts.map +0 -1
- package/dist/esm/types.js.map +0 -1
- package/dist/esm/version.d.ts.map +0 -1
- package/dist/esm/version.js.map +0 -1
package/dist/cjs/errors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { QURLErrorData } from "./types.js";
|
|
1
|
+
import type { QURLErrorData, TombstoneInfo } from "./types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Sentinel `.code` values for SDK-internal failure modes (no real HTTP
|
|
4
4
|
* status applies). Exported as constants so consumers branching on
|
|
@@ -32,6 +32,12 @@ export declare const ERROR_CODE_CONNECTOR_RESOURCE_REVOKED = "connector_resource
|
|
|
32
32
|
export declare const ERROR_CODE_RESOURCE_NOT_FOUND = "resource_not_found";
|
|
33
33
|
/** A Connector slug lookup matched more than one active resource (client-detected, `status: 0`). */
|
|
34
34
|
export declare const ERROR_CODE_AMBIGUOUS_RESOURCE = "ambiguous_resource";
|
|
35
|
+
/**
|
|
36
|
+
* Server `.code` (on a 400 `ValidationError`) when a create that makes a new
|
|
37
|
+
* resource has no `name`, or `PATCH /v1/resources/{id}/preview` sets an empty
|
|
38
|
+
* one. Nothing was written; add the public name and retry.
|
|
39
|
+
*/
|
|
40
|
+
export declare const ERROR_CODE_NAME_REQUIRED = "name_required";
|
|
35
41
|
/** Fallback `.code` when the server returns a non-RFC-7807 response (HTML proxy page, plaintext gateway error, JSON without `error` envelope). */
|
|
36
42
|
export declare const ERROR_CODE_UNKNOWN = "unknown";
|
|
37
43
|
/**
|
|
@@ -67,6 +73,8 @@ export declare class QURLError extends Error {
|
|
|
67
73
|
readonly invalidFields?: Record<string, string>;
|
|
68
74
|
readonly requestId?: string;
|
|
69
75
|
readonly retryAfter?: number;
|
|
76
|
+
/** Retained resource metadata supplied by a 410 Gone response. */
|
|
77
|
+
readonly tombstone?: TombstoneInfo;
|
|
70
78
|
/** Known minted IDs from a rejected terminal batch, for bounded cleanup. No bearer links. */
|
|
71
79
|
readonly partialQurlIds?: readonly string[];
|
|
72
80
|
constructor(data: QURLErrorData);
|
package/dist/cjs/errors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RuntimeError = exports.TimeoutError = exports.NetworkError = exports.DelegatedBatchOutcomeUnknownError = exports.ConnectorResourceOutcomeUnknownError = exports.ServerError = exports.RateLimitError = exports.ValidationError = exports.NotFoundError = exports.AuthorizationError = exports.AuthenticationError = exports.QURLError = exports.ERROR_CODE_UNKNOWN = exports.ERROR_CODE_AMBIGUOUS_RESOURCE = exports.ERROR_CODE_RESOURCE_NOT_FOUND = exports.ERROR_CODE_CONNECTOR_RESOURCE_REVOKED = exports.ERROR_CODE_DELEGATED_BATCH_OUTCOME_UNKNOWN = exports.ERROR_CODE_CONNECTOR_RESOURCE_OUTCOME_UNKNOWN = exports.ERROR_CODE_CRID_MISMATCH = exports.ERROR_CODE_INVALID_CRID_KEY = exports.ERROR_CODE_INVALID_CRID = exports.ERROR_CODE_MISSING_CRID = exports.ERROR_CODE_RUNTIME = exports.ERROR_CODE_TIMEOUT = exports.ERROR_CODE_NETWORK = exports.ERROR_CODE_UNEXPECTED_RESPONSE = exports.ERROR_CODE_CLIENT_VALIDATION = void 0;
|
|
3
|
+
exports.RuntimeError = exports.TimeoutError = exports.NetworkError = exports.DelegatedBatchOutcomeUnknownError = exports.ConnectorResourceOutcomeUnknownError = exports.ServerError = exports.RateLimitError = exports.ValidationError = exports.NotFoundError = exports.AuthorizationError = exports.AuthenticationError = exports.QURLError = exports.ERROR_CODE_UNKNOWN = exports.ERROR_CODE_NAME_REQUIRED = exports.ERROR_CODE_AMBIGUOUS_RESOURCE = exports.ERROR_CODE_RESOURCE_NOT_FOUND = exports.ERROR_CODE_CONNECTOR_RESOURCE_REVOKED = exports.ERROR_CODE_DELEGATED_BATCH_OUTCOME_UNKNOWN = exports.ERROR_CODE_CONNECTOR_RESOURCE_OUTCOME_UNKNOWN = exports.ERROR_CODE_CRID_MISMATCH = exports.ERROR_CODE_INVALID_CRID_KEY = exports.ERROR_CODE_INVALID_CRID = exports.ERROR_CODE_MISSING_CRID = exports.ERROR_CODE_RUNTIME = exports.ERROR_CODE_TIMEOUT = exports.ERROR_CODE_NETWORK = exports.ERROR_CODE_UNEXPECTED_RESPONSE = exports.ERROR_CODE_CLIENT_VALIDATION = void 0;
|
|
4
4
|
exports.createError = createError;
|
|
5
5
|
/**
|
|
6
6
|
* Sentinel `.code` values for SDK-internal failure modes (no real HTTP
|
|
@@ -35,6 +35,12 @@ exports.ERROR_CODE_CONNECTOR_RESOURCE_REVOKED = "connector_resource_revoked";
|
|
|
35
35
|
exports.ERROR_CODE_RESOURCE_NOT_FOUND = "resource_not_found";
|
|
36
36
|
/** A Connector slug lookup matched more than one active resource (client-detected, `status: 0`). */
|
|
37
37
|
exports.ERROR_CODE_AMBIGUOUS_RESOURCE = "ambiguous_resource";
|
|
38
|
+
/**
|
|
39
|
+
* Server `.code` (on a 400 `ValidationError`) when a create that makes a new
|
|
40
|
+
* resource has no `name`, or `PATCH /v1/resources/{id}/preview` sets an empty
|
|
41
|
+
* one. Nothing was written; add the public name and retry.
|
|
42
|
+
*/
|
|
43
|
+
exports.ERROR_CODE_NAME_REQUIRED = "name_required";
|
|
38
44
|
/** Fallback `.code` when the server returns a non-RFC-7807 response (HTML proxy page, plaintext gateway error, JSON without `error` envelope). */
|
|
39
45
|
exports.ERROR_CODE_UNKNOWN = "unknown";
|
|
40
46
|
/**
|
|
@@ -70,6 +76,8 @@ class QURLError extends Error {
|
|
|
70
76
|
invalidFields;
|
|
71
77
|
requestId;
|
|
72
78
|
retryAfter;
|
|
79
|
+
/** Retained resource metadata supplied by a 410 Gone response. */
|
|
80
|
+
tombstone;
|
|
73
81
|
/** Known minted IDs from a rejected terminal batch, for bounded cleanup. No bearer links. */
|
|
74
82
|
partialQurlIds;
|
|
75
83
|
constructor(data) {
|
|
@@ -87,6 +95,7 @@ class QURLError extends Error {
|
|
|
87
95
|
this.invalidFields = data.invalid_fields;
|
|
88
96
|
this.requestId = data.request_id;
|
|
89
97
|
this.retryAfter = data.retry_after;
|
|
98
|
+
this.tombstone = data.tombstone;
|
|
90
99
|
}
|
|
91
100
|
}
|
|
92
101
|
exports.QURLError = QURLError;
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ export { ConnectorResource, isApiKeyRequestScope, ProtectedResource, QURLClient,
|
|
|
2
2
|
export type { EnsureConnectorResourceResult } from "./client.js";
|
|
3
3
|
export { CRIDVerificationError, ShareLink } from "./share.js";
|
|
4
4
|
export type { CRIDVerificationErrorCode, ShareLinkInit, ShareLinkJSON } from "./share.js";
|
|
5
|
-
export { AuthenticationError, AuthorizationError, ConnectorResourceOutcomeUnknownError, createError, DelegatedBatchOutcomeUnknownError, ERROR_CODE_AMBIGUOUS_RESOURCE, ERROR_CODE_CLIENT_VALIDATION, ERROR_CODE_CONNECTOR_RESOURCE_OUTCOME_UNKNOWN, ERROR_CODE_CONNECTOR_RESOURCE_REVOKED, ERROR_CODE_CRID_MISMATCH, ERROR_CODE_DELEGATED_BATCH_OUTCOME_UNKNOWN, ERROR_CODE_INVALID_CRID, ERROR_CODE_INVALID_CRID_KEY, ERROR_CODE_MISSING_CRID, ERROR_CODE_NETWORK, ERROR_CODE_RESOURCE_NOT_FOUND, ERROR_CODE_RUNTIME, ERROR_CODE_TIMEOUT, ERROR_CODE_UNEXPECTED_RESPONSE, ERROR_CODE_UNKNOWN, NetworkError, NotFoundError, QURLError, RateLimitError, RuntimeError, ServerError, TimeoutError, ValidationError, } from "./errors.js";
|
|
5
|
+
export { AuthenticationError, AuthorizationError, ConnectorResourceOutcomeUnknownError, createError, DelegatedBatchOutcomeUnknownError, ERROR_CODE_AMBIGUOUS_RESOURCE, ERROR_CODE_CLIENT_VALIDATION, ERROR_CODE_CONNECTOR_RESOURCE_OUTCOME_UNKNOWN, ERROR_CODE_CONNECTOR_RESOURCE_REVOKED, ERROR_CODE_CRID_MISMATCH, ERROR_CODE_DELEGATED_BATCH_OUTCOME_UNKNOWN, ERROR_CODE_INVALID_CRID, ERROR_CODE_INVALID_CRID_KEY, ERROR_CODE_MISSING_CRID, ERROR_CODE_NAME_REQUIRED, ERROR_CODE_NETWORK, ERROR_CODE_RESOURCE_NOT_FOUND, ERROR_CODE_RUNTIME, ERROR_CODE_TIMEOUT, ERROR_CODE_UNEXPECTED_RESPONSE, ERROR_CODE_UNKNOWN, NetworkError, NotFoundError, QURLError, RateLimitError, RuntimeError, ServerError, TimeoutError, ValidationError, } from "./errors.js";
|
|
6
6
|
export { VERSION } from "./version.js";
|
|
7
|
-
export type { ConsumerAccessPolicy, AccessCode, AccessCodeListOutput, AccessGrant, ConsumerInvitation, ConsumerGrant, ConsumerGrantApprovalInput, ConsumerListInput, ConsumerInvitationListOutput, ConsumerGrantListOutput, AccessPolicy, AccessToken, AIAgentCategory, AIAgentPolicy, ApiKey, ApiKeyListOutput, ApiKeyRequestScope, ApiKeyScope, BatchCreateInput, BatchCreateOutput, BatchItemFailure, BatchItemResult, BatchItemSuccess, BillingInvoiceListOutput, ClientOptions, ConnectorInstallation, ConnectorInstallationCapabilities, ConnectorInstallationListOutput, ConnectorInstallationStats, CreateAccessCodeInput, CreateAccessCodeOutput, CreateApiKeyInput, CreateApiKeyOutput, CreateDurableApiKeyInput, CreateEnrollmentTokenInput, CreateBillingCheckoutInput, CreateDelegatedQurlBatchInput, CreateDelegatedQurlBatchOptions, CreateInput, CreateOutput, CreatePortalOptions, CreateQurlForResourceInput, CreateResourceInput, CreateWebhookInput, CredentialClaim, CredentialClaimInput, CredentialKind, CredentialTarget, CredentialTargetInput, Customer, CheckoutSession, DnsRecord, Domain, DomainCheckDetail, DomainListOutput, DomainVerifyResult, DelegatedQurl, DelegatedQurlBatchAccepted, DelegatedQurlBatchItemFailure, DelegatedQurlBatchItemResult, DelegatedQurlBatchItemSuccess, DelegatedQurlBatchNotModified, DelegatedQurlBatchPending, DelegatedQurlBatchStatus, DelegatedQurlBatchTerminal, DelegatedQurlCreatedData, DelegatedQurlGrant, ExtendInput, Invoice, GetDelegatedQurlBatchOptions, GetDelegatedQurlBatchOutput, ListApiKeysInput, ListBillingInvoicesInput, ListConnectorInstallationsInput, ListDomainsInput, ListInput, ListOutput, ListWebhooksInput, ListWebhookDeliveriesInput, Meta, MintInput, MintOutput, PaginatedOutput, Portal, PortalSession, ProtectUrlOptions, QURL, QURLErrorData, QurlSummary, Quota, RedeemAccessCodeInput, RedeemAccessCodeOutput, RegisterDomainInput, Resource, ResourceDetail, ResourceHandle, ResourceListInput, ResourceListOutput, ResourceType, RequestOptions, ResolveInput, ResolveOutput, Session, SessionListOutput, SessionTerminateOutput, ShareResourceOptions, TombstoneInfo, UnpaginatedOutput, UpdateApiKeyInput, UpdateCustomerInput, UpdateInput, UpdateResourceInput, UpdateResourceQurlInput, UpdateWebhookInput, UsageCostEstimate, UsageCurrentPeriod, UsageDaily, UsageDailyEntry, Webhook, WebhookDelivery, WebhookDeliveryListOutput, WebhookEventType, WebhookEventTypeInfo, WebhookListOutput, WebhookPayload, WebhookWithSecret, } from "./types.js";
|
|
7
|
+
export type { ConsumerAccessPolicy, CRIDPaymentPolicy, AccessCode, AccessCodeListOutput, AccessGrant, ConsumerInvitation, ConsumerGrant, ConsumerGrantApprovalInput, ConsumerListInput, ConsumerInvitationListOutput, ConsumerGrantListOutput, AccessPolicy, AccessToken, AIAgentCategory, AIAgentPolicy, ApiKey, ApiKeyListOutput, ApiKeyRequestScope, ApiKeyScope, BatchCreateInput, BatchCreateOutput, BatchItemFailure, BatchItemResult, BatchItemSuccess, BillingInvoiceListOutput, CallerIdentity, ClientOptions, ConnectorInstallation, ConnectorInstallationCapabilities, ConnectorInstallationListOutput, ConnectorInstallationStats, CreateAccessCodeInput, CreateAccessCodeOutput, CreateApiKeyInput, CreateApiKeyOutput, CreateExternalIdentityBindingInput, CreateExternalIdentityBindingOutput, CreateDurableApiKeyInput, CreateEnrollmentTokenInput, CreateBillingCheckoutInput, CreateDelegatedQurlBatchInput, CreateDelegatedQurlBatchOptions, CreateInput, CreateOutput, CreatePortalOptions, CreateQurlForResourceInput, CreateResourceInput, CreateWebhookInput, CredentialClaim, CredentialClaimInput, CredentialKind, CredentialTarget, CredentialTargetInput, Customer, CheckoutSession, DnsRecord, Domain, DomainCheckDetail, DomainListOutput, DomainVerifyResult, DelegatedQurl, DelegatedQurlBatchAccepted, DelegatedQurlBatchItemFailure, DelegatedQurlBatchItemResult, DelegatedQurlBatchItemSuccess, DelegatedQurlBatchNotModified, DelegatedQurlBatchPending, DelegatedQurlBatchStatus, DelegatedQurlBatchTerminal, DelegatedQurlCreatedData, DelegatedQurlGrant, ExternalIdentityProvider, ExtendInput, Invoice, GetDelegatedQurlBatchOptions, GetDelegatedQurlBatchOutput, ListApiKeysInput, ListBillingInvoicesInput, ListConnectorInstallationsInput, ListDomainsInput, ListInput, ListOutput, ListWebhooksInput, ListWebhookDeliveriesInput, Meta, MintInput, MintOutput, PaginatedOutput, Portal, PortalSession, ProtectUrlOptions, QURL, QURLErrorData, QurlSummary, Quota, RedeemAccessCodeInput, RedeemAccessCodeOutput, RegisterDomainInput, Resource, ResourceDetail, ResourceHandle, ResourceListInput, ResourceListOutput, ResourceType, RequestOptions, ResolveInput, ResolveOutput, Session, SessionListOutput, SessionTerminateOutput, ShareResourceOptions, TombstoneInfo, UnpaginatedOutput, UpdateApiKeyInput, UpdateCustomerInput, UpdateInput, UpdateResourceInput, UpdateResourceQurlInput, UpdateWebhookInput, UsageCostEstimate, UsageCurrentPeriod, UsageDaily, UsageDailyEntry, Webhook, WebhookDelivery, WebhookDeliveryListOutput, WebhookEventType, WebhookEventTypeInfo, WebhookListOutput, WebhookPayload, WebhookWithSecret, } from "./types.js";
|
|
8
|
+
export { getResponseMetadata } from "./response-metadata.js";
|
|
9
|
+
export type { ResponseMetadata } from "./response-metadata.js";
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VERSION = exports.ValidationError = exports.TimeoutError = exports.ServerError = exports.RuntimeError = exports.RateLimitError = exports.QURLError = exports.NotFoundError = exports.NetworkError = exports.ERROR_CODE_UNKNOWN = exports.ERROR_CODE_UNEXPECTED_RESPONSE = exports.ERROR_CODE_TIMEOUT = exports.ERROR_CODE_RUNTIME = exports.ERROR_CODE_RESOURCE_NOT_FOUND = exports.ERROR_CODE_NETWORK = exports.ERROR_CODE_MISSING_CRID = exports.ERROR_CODE_INVALID_CRID_KEY = exports.ERROR_CODE_INVALID_CRID = exports.ERROR_CODE_DELEGATED_BATCH_OUTCOME_UNKNOWN = exports.ERROR_CODE_CRID_MISMATCH = exports.ERROR_CODE_CONNECTOR_RESOURCE_REVOKED = exports.ERROR_CODE_CONNECTOR_RESOURCE_OUTCOME_UNKNOWN = exports.ERROR_CODE_CLIENT_VALIDATION = exports.ERROR_CODE_AMBIGUOUS_RESOURCE = exports.DelegatedBatchOutcomeUnknownError = exports.createError = exports.ConnectorResourceOutcomeUnknownError = exports.AuthorizationError = exports.AuthenticationError = exports.ShareLink = exports.CRIDVerificationError = exports.QURLClient = exports.ProtectedResource = exports.isApiKeyRequestScope = exports.ConnectorResource = void 0;
|
|
3
|
+
exports.getResponseMetadata = exports.VERSION = exports.ValidationError = exports.TimeoutError = exports.ServerError = exports.RuntimeError = exports.RateLimitError = exports.QURLError = exports.NotFoundError = exports.NetworkError = exports.ERROR_CODE_UNKNOWN = exports.ERROR_CODE_UNEXPECTED_RESPONSE = exports.ERROR_CODE_TIMEOUT = exports.ERROR_CODE_RUNTIME = exports.ERROR_CODE_RESOURCE_NOT_FOUND = exports.ERROR_CODE_NETWORK = exports.ERROR_CODE_NAME_REQUIRED = exports.ERROR_CODE_MISSING_CRID = exports.ERROR_CODE_INVALID_CRID_KEY = exports.ERROR_CODE_INVALID_CRID = exports.ERROR_CODE_DELEGATED_BATCH_OUTCOME_UNKNOWN = exports.ERROR_CODE_CRID_MISMATCH = exports.ERROR_CODE_CONNECTOR_RESOURCE_REVOKED = exports.ERROR_CODE_CONNECTOR_RESOURCE_OUTCOME_UNKNOWN = exports.ERROR_CODE_CLIENT_VALIDATION = exports.ERROR_CODE_AMBIGUOUS_RESOURCE = exports.DelegatedBatchOutcomeUnknownError = exports.createError = exports.ConnectorResourceOutcomeUnknownError = exports.AuthorizationError = exports.AuthenticationError = exports.ShareLink = exports.CRIDVerificationError = exports.QURLClient = exports.ProtectedResource = exports.isApiKeyRequestScope = exports.ConnectorResource = void 0;
|
|
4
4
|
var client_js_1 = require("./client.js");
|
|
5
5
|
Object.defineProperty(exports, "ConnectorResource", { enumerable: true, get: function () { return client_js_1.ConnectorResource; } });
|
|
6
6
|
Object.defineProperty(exports, "isApiKeyRequestScope", { enumerable: true, get: function () { return client_js_1.isApiKeyRequestScope; } });
|
|
@@ -24,6 +24,7 @@ Object.defineProperty(exports, "ERROR_CODE_DELEGATED_BATCH_OUTCOME_UNKNOWN", { e
|
|
|
24
24
|
Object.defineProperty(exports, "ERROR_CODE_INVALID_CRID", { enumerable: true, get: function () { return errors_js_1.ERROR_CODE_INVALID_CRID; } });
|
|
25
25
|
Object.defineProperty(exports, "ERROR_CODE_INVALID_CRID_KEY", { enumerable: true, get: function () { return errors_js_1.ERROR_CODE_INVALID_CRID_KEY; } });
|
|
26
26
|
Object.defineProperty(exports, "ERROR_CODE_MISSING_CRID", { enumerable: true, get: function () { return errors_js_1.ERROR_CODE_MISSING_CRID; } });
|
|
27
|
+
Object.defineProperty(exports, "ERROR_CODE_NAME_REQUIRED", { enumerable: true, get: function () { return errors_js_1.ERROR_CODE_NAME_REQUIRED; } });
|
|
27
28
|
Object.defineProperty(exports, "ERROR_CODE_NETWORK", { enumerable: true, get: function () { return errors_js_1.ERROR_CODE_NETWORK; } });
|
|
28
29
|
Object.defineProperty(exports, "ERROR_CODE_RESOURCE_NOT_FOUND", { enumerable: true, get: function () { return errors_js_1.ERROR_CODE_RESOURCE_NOT_FOUND; } });
|
|
29
30
|
Object.defineProperty(exports, "ERROR_CODE_RUNTIME", { enumerable: true, get: function () { return errors_js_1.ERROR_CODE_RUNTIME; } });
|
|
@@ -40,3 +41,5 @@ Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function
|
|
|
40
41
|
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return errors_js_1.ValidationError; } });
|
|
41
42
|
var version_js_1 = require("./version.js");
|
|
42
43
|
Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () { return version_js_1.VERSION; } });
|
|
44
|
+
var response_metadata_js_1 = require("./response-metadata.js");
|
|
45
|
+
Object.defineProperty(exports, "getResponseMetadata", { enumerable: true, get: function () { return response_metadata_js_1.getResponseMetadata; } });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Correlation metadata from one successful API response. */
|
|
2
|
+
export interface ResponseMetadata {
|
|
3
|
+
readonly requestId: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Read this result's server correlation ID. Metadata is non-enumerable and is
|
|
7
|
+
* not part of its JSON payload. Local handles and responses without an ID return undefined.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getResponseMetadata(value: unknown): Readonly<ResponseMetadata> | undefined;
|
|
10
|
+
/** @internal Attach only an identifier already validated at the HTTP boundary. */
|
|
11
|
+
export declare function withResponseMetadata<T>(value: T, requestId: string | undefined): T;
|
|
12
|
+
/** @internal Preserve correlation when a response becomes a new SDK value. */
|
|
13
|
+
export declare function copyResponseMetadata<T>(source: unknown, value: T): T;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getResponseMetadata = getResponseMetadata;
|
|
4
|
+
exports.withResponseMetadata = withResponseMetadata;
|
|
5
|
+
exports.copyResponseMetadata = copyResponseMetadata;
|
|
6
|
+
// A constant global symbol survives mixed ESM/CJS loads without a mutable registry.
|
|
7
|
+
const RESPONSE_METADATA = Symbol.for("@layervai/qurl.responseMetadata.v1");
|
|
8
|
+
function isObject(value) {
|
|
9
|
+
return value !== null && (typeof value === "object" || typeof value === "function");
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Read this result's server correlation ID. Metadata is non-enumerable and is
|
|
13
|
+
* not part of its JSON payload. Local handles and responses without an ID return undefined.
|
|
14
|
+
*/
|
|
15
|
+
function getResponseMetadata(value) {
|
|
16
|
+
if (!isObject(value))
|
|
17
|
+
return undefined;
|
|
18
|
+
return Object.getOwnPropertyDescriptor(value, RESPONSE_METADATA)?.value;
|
|
19
|
+
}
|
|
20
|
+
/** @internal Attach only an identifier already validated at the HTTP boundary. */
|
|
21
|
+
function withResponseMetadata(value, requestId) {
|
|
22
|
+
if (!isObject(value) || !requestId)
|
|
23
|
+
return value;
|
|
24
|
+
// Diagnostic metadata must not turn a successful mutation into a failure.
|
|
25
|
+
if (Object.getOwnPropertyDescriptor(value, RESPONSE_METADATA) || !Object.isExtensible(value))
|
|
26
|
+
return value;
|
|
27
|
+
Object.defineProperty(value, RESPONSE_METADATA, {
|
|
28
|
+
value: Object.freeze({ requestId }),
|
|
29
|
+
enumerable: false,
|
|
30
|
+
writable: false,
|
|
31
|
+
configurable: false,
|
|
32
|
+
});
|
|
33
|
+
return value;
|
|
34
|
+
}
|
|
35
|
+
/** @internal Preserve correlation when a response becomes a new SDK value. */
|
|
36
|
+
function copyResponseMetadata(source, value) {
|
|
37
|
+
return withResponseMetadata(value, getResponseMetadata(source)?.requestId);
|
|
38
|
+
}
|
package/dist/cjs/share.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ShareLink = exports.CRIDVerificationError = void 0;
|
|
4
|
+
const response_metadata_js_1 = require("./response-metadata.js");
|
|
4
5
|
const errors_js_1 = require("./errors.js");
|
|
5
6
|
const crid_js_1 = require("./crid.js");
|
|
6
7
|
/** A local, fail-closed CRID verification failure. */
|
|
@@ -48,6 +49,7 @@ class ShareLink {
|
|
|
48
49
|
this.#expiresAtEpochMs = Number.isFinite(expiresAtEpochMs) ? expiresAtEpochMs : undefined;
|
|
49
50
|
this.expiresInSeconds = init.expiresInSeconds;
|
|
50
51
|
this.singleUse = init.singleUse;
|
|
52
|
+
(0, response_metadata_js_1.copyResponseMetadata)(init, this);
|
|
51
53
|
Object.freeze(this);
|
|
52
54
|
}
|
|
53
55
|
/** Effective expiry as a defensive copy; mutating it does not change this share. */
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isCanonicalTargetPath = isCanonicalTargetPath;
|
|
4
|
+
exports.requireCanonicalTargetPath = requireCanonicalTargetPath;
|
|
5
|
+
const client_errors_js_1 = require("./client-errors.js");
|
|
6
|
+
const client_limits_js_1 = require("./client-limits.js");
|
|
7
|
+
const client_validation_js_1 = require("./client-validation.js");
|
|
8
|
+
// TODO(upstream-contract): qurl-service ValidateTargetPath and the released
|
|
9
|
+
// target_path_v1_vectors define this grammar without normalization.
|
|
10
|
+
const INVALID_TARGET_PATH_ASCII = /[^A-Za-z0-9._~!$&()*+,;=:@%/?-]/;
|
|
11
|
+
const MALFORMED_PERCENT_ESCAPE = /%(?![0-9a-fA-F]{2})/;
|
|
12
|
+
function isCanonicalTargetPath(value) {
|
|
13
|
+
if (typeof value !== "string" ||
|
|
14
|
+
value.length > client_limits_js_1.MAX_TARGET_PATH ||
|
|
15
|
+
value.startsWith("//") ||
|
|
16
|
+
!value.startsWith("/") ||
|
|
17
|
+
INVALID_TARGET_PATH_ASCII.test(value) ||
|
|
18
|
+
MALFORMED_PERCENT_ESCAPE.test(value))
|
|
19
|
+
return false;
|
|
20
|
+
const path = value.split("?", 1)[0];
|
|
21
|
+
// Queries remain encoded data; only the path defines authorization.
|
|
22
|
+
return (!/[%!()*;]/.test(path) &&
|
|
23
|
+
!path.slice(1).includes("//") &&
|
|
24
|
+
!path.split("/").some((segment) => segment === "." || segment === ".."));
|
|
25
|
+
}
|
|
26
|
+
function requireCanonicalTargetPath(value, field) {
|
|
27
|
+
if (value === undefined)
|
|
28
|
+
return;
|
|
29
|
+
(0, client_validation_js_1.requireMaxUtf8Bytes)(value, field, client_limits_js_1.MAX_TARGET_PATH);
|
|
30
|
+
(0, client_validation_js_1.requireNonEmptyIfPresent)(value, field);
|
|
31
|
+
if (!isCanonicalTargetPath(value)) {
|
|
32
|
+
throw (0, client_errors_js_1.clientValidationError)(`${field}: must be a canonical ASCII path with optional query`);
|
|
33
|
+
}
|
|
34
|
+
}
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -56,7 +56,8 @@ export interface AccessToken {
|
|
|
56
56
|
use_count: number;
|
|
57
57
|
qurl_site?: string;
|
|
58
58
|
created_at: string;
|
|
59
|
-
|
|
59
|
+
/** Optional in API summaries; omission does not imply an unlimited lifetime. */
|
|
60
|
+
expires_at?: string;
|
|
60
61
|
}
|
|
61
62
|
/** Per-qURL summary returned from resource-detail and token-update endpoints. */
|
|
62
63
|
export interface QurlSummary {
|
|
@@ -113,6 +114,15 @@ export interface QURL {
|
|
|
113
114
|
* the resource and must be set through {@link UpdateInput} after creation.
|
|
114
115
|
*/
|
|
115
116
|
export interface CreateInput {
|
|
117
|
+
/**
|
|
118
|
+
* Public name recipients see: the qURL page, link previews, and the passkey
|
|
119
|
+
* they save. Not `description`, which stays a private owner note. Sent only
|
|
120
|
+
* when set; needs a qURL API version that accepts it. The service requires
|
|
121
|
+
* it when this call creates a resource (`400 name_required` otherwise) and
|
|
122
|
+
* ignores it when an existing resource is reused. Rename later with
|
|
123
|
+
* `PATCH /v1/resources/{id}/preview`.
|
|
124
|
+
*/
|
|
125
|
+
name?: string;
|
|
116
126
|
/** Omit to keep an existing resource's privacy; a new URL or Connector resource defaults to private. */
|
|
117
127
|
private?: boolean;
|
|
118
128
|
type?: ResourceType;
|
|
@@ -137,6 +147,8 @@ export interface CreateOutput {
|
|
|
137
147
|
expires_at?: string;
|
|
138
148
|
label?: string;
|
|
139
149
|
type?: ResourceType;
|
|
150
|
+
/** Recorded Connector path scope; omitted for the bare origin. */
|
|
151
|
+
target_path?: string;
|
|
140
152
|
}
|
|
141
153
|
/** Input for listing qURLs. */
|
|
142
154
|
export interface ListInput {
|
|
@@ -237,6 +249,8 @@ export interface MintOutput {
|
|
|
237
249
|
}
|
|
238
250
|
/** Options for `QURLClient.protectUrl`. */
|
|
239
251
|
export interface ProtectUrlOptions {
|
|
252
|
+
/** Public resource name; see {@link CreateInput.name}. */
|
|
253
|
+
name?: string;
|
|
240
254
|
private?: boolean;
|
|
241
255
|
consumerAccess?: ConsumerAccessPolicy;
|
|
242
256
|
/** Optional resource-level metadata. Max 500 chars. */
|
|
@@ -282,11 +296,17 @@ export interface CreatePortalOptions {
|
|
|
282
296
|
sessionDuration?: string | number;
|
|
283
297
|
/**
|
|
284
298
|
* Scope a qURL for an existing tunnel resource to one path and its
|
|
285
|
-
* descendants.
|
|
286
|
-
* bytes
|
|
287
|
-
*
|
|
299
|
+
* descendants. Must be a canonical ASCII path with optional query, at most
|
|
300
|
+
* 2048 bytes. The API enforces the tunnel-only resource boundary.
|
|
301
|
+
* This option is invalid with `createPortalForUrl`.
|
|
288
302
|
*/
|
|
289
303
|
targetPath?: string;
|
|
304
|
+
/**
|
|
305
|
+
* Public name of the resource `createPortalForUrl` creates; see
|
|
306
|
+
* {@link CreateInput.name}. Required by the service when that call creates a
|
|
307
|
+
* resource. `createPortal` rejects it: the resource already exists.
|
|
308
|
+
*/
|
|
309
|
+
name?: string;
|
|
290
310
|
}
|
|
291
311
|
/**
|
|
292
312
|
* A qURL link minted for a protected resource.
|
|
@@ -312,6 +332,8 @@ export interface Portal {
|
|
|
312
332
|
qurlId?: string;
|
|
313
333
|
/** Token label, when returned by the API. */
|
|
314
334
|
label?: string;
|
|
335
|
+
/** Recorded Connector path scope; absent means bare origin. */
|
|
336
|
+
targetPath?: string;
|
|
315
337
|
}
|
|
316
338
|
/**
|
|
317
339
|
* Result of a successful `enterPortal`: the reachable resource.
|
|
@@ -345,7 +367,10 @@ export interface ResolveOutput {
|
|
|
345
367
|
resource_id: string;
|
|
346
368
|
access_grant?: AccessGrant;
|
|
347
369
|
}
|
|
348
|
-
/**
|
|
370
|
+
/**
|
|
371
|
+
* Quota information. The API schema does not require rate_limits, usage, or
|
|
372
|
+
* their inner fields; minimal responses may omit them. Check presence before use.
|
|
373
|
+
*/
|
|
349
374
|
export interface Quota {
|
|
350
375
|
plan: "free" | "growth" | "enterprise" | (string & {});
|
|
351
376
|
period_start: string;
|
|
@@ -413,6 +438,7 @@ export interface BatchCreateOutput {
|
|
|
413
438
|
succeeded: number;
|
|
414
439
|
failed: number;
|
|
415
440
|
results: BatchItemResult[];
|
|
441
|
+
/** Canonical meta.request_id wins; data.request_id is preserved when meta omits it. */
|
|
416
442
|
request_id?: string;
|
|
417
443
|
}
|
|
418
444
|
/** One recipient grant redeemed from an opaque delegated mint capability. */
|
|
@@ -513,13 +539,22 @@ export interface DelegatedQurl {
|
|
|
513
539
|
access_policy?: AccessPolicy;
|
|
514
540
|
}
|
|
515
541
|
/** Private resource policy. Contract fulfillment comes from the publisher backend. */
|
|
542
|
+
export interface CRIDPaymentPolicy {
|
|
543
|
+
account_id: string;
|
|
544
|
+
price_id: string;
|
|
545
|
+
/** One-time access duration; zero lasts for the resource lifetime. Subscriptions require zero. */
|
|
546
|
+
access_seconds: number;
|
|
547
|
+
}
|
|
516
548
|
export interface ConsumerAccessPolicy {
|
|
517
549
|
mode: "keys" | "invite_only" | "email_capture" | "review" | "contract";
|
|
518
550
|
version: number;
|
|
519
551
|
contract_id?: string;
|
|
552
|
+
payment?: CRIDPaymentPolicy;
|
|
520
553
|
}
|
|
521
554
|
/** Input for creating a resource directly. */
|
|
522
555
|
export interface CreateResourceInput {
|
|
556
|
+
/** Public resource name; see {@link CreateInput.name}. */
|
|
557
|
+
name?: string;
|
|
523
558
|
private?: boolean;
|
|
524
559
|
consumer_access?: ConsumerAccessPolicy;
|
|
525
560
|
type?: ResourceType;
|
|
@@ -603,7 +638,7 @@ export interface ShareResourceOptions {
|
|
|
603
638
|
ttlSeconds?: number;
|
|
604
639
|
}
|
|
605
640
|
/** Input for minting a qURL against an existing resource. */
|
|
606
|
-
export type CreateQurlForResourceInput = Omit<CreateInput, "target_url" | "custom_domain" | "type" | "private"> & {
|
|
641
|
+
export type CreateQurlForResourceInput = Omit<CreateInput, "target_url" | "custom_domain" | "type" | "private" | "name"> & {
|
|
607
642
|
/**
|
|
608
643
|
* Path this resource qURL resolves to (e.g. "/api/detect").
|
|
609
644
|
*
|
|
@@ -916,6 +951,16 @@ export interface UpdateApiKeyInput {
|
|
|
916
951
|
name?: string;
|
|
917
952
|
scopes?: ApiKeyRequestScope[];
|
|
918
953
|
}
|
|
954
|
+
/** Identity of the credential used for the current request. */
|
|
955
|
+
export interface CallerIdentity {
|
|
956
|
+
owner_id: string;
|
|
957
|
+
auth_type: OpenString<"api_key" | "jwt">;
|
|
958
|
+
/**
|
|
959
|
+
* Available API-key metadata, which may be omitted even for an API-key caller.
|
|
960
|
+
* JWT callers omit it. Display fields are optional; no credential secret is returned.
|
|
961
|
+
*/
|
|
962
|
+
api_key?: ApiKey;
|
|
963
|
+
}
|
|
919
964
|
export interface ApiKey {
|
|
920
965
|
key_id?: string;
|
|
921
966
|
key_prefix?: string;
|
|
@@ -997,6 +1042,7 @@ export interface QURLErrorData {
|
|
|
997
1042
|
invalid_fields?: Record<string, string>;
|
|
998
1043
|
request_id?: string;
|
|
999
1044
|
retry_after?: number;
|
|
1045
|
+
tombstone?: TombstoneInfo;
|
|
1000
1046
|
}
|
|
1001
1047
|
/** Per-call options accepted by mutating requests. */
|
|
1002
1048
|
export interface RequestOptions {
|
|
@@ -1018,13 +1064,19 @@ export interface ClientOptions {
|
|
|
1018
1064
|
/** Base URL. Defaults to https://api.layerv.ai */
|
|
1019
1065
|
baseUrl?: string;
|
|
1020
1066
|
/**
|
|
1021
|
-
* Custom fetch implementation
|
|
1067
|
+
* Custom fetch implementation, called with globalThis as its receiver.
|
|
1068
|
+
* Bind methods that need a different receiver. Redirect-safety requires it to honor
|
|
1022
1069
|
* `redirect: "manual"`, accurately expose `Response.redirected`, and leave
|
|
1023
1070
|
* `Response.url` empty or set it to the normalized request URL when no
|
|
1024
1071
|
* redirect was followed. Every Response-like result must also provide a
|
|
1025
1072
|
* `headers` object with a WHATWG-compatible `headers.get(name)` method.
|
|
1026
1073
|
*/
|
|
1027
1074
|
fetch?: typeof globalThis.fetch;
|
|
1075
|
+
/**
|
|
1076
|
+
* Decoded API response bytes per request. Default: 1 MiB.
|
|
1077
|
+
* Integer range: 1 byte through 16 MiB.
|
|
1078
|
+
*/
|
|
1079
|
+
maxResponseBodyBytes?: number;
|
|
1028
1080
|
/** Maximum retry attempts for transient errors (429, 5xx). Default: 3. */
|
|
1029
1081
|
maxRetries?: number;
|
|
1030
1082
|
/**
|
|
@@ -1081,4 +1133,28 @@ export interface ConsumerInvitationListOutput extends PaginatedOutput {
|
|
|
1081
1133
|
export interface ConsumerGrantListOutput extends PaginatedOutput {
|
|
1082
1134
|
grants: ConsumerGrant[];
|
|
1083
1135
|
}
|
|
1136
|
+
/** Provider authenticated by its configured confidential OAuth client. */
|
|
1137
|
+
export type ExternalIdentityProvider = "slack" | "discord" | "teams";
|
|
1138
|
+
export interface CreateExternalIdentityBindingInput {
|
|
1139
|
+
provider: ExternalIdentityProvider;
|
|
1140
|
+
external_id: string;
|
|
1141
|
+
display_name?: string;
|
|
1142
|
+
/** Explicit reauthorization only; revokes the previous binding key. */
|
|
1143
|
+
rotate_existing?: boolean;
|
|
1144
|
+
}
|
|
1145
|
+
/** Persist api_key.plaintext securely immediately; never log this result. */
|
|
1146
|
+
export interface CreateExternalIdentityBindingOutput {
|
|
1147
|
+
binding_id: string;
|
|
1148
|
+
provider: ExternalIdentityProvider;
|
|
1149
|
+
external_id: string;
|
|
1150
|
+
display_name?: string;
|
|
1151
|
+
api_key: {
|
|
1152
|
+
key_id: string;
|
|
1153
|
+
key_prefix: string;
|
|
1154
|
+
/** One-time secret, replayable only with the same request within 24 hours. */
|
|
1155
|
+
plaintext: string;
|
|
1156
|
+
};
|
|
1157
|
+
scopes: ApiKeyRequestScope[];
|
|
1158
|
+
created_at: string;
|
|
1159
|
+
}
|
|
1084
1160
|
export {};
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "
|
|
1
|
+
export declare const VERSION = "4.0.0";
|
package/dist/cjs/version.js
CHANGED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { CreatePortalOptions, Portal, RequestOptions, Resource } from "./types.js";
|
|
2
|
+
import type { QURLClient } from "./client.js";
|
|
3
|
+
export declare const CONNECTOR_SLUG_PATTERN: RegExp;
|
|
4
|
+
export declare function requireConnectorSlug(slug: string, method: string): void;
|
|
5
|
+
export declare function classifyConnectorMutationFailure(operation: "ensure" | "delete", error: unknown): never;
|
|
6
|
+
export declare function requireConnectorSubtleCrypto(method: string): void;
|
|
7
|
+
type ConnectorResourceExpectation = {
|
|
8
|
+
slug?: string;
|
|
9
|
+
crid?: string;
|
|
10
|
+
revokedIsLifecycleError?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare function verifyResourceIdentity(resource: {
|
|
13
|
+
resource_id?: unknown;
|
|
14
|
+
crid?: unknown;
|
|
15
|
+
} | undefined, method: string, expectedCrid?: string): Promise<void>;
|
|
16
|
+
export declare function parseConnectorResource(client: QURLClient, value: unknown, method: string, expectation?: ConnectorResourceExpectation): Promise<ConnectorResource>;
|
|
17
|
+
/** Result of idempotently ensuring a qURL Connector resource. */
|
|
18
|
+
export interface EnsureConnectorResourceResult {
|
|
19
|
+
resource: ConnectorResource;
|
|
20
|
+
foundExisting: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare const CONNECTOR_RESOURCE_CONSTRUCTOR_TOKEN: unique symbol;
|
|
23
|
+
/**
|
|
24
|
+
* A validated qURL Connector resource bound to the client that loaded it.
|
|
25
|
+
*
|
|
26
|
+
* Resource identity, reverse-routing identity, and NHP admission identity are
|
|
27
|
+
* distinct server-issued values. Callers must consume each field verbatim and
|
|
28
|
+
* must never derive one from another.
|
|
29
|
+
*/
|
|
30
|
+
export declare class ConnectorResource {
|
|
31
|
+
#private;
|
|
32
|
+
readonly resourcePublicKey: string;
|
|
33
|
+
/** Required public identifier, verified against the returned resource key. */
|
|
34
|
+
readonly crid: string;
|
|
35
|
+
readonly connectorRoutingId: string;
|
|
36
|
+
readonly knockResourceId: string;
|
|
37
|
+
readonly slug: string;
|
|
38
|
+
readonly alias?: string;
|
|
39
|
+
/** @internal Instances are returned by QURLClient after wire validation. */
|
|
40
|
+
constructor(client: QURLClient, details: Resource, validationToken: typeof CONNECTOR_RESOURCE_CONSTRUCTOR_TOKEN);
|
|
41
|
+
/** Mint a short-lived portal for this Connector resource. */
|
|
42
|
+
createPortal(opts?: CreatePortalOptions, requestOptions?: RequestOptions): Promise<Portal>;
|
|
43
|
+
}
|
|
44
|
+
export {};
|