@opengeni/contracts 2.9.2 → 2.13.0-canary.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/dist/artifacts.d.ts +121 -0
- package/dist/atlassian.js +11 -11
- package/dist/{chunk-4IVHBXRI.js → chunk-7ABONTXE.js} +42 -2
- package/dist/chunk-7ABONTXE.js.map +1 -0
- package/dist/{chunk-7RMTKFJW.js → chunk-7Q6HPDY2.js} +8 -8
- package/dist/{chunk-AWNGBY5I.js → chunk-DPCCW6U7.js} +7395 -6619
- package/dist/chunk-DPCCW6U7.js.map +1 -0
- package/dist/{chunk-N6GRVXAJ.js → chunk-NPBM4QSK.js} +2 -2
- package/dist/connection-authority.js +11 -11
- package/dist/editable-artifact-codec-registry.js +2 -2
- package/dist/editable-artifact-live.js +2 -2
- package/dist/editable-artifact-serialized-commit.js +3 -3
- package/dist/editable-artifacts.js +13 -13
- package/dist/github-repository-contracts.d.ts +36 -0
- package/dist/github-repository-contracts.js +59 -0
- package/dist/github-repository-contracts.js.map +1 -0
- package/dist/github-repository.d.ts +14 -0
- package/dist/github-repository.js +36 -0
- package/dist/github-repository.js.map +1 -0
- package/dist/google-drive.js +12 -12
- package/dist/index.d.ts +809 -70
- package/dist/index.js +299 -135
- package/dist/mcp-oauth.d.ts +71 -0
- package/dist/model-context-inspector.d.ts +205 -0
- package/dist/model-picker-order.d.ts +23 -0
- package/dist/model-picker-order.js +42 -0
- package/dist/model-picker-order.js.map +1 -0
- package/dist/organization-membership-lifecycle.d.ts +17 -0
- package/dist/personal-github.js +11 -11
- package/dist/session-mcp-projections.d.ts +210 -0
- package/dist/session-titles.d.ts +35 -0
- package/dist/session-titles.js +9 -3
- package/dist/tool-catalog.d.ts +271 -0
- package/dist/workspace-learning-policy.d.ts +1 -1
- package/package.json +13 -1
- package/src/artifacts.ts +111 -1
- package/src/github-repository-contracts.ts +85 -0
- package/src/github-repository.ts +59 -0
- package/src/index.ts +486 -52
- package/src/mcp-oauth.ts +68 -0
- package/src/model-context-inspector.ts +104 -0
- package/src/model-picker-order.ts +87 -0
- package/src/organization-membership-lifecycle.ts +20 -0
- package/src/session-mcp-projections.ts +268 -0
- package/src/session-titles.ts +100 -0
- package/src/tool-catalog.ts +136 -0
- package/src/workspace-learning-policy.ts +4 -3
- package/dist/chunk-4IVHBXRI.js.map +0 -1
- package/dist/chunk-AWNGBY5I.js.map +0 -1
- /package/dist/{chunk-7RMTKFJW.js.map → chunk-7Q6HPDY2.js.map} +0 -0
- /package/dist/{chunk-N6GRVXAJ.js.map → chunk-NPBM4QSK.js.map} +0 -0
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-NVJMJWLL.js";
|
|
7
7
|
import {
|
|
8
8
|
editableArtifactCodecFor
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7Q6HPDY2.js";
|
|
10
10
|
import {
|
|
11
11
|
DOCUMENT_ARTIFACT_COMMAND_MAX_COMMANDS,
|
|
12
12
|
DOCUMENT_ARTIFACT_MAX_STRUCTURAL_COUNTER
|
|
@@ -380,4 +380,4 @@ export {
|
|
|
380
380
|
decodeEditableArtifactSerializedCommit,
|
|
381
381
|
assertCanonicalEditableArtifactSerializedCommit
|
|
382
382
|
};
|
|
383
|
-
//# sourceMappingURL=chunk-
|
|
383
|
+
//# sourceMappingURL=chunk-NPBM4QSK.js.map
|
|
@@ -4,26 +4,26 @@ import {
|
|
|
4
4
|
SessionTenancyVisibility,
|
|
5
5
|
UserResourceAuthorityGrant,
|
|
6
6
|
UserResourceDelegation
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-WYBDERIY.js";
|
|
9
|
-
import "./chunk-MRWYRAS5.js";
|
|
10
|
-
import "./chunk-4IVHBXRI.js";
|
|
11
|
-
import "./chunk-CM6BMECR.js";
|
|
12
|
-
import "./chunk-JUFK3T4Q.js";
|
|
7
|
+
} from "./chunk-DPCCW6U7.js";
|
|
13
8
|
import "./chunk-YBW5JSA3.js";
|
|
14
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-NPBM4QSK.js";
|
|
10
|
+
import "./chunk-CM6BMECR.js";
|
|
11
|
+
import "./chunk-MRWYRAS5.js";
|
|
15
12
|
import "./chunk-3SIZGL3O.js";
|
|
13
|
+
import "./chunk-M5ZGRVIQ.js";
|
|
14
|
+
import "./chunk-BCS7WHCK.js";
|
|
15
|
+
import "./chunk-WYBDERIY.js";
|
|
16
|
+
import "./chunk-7ABONTXE.js";
|
|
16
17
|
import "./chunk-NVJMJWLL.js";
|
|
17
18
|
import "./chunk-YRKRZ6OF.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-7Q6HPDY2.js";
|
|
19
20
|
import "./chunk-Y3KNXVTD.js";
|
|
21
|
+
import "./chunk-TXTQIYCV.js";
|
|
20
22
|
import "./chunk-RIY7GYQS.js";
|
|
21
23
|
import "./chunk-D2HKF2EF.js";
|
|
22
24
|
import "./chunk-MYBZRDTY.js";
|
|
23
|
-
import "./chunk-TXTQIYCV.js";
|
|
24
25
|
import "./chunk-PX3VCKAU.js";
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-M5ZGRVIQ.js";
|
|
26
|
+
import "./chunk-JUFK3T4Q.js";
|
|
27
27
|
|
|
28
28
|
// src/connection-authority.ts
|
|
29
29
|
import { z } from "zod";
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
EDITABLE_ARTIFACT_CODEC_REGISTRY,
|
|
3
3
|
currentEditableArtifactCompatibility,
|
|
4
4
|
editableArtifactCodecFor
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-7Q6HPDY2.js";
|
|
6
6
|
import "./chunk-Y3KNXVTD.js";
|
|
7
|
+
import "./chunk-TXTQIYCV.js";
|
|
7
8
|
import "./chunk-RIY7GYQS.js";
|
|
8
9
|
import "./chunk-D2HKF2EF.js";
|
|
9
10
|
import "./chunk-MYBZRDTY.js";
|
|
10
|
-
import "./chunk-TXTQIYCV.js";
|
|
11
11
|
import {
|
|
12
12
|
DOCUMENT_ARTIFACT_MODEL_SCHEMA_VERSION,
|
|
13
13
|
DOCUMENT_ARTIFACT_SNAPSHOT_VERSION,
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
hashEditableArtifactMutationIntentBytes
|
|
4
4
|
} from "./chunk-NVJMJWLL.js";
|
|
5
5
|
import "./chunk-YRKRZ6OF.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-7Q6HPDY2.js";
|
|
7
7
|
import "./chunk-Y3KNXVTD.js";
|
|
8
|
+
import "./chunk-TXTQIYCV.js";
|
|
8
9
|
import "./chunk-RIY7GYQS.js";
|
|
9
10
|
import "./chunk-D2HKF2EF.js";
|
|
10
11
|
import "./chunk-MYBZRDTY.js";
|
|
11
|
-
import "./chunk-TXTQIYCV.js";
|
|
12
12
|
import {
|
|
13
13
|
EDITABLE_ARTIFACT_LIVE_WIRE_VERSION
|
|
14
14
|
} from "./chunk-PX3VCKAU.js";
|
|
@@ -4,15 +4,15 @@ import {
|
|
|
4
4
|
assertCanonicalEditableArtifactSerializedCommit,
|
|
5
5
|
decodeEditableArtifactSerializedCommit,
|
|
6
6
|
encodeEditableArtifactSerializedCommit
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-NPBM4QSK.js";
|
|
8
8
|
import "./chunk-NVJMJWLL.js";
|
|
9
9
|
import "./chunk-YRKRZ6OF.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-7Q6HPDY2.js";
|
|
11
11
|
import "./chunk-Y3KNXVTD.js";
|
|
12
|
+
import "./chunk-TXTQIYCV.js";
|
|
12
13
|
import "./chunk-RIY7GYQS.js";
|
|
13
14
|
import "./chunk-D2HKF2EF.js";
|
|
14
15
|
import "./chunk-MYBZRDTY.js";
|
|
15
|
-
import "./chunk-TXTQIYCV.js";
|
|
16
16
|
import {
|
|
17
17
|
EDITABLE_ARTIFACT_SERIALIZED_COMMIT_VERSION
|
|
18
18
|
} from "./chunk-PX3VCKAU.js";
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
EDITABLE_ARTIFACT_CODEC_REGISTRY,
|
|
26
26
|
currentEditableArtifactCompatibility,
|
|
27
27
|
editableArtifactCodecFor
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-7Q6HPDY2.js";
|
|
29
29
|
import {
|
|
30
30
|
SPREADSHEET_ARTIFACT_METADATA_MAX_SHEETS,
|
|
31
31
|
SPREADSHEET_ARTIFACT_METADATA_MIN_RESPONSE_BYTES,
|
|
@@ -49,6 +49,18 @@ import {
|
|
|
49
49
|
encodeSpreadsheetViewportKernelProjection,
|
|
50
50
|
encodeSpreadsheetViewportKernelQuery
|
|
51
51
|
} from "./chunk-Y3KNXVTD.js";
|
|
52
|
+
import {
|
|
53
|
+
SPREADSHEET_ARTIFACT_COMMAND_MAX_BYTES,
|
|
54
|
+
SPREADSHEET_ARTIFACT_COMMAND_MAX_CELLS,
|
|
55
|
+
SPREADSHEET_ARTIFACT_COMMAND_MAX_COMMANDS,
|
|
56
|
+
SPREADSHEET_ARTIFACT_COMMAND_MAX_STRING_BYTES,
|
|
57
|
+
SPREADSHEET_ARTIFACT_SHEET_NAME_MAX_UTF16_UNITS,
|
|
58
|
+
assertCanonicalSpreadsheetArtifactCommandBytes,
|
|
59
|
+
decodeSpreadsheetArtifactCommandBatch,
|
|
60
|
+
editableArtifactStableId,
|
|
61
|
+
encodeSpreadsheetArtifactCommandBatch,
|
|
62
|
+
spreadsheetSheetId
|
|
63
|
+
} from "./chunk-TXTQIYCV.js";
|
|
52
64
|
import {
|
|
53
65
|
DOCUMENT_ARTIFACT_COMMAND_MAX_BYTES,
|
|
54
66
|
DOCUMENT_ARTIFACT_COMMAND_MAX_COMMANDS,
|
|
@@ -108,18 +120,6 @@ import {
|
|
|
108
120
|
encodePresentationArtifactQueryResponse
|
|
109
121
|
} from "./chunk-D2HKF2EF.js";
|
|
110
122
|
import "./chunk-MYBZRDTY.js";
|
|
111
|
-
import {
|
|
112
|
-
SPREADSHEET_ARTIFACT_COMMAND_MAX_BYTES,
|
|
113
|
-
SPREADSHEET_ARTIFACT_COMMAND_MAX_CELLS,
|
|
114
|
-
SPREADSHEET_ARTIFACT_COMMAND_MAX_COMMANDS,
|
|
115
|
-
SPREADSHEET_ARTIFACT_COMMAND_MAX_STRING_BYTES,
|
|
116
|
-
SPREADSHEET_ARTIFACT_SHEET_NAME_MAX_UTF16_UNITS,
|
|
117
|
-
assertCanonicalSpreadsheetArtifactCommandBytes,
|
|
118
|
-
decodeSpreadsheetArtifactCommandBatch,
|
|
119
|
-
editableArtifactStableId,
|
|
120
|
-
encodeSpreadsheetArtifactCommandBatch,
|
|
121
|
-
spreadsheetSheetId
|
|
122
|
-
} from "./chunk-TXTQIYCV.js";
|
|
123
123
|
import {
|
|
124
124
|
DOCUMENT_ARTIFACT_MODEL_SCHEMA_VERSION,
|
|
125
125
|
DOCUMENT_ARTIFACT_SNAPSHOT_VERSION,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const VerifyPublicGitHubRepositoryRefRequest: z.ZodObject<{
|
|
3
|
+
url: z.ZodString;
|
|
4
|
+
ref: z.ZodString;
|
|
5
|
+
}, z.core.$strict>;
|
|
6
|
+
export type VerifyPublicGitHubRepositoryRefRequest = z.infer<typeof VerifyPublicGitHubRepositoryRefRequest>;
|
|
7
|
+
export declare const VerifyPublicGitHubRepositoryRefResponse: z.ZodObject<{
|
|
8
|
+
owner: z.ZodString;
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
fullName: z.ZodString;
|
|
11
|
+
canonicalUrl: z.ZodString;
|
|
12
|
+
cloneUrl: z.ZodString;
|
|
13
|
+
defaultBranch: z.ZodString;
|
|
14
|
+
ref: z.ZodString;
|
|
15
|
+
commitSha: z.ZodString;
|
|
16
|
+
}, z.core.$strict>;
|
|
17
|
+
export type VerifyPublicGitHubRepositoryRefResponse = z.infer<typeof VerifyPublicGitHubRepositoryRefResponse>;
|
|
18
|
+
export declare const GITHUB_REPOSITORY_BRANCH_PAGE_MAX: 100;
|
|
19
|
+
export declare const ListGitHubRepositoryBranchesQuery: z.ZodObject<{
|
|
20
|
+
cursor: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
21
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
22
|
+
}, z.core.$strict>;
|
|
23
|
+
export type ListGitHubRepositoryBranchesQuery = z.infer<typeof ListGitHubRepositoryBranchesQuery>;
|
|
24
|
+
export declare const GitHubRepositoryBranch: z.ZodObject<{
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
isDefault: z.ZodBoolean;
|
|
27
|
+
}, z.core.$strict>;
|
|
28
|
+
export type GitHubRepositoryBranch = z.infer<typeof GitHubRepositoryBranch>;
|
|
29
|
+
export declare const GitHubRepositoryBranchesResponse: z.ZodObject<{
|
|
30
|
+
branches: z.ZodArray<z.ZodObject<{
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
isDefault: z.ZodBoolean;
|
|
33
|
+
}, z.core.$strict>>;
|
|
34
|
+
nextCursor: z.ZodNullable<z.ZodNumber>;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
export type GitHubRepositoryBranchesResponse = z.infer<typeof GitHubRepositoryBranchesResponse>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// src/github-repository-contracts.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var VerifyPublicGitHubRepositoryRefRequest = z.object({
|
|
4
|
+
url: z.string().min(1).max(2048),
|
|
5
|
+
ref: z.string().trim().min(1).max(1024).refine((value) => !/[\u0000-\u001f\u007f]/u.test(value), "ref contains control characters")
|
|
6
|
+
}).strict();
|
|
7
|
+
var VerifyPublicGitHubRepositoryRefResponse = z.object({
|
|
8
|
+
owner: z.string().min(1).max(39),
|
|
9
|
+
name: z.string().min(1).max(100),
|
|
10
|
+
fullName: z.string().min(3).max(140),
|
|
11
|
+
canonicalUrl: z.string().url(),
|
|
12
|
+
cloneUrl: z.string().url(),
|
|
13
|
+
defaultBranch: z.string().min(1).max(1024),
|
|
14
|
+
ref: z.string().min(1).max(1024),
|
|
15
|
+
commitSha: z.string().regex(/^[0-9a-f]{40}$/u)
|
|
16
|
+
}).strict();
|
|
17
|
+
var GITHUB_REPOSITORY_BRANCH_PAGE_MAX = 100;
|
|
18
|
+
var ListGitHubRepositoryBranchesQuery = z.object({
|
|
19
|
+
cursor: z.coerce.number().int().positive().max(1e4).default(1),
|
|
20
|
+
limit: z.coerce.number().int().min(1).max(GITHUB_REPOSITORY_BRANCH_PAGE_MAX).default(GITHUB_REPOSITORY_BRANCH_PAGE_MAX)
|
|
21
|
+
}).strict();
|
|
22
|
+
var GitHubRepositoryBranch = z.object({
|
|
23
|
+
name: z.string().min(1).max(1024),
|
|
24
|
+
isDefault: z.boolean()
|
|
25
|
+
}).strict();
|
|
26
|
+
var GitHubRepositoryBranchesResponse = z.object({
|
|
27
|
+
branches: z.array(GitHubRepositoryBranch).max(GITHUB_REPOSITORY_BRANCH_PAGE_MAX),
|
|
28
|
+
nextCursor: z.number().int().positive().max(1e4).nullable()
|
|
29
|
+
}).strict().superRefine((response, context) => {
|
|
30
|
+
const names = /* @__PURE__ */ new Set();
|
|
31
|
+
let defaultCount = 0;
|
|
32
|
+
response.branches.forEach((branch, index) => {
|
|
33
|
+
if (names.has(branch.name)) {
|
|
34
|
+
context.addIssue({
|
|
35
|
+
code: "custom",
|
|
36
|
+
path: ["branches", index, "name"],
|
|
37
|
+
message: "branch names must be unique"
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
names.add(branch.name);
|
|
41
|
+
if (branch.isDefault) defaultCount += 1;
|
|
42
|
+
});
|
|
43
|
+
if (defaultCount > 1) {
|
|
44
|
+
context.addIssue({
|
|
45
|
+
code: "custom",
|
|
46
|
+
path: ["branches"],
|
|
47
|
+
message: "at most one branch may be marked as default"
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
export {
|
|
52
|
+
GITHUB_REPOSITORY_BRANCH_PAGE_MAX,
|
|
53
|
+
GitHubRepositoryBranch,
|
|
54
|
+
GitHubRepositoryBranchesResponse,
|
|
55
|
+
ListGitHubRepositoryBranchesQuery,
|
|
56
|
+
VerifyPublicGitHubRepositoryRefRequest,
|
|
57
|
+
VerifyPublicGitHubRepositoryRefResponse
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=github-repository-contracts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/github-repository-contracts.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const VerifyPublicGitHubRepositoryRefRequest = z\n .object({\n url: z.string().min(1).max(2048),\n ref: z\n .string()\n .trim()\n .min(1)\n .max(1024)\n .refine((value) => !/[\\u0000-\\u001f\\u007f]/u.test(value), \"ref contains control characters\"),\n })\n .strict();\nexport type VerifyPublicGitHubRepositoryRefRequest = z.infer<\n typeof VerifyPublicGitHubRepositoryRefRequest\n>;\n\nexport const VerifyPublicGitHubRepositoryRefResponse = z\n .object({\n owner: z.string().min(1).max(39),\n name: z.string().min(1).max(100),\n fullName: z.string().min(3).max(140),\n canonicalUrl: z.string().url(),\n cloneUrl: z.string().url(),\n defaultBranch: z.string().min(1).max(1024),\n ref: z.string().min(1).max(1024),\n commitSha: z.string().regex(/^[0-9a-f]{40}$/u),\n })\n .strict();\nexport type VerifyPublicGitHubRepositoryRefResponse = z.infer<\n typeof VerifyPublicGitHubRepositoryRefResponse\n>;\n\nexport const GITHUB_REPOSITORY_BRANCH_PAGE_MAX = 100 as const;\n\nexport const ListGitHubRepositoryBranchesQuery = z\n .object({\n cursor: z.coerce.number().int().positive().max(10_000).default(1),\n limit: z.coerce\n .number()\n .int()\n .min(1)\n .max(GITHUB_REPOSITORY_BRANCH_PAGE_MAX)\n .default(GITHUB_REPOSITORY_BRANCH_PAGE_MAX),\n })\n .strict();\nexport type ListGitHubRepositoryBranchesQuery = z.infer<typeof ListGitHubRepositoryBranchesQuery>;\n\nexport const GitHubRepositoryBranch = z\n .object({\n name: z.string().min(1).max(1024),\n isDefault: z.boolean(),\n })\n .strict();\nexport type GitHubRepositoryBranch = z.infer<typeof GitHubRepositoryBranch>;\n\nexport const GitHubRepositoryBranchesResponse = z\n .object({\n branches: z.array(GitHubRepositoryBranch).max(GITHUB_REPOSITORY_BRANCH_PAGE_MAX),\n nextCursor: z.number().int().positive().max(10_000).nullable(),\n })\n .strict()\n .superRefine((response, context) => {\n const names = new Set<string>();\n let defaultCount = 0;\n response.branches.forEach((branch, index) => {\n if (names.has(branch.name)) {\n context.addIssue({\n code: \"custom\",\n path: [\"branches\", index, \"name\"],\n message: \"branch names must be unique\",\n });\n }\n names.add(branch.name);\n if (branch.isDefault) defaultCount += 1;\n });\n if (defaultCount > 1) {\n context.addIssue({\n code: \"custom\",\n path: [\"branches\"],\n message: \"at most one branch may be marked as default\",\n });\n }\n });\nexport type GitHubRepositoryBranchesResponse = z.infer<typeof GitHubRepositoryBranchesResponse>;\n"],"mappings":";AAAA,SAAS,SAAS;AAEX,IAAM,yCAAyC,EACnD,OAAO;AAAA,EACN,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,IAAI;AAAA,EAC/B,KAAK,EACF,OAAO,EACP,KAAK,EACL,IAAI,CAAC,EACL,IAAI,IAAI,EACR,OAAO,CAAC,UAAU,CAAC,yBAAyB,KAAK,KAAK,GAAG,iCAAiC;AAC/F,CAAC,EACA,OAAO;AAKH,IAAM,0CAA0C,EACpD,OAAO;AAAA,EACN,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE;AAAA,EAC/B,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC/B,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EACnC,cAAc,EAAE,OAAO,EAAE,IAAI;AAAA,EAC7B,UAAU,EAAE,OAAO,EAAE,IAAI;AAAA,EACzB,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,IAAI;AAAA,EACzC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,IAAI;AAAA,EAC/B,WAAW,EAAE,OAAO,EAAE,MAAM,iBAAiB;AAC/C,CAAC,EACA,OAAO;AAKH,IAAM,oCAAoC;AAE1C,IAAM,oCAAoC,EAC9C,OAAO;AAAA,EACN,QAAQ,EAAE,OAAO,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,GAAM,EAAE,QAAQ,CAAC;AAAA,EAChE,OAAO,EAAE,OACN,OAAO,EACP,IAAI,EACJ,IAAI,CAAC,EACL,IAAI,iCAAiC,EACrC,QAAQ,iCAAiC;AAC9C,CAAC,EACA,OAAO;AAGH,IAAM,yBAAyB,EACnC,OAAO;AAAA,EACN,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,IAAI;AAAA,EAChC,WAAW,EAAE,QAAQ;AACvB,CAAC,EACA,OAAO;AAGH,IAAM,mCAAmC,EAC7C,OAAO;AAAA,EACN,UAAU,EAAE,MAAM,sBAAsB,EAAE,IAAI,iCAAiC;AAAA,EAC/E,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,GAAM,EAAE,SAAS;AAC/D,CAAC,EACA,OAAO,EACP,YAAY,CAAC,UAAU,YAAY;AAClC,QAAM,QAAQ,oBAAI,IAAY;AAC9B,MAAI,eAAe;AACnB,WAAS,SAAS,QAAQ,CAAC,QAAQ,UAAU;AAC3C,QAAI,MAAM,IAAI,OAAO,IAAI,GAAG;AAC1B,cAAQ,SAAS;AAAA,QACf,MAAM;AAAA,QACN,MAAM,CAAC,YAAY,OAAO,MAAM;AAAA,QAChC,SAAS;AAAA,MACX,CAAC;AAAA,IACH;AACA,UAAM,IAAI,OAAO,IAAI;AACrB,QAAI,OAAO,UAAW,iBAAgB;AAAA,EACxC,CAAC;AACD,MAAI,eAAe,GAAG;AACpB,YAAQ,SAAS;AAAA,MACf,MAAM;AAAA,MACN,MAAM,CAAC,UAAU;AAAA,MACjB,SAAS;AAAA,IACX,CAAC;AAAA,EACH;AACF,CAAC;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type CanonicalGitHubRepository = {
|
|
2
|
+
owner: string;
|
|
3
|
+
name: string;
|
|
4
|
+
fullName: string;
|
|
5
|
+
canonicalUrl: string;
|
|
6
|
+
cloneUrl: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Parse only a canonical public github.com repository URL. This deliberately
|
|
10
|
+
* rejects aliases, credentials, ports, query/fragment state, encoded paths,
|
|
11
|
+
* and repository subpaths so callers cannot accidentally verify one target
|
|
12
|
+
* and attach another.
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseCanonicalGitHubRepositoryUrl(value: string): CanonicalGitHubRepository;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// src/github-repository.ts
|
|
2
|
+
function parseCanonicalGitHubRepositoryUrl(value) {
|
|
3
|
+
if (!value.startsWith("https://github.com/")) {
|
|
4
|
+
throw new Error("GitHub repository URL must use the exact https://github.com host.");
|
|
5
|
+
}
|
|
6
|
+
let url;
|
|
7
|
+
try {
|
|
8
|
+
url = new URL(value);
|
|
9
|
+
} catch {
|
|
10
|
+
throw new TypeError("GitHub repository URL is invalid.");
|
|
11
|
+
}
|
|
12
|
+
if (url.protocol !== "https:" || url.hostname !== "github.com" || url.host !== "github.com" || url.username || url.password || url.search || url.hash || url.pathname.includes("%")) {
|
|
13
|
+
throw new TypeError("Use a canonical https://github.com/owner/repository URL.");
|
|
14
|
+
}
|
|
15
|
+
const match = /^\/([^/]+)\/([^/]+?)\/?$/u.exec(url.pathname);
|
|
16
|
+
if (!match) {
|
|
17
|
+
throw new TypeError("GitHub repository URL must contain exactly owner/repository.");
|
|
18
|
+
}
|
|
19
|
+
const owner = match[1];
|
|
20
|
+
const name = match[2].replace(/\.git$/iu, "");
|
|
21
|
+
if (!/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?$/u.test(owner) || !/^[A-Za-z0-9_.-]{1,100}$/u.test(name) || name === "." || name === "..") {
|
|
22
|
+
throw new TypeError("GitHub repository owner or name is invalid.");
|
|
23
|
+
}
|
|
24
|
+
const fullName = `${owner}/${name}`;
|
|
25
|
+
return {
|
|
26
|
+
owner,
|
|
27
|
+
name,
|
|
28
|
+
fullName,
|
|
29
|
+
canonicalUrl: `https://github.com/${fullName}`,
|
|
30
|
+
cloneUrl: `https://github.com/${fullName}.git`
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
parseCanonicalGitHubRepositoryUrl
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=github-repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/github-repository.ts"],"sourcesContent":["export type CanonicalGitHubRepository = {\n owner: string;\n name: string;\n fullName: string;\n canonicalUrl: string;\n cloneUrl: string;\n};\n\n/**\n * Parse only a canonical public github.com repository URL. This deliberately\n * rejects aliases, credentials, ports, query/fragment state, encoded paths,\n * and repository subpaths so callers cannot accidentally verify one target\n * and attach another.\n */\nexport function parseCanonicalGitHubRepositoryUrl(value: string): CanonicalGitHubRepository {\n if (!value.startsWith(\"https://github.com/\")) {\n throw new Error(\"GitHub repository URL must use the exact https://github.com host.\");\n }\n let url: URL;\n try {\n url = new URL(value);\n } catch {\n throw new TypeError(\"GitHub repository URL is invalid.\");\n }\n if (\n url.protocol !== \"https:\" ||\n url.hostname !== \"github.com\" ||\n url.host !== \"github.com\" ||\n url.username ||\n url.password ||\n url.search ||\n url.hash ||\n url.pathname.includes(\"%\")\n ) {\n throw new TypeError(\"Use a canonical https://github.com/owner/repository URL.\");\n }\n const match = /^\\/([^/]+)\\/([^/]+?)\\/?$/u.exec(url.pathname);\n if (!match) {\n throw new TypeError(\"GitHub repository URL must contain exactly owner/repository.\");\n }\n const owner = match[1]!;\n const name = match[2]!.replace(/\\.git$/iu, \"\");\n if (\n !/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?$/u.test(owner) ||\n !/^[A-Za-z0-9_.-]{1,100}$/u.test(name) ||\n name === \".\" ||\n name === \"..\"\n ) {\n throw new TypeError(\"GitHub repository owner or name is invalid.\");\n }\n const fullName = `${owner}/${name}`;\n return {\n owner,\n name,\n fullName,\n canonicalUrl: `https://github.com/${fullName}`,\n cloneUrl: `https://github.com/${fullName}.git`,\n };\n}\n"],"mappings":";AAcO,SAAS,kCAAkC,OAA0C;AAC1F,MAAI,CAAC,MAAM,WAAW,qBAAqB,GAAG;AAC5C,UAAM,IAAI,MAAM,mEAAmE;AAAA,EACrF;AACA,MAAI;AACJ,MAAI;AACF,UAAM,IAAI,IAAI,KAAK;AAAA,EACrB,QAAQ;AACN,UAAM,IAAI,UAAU,mCAAmC;AAAA,EACzD;AACA,MACE,IAAI,aAAa,YACjB,IAAI,aAAa,gBACjB,IAAI,SAAS,gBACb,IAAI,YACJ,IAAI,YACJ,IAAI,UACJ,IAAI,QACJ,IAAI,SAAS,SAAS,GAAG,GACzB;AACA,UAAM,IAAI,UAAU,0DAA0D;AAAA,EAChF;AACA,QAAM,QAAQ,4BAA4B,KAAK,IAAI,QAAQ;AAC3D,MAAI,CAAC,OAAO;AACV,UAAM,IAAI,UAAU,8DAA8D;AAAA,EACpF;AACA,QAAM,QAAQ,MAAM,CAAC;AACrB,QAAM,OAAO,MAAM,CAAC,EAAG,QAAQ,YAAY,EAAE;AAC7C,MACE,CAAC,mDAAmD,KAAK,KAAK,KAC9D,CAAC,2BAA2B,KAAK,IAAI,KACrC,SAAS,OACT,SAAS,MACT;AACA,UAAM,IAAI,UAAU,6CAA6C;AAAA,EACnE;AACA,QAAM,WAAW,GAAG,KAAK,IAAI,IAAI;AACjC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc,sBAAsB,QAAQ;AAAA,IAC5C,UAAU,sBAAsB,QAAQ;AAAA,EAC1C;AACF;","names":[]}
|
package/dist/google-drive.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ConnectionMetadata
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DPCCW6U7.js";
|
|
4
|
+
import "./chunk-YBW5JSA3.js";
|
|
5
|
+
import "./chunk-NPBM4QSK.js";
|
|
6
|
+
import "./chunk-CM6BMECR.js";
|
|
7
|
+
import "./chunk-MRWYRAS5.js";
|
|
8
|
+
import "./chunk-3SIZGL3O.js";
|
|
9
|
+
import "./chunk-M5ZGRVIQ.js";
|
|
10
|
+
import "./chunk-BCS7WHCK.js";
|
|
4
11
|
import {
|
|
5
12
|
ConnectorDocumentDestination,
|
|
6
13
|
ConnectorDocumentDestinationSelection
|
|
7
14
|
} from "./chunk-WYBDERIY.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-4IVHBXRI.js";
|
|
10
|
-
import "./chunk-CM6BMECR.js";
|
|
11
|
-
import "./chunk-JUFK3T4Q.js";
|
|
12
|
-
import "./chunk-YBW5JSA3.js";
|
|
13
|
-
import "./chunk-N6GRVXAJ.js";
|
|
14
|
-
import "./chunk-3SIZGL3O.js";
|
|
15
|
+
import "./chunk-7ABONTXE.js";
|
|
15
16
|
import "./chunk-NVJMJWLL.js";
|
|
16
17
|
import "./chunk-YRKRZ6OF.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-7Q6HPDY2.js";
|
|
18
19
|
import "./chunk-Y3KNXVTD.js";
|
|
20
|
+
import "./chunk-TXTQIYCV.js";
|
|
19
21
|
import "./chunk-RIY7GYQS.js";
|
|
20
22
|
import "./chunk-D2HKF2EF.js";
|
|
21
23
|
import "./chunk-MYBZRDTY.js";
|
|
22
|
-
import "./chunk-TXTQIYCV.js";
|
|
23
24
|
import "./chunk-PX3VCKAU.js";
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-M5ZGRVIQ.js";
|
|
25
|
+
import "./chunk-JUFK3T4Q.js";
|
|
26
26
|
|
|
27
27
|
// src/google-drive.ts
|
|
28
28
|
import { z } from "zod";
|