@dinoxx/dinox-cli 1.1.1 → 2.1.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 (141) hide show
  1. package/README.md +44 -3
  2. package/dist/cli.js +4 -0
  3. package/dist/commands/auth/index.js +1 -2
  4. package/dist/commands/boxes/index.js +37 -13
  5. package/dist/commands/boxes/operations.d.ts +3 -3
  6. package/dist/commands/boxes/operations.js +51 -28
  7. package/dist/commands/info/index.js +30 -5
  8. package/dist/commands/meta/repo.js +2 -1
  9. package/dist/commands/notes/actions.js +20 -37
  10. package/dist/commands/notes/bulk.d.ts +2 -2
  11. package/dist/commands/notes/bulk.js +3 -18
  12. package/dist/commands/notes/contentPatch.d.ts +5 -1
  13. package/dist/commands/notes/contentPatch.js +12 -1
  14. package/dist/commands/notes/contentPatchCommand.d.ts +3 -0
  15. package/dist/commands/notes/contentPatchCommand.js +29 -8
  16. package/dist/commands/notes/descriptors.js +19 -16
  17. package/dist/commands/notes/export.js +3 -0
  18. package/dist/commands/notes/repo/read.d.ts +8 -0
  19. package/dist/commands/notes/repo/read.js +321 -0
  20. package/dist/commands/notes/repo/resolve.d.ts +8 -0
  21. package/dist/commands/notes/repo/resolve.js +187 -0
  22. package/dist/commands/notes/repo/search.d.ts +42 -0
  23. package/dist/commands/notes/repo/search.js +513 -0
  24. package/dist/commands/notes/repo/shared.d.ts +190 -0
  25. package/dist/commands/notes/repo/shared.js +102 -0
  26. package/dist/commands/notes/repo/write.d.ts +24 -0
  27. package/dist/commands/notes/repo/write.js +251 -0
  28. package/dist/commands/notes/repo.d.ts +7 -177
  29. package/dist/commands/notes/repo.js +7 -1310
  30. package/dist/commands/notes/searchOutput.d.ts +2 -1
  31. package/dist/commands/notes/searchOutput.js +2 -1
  32. package/dist/commands/notes/searchSql.js +9 -3
  33. package/dist/commands/prompt/index.d.ts +1 -0
  34. package/dist/commands/prompt/index.js +26 -11
  35. package/dist/commands/savedViews/index.d.ts +7 -0
  36. package/dist/commands/savedViews/index.js +458 -0
  37. package/dist/commands/savedViews/model.d.ts +87 -0
  38. package/dist/commands/savedViews/model.js +306 -0
  39. package/dist/commands/savedViews/repo.d.ts +123 -0
  40. package/dist/commands/savedViews/repo.js +512 -0
  41. package/dist/commands/savedViews/semantics.d.ts +46 -0
  42. package/dist/commands/savedViews/semantics.js +738 -0
  43. package/dist/commands/schema/commandMetadata.js +4 -4
  44. package/dist/commands/schema/index.d.ts +1 -0
  45. package/dist/commands/schema/index.js +23 -2
  46. package/dist/commands/schema/renderSkills.d.ts +6 -0
  47. package/dist/commands/schema/renderSkills.js +109 -11
  48. package/dist/commands/schema/spec.js +4 -0
  49. package/dist/commands/skills/index.d.ts +80 -0
  50. package/dist/commands/skills/index.js +572 -0
  51. package/dist/commands/storage/index.js +2 -2
  52. package/dist/commands/storage/repo/configs.d.ts +30 -0
  53. package/dist/commands/storage/repo/configs.js +259 -0
  54. package/dist/commands/storage/repo/operations.d.ts +25 -0
  55. package/dist/commands/storage/repo/operations.js +337 -0
  56. package/dist/commands/storage/repo/remote.d.ts +32 -0
  57. package/dist/commands/storage/repo/remote.js +132 -0
  58. package/dist/commands/storage/repo/resources.d.ts +12 -0
  59. package/dist/commands/storage/repo/resources.js +134 -0
  60. package/dist/commands/storage/repo/shared.d.ts +181 -0
  61. package/dist/commands/storage/repo/shared.js +36 -0
  62. package/dist/commands/storage/repo/targets.d.ts +12 -0
  63. package/dist/commands/storage/repo/targets.js +178 -0
  64. package/dist/commands/storage/repo.d.ts +3 -166
  65. package/dist/commands/storage/repo.js +4 -1034
  66. package/dist/commands/sync.js +2 -1
  67. package/dist/commands/tags/index.js +30 -11
  68. package/dist/commands/tags/operations.d.ts +3 -3
  69. package/dist/commands/tags/operations.js +45 -20
  70. package/dist/commands/templates/model.d.ts +50 -0
  71. package/dist/commands/templates/model.js +239 -0
  72. package/dist/commands/todo/index.js +3 -3
  73. package/dist/commands/update.d.ts +1 -0
  74. package/dist/commands/update.js +46 -9
  75. package/dist/commands/writeConfirmation.d.ts +13 -0
  76. package/dist/commands/writeConfirmation.js +54 -0
  77. package/dist/config/resolve.js +5 -10
  78. package/dist/config/types.d.ts +3 -6
  79. package/dist/constants/links.d.ts +18 -1
  80. package/dist/constants/links.js +26 -1
  81. package/dist/contract/snapshot.d.ts +30 -0
  82. package/dist/contract/snapshot.js +114 -0
  83. package/dist/daemon/client.d.ts +2 -2
  84. package/dist/daemon/client.js +108 -54
  85. package/dist/daemon/index.d.ts +5 -3
  86. package/dist/daemon/index.js +28 -5
  87. package/dist/daemon/lifecycle.d.ts +7 -2
  88. package/dist/daemon/lifecycle.js +53 -13
  89. package/dist/daemon/pid.d.ts +1 -1
  90. package/dist/daemon/pid.js +6 -3
  91. package/dist/dinox.js +9 -1
  92. package/dist/powersync/exclusiveRuntime.d.ts +1 -0
  93. package/dist/powersync/exclusiveRuntime.js +26 -8
  94. package/dist/powersync/runtime.d.ts +3 -2
  95. package/dist/powersync/runtime.js +19 -3
  96. package/dist/powersync/schema/content.d.ts +1 -78
  97. package/dist/powersync/schema/content.js +1 -78
  98. package/dist/powersync/schema/electronCanonical.d.ts +1561 -0
  99. package/dist/powersync/schema/electronCanonical.js +1154 -0
  100. package/dist/powersync/schema/index.d.ts +573 -129
  101. package/dist/powersync/schema/index.js +3 -32
  102. package/dist/powersync/schema/local.d.ts +1 -56
  103. package/dist/powersync/schema/local.js +1 -60
  104. package/dist/powersync/schema/note.d.ts +1 -35
  105. package/dist/powersync/schema/note.js +1 -35
  106. package/dist/powersync/schema/notesExtras.d.ts +1 -62
  107. package/dist/powersync/schema/notesExtras.js +1 -71
  108. package/dist/powersync/schema/projects.d.ts +1 -104
  109. package/dist/powersync/schema/projects.js +1 -104
  110. package/dist/powersync/schema/savedViews.d.ts +1 -0
  111. package/dist/powersync/schema/savedViews.js +1 -0
  112. package/dist/powersync/schema/storage.d.ts +1 -24
  113. package/dist/powersync/schema/storage.js +1 -24
  114. package/dist/powersync/schema/tags.d.ts +1 -37
  115. package/dist/powersync/schema/tags.js +1 -37
  116. package/dist/powersync/syncGate.d.ts +20 -2
  117. package/dist/powersync/uploader.d.ts +16 -2
  118. package/dist/powersync/uploader.js +152 -158
  119. package/dist/skills/check.d.ts +1 -0
  120. package/dist/skills/check.js +538 -70
  121. package/dist/skills/commandRefs.d.ts +21 -0
  122. package/dist/skills/commandRefs.js +132 -0
  123. package/dist/skills/generate.d.ts +13 -0
  124. package/dist/skills/generate.js +80 -0
  125. package/dist/skills/registry.d.ts +13 -0
  126. package/dist/skills/registry.js +58 -0
  127. package/dist/skills/retired.d.ts +60 -0
  128. package/dist/skills/retired.js +58 -0
  129. package/dist/utils/deadline.d.ts +8 -0
  130. package/dist/utils/deadline.js +31 -0
  131. package/dist/utils/dryRun.d.ts +20 -1
  132. package/dist/utils/dryRun.js +22 -3
  133. package/dist/utils/errorCodes.d.ts +311 -0
  134. package/dist/utils/errorCodes.js +92 -0
  135. package/dist/utils/errors.d.ts +15 -2
  136. package/dist/utils/errors.js +13 -0
  137. package/dist/utils/processExit.d.ts +1 -0
  138. package/dist/utils/processExit.js +33 -0
  139. package/dist/utils/updateNotice.d.ts +1 -0
  140. package/dist/utils/updateNotice.js +1 -1
  141. package/package.json +18 -8
