@mcpher/gas-fakes 1.0.24 → 1.0.26

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.
@@ -0,0 +1,47 @@
1
+ {
2
+ "timeZone": "Europe/London",
3
+ "exceptionLogging": "STACKDRIVER",
4
+ "runtimeVersion": "V8",
5
+ "oauthScopes": [
6
+ "https://www.googleapis.com/auth/drive",
7
+ "https://www.googleapis.com/auth/script.external_request",
8
+ "https://www.googleapis.com/auth/spreadsheets",
9
+ "https://www.googleapis.com/auth/userinfo.email",
10
+ "https://www.googleapis.com/auth/documents",
11
+ "https://www.googleapis.com/auth/presentations",
12
+ "https://www.googleapis.com/auth/forms",
13
+ "https://www.googleapis.com/auth/gmail.labels"
14
+ ],
15
+ "dependencies": {
16
+ "libraries": [
17
+ {
18
+ "userSymbol": "bmUnitTester",
19
+ "version": "20",
20
+ "libraryId": "1zOlHMOpO89vqLPe5XpC-wzA9r5yaBkWt_qFjKqFNsIZtNJ-iUjBYDt-x"
21
+ },
22
+ {
23
+ "userSymbol": "bmIs",
24
+ "version": "1",
25
+ "libraryId": "1tFa7Gc68142wiiZaNmj0zA-ELDHh0q31eDXodeeCf1LxRR1LeSr3opAd"
26
+ },
27
+ {
28
+ "userSymbol": "bmFiddler",
29
+ "version": "30",
30
+ "libraryId": "13EWG4-lPrEf34itxQhAQ7b9JEbmCBfO8uE4Mhr99CHi3Pw65oxXtq-rU",
31
+ "developmentMode": false
32
+ }
33
+ ],
34
+ "enabledAdvancedServices": [
35
+ {
36
+ "userSymbol": "Docs",
37
+ "version": "v1",
38
+ "serviceId": "docs"
39
+ },
40
+ {
41
+ "userSymbol": "Drive",
42
+ "version": "v3",
43
+ "serviceId": "drive"
44
+ }
45
+ ]
46
+ }
47
+ }
@@ -1,24 +1,33 @@
1
- import '../../main.js';
2
- import { moveToTempFolder, deleteTempFile } from './tempfolder.js';
1
+ /**
2
+ * @OnlyCurrentDoc
3
+ */
4
+ import '@mcpher/gas-fakes';
3
5
 
4
- // put all this stuff in a temp folder for easy deletion
5
- const ss = SpreadsheetApp.create("--gasmess-sheet")
6
- moveToTempFolder(ss.getId())
6
+ // the test
7
+ const test = () => {
8
+ // enable sandbox mode
9
+ ScriptApp.__behavior.sandboxMode = true;
7
10
 
8
- const sheet = ss.insertSheet()
9
- const values = [[1,2,3,'=A1+B1'],[4,5,6,'=sum(A2:c2)'],[7,8,9, '=d1+d2']]
10
- const range = sheet.getRange(1,1,values.length,values[0].length)
11
- range.setValues(values)
11
+ // create a new document
12
+ const doc = DocumentApp.create('--gas-fakes-test');
12
13
 
13
- const result = range.getDisplayValues()
14
+ // append a paragraph
15
+ const text = 'coffee turns potential into momentum.';
16
+ doc.getBody().appendParagraph(text);
17
+ doc.saveAndClose();
14
18
 
15
- console.log (result)
19
+ // read the document text and ensure it matches what you created
20
+ const readText = DocumentApp.openById(doc.getId()).getBody().getText();
16
21
 
17
- /* result is correct
18
- * [
19
- [ '1', '2', '3', '3' ],
20
- [ '4', '5', '6', '15' ],
21
- [ '7', '8', '9', '18' ]
22
- ]
23
- */
24
- deleteTempFile(ss.getId())
22
+ // check it
23
+ if (text !== readText.trim()) {
24
+ throw new Error(`expected "${text}", but got "${readText}"`);
25
+ }
26
+ console.log('document created and read back successfully');
27
+
28
+ // tidy up sandbox
29
+ ScriptApp.__behavior.trash();
30
+ }
31
+
32
+ // run the test
33
+ test();
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "brucemess",
3
+ "version": "1.0.0",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "brucemess",
9
+ "version": "1.0.0",
10
+ "license": "ISC",
11
+ "dependencies": {
12
+ "@mcpher/gas-fakes": "file:../../"
13
+ }
14
+ },
15
+ "..": {
16
+ "extraneous": true
17
+ },
18
+ "../..": {
19
+ "name": "@mcpher/gas-fakes",
20
+ "version": "1.0.25",
21
+ "license": "MIT",
22
+ "dependencies": {
23
+ "@google-cloud/logging": "^11.2.1",
24
+ "@mcpher/fake-gasenum": "^1.0.2",
25
+ "@sindresorhus/is": "^7.0.1",
26
+ "archiver": "^7.0.1",
27
+ "exceljs": "^4.4.0",
28
+ "fast-json-stable-stringify": "^2.1.0",
29
+ "get-stream": "^9.0.1",
30
+ "googleapis": "^157.0.0",
31
+ "got": "^14.4.7",
32
+ "into-stream": "^8.0.1",
33
+ "is": "^3.3.2",
34
+ "keyv": "^5.5.0",
35
+ "keyv-file": "^5.1.3",
36
+ "mime": "^4.0.7",
37
+ "sinon": "^21.0.0",
38
+ "sleep-synchronously": "^2.0.0",
39
+ "subsume": "^4.0.0",
40
+ "to-readable-stream": "^4.0.0",
41
+ "unzipper": "^0.12.3",
42
+ "yoctocolors": "^2.1.2"
43
+ },
44
+ "engines": {
45
+ "node": ">=20.11.0"
46
+ }
47
+ },
48
+ "node_modules/@mcpher/gas-fakes": {
49
+ "resolved": "../..",
50
+ "link": true
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "brucemess",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "basic.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "dev": "node --conditions=development"
9
+ },
10
+ "author": "",
11
+ "license": "ISC",
12
+ "type": "module",
13
+ "dependencies": {
14
+
15
+ "@mcpher/gas-fakes": "file:../../"
16
+ }
17
+ }
@@ -1,9 +1,9 @@
1
- import '../../main.js';
1
+
2
2
  import { moveToTempFolder, deleteTempFile } from '../tempfolder.js';
