@apicircle/core 1.0.8 → 1.0.9
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/dist/index.cjs +169 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -3
- package/dist/index.d.ts +15 -3
- package/dist/index.js +165 -0
- package/dist/index.js.map +1 -1
- package/dist/{patches-ysO3y8pG.d.cts → patches-h_K1VcZR.d.cts} +22 -1
- package/dist/{patches-ysO3y8pG.d.ts → patches-h_K1VcZR.d.ts} +22 -1
- package/dist/workspace/file-backed.d.cts +1 -1
- package/dist/workspace/file-backed.d.ts +1 -1
- package/dist/workspace/registry.d.cts +1 -1
- package/dist/workspace/registry.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BodyType, RequestAuth, Request, RequestRun, Folder, RequestBody, HttpMethod, EnvironmentVariable, Assertion, ContextExtraction, WorkspaceSynced, LinkedSnapshot, RequestOverride, EnvironmentVariableOverride, ExecutionPlan, PlanRun } from '@apicircle/shared';
|
|
2
|
-
import { W as WorkspaceState, a as WorkspacePatch, P as ParsedApicircleFolderExport } from './patches-
|
|
3
|
-
export { A as APICIRCLE_FOLDER_EXPORT_FORMAT, b as ApicircleFolderExportDependencies, c as ApicircleFolderExportV1, C as CollectFolderExportArgs, d as CollectFolderExportResult, F as FolderExportCredential, e as FolderExportReport, f as WorkspacePatchKind, g as collectFolderExport, h as collectFolderExportCredentials, i as isApicircleFolderExport, p as parseApicircleFolderExport, j as parseApicircleFolderExportDoc, r as redactFolderExportCredentials, s as serializeFolderExport, k as suggestFolderExportFilename } from './patches-
|
|
2
|
+
import { W as WorkspaceState, a as WorkspacePatch, P as ParsedApicircleFolderExport } from './patches-h_K1VcZR.cjs';
|
|
3
|
+
export { A as APICIRCLE_FOLDER_EXPORT_FORMAT, b as ApicircleFolderExportDependencies, c as ApicircleFolderExportV1, C as CollectFolderExportArgs, d as CollectFolderExportResult, F as FolderExportCredential, e as FolderExportReport, f as WorkspacePatchKind, g as collectFolderExport, h as collectFolderExportCredentials, i as isApicircleFolderExport, p as parseApicircleFolderExport, j as parseApicircleFolderExportDoc, r as redactFolderExportCredentials, s as serializeFolderExport, k as suggestFolderExportFilename } from './patches-h_K1VcZR.cjs';
|
|
4
4
|
|
|
5
5
|
type HeaderEntry$1 = {
|
|
6
6
|
key: string;
|
|
@@ -1360,6 +1360,18 @@ declare function generateWorkingBranchName(opts: BranchNameOptions): string;
|
|
|
1360
1360
|
*/
|
|
1361
1361
|
declare function serializeWorkspaceForGit(synced: WorkspaceSynced): string;
|
|
1362
1362
|
|
|
1363
|
+
/** The dotfolder under the repo root that owns every API-Circle-managed
|
|
1364
|
+
* file in a Git-backed workspace. */
|
|
1365
|
+
declare const WORKSPACE_DIR = ".apicircle";
|
|
1366
|
+
/** On-disk path for the synced workspace document inside a Git repo. */
|
|
1367
|
+
declare const WORKSPACE_JSON_PATH = ".apicircle/workspace.json";
|
|
1368
|
+
/** Directory holding per-attachment blob files (`<slotId>`). */
|
|
1369
|
+
declare const ATTACHMENTS_DIR = ".apicircle/attachments";
|
|
1370
|
+
/** Build the on-disk path for a single attachment slot. Caller is
|
|
1371
|
+
* responsible for URL-encoding when this is passed to the GitHub
|
|
1372
|
+
* Contents API. */
|
|
1373
|
+
declare function attachmentPath(slotId: string): string;
|
|
1374
|
+
|
|
1363
1375
|
/** Error thrown when the input fails any of our checks. `code` lets the UI
|
|
1364
1376
|
* branch on the specific failure (oversized, bad JSON, wrong shape, etc.)
|
|
1365
1377
|
* without parsing the message string. */
|
|
@@ -1920,4 +1932,4 @@ interface TransformSavings {
|
|
|
1920
1932
|
declare function computeTransformSavings(body: string, contentType?: string): TransformSavings;
|
|
1921
1933
|
declare const TRANSFORM_FORMAT_LABELS: Record<TransformFormat, string>;
|
|
1922
1934
|
|
|
1923
|
-
export { ANONYMOUS_ACTOR, type ApplyMutationOptions, type ApplyMutationResult, type AssertionResult, type AttachmentResolver, type AttachmentSlotRef, type AuthApplyOptions, type AuthApplyResult, type AuthApplyTarget, type AuthApplyWarning, type AuthCodeExchangeArgs, type AutoHeaderOverrides, type BranchNameOptions, type BuildDigestArgs, type BuildNtlmType3Args, type BuildRequestOptions, type BuiltRequest, type ClientCredentialsArgs, type ConflictResolution, type HeaderEntry$1 as ContentTypeHeaderEntry, type ContextExtractionResult, DESKTOP_APP_ORIGIN, type DeviceAuthorizationArgs, type DeviceAuthorizationResponse, type DiffEntry, type DiffStatus, type DigestChallenge, EMPTY_UNPUSHED_SUMMARY, type EncryptedBindingHint, type EncryptedPayload, type EntityBucket, type ExecuteOptions, type ExecutionResult, type FetchOAuth2TokenArgs, type GraphQLField, type GraphQLSchemaInfo, HTTP_HEADERS_MAP, type HawkSignArgs, type HeaderEntry, type HeaderSuggestionMode, type ImportApicircleFolderResult, type ImportedFolder, type ImportedRequest, type JwtAlgorithm, type JwtSignArgs, type ApplyArgs as LinkedApplyArgs, type ApplyResult as LinkedApplyResult, type PreviewArgs as LinkedPreviewArgs, type LinkedUpdateBucket, type LinkedUpdateEntry, type LinkedUpdatePreview, type LinkedUpdateResolutionMap, type LinkedUpdateStatus, type MonacoLanguage, type NtlmType2Challenge, type OAuth2ErrorResponse, OAuth2TokenError, type OAuth2TokenResponse, type ParsedApicircleEnvironment, ParsedApicircleFolderExport, type ParsedCurl, type ParsedPostmanCollection, type ParsedPostmanEnvironment, type ParsedVersion, type PkceExchangeArgs, type PkceMethod, type PlanRunAuthorizationContext, PlanRunDeniedError, type PlanStepResult, type PollDeviceFlowArgs, type PreSendBlocker, type PreSendValidationInput, type PreSendValidationResult, type PreSendWarning, type PublishReleaseArgs, type RefreshTokenArgs, RemoteWorkspaceParseError, type ResolutionMap, type ResolutionScope, type ResolveInheritedAuthArgs, type ResolvePlanRefResult, type ResolveResult, type RopcArgs, type RunActor, type RunPlanOptions, type RunPlanResult, type SigV4SignArgs, type SigV4SignResult, TRANSFORM_FORMAT_LABELS, type ThreeWayDiff, type TransformCandidate, type TransformFormat, type TransformSavings, type UnpushedChange, type UnpushedSummary, type VariableSource, type VariableSuggestion, WorkspacePatch, WorkspaceState, applyAuth, applyAwsSigV4, applyContentTypeForBodyType, applyLinkedUpdate, applyMerge, applyMutation, applyPathParams, assertNoPlaintextCredentials, buildAuthorizeUrl, buildAutoHeaders, buildDigestAuthHeader, buildHawkAuthHeader, buildNtlmType1Negotiate, buildNtlmType3Authenticate, buildRequest, buildScope, collectAttachmentSlots, collectVariableSuggestions, compareSemver, composeBody, composeCookieHeader, composeHeaders, composeUrl, composeUrlWithQuery, computeCodeChallenge, computeThreeWayDiff, computeTransformSavings, decryptString, deprecateRelease, deriveKeyFromSlotValue, encryptString, exchangeAuthCode, exchangePkce, executeRequest, exportKey, extractContext, fetchOAuth2Token, findPathPlaceholders, generateAesKey, generateCodeVerifier, generateSlotSalt, generateSpanId, generateTraceParent, generateWorkingBranchName, getBodyTypeForContentType, getContentTypeForBodyType, getHeaderEntry, getHeaderValues, getLanguageFromBodyType, getLanguageFromContentType, getVariableAutocomplete, hasUnpushedChanges, importApicircleFolderInto, importKey, isApicircleEnvironment, isDesktop, isInsomniaExport, isPostmanEnvironment, isPostmanV2Collection, isValidSemver, lookup, mergeWithAutoHeaders, normalizeContentType, parseApicircleEnvironment, parseApicircleEnvironmentDoc, parseCurl, parseDigestChallenge, parseGraphqlSchema, parseInsomniaCollection, parseNtlmType2Challenge, parsePostmanCollection, parsePostmanEnvironment, parseSemver, parseUrlQuery, parseWorkspaceJson, pollDeviceFlow, preSendValidation, previewLinkedUpdate, publishRelease, readJsonPath, redactForGit, refreshToken, requestDeviceAuthorization, requestRunToExecutionResult, resolveInheritedAuth, resolvePlanRef, resolveString, resolveStringMap, runAssertions, runClientCredentials, runPlan, runRopc, serializePayload, serializeWorkspaceForGit, signJwt, slugify, sortVersionsDesc, suggestHeaders, summarizeUnpushedChanges, supportedContentTypeLanguageMap, toCsv, toToon, toYaml, tokenizeCurl, tryParsePayload, validateBranchName, yankRelease };
|
|
1935
|
+
export { ANONYMOUS_ACTOR, ATTACHMENTS_DIR, type ApplyMutationOptions, type ApplyMutationResult, type AssertionResult, type AttachmentResolver, type AttachmentSlotRef, type AuthApplyOptions, type AuthApplyResult, type AuthApplyTarget, type AuthApplyWarning, type AuthCodeExchangeArgs, type AutoHeaderOverrides, type BranchNameOptions, type BuildDigestArgs, type BuildNtlmType3Args, type BuildRequestOptions, type BuiltRequest, type ClientCredentialsArgs, type ConflictResolution, type HeaderEntry$1 as ContentTypeHeaderEntry, type ContextExtractionResult, DESKTOP_APP_ORIGIN, type DeviceAuthorizationArgs, type DeviceAuthorizationResponse, type DiffEntry, type DiffStatus, type DigestChallenge, EMPTY_UNPUSHED_SUMMARY, type EncryptedBindingHint, type EncryptedPayload, type EntityBucket, type ExecuteOptions, type ExecutionResult, type FetchOAuth2TokenArgs, type GraphQLField, type GraphQLSchemaInfo, HTTP_HEADERS_MAP, type HawkSignArgs, type HeaderEntry, type HeaderSuggestionMode, type ImportApicircleFolderResult, type ImportedFolder, type ImportedRequest, type JwtAlgorithm, type JwtSignArgs, type ApplyArgs as LinkedApplyArgs, type ApplyResult as LinkedApplyResult, type PreviewArgs as LinkedPreviewArgs, type LinkedUpdateBucket, type LinkedUpdateEntry, type LinkedUpdatePreview, type LinkedUpdateResolutionMap, type LinkedUpdateStatus, type MonacoLanguage, type NtlmType2Challenge, type OAuth2ErrorResponse, OAuth2TokenError, type OAuth2TokenResponse, type ParsedApicircleEnvironment, ParsedApicircleFolderExport, type ParsedCurl, type ParsedPostmanCollection, type ParsedPostmanEnvironment, type ParsedVersion, type PkceExchangeArgs, type PkceMethod, type PlanRunAuthorizationContext, PlanRunDeniedError, type PlanStepResult, type PollDeviceFlowArgs, type PreSendBlocker, type PreSendValidationInput, type PreSendValidationResult, type PreSendWarning, type PublishReleaseArgs, type RefreshTokenArgs, RemoteWorkspaceParseError, type ResolutionMap, type ResolutionScope, type ResolveInheritedAuthArgs, type ResolvePlanRefResult, type ResolveResult, type RopcArgs, type RunActor, type RunPlanOptions, type RunPlanResult, type SigV4SignArgs, type SigV4SignResult, TRANSFORM_FORMAT_LABELS, type ThreeWayDiff, type TransformCandidate, type TransformFormat, type TransformSavings, type UnpushedChange, type UnpushedSummary, type VariableSource, type VariableSuggestion, WORKSPACE_DIR, WORKSPACE_JSON_PATH, WorkspacePatch, WorkspaceState, applyAuth, applyAwsSigV4, applyContentTypeForBodyType, applyLinkedUpdate, applyMerge, applyMutation, applyPathParams, assertNoPlaintextCredentials, attachmentPath, buildAuthorizeUrl, buildAutoHeaders, buildDigestAuthHeader, buildHawkAuthHeader, buildNtlmType1Negotiate, buildNtlmType3Authenticate, buildRequest, buildScope, collectAttachmentSlots, collectVariableSuggestions, compareSemver, composeBody, composeCookieHeader, composeHeaders, composeUrl, composeUrlWithQuery, computeCodeChallenge, computeThreeWayDiff, computeTransformSavings, decryptString, deprecateRelease, deriveKeyFromSlotValue, encryptString, exchangeAuthCode, exchangePkce, executeRequest, exportKey, extractContext, fetchOAuth2Token, findPathPlaceholders, generateAesKey, generateCodeVerifier, generateSlotSalt, generateSpanId, generateTraceParent, generateWorkingBranchName, getBodyTypeForContentType, getContentTypeForBodyType, getHeaderEntry, getHeaderValues, getLanguageFromBodyType, getLanguageFromContentType, getVariableAutocomplete, hasUnpushedChanges, importApicircleFolderInto, importKey, isApicircleEnvironment, isDesktop, isInsomniaExport, isPostmanEnvironment, isPostmanV2Collection, isValidSemver, lookup, mergeWithAutoHeaders, normalizeContentType, parseApicircleEnvironment, parseApicircleEnvironmentDoc, parseCurl, parseDigestChallenge, parseGraphqlSchema, parseInsomniaCollection, parseNtlmType2Challenge, parsePostmanCollection, parsePostmanEnvironment, parseSemver, parseUrlQuery, parseWorkspaceJson, pollDeviceFlow, preSendValidation, previewLinkedUpdate, publishRelease, readJsonPath, redactForGit, refreshToken, requestDeviceAuthorization, requestRunToExecutionResult, resolveInheritedAuth, resolvePlanRef, resolveString, resolveStringMap, runAssertions, runClientCredentials, runPlan, runRopc, serializePayload, serializeWorkspaceForGit, signJwt, slugify, sortVersionsDesc, suggestHeaders, summarizeUnpushedChanges, supportedContentTypeLanguageMap, toCsv, toToon, toYaml, tokenizeCurl, tryParsePayload, validateBranchName, yankRelease };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BodyType, RequestAuth, Request, RequestRun, Folder, RequestBody, HttpMethod, EnvironmentVariable, Assertion, ContextExtraction, WorkspaceSynced, LinkedSnapshot, RequestOverride, EnvironmentVariableOverride, ExecutionPlan, PlanRun } from '@apicircle/shared';
|
|
2
|
-
import { W as WorkspaceState, a as WorkspacePatch, P as ParsedApicircleFolderExport } from './patches-
|
|
3
|
-
export { A as APICIRCLE_FOLDER_EXPORT_FORMAT, b as ApicircleFolderExportDependencies, c as ApicircleFolderExportV1, C as CollectFolderExportArgs, d as CollectFolderExportResult, F as FolderExportCredential, e as FolderExportReport, f as WorkspacePatchKind, g as collectFolderExport, h as collectFolderExportCredentials, i as isApicircleFolderExport, p as parseApicircleFolderExport, j as parseApicircleFolderExportDoc, r as redactFolderExportCredentials, s as serializeFolderExport, k as suggestFolderExportFilename } from './patches-
|
|
2
|
+
import { W as WorkspaceState, a as WorkspacePatch, P as ParsedApicircleFolderExport } from './patches-h_K1VcZR.js';
|
|
3
|
+
export { A as APICIRCLE_FOLDER_EXPORT_FORMAT, b as ApicircleFolderExportDependencies, c as ApicircleFolderExportV1, C as CollectFolderExportArgs, d as CollectFolderExportResult, F as FolderExportCredential, e as FolderExportReport, f as WorkspacePatchKind, g as collectFolderExport, h as collectFolderExportCredentials, i as isApicircleFolderExport, p as parseApicircleFolderExport, j as parseApicircleFolderExportDoc, r as redactFolderExportCredentials, s as serializeFolderExport, k as suggestFolderExportFilename } from './patches-h_K1VcZR.js';
|
|
4
4
|
|
|
5
5
|
type HeaderEntry$1 = {
|
|
6
6
|
key: string;
|
|
@@ -1360,6 +1360,18 @@ declare function generateWorkingBranchName(opts: BranchNameOptions): string;
|
|
|
1360
1360
|
*/
|
|
1361
1361
|
declare function serializeWorkspaceForGit(synced: WorkspaceSynced): string;
|
|
1362
1362
|
|
|
1363
|
+
/** The dotfolder under the repo root that owns every API-Circle-managed
|
|
1364
|
+
* file in a Git-backed workspace. */
|
|
1365
|
+
declare const WORKSPACE_DIR = ".apicircle";
|
|
1366
|
+
/** On-disk path for the synced workspace document inside a Git repo. */
|
|
1367
|
+
declare const WORKSPACE_JSON_PATH = ".apicircle/workspace.json";
|
|
1368
|
+
/** Directory holding per-attachment blob files (`<slotId>`). */
|
|
1369
|
+
declare const ATTACHMENTS_DIR = ".apicircle/attachments";
|
|
1370
|
+
/** Build the on-disk path for a single attachment slot. Caller is
|
|
1371
|
+
* responsible for URL-encoding when this is passed to the GitHub
|
|
1372
|
+
* Contents API. */
|
|
1373
|
+
declare function attachmentPath(slotId: string): string;
|
|
1374
|
+
|
|
1363
1375
|
/** Error thrown when the input fails any of our checks. `code` lets the UI
|
|
1364
1376
|
* branch on the specific failure (oversized, bad JSON, wrong shape, etc.)
|
|
1365
1377
|
* without parsing the message string. */
|
|
@@ -1920,4 +1932,4 @@ interface TransformSavings {
|
|
|
1920
1932
|
declare function computeTransformSavings(body: string, contentType?: string): TransformSavings;
|
|
1921
1933
|
declare const TRANSFORM_FORMAT_LABELS: Record<TransformFormat, string>;
|
|
1922
1934
|
|
|
1923
|
-
export { ANONYMOUS_ACTOR, type ApplyMutationOptions, type ApplyMutationResult, type AssertionResult, type AttachmentResolver, type AttachmentSlotRef, type AuthApplyOptions, type AuthApplyResult, type AuthApplyTarget, type AuthApplyWarning, type AuthCodeExchangeArgs, type AutoHeaderOverrides, type BranchNameOptions, type BuildDigestArgs, type BuildNtlmType3Args, type BuildRequestOptions, type BuiltRequest, type ClientCredentialsArgs, type ConflictResolution, type HeaderEntry$1 as ContentTypeHeaderEntry, type ContextExtractionResult, DESKTOP_APP_ORIGIN, type DeviceAuthorizationArgs, type DeviceAuthorizationResponse, type DiffEntry, type DiffStatus, type DigestChallenge, EMPTY_UNPUSHED_SUMMARY, type EncryptedBindingHint, type EncryptedPayload, type EntityBucket, type ExecuteOptions, type ExecutionResult, type FetchOAuth2TokenArgs, type GraphQLField, type GraphQLSchemaInfo, HTTP_HEADERS_MAP, type HawkSignArgs, type HeaderEntry, type HeaderSuggestionMode, type ImportApicircleFolderResult, type ImportedFolder, type ImportedRequest, type JwtAlgorithm, type JwtSignArgs, type ApplyArgs as LinkedApplyArgs, type ApplyResult as LinkedApplyResult, type PreviewArgs as LinkedPreviewArgs, type LinkedUpdateBucket, type LinkedUpdateEntry, type LinkedUpdatePreview, type LinkedUpdateResolutionMap, type LinkedUpdateStatus, type MonacoLanguage, type NtlmType2Challenge, type OAuth2ErrorResponse, OAuth2TokenError, type OAuth2TokenResponse, type ParsedApicircleEnvironment, ParsedApicircleFolderExport, type ParsedCurl, type ParsedPostmanCollection, type ParsedPostmanEnvironment, type ParsedVersion, type PkceExchangeArgs, type PkceMethod, type PlanRunAuthorizationContext, PlanRunDeniedError, type PlanStepResult, type PollDeviceFlowArgs, type PreSendBlocker, type PreSendValidationInput, type PreSendValidationResult, type PreSendWarning, type PublishReleaseArgs, type RefreshTokenArgs, RemoteWorkspaceParseError, type ResolutionMap, type ResolutionScope, type ResolveInheritedAuthArgs, type ResolvePlanRefResult, type ResolveResult, type RopcArgs, type RunActor, type RunPlanOptions, type RunPlanResult, type SigV4SignArgs, type SigV4SignResult, TRANSFORM_FORMAT_LABELS, type ThreeWayDiff, type TransformCandidate, type TransformFormat, type TransformSavings, type UnpushedChange, type UnpushedSummary, type VariableSource, type VariableSuggestion, WorkspacePatch, WorkspaceState, applyAuth, applyAwsSigV4, applyContentTypeForBodyType, applyLinkedUpdate, applyMerge, applyMutation, applyPathParams, assertNoPlaintextCredentials, buildAuthorizeUrl, buildAutoHeaders, buildDigestAuthHeader, buildHawkAuthHeader, buildNtlmType1Negotiate, buildNtlmType3Authenticate, buildRequest, buildScope, collectAttachmentSlots, collectVariableSuggestions, compareSemver, composeBody, composeCookieHeader, composeHeaders, composeUrl, composeUrlWithQuery, computeCodeChallenge, computeThreeWayDiff, computeTransformSavings, decryptString, deprecateRelease, deriveKeyFromSlotValue, encryptString, exchangeAuthCode, exchangePkce, executeRequest, exportKey, extractContext, fetchOAuth2Token, findPathPlaceholders, generateAesKey, generateCodeVerifier, generateSlotSalt, generateSpanId, generateTraceParent, generateWorkingBranchName, getBodyTypeForContentType, getContentTypeForBodyType, getHeaderEntry, getHeaderValues, getLanguageFromBodyType, getLanguageFromContentType, getVariableAutocomplete, hasUnpushedChanges, importApicircleFolderInto, importKey, isApicircleEnvironment, isDesktop, isInsomniaExport, isPostmanEnvironment, isPostmanV2Collection, isValidSemver, lookup, mergeWithAutoHeaders, normalizeContentType, parseApicircleEnvironment, parseApicircleEnvironmentDoc, parseCurl, parseDigestChallenge, parseGraphqlSchema, parseInsomniaCollection, parseNtlmType2Challenge, parsePostmanCollection, parsePostmanEnvironment, parseSemver, parseUrlQuery, parseWorkspaceJson, pollDeviceFlow, preSendValidation, previewLinkedUpdate, publishRelease, readJsonPath, redactForGit, refreshToken, requestDeviceAuthorization, requestRunToExecutionResult, resolveInheritedAuth, resolvePlanRef, resolveString, resolveStringMap, runAssertions, runClientCredentials, runPlan, runRopc, serializePayload, serializeWorkspaceForGit, signJwt, slugify, sortVersionsDesc, suggestHeaders, summarizeUnpushedChanges, supportedContentTypeLanguageMap, toCsv, toToon, toYaml, tokenizeCurl, tryParsePayload, validateBranchName, yankRelease };
|
|
1935
|
+
export { ANONYMOUS_ACTOR, ATTACHMENTS_DIR, type ApplyMutationOptions, type ApplyMutationResult, type AssertionResult, type AttachmentResolver, type AttachmentSlotRef, type AuthApplyOptions, type AuthApplyResult, type AuthApplyTarget, type AuthApplyWarning, type AuthCodeExchangeArgs, type AutoHeaderOverrides, type BranchNameOptions, type BuildDigestArgs, type BuildNtlmType3Args, type BuildRequestOptions, type BuiltRequest, type ClientCredentialsArgs, type ConflictResolution, type HeaderEntry$1 as ContentTypeHeaderEntry, type ContextExtractionResult, DESKTOP_APP_ORIGIN, type DeviceAuthorizationArgs, type DeviceAuthorizationResponse, type DiffEntry, type DiffStatus, type DigestChallenge, EMPTY_UNPUSHED_SUMMARY, type EncryptedBindingHint, type EncryptedPayload, type EntityBucket, type ExecuteOptions, type ExecutionResult, type FetchOAuth2TokenArgs, type GraphQLField, type GraphQLSchemaInfo, HTTP_HEADERS_MAP, type HawkSignArgs, type HeaderEntry, type HeaderSuggestionMode, type ImportApicircleFolderResult, type ImportedFolder, type ImportedRequest, type JwtAlgorithm, type JwtSignArgs, type ApplyArgs as LinkedApplyArgs, type ApplyResult as LinkedApplyResult, type PreviewArgs as LinkedPreviewArgs, type LinkedUpdateBucket, type LinkedUpdateEntry, type LinkedUpdatePreview, type LinkedUpdateResolutionMap, type LinkedUpdateStatus, type MonacoLanguage, type NtlmType2Challenge, type OAuth2ErrorResponse, OAuth2TokenError, type OAuth2TokenResponse, type ParsedApicircleEnvironment, ParsedApicircleFolderExport, type ParsedCurl, type ParsedPostmanCollection, type ParsedPostmanEnvironment, type ParsedVersion, type PkceExchangeArgs, type PkceMethod, type PlanRunAuthorizationContext, PlanRunDeniedError, type PlanStepResult, type PollDeviceFlowArgs, type PreSendBlocker, type PreSendValidationInput, type PreSendValidationResult, type PreSendWarning, type PublishReleaseArgs, type RefreshTokenArgs, RemoteWorkspaceParseError, type ResolutionMap, type ResolutionScope, type ResolveInheritedAuthArgs, type ResolvePlanRefResult, type ResolveResult, type RopcArgs, type RunActor, type RunPlanOptions, type RunPlanResult, type SigV4SignArgs, type SigV4SignResult, TRANSFORM_FORMAT_LABELS, type ThreeWayDiff, type TransformCandidate, type TransformFormat, type TransformSavings, type UnpushedChange, type UnpushedSummary, type VariableSource, type VariableSuggestion, WORKSPACE_DIR, WORKSPACE_JSON_PATH, WorkspacePatch, WorkspaceState, applyAuth, applyAwsSigV4, applyContentTypeForBodyType, applyLinkedUpdate, applyMerge, applyMutation, applyPathParams, assertNoPlaintextCredentials, attachmentPath, buildAuthorizeUrl, buildAutoHeaders, buildDigestAuthHeader, buildHawkAuthHeader, buildNtlmType1Negotiate, buildNtlmType3Authenticate, buildRequest, buildScope, collectAttachmentSlots, collectVariableSuggestions, compareSemver, composeBody, composeCookieHeader, composeHeaders, composeUrl, composeUrlWithQuery, computeCodeChallenge, computeThreeWayDiff, computeTransformSavings, decryptString, deprecateRelease, deriveKeyFromSlotValue, encryptString, exchangeAuthCode, exchangePkce, executeRequest, exportKey, extractContext, fetchOAuth2Token, findPathPlaceholders, generateAesKey, generateCodeVerifier, generateSlotSalt, generateSpanId, generateTraceParent, generateWorkingBranchName, getBodyTypeForContentType, getContentTypeForBodyType, getHeaderEntry, getHeaderValues, getLanguageFromBodyType, getLanguageFromContentType, getVariableAutocomplete, hasUnpushedChanges, importApicircleFolderInto, importKey, isApicircleEnvironment, isDesktop, isInsomniaExport, isPostmanEnvironment, isPostmanV2Collection, isValidSemver, lookup, mergeWithAutoHeaders, normalizeContentType, parseApicircleEnvironment, parseApicircleEnvironmentDoc, parseCurl, parseDigestChallenge, parseGraphqlSchema, parseInsomniaCollection, parseNtlmType2Challenge, parsePostmanCollection, parsePostmanEnvironment, parseSemver, parseUrlQuery, parseWorkspaceJson, pollDeviceFlow, preSendValidation, previewLinkedUpdate, publishRelease, readJsonPath, redactForGit, refreshToken, requestDeviceAuthorization, requestRunToExecutionResult, resolveInheritedAuth, resolvePlanRef, resolveString, resolveStringMap, runAssertions, runClientCredentials, runPlan, runRopc, serializePayload, serializeWorkspaceForGit, signJwt, slugify, sortVersionsDesc, suggestHeaders, summarizeUnpushedChanges, supportedContentTypeLanguageMap, toCsv, toToon, toYaml, tokenizeCurl, tryParsePayload, validateBranchName, yankRelease };
|
package/dist/index.js
CHANGED
|
@@ -5010,6 +5010,14 @@ function sortedReplacer(_key, value) {
|
|
|
5010
5010
|
return out;
|
|
5011
5011
|
}
|
|
5012
5012
|
|
|
5013
|
+
// src/git/repoPaths.ts
|
|
5014
|
+
var WORKSPACE_DIR = ".apicircle";
|
|
5015
|
+
var WORKSPACE_JSON_PATH = `${WORKSPACE_DIR}/workspace.json`;
|
|
5016
|
+
var ATTACHMENTS_DIR = `${WORKSPACE_DIR}/attachments`;
|
|
5017
|
+
function attachmentPath(slotId) {
|
|
5018
|
+
return `${ATTACHMENTS_DIR}/${slotId}`;
|
|
5019
|
+
}
|
|
5020
|
+
|
|
5013
5021
|
// src/git/parseWorkspaceJson.ts
|
|
5014
5022
|
var MAX_WORKSPACE_JSON_BYTES = 16 * 1024 * 1024;
|
|
5015
5023
|
var FORBIDDEN_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
@@ -6674,6 +6682,18 @@ function applyMutation(state, patch, options = {}) {
|
|
|
6674
6682
|
return applyMockUpsert(state, patch.mock, now);
|
|
6675
6683
|
case "mock.delete":
|
|
6676
6684
|
return applyMockDelete(state, patch.id, now);
|
|
6685
|
+
case "globalAsset.upsertFile":
|
|
6686
|
+
return applyGlobalAssetUpsertFile(state, patch.file, now);
|
|
6687
|
+
case "globalAsset.removeFile":
|
|
6688
|
+
return applyGlobalAssetRemoveFile(state, patch.id, now);
|
|
6689
|
+
case "globalAsset.markPushed":
|
|
6690
|
+
return applyGlobalAssetMarkPushed(state, patch.id, patch.ref, now);
|
|
6691
|
+
case "globalAsset.markMerged":
|
|
6692
|
+
return applyGlobalAssetMarkMerged(state, patch.id, patch.ref, now);
|
|
6693
|
+
case "globalAsset.cleanupWorkingRef":
|
|
6694
|
+
return applyGlobalAssetCleanupWorkingRef(state, patch.id, now);
|
|
6695
|
+
case "globalAsset.invalidateRef":
|
|
6696
|
+
return applyGlobalAssetInvalidateRef(state, patch.id, patch.which, now);
|
|
6677
6697
|
case "plan.upsert":
|
|
6678
6698
|
return applyPlanUpsert(state, patch.plan, now);
|
|
6679
6699
|
case "plan.delete":
|
|
@@ -6989,6 +7009,147 @@ function applyMockDelete(state, id, now) {
|
|
|
6989
7009
|
} : state.local;
|
|
6990
7010
|
return { next: { synced, local }, changedIds: [id] };
|
|
6991
7011
|
}
|
|
7012
|
+
function applyGlobalAssetUpsertFile(state, file, now) {
|
|
7013
|
+
const files = state.synced.globalAssets.files ?? {};
|
|
7014
|
+
const existing = files[file.id];
|
|
7015
|
+
const next = {
|
|
7016
|
+
...file,
|
|
7017
|
+
workingBranchRef: file.workingBranchRef !== void 0 ? file.workingBranchRef : existing?.workingBranchRef,
|
|
7018
|
+
baseBranchRef: file.baseBranchRef !== void 0 ? file.baseBranchRef : existing?.baseBranchRef,
|
|
7019
|
+
updatedAt: now
|
|
7020
|
+
};
|
|
7021
|
+
const synced = {
|
|
7022
|
+
...state.synced,
|
|
7023
|
+
globalAssets: {
|
|
7024
|
+
...state.synced.globalAssets,
|
|
7025
|
+
files: { ...files, [file.id]: next }
|
|
7026
|
+
},
|
|
7027
|
+
meta: { ...state.synced.meta, updatedAt: now }
|
|
7028
|
+
};
|
|
7029
|
+
return { next: { ...state, synced }, changedIds: [file.id] };
|
|
7030
|
+
}
|
|
7031
|
+
function applyGlobalAssetRemoveFile(state, id, now) {
|
|
7032
|
+
const files = state.synced.globalAssets.files ?? {};
|
|
7033
|
+
if (!files[id]) {
|
|
7034
|
+
return { next: state, changedIds: [] };
|
|
7035
|
+
}
|
|
7036
|
+
const { [id]: _drop, ...rest } = files;
|
|
7037
|
+
void _drop;
|
|
7038
|
+
const requests = { ...state.synced.collections.requests };
|
|
7039
|
+
for (const [reqId, req] of Object.entries(requests)) {
|
|
7040
|
+
const body = clearAssetFromRequestBody(req.body, id);
|
|
7041
|
+
if (body !== req.body) requests[reqId] = { ...req, body, updatedAt: now };
|
|
7042
|
+
}
|
|
7043
|
+
const mockServers = { ...state.synced.mockServers };
|
|
7044
|
+
for (const [serverId, server] of Object.entries(mockServers)) {
|
|
7045
|
+
let touchedServer = false;
|
|
7046
|
+
const endpoints = server.endpoints.map((endpoint) => {
|
|
7047
|
+
let touched = false;
|
|
7048
|
+
const defaultResponse = clearAssetFromMockResponse(endpoint.defaultResponse, id);
|
|
7049
|
+
if (defaultResponse !== endpoint.defaultResponse) touched = true;
|
|
7050
|
+
const requestValidation = endpoint.requestValidation.map((rule) => {
|
|
7051
|
+
const failResponse = clearAssetFromMockResponse(rule.failResponse, id);
|
|
7052
|
+
if (failResponse === rule.failResponse) return rule;
|
|
7053
|
+
touched = true;
|
|
7054
|
+
return { ...rule, failResponse };
|
|
7055
|
+
});
|
|
7056
|
+
const responseRules = endpoint.responseRules.map((rule) => {
|
|
7057
|
+
const response = clearAssetFromMockResponse(rule.response, id);
|
|
7058
|
+
if (response === rule.response) return rule;
|
|
7059
|
+
touched = true;
|
|
7060
|
+
return { ...rule, response };
|
|
7061
|
+
});
|
|
7062
|
+
if (!touched) return endpoint;
|
|
7063
|
+
touchedServer = true;
|
|
7064
|
+
return { ...endpoint, defaultResponse, requestValidation, responseRules };
|
|
7065
|
+
});
|
|
7066
|
+
if (touchedServer) {
|
|
7067
|
+
const source = server.source.kind === "manual" ? { kind: "manual", endpoints } : server.source;
|
|
7068
|
+
mockServers[serverId] = { ...server, source, endpoints, updatedAt: now };
|
|
7069
|
+
}
|
|
7070
|
+
}
|
|
7071
|
+
let local = state.local;
|
|
7072
|
+
if (local.pendingFileUploads && local.pendingFileUploads[id]) {
|
|
7073
|
+
const nextPending = { ...local.pendingFileUploads };
|
|
7074
|
+
delete nextPending[id];
|
|
7075
|
+
local = { ...local, pendingFileUploads: nextPending };
|
|
7076
|
+
}
|
|
7077
|
+
if (local.assetUsageIndex && local.assetUsageIndex[id]) {
|
|
7078
|
+
const nextUsage = { ...local.assetUsageIndex };
|
|
7079
|
+
delete nextUsage[id];
|
|
7080
|
+
local = { ...local, assetUsageIndex: nextUsage };
|
|
7081
|
+
}
|
|
7082
|
+
const synced = {
|
|
7083
|
+
...state.synced,
|
|
7084
|
+
collections: { ...state.synced.collections, requests },
|
|
7085
|
+
mockServers,
|
|
7086
|
+
globalAssets: { ...state.synced.globalAssets, files: rest },
|
|
7087
|
+
meta: { ...state.synced.meta, updatedAt: now }
|
|
7088
|
+
};
|
|
7089
|
+
return { next: { synced, local }, changedIds: [id] };
|
|
7090
|
+
}
|
|
7091
|
+
function applyGlobalAssetMarkPushed(state, id, ref, now) {
|
|
7092
|
+
return mutateAssetRef(state, id, now, (asset) => ({ ...asset, workingBranchRef: ref }));
|
|
7093
|
+
}
|
|
7094
|
+
function applyGlobalAssetMarkMerged(state, id, ref, now) {
|
|
7095
|
+
return mutateAssetRef(state, id, now, (asset) => ({ ...asset, baseBranchRef: ref }));
|
|
7096
|
+
}
|
|
7097
|
+
function applyGlobalAssetCleanupWorkingRef(state, id, now) {
|
|
7098
|
+
return mutateAssetRef(state, id, now, (asset) => {
|
|
7099
|
+
if (!asset.workingBranchRef) return asset;
|
|
7100
|
+
return { ...asset, workingBranchRef: null };
|
|
7101
|
+
});
|
|
7102
|
+
}
|
|
7103
|
+
function applyGlobalAssetInvalidateRef(state, id, which, now) {
|
|
7104
|
+
return mutateAssetRef(state, id, now, (asset) => {
|
|
7105
|
+
if (which === "working") {
|
|
7106
|
+
if (!asset.workingBranchRef) return asset;
|
|
7107
|
+
return { ...asset, workingBranchRef: null };
|
|
7108
|
+
}
|
|
7109
|
+
if (!asset.baseBranchRef) return asset;
|
|
7110
|
+
return { ...asset, baseBranchRef: null };
|
|
7111
|
+
});
|
|
7112
|
+
}
|
|
7113
|
+
function mutateAssetRef(state, id, now, transform) {
|
|
7114
|
+
const files = state.synced.globalAssets.files ?? {};
|
|
7115
|
+
const existing = files[id];
|
|
7116
|
+
if (!existing) return { next: state, changedIds: [] };
|
|
7117
|
+
const updated = transform(existing);
|
|
7118
|
+
if (updated === existing) return { next: state, changedIds: [] };
|
|
7119
|
+
const next = { ...updated, updatedAt: now };
|
|
7120
|
+
const synced = {
|
|
7121
|
+
...state.synced,
|
|
7122
|
+
globalAssets: {
|
|
7123
|
+
...state.synced.globalAssets,
|
|
7124
|
+
files: { ...files, [id]: next }
|
|
7125
|
+
},
|
|
7126
|
+
meta: { ...state.synced.meta, updatedAt: now }
|
|
7127
|
+
};
|
|
7128
|
+
return { next: { ...state, synced }, changedIds: [id] };
|
|
7129
|
+
}
|
|
7130
|
+
function clearAssetFromRequestBody(body, id) {
|
|
7131
|
+
if (body.type === "binary" && body.attachment?.globalFileAssetId === id) {
|
|
7132
|
+
return { type: "binary", content: "" };
|
|
7133
|
+
}
|
|
7134
|
+
if (body.type !== "form-data" || !body.formRows) return body;
|
|
7135
|
+
let touched = false;
|
|
7136
|
+
const formRows = body.formRows.map((row) => {
|
|
7137
|
+
if (row.kind !== "file" || row.globalFileAssetId !== id) return row;
|
|
7138
|
+
touched = true;
|
|
7139
|
+
return { kind: "file", key: row.key, enabled: row.enabled, slotId: null };
|
|
7140
|
+
});
|
|
7141
|
+
return touched ? { ...body, formRows } : body;
|
|
7142
|
+
}
|
|
7143
|
+
function clearAssetFromMockResponse(response, id) {
|
|
7144
|
+
const body = clearAssetFromMockBody(response.body, id);
|
|
7145
|
+
return body === response.body ? response : { ...response, body };
|
|
7146
|
+
}
|
|
7147
|
+
function clearAssetFromMockBody(body, id) {
|
|
7148
|
+
if (body.type === "binary" && body.attachment?.globalFileAssetId === id) {
|
|
7149
|
+
return { type: "binary", content: "" };
|
|
7150
|
+
}
|
|
7151
|
+
return body;
|
|
7152
|
+
}
|
|
6992
7153
|
function applyPlanUpsert(state, plan, now) {
|
|
6993
7154
|
const existing = state.local.executionPlans[plan.id];
|
|
6994
7155
|
const merged = existing ? { ...existing, ...plan, id: existing.id, createdAt: existing.createdAt, updatedAt: now } : { ...plan, updatedAt: now };
|
|
@@ -7882,6 +8043,7 @@ var TRANSFORM_FORMAT_LABELS = {
|
|
|
7882
8043
|
export {
|
|
7883
8044
|
ANONYMOUS_ACTOR,
|
|
7884
8045
|
APICIRCLE_FOLDER_EXPORT_FORMAT,
|
|
8046
|
+
ATTACHMENTS_DIR,
|
|
7885
8047
|
DESKTOP_APP_ORIGIN,
|
|
7886
8048
|
EMPTY_UNPUSHED_SUMMARY,
|
|
7887
8049
|
HTTP_HEADERS_MAP,
|
|
@@ -7889,6 +8051,8 @@ export {
|
|
|
7889
8051
|
PlanRunDeniedError,
|
|
7890
8052
|
RemoteWorkspaceParseError,
|
|
7891
8053
|
TRANSFORM_FORMAT_LABELS,
|
|
8054
|
+
WORKSPACE_DIR,
|
|
8055
|
+
WORKSPACE_JSON_PATH,
|
|
7892
8056
|
applyAuth,
|
|
7893
8057
|
applyAwsSigV4,
|
|
7894
8058
|
applyContentTypeForBodyType,
|
|
@@ -7897,6 +8061,7 @@ export {
|
|
|
7897
8061
|
applyMutation,
|
|
7898
8062
|
applyPathParams,
|
|
7899
8063
|
assertNoPlaintextCredentials,
|
|
8064
|
+
attachmentPath,
|
|
7900
8065
|
buildAuthorizeUrl,
|
|
7901
8066
|
buildAutoHeaders,
|
|
7902
8067
|
buildDigestAuthHeader,
|