@srafis/zsync 0.1.4 → 0.1.5
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/README.md +4 -4
- package/dist/zsync.js +6 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -90,7 +90,7 @@ bun run dev
|
|
|
90
90
|
1. Choose Today, Yesterday, This week, Last week, or This month.
|
|
91
91
|
2. Use the arrow keys to move through entries and Space to select or deselect them. Press Enter to continue.
|
|
92
92
|
3. Choose a Zoho job for each unmapped Clockify project. zsync remembers your choices. An exact, unique match with a Zoho project or job name is selected automatically.
|
|
93
|
-
4. Review
|
|
93
|
+
4. Review the create/update/delete counts and submit the final Yes/No prompt. It defaults to No when deletions are selected, otherwise Yes.
|
|
94
94
|
|
|
95
95
|
New, changed and deleted entries start selected. Changed rows show a yellow `[updated]` label before their description and update the existing Zoho log when confirmed. Unchanged synced entries start unselected and are skipped if selected.
|
|
96
96
|
|
|
@@ -115,9 +115,9 @@ zsync creates duration-based logs. The original start and end timestamps are ret
|
|
|
115
115
|
|
|
116
116
|
## Running sync again
|
|
117
117
|
|
|
118
|
-
zsync writes readable YAML metadata in the Zoho log's Description and recognizes entries by a sync marker derived from their Clockify ID.
|
|
118
|
+
zsync writes readable YAML metadata in the Zoho log's Description and recognizes entries by a sync marker derived from their Clockify ID. Comparison includes the exact metadata text, excluding the sync marker. Differences in the log fields or metadata appear as updates. Keep that metadata intact so later runs can find the existing log. Recognition works across machines and OAuth clients without a local sync ledger.
|
|
119
119
|
|
|
120
|
-
Selecting a changed entry overwrites differing Zoho fields with the Clockify values.
|
|
120
|
+
Selecting a changed entry overwrites differing Zoho fields with the Clockify values.
|
|
121
121
|
|
|
122
122
|
A manually entered Zoho log without sync metadata is not treated as a match, even if its title and duration are identical. Deleting a synced Zoho log makes its Clockify entry appear new again.
|
|
123
123
|
|
|
@@ -129,7 +129,7 @@ Before showing the combined sync table, zsync checks synced Zoho logs dated with
|
|
|
129
129
|
|
|
130
130
|
If Clockify confirms an entry is absent, its Zoho log appears in the same checkbox table as new and changed entries, labelled with a red `[deleted]` before its description. Deletion rows start checked. Deselect any logs you want to keep and review the create/update/delete counts at the final confirmation. The app rechecks each selected log and its Clockify source before deleting, then verifies that the Zoho log is gone. Deletions are not retried automatically after an uncertain response.
|
|
131
131
|
|
|
132
|
-
Logs need Clockify source metadata, an entry ID and a valid sync marker. Explicit workspace/user IDs must match your configuration.
|
|
132
|
+
Logs need Clockify source metadata, an entry ID and a valid sync marker. Explicit workspace/user IDs must match your configuration. Deletion checks use the configured Clockify workspace. Use the same workspace for tracking and syncing. Manual logs and locked logs are excluded.
|
|
133
133
|
|
|
134
134
|
Deletion review also runs when the selected period has no completed Clockify entries. After confirmation, the app applies creations and updates, then deletions. A failure does not roll back successful operations. A deletion failure is reported per entry and produces a nonzero exit status.
|
|
135
135
|
|
package/dist/zsync.js
CHANGED
|
@@ -7441,6 +7441,10 @@ function responseMessage(body) {
|
|
|
7441
7441
|
const parts = [];
|
|
7442
7442
|
if (typeof response.message === "string")
|
|
7443
7443
|
parts.push(response.message);
|
|
7444
|
+
if (typeof response.error === "string")
|
|
7445
|
+
parts.push(response.error);
|
|
7446
|
+
if (typeof response.error_description === "string")
|
|
7447
|
+
parts.push(response.error_description);
|
|
7444
7448
|
if (Array.isArray(response.errors)) {
|
|
7445
7449
|
for (const error of response.errors) {
|
|
7446
7450
|
if (!isRecord(error))
|
|
@@ -7837,6 +7841,8 @@ function createZoho(config, options = {}) {
|
|
|
7837
7841
|
const body = requireHttp(result, "Zoho OAuth token refresh", secrets);
|
|
7838
7842
|
if (!isRecord(body))
|
|
7839
7843
|
throw new Error("Zoho OAuth token refresh returned malformed data");
|
|
7844
|
+
if (typeof body.error === "string")
|
|
7845
|
+
throw new Error(`Zoho OAuth token refresh failed: ${redact(responseMessage(body), secrets)}`);
|
|
7840
7846
|
const token = valueString(body.access_token, "access_token", "Zoho OAuth token refresh");
|
|
7841
7847
|
secrets.push(token);
|
|
7842
7848
|
const expiresIn = Number(body.expires_in ?? 3600);
|
package/package.json
CHANGED