@devpad/mcp 2.0.2 → 2.0.3
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.js +190 -474
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1423,8 +1423,8 @@ var require_resolve = __commonJS((exports, module) => {
|
|
|
1423
1423
|
function resolveSchema(root, ref) {
|
|
1424
1424
|
var p = URI.parse(ref), refPath = _getFullPath(p), baseId = getFullPath(this._getId(root.schema));
|
|
1425
1425
|
if (Object.keys(root.schema).length === 0 || refPath !== baseId) {
|
|
1426
|
-
var
|
|
1427
|
-
var refVal = this._refs[
|
|
1426
|
+
var id = normalizeId(refPath);
|
|
1427
|
+
var refVal = this._refs[id];
|
|
1428
1428
|
if (typeof refVal == "string") {
|
|
1429
1429
|
return resolveRecursive.call(this, root, refVal, p);
|
|
1430
1430
|
} else if (refVal instanceof SchemaObject) {
|
|
@@ -1432,11 +1432,11 @@ var require_resolve = __commonJS((exports, module) => {
|
|
|
1432
1432
|
this._compile(refVal);
|
|
1433
1433
|
root = refVal;
|
|
1434
1434
|
} else {
|
|
1435
|
-
refVal = this._schemas[
|
|
1435
|
+
refVal = this._schemas[id];
|
|
1436
1436
|
if (refVal instanceof SchemaObject) {
|
|
1437
1437
|
if (!refVal.validate)
|
|
1438
1438
|
this._compile(refVal);
|
|
1439
|
-
if (
|
|
1439
|
+
if (id == normalizeId(ref))
|
|
1440
1440
|
return { schema: refVal, root, baseId };
|
|
1441
1441
|
root = refVal;
|
|
1442
1442
|
} else {
|
|
@@ -1455,9 +1455,9 @@ var require_resolve = __commonJS((exports, module) => {
|
|
|
1455
1455
|
var schema = res.schema;
|
|
1456
1456
|
var baseId = res.baseId;
|
|
1457
1457
|
root = res.root;
|
|
1458
|
-
var
|
|
1459
|
-
if (
|
|
1460
|
-
baseId = resolveUrl(baseId,
|
|
1458
|
+
var id = this._getId(schema);
|
|
1459
|
+
if (id)
|
|
1460
|
+
baseId = resolveUrl(baseId, id);
|
|
1461
1461
|
return getJsonPointer.call(this, parsedRef, baseId, schema, root);
|
|
1462
1462
|
}
|
|
1463
1463
|
}
|
|
@@ -1474,11 +1474,11 @@ var require_resolve = __commonJS((exports, module) => {
|
|
|
1474
1474
|
schema = schema[part];
|
|
1475
1475
|
if (schema === undefined)
|
|
1476
1476
|
break;
|
|
1477
|
-
var
|
|
1477
|
+
var id;
|
|
1478
1478
|
if (!PREVENT_SCOPE_CHANGE[part]) {
|
|
1479
|
-
|
|
1480
|
-
if (
|
|
1481
|
-
baseId = resolveUrl(baseId,
|
|
1479
|
+
id = this._getId(schema);
|
|
1480
|
+
if (id)
|
|
1481
|
+
baseId = resolveUrl(baseId, id);
|
|
1482
1482
|
if (schema.$ref) {
|
|
1483
1483
|
var $ref = resolveUrl(baseId, schema.$ref);
|
|
1484
1484
|
var res = resolveSchema.call(this, root, $ref);
|
|
@@ -1565,22 +1565,22 @@ var require_resolve = __commonJS((exports, module) => {
|
|
|
1565
1565
|
}
|
|
1566
1566
|
return count;
|
|
1567
1567
|
}
|
|
1568
|
-
function getFullPath(
|
|
1568
|
+
function getFullPath(id, normalize) {
|
|
1569
1569
|
if (normalize !== false)
|
|
1570
|
-
|
|
1571
|
-
var p = URI.parse(
|
|
1570
|
+
id = normalizeId(id);
|
|
1571
|
+
var p = URI.parse(id);
|
|
1572
1572
|
return _getFullPath(p);
|
|
1573
1573
|
}
|
|
1574
1574
|
function _getFullPath(p) {
|
|
1575
1575
|
return URI.serialize(p).split("#")[0] + "#";
|
|
1576
1576
|
}
|
|
1577
1577
|
var TRAILING_SLASH_HASH = /#\/?$/;
|
|
1578
|
-
function normalizeId(
|
|
1579
|
-
return
|
|
1578
|
+
function normalizeId(id) {
|
|
1579
|
+
return id ? id.replace(TRAILING_SLASH_HASH, "") : "";
|
|
1580
1580
|
}
|
|
1581
|
-
function resolveUrl(baseId,
|
|
1582
|
-
|
|
1583
|
-
return URI.resolve(baseId,
|
|
1581
|
+
function resolveUrl(baseId, id) {
|
|
1582
|
+
id = normalizeId(id);
|
|
1583
|
+
return URI.resolve(baseId, id);
|
|
1584
1584
|
}
|
|
1585
1585
|
function resolveIds(schema) {
|
|
1586
1586
|
var schemaId = normalizeId(this._getId(schema));
|
|
@@ -1591,26 +1591,26 @@ var require_resolve = __commonJS((exports, module) => {
|
|
|
1591
1591
|
traverse(schema, { allKeys: true }, function(sch, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
|
|
1592
1592
|
if (jsonPtr === "")
|
|
1593
1593
|
return;
|
|
1594
|
-
var
|
|
1594
|
+
var id = self._getId(sch);
|
|
1595
1595
|
var baseId = baseIds[parentJsonPtr];
|
|
1596
1596
|
var fullPath = fullPaths[parentJsonPtr] + "/" + parentKeyword;
|
|
1597
1597
|
if (keyIndex !== undefined)
|
|
1598
1598
|
fullPath += "/" + (typeof keyIndex == "number" ? keyIndex : util3.escapeFragment(keyIndex));
|
|
1599
|
-
if (typeof
|
|
1600
|
-
|
|
1601
|
-
var refVal = self._refs[
|
|
1599
|
+
if (typeof id == "string") {
|
|
1600
|
+
id = baseId = normalizeId(baseId ? URI.resolve(baseId, id) : id);
|
|
1601
|
+
var refVal = self._refs[id];
|
|
1602
1602
|
if (typeof refVal == "string")
|
|
1603
1603
|
refVal = self._refs[refVal];
|
|
1604
1604
|
if (refVal && refVal.schema) {
|
|
1605
1605
|
if (!equal(sch, refVal.schema))
|
|
1606
|
-
throw new Error('id "' +
|
|
1607
|
-
} else if (
|
|
1608
|
-
if (
|
|
1609
|
-
if (localRefs[
|
|
1610
|
-
throw new Error('id "' +
|
|
1611
|
-
localRefs[
|
|
1606
|
+
throw new Error('id "' + id + '" resolves to more than one schema');
|
|
1607
|
+
} else if (id != normalizeId(fullPath)) {
|
|
1608
|
+
if (id[0] == "#") {
|
|
1609
|
+
if (localRefs[id] && !equal(sch, localRefs[id]))
|
|
1610
|
+
throw new Error('id "' + id + '" resolves to more than one schema');
|
|
1611
|
+
localRefs[id] = sch;
|
|
1612
1612
|
} else {
|
|
1613
|
-
self._refs[
|
|
1613
|
+
self._refs[id] = fullPath;
|
|
1614
1614
|
}
|
|
1615
1615
|
}
|
|
1616
1616
|
}
|
|
@@ -5907,10 +5907,10 @@ var require_ajv = __commonJS((exports, module) => {
|
|
|
5907
5907
|
this.addSchema(schema[i], undefined, _skipValidation, _meta);
|
|
5908
5908
|
return this;
|
|
5909
5909
|
}
|
|
5910
|
-
var
|
|
5911
|
-
if (
|
|
5910
|
+
var id = this._getId(schema);
|
|
5911
|
+
if (id !== undefined && typeof id != "string")
|
|
5912
5912
|
throw new Error("schema id must be string");
|
|
5913
|
-
key = resolve.normalizeId(key ||
|
|
5913
|
+
key = resolve.normalizeId(key || id);
|
|
5914
5914
|
checkUnique(this, key);
|
|
5915
5915
|
this._schemas[key] = this._addSchema(schema, _skipValidation, _meta, true);
|
|
5916
5916
|
return this;
|
|
@@ -5998,11 +5998,11 @@ var require_ajv = __commonJS((exports, module) => {
|
|
|
5998
5998
|
var serialize = this._opts.serialize;
|
|
5999
5999
|
var cacheKey = serialize ? serialize(schemaKeyRef) : schemaKeyRef;
|
|
6000
6000
|
this._cache.del(cacheKey);
|
|
6001
|
-
var
|
|
6002
|
-
if (
|
|
6003
|
-
|
|
6004
|
-
delete this._schemas[
|
|
6005
|
-
delete this._refs[
|
|
6001
|
+
var id = this._getId(schemaKeyRef);
|
|
6002
|
+
if (id) {
|
|
6003
|
+
id = resolve.normalizeId(id);
|
|
6004
|
+
delete this._schemas[id];
|
|
6005
|
+
delete this._refs[id];
|
|
6006
6006
|
}
|
|
6007
6007
|
}
|
|
6008
6008
|
return this;
|
|
@@ -6025,23 +6025,23 @@ var require_ajv = __commonJS((exports, module) => {
|
|
|
6025
6025
|
if (cached)
|
|
6026
6026
|
return cached;
|
|
6027
6027
|
shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false;
|
|
6028
|
-
var
|
|
6029
|
-
if (
|
|
6030
|
-
checkUnique(this,
|
|
6028
|
+
var id = resolve.normalizeId(this._getId(schema));
|
|
6029
|
+
if (id && shouldAddSchema)
|
|
6030
|
+
checkUnique(this, id);
|
|
6031
6031
|
var willValidate = this._opts.validateSchema !== false && !skipValidation;
|
|
6032
6032
|
var recursiveMeta;
|
|
6033
|
-
if (willValidate && !(recursiveMeta =
|
|
6033
|
+
if (willValidate && !(recursiveMeta = id && id == resolve.normalizeId(schema.$schema)))
|
|
6034
6034
|
this.validateSchema(schema, true);
|
|
6035
6035
|
var localRefs = resolve.ids.call(this, schema);
|
|
6036
6036
|
var schemaObj = new SchemaObject({
|
|
6037
|
-
id
|
|
6037
|
+
id,
|
|
6038
6038
|
schema,
|
|
6039
6039
|
localRefs,
|
|
6040
6040
|
cacheKey,
|
|
6041
6041
|
meta
|
|
6042
6042
|
});
|
|
6043
|
-
if (
|
|
6044
|
-
this._refs[
|
|
6043
|
+
if (id[0] != "#" && shouldAddSchema)
|
|
6044
|
+
this._refs[id] = schemaObj;
|
|
6045
6045
|
this._cache.put(cacheKey, schemaObj);
|
|
6046
6046
|
if (willValidate && recursiveMeta)
|
|
6047
6047
|
this.validateSchema(schema, true);
|
|
@@ -6168,9 +6168,9 @@ var require_ajv = __commonJS((exports, module) => {
|
|
|
6168
6168
|
self.addKeyword(name, keyword);
|
|
6169
6169
|
}
|
|
6170
6170
|
}
|
|
6171
|
-
function checkUnique(self,
|
|
6172
|
-
if (self._schemas[
|
|
6173
|
-
throw new Error('schema with key or id "' +
|
|
6171
|
+
function checkUnique(self, id) {
|
|
6172
|
+
if (self._schemas[id] || self._refs[id])
|
|
6173
|
+
throw new Error('schema with key or id "' + id + '" already exists');
|
|
6174
6174
|
}
|
|
6175
6175
|
function getMetaSchemaOptions(self) {
|
|
6176
6176
|
var metaOpts = util3.copy(self._opts);
|
|
@@ -10166,7 +10166,7 @@ var coerce = {
|
|
|
10166
10166
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
10167
10167
|
};
|
|
10168
10168
|
var NEVER = INVALID;
|
|
10169
|
-
// ../api/dist/chunk-
|
|
10169
|
+
// ../api/dist/chunk-INGCIUMX.js
|
|
10170
10170
|
var ArrayBufferedQueue = class {
|
|
10171
10171
|
constructor(_capacity) {
|
|
10172
10172
|
this._capacity = _capacity;
|
|
@@ -11124,46 +11124,6 @@ class ForeignKey {
|
|
|
11124
11124
|
function uniqueKeyName2(table, columns) {
|
|
11125
11125
|
return `${table[TableName]}_${columns.join("_")}_unique`;
|
|
11126
11126
|
}
|
|
11127
|
-
function unique(name) {
|
|
11128
|
-
return new UniqueOnConstraintBuilder(name);
|
|
11129
|
-
}
|
|
11130
|
-
|
|
11131
|
-
class UniqueConstraintBuilder {
|
|
11132
|
-
constructor(columns, name) {
|
|
11133
|
-
this.name = name;
|
|
11134
|
-
this.columns = columns;
|
|
11135
|
-
}
|
|
11136
|
-
static [entityKind] = "SQLiteUniqueConstraintBuilder";
|
|
11137
|
-
columns;
|
|
11138
|
-
build(table) {
|
|
11139
|
-
return new UniqueConstraint(table, this.columns, this.name);
|
|
11140
|
-
}
|
|
11141
|
-
}
|
|
11142
|
-
|
|
11143
|
-
class UniqueOnConstraintBuilder {
|
|
11144
|
-
static [entityKind] = "SQLiteUniqueOnConstraintBuilder";
|
|
11145
|
-
name;
|
|
11146
|
-
constructor(name) {
|
|
11147
|
-
this.name = name;
|
|
11148
|
-
}
|
|
11149
|
-
on(...columns) {
|
|
11150
|
-
return new UniqueConstraintBuilder(columns, this.name);
|
|
11151
|
-
}
|
|
11152
|
-
}
|
|
11153
|
-
|
|
11154
|
-
class UniqueConstraint {
|
|
11155
|
-
constructor(table, columns, name) {
|
|
11156
|
-
this.table = table;
|
|
11157
|
-
this.columns = columns;
|
|
11158
|
-
this.name = name ?? uniqueKeyName2(this.table, this.columns.map((column) => column.name));
|
|
11159
|
-
}
|
|
11160
|
-
static [entityKind] = "SQLiteUniqueConstraint";
|
|
11161
|
-
columns;
|
|
11162
|
-
name;
|
|
11163
|
-
getName() {
|
|
11164
|
-
return this.name;
|
|
11165
|
-
}
|
|
11166
|
-
}
|
|
11167
11127
|
|
|
11168
11128
|
// ../../node_modules/drizzle-orm/sqlite-core/columns/common.js
|
|
11169
11129
|
class SQLiteColumnBuilder extends ColumnBuilder {
|
|
@@ -11446,7 +11406,6 @@ function integer(a, b) {
|
|
|
11446
11406
|
}
|
|
11447
11407
|
return new SQLiteIntegerBuilder(name);
|
|
11448
11408
|
}
|
|
11449
|
-
var int = integer;
|
|
11450
11409
|
|
|
11451
11410
|
// ../../node_modules/drizzle-orm/sqlite-core/columns/numeric.js
|
|
11452
11411
|
class SQLiteNumericBuilder extends SQLiteColumnBuilder {
|
|
@@ -11642,9 +11601,9 @@ var sqliteTable = (name, columns, extraConfig) => {
|
|
|
11642
11601
|
|
|
11643
11602
|
// ../../node_modules/drizzle-orm/sqlite-core/indexes.js
|
|
11644
11603
|
class IndexBuilderOn {
|
|
11645
|
-
constructor(name,
|
|
11604
|
+
constructor(name, unique) {
|
|
11646
11605
|
this.name = name;
|
|
11647
|
-
this.unique =
|
|
11606
|
+
this.unique = unique;
|
|
11648
11607
|
}
|
|
11649
11608
|
static [entityKind] = "SQLiteIndexBuilderOn";
|
|
11650
11609
|
on(...columns) {
|
|
@@ -11655,11 +11614,11 @@ class IndexBuilderOn {
|
|
|
11655
11614
|
class IndexBuilder {
|
|
11656
11615
|
static [entityKind] = "SQLiteIndexBuilder";
|
|
11657
11616
|
config;
|
|
11658
|
-
constructor(name, columns,
|
|
11617
|
+
constructor(name, columns, unique) {
|
|
11659
11618
|
this.config = {
|
|
11660
11619
|
name,
|
|
11661
11620
|
columns,
|
|
11662
|
-
unique
|
|
11621
|
+
unique,
|
|
11663
11622
|
where: undefined
|
|
11664
11623
|
};
|
|
11665
11624
|
}
|
|
@@ -11718,21 +11677,6 @@ class PrimaryKey {
|
|
|
11718
11677
|
}
|
|
11719
11678
|
}
|
|
11720
11679
|
|
|
11721
|
-
// ../../node_modules/drizzle-orm/relations.js
|
|
11722
|
-
class Relations {
|
|
11723
|
-
constructor(table, config) {
|
|
11724
|
-
this.table = table;
|
|
11725
|
-
this.config = config;
|
|
11726
|
-
}
|
|
11727
|
-
static [entityKind] = "Relations";
|
|
11728
|
-
}
|
|
11729
|
-
function relations(table, relations2) {
|
|
11730
|
-
return new Relations(table, (helpers) => Object.fromEntries(Object.entries(relations2(helpers)).map(([key, value]) => [
|
|
11731
|
-
key,
|
|
11732
|
-
value.withFieldName(key)
|
|
11733
|
-
])));
|
|
11734
|
-
}
|
|
11735
|
-
|
|
11736
11680
|
// ../../node_modules/@f0rbit/corpus/dist/observations/schema.js
|
|
11737
11681
|
var corpus_observations = sqliteTable("corpus_observations", {
|
|
11738
11682
|
id: text("id").primaryKey(),
|
|
@@ -11791,275 +11735,6 @@ var corpus_snapshots = sqliteTable("corpus_snapshots", {
|
|
|
11791
11735
|
hash_idx: index("idx_content_hash").on(table.store_id, table.content_hash),
|
|
11792
11736
|
data_key_idx: index("idx_data_key").on(table.data_key)
|
|
11793
11737
|
}));
|
|
11794
|
-
// ../api/dist/chunk-FOO5XXY5.js
|
|
11795
|
-
var timestamps = () => ({
|
|
11796
|
-
created_at: text("created_at").notNull().default(sql`(CURRENT_TIMESTAMP)`),
|
|
11797
|
-
updated_at: text("updated_at").notNull().default(sql`(CURRENT_TIMESTAMP)`)
|
|
11798
|
-
});
|
|
11799
|
-
var deleted = () => ({
|
|
11800
|
-
deleted: int("deleted", { mode: "boolean" }).notNull().default(false)
|
|
11801
|
-
});
|
|
11802
|
-
var owner_id = () => ({
|
|
11803
|
-
owner_id: text("owner_id").notNull().references(() => user.id)
|
|
11804
|
-
});
|
|
11805
|
-
var id = (prefix) => ({
|
|
11806
|
-
id: text("id").primaryKey().$defaultFn(() => `${prefix}_${crypto.randomUUID()}`)
|
|
11807
|
-
});
|
|
11808
|
-
var entity = (prefix) => ({
|
|
11809
|
-
...id(prefix),
|
|
11810
|
-
...timestamps(),
|
|
11811
|
-
...deleted()
|
|
11812
|
-
});
|
|
11813
|
-
var owned_entity = (prefix) => ({
|
|
11814
|
-
...entity(prefix),
|
|
11815
|
-
...owner_id()
|
|
11816
|
-
});
|
|
11817
|
-
var user = sqliteTable("user", {
|
|
11818
|
-
id: text("id").primaryKey().$defaultFn(() => `user_${crypto.randomUUID()}`),
|
|
11819
|
-
github_id: integer("github_id"),
|
|
11820
|
-
name: text("name"),
|
|
11821
|
-
email: text("email").unique(),
|
|
11822
|
-
email_verified: text("email_verified"),
|
|
11823
|
-
image_url: text("image_url"),
|
|
11824
|
-
task_view: text("task_view", { enum: ["list", "grid"] }).notNull().default("list")
|
|
11825
|
-
});
|
|
11826
|
-
var session = sqliteTable("session", {
|
|
11827
|
-
id: text("id").notNull().primaryKey(),
|
|
11828
|
-
userId: text("user_id").notNull().references(() => user.id),
|
|
11829
|
-
expiresAt: integer("expires_at").notNull(),
|
|
11830
|
-
access_token: text("access_token")
|
|
11831
|
-
});
|
|
11832
|
-
var api_keys = sqliteTable("api_keys", {
|
|
11833
|
-
...id("apikey"),
|
|
11834
|
-
user_id: text("user_id").notNull().references(() => user.id),
|
|
11835
|
-
key_hash: text("key_hash").notNull().unique(),
|
|
11836
|
-
name: text("name"),
|
|
11837
|
-
note: text("note"),
|
|
11838
|
-
scope: text("scope", { enum: ["devpad", "blog", "media", "all"] }).notNull().default("all"),
|
|
11839
|
-
enabled: integer("enabled", { mode: "boolean" }).notNull().default(true),
|
|
11840
|
-
last_used_at: text("last_used_at"),
|
|
11841
|
-
...timestamps(),
|
|
11842
|
-
deleted: integer("deleted", { mode: "boolean" }).notNull().default(false)
|
|
11843
|
-
});
|
|
11844
|
-
var project = sqliteTable("project", {
|
|
11845
|
-
...owned_entity("project"),
|
|
11846
|
-
project_id: text("project_id").notNull(),
|
|
11847
|
-
name: text("name").notNull(),
|
|
11848
|
-
description: text("description"),
|
|
11849
|
-
specification: text("specification"),
|
|
11850
|
-
repo_url: text("repo_url"),
|
|
11851
|
-
repo_id: integer("repo_id"),
|
|
11852
|
-
icon_url: text("icon_url"),
|
|
11853
|
-
status: text("status", { enum: ["DEVELOPMENT", "PAUSED", "RELEASED", "LIVE", "FINISHED", "ABANDONED", "STOPPED"] }).notNull().default("DEVELOPMENT"),
|
|
11854
|
-
link_url: text("link_url"),
|
|
11855
|
-
link_text: text("link_text"),
|
|
11856
|
-
visibility: text("visibility", { enum: ["PUBLIC", "PRIVATE", "HIDDEN", "ARCHIVED", "DRAFT", "DELETED"] }).notNull().default("PRIVATE"),
|
|
11857
|
-
current_version: text("current_version"),
|
|
11858
|
-
scan_branch: text("scan_branch")
|
|
11859
|
-
});
|
|
11860
|
-
var ACTIONS = [
|
|
11861
|
-
"CREATE_TASK",
|
|
11862
|
-
"UPDATE_TASK",
|
|
11863
|
-
"DELETE_TASK",
|
|
11864
|
-
"CREATE_PROJECT",
|
|
11865
|
-
"UPDATE_PROJECT",
|
|
11866
|
-
"DELETE_PROJECT",
|
|
11867
|
-
"CREATE_TAG",
|
|
11868
|
-
"UPDATE_TAG",
|
|
11869
|
-
"DELETE_TAG",
|
|
11870
|
-
"CREATE_GOAL",
|
|
11871
|
-
"UPDATE_GOAL",
|
|
11872
|
-
"DELETE_GOAL",
|
|
11873
|
-
"CREATE_MILESTONE",
|
|
11874
|
-
"UPDATE_MILESTONE",
|
|
11875
|
-
"DELETE_MILESTONE",
|
|
11876
|
-
"CREATE_CHECKLIST",
|
|
11877
|
-
"UPDATE_CHECKLIST",
|
|
11878
|
-
"DELETE_CHECKLIST"
|
|
11879
|
-
];
|
|
11880
|
-
var action = sqliteTable("action", {
|
|
11881
|
-
...owned_entity("action"),
|
|
11882
|
-
type: text("type", { enum: ACTIONS }).notNull(),
|
|
11883
|
-
description: text("description").notNull(),
|
|
11884
|
-
data: text("data", { mode: "json" })
|
|
11885
|
-
});
|
|
11886
|
-
var tracker_result = sqliteTable("tracker_result", {
|
|
11887
|
-
id: integer("id").primaryKey({ autoIncrement: true }),
|
|
11888
|
-
project_id: text("project_id").notNull().references(() => project.id),
|
|
11889
|
-
created_at: text("created_at").notNull().default(sql`(CURRENT_TIMESTAMP)`),
|
|
11890
|
-
data: text("data", { mode: "json" }).notNull(),
|
|
11891
|
-
accepted: integer("accepted", { mode: "boolean" }).notNull().default(false)
|
|
11892
|
-
});
|
|
11893
|
-
var todo_updates = sqliteTable("todo_updates", {
|
|
11894
|
-
id: integer("id").primaryKey({ autoIncrement: true }),
|
|
11895
|
-
project_id: text("project_id").notNull().references(() => project.id),
|
|
11896
|
-
created_at: text("created_at").notNull().default(sql`(CURRENT_TIMESTAMP)`),
|
|
11897
|
-
old_id: integer("old_id").references(() => tracker_result.id),
|
|
11898
|
-
new_id: integer("new_id").notNull().references(() => tracker_result.id),
|
|
11899
|
-
data: text("data", { mode: "json" }).notNull(),
|
|
11900
|
-
status: text("status", { enum: ["PENDING", "ACCEPTED", "REJECTED", "IGNORED"] }).notNull().default("PENDING"),
|
|
11901
|
-
branch: text("branch"),
|
|
11902
|
-
commit_sha: text("commit_sha"),
|
|
11903
|
-
commit_msg: text("commit_msg"),
|
|
11904
|
-
commit_url: text("commit_url")
|
|
11905
|
-
});
|
|
11906
|
-
var update_tracker_relations = relations(todo_updates, ({ one }) => ({
|
|
11907
|
-
old: one(tracker_result, { fields: [todo_updates.old_id], references: [tracker_result.id] }),
|
|
11908
|
-
new: one(tracker_result, { fields: [todo_updates.new_id], references: [tracker_result.id] })
|
|
11909
|
-
}));
|
|
11910
|
-
var milestone = sqliteTable("milestone", {
|
|
11911
|
-
...entity("milestone"),
|
|
11912
|
-
project_id: text("project_id").notNull().references(() => project.id),
|
|
11913
|
-
name: text("name").notNull(),
|
|
11914
|
-
description: text("description"),
|
|
11915
|
-
target_time: text("target_time"),
|
|
11916
|
-
target_version: text("target_version"),
|
|
11917
|
-
finished_at: text("finished_at"),
|
|
11918
|
-
after_id: text("after_id")
|
|
11919
|
-
});
|
|
11920
|
-
var goal = sqliteTable("goal", {
|
|
11921
|
-
...entity("goal"),
|
|
11922
|
-
milestone_id: text("milestone_id").notNull().references(() => milestone.id),
|
|
11923
|
-
name: text("name").notNull(),
|
|
11924
|
-
description: text("description"),
|
|
11925
|
-
target_time: text("target_time"),
|
|
11926
|
-
finished_at: text("finished_at")
|
|
11927
|
-
});
|
|
11928
|
-
var task = sqliteTable("task", {
|
|
11929
|
-
...owned_entity("task"),
|
|
11930
|
-
title: text("title").notNull(),
|
|
11931
|
-
progress: text("progress", { enum: ["UNSTARTED", "IN_PROGRESS", "COMPLETED"] }).notNull().default("UNSTARTED"),
|
|
11932
|
-
visibility: text("visibility", { enum: ["PUBLIC", "PRIVATE", "HIDDEN", "ARCHIVED", "DRAFT", "DELETED"] }).notNull().default("PRIVATE"),
|
|
11933
|
-
goal_id: text("goal_id").references(() => goal.id),
|
|
11934
|
-
project_id: text("project_id").references(() => project.id),
|
|
11935
|
-
description: text("description"),
|
|
11936
|
-
start_time: text("start_time"),
|
|
11937
|
-
end_time: text("end_time"),
|
|
11938
|
-
summary: text("summary"),
|
|
11939
|
-
codebase_task_id: text("codebase_task_id").references(() => codebase_tasks.id),
|
|
11940
|
-
priority: text("priority", { enum: ["LOW", "MEDIUM", "HIGH"] }).notNull().default("LOW")
|
|
11941
|
-
});
|
|
11942
|
-
var checklist = sqliteTable("checklist", {
|
|
11943
|
-
...entity("checklist"),
|
|
11944
|
-
task_id: text("task_id").notNull().references(() => task.id),
|
|
11945
|
-
name: text("name").notNull()
|
|
11946
|
-
});
|
|
11947
|
-
var checklist_item = sqliteTable("checklist_item", {
|
|
11948
|
-
...entity("checklist-item"),
|
|
11949
|
-
checklist_id: text("checklist_id").notNull().references(() => checklist.id),
|
|
11950
|
-
parent_id: text("parent_id"),
|
|
11951
|
-
name: text("name").notNull(),
|
|
11952
|
-
checked: int("checked", { mode: "boolean" }).notNull().default(false)
|
|
11953
|
-
});
|
|
11954
|
-
var codebase_tasks = sqliteTable("codebase_tasks", {
|
|
11955
|
-
...entity("codebase-task"),
|
|
11956
|
-
branch: text("branch"),
|
|
11957
|
-
commit_sha: text("commit_sha"),
|
|
11958
|
-
commit_msg: text("commit_msg"),
|
|
11959
|
-
commit_url: text("commit_url"),
|
|
11960
|
-
type: text("type"),
|
|
11961
|
-
text: text("text"),
|
|
11962
|
-
file: text("file"),
|
|
11963
|
-
line: integer("line"),
|
|
11964
|
-
context: text("context", { mode: "json" }),
|
|
11965
|
-
recent_scan_id: integer("recent_scan_id").references(() => tracker_result.id)
|
|
11966
|
-
});
|
|
11967
|
-
var tag = sqliteTable("tag", {
|
|
11968
|
-
...owned_entity("tag"),
|
|
11969
|
-
title: text("title").notNull(),
|
|
11970
|
-
color: text("color"),
|
|
11971
|
-
render: int("render", { mode: "boolean" }).notNull().default(true)
|
|
11972
|
-
}, (table) => ({
|
|
11973
|
-
tag_unique: unique("tag_unique").on(table.owner_id, table.title)
|
|
11974
|
-
}));
|
|
11975
|
-
var task_tag = sqliteTable("task_tag", {
|
|
11976
|
-
task_id: text("task_id").notNull().references(() => task.id),
|
|
11977
|
-
tag_id: text("tag_id").notNull().references(() => tag.id),
|
|
11978
|
-
...timestamps()
|
|
11979
|
-
}, (table) => ({
|
|
11980
|
-
task_tag_unique: primaryKey({ columns: [table.task_id, table.tag_id] })
|
|
11981
|
-
}));
|
|
11982
|
-
var commit_detail = sqliteTable("commit_detail", {
|
|
11983
|
-
sha: text("sha").primaryKey(),
|
|
11984
|
-
message: text("message").notNull(),
|
|
11985
|
-
url: text("url").notNull(),
|
|
11986
|
-
avatar_url: text("avatar_url"),
|
|
11987
|
-
author_user: text("author_user").notNull(),
|
|
11988
|
-
author_name: text("author_name"),
|
|
11989
|
-
author_email: text("author_email").notNull(),
|
|
11990
|
-
date: text("date").notNull()
|
|
11991
|
-
});
|
|
11992
|
-
var tag_config = sqliteTable("tag_config", {
|
|
11993
|
-
...id("tag_config"),
|
|
11994
|
-
project_id: text("project_id").notNull().references(() => project.id),
|
|
11995
|
-
tag_id: text("tag_id").notNull().references(() => tag.id),
|
|
11996
|
-
match: text("match").notNull(),
|
|
11997
|
-
...timestamps()
|
|
11998
|
-
});
|
|
11999
|
-
var ignore_path = sqliteTable("ignore_path", {
|
|
12000
|
-
...id("ignore_path"),
|
|
12001
|
-
project_id: text("project_id").notNull().references(() => project.id),
|
|
12002
|
-
path: text("path").notNull(),
|
|
12003
|
-
...timestamps()
|
|
12004
|
-
});
|
|
12005
|
-
var user_relations = relations(user, ({ many }) => ({
|
|
12006
|
-
sessions: many(session),
|
|
12007
|
-
api_keys: many(api_keys),
|
|
12008
|
-
actions: many(action),
|
|
12009
|
-
tasks: many(task),
|
|
12010
|
-
tags: many(tag)
|
|
12011
|
-
}));
|
|
12012
|
-
var session_relations = relations(session, ({ one }) => ({
|
|
12013
|
-
user: one(user, { fields: [session.userId], references: [user.id] })
|
|
12014
|
-
}));
|
|
12015
|
-
var api_keys_relations = relations(api_keys, ({ one }) => ({
|
|
12016
|
-
owner: one(user, { fields: [api_keys.user_id], references: [user.id] })
|
|
12017
|
-
}));
|
|
12018
|
-
var project_relations = relations(project, ({ one, many }) => ({
|
|
12019
|
-
owner: one(user, { fields: [project.owner_id], references: [user.id] }),
|
|
12020
|
-
tracker_results: many(tracker_result),
|
|
12021
|
-
milestones: many(milestone),
|
|
12022
|
-
todo_updates: many(todo_updates)
|
|
12023
|
-
}));
|
|
12024
|
-
var action_relations = relations(action, ({ one }) => ({
|
|
12025
|
-
owner: one(user, { fields: [action.owner_id], references: [user.id] })
|
|
12026
|
-
}));
|
|
12027
|
-
var tracker_result_relations = relations(tracker_result, ({ one }) => ({
|
|
12028
|
-
project: one(project, { fields: [tracker_result.project_id], references: [project.id] })
|
|
12029
|
-
}));
|
|
12030
|
-
var todoUpdatesRelations = relations(todo_updates, ({ one }) => ({
|
|
12031
|
-
project: one(project, { fields: [todo_updates.project_id], references: [project.id] }),
|
|
12032
|
-
oldTrackerResult: one(tracker_result, { fields: [todo_updates.old_id], references: [tracker_result.id] }),
|
|
12033
|
-
newTrackerResult: one(tracker_result, { fields: [todo_updates.new_id], references: [tracker_result.id] })
|
|
12034
|
-
}));
|
|
12035
|
-
var milestone_relations = relations(milestone, ({ one, many }) => ({
|
|
12036
|
-
project: one(project, { fields: [milestone.project_id], references: [project.id] }),
|
|
12037
|
-
goals: many(goal)
|
|
12038
|
-
}));
|
|
12039
|
-
var goal_relations = relations(goal, ({ one }) => ({
|
|
12040
|
-
milestone: one(milestone, { fields: [goal.milestone_id], references: [milestone.id] })
|
|
12041
|
-
}));
|
|
12042
|
-
var task_relations = relations(task, ({ one, many }) => ({
|
|
12043
|
-
owner: one(user, { fields: [task.owner_id], references: [user.id] }),
|
|
12044
|
-
goal: one(goal, { fields: [task.goal_id], references: [goal.id] }),
|
|
12045
|
-
codebase_task: one(codebase_tasks, { fields: [task.codebase_task_id], references: [codebase_tasks.id] }),
|
|
12046
|
-
checklists: many(checklist)
|
|
12047
|
-
}));
|
|
12048
|
-
var checklist_relations = relations(checklist, ({ one, many }) => ({
|
|
12049
|
-
task: one(task, { fields: [checklist.task_id], references: [task.id] }),
|
|
12050
|
-
items: many(checklist_item)
|
|
12051
|
-
}));
|
|
12052
|
-
var checklist_item_relations = relations(checklist_item, ({ one }) => ({
|
|
12053
|
-
checklist: one(checklist, { fields: [checklist_item.checklist_id], references: [checklist.id] })
|
|
12054
|
-
}));
|
|
12055
|
-
var tag_relations = relations(tag, ({ one }) => ({
|
|
12056
|
-
owner: one(user, { fields: [tag.owner_id], references: [user.id] })
|
|
12057
|
-
}));
|
|
12058
|
-
var task_tag_relations = relations(task_tag, ({ one }) => ({
|
|
12059
|
-
task: one(task, { fields: [task_tag.task_id], references: [task.id] }),
|
|
12060
|
-
tag: one(tag, { fields: [task_tag.tag_id], references: [tag.id] })
|
|
12061
|
-
}));
|
|
12062
|
-
|
|
12063
11738
|
// ../api/dist/index.js
|
|
12064
11739
|
var ApiError = class _ApiError extends Error {
|
|
12065
11740
|
constructor(message, options = {}) {
|
|
@@ -12320,7 +11995,9 @@ var ApiClient2 = class {
|
|
|
12320
11995
|
session: () => wrap(() => this.clients.auth_root.get("/auth/session")),
|
|
12321
11996
|
keys: {
|
|
12322
11997
|
list: () => wrap(() => this.clients.auth.get("/keys")),
|
|
12323
|
-
create: (name) => wrap(() => this.clients.auth.post("/keys", {
|
|
11998
|
+
create: (name) => wrap(() => this.clients.auth.post("/keys", {
|
|
11999
|
+
body: name ? { name } : {}
|
|
12000
|
+
})),
|
|
12324
12001
|
revoke: (key_id) => wrap(() => this.clients.auth.delete(`/keys/${key_id}`)),
|
|
12325
12002
|
remove: (key_id) => wrap(() => this.clients.auth.delete(`/keys/${key_id}`))
|
|
12326
12003
|
}
|
|
@@ -12331,52 +12008,60 @@ var ApiClient2 = class {
|
|
|
12331
12008
|
const result = await this.projects.list(filters);
|
|
12332
12009
|
if (!result.ok)
|
|
12333
12010
|
throw new Error(result.error.message);
|
|
12334
|
-
return result.value.reduce((acc,
|
|
12335
|
-
acc[
|
|
12011
|
+
return result.value.reduce((acc, project) => {
|
|
12012
|
+
acc[project.id] = project;
|
|
12336
12013
|
return acc;
|
|
12337
12014
|
}, {});
|
|
12338
12015
|
}),
|
|
12339
|
-
find: (
|
|
12016
|
+
find: (id) => wrap(() => this.clients.projects.get("/projects", { query: { id } })),
|
|
12340
12017
|
getByName: (name) => wrap(() => this.clients.projects.get("/projects", { query: { name } })),
|
|
12341
|
-
getById: (
|
|
12018
|
+
getById: (id) => wrap(() => this.clients.projects.get("/projects", { query: { id } })),
|
|
12342
12019
|
create: (data) => wrap(() => this.clients.projects.patch("/projects", { body: data })),
|
|
12343
12020
|
update: async (idOrData, changes) => wrap(async () => {
|
|
12344
12021
|
if (typeof idOrData === "object" && idOrData.id) {
|
|
12345
|
-
return this.clients.projects.patch("/projects", {
|
|
12022
|
+
return this.clients.projects.patch("/projects", {
|
|
12023
|
+
body: idOrData
|
|
12024
|
+
});
|
|
12346
12025
|
}
|
|
12347
|
-
const
|
|
12026
|
+
const id = idOrData;
|
|
12348
12027
|
if (!changes) {
|
|
12349
12028
|
throw new Error("Changes parameter required for update");
|
|
12350
12029
|
}
|
|
12351
|
-
const result = await this.projects.find(
|
|
12030
|
+
const result = await this.projects.find(id);
|
|
12352
12031
|
if (!result.ok)
|
|
12353
12032
|
throw new Error(result.error.message);
|
|
12354
12033
|
if (!result.value)
|
|
12355
|
-
throw new Error(`Project with id ${
|
|
12356
|
-
const
|
|
12034
|
+
throw new Error(`Project with id ${id} not found`);
|
|
12035
|
+
const project = result.value;
|
|
12357
12036
|
const updateData = {
|
|
12358
|
-
id:
|
|
12359
|
-
project_id:
|
|
12360
|
-
owner_id:
|
|
12361
|
-
name:
|
|
12362
|
-
description:
|
|
12363
|
-
specification:
|
|
12364
|
-
repo_url:
|
|
12365
|
-
repo_id:
|
|
12366
|
-
icon_url:
|
|
12367
|
-
status:
|
|
12368
|
-
deleted:
|
|
12369
|
-
link_url:
|
|
12370
|
-
link_text:
|
|
12371
|
-
visibility:
|
|
12372
|
-
current_version:
|
|
12037
|
+
id: project.id,
|
|
12038
|
+
project_id: project.project_id,
|
|
12039
|
+
owner_id: project.owner_id,
|
|
12040
|
+
name: project.name,
|
|
12041
|
+
description: project.description,
|
|
12042
|
+
specification: project.specification,
|
|
12043
|
+
repo_url: project.repo_url,
|
|
12044
|
+
repo_id: project.repo_id,
|
|
12045
|
+
icon_url: project.icon_url,
|
|
12046
|
+
status: project.status,
|
|
12047
|
+
deleted: project.deleted,
|
|
12048
|
+
link_url: project.link_url,
|
|
12049
|
+
link_text: project.link_text,
|
|
12050
|
+
visibility: project.visibility,
|
|
12051
|
+
current_version: project.current_version,
|
|
12373
12052
|
...changes
|
|
12374
12053
|
};
|
|
12375
|
-
return this.clients.projects.patch("/projects", {
|
|
12054
|
+
return this.clients.projects.patch("/projects", {
|
|
12055
|
+
body: updateData
|
|
12056
|
+
});
|
|
12376
12057
|
}),
|
|
12377
12058
|
config: {
|
|
12378
|
-
load: (project_id) => wrap(() => this.clients.projects.get("/projects/config", {
|
|
12379
|
-
|
|
12059
|
+
load: (project_id) => wrap(() => this.clients.projects.get("/projects/config", {
|
|
12060
|
+
query: { project_id }
|
|
12061
|
+
})),
|
|
12062
|
+
save: (request) => wrap(() => this.clients.projects.patch("/projects/save_config", {
|
|
12063
|
+
body: request
|
|
12064
|
+
}))
|
|
12380
12065
|
},
|
|
12381
12066
|
scan: {
|
|
12382
12067
|
initiate: async (project_id) => {
|
|
@@ -12391,65 +12076,76 @@ var ApiClient2 = class {
|
|
|
12391
12076
|
return stream;
|
|
12392
12077
|
},
|
|
12393
12078
|
updates: (project_id) => wrap(() => this.clients.projects.get("/projects/updates", { query: { project_id } }).then((response) => response.updates)),
|
|
12394
|
-
update: (project_id, data) => wrap(() => this.clients.projects.post("/projects/scan_status", {
|
|
12079
|
+
update: (project_id, data) => wrap(() => this.clients.projects.post("/projects/scan_status", {
|
|
12080
|
+
query: { project_id },
|
|
12081
|
+
body: data
|
|
12082
|
+
}))
|
|
12395
12083
|
},
|
|
12396
12084
|
history: (project_id) => wrap(() => this.clients.projects.get(`/projects/${project_id}/history`)),
|
|
12397
12085
|
upsert: (data) => wrap(() => this.clients.projects.patch("/projects", { body: data })),
|
|
12398
|
-
specification: (project_id) => wrap(() => this.clients.projects.get("/projects/fetch_spec", {
|
|
12399
|
-
|
|
12086
|
+
specification: (project_id) => wrap(() => this.clients.projects.get("/projects/fetch_spec", {
|
|
12087
|
+
query: { project_id }
|
|
12088
|
+
})),
|
|
12089
|
+
deleteProject: (project) => wrap(() => this.clients.projects.patch("/projects", {
|
|
12090
|
+
body: { ...project, deleted: true }
|
|
12091
|
+
}))
|
|
12400
12092
|
};
|
|
12401
12093
|
this.milestones = {
|
|
12402
12094
|
list: () => wrap(() => this.clients.milestones.get("/milestones")),
|
|
12403
12095
|
getByProject: (project_id) => wrap(() => this.clients.milestones.get(`/projects/${project_id}/milestones`)),
|
|
12404
|
-
find: (
|
|
12096
|
+
find: (id) => wrap(async () => {
|
|
12405
12097
|
try {
|
|
12406
|
-
return await this.clients.milestones.get(`/milestones/${
|
|
12098
|
+
return await this.clients.milestones.get(`/milestones/${id}`);
|
|
12407
12099
|
} catch (error) {
|
|
12408
12100
|
return null;
|
|
12409
12101
|
}
|
|
12410
12102
|
}),
|
|
12411
12103
|
create: (data) => wrap(() => this.clients.milestones.post("/milestones", { body: data })),
|
|
12412
|
-
update: async (
|
|
12413
|
-
const result = await this.milestones.find(
|
|
12104
|
+
update: async (id, data) => wrap(async () => {
|
|
12105
|
+
const result = await this.milestones.find(id);
|
|
12414
12106
|
if (!result.ok)
|
|
12415
12107
|
throw new Error(result.error.message);
|
|
12416
12108
|
if (!result.value)
|
|
12417
|
-
throw new Error(`Milestone with id ${
|
|
12418
|
-
const
|
|
12109
|
+
throw new Error(`Milestone with id ${id} not found`);
|
|
12110
|
+
const milestone = result.value;
|
|
12419
12111
|
const updateData = {
|
|
12420
|
-
id:
|
|
12421
|
-
project_id:
|
|
12422
|
-
name: data.name ??
|
|
12423
|
-
description: data.description ??
|
|
12424
|
-
target_time: data.target_time ??
|
|
12425
|
-
target_version: data.target_version ??
|
|
12112
|
+
id: milestone.id,
|
|
12113
|
+
project_id: milestone.project_id,
|
|
12114
|
+
name: data.name ?? milestone.name,
|
|
12115
|
+
description: data.description ?? milestone.description,
|
|
12116
|
+
target_time: data.target_time ?? milestone.target_time,
|
|
12117
|
+
target_version: data.target_version ?? milestone.target_version
|
|
12426
12118
|
};
|
|
12427
|
-
return this.clients.milestones.patch(`/milestones/${
|
|
12119
|
+
return this.clients.milestones.patch(`/milestones/${id}`, {
|
|
12120
|
+
body: updateData
|
|
12121
|
+
});
|
|
12428
12122
|
}),
|
|
12429
|
-
delete: (
|
|
12430
|
-
goals: (
|
|
12123
|
+
delete: (id) => wrap(() => this.clients.milestones.delete(`/milestones/${id}`)),
|
|
12124
|
+
goals: (id) => wrap(() => this.clients.milestones.get(`/milestones/${id}/goals`))
|
|
12431
12125
|
};
|
|
12432
12126
|
this.goals = {
|
|
12433
12127
|
list: () => wrap(() => this.clients.goals.get("/goals")),
|
|
12434
|
-
find: (
|
|
12128
|
+
find: (id) => wrap(() => this.clients.goals.get(`/goals/${id}`)),
|
|
12435
12129
|
create: (data) => wrap(() => this.clients.goals.post("/goals", { body: data })),
|
|
12436
|
-
update: async (
|
|
12437
|
-
const result = await this.goals.find(
|
|
12130
|
+
update: async (id, data) => wrap(async () => {
|
|
12131
|
+
const result = await this.goals.find(id);
|
|
12438
12132
|
if (!result.ok)
|
|
12439
12133
|
throw new Error(result.error.message);
|
|
12440
12134
|
if (!result.value)
|
|
12441
|
-
throw new Error(`Goal with id ${
|
|
12442
|
-
const
|
|
12135
|
+
throw new Error(`Goal with id ${id} not found`);
|
|
12136
|
+
const goal = result.value;
|
|
12443
12137
|
const updateData = {
|
|
12444
|
-
id:
|
|
12445
|
-
milestone_id:
|
|
12446
|
-
name: data.name ??
|
|
12447
|
-
description: data.description ??
|
|
12448
|
-
target_time: data.target_time ??
|
|
12138
|
+
id: goal.id,
|
|
12139
|
+
milestone_id: goal.milestone_id,
|
|
12140
|
+
name: data.name ?? goal.name,
|
|
12141
|
+
description: data.description ?? goal.description,
|
|
12142
|
+
target_time: data.target_time ?? goal.target_time
|
|
12449
12143
|
};
|
|
12450
|
-
return this.clients.goals.patch(`/goals/${
|
|
12144
|
+
return this.clients.goals.patch(`/goals/${id}`, {
|
|
12145
|
+
body: updateData
|
|
12146
|
+
});
|
|
12451
12147
|
}),
|
|
12452
|
-
delete: (
|
|
12148
|
+
delete: (id) => wrap(() => this.clients.goals.delete(`/goals/${id}`))
|
|
12453
12149
|
};
|
|
12454
12150
|
this.tasks = {
|
|
12455
12151
|
list: (filters) => wrap(() => {
|
|
@@ -12460,35 +12156,41 @@ var ApiClient2 = class {
|
|
|
12460
12156
|
query.tag = filters.tag_id;
|
|
12461
12157
|
return this.clients.tasks.get("/tasks", Object.keys(query).length > 0 ? { query } : {});
|
|
12462
12158
|
}),
|
|
12463
|
-
find: (
|
|
12464
|
-
getByProject: (project_id) => wrap(() => this.clients.tasks.get(`/tasks`, {
|
|
12159
|
+
find: (id) => wrap(() => this.clients.tasks.get("/tasks", { query: { id } })),
|
|
12160
|
+
getByProject: (project_id) => wrap(() => this.clients.tasks.get(`/tasks`, {
|
|
12161
|
+
query: { project: project_id }
|
|
12162
|
+
})),
|
|
12465
12163
|
create: (data) => wrap(() => this.clients.tasks.patch("/tasks", { body: data })),
|
|
12466
|
-
update: async (
|
|
12467
|
-
const result = await this.tasks.find(
|
|
12164
|
+
update: async (id, changes) => wrap(async () => {
|
|
12165
|
+
const result = await this.tasks.find(id);
|
|
12468
12166
|
if (!result.ok)
|
|
12469
12167
|
throw new Error(result.error.message);
|
|
12470
12168
|
if (!result.value)
|
|
12471
|
-
throw new Error(`Task with id ${
|
|
12472
|
-
const
|
|
12169
|
+
throw new Error(`Task with id ${id} not found`);
|
|
12170
|
+
const task = result.value;
|
|
12473
12171
|
const updateData = {
|
|
12474
|
-
id
|
|
12475
|
-
title:
|
|
12476
|
-
summary:
|
|
12477
|
-
description:
|
|
12478
|
-
progress:
|
|
12479
|
-
visibility:
|
|
12480
|
-
start_time:
|
|
12481
|
-
end_time:
|
|
12482
|
-
priority:
|
|
12483
|
-
owner_id:
|
|
12484
|
-
project_id:
|
|
12172
|
+
id,
|
|
12173
|
+
title: task.task.title,
|
|
12174
|
+
summary: task.task.summary,
|
|
12175
|
+
description: task.task.description,
|
|
12176
|
+
progress: task.task.progress,
|
|
12177
|
+
visibility: task.task.visibility,
|
|
12178
|
+
start_time: task.task.start_time,
|
|
12179
|
+
end_time: task.task.end_time,
|
|
12180
|
+
priority: task.task.priority,
|
|
12181
|
+
owner_id: task.task.owner_id,
|
|
12182
|
+
project_id: task.task.project_id,
|
|
12485
12183
|
...changes
|
|
12486
12184
|
};
|
|
12487
|
-
return this.clients.tasks.patch("/tasks", {
|
|
12185
|
+
return this.clients.tasks.patch("/tasks", {
|
|
12186
|
+
body: updateData
|
|
12187
|
+
});
|
|
12488
12188
|
}),
|
|
12489
12189
|
upsert: (data) => wrap(() => this.clients.tasks.patch("/tasks", { body: data })),
|
|
12490
12190
|
saveTags: (data) => wrap(() => this.clients.tasks.patch("/tasks/save_tags", { body: data })),
|
|
12491
|
-
deleteTask: (
|
|
12191
|
+
deleteTask: (task) => wrap(() => this.clients.tasks.patch("/tasks", {
|
|
12192
|
+
body: { ...task.task, deleted: true }
|
|
12193
|
+
})),
|
|
12492
12194
|
history: {
|
|
12493
12195
|
get: (task_id) => wrap(() => this.clients.tasks.get(`/tasks/history/${task_id}`))
|
|
12494
12196
|
}
|
|
@@ -12535,19 +12237,23 @@ var ApiClient2 = class {
|
|
|
12535
12237
|
getForPost: (uuid) => wrap(() => this.clients.blog.get(`/blog/tags/posts/${uuid}/tags`)),
|
|
12536
12238
|
setForPost: (uuid, tags) => wrap(() => this.clients.blog.put(`/blog/tags/posts/${uuid}/tags`, { body: { tags } })),
|
|
12537
12239
|
addToPost: (uuid, tags) => wrap(() => this.clients.blog.post(`/blog/tags/posts/${uuid}/tags`, { body: { tags } })),
|
|
12538
|
-
removeFromPost: (uuid,
|
|
12240
|
+
removeFromPost: (uuid, tag) => wrap(() => this.clients.blog.delete(`/blog/tags/posts/${uuid}/tags/${tag}`))
|
|
12539
12241
|
},
|
|
12540
12242
|
categories: {
|
|
12541
12243
|
tree: () => wrap(() => this.clients.blog.get("/blog/categories")),
|
|
12542
12244
|
create: (data) => wrap(() => this.clients.blog.post("/blog/categories", { body: data })),
|
|
12543
|
-
update: (name, data) => wrap(() => this.clients.blog.put(`/blog/categories/${name}`, {
|
|
12245
|
+
update: (name, data) => wrap(() => this.clients.blog.put(`/blog/categories/${name}`, {
|
|
12246
|
+
body: data
|
|
12247
|
+
})),
|
|
12544
12248
|
delete: (name) => wrap(() => this.clients.blog.delete(`/blog/categories/${name}`))
|
|
12545
12249
|
},
|
|
12546
12250
|
tokens: {
|
|
12547
12251
|
list: () => wrap(() => this.clients.blog.get("/blog/tokens")),
|
|
12548
12252
|
create: (data) => wrap(() => this.clients.blog.post("/blog/tokens", { body: data })),
|
|
12549
|
-
update: (
|
|
12550
|
-
|
|
12253
|
+
update: (id, data) => wrap(() => this.clients.blog.put(`/blog/tokens/${id}`, {
|
|
12254
|
+
body: data
|
|
12255
|
+
})),
|
|
12256
|
+
delete: (id) => wrap(() => this.clients.blog.delete(`/blog/tokens/${id}`))
|
|
12551
12257
|
}
|
|
12552
12258
|
};
|
|
12553
12259
|
this.media = {
|
|
@@ -12557,9 +12263,9 @@ var ApiClient2 = class {
|
|
|
12557
12263
|
return res.profiles;
|
|
12558
12264
|
}),
|
|
12559
12265
|
create: (data) => wrap(() => this.clients.media.post("/profiles", { body: data })),
|
|
12560
|
-
get: (
|
|
12561
|
-
update: (
|
|
12562
|
-
delete: (
|
|
12266
|
+
get: (id) => wrap(() => this.clients.media.get(`/profiles/${id}`)),
|
|
12267
|
+
update: (id, data) => wrap(() => this.clients.media.patch(`/profiles/${id}`, { body: data })),
|
|
12268
|
+
delete: (id) => wrap(() => this.clients.media.delete(`/profiles/${id}`)),
|
|
12563
12269
|
filters: {
|
|
12564
12270
|
list: (profile_id) => wrap(async () => {
|
|
12565
12271
|
const res = await this.clients.media.get(`/profiles/${profile_id}/filters`);
|
|
@@ -12589,10 +12295,14 @@ var ApiClient2 = class {
|
|
|
12589
12295
|
delete: (account_id) => wrap(() => this.clients.media.delete(`/connections/${account_id}`)),
|
|
12590
12296
|
refresh: (account_id) => wrap(() => this.clients.media.post(`/connections/${account_id}/refresh`)),
|
|
12591
12297
|
refreshAll: () => wrap(() => this.clients.media.post("/connections/refresh-all")),
|
|
12592
|
-
updateStatus: (account_id, is_active) => wrap(() => this.clients.media.patch(`/connections/${account_id}`, {
|
|
12298
|
+
updateStatus: (account_id, is_active) => wrap(() => this.clients.media.patch(`/connections/${account_id}`, {
|
|
12299
|
+
body: { is_active }
|
|
12300
|
+
})),
|
|
12593
12301
|
settings: {
|
|
12594
12302
|
get: (account_id) => wrap(() => this.clients.media.get(`/connections/${account_id}/settings`)),
|
|
12595
|
-
update: (account_id, settings) => wrap(() => this.clients.media.put(`/connections/${account_id}/settings`, {
|
|
12303
|
+
update: (account_id, settings) => wrap(() => this.clients.media.put(`/connections/${account_id}/settings`, {
|
|
12304
|
+
body: { settings }
|
|
12305
|
+
}))
|
|
12596
12306
|
},
|
|
12597
12307
|
repos: (account_id) => wrap(async () => {
|
|
12598
12308
|
const res = await this.clients.media.get(`/connections/${account_id}/repos`);
|
|
@@ -12617,7 +12327,9 @@ var ApiClient2 = class {
|
|
|
12617
12327
|
query.to = params.to;
|
|
12618
12328
|
return this.clients.media.get(`/timeline/${user_id}`, Object.keys(query).length ? { query } : {});
|
|
12619
12329
|
}),
|
|
12620
|
-
getRaw: (user_id, platform, account_id) => wrap(() => this.clients.media.get(`/timeline/${user_id}/raw/${platform}`, {
|
|
12330
|
+
getRaw: (user_id, platform, account_id) => wrap(() => this.clients.media.get(`/timeline/${user_id}/raw/${platform}`, {
|
|
12331
|
+
query: { account_id }
|
|
12332
|
+
}))
|
|
12621
12333
|
}
|
|
12622
12334
|
};
|
|
12623
12335
|
this.user = {
|
|
@@ -12639,7 +12351,11 @@ var ApiClient2 = class {
|
|
|
12639
12351
|
const auth_base_url = base_url.replace(/\/v1\/?$/, "");
|
|
12640
12352
|
this.clients = {
|
|
12641
12353
|
auth: new ApiClient({ ...clientOptions, category: "auth" }),
|
|
12642
|
-
auth_root: new ApiClient({
|
|
12354
|
+
auth_root: new ApiClient({
|
|
12355
|
+
...clientOptions,
|
|
12356
|
+
base_url: auth_base_url,
|
|
12357
|
+
category: "auth"
|
|
12358
|
+
}),
|
|
12643
12359
|
projects: new ApiClient({ ...clientOptions, category: "projects" }),
|
|
12644
12360
|
tasks: new ApiClient({ ...clientOptions, category: "tasks" }),
|
|
12645
12361
|
milestones: new ApiClient({ ...clientOptions, category: "milestones" }),
|
|
@@ -12830,10 +12546,10 @@ var tools = {
|
|
|
12830
12546
|
id: exports_external.string().describe("Project ID")
|
|
12831
12547
|
}),
|
|
12832
12548
|
execute: async (client, input) => {
|
|
12833
|
-
const
|
|
12834
|
-
if (!
|
|
12549
|
+
const project = unwrap2(await client.projects.find(input.id));
|
|
12550
|
+
if (!project)
|
|
12835
12551
|
throw new Error(`Project ${input.id} not found`);
|
|
12836
|
-
unwrap2(await client.projects.deleteProject(
|
|
12552
|
+
unwrap2(await client.projects.deleteProject(project));
|
|
12837
12553
|
return { success: true };
|
|
12838
12554
|
}
|
|
12839
12555
|
},
|
|
@@ -12892,10 +12608,10 @@ var tools = {
|
|
|
12892
12608
|
id: exports_external.string().describe("Task ID")
|
|
12893
12609
|
}),
|
|
12894
12610
|
execute: async (client, input) => {
|
|
12895
|
-
const
|
|
12896
|
-
if (!
|
|
12611
|
+
const task = unwrap2(await client.tasks.find(input.id));
|
|
12612
|
+
if (!task)
|
|
12897
12613
|
throw new Error(`Task ${input.id} not found`);
|
|
12898
|
-
unwrap2(await client.tasks.deleteTask(
|
|
12614
|
+
unwrap2(await client.tasks.deleteTask(task));
|
|
12899
12615
|
return { success: true };
|
|
12900
12616
|
}
|
|
12901
12617
|
},
|
|
@@ -13059,8 +12775,8 @@ var tools = {
|
|
|
13059
12775
|
slug: exports_external.string().optional().describe("Profile slug")
|
|
13060
12776
|
}),
|
|
13061
12777
|
execute: async (client, input) => {
|
|
13062
|
-
const { id
|
|
13063
|
-
return unwrap2(await client.media.profiles.update(
|
|
12778
|
+
const { id, ...data } = input;
|
|
12779
|
+
return unwrap2(await client.media.profiles.update(id, data));
|
|
13064
12780
|
}
|
|
13065
12781
|
},
|
|
13066
12782
|
devpad_media_profiles_delete: {
|