3
3
  import { report, scl } from './dreport.js';
4
4
 
5
5
 
6
-
6
+ import '@mcpher/gas-fakes';
7
7
  const suffix = "-bruce"
8
8
  const tli = () => {
9
9
  let doc = DocumentApp.create("abc")
package/index.js ADDED
File without changes
package/package.json CHANGED
@@ -26,49 +26,57 @@
26
26
  },
27
27
  "type": "module",
28
28
  "scripts": {
29
- "test": "cp mainlocal.js main.js && node ./test/test.js",
30
- "testdrive": "cp mainlocal.js main.js && node ./test/testdrive.js execute",
31
- "testsheetsdatavalidations": "cp mainlocal.js main.js && node ./test/testsheetsdatavalidations.js execute",
32
- "testsheetspermissions": "cp mainlocal.js main.js && node ./test/testsheetspermissions.js execute",
33
- "testsheetsvalues": "cp mainlocal.js main.js && node ./test/testsheetsvalues.js execute",
34
- "testsheets": "cp mainlocal.js main.js && node ./test/testsheets.js execute",
35
- "testfetch": "cp mainlocal.js main.js && node ./test/testfetch.js execute",
36
- "testsession": "cp mainlocal.js main.js && node ./test/testsession.js execute",
37
- "testutilities": "cp mainlocal.js main.js && node ./test/testutilities.js execute",
38
- "teststores": "cp mainlocal.js main.js && node ./test/teststores.js execute",
39
- "testscriptapp": "cp mainlocal.js main.js && node ./test/testscriptapp.js execute",
40
- "testfiddler": "cp mainlocal.js main.js && node ./test/testfiddler.js execute",
41
- "testenums": "cp mainlocal.js main.js && node ./test/testenums.js execute",
42
- "testsheetssets": "cp mainlocal.js main.js && node ./test/testsheetssets.js execute",
43
- "testsheetsvui": "cp mainlocal.js main.js && node ./test/testsheetsvui.js execute",
44
- "testsheetsdeveloper": "cp mainlocal.js main.js && node ./test/testsheetsdeveloper.js execute",
45
- "testsheetsexotics": "cp mainlocal.js main.js && node ./test/testsheetsexotics.js execute",
46
- "testsheetsdata": "cp mainlocal.js main.js && node ./test/testsheetsdata.js execute",
47
- "testdocsadv": "cp mainlocal.js main.js && node ./test/testdocsadv.js execute",
48
- "testslidesadv": "cp mainlocal.js main.js && node ./test/testslidesadv.js execute",
49
- "testform": "cp mainlocal.js main.js && node ./test/testform.js execute",
50
- "testformsadv": "cp mainlocal.js main.js && node ./test/testformsadv.js execute",
51
- "testdocs": "cp mainlocal.js main.js && node ./test/testdocs.js execute",
52
- "testslides": "cp mainlocal.js main.js && node ./test/testslides.js execute",
53
- "testdocsnext": "cp mainlocal.js main.js && node ./test/testdocsnext.js execute",
54
- "testsheetstext": "cp mainlocal.js main.js && node ./test/testsheetstext.js execute",
55
- "testsheetsrange": "cp mainlocal.js main.js && node ./test/testsheetsrange.js execute",
56
- "testdocslistitems": "cp mainlocal.js main.js && node ./test/testdocslistitems.js execute",
57
- "testdocsall": "cp mainlocal.js main.js && node ./test/testdocsall.js",
58
- "testdocsheaders": "cp mainlocal.js main.js && node ./test/testdocsheaders.js execute",
59
- "testdocsfooters": "cp mainlocal.js main.js && node ./test/testdocsfooters.js execute",
60
- "testdocsfootnotes": "cp mainlocal.js main.js && node ./test/testdocsfootnotes.js execute",
61
- "testdocsimages": "cp mainlocal.js main.js && node ./test/testdocsimages.js execute",
62
- "testdocsstyles": "cp mainlocal.js main.js && node ./test/testdocsstyles.js execute",
63
- "testsandbox": "cp mainlocal.js main.js && node ./test/testsandbox.js execute",
64
- "testgmail": "cp mainlocal.js main.js && node ./test/testgmail.js execute",
65
- "testlogger": "cp mainlocal.js main.js && node ./test/testlogger.js execute",
66
- "pub": "cp mainlocal.js main.js && npm publish --access public"
29
+ "test": "node ./test/test.js",
30
+ "testdrive": "node ./test/testdrive.js execute",
31
+ "testsheetsdatavalidations": "node ./test/testsheetsdatavalidations.js execute",
32
+ "testsheetspermissions": "node ./test/testsheetspermissions.js execute",
33
+ "testsheetsvalues": "node ./test/testsheetsvalues.js execute",
34
+ "testsheets": "node ./test/testsheets.js execute",
35
+ "testfetch": "node ./test/testfetch.js execute",
36
+ "testsession": "node ./test/testsession.js execute",
37
+ "testutilities": "node ./test/testutilities.js execute",
38
+ "teststores": "node ./test/teststores.js execute",
39
+ "testscriptapp": "node ./test/testscriptapp.js execute",
40
+ "testfiddler": "node ./test/testfiddler.js execute",
41
+ "testenums": "node ./test/testenums.js execute",
42
+ "testsheetssets": "node ./test/testsheetssets.js execute",
43
+ "testsheetsvui": "node ./test/testsheetsvui.js execute",
44
+ "testsheetsdeveloper": "node ./test/testsheetsdeveloper.js execute",
45
+ "testsheetsexotics": "node ./test/testsheetsexotics.js execute",
46
+ "testsheetsdata": "node ./test/testsheetsdata.js execute",
47
+ "testdocsadv": "node ./test/testdocsadv.js execute",
48
+ "testslidesadv": "node ./test/testslidesadv.js execute",
49
+ "testform": "node ./test/testform.js execute",
50
+ "testformsadv": "node ./test/testformsadv.js execute",
51
+ "testdocs": "node ./test/testdocs.js execute",
52
+ "testslides": "node ./test/testslides.js execute",
53
+ "testdocsnext": "node ./test/testdocsnext.js execute",
54
+ "testsheetstext": "node ./test/testsheetstext.js execute",
55
+ "testsheetsrange": "node ./test/testsheetsrange.js execute",
56
+ "testdocslistitems": "node ./test/testdocslistitems.js execute",
57
+ "testdocsall": "node ./test/testdocsall.js",
58
+ "testdocsheaders": "node ./test/testdocsheaders.js execute",
59
+ "testdocsfooters": "node ./test/testdocsfooters.js execute",
60
+ "testdocsfootnotes": "node ./test/testdocsfootnotes.js execute",
61
+ "testdocsimages": "node ./test/testdocsimages.js execute",
62
+ "testdocsstyles": "node ./test/testdocsstyles.js execute",
63
+ "testsandbox": "node ./test/testsandbox.js execute",
64
+ "testgmail": "node ./test/testgmail.js execute",
65
+ "testlogger": "node ./test/testlogger.js execute",
66
+ "pub": "npm publish --access public"
67
67
  },
68
68
  "name": "@mcpher/gas-fakes",
69
- "version": "1.0.24",
69
+ "version": "1.0.26",
70
70
  "license": "MIT",
71
71
  "main": "main.js",
72
+ "exports": {
73
+ ".": {
74
+ "development": "./src/index.js",
75
+ "import": "./main.js",
76
+ "default": "./main.js"
77
+ },
78
+ "./package.json": "./package.json"
79
+ },
72
80
  "description": "A proof of concept implementation of Apps Script Environment on Node",
73
81
  "repository": "github:brucemcpherson/gas-fakes",
74
82
  "homepage": "https://ramblings.mcpher.com/a-proof-of-concept-implementation-of-apps-script-environment-on-node/"