@0xtorch/csv 0.0.92 → 0.0.93
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/_cjs/parseRowsToActions/parse.js +10 -1
- package/_cjs/parseRowsToActions/parse.js.map +1 -1
- package/_cjs/schemas/parser.js +1 -1
- package/_cjs/schemas/parser.js.map +1 -1
- package/_esm/parseRowsToActions/parse.js +10 -1
- package/_esm/parseRowsToActions/parse.js.map +1 -1
- package/_esm/schemas/parser.js +1 -1
- package/_esm/schemas/parser.js.map +1 -1
- package/_types/parseRowsToActions/parse.d.ts.map +1 -1
- package/_types/schemas/format.d.ts +53 -9
- package/_types/schemas/format.d.ts.map +1 -1
- package/_types/schemas/parser.d.ts +76 -12
- package/_types/schemas/parser.d.ts.map +1 -1
- package/package.json +1 -1
- package/parseRowsToActions/parse.ts +14 -1
- package/schemas/parser.ts +1 -1
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type Action,
|
|
3
|
+
type ActionCrossType,
|
|
3
4
|
type ActionEvidence,
|
|
4
5
|
type ActionType,
|
|
5
6
|
type CryptoCurrency,
|
|
@@ -106,6 +107,15 @@ export const parseRowsToActionsByParser = ({
|
|
|
106
107
|
: stringify(
|
|
107
108
|
getAllValue({ schema: generator.crossId, rows, service, fileId }),
|
|
108
109
|
)
|
|
110
|
+
const crossType =
|
|
111
|
+
generator.crossType === undefined
|
|
112
|
+
? undefined
|
|
113
|
+
: typeof generator.crossType === 'string'
|
|
114
|
+
? generator.crossType
|
|
115
|
+
: stringify(getCellValue({ schema: generator.crossType, rows }))
|
|
116
|
+
if (crossType !== undefined && !isActionCrossType(crossType)) {
|
|
117
|
+
continue
|
|
118
|
+
}
|
|
109
119
|
const loanId =
|
|
110
120
|
generator.loanId === undefined
|
|
111
121
|
? undefined
|
|
@@ -141,7 +151,7 @@ export const parseRowsToActionsByParser = ({
|
|
|
141
151
|
}),
|
|
142
152
|
),
|
|
143
153
|
crossId,
|
|
144
|
-
crossType
|
|
154
|
+
crossType,
|
|
145
155
|
loanId,
|
|
146
156
|
target:
|
|
147
157
|
target === undefined || target.type !== 'Nft' ? undefined : target,
|
|
@@ -161,3 +171,6 @@ const isActionEvidence = (value: string): value is ActionEvidence =>
|
|
|
161
171
|
['contract', 'system-rule', 'user-rule', 'manual-check', 'none'].includes(
|
|
162
172
|
value,
|
|
163
173
|
)
|
|
174
|
+
|
|
175
|
+
const isActionCrossType = (value: string): value is ActionCrossType =>
|
|
176
|
+
['start', 'middle', 'end'].includes(value)
|
package/schemas/parser.ts
CHANGED
|
@@ -208,7 +208,7 @@ const generatorSchema = z.object({
|
|
|
208
208
|
comment: allValueSchema.optional(),
|
|
209
209
|
app: allValueSchema.optional(),
|
|
210
210
|
crossId: allValueSchema.optional(),
|
|
211
|
-
crossType: actionCrossTypeUnionSchema.optional(),
|
|
211
|
+
crossType: z.union([actionCrossTypeUnionSchema, cellValueSchema]).optional(),
|
|
212
212
|
loanId: allValueSchema.optional(),
|
|
213
213
|
target: assetIdSchema.optional(),
|
|
214
214
|
transfers: z.array(transferComponentSchema),
|