@dereekb/dbx-components-mcp 13.36.0 → 13.38.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.
|
@@ -92,6 +92,46 @@
|
|
|
92
92
|
],
|
|
93
93
|
"example": "fields: {\n payload: firestorePassThroughField<MyType>()\n}"
|
|
94
94
|
},
|
|
95
|
+
{
|
|
96
|
+
"slug": "optional-firestore-passthrough-json-field",
|
|
97
|
+
"name": "optionalFirestorePassthroughJsonField",
|
|
98
|
+
"kind": "factory",
|
|
99
|
+
"category": "object",
|
|
100
|
+
"module": "@dereekb/firebase",
|
|
101
|
+
"subpath": "common/firestore/snapshot/snapshot.field",
|
|
102
|
+
"signature": "optionalFirestorePassthroughJsonField(config?: OptionalFirestorePassthroughJsonFieldConfig<T>): FirestoreModelFieldMapFunctionsConfig<Maybe<T>, Maybe<T>>",
|
|
103
|
+
"description": "Creates a field mapping configuration for an optional object field that is stored as-is, aside from\nthe values the filter strips out on the way in.\n\nThis is the field for json a converter should not model: a third-party api response, a request config\nwhose parameters the vendor extends without warning, an sdk-shaped payload. A strict converter would\nsilently drop whatever it does not name; this one keeps everything.\n\nThe one thing it does not keep is a value Firestore rejects. Firestore refuses an explicit `undefined`\noutright — one absent optional field anywhere in the payload fails the whole write — and such a value\nis exactly what assembling json from `Maybe` inputs produces (a usage object built from whichever\ntoken counts a response happened to report, a config a caller spread a `Maybe` into). Solved per-writer\nit has to be remembered at every call site; solved here it cannot be forgotten.\n\nThe filtering is RECURSIVE, since json of this kind is nested and its interior is just as capable of\ncarrying an `undefined` as its top level. Non-plain values are retained by reference, so a `Date` (or\na `Timestamp`, or a `DocumentReference`) survives the copy intact.\n\nFiltering happens on WRITE only. Reads are the plain passthrough — no copy, no traversal — since data\nthat came out of Firestore cannot contain the values being filtered in the first place.\n\nA top-level `null` still clears the field: {@link optionalFirestoreField} short-circuits `x == null`\nahead of the transform, so `update({ myField: null })` is untouched by this.",
|
|
104
|
+
"optional": true,
|
|
105
|
+
"params": [
|
|
106
|
+
{
|
|
107
|
+
"name": "config",
|
|
108
|
+
"type": "OptionalFirestorePassthroughJsonFieldConfig<T>",
|
|
109
|
+
"description": "- Filtering and storage configuration. Defaults to stripping `undefined` values at every depth.",
|
|
110
|
+
"optional": true
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"returns": "A field mapping configuration for optional passthrough json values.",
|
|
114
|
+
"tags": [
|
|
115
|
+
"json",
|
|
116
|
+
"passthrough",
|
|
117
|
+
"object",
|
|
118
|
+
"raw",
|
|
119
|
+
"optional",
|
|
120
|
+
"undefined",
|
|
121
|
+
"filter",
|
|
122
|
+
"recursive",
|
|
123
|
+
"factory",
|
|
124
|
+
"firestore",
|
|
125
|
+
"field",
|
|
126
|
+
"optionalfirestorepassthroughjsonfield"
|
|
127
|
+
],
|
|
128
|
+
"example": "fields: {\n // { model: 'm', temperature: undefined, provider: { only: ['openai'], sort: undefined } }\n // stores as { model: 'm', provider: { only: ['openai'] } }\n config: optionalFirestorePassthroughJsonField<MyVendorConfig>(),\n // store null rather than an empty object when nothing survives the filtering\n usage: optionalFirestorePassthroughJsonField<MyVendorUsage>({ filterEmptyValues: true, dontStoreIfEmpty: true })\n}",
|
|
129
|
+
"relatedSlugs": [
|
|
130
|
+
"optional-firestore-field",
|
|
131
|
+
"firestore-pass-through-field",
|
|
132
|
+
"firestore-sub-object"
|
|
133
|
+
]
|
|
134
|
+
},
|
|
95
135
|
{
|
|
96
136
|
"slug": "firestore-string",
|
|
97
137
|
"name": "firestoreString",
|
|
@@ -7081,6 +7081,88 @@
|
|
|
7081
7081
|
"object-keys-equality-comparator-function"
|
|
7082
7082
|
]
|
|
7083
7083
|
},
|
|
7084
|
+
{
|
|
7085
|
+
"slug": "copy-value-deep-function",
|
|
7086
|
+
"name": "copyValueDeepFunction",
|
|
7087
|
+
"kind": "factory",
|
|
7088
|
+
"category": "object",
|
|
7089
|
+
"module": "@dereekb/util",
|
|
7090
|
+
"subpath": "object/object.copy",
|
|
7091
|
+
"signature": "copyValueDeepFunction(config?: Maybe<CopyValueDeepConfig>): CopyValueDeepFunction",
|
|
7092
|
+
"description": "Creates a reusable {@link CopyValueDeepFunction}.\n\nPlain objects and arrays are copied recursively. Every other value is retained by reference:\nprimitives have nothing to copy, and a `Date`/`Map`/`Set`/class instance is a value in its own right,\nnot a bag of keys to rebuild — copying one key-by-key would replace a `Date` with `{}`. This is what\nmakes the function safe to use on data that carries such instances (a Firestore `Timestamp`, a\n`DocumentReference`) alongside plain json.\n\nThe root value itself is never filtered — only the values found within an object or array are, since\nthe filter is a decision about a key/value pair. A root `undefined` therefore copies to `undefined`.\n\nRepeated and cyclical references are tracked, so a value referenced twice is copied once and a cycle\nterminates rather than overflowing the stack.",
|
|
7093
|
+
"params": [
|
|
7094
|
+
{
|
|
7095
|
+
"name": "config",
|
|
7096
|
+
"type": "Maybe<CopyValueDeepConfig>",
|
|
7097
|
+
"description": "- Filter, array handling, and transform configuration. Defaults to removing `undefined` values.",
|
|
7098
|
+
"optional": true
|
|
7099
|
+
}
|
|
7100
|
+
],
|
|
7101
|
+
"returns": "Recursively copies any input value.",
|
|
7102
|
+
"tags": [
|
|
7103
|
+
"object",
|
|
7104
|
+
"copy",
|
|
7105
|
+
"clone",
|
|
7106
|
+
"deep",
|
|
7107
|
+
"recursive",
|
|
7108
|
+
"filter",
|
|
7109
|
+
"transform",
|
|
7110
|
+
"undefined",
|
|
7111
|
+
"factory",
|
|
7112
|
+
"value",
|
|
7113
|
+
"function",
|
|
7114
|
+
"copyvaluedeepfunction"
|
|
7115
|
+
],
|
|
7116
|
+
"example": "// remove undefined values at any depth\nconst copyFn = copyValueDeepFunction();\ncopyFn({ a: 1, b: undefined, c: { d: undefined, e: [1, undefined] } });\n// { a: 1, c: { e: [1] } }\n\n// remove null and undefined values, and prune anything left empty\nconst copyCleanFn = copyValueDeepFunction({ filter: KeyValueTypleValueFilter.NULL, filterEmptyValues: true });\ncopyCleanFn({ a: 1, b: { c: null } });\n// { a: 1 }",
|
|
7117
|
+
"relatedSlugs": [
|
|
7118
|
+
"copy-value-deep",
|
|
7119
|
+
"filter-from-pojo-function",
|
|
7120
|
+
"copy-object"
|
|
7121
|
+
]
|
|
7122
|
+
},
|
|
7123
|
+
{
|
|
7124
|
+
"slug": "copy-value-deep",
|
|
7125
|
+
"name": "copyValueDeep",
|
|
7126
|
+
"kind": "function",
|
|
7127
|
+
"category": "object",
|
|
7128
|
+
"module": "@dereekb/util",
|
|
7129
|
+
"subpath": "object/object.copy",
|
|
7130
|
+
"signature": "copyValueDeep(value: T, config?: Maybe<CopyValueDeepConfig>): T",
|
|
7131
|
+
"description": "Recursively copies a value, filtering values as it goes.\n\nSee {@link copyValueDeepFunction} for the copy/filter semantics. Prefer the factory when copying more\nthan one value with the same configuration.",
|
|
7132
|
+
"params": [
|
|
7133
|
+
{
|
|
7134
|
+
"name": "value",
|
|
7135
|
+
"type": "T",
|
|
7136
|
+
"description": "- The value to copy.",
|
|
7137
|
+
"optional": false
|
|
7138
|
+
},
|
|
7139
|
+
{
|
|
7140
|
+
"name": "config",
|
|
7141
|
+
"type": "Maybe<CopyValueDeepConfig>",
|
|
7142
|
+
"description": "- Filter, array handling, and transform configuration. Defaults to removing `undefined` values.",
|
|
7143
|
+
"optional": true
|
|
7144
|
+
}
|
|
7145
|
+
],
|
|
7146
|
+
"returns": "A recursive copy of the value.",
|
|
7147
|
+
"tags": [
|
|
7148
|
+
"object",
|
|
7149
|
+
"copy",
|
|
7150
|
+
"clone",
|
|
7151
|
+
"deep",
|
|
7152
|
+
"recursive",
|
|
7153
|
+
"filter",
|
|
7154
|
+
"transform",
|
|
7155
|
+
"undefined",
|
|
7156
|
+
"value",
|
|
7157
|
+
"copyvaluedeep"
|
|
7158
|
+
],
|
|
7159
|
+
"example": "copyValueDeep({ a: 1, b: { c: undefined } });\n// { a: 1, b: {} }",
|
|
7160
|
+
"relatedSlugs": [
|
|
7161
|
+
"copy-value-deep-function",
|
|
7162
|
+
"filter-from-pojo",
|
|
7163
|
+
"copy-object"
|
|
7164
|
+
]
|
|
7165
|
+
},
|
|
7084
7166
|
{
|
|
7085
7167
|
"slug": "object-is-empty",
|
|
7086
7168
|
"name": "objectIsEmpty",
|
|
@@ -7970,6 +8052,39 @@
|
|
|
7970
8052
|
"maptoobject"
|
|
7971
8053
|
]
|
|
7972
8054
|
},
|
|
8055
|
+
{
|
|
8056
|
+
"slug": "is-plain-object",
|
|
8057
|
+
"name": "isPlainObject",
|
|
8058
|
+
"kind": "function",
|
|
8059
|
+
"category": "object",
|
|
8060
|
+
"module": "@dereekb/util",
|
|
8061
|
+
"subpath": "object/object",
|
|
8062
|
+
"signature": "isPlainObject(value: unknown): value is Record<string, unknown>",
|
|
8063
|
+
"description": "Checks whether the value is a \"plain\" object, meaning an object literal or an object created with a\nnull prototype.\n\nArrays, `Date`, `RegExp`, `Map`, `Set`, and class instances are NOT plain objects. This is the check\nto use before recursing into a value's keys: a class instance's keys are an implementation detail and\ncopying them key-by-key produces a lifeless imitation of the original (a `Date` becomes `{}`).",
|
|
8064
|
+
"params": [
|
|
8065
|
+
{
|
|
8066
|
+
"name": "value",
|
|
8067
|
+
"type": "unknown",
|
|
8068
|
+
"description": "- The value to check.",
|
|
8069
|
+
"optional": false
|
|
8070
|
+
}
|
|
8071
|
+
],
|
|
8072
|
+
"returns": "`true` if the value is an object literal or has a null prototype.",
|
|
8073
|
+
"tags": [
|
|
8074
|
+
"object",
|
|
8075
|
+
"pojo",
|
|
8076
|
+
"plain",
|
|
8077
|
+
"literal",
|
|
8078
|
+
"type-guard",
|
|
8079
|
+
"check",
|
|
8080
|
+
"is",
|
|
8081
|
+
"isplainobject"
|
|
8082
|
+
],
|
|
8083
|
+
"relatedSlugs": [
|
|
8084
|
+
"object-has-no-keys",
|
|
8085
|
+
"copy-value-deep"
|
|
8086
|
+
]
|
|
8087
|
+
},
|
|
7973
8088
|
{
|
|
7974
8089
|
"slug": "copy-object",
|
|
7975
8090
|
"name": "copyObject",
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/dbx-components-mcp",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.38.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"dbx-components-mcp": "dbx-components-mcp.js"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@modelcontextprotocol/
|
|
9
|
+
"@modelcontextprotocol/server": "^2.0.0",
|
|
10
10
|
"arktype": "^2.2.0",
|
|
11
11
|
"ts-morph": "^21.0.0"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@dereekb/dbx-cli": "13.
|
|
15
|
-
"@dereekb/util": "13.
|
|
14
|
+
"@dereekb/dbx-cli": "13.38.0",
|
|
15
|
+
"@dereekb/util": "13.38.0"
|
|
16
16
|
}
|
|
17
17
|
}
|