firebase-mcp 0.3.0 → 0.3.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/config/index.js +1 -1
- package/dist/config/index.js.map +1 -1
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +38 -42
- package/dist/server/index.js.map +1 -1
- package/dist/tools/auth/index.d.ts +3 -3
- package/dist/tools/auth/index.d.ts.map +1 -1
- package/dist/tools/auth/index.js +3 -3
- package/dist/tools/auth/index.js.map +1 -1
- package/dist/tools/auth/{get_user.d.ts → operations/get_user.d.ts} +2 -2
- package/dist/tools/auth/operations/get_user.d.ts.map +1 -0
- package/dist/tools/auth/{get_user.js → operations/get_user.js} +2 -2
- package/dist/tools/auth/operations/get_user.js.map +1 -0
- package/dist/tools/auth/{list_users.d.ts → operations/list_users.d.ts} +2 -2
- package/dist/tools/auth/operations/list_users.d.ts.map +1 -0
- package/dist/tools/auth/{list_users.js → operations/list_users.js} +2 -2
- package/dist/tools/auth/operations/list_users.js.map +1 -0
- package/dist/tools/auth/{read.d.ts → tool.d.ts} +2 -2
- package/dist/tools/auth/{read.d.ts.map → tool.d.ts.map} +1 -1
- package/dist/tools/auth/{read.js → tool.js} +3 -3
- package/dist/tools/auth/{read.js.map → tool.js.map} +1 -1
- package/dist/tools/firestore/index.d.ts +13 -12
- package/dist/tools/firestore/index.d.ts.map +1 -1
- package/dist/tools/firestore/index.js +13 -12
- package/dist/tools/firestore/index.js.map +1 -1
- package/dist/tools/firestore/{aggregate_collection.d.ts → operations/aggregate_collection.d.ts} +4 -4
- package/dist/tools/firestore/operations/aggregate_collection.d.ts.map +1 -0
- package/dist/tools/firestore/{aggregate_collection.js → operations/aggregate_collection.js} +7 -2
- package/dist/tools/firestore/operations/aggregate_collection.js.map +1 -0
- package/dist/tools/firestore/{count_documents.d.ts → operations/count_documents.d.ts} +4 -4
- package/dist/tools/firestore/operations/count_documents.d.ts.map +1 -0
- package/dist/tools/firestore/{count_documents.js → operations/count_documents.js} +7 -2
- package/dist/tools/firestore/operations/count_documents.js.map +1 -0
- package/dist/tools/firestore/operations/distinct_values.d.ts +59 -0
- package/dist/tools/firestore/operations/distinct_values.d.ts.map +1 -0
- package/dist/tools/firestore/operations/distinct_values.js +173 -0
- package/dist/tools/firestore/operations/distinct_values.js.map +1 -0
- package/dist/tools/firestore/{get_collection_schema.d.ts → operations/get_collection_schema.d.ts} +3 -3
- package/dist/tools/firestore/operations/get_collection_schema.d.ts.map +1 -0
- package/dist/tools/firestore/{get_collection_schema.js → operations/get_collection_schema.js} +6 -1
- package/dist/tools/firestore/operations/get_collection_schema.js.map +1 -0
- package/dist/tools/firestore/{get_document.d.ts → operations/get_document.d.ts} +4 -3
- package/dist/tools/firestore/operations/get_document.d.ts.map +1 -0
- package/dist/tools/firestore/{get_document.js → operations/get_document.js} +20 -9
- package/dist/tools/firestore/operations/get_document.js.map +1 -0
- package/dist/tools/firestore/{get_many_documents.d.ts → operations/get_many_documents.d.ts} +3 -3
- package/dist/tools/firestore/operations/get_many_documents.d.ts.map +1 -0
- package/dist/tools/firestore/{get_many_documents.js → operations/get_many_documents.js} +13 -2
- package/dist/tools/firestore/operations/get_many_documents.js.map +1 -0
- package/dist/tools/firestore/{list_collections.d.ts → operations/list_collections.d.ts} +3 -3
- package/dist/tools/firestore/operations/list_collections.d.ts.map +1 -0
- package/dist/tools/firestore/{list_collections.js → operations/list_collections.js} +6 -1
- package/dist/tools/firestore/operations/list_collections.js.map +1 -0
- package/dist/tools/firestore/{list_documents.d.ts → operations/list_documents.d.ts} +4 -4
- package/dist/tools/firestore/operations/list_documents.d.ts.map +1 -0
- package/dist/tools/firestore/{list_documents.js → operations/list_documents.js} +19 -21
- package/dist/tools/firestore/operations/list_documents.js.map +1 -0
- package/dist/tools/firestore/{list_indexes.d.ts → operations/list_indexes.d.ts} +2 -2
- package/dist/tools/firestore/operations/list_indexes.d.ts.map +1 -0
- package/dist/tools/firestore/{list_indexes.js → operations/list_indexes.js} +1 -1
- package/dist/tools/firestore/operations/list_indexes.js.map +1 -0
- package/dist/tools/firestore/{query_collection.d.ts → operations/query_collection.d.ts} +4 -4
- package/dist/tools/firestore/operations/query_collection.d.ts.map +1 -0
- package/dist/tools/firestore/{query_collection.js → operations/query_collection.js} +7 -2
- package/dist/tools/firestore/operations/query_collection.js.map +1 -0
- package/dist/tools/firestore/{query_collection_group.d.ts → operations/query_collection_group.d.ts} +4 -4
- package/dist/tools/firestore/operations/query_collection_group.d.ts.map +1 -0
- package/dist/tools/firestore/{query_collection_group.js → operations/query_collection_group.js} +2 -2
- package/dist/tools/firestore/operations/query_collection_group.js.map +1 -0
- package/dist/tools/firestore/{read_collections.d.ts → operations/read_collections.d.ts} +3 -3
- package/dist/tools/firestore/operations/read_collections.d.ts.map +1 -0
- package/dist/tools/firestore/{read_collections.js → operations/read_collections.js} +7 -2
- package/dist/tools/firestore/operations/read_collections.js.map +1 -0
- package/dist/tools/firestore/{read.d.ts → tool.d.ts} +32 -8
- package/dist/tools/firestore/tool.d.ts.map +1 -0
- package/dist/tools/firestore/{read.js → tool.js} +73 -27
- package/dist/tools/firestore/tool.js.map +1 -0
- package/dist/tools/firestore/utils/paths.d.ts +14 -0
- package/dist/tools/firestore/utils/paths.d.ts.map +1 -0
- package/dist/tools/firestore/utils/paths.js +39 -0
- package/dist/tools/firestore/utils/paths.js.map +1 -0
- package/dist/tools/firestore/utils/types.d.ts.map +1 -0
- package/dist/tools/firestore/{types.js → utils/types.js} +1 -1
- package/dist/tools/firestore/utils/types.js.map +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +1 -0
- package/dist/tools/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/tools/auth/get_user.d.ts.map +0 -1
- package/dist/tools/auth/get_user.js.map +0 -1
- package/dist/tools/auth/list_users.d.ts.map +0 -1
- package/dist/tools/auth/list_users.js.map +0 -1
- package/dist/tools/firestore/aggregate_collection.d.ts.map +0 -1
- package/dist/tools/firestore/aggregate_collection.js.map +0 -1
- package/dist/tools/firestore/count_documents.d.ts.map +0 -1
- package/dist/tools/firestore/count_documents.js.map +0 -1
- package/dist/tools/firestore/get_collection_schema.d.ts.map +0 -1
- package/dist/tools/firestore/get_collection_schema.js.map +0 -1
- package/dist/tools/firestore/get_document.d.ts.map +0 -1
- package/dist/tools/firestore/get_document.js.map +0 -1
- package/dist/tools/firestore/get_many_documents.d.ts.map +0 -1
- package/dist/tools/firestore/get_many_documents.js.map +0 -1
- package/dist/tools/firestore/list_collections.d.ts.map +0 -1
- package/dist/tools/firestore/list_collections.js.map +0 -1
- package/dist/tools/firestore/list_documents.d.ts.map +0 -1
- package/dist/tools/firestore/list_documents.js.map +0 -1
- package/dist/tools/firestore/list_indexes.d.ts.map +0 -1
- package/dist/tools/firestore/list_indexes.js.map +0 -1
- package/dist/tools/firestore/query_collection.d.ts.map +0 -1
- package/dist/tools/firestore/query_collection.js.map +0 -1
- package/dist/tools/firestore/query_collection_group.d.ts.map +0 -1
- package/dist/tools/firestore/query_collection_group.js.map +0 -1
- package/dist/tools/firestore/read.d.ts.map +0 -1
- package/dist/tools/firestore/read.js.map +0 -1
- package/dist/tools/firestore/read_collections.d.ts.map +0 -1
- package/dist/tools/firestore/read_collections.js.map +0 -1
- package/dist/tools/firestore/types.d.ts.map +0 -1
- package/dist/tools/firestore/types.js.map +0 -1
- /package/dist/tools/firestore/{types.d.ts → utils/types.d.ts} +0 -0
package/dist/config/index.js
CHANGED
|
@@ -29,7 +29,7 @@ const FirestoreRulesSchema = zod_1.z.object({
|
|
|
29
29
|
});
|
|
30
30
|
const FirestoreConfigSchema = zod_1.z.object({
|
|
31
31
|
rules: FirestoreRulesSchema,
|
|
32
|
-
maxCollectionReadSize: zod_1.z.number().default(
|
|
32
|
+
maxCollectionReadSize: zod_1.z.number().default(100),
|
|
33
33
|
maxBatchFetchSize: zod_1.z.number().default(200),
|
|
34
34
|
});
|
|
35
35
|
exports.ProjectConfigSchema = zod_1.z.object({
|
package/dist/config/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAgC;AAChC,qCAAuC;AACvC,yCAAoC;AACpC,6BAAwB;AAExB,kCAA+B;AAE/B,MAAa,WAAY,SAAQ,KAAK;IAEE;IAD7B,IAAI,GAAG,aAAsB,CAAC;IACvC,YAAY,OAAe,EAAW,KAAe;QACnD,KAAK,CAAC,OAAO,CAAC,CAAC;QADqB,UAAK,GAAL,KAAK,CAAU;QAEnD,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;IAC5B,CAAC;CACF;AAND,kCAMC;AAED,MAAM,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IACpC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,kBAAkB,EAAE,OAAC,CAAC,MAAM,EAAE;CAC/B,CAAC,CAAC;AAEH,MAAM,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IACpC,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;IAC1B,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;CAC1B,CAAC,CAAC;AAEH,MAAM,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IACrC,KAAK,EAAE,oBAAoB;IAC3B,qBAAqB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAgC;AAChC,qCAAuC;AACvC,yCAAoC;AACpC,6BAAwB;AAExB,kCAA+B;AAE/B,MAAa,WAAY,SAAQ,KAAK;IAEE;IAD7B,IAAI,GAAG,aAAsB,CAAC;IACvC,YAAY,OAAe,EAAW,KAAe;QACnD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C,eAAe,CAA8C;IAC9E,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IACtC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;;IAU9B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAkBA,qBAAa,cAAe,SAAQ,KAAK;IAIrC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IAH1B,QAAQ,CAAC,IAAI,EAAG,gBAAgB,CAAU;gBAExC,OAAO,EAAE,MAAM,EACN,KAAK,CAAC,EAAE,OAAO,YAAA;CAK3B;AAeD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA8C;IAC9E,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IACtC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;;IAU9B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAoBd,cAAc;YAmDd,eAAe;IAW7B,OAAO,CAAC,gBAAgB;CAgBzB"}
|
package/dist/server/index.js
CHANGED
|
@@ -47,50 +47,46 @@ class FirebaseMcpServer {
|
|
|
47
47
|
throw result.cause;
|
|
48
48
|
this.appConfig = result.value;
|
|
49
49
|
this.mcpServer.server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({ tools: tools_1.allToolDefinitions }));
|
|
50
|
-
this.mcpServer.server.setRequestHandler(types_js_1.CallToolRequestSchema,
|
|
51
|
-
const name = request.params.name;
|
|
52
|
-
const args = request.params.arguments ?? {};
|
|
53
|
-
if (name === tools_1.GET_CONFIG) {
|
|
54
|
-
return (0, tools_1.getConfig)(this.appConfig);
|
|
55
|
-
}
|
|
56
|
-
if (name === tools_1.RELOAD_CONFIG) {
|
|
57
|
-
return (0, tools_1.reloadConfig)(async () => {
|
|
58
|
-
const { exit: cfgExit } = (0, config_1.loadConfig)(this.configPath).fork();
|
|
59
|
-
const cfgResult = await cfgExit;
|
|
60
|
-
if (cfgResult._tag !== 'ok') {
|
|
61
|
-
throw cfgResult._tag === 'err'
|
|
62
|
-
? cfgResult.error
|
|
63
|
-
: cfgResult.cause;
|
|
64
|
-
}
|
|
65
|
-
this.projectContexts.clear();
|
|
66
|
-
this.appConfig = cfgResult.value;
|
|
67
|
-
return { projects: Object.keys(cfgResult.value.projects) };
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
const projectId = typeof args.projectId === 'string' ? args.projectId : null;
|
|
71
|
-
if (!projectId) {
|
|
72
|
-
return toErrorResult('MISSING_PROJECT_ID', 'projectId is required. Call get_config to see available projects.');
|
|
73
|
-
}
|
|
74
|
-
const projectConfig = this.appConfig.projects[projectId];
|
|
75
|
-
if (!projectConfig) {
|
|
76
|
-
return toErrorResult('PROJECT_NOT_FOUND', `Project "${projectId}" not found in config. Call get_config to see available projects.`, { projectId, available: Object.keys(this.appConfig.projects) });
|
|
77
|
-
}
|
|
78
|
-
const { projectId: _stripped, ...toolArgs } = args;
|
|
79
|
-
let ctx;
|
|
80
|
-
try {
|
|
81
|
-
ctx = await this.getOrInitProject(projectId, projectConfig);
|
|
82
|
-
}
|
|
83
|
-
catch (cause) {
|
|
84
|
-
return toErrorResult('FIREBASE_INIT_ERROR', `Failed to initialize Firebase for project "${projectId}": ${String(cause)}`);
|
|
85
|
-
}
|
|
86
|
-
const { exit: toolExit } = (0, tools_1.dispatchTool)(ctx, name, toolArgs).fork();
|
|
87
|
-
const toolResult = await toolExit;
|
|
88
|
-
if (toolResult._tag === 'ok')
|
|
89
|
-
return toolResult.value;
|
|
90
|
-
return toErrorResult('INTERNAL_ERROR', `Unexpected error: ${String(toolResult._tag === 'err' ? toolResult.error : toolResult.cause)}`);
|
|
91
|
-
});
|
|
50
|
+
this.mcpServer.server.setRequestHandler(types_js_1.CallToolRequestSchema, (request) => this.handleToolCall(request.params.name, request.params.arguments ?? {}));
|
|
92
51
|
await this.mcpServer.server.connect(new stdio_js_1.StdioServerTransport());
|
|
93
52
|
}
|
|
53
|
+
async handleToolCall(name, args) {
|
|
54
|
+
if (name === tools_1.GET_CONFIG)
|
|
55
|
+
return (0, tools_1.getConfig)(this.appConfig);
|
|
56
|
+
if (name === tools_1.RELOAD_CONFIG)
|
|
57
|
+
return (0, tools_1.reloadConfig)(() => this.reloadAppConfig());
|
|
58
|
+
const projectId = typeof args.projectId === 'string' ? args.projectId : null;
|
|
59
|
+
if (!projectId) {
|
|
60
|
+
return toErrorResult('MISSING_PROJECT_ID', 'projectId is required. Call get_config to see available projects.');
|
|
61
|
+
}
|
|
62
|
+
const projectConfig = this.appConfig.projects[projectId];
|
|
63
|
+
if (!projectConfig) {
|
|
64
|
+
return toErrorResult('PROJECT_NOT_FOUND', `Project "${projectId}" not found in config. Call get_config to see available projects.`, { projectId, available: Object.keys(this.appConfig.projects) });
|
|
65
|
+
}
|
|
66
|
+
const { projectId: _stripped, ...toolArgs } = args;
|
|
67
|
+
let ctx;
|
|
68
|
+
try {
|
|
69
|
+
ctx = await this.getOrInitProject(projectId, projectConfig);
|
|
70
|
+
}
|
|
71
|
+
catch (cause) {
|
|
72
|
+
return toErrorResult('FIREBASE_INIT_ERROR', `Failed to initialize Firebase for project "${projectId}": ${String(cause)}`);
|
|
73
|
+
}
|
|
74
|
+
const { exit } = (0, tools_1.dispatchTool)(ctx, name, toolArgs).fork();
|
|
75
|
+
const toolResult = await exit;
|
|
76
|
+
if (toolResult._tag === 'ok')
|
|
77
|
+
return toolResult.value;
|
|
78
|
+
return toErrorResult('INTERNAL_ERROR', `Unexpected error: ${String(toolResult._tag === 'err' ? toolResult.error : toolResult.cause)}`);
|
|
79
|
+
}
|
|
80
|
+
async reloadAppConfig() {
|
|
81
|
+
const { exit } = (0, config_1.loadConfig)(this.configPath).fork();
|
|
82
|
+
const result = await exit;
|
|
83
|
+
if (result._tag !== 'ok') {
|
|
84
|
+
throw result._tag === 'err' ? result.error : result.cause;
|
|
85
|
+
}
|
|
86
|
+
this.projectContexts.clear();
|
|
87
|
+
this.appConfig = result.value;
|
|
88
|
+
return { projects: Object.keys(result.value.projects) };
|
|
89
|
+
}
|
|
94
90
|
getOrInitProject(projectId, config) {
|
|
95
91
|
const cached = this.projectContexts.get(projectId);
|
|
96
92
|
if (cached)
|
package/dist/server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":";;;AAAA,oEAAoE;AACpE,wEAAiF;AACjF,iEAG4C;AAE5C,sCAAgF;AAChF,wCAAkE;AAClE,oCAOkB;AAElB,MAAa,cAAe,SAAQ,KAAK;IAI5B;IAHF,IAAI,GAAG,gBAAyB,CAAC;IAC1C,YACE,OAAe,EACN,KAAe;QAExB,KAAK,CAAC,OAAO,CAAC,CAAC;QAFN,UAAK,GAAL,KAAK,CAAU;QAGxB,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AATD,wCASC;AAED,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,OAAe,EAAE,OAAiB,EAAE,EAAE,CAAC,CAAC;IAC3E,OAAO,EAAE;QACP;YACE,IAAI,EAAE,MAAe;YACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE;aAClC,CAAC;SACH;KACF;IACD,OAAO,EAAE,IAAI;CACd,CAAC,CAAC;AAEH,MAAa,iBAAiB;IACpB,SAAS,CAAa;IACb,eAAe,GAAG,IAAI,GAAG,EAAmC,CAAC;IAC7D,SAAS,CAAY;IACrB,UAAU,CAAS;IAEpC;QACE,IAAI,CAAC,UAAU,GAAG,IAAA,sBAAa,GAAE,CAAC;QAClC,IAAI,CAAC,SAAS,GAAG,IAAI,kBAAS,CAC5B,EAAE,IAAI,EAAE,cAAc,EAAE,OA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C,GAAG,CAAC,SAAS,CAAC,CAAC;QACnD,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC;QAE1B,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,8BAAoB,EAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;QACrD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YACnC,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI;gBAAE,OAAO,MAAM,CAAC,KAAK,CAAC;YAC9C,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YACvC,MAAM,MAAM,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;QAC5D,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC7C,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAhHD,8CAgHC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './get_user';
|
|
2
|
-
export * from './list_users';
|
|
3
|
-
export * from './
|
|
1
|
+
export * from './operations/get_user';
|
|
2
|
+
export * from './operations/list_users';
|
|
3
|
+
export * from './tool';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/auth/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/auth/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,QAAQ,CAAC"}
|
package/dist/tools/auth/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./get_user"), exports);
|
|
18
|
-
__exportStar(require("./list_users"), exports);
|
|
19
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./operations/get_user"), exports);
|
|
18
|
+
__exportStar(require("./operations/list_users"), exports);
|
|
19
|
+
__exportStar(require("./tool"), exports);
|
|
20
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/auth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/auth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,0DAAwC;AACxC,yCAAuB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
import type { ProjectContext } from '
|
|
3
|
-
import { Task } from '
|
|
2
|
+
import type { ProjectContext } from '../../../project';
|
|
3
|
+
import { Task } from '../../../task';
|
|
4
4
|
export declare class AuthGetUserError extends Error {
|
|
5
5
|
readonly cause?: unknown | undefined;
|
|
6
6
|
readonly _tag: "AuthGetUserError";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get_user.d.ts","sourceRoot":"","sources":["../../../../src/tools/auth/operations/get_user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAGrC,qBAAa,gBAAiB,SAAQ,KAAK;IAEZ,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IADrD,QAAQ,CAAC,IAAI,EAAG,kBAAkB,CAAU;gBAChC,OAAO,EAAE,MAAM,EAAW,KAAK,CAAC,EAAE,OAAO,YAAA;CAItD;AAED,qBAAa,qBAAsB,SAAQ,KAAK;IAElC,QAAQ,CAAC,UAAU,EAAE,MAAM;IADvC,QAAQ,CAAC,IAAI,EAAG,uBAAuB,CAAU;gBAC5B,UAAU,EAAE,MAAM;CAIxC;AAED,eAAO,MAAM,QAAQ,EAAG,UAAmB,CAAC;AAE5C,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,iBAAiB,EAAE,IAsB/B,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,KAAK,cAAc,EAAE,OAAO,WAAW,4DAqC3D,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getUser = exports.getUserDefinition = exports.GET_USER = exports.AuthUserNotFoundError = exports.AuthGetUserError = void 0;
|
|
4
|
-
const task_1 = require("
|
|
5
|
-
const normalize_1 = require("
|
|
4
|
+
const task_1 = require("../../../task");
|
|
5
|
+
const normalize_1 = require("../../normalize");
|
|
6
6
|
class AuthGetUserError extends Error {
|
|
7
7
|
cause;
|
|
8
8
|
_tag = 'AuthGetUserError';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get_user.js","sourceRoot":"","sources":["../../../../src/tools/auth/operations/get_user.ts"],"names":[],"mappings":";;;AAGA,wCAAqC;AACrC,+CAAiD;AAEjD,MAAa,gBAAiB,SAAQ,KAAK;IAEH;IAD7B,IAAI,GAAG,kBAA2B,CAAC;IAC5C,YAAY,OAAe,EAAW,KAAe;QACnD,KAAK,CAAC,OAAO,CAAC,CAAC;QADqB,UAAK,GAAL,KAAK,CAAU;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CACR,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,KAAM,CAAC;QACzE,KAAK,EAAE,CAAC,KAAc,EAAE,EAAE;YACxB,MAAM,IAAI,GACR,KAAK,IAAI,IAAI;gBACb,OAAO,KAAK,KAAK,QAAQ;gBACzB,MAAM,IAAI,KAAK;gBACf,OAAQ,KAA2B,CAAC,IAAI,KAAK,QAAQ;gBACnD,CAAC,CAAE,KAA0B,CAAC,IAAI;gBAClC,CAAC,CAAC,EAAE,CAAC;YAET,IAAI,IAAI,KAAK,qBAAqB,EAAE,CAAC;gBACnC,OAAO,IAAI,qBAAqB,CAAC,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;YACnE,CAAC;YAED,OAAO,IAAI,gBAAgB,CACzB,yBAAyB,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,KAAK,EAAE,EACnD,KAAK,CACN,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,IAAA,0BAAc,EAAC;QACpB,GAAG,UAAU,CAAC,MAAM,EAAE;QACtB,YAAY,EAAE,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;KACtE,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AArCQ,QAAA,OAAO,WAqCf"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
import type { ProjectContext } from '
|
|
3
|
-
import { Task } from '
|
|
2
|
+
import type { ProjectContext } from '../../../project';
|
|
3
|
+
import { Task } from '../../../task';
|
|
4
4
|
export declare class AuthListUsersError extends Error {
|
|
5
5
|
readonly cause?: unknown | undefined;
|
|
6
6
|
readonly _tag: "AuthListUsersError";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list_users.d.ts","sourceRoot":"","sources":["../../../../src/tools/auth/operations/list_users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAGrC,qBAAa,kBAAmB,SAAQ,KAAK;IAEd,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IADrD,QAAQ,CAAC,IAAI,EAAG,oBAAoB,CAAU;gBAClC,OAAO,EAAE,MAAM,EAAW,KAAK,CAAC,EAAE,OAAO,YAAA;CAItD;AAED,eAAO,MAAM,UAAU,EAAG,YAAqB,CAAC;AAEhD,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,mBAAmB,EAAE,IAwBjC,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,KAAK,cAAc,EAAE,OAAO,aAAa;;;sBAmB/D,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.listUsers = exports.listUsersDefinition = exports.LIST_USERS = exports.AuthListUsersError = void 0;
|
|
4
|
-
const task_1 = require("
|
|
5
|
-
const normalize_1 = require("
|
|
4
|
+
const task_1 = require("../../../task");
|
|
5
|
+
const normalize_1 = require("../../normalize");
|
|
6
6
|
class AuthListUsersError extends Error {
|
|
7
7
|
cause;
|
|
8
8
|
_tag = 'AuthListUsersError';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list_users.js","sourceRoot":"","sources":["../../../../src/tools/auth/operations/list_users.ts"],"names":[],"mappings":";;;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AAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAC5B,IAAA,0BAAc,EAAC;YACb,GAAG,CAAC,CAAC,MAAM,EAAE;YACb,YAAY,EAAE,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;SAC7D,CAAC,CACH;QACD,aAAa,EAAE,MAAM,CAAC,SAAS,IAAI,IAAI;KACxC,CAAC;AACJ,CAAC,CAAC,CAAC;AAnBQ,QAAA,SAAS,aAmBjB"}
|
|
@@ -10,6 +10,6 @@ export declare class UnknownAuthOperationError extends Error {
|
|
|
10
10
|
}
|
|
11
11
|
export declare const AUTH_READ: "auth_read";
|
|
12
12
|
export declare const authReadDefinition: Tool;
|
|
13
|
-
export declare const dispatchAuthRead: (ctx: ProjectContext, operation: ReadOperations | (string & {}), args: unknown) => Task<unknown, import("./get_user").AuthGetUserError | import("./get_user").AuthUserNotFoundError | import("./list_users").AuthListUsersError | UnknownAuthOperationError>;
|
|
13
|
+
export declare const dispatchAuthRead: (ctx: ProjectContext, operation: ReadOperations | (string & {}), args: unknown) => Task<unknown, import("./operations/get_user").AuthGetUserError | import("./operations/get_user").AuthUserNotFoundError | import("./operations/list_users").AuthListUsersError | UnknownAuthOperationError>;
|
|
14
14
|
export {};
|
|
15
|
-
//# sourceMappingURL=
|
|
15
|
+
//# sourceMappingURL=tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../src/tools/auth/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAIlC,QAAA,MAAM,eAAe,qCAAkC,CAAC;AAExD,KAAK,cAAc,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,qBAAa,yBAA0B,SAAQ,KAAK;IAEtC,QAAQ,CAAC,SAAS,EAAE,MAAM;IADtC,QAAQ,CAAC,IAAI,EAAG,2BAA2B,CAAU;gBAChC,SAAS,EAAE,MAAM;CAIvC;AAED,eAAO,MAAM,SAAS,EAAG,WAAoB,CAAC;AAE9C,eAAO,MAAM,kBAAkB,EAAE,IAwChC,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,KAAK,cAAc,EACnB,WAAW,cAAc,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,EACzC,MAAM,OAAO,+MAed,CAAC"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dispatchAuthRead = exports.authReadDefinition = exports.AUTH_READ = exports.UnknownAuthOperationError = void 0;
|
|
4
4
|
const task_1 = require("../../task");
|
|
5
|
-
const get_user_1 = require("./get_user");
|
|
6
|
-
const list_users_1 = require("./list_users");
|
|
5
|
+
const get_user_1 = require("./operations/get_user");
|
|
6
|
+
const list_users_1 = require("./operations/list_users");
|
|
7
7
|
const READ_OPERATIONS = [get_user_1.GET_USER, list_users_1.LIST_USERS];
|
|
8
8
|
class UnknownAuthOperationError extends Error {
|
|
9
9
|
operation;
|
|
@@ -69,4 +69,4 @@ const dispatchAuthRead = (ctx, operation, args) => {
|
|
|
69
69
|
});
|
|
70
70
|
};
|
|
71
71
|
exports.dispatchAuthRead = dispatchAuthRead;
|
|
72
|
-
//# sourceMappingURL=
|
|
72
|
+
//# sourceMappingURL=tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../../src/tools/auth/tool.ts"],"names":[],"mappings":";;;AAGA,qCAAkC;AAClC,oDAAuE;AACvE,wD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AG,IAAI,CAAC;IACf,OAAO,WAAI,CAAC,GAAG,CAAC,QAAQ,CAAC;QACvB,QAAQ,SAAS,EAAE,CAAC;YAClB,KAAK,mBAAQ;gBACX,OAAO,KAAK,CAAC,CAAC,IAAA,kBAAO,EAAC,GAAG,EAAE,CAAgB,CAAC,CAAC;YAC/C,KAAK,uBAAU;gBACb,OAAO,KAAK,CAAC,CAAC,IAAA,sBAAS,EAAC,GAAG,EAAE,CAAkB,CAAC,CAAC;YACnD;gBACE,OAAO,KAAK,CAAC,CAAC,WAAI,CAAC,IAAI,CACrB,IAAI,yBAAyB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CACjD,CAAC;QACN,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAlBW,QAAA,gBAAgB,oBAkB3B"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export * from './aggregate_collection';
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './
|
|
12
|
-
export * from './
|
|
1
|
+
export * from './operations/aggregate_collection';
|
|
2
|
+
export * from './operations/distinct_values';
|
|
3
|
+
export * from './operations/count_documents';
|
|
4
|
+
export * from './operations/get_collection_schema';
|
|
5
|
+
export * from './operations/get_document';
|
|
6
|
+
export * from './operations/get_many_documents';
|
|
7
|
+
export * from './operations/list_collections';
|
|
8
|
+
export * from './operations/list_documents';
|
|
9
|
+
export * from './operations/list_indexes';
|
|
10
|
+
export * from './operations/query_collection';
|
|
11
|
+
export * from './operations/query_collection_group';
|
|
12
|
+
export * from './operations/read_collections';
|
|
13
|
+
export * from './tool';
|
|
13
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/firestore/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/firestore/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,QAAQ,CAAC"}
|
|
@@ -14,16 +14,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./aggregate_collection"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./
|
|
20
|
-
__exportStar(require("./
|
|
21
|
-
__exportStar(require("./
|
|
22
|
-
__exportStar(require("./
|
|
23
|
-
__exportStar(require("./
|
|
24
|
-
__exportStar(require("./
|
|
25
|
-
__exportStar(require("./
|
|
26
|
-
__exportStar(require("./
|
|
27
|
-
__exportStar(require("./
|
|
28
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./operations/aggregate_collection"), exports);
|
|
18
|
+
__exportStar(require("./operations/distinct_values"), exports);
|
|
19
|
+
__exportStar(require("./operations/count_documents"), exports);
|
|
20
|
+
__exportStar(require("./operations/get_collection_schema"), exports);
|
|
21
|
+
__exportStar(require("./operations/get_document"), exports);
|
|
22
|
+
__exportStar(require("./operations/get_many_documents"), exports);
|
|
23
|
+
__exportStar(require("./operations/list_collections"), exports);
|
|
24
|
+
__exportStar(require("./operations/list_documents"), exports);
|
|
25
|
+
__exportStar(require("./operations/list_indexes"), exports);
|
|
26
|
+
__exportStar(require("./operations/query_collection"), exports);
|
|
27
|
+
__exportStar(require("./operations/query_collection_group"), exports);
|
|
28
|
+
__exportStar(require("./operations/read_collections"), exports);
|
|
29
|
+
__exportStar(require("./tool"), exports);
|
|
29
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/firestore/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/firestore/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oEAAkD;AAClD,+DAA6C;AAC7C,+DAA6C;AAC7C,qEAAmD;AACnD,4DAA0C;AAC1C,kEAAgD;AAChD,gEAA8C;AAC9C,8DAA4C;AAC5C,4DAA0C;AAC1C,gEAA8C;AAC9C,sEAAoD;AACpD,gEAA8C;AAC9C,yCAAuB"}
|
package/dist/tools/firestore/{aggregate_collection.d.ts → operations/aggregate_collection.d.ts}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
2
|
import { AggregateField } from 'firebase-admin/firestore';
|
|
3
|
-
import type { ProjectContext } from '
|
|
4
|
-
import { Task } from '
|
|
5
|
-
import { QueryFilter } from '
|
|
3
|
+
import type { ProjectContext } from '../../../project';
|
|
4
|
+
import { Task } from '../../../task';
|
|
5
|
+
import { QueryFilter } from '../utils/types';
|
|
6
6
|
export declare class FirestoreAggregateError extends Error {
|
|
7
7
|
readonly cause?: unknown | undefined;
|
|
8
8
|
readonly _tag: "FirestoreAggregateError";
|
|
@@ -25,5 +25,5 @@ export declare const aggregateCollection: (ctx: ProjectContext, input: Aggregate
|
|
|
25
25
|
result: FirebaseFirestore.AggregateSpecData<{
|
|
26
26
|
[k: string]: AggregateField<number>;
|
|
27
27
|
}>;
|
|
28
|
-
}, import("
|
|
28
|
+
}, import("../../../project").AccessDeniedError | FirestoreAggregateError>;
|
|
29
29
|
//# sourceMappingURL=aggregate_collection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate_collection.d.ts","sourceRoot":"","sources":["../../../../src/tools/firestore/operations/aggregate_collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,OAAO,EAAsB,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEjE,qBAAa,uBAAwB,SAAQ,KAAK;IAEnB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IADrD,QAAQ,CAAC,IAAI,EAAG,yBAAyB,CAAU;gBACvC,OAAO,EAAE,MAAM,EAAW,KAAK,CAAC,EAAE,OAAO,YAAA;CAItD;AAED,eAAO,MAAM,oBAAoB,EAAG,sBAA+B,CAAC;AAEpE,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG,OAAO,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;CACzB;AAED,eAAO,MAAM,6BAA6B,EAAE,IAiD3C,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,KAAK,cAAc,EACnB,OAAO,uBAAuB;;;;;0EAyC5B,CAAC"}
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.aggregateCollection = exports.aggregateCollectionDefinition = exports.AGGREGATE_COLLECTION = exports.FirestoreAggregateError = void 0;
|
|
4
4
|
const firestore_1 = require("firebase-admin/firestore");
|
|
5
|
-
const task_1 = require("
|
|
6
|
-
const
|
|
5
|
+
const task_1 = require("../../../task");
|
|
6
|
+
const paths_1 = require("../utils/paths");
|
|
7
|
+
const types_1 = require("../utils/types");
|
|
7
8
|
class FirestoreAggregateError extends Error {
|
|
8
9
|
cause;
|
|
9
10
|
_tag = 'FirestoreAggregateError';
|
|
@@ -63,6 +64,10 @@ exports.aggregateCollectionDefinition = {
|
|
|
63
64
|
},
|
|
64
65
|
};
|
|
65
66
|
const aggregateCollection = (ctx, input) => task_1.Task.gen(function* () {
|
|
67
|
+
const err = (0, paths_1.collectionPathError)(input.collection);
|
|
68
|
+
if (err) {
|
|
69
|
+
return yield* task_1.Task.fail(new FirestoreAggregateError(err));
|
|
70
|
+
}
|
|
66
71
|
yield* ctx.checkAccess(input.collection);
|
|
67
72
|
const result = yield* task_1.Task.attempt({
|
|
68
73
|
try: () => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate_collection.js","sourceRoot":"","sources":["../../../../src/tools/firestore/operations/aggregate_collection.ts"],"names":[],"mappings":";;;AACA,wDAA0D;AAG1D,wCAAqC;AACrC,0CAAqD;AACrD,0CAAiE;AAEjE,MAAa,uBAAwB,SAAQ,KAAK;IAEV;IAD7B,IAAI,GAAG,yBAAkC,CAAC;IACnD,YAAY,OAAe,EAAW,KAAe;QACnD,KAAK,CAAC,OAAO,CAAC,CAAC;QADqB,UAAK,GAAL,KAAK,CAAU;QAEnD,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IACxC,CAAC;CACF;AAND,0DAMC;AAEY,QAAA,oBAAoB,GAAG,sBAA+B,CAAC;AAcvD,Q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C;QACD,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CACf,IAAI,uBAAuB,CACzB,mCAAmC,KAAK,CAAC,UAAU,EAAE,EACrD,KAAK,CACN;KACJ,CAAC,CAAC;IAEH,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;AAClD,CAAC,CAAC,CAAC;AA3CQ,QAAA,mBAAmB,uBA2C3B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
import type { ProjectContext } from '
|
|
3
|
-
import { Task } from '
|
|
4
|
-
import { QueryFilter } from '
|
|
2
|
+
import type { ProjectContext } from '../../../project';
|
|
3
|
+
import { Task } from '../../../task';
|
|
4
|
+
import { QueryFilter } from '../utils/types';
|
|
5
5
|
export declare class FirestoreCountError extends Error {
|
|
6
6
|
readonly cause?: unknown | undefined;
|
|
7
7
|
readonly _tag: "FirestoreCountError";
|
|
@@ -16,5 +16,5 @@ export declare const countDocumentsDefinition: Tool;
|
|
|
16
16
|
export declare const countDocuments: (ctx: ProjectContext, input: CountDocumentsArgs) => Task<{
|
|
17
17
|
collection: string;
|
|
18
18
|
count: number;
|
|
19
|
-
}, import("
|
|
19
|
+
}, import("../../../project").AccessDeniedError | FirestoreCountError>;
|
|
20
20
|
//# sourceMappingURL=count_documents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"count_documents.d.ts","sourceRoot":"","sources":["../../../../src/tools/firestore/operations/count_documents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,OAAO,EAAsB,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEjE,qBAAa,mBAAoB,SAAQ,KAAK;IAEf,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IADrD,QAAQ,CAAC,IAAI,EAAG,qBAAqB,CAAU;gBACnC,OAAO,EAAE,MAAM,EAAW,KAAK,CAAC,EAAE,OAAO,YAAA;CAItD;AAED,eAAO,MAAM,eAAe,EAAG,iBAA0B,CAAC;AAE1D,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;CACzB;AAED,eAAO,MAAM,wBAAwB,EAAE,IAuBtC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,KAAK,cAAc,EAAE,OAAO,kBAAkB;;;sEA+BzE,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.countDocuments = exports.countDocumentsDefinition = exports.COUNT_DOCUMENTS = exports.FirestoreCountError = void 0;
|
|
4
|
-
const task_1 = require("
|
|
5
|
-
const
|
|
4
|
+
const task_1 = require("../../../task");
|
|
5
|
+
const paths_1 = require("../utils/paths");
|
|
6
|
+
const types_1 = require("../utils/types");
|
|
6
7
|
class FirestoreCountError extends Error {
|
|
7
8
|
cause;
|
|
8
9
|
_tag = 'FirestoreCountError';
|
|
@@ -38,6 +39,10 @@ exports.countDocumentsDefinition = {
|
|
|
38
39
|
},
|
|
39
40
|
};
|
|
40
41
|
const countDocuments = (ctx, input) => task_1.Task.gen(function* () {
|
|
42
|
+
const err = (0, paths_1.collectionPathError)(input.collection);
|
|
43
|
+
if (err) {
|
|
44
|
+
return yield* task_1.Task.fail(new FirestoreCountError(err));
|
|
45
|
+
}
|
|
41
46
|
yield* ctx.checkAccess(input.collection);
|
|
42
47
|
const count = yield* task_1.Task.attempt({
|
|
43
48
|
try: () => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"count_documents.js","sourceRoot":"","sources":["../../../../src/tools/firestore/operations/count_documents.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,KAAK,CAAC,CAAC,WAAI,CAAC,OAAO,CAAC;QAChC,GAAG,EAAE,GAAG,EAAE;YACR,IAAI,KAAK,GAA4B,GAAG;iBACrC,SAAS,EAAE;iBACX,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YAEhC,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC;gBACzC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;YACnE,CAAC;YAED,OAAO,KAAK;iBACT,KAAK,EAAE;iBACP,GAAG,EAAE;iBACL,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC;QACvC,CAAC;QACD,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CACf,IAAI,mBAAmB,CACrB,iCAAiC,KAAK,CAAC,UAAU,EAAE,EACnD,KAAK,CACN;KACJ,CAAC,CAAC;IAEH,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,EAAE,CAAC;AACjD,CAAC,CAAC,CAAC;AA/BQ,QAAA,cAAc,kBA+BtB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ProjectContext } from '../../../project';
|
|
2
|
+
import { Task } from '../../../task';
|
|
3
|
+
import { QueryFilter } from '../utils/types';
|
|
4
|
+
export declare class FirestoreDistinctValuesError extends Error {
|
|
5
|
+
readonly cause?: unknown | undefined;
|
|
6
|
+
readonly _tag: "FirestoreDistinctValuesError";
|
|
7
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
8
|
+
}
|
|
9
|
+
export declare const DISTINCT_VALUES: "distinct_values";
|
|
10
|
+
export interface DistinctValuesArgs {
|
|
11
|
+
collection?: string;
|
|
12
|
+
collectionId?: string;
|
|
13
|
+
/** Single field shorthand. Use `fields` for multi-field grouping. */
|
|
14
|
+
field?: string;
|
|
15
|
+
/** Fields to fetch and group by. Use `groupByFields` to group on a subset while treating the rest as labels. */
|
|
16
|
+
fields?: string[];
|
|
17
|
+
/**
|
|
18
|
+
* Subset of `fields` to use as the grouping/identity key.
|
|
19
|
+
* Remaining fields are treated as labels: collected as arrays of unique values seen per group.
|
|
20
|
+
* Useful when a display name may vary slightly across collections but the ID field is stable.
|
|
21
|
+
*/
|
|
22
|
+
groupByFields?: string[];
|
|
23
|
+
filters?: QueryFilter[];
|
|
24
|
+
groupByPathSegment?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Only return values that appear in at least this many distinct collection buckets.
|
|
27
|
+
* Pass "all" to mean "present in every collection bucket found" without needing to
|
|
28
|
+
* know the total count upfront. Only applies when using collectionId. All values are
|
|
29
|
+
* annotated with collectionCount and collections[] regardless of whether this is set.
|
|
30
|
+
*/
|
|
31
|
+
minCollections?: number | 'all';
|
|
32
|
+
}
|
|
33
|
+
type ScalarValue = string | null;
|
|
34
|
+
export declare const distinctValues: (ctx: ProjectContext, input: DistinctValuesArgs) => Task<{
|
|
35
|
+
fields: string | string[];
|
|
36
|
+
totalDocsFetched: number;
|
|
37
|
+
values: {
|
|
38
|
+
value: ScalarValue | Record<string, string[] | ScalarValue>;
|
|
39
|
+
count: number;
|
|
40
|
+
collectionCount?: number;
|
|
41
|
+
collections?: string[];
|
|
42
|
+
}[];
|
|
43
|
+
byCollection: Record<string, {
|
|
44
|
+
value: ScalarValue | Record<string, ScalarValue>;
|
|
45
|
+
count: number;
|
|
46
|
+
}[]>;
|
|
47
|
+
} | {
|
|
48
|
+
fields: string | string[];
|
|
49
|
+
totalDocsFetched: number;
|
|
50
|
+
values: {
|
|
51
|
+
value: ScalarValue | Record<string, string[] | ScalarValue>;
|
|
52
|
+
count: number;
|
|
53
|
+
collectionCount?: number;
|
|
54
|
+
collections?: string[];
|
|
55
|
+
}[];
|
|
56
|
+
byCollection?: undefined;
|
|
57
|
+
}, import("../../../project").AccessDeniedError | FirestoreDistinctValuesError>;
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=distinct_values.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"distinct_values.d.ts","sourceRoot":"","sources":["../../../../src/tools/firestore/operations/distinct_values.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,qBAAa,4BAA6B,SAAQ,KAAK;IAInD,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IAH1B,QAAQ,CAAC,IAAI,EAAG,8BAA8B,CAAU;gBAEtD,OAAO,EAAE,MAAM,EACN,KAAK,CAAC,EAAE,OAAO,YAAA;CAK3B;AAED,eAAO,MAAM,eAAe,EAAG,iBAA0B,CAAC;AAE1D,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gHAAgH;IAChH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CACjC;AAED,KAAK,WAAW,GAAG,MAAM,GAAG,IAAI,CAAC;AAgBjC,eAAO,MAAM,cAAc,GACzB,KAAK,cAAc,EACnB,OAAO,kBAAkB;;;;;eA6JV,MAAM;0BACK,MAAM;sBACV,MAAM,EAAE;;;eA0Bf,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC;eAAS,MAAM;;;;;;;eA5BxD,MAAM;0BACK,MAAM;sBACV,MAAM,EAAE;;;+EAsD5B,CAAC"}
|