update
This commit is contained in:
163
.obsidian/plugins/obsidian-share-as-gist/main.js
vendored
163
.obsidian/plugins/obsidian-share-as-gist/main.js
vendored
@@ -4721,7 +4721,7 @@ function requestLog(octokit) {
|
||||
requestLog.VERSION = VERSION5;
|
||||
|
||||
// node_modules/@octokit/plugin-paginate-rest/dist-web/index.js
|
||||
var VERSION6 = "8.0.0";
|
||||
var VERSION6 = "9.0.0";
|
||||
function normalizePaginatedListResponse(response) {
|
||||
if (!response.data) {
|
||||
return __spreadProps(__spreadValues({}, response), {
|
||||
@@ -4828,7 +4828,7 @@ function paginateRest(octokit) {
|
||||
paginateRest.VERSION = VERSION6;
|
||||
|
||||
// node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js
|
||||
var VERSION7 = "9.0.0";
|
||||
var VERSION7 = "10.0.0";
|
||||
var Endpoints = {
|
||||
actions: {
|
||||
addCustomLabelsToSelfHostedRunnerForOrg: [
|
||||
@@ -4843,9 +4843,6 @@ var Endpoints = {
|
||||
addSelectedRepoToOrgVariable: [
|
||||
"PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
|
||||
],
|
||||
addSelectedRepoToRequiredWorkflow: [
|
||||
"PUT /orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories/{repository_id}"
|
||||
],
|
||||
approveWorkflowRun: [
|
||||
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"
|
||||
],
|
||||
@@ -4874,7 +4871,6 @@ var Endpoints = {
|
||||
"POST /repos/{owner}/{repo}/actions/runners/remove-token"
|
||||
],
|
||||
createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"],
|
||||
createRequiredWorkflow: ["POST /orgs/{org}/actions/required_workflows"],
|
||||
createWorkflowDispatch: [
|
||||
"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
|
||||
],
|
||||
@@ -4901,9 +4897,6 @@ var Endpoints = {
|
||||
deleteRepoVariable: [
|
||||
"DELETE /repos/{owner}/{repo}/actions/variables/{name}"
|
||||
],
|
||||
deleteRequiredWorkflow: [
|
||||
"DELETE /orgs/{org}/actions/required_workflows/{required_workflow_id}"
|
||||
],
|
||||
deleteSelfHostedRunnerFromOrg: [
|
||||
"DELETE /orgs/{org}/actions/runners/{runner_id}"
|
||||
],
|
||||
@@ -4991,17 +4984,8 @@ var Endpoints = {
|
||||
{ renamed: ["actions", "getGithubActionsPermissionsRepository"] }
|
||||
],
|
||||
getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"],
|
||||
getRepoRequiredWorkflow: [
|
||||
"GET /repos/{org}/{repo}/actions/required_workflows/{required_workflow_id_for_repo}"
|
||||
],
|
||||
getRepoRequiredWorkflowUsage: [
|
||||
"GET /repos/{org}/{repo}/actions/required_workflows/{required_workflow_id_for_repo}/timing"
|
||||
],
|
||||
getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],
|
||||
getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"],
|
||||
getRequiredWorkflow: [
|
||||
"GET /orgs/{org}/actions/required_workflows/{required_workflow_id}"
|
||||
],
|
||||
getReviewsForRun: [
|
||||
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"
|
||||
],
|
||||
@@ -5050,16 +5034,9 @@ var Endpoints = {
|
||||
listRepoOrganizationVariables: [
|
||||
"GET /repos/{owner}/{repo}/actions/organization-variables"
|
||||
],
|
||||
listRepoRequiredWorkflows: [
|
||||
"GET /repos/{org}/{repo}/actions/required_workflows"
|
||||
],
|
||||
listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
|
||||
listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"],
|
||||
listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
|
||||
listRequiredWorkflowRuns: [
|
||||
"GET /repos/{owner}/{repo}/actions/required_workflows/{required_workflow_id_for_repo}/runs"
|
||||
],
|
||||
listRequiredWorkflows: ["GET /orgs/{org}/actions/required_workflows"],
|
||||
listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"],
|
||||
listRunnerApplicationsForRepo: [
|
||||
"GET /repos/{owner}/{repo}/actions/runners/downloads"
|
||||
@@ -5073,9 +5050,6 @@ var Endpoints = {
|
||||
listSelectedRepositoriesEnabledGithubActionsOrganization: [
|
||||
"GET /orgs/{org}/actions/permissions/repositories"
|
||||
],
|
||||
listSelectedRepositoriesRequiredWorkflow: [
|
||||
"GET /orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories"
|
||||
],
|
||||
listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"],
|
||||
listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"],
|
||||
listWorkflowRunArtifacts: [
|
||||
@@ -5110,9 +5084,6 @@ var Endpoints = {
|
||||
removeSelectedRepoFromOrgVariable: [
|
||||
"DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
|
||||
],
|
||||
removeSelectedRepoFromRequiredWorkflow: [
|
||||
"DELETE /orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories/{repository_id}"
|
||||
],
|
||||
reviewCustomGatesForRun: [
|
||||
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"
|
||||
],
|
||||
@@ -5149,9 +5120,6 @@ var Endpoints = {
|
||||
setSelectedReposForOrgVariable: [
|
||||
"PUT /orgs/{org}/actions/variables/{name}/repositories"
|
||||
],
|
||||
setSelectedReposToRequiredWorkflow: [
|
||||
"PUT /orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories"
|
||||
],
|
||||
setSelectedRepositoriesEnabledGithubActionsOrganization: [
|
||||
"PUT /orgs/{org}/actions/permissions/repositories"
|
||||
],
|
||||
@@ -5164,9 +5132,6 @@ var Endpoints = {
|
||||
updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
|
||||
updateRepoVariable: [
|
||||
"PATCH /repos/{owner}/{repo}/actions/variables/{name}"
|
||||
],
|
||||
updateRequiredWorkflow: [
|
||||
"PATCH /orgs/{org}/actions/required_workflows/{required_workflow_id}"
|
||||
]
|
||||
},
|
||||
activity: {
|
||||
@@ -5394,9 +5359,6 @@ var Endpoints = {
|
||||
createWithRepoForAuthenticatedUser: [
|
||||
"POST /repos/{owner}/{repo}/codespaces"
|
||||
],
|
||||
deleteCodespacesBillingUsers: [
|
||||
"DELETE /orgs/{org}/codespaces/billing/selected_users"
|
||||
],
|
||||
deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"],
|
||||
deleteFromOrganization: [
|
||||
"DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"
|
||||
@@ -5468,10 +5430,6 @@ var Endpoints = {
|
||||
repoMachinesForAuthenticatedUser: [
|
||||
"GET /repos/{owner}/{repo}/codespaces/machines"
|
||||
],
|
||||
setCodespacesBilling: ["PUT /orgs/{org}/codespaces/billing"],
|
||||
setCodespacesBillingUsers: [
|
||||
"POST /orgs/{org}/codespaces/billing/selected_users"
|
||||
],
|
||||
setRepositoriesForSecretForAuthenticatedUser: [
|
||||
"PUT /user/codespaces/secrets/{secret_name}/repositories"
|
||||
],
|
||||
@@ -5485,6 +5443,25 @@ var Endpoints = {
|
||||
],
|
||||
updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
|
||||
},
|
||||
copilot: {
|
||||
addCopilotForBusinessSeatsForTeams: [
|
||||
"POST /orgs/{org}/copilot/billing/selected_teams"
|
||||
],
|
||||
addCopilotForBusinessSeatsForUsers: [
|
||||
"POST /orgs/{org}/copilot/billing/selected_users"
|
||||
],
|
||||
cancelCopilotSeatAssignmentForTeams: [
|
||||
"DELETE /orgs/{org}/copilot/billing/selected_teams"
|
||||
],
|
||||
cancelCopilotSeatAssignmentForUsers: [
|
||||
"DELETE /orgs/{org}/copilot/billing/selected_users"
|
||||
],
|
||||
getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
|
||||
getCopilotSeatAssignmentDetailsForUser: [
|
||||
"GET /orgs/{org}/members/{username}/copilot"
|
||||
],
|
||||
listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
|
||||
},
|
||||
dependabot: {
|
||||
addSelectedRepoToOrgSecret: [
|
||||
"PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
|
||||
@@ -5773,15 +5750,13 @@ var Endpoints = {
|
||||
listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
|
||||
listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
|
||||
listPatGrantRepositories: [
|
||||
"GET /organizations/{org}/personal-access-tokens/{pat_id}/repositories"
|
||||
"GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
|
||||
],
|
||||
listPatGrantRequestRepositories: [
|
||||
"GET /organizations/{org}/personal-access-token-requests/{pat_request_id}/repositories"
|
||||
"GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
|
||||
],
|
||||
listPatGrantRequests: [
|
||||
"GET /organizations/{org}/personal-access-token-requests"
|
||||
],
|
||||
listPatGrants: ["GET /organizations/{org}/personal-access-tokens"],
|
||||
listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"],
|
||||
listPatGrants: ["GET /orgs/{org}/personal-access-tokens"],
|
||||
listPendingInvitations: ["GET /orgs/{org}/invitations"],
|
||||
listPublicMembers: ["GET /orgs/{org}/public_members"],
|
||||
listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"],
|
||||
@@ -5803,10 +5778,10 @@ var Endpoints = {
|
||||
"DELETE /orgs/{org}/security-managers/teams/{team_slug}"
|
||||
],
|
||||
reviewPatGrantRequest: [
|
||||
"POST /organizations/{org}/personal-access-token-requests/{pat_request_id}"
|
||||
"POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"
|
||||
],
|
||||
reviewPatGrantRequestsInBulk: [
|
||||
"POST /organizations/{org}/personal-access-token-requests"
|
||||
"POST /orgs/{org}/personal-access-token-requests"
|
||||
],
|
||||
setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
|
||||
setPublicMembershipForAuthenticatedUser: [
|
||||
@@ -5817,10 +5792,8 @@ var Endpoints = {
|
||||
updateMembershipForAuthenticatedUser: [
|
||||
"PATCH /user/memberships/orgs/{org}"
|
||||
],
|
||||
updatePatAccess: [
|
||||
"POST /organizations/{org}/personal-access-tokens/{pat_id}"
|
||||
],
|
||||
updatePatAccesses: ["POST /organizations/{org}/personal-access-tokens"],
|
||||
updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"],
|
||||
updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"],
|
||||
updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"],
|
||||
updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"]
|
||||
},
|
||||
@@ -6100,6 +6073,9 @@ var Endpoints = {
|
||||
{},
|
||||
{ mapToData: "users" }
|
||||
],
|
||||
checkAutomatedSecurityFixes: [
|
||||
"GET /repos/{owner}/{repo}/automated-security-fixes"
|
||||
],
|
||||
checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
|
||||
checkVulnerabilityAlerts: [
|
||||
"GET /repos/{owner}/{repo}/vulnerability-alerts"
|
||||
@@ -6203,7 +6179,9 @@ var Endpoints = {
|
||||
disableDeploymentProtectionRule: [
|
||||
"DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
|
||||
],
|
||||
disableLfsForRepo: ["DELETE /repos/{owner}/{repo}/lfs"],
|
||||
disablePrivateVulnerabilityReporting: [
|
||||
"DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
|
||||
],
|
||||
disableVulnerabilityAlerts: [
|
||||
"DELETE /repos/{owner}/{repo}/vulnerability-alerts"
|
||||
],
|
||||
@@ -6217,7 +6195,9 @@ var Endpoints = {
|
||||
enableAutomatedSecurityFixes: [
|
||||
"PUT /repos/{owner}/{repo}/automated-security-fixes"
|
||||
],
|
||||
enableLfsForRepo: ["PUT /repos/{owner}/{repo}/lfs"],
|
||||
enablePrivateVulnerabilityReporting: [
|
||||
"PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
|
||||
],
|
||||
enableVulnerabilityAlerts: [
|
||||
"PUT /repos/{owner}/{repo}/vulnerability-alerts"
|
||||
],
|
||||
@@ -6315,6 +6295,7 @@ var Endpoints = {
|
||||
getWebhookDelivery: [
|
||||
"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"
|
||||
],
|
||||
listActivities: ["GET /repos/{owner}/{repo}/activity"],
|
||||
listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"],
|
||||
listBranches: ["GET /repos/{owner}/{repo}/branches"],
|
||||
listBranchesForHeadCommit: [
|
||||
@@ -6494,9 +6475,15 @@ var Endpoints = {
|
||||
createRepositoryAdvisory: [
|
||||
"POST /repos/{owner}/{repo}/security-advisories"
|
||||
],
|
||||
createRepositoryAdvisoryCveRequest: [
|
||||
"POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"
|
||||
],
|
||||
getGlobalAdvisory: ["GET /advisories/{ghsa_id}"],
|
||||
getRepositoryAdvisory: [
|
||||
"GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
|
||||
],
|
||||
listGlobalAdvisories: ["GET /advisories"],
|
||||
listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"],
|
||||
listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"],
|
||||
updateRepositoryAdvisory: [
|
||||
"PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
|
||||
@@ -6803,7 +6790,7 @@ function legacyRestEndpointMethods(octokit) {
|
||||
legacyRestEndpointMethods.VERSION = VERSION7;
|
||||
|
||||
// node_modules/@octokit/rest/dist-web/index.js
|
||||
var VERSION8 = "20.0.1";
|
||||
var VERSION8 = "20.0.2";
|
||||
var Octokit2 = Octokit.plugin(
|
||||
requestLog,
|
||||
legacyRestEndpointMethods,
|
||||
@@ -6916,6 +6903,42 @@ var getLatestSettings = (plugin) => __async(void 0, null, function* () {
|
||||
return plugin.settings;
|
||||
});
|
||||
var stripFrontMatter = (content) => (0, import_gray_matter2.default)(content).content;
|
||||
var copyGitUrlEditorCallback = (opts) => () => __async(void 0, null, function* () {
|
||||
const { app, plugin } = opts;
|
||||
const { enableUpdatingGistsAfterCreation } = yield getLatestSettings(plugin);
|
||||
if (!enableUpdatingGistsAfterCreation) {
|
||||
return new import_obsidian.Notice(
|
||||
"You need to enable 'Update gists after creation' in Settings to use this command."
|
||||
);
|
||||
}
|
||||
const view = app.workspace.getActiveViewOfType(import_obsidian.MarkdownView);
|
||||
if (!view) {
|
||||
return new import_obsidian.Notice("No active file");
|
||||
}
|
||||
const editor = view.editor;
|
||||
const originalContent = editor.getValue();
|
||||
const existingSharedGists = getSharedGistsForFile(originalContent);
|
||||
if (existingSharedGists.length === 0) {
|
||||
return new import_obsidian.Notice(
|
||||
"You must share this note as a gist before you can copy its URL to the clipboard."
|
||||
);
|
||||
}
|
||||
if (existingSharedGists.length > 1) {
|
||||
new SelectExistingGistModal(
|
||||
app,
|
||||
existingSharedGists,
|
||||
false,
|
||||
(sharedGist) => __async(void 0, null, function* () {
|
||||
navigator.clipboard.writeText(sharedGist.url);
|
||||
new import_obsidian.Notice("Copied gist URL to clipboard.");
|
||||
})
|
||||
).open();
|
||||
} else {
|
||||
const sharedGist = existingSharedGists[0];
|
||||
navigator.clipboard.writeText(sharedGist.url);
|
||||
return new import_obsidian.Notice("Copied gist URL to clipboard.");
|
||||
}
|
||||
});
|
||||
var shareGistEditorCallback = (opts) => () => __async(void 0, null, function* () {
|
||||
const { isPublic, app, plugin } = opts;
|
||||
const accessToken = getAccessToken();
|
||||
@@ -6937,9 +6960,10 @@ var shareGistEditorCallback = (opts) => () => __async(void 0, null, function* ()
|
||||
);
|
||||
const gistContent = includeFrontMatter ? originalContent : stripFrontMatter(originalContent);
|
||||
if (enableUpdatingGistsAfterCreation && existingSharedGists.length) {
|
||||
new ShareAsGistSelectExistingGistModal(
|
||||
new SelectExistingGistModal(
|
||||
app,
|
||||
existingSharedGists,
|
||||
true,
|
||||
(sharedGist) => __async(void 0, null, function* () {
|
||||
let result;
|
||||
if (sharedGist) {
|
||||
@@ -7047,6 +7071,14 @@ var ShareAsGistPlugin = class extends import_obsidian.Plugin {
|
||||
isPublic: false
|
||||
})
|
||||
});
|
||||
this.addCommand({
|
||||
id: "copy-gist-url",
|
||||
name: "Copy GitHub.com gist URL",
|
||||
callback: copyGitUrlEditorCallback({
|
||||
plugin: this,
|
||||
app: this.app
|
||||
})
|
||||
});
|
||||
this.addModifyCallback();
|
||||
this.addSettingTab(new ShareAsGistSettingTab(this.app, this));
|
||||
});
|
||||
@@ -7091,14 +7123,19 @@ var ShareAsGistPlugin = class extends import_obsidian.Plugin {
|
||||
});
|
||||
}
|
||||
};
|
||||
var ShareAsGistSelectExistingGistModal = class extends import_obsidian.SuggestModal {
|
||||
constructor(app, sharedGists, onSubmit) {
|
||||
var SelectExistingGistModal = class extends import_obsidian.SuggestModal {
|
||||
constructor(app, sharedGists, allowCreatingNewGist, onSubmit) {
|
||||
super(app);
|
||||
this.sharedGists = sharedGists;
|
||||
this.allowCreatingNewGist = allowCreatingNewGist;
|
||||
this.onSubmit = onSubmit;
|
||||
}
|
||||
getSuggestions() {
|
||||
return this.sharedGists.concat(null);
|
||||
if (this.allowCreatingNewGist) {
|
||||
return this.sharedGists.concat(null);
|
||||
} else {
|
||||
return this.sharedGists;
|
||||
}
|
||||
}
|
||||
renderSuggestion(sharedGist, el) {
|
||||
if (sharedGist === null) {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "obsidian-share-as-gist",
|
||||
"name": "Share as Gist",
|
||||
"version": "1.3.1",
|
||||
"version": "1.4.0",
|
||||
"minAppVersion": "0.9.7",
|
||||
"description": "Shares an Obsidian note as a GitHub.com gist",
|
||||
"author": "Tim Rogers",
|
||||
|
Reference in New Issue
Block a user