sfc-utils 1.4.207 → 1.4.208

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 (2) hide show
  1. package/copy/sheets.js +17 -7
  2. package/package.json +1 -1
package/copy/sheets.js CHANGED
@@ -36,20 +36,20 @@ var cast = function (str, forceStr) {
36
36
  return str;
37
37
  };
38
38
 
39
- let googleAuth = (project, directory = null, forceStr = false) => {
39
+ let googleAuth = (project, directory = null, forceStr = false, options = {}) => {
40
40
  return new Promise((resolveFinal) => {
41
41
  var auth = null;
42
42
  authObj
43
43
  .authenticate({ fallback: false })
44
44
  .then((resp) => {
45
45
  auth = resp;
46
- grabSheets(auth, project, directory, forceStr)
46
+ grabSheets(auth, project, directory, forceStr, options)
47
47
  .then(() => resolveFinal())
48
48
  .catch(() => {
49
49
  // If the first attempt failed, then make another req using the fallback
50
50
  authObj.authenticate({ fallback: true }).then((resp) => {
51
51
  auth = resp;
52
- grabSheets(auth, project, directory, forceStr).then(() =>
52
+ grabSheets(auth, project, directory, forceStr, options).then(() =>
53
53
  resolveFinal()
54
54
  );
55
55
  });
@@ -58,14 +58,14 @@ let googleAuth = (project, directory = null, forceStr = false) => {
58
58
  .catch(() => {
59
59
  // Failure if we fall back but there's no token
60
60
  auth = authObj.task();
61
- grabSheets(auth, project, directory, forceStr).then(() =>
61
+ grabSheets(auth, project, directory, forceStr, options).then(() =>
62
62
  resolveFinal()
63
63
  );
64
64
  });
65
65
  });
66
66
  };
67
67
 
68
- let grabSheets = (auth, project, directory, forceStr) => {
68
+ let grabSheets = (auth, project, directory, forceStr, options = {}) => {
69
69
  return new Promise((resolveAll, rejectAll) => {
70
70
  var sheetKeys = project.GOOGLE_SHEETS;
71
71
  if (!sheetKeys) {
@@ -90,7 +90,8 @@ let grabSheets = (auth, project, directory, forceStr) => {
90
90
  spreadsheetId,
91
91
  directory,
92
92
  forceStr,
93
- project
93
+ project,
94
+ options
94
95
  );
95
96
  });
96
97
  promiseStack.push(promiseItem);
@@ -114,7 +115,8 @@ let getSheet = async (
114
115
  spreadsheetId,
115
116
  directory,
116
117
  forceStr,
117
- project
118
+ project,
119
+ options = {}
118
120
  ) => {
119
121
  let output = await api.spreadsheets
120
122
  .get({
@@ -137,8 +139,16 @@ let getSheet = async (
137
139
  }
138
140
  console.log("language swap:", languageSwap);
139
141
  // Process all other sheets with the language swap
142
+ const sheetNames = Array.isArray(options.sheetNames)
143
+ ? options.sheetNames
144
+ : [];
140
145
  for (var sheet of sheets) {
141
146
  if (sheet.properties.title[0] == "_") continue;
147
+ if (
148
+ sheetNames.length &&
149
+ sheetNames.indexOf(sheet.properties.title) === -1
150
+ )
151
+ continue;
142
152
  await processSheetData(
143
153
  auth,
144
154
  spreadsheetId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sfc-utils",
3
- "version": "1.4.207",
3
+ "version": "1.4.208",
4
4
  "author": "ewagstaff <evanjwagstaff@gmail.com>",
5
5
  "dependencies": {
6
6
  "archieml": "^0.4.2",