@tenonhq/sincronia-core 0.0.35 → 0.0.37

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.
@@ -141,46 +141,9 @@ var __importStar = (this && this.__importStar) || (function () {
141
141
  else {
142
142
  Logger_1.logger.info(`Found app: ${scopeApp.displayName} (${scopeName})`);
143
143
  }
144
- // Get manifest for this scope (without files first)
145
- Logger_1.logger.info(`Downloading manifest for scope: ${scopeName}`);
146
- const manifest = await (0, snClient_1.unwrapSNResponse)(client.getManifest(scopeName, config, false));
147
- // Now get the actual files using getMissingFiles
148
- Logger_1.logger.info(`Downloading files for scope: ${scopeName}...`);
149
- const missing = {};
150
- // Build missing files map from manifest
151
- const tables = (manifest === null || manifest === void 0 ? void 0 : manifest.tables) || {};
152
- for (const tableName of Object.keys(tables)) {
153
- const table = tables[tableName];
154
- for (const recordId of Object.keys(table.records || {})) {
155
- const record = table.records[recordId];
156
- if (record.files && record.files.length > 0) {
157
- if (!missing[tableName]) {
158
- missing[tableName] = {};
159
- }
160
- missing[tableName][recordId] = record.files.map(f => ({
161
- name: f.name,
162
- type: f.type
163
- }));
164
- }
165
- }
166
- }
167
- // Fetch the actual file contents
168
- let filesWithContent = {};
169
- if (Object.keys(missing).length > 0) {
170
- const tableOptions = (typeof scopeConfig === 'object' && scopeConfig.tableOptions) || config.tableOptions || {};
171
- filesWithContent = await (0, snClient_1.unwrapSNResponse)(client.getMissingFiles(missing, tableOptions));
172
- }
173
- // Merge the file contents back into the manifest
174
- for (const tableName of Object.keys(filesWithContent)) {
175
- if (manifest.tables[tableName]) {
176
- for (const recordId of Object.keys(filesWithContent[tableName].records || {})) {
177
- if (manifest.tables[tableName].records[recordId]) {
178
- manifest.tables[tableName].records[recordId].files =
179
- filesWithContent[tableName].records[recordId].files;
180
- }
181
- }
182
- }
183
- }
144
+ // Get manifest with files for this scope
145
+ Logger_1.logger.info(`Downloading manifest and files for scope: ${scopeName}`);
146
+ const manifest = await (0, snClient_1.unwrapSNResponse)(client.getManifest(scopeName, config, true));
184
147
  // Process the manifest to create local files in the correct directory
185
148
  Logger_1.logger.info(`Processing manifest and creating local files for ${scopeName}...`);
186
149
  Logger_1.logger.info(`Manifest has ${Object.keys((manifest === null || manifest === void 0 ? void 0 : manifest.tables) || {}).length} tables`);
package/dist/snClient.js CHANGED
@@ -179,6 +179,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
179
179
  excludes,
180
180
  tableOptions,
181
181
  withFiles,
182
+ getContents: withFiles, // ServiceNow expects getContents, not withFiles
182
183
  });
183
184
  };
184
185
  const changeUpdateSet = (params) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenonhq/sincronia-core",
3
- "version": "0.0.35",
3
+ "version": "0.0.37",
4
4
  "description": "Next-gen file syncer",
5
5
  "license": "GPL-3.0",
6
6
  "main": "./dist/index.js",
@@ -37,7 +37,7 @@
37
37
  "typescript": "^5.2.2"
38
38
  },
39
39
  "dependencies": {
40
- "@tenonhq/sincronia-core": "^0.0.29",
40
+ "@tenonhq/sincronia-core": "^0.0.35",
41
41
  "axios": "^1.5.1",
42
42
  "axios-rate-limit": "^1.3.0",
43
43
  "chalk": "^5.3.0",