@coherentglobal/spark-execute-sdk 0.3.13 → 0.3.15
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/package.json +3 -3
- package/.github/workflows/build-publish.yml +0 -50
- package/examples/UsingBearerTokenFNAsync/bearerTokenExample.js +0 -22
- package/examples/UsingBearerTokenFNAsync/config.js +0 -88
- package/examples/UsingBearerTokenFNAsync/index.html +0 -207
- package/examples/UsingBearerTokenFNAsync/modelCInput.json +0 -15
- package/examples/UsingBearerTokenFNAsync/models/Model_C.zip +0 -0
- package/examples/UsingBearerTokenString/bearerTokenExample.js +0 -22
- package/examples/UsingBearerTokenString/config.js +0 -182
- package/examples/UsingBearerTokenString/index.html +0 -191
- package/examples/UsingBearerTokenString/modelCInput.json +0 -15
- package/examples/UsingBearerTokenString/models/Model_C.zip +0 -0
- package/examples/UsingSyntheticKeyFNAsync/bearerTokenExample.js +0 -22
- package/examples/UsingSyntheticKeyFNAsync/config.js +0 -195
- package/examples/UsingSyntheticKeyFNAsync/index.html +0 -205
- package/examples/UsingSyntheticKeyFNAsync/modelCInput.json +0 -15
- package/examples/UsingSyntheticKeyFNAsync/models/Model_C.zip +0 -0
- package/examples/UsingSyntheticKeyString/bearerTokenExample.js +0 -41
- package/examples/UsingSyntheticKeyString/config.js +0 -182
- package/examples/UsingSyntheticKeyString/index.html +0 -192
- package/examples/UsingSyntheticKeyString/modelCInput.json +0 -17
- package/examples/UsingSyntheticKeyString/models/Model_C.zip +0 -0
- package/examples/asyncFunctionModel/config.js +0 -96
- package/examples/asyncFunctionModel/modelCInput.json +0 -15
- package/examples/asyncFunctionModel/models/Model_C.zip +0 -0
- package/examples/asyncFunctionModel/node.js +0 -125
- package/examples/asyncFunctionModel/tool.js +0 -17
- package/examples/base64Model/config.js +0 -96
- package/examples/base64Model/modelCInput.json +0 -15
- package/examples/base64Model/models/Model_C.zip +0 -0
- package/examples/base64Model/node.js +0 -125
- package/examples/base64Model/tool.js +0 -17
- package/examples/base64modelBrowser/config.js +0 -96
- package/examples/base64modelBrowser/index.html +0 -194
- package/examples/base64modelBrowser/modelCInput.json +0 -15
- package/examples/base64modelBrowser/models/Model_C.zip +0 -0
- package/examples/base64modelBrowser/models/base64model.txt +0 -1
- package/examples/base64modelBrowser/node.js +0 -126
- package/examples/base64modelBrowser/tool.js +0 -17
- package/examples/binary/config.js +0 -96
- package/examples/binary/modelCInput.json +0 -15
- package/examples/binary/models/Model_C.zip +0 -0
- package/examples/binary/models/binary.txt +0 -1
- package/examples/binary/node.js +0 -131
- package/examples/binary/tool.js +0 -18
- package/examples/functionModel/config.js +0 -96
- package/examples/functionModel/index.html +0 -218
- package/examples/functionModel/modelCInput.json +0 -15
- package/examples/functionModel/models/0211e8f0-9988-4514-a761-9782db6700ce.zip +0 -0
- package/examples/functionModel/node.js +0 -138
- package/examples/functionModel/tool.js +0 -17
- package/examples/nodejs/node.js +0 -250
- package/examples/nodejs/test_models/Archive.zip +0 -0
- package/examples/nodejs/test_models/BlackScholes.zip +0 -0
- package/examples/nodejs/test_models/Model_A.zip +0 -0
- package/examples/nodejs/test_models/Par7.zip +0 -0
- package/examples/unzippedModel/config.js +0 -96
- package/examples/unzippedModel/index.html +0 -195
- package/examples/unzippedModel/modelCInput.json +0 -15
- package/examples/unzippedModel/models/0211e8f0-9988-4514-a761-9782db6700ce/Model_C.data +0 -0
- package/examples/unzippedModel/models/0211e8f0-9988-4514-a761-9782db6700ce/Model_C.js +0 -21
- package/examples/unzippedModel/models/0211e8f0-9988-4514-a761-9782db6700ce/Model_C.wasm +0 -0
- package/examples/unzippedModel/node.js +0 -125
- package/examples/unzippedModel/tool.js +0 -17
- package/examples/v16UpstreamDownStream/config.js +0 -151
- package/examples/v16UpstreamDownStream/configs/Downstream.json +0 -93
- package/examples/v16UpstreamDownStream/configs/Upstream.json +0 -102
- package/examples/v16UpstreamDownStream/index.html +0 -216
- package/examples/v16UpstreamDownStream/inputs/Downstream.json +0 -15
- package/examples/v16UpstreamDownStream/inputs/Upstream.json +0 -13
- package/examples/v16UpstreamDownStream/models/DownstreamService_example/DownstreamService_example.data +0 -0
- package/examples/v16UpstreamDownStream/models/DownstreamService_example/DownstreamService_example.js +0 -21
- package/examples/v16UpstreamDownStream/models/DownstreamService_example/DownstreamService_example.wasm +0 -0
- package/examples/v16UpstreamDownStream/models/DownstreamService_example.zip +0 -0
- package/examples/v16UpstreamDownStream/models/UpstreamService_example.zip +0 -0
- package/examples/v16UpstreamDownStream/models/base64modelA.txt +0 -1
- package/examples/v16UpstreamDownStream/models/base64modelB.txt +0 -1
- package/examples/v16UpstreamDownStream/node.js +0 -226
- package/examples/v16UpstreamDownStream/tools.js +0 -25
- package/src/tenant_resolver/externalResolver_coherent.js +0 -118
- package/src/tenant_resolver/externalResolver_test.js +0 -118
- package/test/config.test.js +0 -124
- package/test/mock-data/dummy-config.json +0 -102
- package/test/mock-data/valid.json +0 -21
- package/test/spark-sdk.test.js +0 -20
package/examples/binary/node.js
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
console.log("SPARK START: ");
|
|
2
|
-
|
|
3
|
-
const Spark = require("../../src/node.js");
|
|
4
|
-
const modelC = require("./modelCInput.json");
|
|
5
|
-
const fs = require("fs");
|
|
6
|
-
const location = "./models/Model_C.zip";
|
|
7
|
-
const file = fs.readFileSync(location);
|
|
8
|
-
const data = file.toString("base64");
|
|
9
|
-
const buffer = Buffer.from(data, "base64");
|
|
10
|
-
const uint = new Uint8Array(buffer);
|
|
11
|
-
|
|
12
|
-
const config = {
|
|
13
|
-
sparkEndpoint: {
|
|
14
|
-
url: "https://spark.dev.coherent.global",
|
|
15
|
-
tenant: "coherent",
|
|
16
|
-
authType: "bearerToken",
|
|
17
|
-
bearerToken: "",
|
|
18
|
-
},
|
|
19
|
-
nodeGenModels: [
|
|
20
|
-
{
|
|
21
|
-
versionId: "0211e8f0-9988-4514-a761-9782db6700ce",
|
|
22
|
-
type: "binary",
|
|
23
|
-
binary: uint,
|
|
24
|
-
metaData: {
|
|
25
|
-
id: "7156c7a4-8a81-4d83-ac7f-a54ce02009da",
|
|
26
|
-
url: "/docstore/api/v1/documents/versions/tokens/ItHPu2LY%2F626xeFbg%2BlSskCRy0%2FKjVp0H4uIcJmX%2BH0ehoZgRGXefIcHwR9PuX7kKHk3ywjoy6hVqkIDPWn4jAcsDN07VXdys0%2Fi4LdSxmtKGKF8IT9f%2FZZWRGWTmNWQ9SweGfiT7xc5N2%2BC9aTmlySAtACZkcdYDpsKtSuhvSJrRrSkzlt9Ra4TPBXTaokPfGR6VzK%2FMKM%2B3y3aXt3sT0P5EIRF%2BtMrVmpwmTTGva8%3D/Model_C.c1engine",
|
|
27
|
-
EngineInformation: {
|
|
28
|
-
FileSize: 4885,
|
|
29
|
-
Author: "francisc.camillo@coherent.global",
|
|
30
|
-
ProductName: "ExecuteSDK",
|
|
31
|
-
Revision: "1.0.0",
|
|
32
|
-
Description: null,
|
|
33
|
-
FileMD5Hash: "3E9395DB32F0E8430BD8865DDA53753C",
|
|
34
|
-
UniversalFileHash: null,
|
|
35
|
-
ReleaseDate: "2022-08-23T13:06:52.786Z",
|
|
36
|
-
ServiceName: "Model_C",
|
|
37
|
-
NoOfInstance: 1,
|
|
38
|
-
UploaderEmail: "francisc.camillo@coherent.global",
|
|
39
|
-
DefaultEngineType: "NodeGen",
|
|
40
|
-
OriginalFileName: "Model_C.xlsx",
|
|
41
|
-
SizeOfUploadedFile: 4885,
|
|
42
|
-
ReleaseNote: null,
|
|
43
|
-
IsTypeScriptFile: false,
|
|
44
|
-
IsJsSheetEngineGenerated: false,
|
|
45
|
-
EngineUpgradeType: "minor",
|
|
46
|
-
PublicAPI: true,
|
|
47
|
-
FileGuid: "42efc880-91f1-4928-88cc-b29b68327f26",
|
|
48
|
-
ServiceGuid: "bcc2f47d-0682-4d2b-9174-5b01f903ee6b",
|
|
49
|
-
ServiceVersionGuid: "0211e8f0-9988-4514-a761-9782db6700ce",
|
|
50
|
-
BaseUrl: "https://excel.dev.coherent.global",
|
|
51
|
-
Tenant: "coherent",
|
|
52
|
-
AllowToStoreHistory: true,
|
|
53
|
-
CalcMode: "AUTO",
|
|
54
|
-
ForceInputsWriteBeforeCalcModeChanges: true,
|
|
55
|
-
Provenance: null,
|
|
56
|
-
VersionLabel: "Model_C",
|
|
57
|
-
ExplainerType: "",
|
|
58
|
-
IsXParameter: false,
|
|
59
|
-
XParameterSetVersionId: "",
|
|
60
|
-
VersionUpgradeAssert: "OFF",
|
|
61
|
-
},
|
|
62
|
-
XInputTable: [
|
|
63
|
-
{
|
|
64
|
-
"Input Name": "Input",
|
|
65
|
-
Description: null,
|
|
66
|
-
Address: "C2",
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
XOutputTable: [
|
|
70
|
-
{
|
|
71
|
-
"Output Name": "Output1",
|
|
72
|
-
Description: null,
|
|
73
|
-
Address: "C3",
|
|
74
|
-
},
|
|
75
|
-
],
|
|
76
|
-
FormsService: null,
|
|
77
|
-
StaticService: null,
|
|
78
|
-
VersionId: "0211e8f0-9988-4514-a761-9782db6700ce",
|
|
79
|
-
created: "2022-08-23T13:06:55.017422Z",
|
|
80
|
-
effectiveStartDate: "2009-12-31T16:00:00Z",
|
|
81
|
-
effectiveEndDate: "2119-12-31T16:00:00Z",
|
|
82
|
-
path: "/products/ExecuteSDK/productfactory/engines/Model_C/Model_C.c1engine",
|
|
83
|
-
privacyLevel: "Private",
|
|
84
|
-
dateTime1: "2009-12-31T16:00:00Z",
|
|
85
|
-
dateTime2: "2119-12-31T16:00:00Z",
|
|
86
|
-
status1: "nodegen",
|
|
87
|
-
status2: "Model_C.xlsx",
|
|
88
|
-
email1: null,
|
|
89
|
-
email2: null,
|
|
90
|
-
amount1: 4885,
|
|
91
|
-
amount2: 9184,
|
|
92
|
-
amount3: null,
|
|
93
|
-
type: "EngineDocument",
|
|
94
|
-
policyNumber: "francisc.camillo@coherent.global",
|
|
95
|
-
name1: "Model_C",
|
|
96
|
-
name2: "Model_C.c1engine",
|
|
97
|
-
otherString1: "1.0.0",
|
|
98
|
-
otherString2: "EngineFile",
|
|
99
|
-
referenceId: "ExecuteSDK~Model_C.c1engine",
|
|
100
|
-
disposition: null,
|
|
101
|
-
productName: "ExecuteSDK",
|
|
102
|
-
content: null,
|
|
103
|
-
latestVersionId: "0211e8f0-9988-4514-a761-9782db6700ce",
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
],
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
let spark;
|
|
110
|
-
try {
|
|
111
|
-
spark = new Spark(config);
|
|
112
|
-
} catch (err) {
|
|
113
|
-
console.log("ERR: ", err);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const modelToTest = "0211e8f0-9988-4514-a761-9782db6700ce"; // Model C
|
|
117
|
-
const dataInput = modelC;
|
|
118
|
-
|
|
119
|
-
async function execute() {
|
|
120
|
-
console.log("Reached");
|
|
121
|
-
try {
|
|
122
|
-
let result = await spark.execute(dataInput);
|
|
123
|
-
|
|
124
|
-
console.log("Final Result", result);
|
|
125
|
-
return result;
|
|
126
|
-
} catch (err) {
|
|
127
|
-
console.log("No model found", err);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
(async () => await execute())();
|
package/examples/binary/tool.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
const fs = require('fs')
|
|
2
|
-
const location = "./models/Model_C.zip"
|
|
3
|
-
|
|
4
|
-
const file = fs.readFileSync(location)
|
|
5
|
-
|
|
6
|
-
// generate base64
|
|
7
|
-
const data = file.toString('base64')
|
|
8
|
-
const buffer = Buffer.from(data, 'base64')
|
|
9
|
-
const uint = new Uint8Array(buffer)
|
|
10
|
-
const newBuffer = Buffer.from(uint)
|
|
11
|
-
console.log("NEW: ", newBuffer)
|
|
12
|
-
// fs.writeFileSync('./models/binary.txt', data)
|
|
13
|
-
|
|
14
|
-
// generate blob
|
|
15
|
-
// const blob = atob(data)
|
|
16
|
-
// fs.writeFileSync('./models/blobmodel.txt', blob)
|
|
17
|
-
|
|
18
|
-
|