@pierre/storage 1.4.0 → 1.4.1
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 +7 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/types.ts +9 -0
package/dist/index.d.cts
CHANGED
|
@@ -810,9 +810,15 @@ interface GitStorageOptions extends OverrideableGitStorageOptions {
|
|
|
810
810
|
defaultTTL?: number;
|
|
811
811
|
}
|
|
812
812
|
type ValidAPIVersion = 1;
|
|
813
|
+
/** A policy operation included in the JWT. */
|
|
814
|
+
type Op = string;
|
|
815
|
+
declare const OP_NO_FORCE_PUSH: Op;
|
|
816
|
+
/** A list of policy operations. */
|
|
817
|
+
type Ops = Op[];
|
|
813
818
|
interface GetRemoteURLOptions {
|
|
814
819
|
permissions?: ('git:write' | 'git:read' | 'repo:write' | 'org:read')[];
|
|
815
820
|
ttl?: number;
|
|
821
|
+
ops?: Ops;
|
|
816
822
|
}
|
|
817
823
|
interface Repo {
|
|
818
824
|
id: string;
|
|
@@ -1545,4 +1551,4 @@ declare function createClient(options: GitStorageOptions): GitStorage;
|
|
|
1545
1551
|
|
|
1546
1552
|
type StorageOptions = GitStorageOptions;
|
|
1547
1553
|
|
|
1548
|
-
export { ApiError, type AppendNoteOptions, type ArchiveOptions, type BaseRepo, type BlobLike, type BranchInfo, GitStorage as CodeStorage, type CommitBuilder, type CommitFileOptions, type CommitFileSource, type CommitInfo, type CommitMetadata, type CommitResult, type CommitSignature, type CommitTextFileOptions, type CreateBranchOptions, type CreateBranchResponse, type CreateBranchResult, type CreateCommitBranchOptions, type CreateCommitFromDiffOptions, type CreateCommitOptions, type CreateGitCredentialOptions, type CreateNoteOptions, type CreateRepoOptions, type CreateTagOptions, type CreateTagResponse, type CreateTagResult, type DeleteGitCredentialOptions, type DeleteNoteOptions, type DeleteRepoOptions, type DeleteRepoResult, type DeleteTagOptions, type DeleteTagResponse, type DeleteTagResult, type DiffFileBase, type DiffFileState, type DiffSource, type DiffStats, type FileDiff, type FileLike, type FileWithMetadata, type FilteredFile, type FindOneOptions, type ForkBaseRepo, type GenericGitBaseRepo, type GetBranchDiffOptions, type GetBranchDiffResponse, type GetBranchDiffResult, type GetCommitDiffOptions, type GetCommitDiffResponse, type GetCommitDiffResult, type GetFileOptions, type GetNoteOptions, type GetNoteResponse, type GetNoteResult, type GetRemoteURLOptions, type GitCredential, type GitFileMode, type GitHubBaseRepo, GitStorage, type GitStorageOptions, type GrepFileMatch, type GrepLine, type GrepOptions, type GrepResult, type LegacyCreateCommitOptions, type ListBranchesOptions, type ListBranchesResponse, type ListBranchesResult, type ListCommitsOptions, type ListCommitsResponse, type ListCommitsResult, type ListFilesOptions, type ListFilesResponse, type ListFilesResult, type ListFilesWithMetadataOptions, type ListFilesWithMetadataResponse, type ListFilesWithMetadataResult, type ListReposOptions, type ListReposResponse, type ListReposResult, type ListTagsOptions, type ListTagsResponse, type ListTagsResult, type NoteWriteResponse, type NoteWriteResult, type NoteWriteResultPayload, type OverrideableGitStorageOptions, type ParsedWebhookSignature, type PublicGitHubBaseRepoAuth, type PullUpstreamOptions, type RawBranchInfo, type RawCommitInfo, type RawCommitMetadata, type RawFileDiff, type RawFileWithMetadata, type RawFilteredFile, type RawRepoBaseInfo, type RawRepoInfo, type RawTagInfo, type RawWebhookPushEvent, type ReadableStreamLike, type ReadableStreamReaderLike, type RefUpdate, RefUpdateError, type RefUpdateReason, type Repo, type RepoBaseInfo, type RepoInfo, type RepoOptions, type RestoreCommitOptions, type RestoreCommitResult, type StorageOptions, type SupportedRepoProvider, type TagInfo, type TextEncoding, type UpdateGitCredentialOptions, type ValidAPIVersion, type ValidMethod, type ValidPath, type WebhookEventPayload, type WebhookPushEvent, type WebhookUnknownEvent, type WebhookValidationOptions, type WebhookValidationResult, createClient, parseSignatureHeader, validateWebhook, validateWebhookSignature };
|
|
1554
|
+
export { ApiError, type AppendNoteOptions, type ArchiveOptions, type BaseRepo, type BlobLike, type BranchInfo, GitStorage as CodeStorage, type CommitBuilder, type CommitFileOptions, type CommitFileSource, type CommitInfo, type CommitMetadata, type CommitResult, type CommitSignature, type CommitTextFileOptions, type CreateBranchOptions, type CreateBranchResponse, type CreateBranchResult, type CreateCommitBranchOptions, type CreateCommitFromDiffOptions, type CreateCommitOptions, type CreateGitCredentialOptions, type CreateNoteOptions, type CreateRepoOptions, type CreateTagOptions, type CreateTagResponse, type CreateTagResult, type DeleteGitCredentialOptions, type DeleteNoteOptions, type DeleteRepoOptions, type DeleteRepoResult, type DeleteTagOptions, type DeleteTagResponse, type DeleteTagResult, type DiffFileBase, type DiffFileState, type DiffSource, type DiffStats, type FileDiff, type FileLike, type FileWithMetadata, type FilteredFile, type FindOneOptions, type ForkBaseRepo, type GenericGitBaseRepo, type GetBranchDiffOptions, type GetBranchDiffResponse, type GetBranchDiffResult, type GetCommitDiffOptions, type GetCommitDiffResponse, type GetCommitDiffResult, type GetFileOptions, type GetNoteOptions, type GetNoteResponse, type GetNoteResult, type GetRemoteURLOptions, type GitCredential, type GitFileMode, type GitHubBaseRepo, GitStorage, type GitStorageOptions, type GrepFileMatch, type GrepLine, type GrepOptions, type GrepResult, type LegacyCreateCommitOptions, type ListBranchesOptions, type ListBranchesResponse, type ListBranchesResult, type ListCommitsOptions, type ListCommitsResponse, type ListCommitsResult, type ListFilesOptions, type ListFilesResponse, type ListFilesResult, type ListFilesWithMetadataOptions, type ListFilesWithMetadataResponse, type ListFilesWithMetadataResult, type ListReposOptions, type ListReposResponse, type ListReposResult, type ListTagsOptions, type ListTagsResponse, type ListTagsResult, type NoteWriteResponse, type NoteWriteResult, type NoteWriteResultPayload, OP_NO_FORCE_PUSH, type Op, type Ops, type OverrideableGitStorageOptions, type ParsedWebhookSignature, type PublicGitHubBaseRepoAuth, type PullUpstreamOptions, type RawBranchInfo, type RawCommitInfo, type RawCommitMetadata, type RawFileDiff, type RawFileWithMetadata, type RawFilteredFile, type RawRepoBaseInfo, type RawRepoInfo, type RawTagInfo, type RawWebhookPushEvent, type ReadableStreamLike, type ReadableStreamReaderLike, type RefUpdate, RefUpdateError, type RefUpdateReason, type Repo, type RepoBaseInfo, type RepoInfo, type RepoOptions, type RestoreCommitOptions, type RestoreCommitResult, type StorageOptions, type SupportedRepoProvider, type TagInfo, type TextEncoding, type UpdateGitCredentialOptions, type ValidAPIVersion, type ValidMethod, type ValidPath, type WebhookEventPayload, type WebhookPushEvent, type WebhookUnknownEvent, type WebhookValidationOptions, type WebhookValidationResult, createClient, parseSignatureHeader, validateWebhook, validateWebhookSignature };
|
package/dist/index.d.ts
CHANGED
|
@@ -810,9 +810,15 @@ interface GitStorageOptions extends OverrideableGitStorageOptions {
|
|
|
810
810
|
defaultTTL?: number;
|
|
811
811
|
}
|
|
812
812
|
type ValidAPIVersion = 1;
|
|
813
|
+
/** A policy operation included in the JWT. */
|
|
814
|
+
type Op = string;
|
|
815
|
+
declare const OP_NO_FORCE_PUSH: Op;
|
|
816
|
+
/** A list of policy operations. */
|
|
817
|
+
type Ops = Op[];
|
|
813
818
|
interface GetRemoteURLOptions {
|
|
814
819
|
permissions?: ('git:write' | 'git:read' | 'repo:write' | 'org:read')[];
|
|
815
820
|
ttl?: number;
|
|
821
|
+
ops?: Ops;
|
|
816
822
|
}
|
|
817
823
|
interface Repo {
|
|
818
824
|
id: string;
|
|
@@ -1545,4 +1551,4 @@ declare function createClient(options: GitStorageOptions): GitStorage;
|
|
|
1545
1551
|
|
|
1546
1552
|
type StorageOptions = GitStorageOptions;
|
|
1547
1553
|
|
|
1548
|
-
export { ApiError, type AppendNoteOptions, type ArchiveOptions, type BaseRepo, type BlobLike, type BranchInfo, GitStorage as CodeStorage, type CommitBuilder, type CommitFileOptions, type CommitFileSource, type CommitInfo, type CommitMetadata, type CommitResult, type CommitSignature, type CommitTextFileOptions, type CreateBranchOptions, type CreateBranchResponse, type CreateBranchResult, type CreateCommitBranchOptions, type CreateCommitFromDiffOptions, type CreateCommitOptions, type CreateGitCredentialOptions, type CreateNoteOptions, type CreateRepoOptions, type CreateTagOptions, type CreateTagResponse, type CreateTagResult, type DeleteGitCredentialOptions, type DeleteNoteOptions, type DeleteRepoOptions, type DeleteRepoResult, type DeleteTagOptions, type DeleteTagResponse, type DeleteTagResult, type DiffFileBase, type DiffFileState, type DiffSource, type DiffStats, type FileDiff, type FileLike, type FileWithMetadata, type FilteredFile, type FindOneOptions, type ForkBaseRepo, type GenericGitBaseRepo, type GetBranchDiffOptions, type GetBranchDiffResponse, type GetBranchDiffResult, type GetCommitDiffOptions, type GetCommitDiffResponse, type GetCommitDiffResult, type GetFileOptions, type GetNoteOptions, type GetNoteResponse, type GetNoteResult, type GetRemoteURLOptions, type GitCredential, type GitFileMode, type GitHubBaseRepo, GitStorage, type GitStorageOptions, type GrepFileMatch, type GrepLine, type GrepOptions, type GrepResult, type LegacyCreateCommitOptions, type ListBranchesOptions, type ListBranchesResponse, type ListBranchesResult, type ListCommitsOptions, type ListCommitsResponse, type ListCommitsResult, type ListFilesOptions, type ListFilesResponse, type ListFilesResult, type ListFilesWithMetadataOptions, type ListFilesWithMetadataResponse, type ListFilesWithMetadataResult, type ListReposOptions, type ListReposResponse, type ListReposResult, type ListTagsOptions, type ListTagsResponse, type ListTagsResult, type NoteWriteResponse, type NoteWriteResult, type NoteWriteResultPayload, type OverrideableGitStorageOptions, type ParsedWebhookSignature, type PublicGitHubBaseRepoAuth, type PullUpstreamOptions, type RawBranchInfo, type RawCommitInfo, type RawCommitMetadata, type RawFileDiff, type RawFileWithMetadata, type RawFilteredFile, type RawRepoBaseInfo, type RawRepoInfo, type RawTagInfo, type RawWebhookPushEvent, type ReadableStreamLike, type ReadableStreamReaderLike, type RefUpdate, RefUpdateError, type RefUpdateReason, type Repo, type RepoBaseInfo, type RepoInfo, type RepoOptions, type RestoreCommitOptions, type RestoreCommitResult, type StorageOptions, type SupportedRepoProvider, type TagInfo, type TextEncoding, type UpdateGitCredentialOptions, type ValidAPIVersion, type ValidMethod, type ValidPath, type WebhookEventPayload, type WebhookPushEvent, type WebhookUnknownEvent, type WebhookValidationOptions, type WebhookValidationResult, createClient, parseSignatureHeader, validateWebhook, validateWebhookSignature };
|
|
1554
|
+
export { ApiError, type AppendNoteOptions, type ArchiveOptions, type BaseRepo, type BlobLike, type BranchInfo, GitStorage as CodeStorage, type CommitBuilder, type CommitFileOptions, type CommitFileSource, type CommitInfo, type CommitMetadata, type CommitResult, type CommitSignature, type CommitTextFileOptions, type CreateBranchOptions, type CreateBranchResponse, type CreateBranchResult, type CreateCommitBranchOptions, type CreateCommitFromDiffOptions, type CreateCommitOptions, type CreateGitCredentialOptions, type CreateNoteOptions, type CreateRepoOptions, type CreateTagOptions, type CreateTagResponse, type CreateTagResult, type DeleteGitCredentialOptions, type DeleteNoteOptions, type DeleteRepoOptions, type DeleteRepoResult, type DeleteTagOptions, type DeleteTagResponse, type DeleteTagResult, type DiffFileBase, type DiffFileState, type DiffSource, type DiffStats, type FileDiff, type FileLike, type FileWithMetadata, type FilteredFile, type FindOneOptions, type ForkBaseRepo, type GenericGitBaseRepo, type GetBranchDiffOptions, type GetBranchDiffResponse, type GetBranchDiffResult, type GetCommitDiffOptions, type GetCommitDiffResponse, type GetCommitDiffResult, type GetFileOptions, type GetNoteOptions, type GetNoteResponse, type GetNoteResult, type GetRemoteURLOptions, type GitCredential, type GitFileMode, type GitHubBaseRepo, GitStorage, type GitStorageOptions, type GrepFileMatch, type GrepLine, type GrepOptions, type GrepResult, type LegacyCreateCommitOptions, type ListBranchesOptions, type ListBranchesResponse, type ListBranchesResult, type ListCommitsOptions, type ListCommitsResponse, type ListCommitsResult, type ListFilesOptions, type ListFilesResponse, type ListFilesResult, type ListFilesWithMetadataOptions, type ListFilesWithMetadataResponse, type ListFilesWithMetadataResult, type ListReposOptions, type ListReposResponse, type ListReposResult, type ListTagsOptions, type ListTagsResponse, type ListTagsResult, type NoteWriteResponse, type NoteWriteResult, type NoteWriteResultPayload, OP_NO_FORCE_PUSH, type Op, type Ops, type OverrideableGitStorageOptions, type ParsedWebhookSignature, type PublicGitHubBaseRepoAuth, type PullUpstreamOptions, type RawBranchInfo, type RawCommitInfo, type RawCommitMetadata, type RawFileDiff, type RawFileWithMetadata, type RawFilteredFile, type RawRepoBaseInfo, type RawRepoInfo, type RawTagInfo, type RawWebhookPushEvent, type ReadableStreamLike, type ReadableStreamReaderLike, type RefUpdate, RefUpdateError, type RefUpdateReason, type Repo, type RepoBaseInfo, type RepoInfo, type RepoOptions, type RestoreCommitOptions, type RestoreCommitResult, type StorageOptions, type SupportedRepoProvider, type TagInfo, type TextEncoding, type UpdateGitCredentialOptions, type ValidAPIVersion, type ValidMethod, type ValidPath, type WebhookEventPayload, type WebhookPushEvent, type WebhookUnknownEvent, type WebhookValidationOptions, type WebhookValidationResult, createClient, parseSignatureHeader, validateWebhook, validateWebhookSignature };
|
package/dist/index.js
CHANGED
|
@@ -543,7 +543,7 @@ function concatChunks(a, b) {
|
|
|
543
543
|
|
|
544
544
|
// package.json
|
|
545
545
|
var package_default = {
|
|
546
|
-
version: "1.4.
|
|
546
|
+
version: "1.4.1"};
|
|
547
547
|
|
|
548
548
|
// src/version.ts
|
|
549
549
|
var PACKAGE_NAME = "code-storage-sdk";
|
|
@@ -1181,6 +1181,9 @@ var ApiFetcher = class {
|
|
|
1181
1181
|
}
|
|
1182
1182
|
};
|
|
1183
1183
|
|
|
1184
|
+
// src/types.ts
|
|
1185
|
+
var OP_NO_FORCE_PUSH = "no-force-push";
|
|
1186
|
+
|
|
1184
1187
|
// src/util.ts
|
|
1185
1188
|
function timingSafeEqual(a, b) {
|
|
1186
1189
|
const bufferA = typeof a === "string" ? new TextEncoder().encode(a) : a;
|
|
@@ -2805,7 +2808,8 @@ var GitStorage = class _GitStorage {
|
|
|
2805
2808
|
repo: repoId,
|
|
2806
2809
|
scopes: permissions,
|
|
2807
2810
|
iat: now,
|
|
2808
|
-
exp: now + ttl
|
|
2811
|
+
exp: now + ttl,
|
|
2812
|
+
...options?.ops && options.ops.length > 0 ? { ops: options.ops } : {}
|
|
2809
2813
|
};
|
|
2810
2814
|
const key = await importPKCS8(this.options.key, "ES256");
|
|
2811
2815
|
const jwt = await new SignJWT(payload).setProtectedHeader({ alg: "ES256", typ: "JWT" }).sign(key);
|
|
@@ -2816,6 +2820,6 @@ function createClient(options) {
|
|
|
2816
2820
|
return new GitStorage(options);
|
|
2817
2821
|
}
|
|
2818
2822
|
|
|
2819
|
-
export { ApiError, GitStorage as CodeStorage, GitStorage, RefUpdateError, createClient, parseSignatureHeader, validateWebhook, validateWebhookSignature };
|
|
2823
|
+
export { ApiError, GitStorage as CodeStorage, GitStorage, OP_NO_FORCE_PUSH, RefUpdateError, createClient, parseSignatureHeader, validateWebhook, validateWebhookSignature };
|
|
2820
2824
|
//# sourceMappingURL=index.js.map
|
|
2821
2825
|
//# sourceMappingURL=index.js.map
|