theta-client-react-native 1.1.0 → 1.2.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.
Files changed (162) hide show
  1. package/android/build.gradle +1 -1
  2. package/android/src/main/java/com/ricoh360/thetaclientreactnative/Converter.kt +375 -0
  3. package/android/src/main/java/com/ricoh360/thetaclientreactnative/ThetaClientSdkModule.kt +391 -17
  4. package/ios/ThetaClientReactNative.h +6 -0
  5. package/ios/ThetaClientReactNative.mm +1125 -132
  6. package/lib/commonjs/capture/index.js +11 -0
  7. package/lib/commonjs/capture/index.js.map +1 -1
  8. package/lib/commonjs/capture/notify.js +12 -0
  9. package/lib/commonjs/capture/notify.js.map +1 -0
  10. package/lib/commonjs/capture/time-shift-capture.js +91 -0
  11. package/lib/commonjs/capture/time-shift-capture.js.map +1 -0
  12. package/lib/commonjs/theta-repository/access-point.js.map +1 -1
  13. package/lib/commonjs/theta-repository/digest-auth.js +2 -0
  14. package/lib/commonjs/theta-repository/digest-auth.js.map +1 -0
  15. package/lib/commonjs/theta-repository/index.js +37 -4
  16. package/lib/commonjs/theta-repository/index.js.map +1 -1
  17. package/lib/commonjs/theta-repository/options/index.js +110 -0
  18. package/lib/commonjs/theta-repository/options/index.js.map +1 -1
  19. package/lib/commonjs/theta-repository/options/option-camera-control-source.js +29 -0
  20. package/lib/commonjs/theta-repository/options/option-camera-control-source.js.map +1 -0
  21. package/lib/commonjs/theta-repository/options/option-camera-mode.js +26 -0
  22. package/lib/commonjs/theta-repository/options/option-camera-mode.js.map +1 -0
  23. package/lib/commonjs/theta-repository/options/option-network-type.js +26 -0
  24. package/lib/commonjs/theta-repository/options/option-network-type.js.map +1 -0
  25. package/lib/commonjs/theta-repository/options/option-power-saving.js +24 -0
  26. package/lib/commonjs/theta-repository/options/option-power-saving.js.map +1 -0
  27. package/lib/commonjs/theta-repository/options/option-preview-format.js +32 -0
  28. package/lib/commonjs/theta-repository/options/option-preview-format.js.map +1 -0
  29. package/lib/commonjs/theta-repository/options/option-proxy.js +2 -0
  30. package/lib/commonjs/theta-repository/options/option-proxy.js.map +1 -0
  31. package/lib/commonjs/theta-repository/options/option-shooting-method.js +41 -0
  32. package/lib/commonjs/theta-repository/options/option-shooting-method.js.map +1 -0
  33. package/lib/commonjs/theta-repository/options/option-shutter-speed.js +302 -0
  34. package/lib/commonjs/theta-repository/options/option-shutter-speed.js.map +1 -0
  35. package/lib/commonjs/theta-repository/options/option-time-shift.js +43 -0
  36. package/lib/commonjs/theta-repository/options/option-time-shift.js.map +1 -0
  37. package/lib/commonjs/theta-repository/options/option-wlan-frequency.js +22 -0
  38. package/lib/commonjs/theta-repository/options/option-wlan-frequency.js.map +1 -0
  39. package/lib/commonjs/theta-repository/options/options.js +30 -2
  40. package/lib/commonjs/theta-repository/options/options.js.map +1 -1
  41. package/lib/commonjs/theta-repository/theta-config.js +6 -0
  42. package/lib/commonjs/theta-repository/theta-config.js.map +1 -0
  43. package/lib/commonjs/theta-repository/theta-files.js +13 -1
  44. package/lib/commonjs/theta-repository/theta-files.js.map +1 -1
  45. package/lib/commonjs/theta-repository/theta-repository.js +39 -8
  46. package/lib/commonjs/theta-repository/theta-repository.js.map +1 -1
  47. package/lib/commonjs/theta-repository/theta-timeout.js +2 -0
  48. package/lib/commonjs/theta-repository/theta-timeout.js.map +1 -0
  49. package/lib/module/capture/index.js +1 -0
  50. package/lib/module/capture/index.js.map +1 -1
  51. package/lib/module/capture/notify.js +6 -0
  52. package/lib/module/capture/notify.js.map +1 -0
  53. package/lib/module/capture/time-shift-capture.js +83 -0
  54. package/lib/module/capture/time-shift-capture.js.map +1 -0
  55. package/lib/module/theta-repository/access-point.js.map +1 -1
  56. package/lib/module/theta-repository/digest-auth.js +2 -0
  57. package/lib/module/theta-repository/digest-auth.js.map +1 -0
  58. package/lib/module/theta-repository/index.js +4 -1
  59. package/lib/module/theta-repository/index.js.map +1 -1
  60. package/lib/module/theta-repository/options/index.js +10 -0
  61. package/lib/module/theta-repository/options/index.js.map +1 -1
  62. package/lib/module/theta-repository/options/option-camera-control-source.js +22 -0
  63. package/lib/module/theta-repository/options/option-camera-control-source.js.map +1 -0
  64. package/lib/module/theta-repository/options/option-camera-mode.js +19 -0
  65. package/lib/module/theta-repository/options/option-camera-mode.js.map +1 -0
  66. package/lib/module/theta-repository/options/option-network-type.js +19 -0
  67. package/lib/module/theta-repository/options/option-network-type.js.map +1 -0
  68. package/lib/module/theta-repository/options/option-power-saving.js +17 -0
  69. package/lib/module/theta-repository/options/option-power-saving.js.map +1 -0
  70. package/lib/module/theta-repository/options/option-preview-format.js +25 -0
  71. package/lib/module/theta-repository/options/option-preview-format.js.map +1 -0
  72. package/lib/module/theta-repository/options/option-proxy.js +2 -0
  73. package/lib/module/theta-repository/options/option-proxy.js.map +1 -0
  74. package/lib/module/theta-repository/options/option-shooting-method.js +34 -0
  75. package/lib/module/theta-repository/options/option-shooting-method.js.map +1 -0
  76. package/lib/module/theta-repository/options/option-shutter-speed.js +295 -0
  77. package/lib/module/theta-repository/options/option-shutter-speed.js.map +1 -0
  78. package/lib/module/theta-repository/options/option-time-shift.js +36 -0
  79. package/lib/module/theta-repository/options/option-time-shift.js.map +1 -0
  80. package/lib/module/theta-repository/options/option-wlan-frequency.js +15 -0
  81. package/lib/module/theta-repository/options/option-wlan-frequency.js.map +1 -0
  82. package/lib/module/theta-repository/options/options.js +30 -2
  83. package/lib/module/theta-repository/options/options.js.map +1 -1
  84. package/lib/module/theta-repository/theta-config.js +2 -0
  85. package/lib/module/theta-repository/theta-config.js.map +1 -0
  86. package/lib/module/theta-repository/theta-files.js +12 -0
  87. package/lib/module/theta-repository/theta-files.js.map +1 -1
  88. package/lib/module/theta-repository/theta-repository.js +38 -9
  89. package/lib/module/theta-repository/theta-repository.js.map +1 -1
  90. package/lib/module/theta-repository/theta-timeout.js +2 -0
  91. package/lib/module/theta-repository/theta-timeout.js.map +1 -0
  92. package/lib/typescript/capture/index.d.ts +1 -0
  93. package/lib/typescript/capture/index.d.ts.map +1 -1
  94. package/lib/typescript/capture/notify.d.ts +13 -0
  95. package/lib/typescript/capture/notify.d.ts.map +1 -0
  96. package/lib/typescript/capture/time-shift-capture.d.ts +44 -0
  97. package/lib/typescript/capture/time-shift-capture.d.ts.map +1 -0
  98. package/lib/typescript/theta-repository/access-point.d.ts +4 -1
  99. package/lib/typescript/theta-repository/access-point.d.ts.map +1 -1
  100. package/lib/typescript/theta-repository/digest-auth.d.ts +17 -0
  101. package/lib/typescript/theta-repository/digest-auth.d.ts.map +1 -0
  102. package/lib/typescript/theta-repository/index.d.ts +4 -1
  103. package/lib/typescript/theta-repository/index.d.ts.map +1 -1
  104. package/lib/typescript/theta-repository/options/index.d.ts +10 -0
  105. package/lib/typescript/theta-repository/options/index.d.ts.map +1 -1
  106. package/lib/typescript/theta-repository/options/option-camera-control-source.d.ts +22 -0
  107. package/lib/typescript/theta-repository/options/option-camera-control-source.d.ts.map +1 -0
  108. package/lib/typescript/theta-repository/options/option-camera-mode.d.ts +19 -0
  109. package/lib/typescript/theta-repository/options/option-camera-mode.d.ts.map +1 -0
  110. package/lib/typescript/theta-repository/options/option-network-type.d.ts +19 -0
  111. package/lib/typescript/theta-repository/options/option-network-type.d.ts.map +1 -0
  112. package/lib/typescript/theta-repository/options/option-power-saving.d.ts +16 -0
  113. package/lib/typescript/theta-repository/options/option-power-saving.d.ts.map +1 -0
  114. package/lib/typescript/theta-repository/options/option-preview-format.d.ts +25 -0
  115. package/lib/typescript/theta-repository/options/option-preview-format.d.ts.map +1 -0
  116. package/lib/typescript/theta-repository/options/option-proxy.d.ts +23 -0
  117. package/lib/typescript/theta-repository/options/option-proxy.d.ts.map +1 -0
  118. package/lib/typescript/theta-repository/options/option-shooting-method.d.ts +33 -0
  119. package/lib/typescript/theta-repository/options/option-shooting-method.d.ts.map +1 -0
  120. package/lib/typescript/theta-repository/options/option-shutter-speed.d.ts +295 -0
  121. package/lib/typescript/theta-repository/options/option-shutter-speed.d.ts.map +1 -0
  122. package/lib/typescript/theta-repository/options/option-time-shift.d.ts +54 -0
  123. package/lib/typescript/theta-repository/options/option-time-shift.d.ts.map +1 -0
  124. package/lib/typescript/theta-repository/options/option-white-balance-auto-strength.d.ts +1 -1
  125. package/lib/typescript/theta-repository/options/option-white-balance-auto-strength.d.ts.map +1 -1
  126. package/lib/typescript/theta-repository/options/option-wlan-frequency.d.ts +15 -0
  127. package/lib/typescript/theta-repository/options/option-wlan-frequency.d.ts.map +1 -0
  128. package/lib/typescript/theta-repository/options/options.d.ts +73 -6
  129. package/lib/typescript/theta-repository/options/options.d.ts.map +1 -1
  130. package/lib/typescript/theta-repository/theta-config.d.ts +20 -0
  131. package/lib/typescript/theta-repository/theta-config.d.ts.map +1 -0
  132. package/lib/typescript/theta-repository/theta-files.d.ts +14 -1
  133. package/lib/typescript/theta-repository/theta-files.d.ts.map +1 -1
  134. package/lib/typescript/theta-repository/theta-repository.d.ts +28 -7
  135. package/lib/typescript/theta-repository/theta-repository.d.ts.map +1 -1
  136. package/lib/typescript/theta-repository/theta-timeout.d.ts +22 -0
  137. package/lib/typescript/theta-repository/theta-timeout.d.ts.map +1 -0
  138. package/package.json +1 -1
  139. package/src/capture/index.ts +1 -0
  140. package/src/capture/notify.ts +27 -0
  141. package/src/capture/time-shift-capture.ts +99 -0
  142. package/src/theta-repository/access-point.ts +5 -1
  143. package/src/theta-repository/digest-auth.ts +16 -0
  144. package/src/theta-repository/index.ts +4 -1
  145. package/src/theta-repository/options/index.ts +11 -0
  146. package/src/theta-repository/options/option-camera-control-source.ts +24 -0
  147. package/src/theta-repository/options/option-camera-mode.ts +20 -0
  148. package/src/theta-repository/options/option-network-type.ts +20 -0
  149. package/src/theta-repository/options/option-power-saving.ts +18 -0
  150. package/src/theta-repository/options/option-preview-format.ts +27 -0
  151. package/src/theta-repository/options/option-proxy.ts +22 -0
  152. package/src/theta-repository/options/option-shooting-method.ts +36 -0
  153. package/src/theta-repository/options/option-shutter-speed.ts +360 -0
  154. package/src/theta-repository/options/option-time-shift.ts +59 -0
  155. package/src/theta-repository/options/option-white-balance-auto-strength.ts +1 -1
  156. package/src/theta-repository/options/option-wlan-frequency.ts +16 -0
  157. package/src/theta-repository/options/options.ts +74 -6
  158. package/src/theta-repository/theta-config.ts +20 -0
  159. package/src/theta-repository/theta-files.ts +16 -1
  160. package/src/theta-repository/theta-repository.ts +68 -17
  161. package/src/theta-repository/theta-timeout.ts +21 -0
  162. package/theta-client-react-native.podspec +1 -1