@@ -1,166 +1,3 @@
1
- import fsp from 'node:fs/promises';
2
- import type { AbstractPowerSyncDatabase } from '@powersync/common';
3
- declare const UPLOAD_CATEGORY_VALUES: readonly ["images", "audios", "files", "videos"];
4
- export type StorageUploadCategory = (typeof UPLOAD_CATEGORY_VALUES)[number];
5
- export type StorageListItem = {
6
- id: string;
7
- aliasName: string;
8
- provider: string;
9
- endpoint: string;
10
- bucket: string;
11
- region: string;
12
- forcePathStyle: boolean;
13
- pathPrefix: string;
14
- customDomain: string;
15
- legacyDomains: string[];
16
- isPrivate: boolean;
17
- hasAccessKeyId: boolean;
18
- hasSecretAccessKey: boolean;
19
- isActive: boolean;
20
- };
21
- export type StorageListResult = {
22
- activeCustomStorageConfigId: string | null;
23
- usesOfficialStorage: boolean;
24
- items: StorageListItem[];
25
- };
26
- type StoredCustomStorageConfig = {
27
- id: string;
28
- aliasName: string;
29
- provider: string;
30
- endpoint: string;
31
- bucket: string;
32
- region: string;
33
- accessKeyId: string;
34
- secretAccessKey: string;
35
- forcePathStyle: boolean;
36
- pathPrefix: string;
37
- customDomain: string;
38
- legacyDomains: string[];
39
- isPrivate: boolean;
40
- };
41
- export type StorageUploadPlan = {
42
- storage: StorageListItem;
43
- selectionSource: 'storage_id' | 'active' | 'single_available_config';
44
- filePath: string;
45
- fileName: string;
46
- sizeBytes: number;
47
- category: StorageUploadCategory;
48
- contentType: string;
49
- storageKey: string;
50
- storageUrl: string;
51
- domain: string;
52
- };
53
- export type StorageUploadResult = {
54
- resourceId: string;
55
- storageConfigId: string;
56
- aliasName: string;
57
- provider: string;
58
- bucket: string;
59
- endpoint: string;
60
- domain: string;
61
- storageKey: string;
62
- storageUrl: string;
63
- fileName: string;
64
- sizeBytes: number;
65
- contentType: string;
66
- category: StorageUploadCategory;
67
- etag: string | null;
68
- thumbnailUrl: string | null;
69
- isPrivate: boolean;
70
- selectionSource: StorageUploadPlan['selectionSource'];
71
- };
72
- export type StorageTestPlan = {
73
- storage: StorageListItem;
74
- selectionSource: StorageUploadPlan['selectionSource'];
75
- contentType: string;
76
- sizeBytes: number;
77
- storageKey: string;
78
- storageUrl: string;
79
- domain: string;
80
- };
81
- export type StorageTestResult = {
82
- storageConfigId: string;
83
- aliasName: string;
84
- provider: string;
85
- bucket: string;
86
- endpoint: string;
87
- domain: string;
88
- storageKey: string;
89
- storageUrl: string;
90
- contentType: string;
91
- sizeBytes: number;
92
- selectionSource: StorageUploadPlan['selectionSource'];
93
- isPrivate: boolean;
94
- };
95
- export type StorageStatsEntry = {
96
- provider: string;
97
- bucket: string;
98
- label: string;
99
- totalBytes: number;
100
- fileCount: number;
101
- storageConfigId: string | null;
102
- aliasName: string | null;
103
- isOfficial: boolean;
104
- };
105
- export type StorageStatsResult = {
106
- totalBytes: number;
107
- totalFiles: number;
108
- entries: StorageStatsEntry[];
109
- };
110
- type UploadObjectInput = {
111
- localPath: string;
112
- bucket: string;
113
- key: string;
114
- contentType: string;
115
- contentLength: number;
116
- overwrite: boolean;
117
- storage: StoredCustomStorageConfig;
118
- };
119
- type UploadObjectResult = {
120
- etag: string | null;
121
- };
122
- type UploadDeps = {
123
- statFile?: typeof fsp.stat;
124
- uploadObject?: (input: UploadObjectInput) => Promise<UploadObjectResult>;
125
- deleteObject?: (input: {
126
- bucket: string;
127
- key: string;
128
- etag?: string | null;
129
- storage: StoredCustomStorageConfig;
130
- }) => Promise<void>;
131
- uploadBytes?: (input: {
132
- body: Buffer;
133
- bucket: string;
134
- key: string;
135
- contentType: string;
136
- overwrite?: boolean;
137
- storage: StoredCustomStorageConfig;
138
- }) => Promise<UploadObjectResult>;
139
- };
140
- export declare function parseStorageUploadCategory(value: unknown): StorageUploadCategory;
141
- export declare function listStorageConfigs(db: AbstractPowerSyncDatabase, userId: string): Promise<StorageListResult>;
142
- export declare function getStorageStats(db: AbstractPowerSyncDatabase, userId: string): Promise<StorageStatsResult>;
143
- export declare function inspectStorageUpload(db: AbstractPowerSyncDatabase, input: {
144
- userId: string;
145
- filePath: string;
146
- category: StorageUploadCategory;
147
- storageId?: string;
148
- key?: string;
149
- }, deps?: Pick<UploadDeps, 'statFile'>): Promise<StorageUploadPlan>;
150
- export declare function inspectStorageTest(db: AbstractPowerSyncDatabase, input: {
151
- userId: string;
152
- storageId?: string;
153
- }): Promise<StorageTestPlan>;
154
- export declare function testStorageUpload(db: AbstractPowerSyncDatabase, input: {
155
- userId: string;
156
- storageId?: string;
157
- }, deps?: Pick<UploadDeps, 'deleteObject' | 'uploadBytes'>): Promise<StorageTestResult>;
158
- export declare function uploadFileToStorage(db: AbstractPowerSyncDatabase, input: {
159
- userId: string;
160
- filePath: string;
161
- category: StorageUploadCategory;
162
- storageId?: string;
163
- key?: string;
164
- overwrite?: boolean;
165
- }, deps?: UploadDeps): Promise<StorageUploadResult>;
166
- export {};
1
+ export type { StorageListItem, StorageListResult, StorageStatsEntry, StorageStatsResult, StorageTestPlan, StorageTestResult, StorageUploadCategory, StorageUploadPlan, StorageUploadResult, } from './repo/shared.js';
2
+ export { getStorageStats, listStorageConfigs, parseStorageUploadCategory, } from './repo/configs.js';
3
+ export { inspectStorageTest, inspectStorageUpload, testStorageUpload, uploadFileToStorage, } from './repo/operations.js';