@simplysm/sd-claude 14.0.47 → 14.0.49

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.
Files changed (130) hide show
  1. package/{claude/references/sd-simplysm14/sd-claude/usage.md → README.md} +2 -2
  2. package/claude/rules/sd-claude-rules.md +25 -10
  3. package/claude/rules/sd-options.md +11 -6
  4. package/claude/sd-subagent-start.sh +6 -0
  5. package/claude/settings.json +1 -12
  6. package/claude/skills/sd-check/SKILL.md +43 -12
  7. package/claude/skills/sd-claude-docs/SKILL.md +30 -58
  8. package/claude/skills/sd-claude-docs/references/package-claudemd.md +12 -0
  9. package/claude/skills/sd-claude-docs/references/package-doc-gen.md +26 -13
  10. package/claude/skills/sd-commit/SKILL.md +1 -1
  11. package/claude/skills/sd-debug/SKILL.md +5 -3
  12. package/claude/skills/sd-deliverable/SKILL.md +1 -1
  13. package/claude/skills/sd-dev/SKILL.md +14 -9
  14. package/claude/skills/sd-doc-extract/SKILL.md +8 -10
  15. package/claude/skills/sd-doc-extract/_common.py +8 -1
  16. package/claude/skills/sd-doc-extract/_extract_docx.py +74 -34
  17. package/claude/skills/sd-doc-extract/_extract_pdf.py +12 -1
  18. package/claude/skills/sd-doc-extract/_extract_pptx.py +103 -23
  19. package/claude/skills/sd-doc-extract/_extract_xlsb.py +93 -4
  20. package/claude/skills/sd-doc-extract/_extract_xlsx.py +98 -36
  21. package/claude/skills/sd-doc-extract/extract.py +22 -3
  22. package/claude/skills/sd-inner-clarify/SKILL.md +78 -0
  23. package/claude/skills/sd-inner-debug/SKILL.md +1 -1
  24. package/claude/skills/sd-inner-review/SKILL.md +13 -0
  25. package/claude/skills/sd-issue/SKILL.md +1 -1
  26. package/claude/skills/sd-outlook/SKILL.md +1 -1
  27. package/claude/skills/sd-plan/SKILL.md +50 -17
  28. package/claude/skills/sd-prompt/SKILL.md +180 -178
  29. package/claude/skills/sd-prompt/references/eval-runner.md +5 -30
  30. package/claude/skills/sd-prompt/references/sd-eval-env-template.md +23 -0
  31. package/claude/skills/sd-refactor/SKILL.md +2 -2
  32. package/claude/skills/sd-tdd/SKILL.md +45 -16
  33. package/claude/skills/sd-use/SKILL.md +84 -80
  34. package/claude/skills/sd-wbs/SKILL.md +84 -27
  35. package/{claude/references/sd-simplysm14/sd-claude/docs → docs}/assets.md +2 -3
  36. package/{claude/references/sd-simplysm14/sd-claude/docs → docs}/hooks.md +7 -6
  37. package/{claude/references/sd-simplysm14/sd-claude/docs → docs}/scripts.md +1 -9
  38. package/package.json +3 -2
  39. package/scripts/sync.mjs +4 -2
  40. package/claude/references/sd-simplysm14/angular/docs/bootstrap.md +0 -48
  41. package/claude/references/sd-simplysm14/angular/docs/directives.md +0 -236
  42. package/claude/references/sd-simplysm14/angular/docs/features.md +0 -379
  43. package/claude/references/sd-simplysm14/angular/docs/pipes.md +0 -32
  44. package/claude/references/sd-simplysm14/angular/docs/plugins.md +0 -37
  45. package/claude/references/sd-simplysm14/angular/docs/provider-types.md +0 -283
  46. package/claude/references/sd-simplysm14/angular/docs/providers.md +0 -379
  47. package/claude/references/sd-simplysm14/angular/docs/styling.md +0 -222
  48. package/claude/references/sd-simplysm14/angular/docs/type-utilities.md +0 -250
  49. package/claude/references/sd-simplysm14/angular/docs/ui-data.md +0 -275
  50. package/claude/references/sd-simplysm14/angular/docs/ui-form.md +0 -490
  51. package/claude/references/sd-simplysm14/angular/docs/ui-layout.md +0 -140
  52. package/claude/references/sd-simplysm14/angular/docs/ui-navigation.md +0 -273
  53. package/claude/references/sd-simplysm14/angular/docs/ui-overlay.md +0 -157
  54. package/claude/references/sd-simplysm14/angular/docs/ui-visual.md +0 -127
  55. package/claude/references/sd-simplysm14/angular/docs/utils.md +0 -295
  56. package/claude/references/sd-simplysm14/angular/usage.md +0 -489
  57. package/claude/references/sd-simplysm14/capacitor-plugin-auto-update/usage.md +0 -182
  58. package/claude/references/sd-simplysm14/capacitor-plugin-file-system/docs/file-operations.md +0 -154
  59. package/claude/references/sd-simplysm14/capacitor-plugin-file-system/docs/permissions.md +0 -84
  60. package/claude/references/sd-simplysm14/capacitor-plugin-file-system/docs/storage-paths.md +0 -107
  61. package/claude/references/sd-simplysm14/capacitor-plugin-file-system/docs/types.md +0 -83
  62. package/claude/references/sd-simplysm14/capacitor-plugin-file-system/usage.md +0 -133
  63. package/claude/references/sd-simplysm14/capacitor-plugin-intent/usage.md +0 -203
  64. package/claude/references/sd-simplysm14/capacitor-plugin-usb-storage/usage.md +0 -258
  65. package/claude/references/sd-simplysm14/core-browser/usage.md +0 -306
  66. package/claude/references/sd-simplysm14/core-common/docs/errors.md +0 -82
  67. package/claude/references/sd-simplysm14/core-common/docs/extensions.md +0 -167
  68. package/claude/references/sd-simplysm14/core-common/docs/features.md +0 -136
  69. package/claude/references/sd-simplysm14/core-common/docs/types.md +0 -245
  70. package/claude/references/sd-simplysm14/core-common/docs/utils.md +0 -591
  71. package/claude/references/sd-simplysm14/core-common/usage.md +0 -255
  72. package/claude/references/sd-simplysm14/core-node/docs/child-process.md +0 -182
  73. package/claude/references/sd-simplysm14/core-node/docs/features.md +0 -214
  74. package/claude/references/sd-simplysm14/core-node/docs/file-system.md +0 -509
  75. package/claude/references/sd-simplysm14/core-node/docs/file-watching.md +0 -139
  76. package/claude/references/sd-simplysm14/core-node/docs/logging.md +0 -180
  77. package/claude/references/sd-simplysm14/core-node/docs/path.md +0 -176
  78. package/claude/references/sd-simplysm14/core-node/docs/utilities-cpx.md +0 -194
  79. package/claude/references/sd-simplysm14/core-node/docs/utilities-fsx.md +0 -469
  80. package/claude/references/sd-simplysm14/core-node/docs/utilities-pathx.md +0 -151
  81. package/claude/references/sd-simplysm14/core-node/docs/worker-threads.md +0 -334
  82. package/claude/references/sd-simplysm14/core-node/docs/worker.md +0 -205
  83. package/claude/references/sd-simplysm14/core-node/usage.md +0 -259
  84. package/claude/references/sd-simplysm14/excel/docs/core-classes.md +0 -453
  85. package/claude/references/sd-simplysm14/excel/docs/types.md +0 -459
  86. package/claude/references/sd-simplysm14/excel/docs/utilities.md +0 -194
  87. package/claude/references/sd-simplysm14/excel/docs/wrapper.md +0 -73
  88. package/claude/references/sd-simplysm14/excel/usage.md +0 -134
  89. package/claude/references/sd-simplysm14/lint/usage.md +0 -130
  90. package/claude/references/sd-simplysm14/orm-common/docs/core.md +0 -188
  91. package/claude/references/sd-simplysm14/orm-common/docs/expression.md +0 -190
  92. package/claude/references/sd-simplysm14/orm-common/docs/models.md +0 -17
  93. package/claude/references/sd-simplysm14/orm-common/docs/query-builder.md +0 -97
  94. package/claude/references/sd-simplysm14/orm-common/docs/queryable-executable.md +0 -250
  95. package/claude/references/sd-simplysm14/orm-common/docs/schema-builders.md +0 -364
  96. package/claude/references/sd-simplysm14/orm-common/docs/types.md +0 -522
  97. package/claude/references/sd-simplysm14/orm-common/usage.md +0 -229
  98. package/claude/references/sd-simplysm14/orm-node/docs/connections.md +0 -137
  99. package/claude/references/sd-simplysm14/orm-node/docs/core.md +0 -131
  100. package/claude/references/sd-simplysm14/orm-node/docs/types.md +0 -173
  101. package/claude/references/sd-simplysm14/orm-node/usage.md +0 -143
  102. package/claude/references/sd-simplysm14/sd-cli/usage.md +0 -782
  103. package/claude/references/sd-simplysm14/service-client/docs/features.md +0 -217
  104. package/claude/references/sd-simplysm14/service-client/docs/main.md +0 -148
  105. package/claude/references/sd-simplysm14/service-client/docs/protocol.md +0 -53
  106. package/claude/references/sd-simplysm14/service-client/docs/transport.md +0 -131
  107. package/claude/references/sd-simplysm14/service-client/docs/types.md +0 -129
  108. package/claude/references/sd-simplysm14/service-client/usage.md +0 -202
  109. package/claude/references/sd-simplysm14/service-common/docs/app-structure.md +0 -175
  110. package/claude/references/sd-simplysm14/service-common/docs/events.md +0 -64
  111. package/claude/references/sd-simplysm14/service-common/docs/protocol.md +0 -331
  112. package/claude/references/sd-simplysm14/service-common/docs/service-types.md +0 -90
  113. package/claude/references/sd-simplysm14/service-common/docs/types.md +0 -19
  114. package/claude/references/sd-simplysm14/service-common/usage.md +0 -154
  115. package/claude/references/sd-simplysm14/service-server/docs/auth.md +0 -64
  116. package/claude/references/sd-simplysm14/service-server/docs/core.md +0 -174
  117. package/claude/references/sd-simplysm14/service-server/docs/legacy.md +0 -25
  118. package/claude/references/sd-simplysm14/service-server/docs/main.md +0 -88
  119. package/claude/references/sd-simplysm14/service-server/docs/protocol.md +0 -33
  120. package/claude/references/sd-simplysm14/service-server/docs/services.md +0 -94
  121. package/claude/references/sd-simplysm14/service-server/docs/transport-http.md +0 -93
  122. package/claude/references/sd-simplysm14/service-server/docs/transport-socket.md +0 -119
  123. package/claude/references/sd-simplysm14/service-server/docs/types.md +0 -36
  124. package/claude/references/sd-simplysm14/service-server/docs/utils.md +0 -22
  125. package/claude/references/sd-simplysm14/service-server/usage.md +0 -171
  126. package/claude/references/sd-simplysm14/storage/usage.md +0 -301
  127. package/claude/references/sd-simplysm14.md +0 -35
  128. package/claude/rules/sd-clarify.md +0 -23
  129. package/claude/sd-session-start.sh +0 -10
  130. /package/{claude/references/sd-simplysm14/sd-claude/docs → docs}/cli.md +0 -0
