@0xtorch/csv 0.0.59 → 0.0.61

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xtorch/csv",
3
- "version": "0.0.59",
3
+ "version": "0.0.61",
4
4
  "description": "Cryptorch CSV extension",
5
5
  "keywords": [
6
6
  "cryptorch",
@@ -35,7 +35,7 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@0xtorch/big-decimal": "^0.0.13",
38
- "@0xtorch/core": "^0.0.60",
38
+ "@0xtorch/core": "^0.0.61",
39
39
  "encoding-japanese": "^2.1.0",
40
40
  "papaparse": "^5.4.1",
41
41
  "xlsx": "^0.18.5",
@@ -85,7 +85,7 @@ export const parseRowsToActionsByParser = ({
85
85
  order: 0,
86
86
  type: generator.type,
87
87
  timestamp,
88
- evidence: 'system-rule',
88
+ evidence: generator.evidence ?? 'system-rule',
89
89
  comment,
90
90
  app,
91
91
  transfers: generator.transfers.flatMap((transfer) =>
@@ -52,23 +52,26 @@ export const iso8601JpTextSchema = z
52
52
  export const datetimeJpTextSchema = z
53
53
  .string()
54
54
  .regex(
55
- /^\d{1,4}\/\d{1,2}\/\d{1,4}( \d{1,2}:\d{1,2}(:\d{1,2})?(\.\d{1,3})?)?$/,
55
+ /^\d{1,4}\/\d{1,2}\/\d{1,4}( \d{1,2}:\d{1,2}(:\d{1,2})?(\.\d{1,3})?)?( JST)?$/,
56
56
  )
57
57
  .transform((v) => {
58
- const [datePart, timePart] = v.split(' ')
58
+ const [datePart, ...otherParts] = v.split(' ')
59
+ const otherPart = otherParts.join(' ')
59
60
 
60
61
  // Only date
61
- if (timePart === undefined) {
62
+ if (otherPart === '') {
62
63
  return new Date(`${datePart} 00:00+09:00`).getTime()
63
64
  }
64
65
 
65
66
  const [a, b, c] = datePart.split('/')
66
67
  // Rakuten wallet date format
67
68
  if (a.length === 2 && c.length === 2 && Number(a) > 12) {
68
- return new Date(`20${a}/${b}/${c} ${timePart}+09:00`).getTime()
69
+ return new Date(
70
+ `20${a}/${b}/${c} ${otherPart.replace(' JST', '')}+09:00`,
71
+ ).getTime()
69
72
  }
70
73
 
71
- return new Date(`${v}+09:00`).getTime()
74
+ return new Date(`${v.replace(' JST', '')}+09:00`).getTime()
72
75
  })
73
76
 
74
77
  export const formatterValueSchema = z.union([
package/schemas/parser.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  actionCrossTypeUnionSchema,
3
+ actionEvidenceUnionSchema,
3
4
  actionTypeUnionSchema,
4
5
  } from '@0xtorch/core'
5
6
  import { z } from 'zod'
@@ -193,6 +194,7 @@ export const transferComponentSchema = z.object({
193
194
  const generatorSchema = z.object({
194
195
  type: actionTypeUnionSchema,
195
196
  source: allValueSchema,
197
+ evidence: actionEvidenceUnionSchema.optional(),
196
198
  timestamp: cellValueSchema,
197
199
  comment: allValueSchema.optional(),
198
200
  app: allValueSchema.optional(),