@@ -1,13 +1,24 @@
1
1
  import { AccessPoint, AuthModeEnum } from './access-point';
2
- import type { FileTypeEnum, ThetaFiles } from './theta-files';
2
+ import type { FileTypeEnum, StorageEnum, ThetaFiles } from './theta-files';
3
3
  import type { ThetaState } from './theta-state';
4
4
  import type { ThetaInfo } from './theta-info';
5
5
  import type { MetaInfo } from './theta-meta';
6
6
  import type { PluginInfo } from './theta-plugin';
7
7
 
8
8
  import { NativeModules } from 'react-native';
9
- import type { OptionNameEnum, Options, CaptureModeEnum } from './options';
10
- import { PhotoCaptureBuilder, VideoCaptureBuilder } from '../capture';
9
+ import type {
10
+ OptionNameEnum,
11
+ Options,
12
+ CaptureModeEnum,
13
+ Proxy,
14
+ } from './options';
15
+ import {
16
+ PhotoCaptureBuilder,
17
+ VideoCaptureBuilder,
18
+ TimeShiftCaptureBuilder,
19
+ } from '../capture';
20
+ import type { ThetaConfig } from './theta-config';
21
+ import type { ThetaTimeout } from './theta-timeout';
11
22
  const ThetaClientReactNative = NativeModules.ThetaClientReactNative;