@@ -1,203 +0,0 @@
1
- # @simplysm/capacitor-plugin-intent
2
-
3
- Capacitor Intent 플러그인. 브로드캐스트 송수신, 실행 인텐트 조회, 새 인텐트 이벤트 수신, `startActivityForResult`를 제공한다. 산업용 디바이스 연동(바코드 스캐너, PDA 등)을 위해 설계되었다.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install @simplysm/capacitor-plugin-intent
9
- ```
10
-
11
- ## API Overview
12
-
13
- ### 인텐트
14
-
15
- | API | Type | Description |
16
- |-----|------|-------------|
17
- | `IntentResult` | interface | 브로드캐스트/인텐트 결과 데이터 |
18
- | `StartActivityForResultOptions` | interface | startActivityForResult 호출 옵션 |
19
- | `StartActivityForResultResult` | interface | startActivityForResult 반환 결과 |
20
- | `IntentPlugin` | interface | Capacitor 네이티브 플러그인 인터페이스 |
21
- | `Intent` | abstract class | 인텐트 플러그인 정적 파사드 |
22
-
23
- ---
24
-
25
- ## `IntentResult`
26
-
27
- 브로드캐스트 또는 인텐트 결과 데이터를 나타내는 인터페이스.
28
-
29
- ```typescript
30
- export interface IntentResult {
31
- action?: string;
32
- extras?: Record<string, unknown>;
33
- }
34
- ```
35
-
36
- | Field | Type | Description |
37
- |-------|------|-------------|
38
- | `action` | `string \| undefined` | 브로드캐스트 액션 |
39
- | `extras` | `Record<string, unknown> \| undefined` | 추가 데이터 |
40
-
41
- ## `StartActivityForResultOptions`
42
-
43
- `startActivityForResult` 호출 시 전달하는 옵션 인터페이스.
44
-
45
- ```typescript
46
- export interface StartActivityForResultOptions {
47
- action?: string;
48
- uri?: string;
49
- extras?: Record<string, unknown>;
50
- type?: string;
51
- packageName?: string;
52
- className?: string;
53
- flags?: number;
54
- }
55
- ```
56
-
57
- | Field | Type | Description |
58
- |-------|------|-------------|
59
- | `action` | `string \| undefined` | Intent 액션 |
60
- | `uri` | `string \| undefined` | Intent 데이터 URI |
61
- | `extras` | `Record<string, unknown> \| undefined` | 추가 데이터 |
62
- | `type` | `string \| undefined` | MIME type |
63
- | `packageName` | `string \| undefined` | 특정 앱 지정 |
64
- | `className` | `string \| undefined` | 특정 Activity 지정 |
65
- | `flags` | `number \| undefined` | Intent flags |
66
-
67
- ## `StartActivityForResultResult`
68
-
69
- `startActivityForResult` 호출의 반환 결과 인터페이스.
70
-
71
- ```typescript
72
- export interface StartActivityForResultResult {
73
- resultCode: number;
74
- data?: {
75
- action?: string;
76
- uri?: string;
77
- extras?: Record<string, unknown>;
78
- };
79
- }
80
- ```
81
-
82
- | Field | Type | Description |
83
- |-------|------|-------------|
84
- | `resultCode` | `number` | 결과 코드 (`-1`: RESULT_OK, `0`: RESULT_CANCELED) |
85
- | `data` | `object \| undefined` | 결과 데이터 |
86
- | `data.action` | `string \| undefined` | 결과 인텐트 액션 |
87
- | `data.uri` | `string \| undefined` | 결과 인텐트 데이터 URI |
88
- | `data.extras` | `Record<string, unknown> \| undefined` | 결과 인텐트 추가 데이터 |
89
-
90
- ## `IntentPlugin`
91
-
92
- Capacitor 네이티브 플러그인 인터페이스. 직접 사용하지 않고 `Intent` 파사드를 통해 접근한다.
93
-
94
- ```typescript
95
- export interface IntentPlugin {
96
- subscribe(
97
- options: { filters: string[] },
98
- callback: (result: IntentResult) => void,
99
- ): Promise<{ id: string }>;
100
- unsubscribe(options: { id: string }): Promise<void>;
101
- unsubscribeAll(): Promise<void>;
102
- send(options: { action: string; extras?: Record<string, unknown> }): Promise<void>;
103
- getLaunchIntent(): Promise<IntentResult>;
104
- addListener(
105
- eventName: "newIntent",
106
- listenerFunc: (data: IntentResult) => void,
107
- ): Promise<PluginListenerHandle>;
108
- removeAllListeners(): Promise<void>;
109
- startActivityForResult(
110
- options: StartActivityForResultOptions,
111
- ): Promise<StartActivityForResultResult>;
112
- }
113
- ```
114
-
115
- | Method | Parameters | Return | Description |
116
- |--------|-----------|--------|-------------|
117
- | `subscribe` | `{ filters }, callback` | `Promise<{ id: string }>` | 브로드캐스트 수신기 등록 |
118
- | `unsubscribe` | `{ id }` | `Promise<void>` | 특정 수신기 구독 해제 |
119
- | `unsubscribeAll` | 없음 | `Promise<void>` | 모든 수신기 구독 해제 |
120
- | `send` | `{ action, extras? }` | `Promise<void>` | 브로드캐스트 전송 |
121
- | `getLaunchIntent` | 없음 | `Promise<IntentResult>` | 실행 인텐트 조회 |
122
- | `addListener` | `"newIntent", listenerFunc` | `Promise<PluginListenerHandle>` | 새 인텐트 이벤트 리스너 등록 |
123
- | `removeAllListeners` | 없음 | `Promise<void>` | 모든 이벤트 리스너 제거 |
124
- | `startActivityForResult` | `options` | `Promise<StartActivityForResultResult>` | 외부 Activity 실행 후 결과 수신 |
125
-
126
- ## `Intent`
127
-
128
- Android 인텐트 플러그인 정적 파사드 클래스. 브로드캐스트 송수신, 실행 인텐트 조회, 산업용 디바이스 연동을 위한 기능을 제공한다.
129
-
130
- ```typescript
131
- export abstract class Intent {
132
- static async subscribe(
133
- filters: string[],
134
- callback: (result: IntentResult) => void,
135
- ): Promise<() => Promise<void>>;
136
- static async unsubscribeAll(): Promise<void>;
137
- static async send(options: { action: string; extras?: Record<string, unknown> }): Promise<void>;
138
- static async getLaunchIntent(): Promise<IntentResult>;
139
- static async addListener(
140
- eventName: "newIntent",
141
- callback: (result: IntentResult) => void,
142
- ): Promise<PluginListenerHandle>;
143
- static async removeAllListeners(): Promise<void>;
144
- static async startActivityForResult(
145
- options: StartActivityForResultOptions,
146
- ): Promise<StartActivityForResultResult>;
147
- }
148
- ```
149
-
150
- | Method | Parameters | Return | Description |
151
- |--------|-----------|--------|-------------|
152
- | `subscribe` | `filters: string[], callback` | `Promise<() => Promise<void>>` | 브로드캐스트 수신기 등록. 구독 해제 함수를 반환한다. 초기 resolve 콜백(`action == null`)은 자동 필터링된다. |
153
- | `unsubscribeAll` | 없음 | `Promise<void>` | 모든 브로드캐스트 수신기 구독 해제 |
154
- | `send` | `{ action, extras? }` | `Promise<void>` | 브로드캐스트 전송 |
155
- | `getLaunchIntent` | 없음 | `Promise<IntentResult>` | 앱 실행 인텐트 조회 |
156
- | `addListener` | `"newIntent", callback` | `Promise<PluginListenerHandle>` | 앱 실행 중 수신되는 새 인텐트 이벤트 리스너 등록. `handle.remove()`로 해제한다. |
157
- | `removeAllListeners` | 없음 | `Promise<void>` | 모든 이벤트 리스너 제거 |
158
- | `startActivityForResult` | `options: StartActivityForResultOptions` | `Promise<StartActivityForResultResult>` | 외부 Activity를 실행하고 결과를 수신한다 |
159
-
160
- ## Usage Examples
161
-
162
- ### 브로드캐스트 수신 (바코드 스캐너 연동)
163
-
164
- ```typescript
165
- import { Intent } from "@simplysm/capacitor-plugin-intent";
166
-
167
- const unsub = await Intent.subscribe(
168
- ["com.symbol.datawedge.api.RESULT_ACTION"],
169
- (result) => {
170
- // result.extras에서 스캔 데이터 처리
171
- },
172
- );
173
-
174
- // 구독 해제
175
- await unsub();
176
- ```
177
-
178
- ### 브로드캐스트 전송
179
-
180
- ```typescript
181
- import { Intent } from "@simplysm/capacitor-plugin-intent";
182
-
183
- await Intent.send({
184
- action: "com.symbol.datawedge.api.ACTION",
185
- extras: {
186
- "com.symbol.datawedge.api.SOFT_SCAN_TRIGGER": "TOGGLE_SCANNING",
187
- },
188
- });
189
- ```
190
-
191
- ### startActivityForResult
192
-
193
- ```typescript
194
- import { Intent } from "@simplysm/capacitor-plugin-intent";
195
-
196
- const result = await Intent.startActivityForResult({
197
- action: "com.example.PAY",
198
- extras: { amount: 1000 },
199
- });
200
- if (result.resultCode === -1) {
201
- // RESULT_OK
202
- }
203
- ```
@@ -1,258 +0,0 @@
1
- # @simplysm/capacitor-plugin-usb-storage
2
-
3
- Capacitor USB 저장소 플러그인. Android에서 libaums 라이브러리를 통해 USB Mass Storage 장치를 열거하고 파일을 읽는다. 브라우저에서는 IndexedDB 기반 가상 USB 저장소로 에뮬레이션한다.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install @simplysm/capacitor-plugin-usb-storage
9
- ```
10
-
11
- ## API Overview
12
-
13
- ### USB 저장소 - 공개 API
14
-
15
- | API | Type | Description |
16
- |-----|------|-------------|
17
- | `UsbDeviceInfo` | interface | USB 장치 정보 (이름, 제조사, vendorId 등) |
18
- | `UsbDeviceFilter` | interface | USB 장치 필터 (vendorId + productId) |
19
- | `UsbFileInfo` | interface | USB 저장소 내 파일/디렉토리 정보 |
20
- | `UsbStoragePlugin` | interface | Capacitor 네이티브 플러그인 인터페이스 |
21
- | `UsbStorage` | abstract class | USB 저장 장치 접근 정적 파사드 |
22
-
23
- ---
24
-
25
- ## `UsbDeviceInfo`
26
-
27
- 연결된 USB 장치 정보를 나타내는 인터페이스.
28
-
29
- ```typescript
30
- export interface UsbDeviceInfo {
31
- deviceName: string;
32
- manufacturerName: string;
33
- productName: string;
34
- vendorId: number;
35
- productId: number;
36
- }
37
- ```
38
-
39
- | Field | Type | Description |
40
- |-------|------|-------------|
41
- | `deviceName` | `string` | 장치 이름 |
42
- | `manufacturerName` | `string` | 제조사 이름 |
43
- | `productName` | `string` | 제품 이름 |
44
- | `vendorId` | `number` | USB Vendor ID |
45
- | `productId` | `number` | USB Product ID |
46
-
47
- ## `UsbDeviceFilter`
48
-
49
- USB 장치를 식별하기 위한 필터 인터페이스. 모든 장치 접근 메서드의 첫 번째 파라미터로 사용된다.
50
-
51
- ```typescript
52
- export interface UsbDeviceFilter {
53
- vendorId: number;
54
- productId: number;
55
- }
56
- ```
57
-
58
- | Field | Type | Description |
59
- |-------|------|-------------|
60
- | `vendorId` | `number` | USB Vendor ID |
61
- | `productId` | `number` | USB Product ID |
62
-
63
- ## `UsbFileInfo`
64
-
65
- USB 저장소 내 파일 또는 디렉토리 정보를 나타내는 인터페이스.
66
-
67
- ```typescript
68
- export interface UsbFileInfo {
69
- name: string;
70
- isDirectory: boolean;
71
- }
72
- ```
73
-
74
- | Field | Type | Description |
75
- |-------|------|-------------|
76
- | `name` | `string` | 파일 또는 디렉토리 이름 |
77
- | `isDirectory` | `boolean` | 디렉토리 여부 |
78
-
79
- ## `UsbStoragePlugin`
80
-
81
- Capacitor 네이티브 플러그인 인터페이스. 직접 사용하지 않고 `UsbStorage` 파사드를 통해 접근한다.
82
-
83
- ```typescript
84
- export interface UsbStoragePlugin {
85
- getDevices(): Promise<{ devices: UsbDeviceInfo[] }>;
86
- requestPermissions(options: UsbDeviceFilter): Promise<{ granted: boolean }>;
87
- checkPermissions(options: UsbDeviceFilter): Promise<{ granted: boolean }>;
88
- readdir(options: UsbDeviceFilter & { path: string }): Promise<{ files: UsbFileInfo[] }>;
89
- readFile(options: UsbDeviceFilter & { path: string }): Promise<{ data: string | null }>;
90
- }
91
- ```
92
-
93
- | Method | Parameters | Return | Description |
94
- |--------|-----------|--------|-------------|
95
- | `getDevices` | 없음 | `Promise<{ devices: UsbDeviceInfo[] }>` | 연결된 USB 장치 목록 조회 |
96
- | `requestPermissions` | `UsbDeviceFilter` | `Promise<{ granted: boolean }>` | USB 장치 접근 권한 요청 |
97
- | `checkPermissions` | `UsbDeviceFilter` | `Promise<{ granted: boolean }>` | USB 장치 접근 권한 확인 |
98
- | `readdir` | `UsbDeviceFilter & { path }` | `Promise<{ files: UsbFileInfo[] }>` | 디렉토리 내용 읽기 |
99
- | `readFile` | `UsbDeviceFilter & { path }` | `Promise<{ data: string \| null }>` | 파일 읽기 (Base64). 파일이 없으면 `null` |
100
-
101
- ## `UsbStorage`
102
-
103
- USB 저장 장치 접근 정적 파사드 클래스. Android에서는 libaums를 통해 USB Mass Storage에 접근하고, 브라우저에서는 IndexedDB 기반으로 에뮬레이션된다.
104
-
105
- `readFile()`의 반환 타입 `Bytes`는 `@simplysm/core-common`의 타입이다 (`Uint8Array` 별칭).
106
-
107
- ```typescript
108
- export abstract class UsbStorage {
109
- static async getDevices(): Promise<UsbDeviceInfo[]>;
110
- static async requestPermissions(filter: UsbDeviceFilter): Promise<boolean>;
111
- static async checkPermissions(filter: UsbDeviceFilter): Promise<boolean>;
112
- static async readdir(filter: UsbDeviceFilter, dirPath: string): Promise<UsbFileInfo[]>;
113
- static async readFile(filter: UsbDeviceFilter, filePath: string): Promise<Bytes | undefined>;
114
- }
115
- ```
116
-
117
- | Method | Parameters | Return | Description |
118
- |--------|-----------|--------|-------------|
119
- | `getDevices` | 없음 | `Promise<UsbDeviceInfo[]>` | 연결된 USB Mass Storage 장치 목록 조회 |
120
- | `requestPermissions` | `filter: UsbDeviceFilter` | `Promise<boolean>` | USB 장치 접근 권한 요청. 승인 여부 반환 |
121
- | `checkPermissions` | `filter: UsbDeviceFilter` | `Promise<boolean>` | USB 장치 접근 권한 보유 여부 확인 |
122
- | `readdir` | `filter: UsbDeviceFilter, dirPath: string` | `Promise<UsbFileInfo[]>` | USB 저장 장치의 디렉토리 내용 읽기 |
123
- | `readFile` | `filter: UsbDeviceFilter, filePath: string` | `Promise<Bytes \| undefined>` | USB 저장 장치에서 파일 읽기. 파일이 없으면 `undefined` 반환. 최대 100MB |
124
-
125
- ## Browser-Only Testing API (`UsbStorageWeb`)
126
-
127
- 브라우저 환경에서 테스트 및 개발 목적으로 사용하는 API. `UsbStorage` 정적 파사드로는 접근할 수 없으며, `UsbStorageWeb` 인스턴스를 직접 사용할 때만 호출 가능하다.
128
-
129
- ### `addVirtualDevice(device)`
130
-
131
- 가상 USB 장치를 IndexedDB에 등록한다. (테스트/개발용)
132
-
133
- ```typescript
134
- async addVirtualDevice(device: {
135
- vendorId: number;
136
- productId: number;
137
- deviceName: string;
138
- manufacturerName: string;
139
- productName: string;
140
- }): Promise<void>
141
- ```
142
-
143
- | Parameter | Type | Description |
144
- |-----------|------|-------------|
145
- | `device.vendorId` | `number` | USB Vendor ID |
146
- | `device.productId` | `number` | USB Product ID |
147
- | `device.deviceName` | `string` | 장치 이름 |
148
- | `device.manufacturerName` | `string` | 제조사 이름 |
149
- | `device.productName` | `string` | 제품 이름 |
150
-
151
- ### `addVirtualFile(filter, filePath, data)`
152
-
153
- 가상 USB 장치에 파일을 추가한다. (테스트/개발용)
154
-
155
- ```typescript
156
- async addVirtualFile(
157
- filter: UsbDeviceFilter,
158
- filePath: string,
159
- data: Uint8Array,
160
- ): Promise<void>
161
- ```
162
-
163
- | Parameter | Type | Description |
164
- |-----------|------|-------------|
165
- | `filter.vendorId` | `number` | 대상 장치의 USB Vendor ID |
166
- | `filter.productId` | `number` | 대상 장치의 USB Product ID |
167
- | `filePath` | `string` | 파일 경로 (예: `/updates/config.json`) |
168
- | `data` | `Uint8Array` | 파일 바이너리 데이터 |
169
-
170
- **주의**: 파일이 위치할 부모 디렉토리가 존재하지 않으면 자동으로 생성된다.
171
-
172
- ### `addVirtualDirectory(filter, dirPath)`
173
-
174
- 가상 USB 장치에 디렉토리를 추가한다. (테스트/개발용)
175
-
176
- ```typescript
177
- async addVirtualDirectory(
178
- filter: UsbDeviceFilter,
179
- dirPath: string,
180
- ): Promise<void>
181
- ```
182
-
183
- | Parameter | Type | Description |
184
- |-----------|------|-------------|
185
- | `filter.vendorId` | `number` | 대상 장치의 USB Vendor ID |
186
- | `filter.productId` | `number` | 대상 장치의 USB Product ID |
187
- | `dirPath` | `string` | 생성할 디렉토리 경로 (예: `/updates`) |
188
-
189
- ---
190
-
191
- ## Usage Examples
192
-
193
- ### USB 장치 열거 및 권한 요청
194
-
195
- ```typescript
196
- import { UsbStorage } from "@simplysm/capacitor-plugin-usb-storage";
197
-
198
- const devices = await UsbStorage.getDevices();
199
- if (devices.length > 0) {
200
- const device = devices[0];
201
- const filter = { vendorId: device.vendorId, productId: device.productId };
202
-
203
- const granted = await UsbStorage.checkPermissions(filter);
204
- if (!granted) {
205
- await UsbStorage.requestPermissions(filter);
206
- }
207
- }
208
- ```
209
-
210
- ### USB 저장소 파일 읽기
211
-
212
- ```typescript
213
- import { UsbStorage } from "@simplysm/capacitor-plugin-usb-storage";
214
- import type { UsbDeviceFilter } from "@simplysm/capacitor-plugin-usb-storage";
215
-
216
- const filter: UsbDeviceFilter = { vendorId: 1234, productId: 5678 };
217
-
218
- // 디렉토리 목록 조회
219
- const files = await UsbStorage.readdir(filter, "/updates");
220
-
221
- // 파일 읽기 (Bytes | undefined 반환)
222
- const data = await UsbStorage.readFile(filter, "/updates/config.json");
223
- if (data != null) {
224
- const text = new TextDecoder().decode(data);
225
- }
226
- ```
227
-
228
- ### 브라우저 테스트 - 가상 USB 장치 설정
229
-
230
- 브라우저 환경에서 테스트할 때, `UsbStorageWeb`을 직접 import하여 가상 USB 저장소를 설정한다. `UsbStorageWeb`은 패키지 공개 API(`index.ts`)에서 export되지 않으므로, 소스 경로를 직접 참조한다.
231
-
232
- ```typescript
233
- import { UsbStorageWeb } from "@simplysm/capacitor-plugin-usb-storage/src/web/UsbStorageWeb";
234
- import { UsbStorage } from "@simplysm/capacitor-plugin-usb-storage";
235
-
236
- const usbStorageWeb = new UsbStorageWeb();
237
-
238
- // 가상 장치 등록
239
- await usbStorageWeb.addVirtualDevice({
240
- vendorId: 1234,
241
- productId: 5678,
242
- deviceName: "Test Device",
243
- manufacturerName: "Test Manufacturer",
244
- productName: "Test Product",
245
- });
246
-
247
- // 가상 파일 추가
248
- const fileData = new TextEncoder().encode("Hello, USB!");
249
- await usbStorageWeb.addVirtualFile(
250
- { vendorId: 1234, productId: 5678 },
251
- "/updates/config.json",
252
- fileData,
253
- );
254
-
255
- // UsbStorage 정적 API로 접근 (Capacitor가 브라우저에서 UsbStorageWeb 인스턴스를 사용)
256
- const files = await UsbStorage.readdir({ vendorId: 1234, productId: 5678 }, "/updates");
257
- const data = await UsbStorage.readFile({ vendorId: 1234, productId: 5678 }, "/updates/config.json");
258
- ```