12
23
 
13
24
  /**
@@ -15,13 +26,26 @@ const ThetaClientReactNative = NativeModules.ThetaClientReactNative;
15
26
  *
16
27
  * @function initialize
17
28
  * @param {string} endPoint optional endpoint of camera
29
+ * @param {ThetaConfig} config Configuration of initialize. If null, get from THETA.
30
+ * @param {ThetaTimeout} timeout Timeout of HTTP call.
18
31
  * @return promise of boolean result
19
32
  **/
20
- export function initialize(endPoint?: string): Promise<boolean> {
21
- if (!endPoint) {
22
- endPoint = 'http://192.168.1.1';
23
- }
24
- return ThetaClientReactNative.initialize(endPoint);
33
+ export function initialize(
34
+ endPoint: string = 'http://192.168.1.1',
35
+ config?: ThetaConfig,
36
+ timeout?: ThetaTimeout
37
+ ): Promise<boolean> {
38
+ return ThetaClientReactNative.initialize(endPoint, config, timeout);
39
+ }
40
+
41
+ /**
42
+ * Returns whether it is initialized or not.
43
+ *
44
+ * @function isInitialized
45
+ * @return promise of boolean result
46
+ **/
47
+ export function isInitialized(): Promise<boolean> {
48
+ return ThetaClientReactNative.isInitialized();
25
49
  }
26
50
 
27
51
  /**
@@ -46,6 +70,17 @@ export function getPhotoCaptureBuilder(): PhotoCaptureBuilder {
46
70
  return new PhotoCaptureBuilder();
47
71
  }
48
72
 
73
+ /**
74
+ * Get TimeShiftCaptureBuilder for time-shift.
75
+ *
76
+ * @function getTimeShiftCaptureBuilder
77
+ * @return created TimeShiftCaptureBuilder
78
+ */
79
+ export function getTimeShiftCaptureBuilder(): TimeShiftCaptureBuilder {
80
+ ThetaClientReactNative.getTimeShiftCaptureBuilder();
81
+ return new TimeShiftCaptureBuilder();
82
+ }
83
+
49
84
  /**
50
85
  * Get PhotoCapture.Builder for capture video.
51
86
  *
@@ -186,18 +221,21 @@ export function getThetaState(): Promise<ThetaState> {
186
221
  * @param {number} entryCount Desired number of entries to return. If
187
222
  * entryCount is more than the number of remaining files, just
188
223
  * return entries of actual remaining files.
224
+ * @param {StorageEnum} storage Desired storage. If omitted, return current storage. (RICOH THETA X Version 2.00.0 or later)
189
225
  * @return promise with a list of file information and number of totalEntries.
190
226
  * see [camera.listFiles](https://github.com/ricohapi/theta-api-specs/blob/main/theta-web-api-v2.1/commands/camera.list_files.md).
191
227
  */
192
228
  export function listFiles(
193
229
  fileTypeEnum: FileTypeEnum,
194
230
  startPosition: number = 0,
195
- entryCount: number
231
+ entryCount: number,
232
+ storage?: StorageEnum
196
233
  ): Promise<ThetaFiles> {
197
234
  return ThetaClientReactNative.listFiles(
198
235
  fileTypeEnum,
199
236
  startPosition,
200
- entryCount
237
+ entryCount,
238
+ storage
201
239
  );
202
240
  }
203
241
 
@@ -295,6 +333,7 @@ export function listAccessPoints(): Promise<AccessPoint[]> {
295
333
  * @param {AuthModeEnum} authMode Authentication mode.
296
334
  * @param {string} password Password. If authMode is "NONE", pass empty String.
297
335
  * @param {number} connectionPriority Connection priority 1 to 5.
336
+ * @param {Proxy} proxy Proxy information to be used for the access point.
298
337
  * @return promise of boolean result
299
338
  */
300
339
  export function setAccessPointDynamically(
@@ -302,14 +341,16 @@ export function setAccessPointDynamically(
302
341
  ssidStealth: boolean = false,
303
342
  authMode: AuthModeEnum = AuthModeEnum.NONE,
304
343
  password: string = '',
305
- connectionPriority: number = 1
344
+ connectionPriority: number = 1,
345
+ proxy?: Proxy
306
346
  ): Promise<boolean> {
307
347
  return ThetaClientReactNative.setAccessPointDynamically(
308
348
  ssid,
309
349
  ssidStealth,
310
350
  authMode,
311
351
  password,
312
- connectionPriority
352
+ connectionPriority,
353
+ proxy
313
354
  );
314
355
  }
315
356
 
@@ -325,6 +366,7 @@ export function setAccessPointDynamically(
325
366
  * @param {string} ipAddress IP address assigns to Theta.
326
367
  * @param {string} subnetMask Subnet mask.
327
368
  * @param {string} defaultGateway Default gateway.
369
+ * @param {Proxy} proxy Proxy information to be used for the access point.
328
370
  * @return promise of boolean result
329
371
  */
330
372
  export function setAccessPointStatically(
@@ -335,7 +377,8 @@ export function setAccessPointStatically(
335
377
  connectionPriority: number = 1,
336
378
  ipAddress: string,
337
379
  subnetMask: string,
338
- defaultGateway: string
380
+ defaultGateway: string,
381
+ proxy?: Proxy
339
382
  ): Promise<boolean> {
340
383
  return ThetaClientReactNative.setAccessPointStatically(
341
384
  ssid,
@@ -345,7 +388,8 @@ export function setAccessPointStatically(
345
388
  connectionPriority,
346
389
  ipAddress,
347
390
  subnetMask,
348
- defaultGateway
391
+ defaultGateway,
392
+ proxy
349
393
  );
350
394
  }
351
395
 
@@ -380,7 +424,9 @@ export function getMySetting(captureMode: CaptureModeEnum): Promise<Options> {
380
424
  * @param optionNames List of option names to acquire
381
425
  * @returns Options of my setting
382
426
  */
383
- export function getMySettingFromOldModel(optionNames: OptionNameEnum[]): Promise<Options> {
427
+ export function getMySettingFromOldModel(
428
+ optionNames: OptionNameEnum[]
429
+ ): Promise<Options> {
384
430
  return ThetaClientReactNative.getMySettingFromOldModel(optionNames);
385
431
  }
386
432
 
@@ -391,7 +437,10 @@ export function getMySettingFromOldModel(optionNames: OptionNameEnum[]): Promise
391
437
  * @param options registered to My Settings
392
438
  * @returns Promise of boolean result, always true
393
439
  */
394
- export function setMySetting(captureMode: CaptureModeEnum, options: Options): Promise<boolean> {
440
+ export function setMySetting(
441
+ captureMode: CaptureModeEnum,
442
+ options: Options
443
+ ): Promise<boolean> {
395
444
  return ThetaClientReactNative.setMySetting(captureMode, options);
396
445
  }
397
446
 
@@ -400,7 +449,9 @@ export function setMySetting(captureMode: CaptureModeEnum, options: Options): Pr
400
449
  * @param captureMode The target shooting mode
401
450
  * @returns Promise of boolean result, always true
402
451
  */
403
- export function deleteMySetting(captureMode: CaptureModeEnum): Promise<boolean> {
452
+ export function deleteMySetting(
453
+ captureMode: CaptureModeEnum
454
+ ): Promise<boolean> {
404
455
  return ThetaClientReactNative.deleteMySetting(captureMode);
405
456
  }
406
457
 
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Timeout of HTTP call.
3
+ */
4
+ export type ThetaTimeout = {
5
+ /**
6
+ * Specifies a time period (in milliseconds) in
7
+ * which a client should establish a connection with a server.
8
+ */
9
+ connectTimeout: number;
10
+ /**
11
+ * Specifies a time period (in milliseconds) required to process an HTTP call:
12
+ * from sending a request to receiving first response bytes.
13
+ * To disable this timeout, set its value to 0.
14
+ */
15
+ requestTimeout: number;
16
+ /**
17
+ * Specifies a maximum time (in milliseconds) of inactivity between two data packets
18
+ * when exchanging data with a server.
19
+ */
20
+ socketTimeout: number;
21
+ };
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|
17
17
  s.source_files = "ios/**/*.{h,m,mm}"
18
18
 
19
19
  s.dependency "React-Core"
20
- s.dependency "THETAClient", "1.1.0"
20
+ s.dependency "THETAClient", "1.2.0"
21
21
 
22
22
  # Don't install the dependencies when we run `pod install` in the old architecture.
23
23
  if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then