npm package diff
Package: @forge/runtime
Versions: 6.0.0-next.0-experimental-97e4b11 - 6.0.0-next.1
Removed: package/out/app-manifest.js
Removed: package/out/config.js
Removed: package/out/context.js
Removed: package/out/feature-flag.js
Removed: package/out/limits/index.js
Removed: package/out/metrics/index.js
Removed: package/out/sandbox/inspector.js
Removed: package/out/sandbox/invocation-request.js
Removed: package/out/logger.js
Removed: package/out/metrics/metrics.js
Removed: package/out/snapshot.js
Removed: package/out/limits/tracker.js
Removed: package/out/app-manifest.d.ts.map
Removed: package/out/config.d.ts.map
Removed: package/out/context.d.ts.map
Removed: package/out/feature-flag.d.ts.map
Removed: package/out/limits/index.d.ts.map
Removed: package/out/metrics/index.d.ts.map
Removed: package/out/sandbox/inspector.d.ts.map
Removed: package/out/sandbox/invocation-request.d.ts.map
Removed: package/out/logger.d.ts.map
Removed: package/out/metrics/metrics.d.ts.map
Removed: package/out/snapshot.d.ts.map
Removed: package/out/limits/tracker.d.ts.map
Removed: package/out/app-manifest.d.ts
Removed: package/out/config.d.ts
Removed: package/out/context.d.ts
Removed: package/out/feature-flag.d.ts
Removed: package/out/limits/index.d.ts
Removed: package/out/metrics/index.d.ts
Removed: package/out/sandbox/inspector.d.ts
Removed: package/out/sandbox/invocation-request.d.ts
Removed: package/out/logger.d.ts
Removed: package/out/metrics/metrics.d.ts
Removed: package/out/snapshot.d.ts
Removed: package/out/limits/tracker.d.ts
Modified: package/out/index.js
Index: package/out/index.js
===================================================================
--- package/out/index.js
+++ package/out/index.js
@@ -1,27 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.invoke = exports.validateInvocation = exports.InvocationValidationError = exports.getUserVars = exports.initializeInspector = void 0;
+exports.getUserVars = void 0;
const tslib_1 = require("tslib");
-const Either_1 = require("fp-ts/lib/Either");
-const io_ts_reporters_1 = tslib_1.__importDefault(require("io-ts-reporters"));
-const request_1 = require("./request");
-const inspector_1 = require("./sandbox/inspector");
-tslib_1.__exportStar(require("./app-manifest"), exports);
-tslib_1.__exportStar(require("./config"), exports);
-tslib_1.__exportStar(require("./context"), exports);
-tslib_1.__exportStar(require("./feature-flag"), exports);
-tslib_1.__exportStar(require("./metrics"), exports);
tslib_1.__exportStar(require("./request"), exports);
tslib_1.__exportStar(require("./result"), exports);
-tslib_1.__exportStar(require("./snapshot"), exports);
-tslib_1.__exportStar(require("./limits"), exports);
-tslib_1.__exportStar(require("./logger"), exports);
tslib_1.__exportStar(require("./sandbox"), exports);
-function initializeInspector() {
- return new inspector_1.ChromeInspector();
-}
-exports.initializeInspector = initializeInspector;
function getUserVars() {
const prefix = 'FORGE_USER_VAR_';
const envKeys = Object.keys(process.env);
return envKeys.reduce((userVars, name) => {
@@ -35,24 +19,4 @@
return userVars;
}, []);
}
exports.getUserVars = getUserVars;
-class InvocationValidationError extends Error {
-}
-exports.InvocationValidationError = InvocationValidationError;
-function failedInvocationMessage(validationResult) {
- return ['Invocation validation failed:', ...io_ts_reporters_1.default.report(validationResult)].join('\n');
-}
-function validateInvocation(invocation) {
- const validationResult = request_1.ExternalRequestBodyType.decode(invocation);
- if ((0, Either_1.isLeft)(validationResult)) {
- throw new InvocationValidationError(failedInvocationMessage(validationResult));
- }
- else {
- return validationResult.right;
- }
-}
-exports.validateInvocation = validateInvocation;
-function invoke(invocation) {
- return invocation.sandbox.execute(invocation.xenInvocationRequest, invocation.invocationLimits, invocation.inspector);
-}
-exports.invoke = invoke;
Modified: package/out/sandbox/index.js
Index: package/out/sandbox/index.js
===================================================================
--- package/out/sandbox/index.js
+++ package/out/sandbox/index.js
@@ -1,7 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
-tslib_1.__exportStar(require("./inspector"), exports);
tslib_1.__exportStar(require("./invocation-event"), exports);
-tslib_1.__exportStar(require("./invocation-request"), exports);
tslib_1.__exportStar(require("./sandbox"), exports);
Modified: package/out/sandbox/invocation-event.js
Index: package/out/sandbox/invocation-event.js
===================================================================
--- package/out/sandbox/invocation-event.js
+++ package/out/sandbox/invocation-event.js
@@ -1,57 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.p3LogEvent = exports.invokeNetworkRequestFinishEvent = exports.invokeNetworkRequestStartEvent = exports.getHostname = exports.isNonEmptyArray = exports.EVENT_NETWORK_REQUEST_FINISH = exports.EVENT_NETWORK_REQUEST_START = exports.EVENT_P3_LOG = exports.StaticInvocationEventEmitter = void 0;
+exports.EVENT_P3_LOG = exports.StaticInvocationEventEmitter = exports.LogLevel = void 0;
const events_1 = require("events");
-const url_1 = require("url");
+var LogLevel;
+(function (LogLevel) {
+ LogLevel[LogLevel["DEBUG"] = 20] = "DEBUG";
+ LogLevel[LogLevel["INFO"] = 30] = "INFO";
+ LogLevel[LogLevel["WARN"] = 40] = "WARN";
+ LogLevel[LogLevel["ERROR"] = 50] = "ERROR";
+ LogLevel[LogLevel["FATAL"] = 60] = "FATAL";
+})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
class InvocationEventEmitter extends events_1.EventEmitter {
}
exports.StaticInvocationEventEmitter = new InvocationEventEmitter();
exports.EVENT_P3_LOG = 'p3-log';
-exports.EVENT_NETWORK_REQUEST_START = 'network-request-start';
-exports.EVENT_NETWORK_REQUEST_FINISH = 'network-request-finish';
-function isNonEmptyArray(arr) {
- return arr.length > 0;
-}
-exports.isNonEmptyArray = isNonEmptyArray;
-function getHostname(url) {
- let host;
- try {
- host = new url_1.URL(url).hostname;
- }
- catch (e) {
- host = '';
- }
- return host;
-}
-exports.getHostname = getHostname;
-function invokeNetworkRequestStartEvent(invocation, networkEvent) {
- const eventData = {
- invocationId: invocation.getInvocationId(),
- hostname: getHostname(networkEvent.url),
- request: {
- body: networkEvent.request.body,
- headers: networkEvent.request.headers
- }
- };
- exports.StaticInvocationEventEmitter.emit(exports.EVENT_NETWORK_REQUEST_START, eventData);
-}
-exports.invokeNetworkRequestStartEvent = invokeNetworkRequestStartEvent;
-function invokeNetworkRequestFinishEvent(invocation, networkEvent) {
- const eventData = {
- invocationId: invocation.getInvocationId(),
- hostname: getHostname(networkEvent.url),
- response: networkEvent.response,
- error: networkEvent.error
- };
- exports.StaticInvocationEventEmitter.emit(exports.EVENT_NETWORK_REQUEST_FINISH, eventData);
-}
-exports.invokeNetworkRequestFinishEvent = invokeNetworkRequestFinishEvent;
-function p3LogEvent(invocation, logLevel, logArguments) {
- const eventData = {
- invocationId: invocation.getInvocationId(),
- logLevel,
- logArguments
- };
- exports.StaticInvocationEventEmitter.emit(exports.EVENT_P3_LOG, eventData);
-}
-exports.p3LogEvent = p3LogEvent;
Modified: package/out/request.js
Index: package/out/request.js
===================================================================
--- package/out/request.js
+++ package/out/request.js
@@ -1,132 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.InvocationType = exports.ExternalRequestBodyType = exports.LicenseType = void 0;
-const tslib_1 = require("tslib");
-const t = tslib_1.__importStar(require("io-ts"));
-const Remote = t.type({
- baseUrl: t.string,
- key: t.string
-});
-const ExternalAuthMetaDataAccount = t.intersection([
- t.type({
- id: t.string,
- externalAccountId: t.string,
- displayName: t.string,
- scopes: t.array(t.string)
- }),
- t.partial({
- avatarUrl: t.string
- })
-]);
-const ExternalAuthMetaData = t.type({
- service: t.string,
- remotes: t.array(Remote),
- accounts: t.array(ExternalAuthMetaDataAccount)
-});
-const XisRequestTokenType = t.intersection([
- t.type({
- id: t.string,
- service: t.string,
- token: t.string
- }),
- t.partial({
- externalAccountId: t.string,
- displayName: t.string,
- avatarUrl: t.union([t.string, t.undefined]),
- scopes: t.array(t.string)
- })
-]);
-exports.LicenseType = t.intersection([
- t.type({
- isActive: t.boolean
- }),
- t.partial({
- billingPeriod: t.union([t.string, t.null]),
- capabilitySet: t.union([t.string, t.null]),
- ccpEntitlementId: t.union([t.string, t.null]),
- ccpEntitlementSlug: t.union([t.string, t.null]),
- isEvaluation: t.union([t.boolean, t.null]),
- subscriptionEndDate: t.union([t.string, t.null]),
- supportEntitlementNumber: t.union([t.string, t.null]),
- trialEndDate: t.union([t.string, t.null]),
- type: t.union([t.string, t.null])
- })
-]);
-const AppContext = t.intersection([
- t.type({
- appId: t.string,
- appVersion: t.string,
- environmentId: t.string,
- environmentType: t.string,
- invocationId: t.string,
- installationId: t.string,
- functionKey: t.string,
- moduleType: t.string,
- moduleKey: t.string
- }),
- t.partial({
- license: exports.LicenseType
- })
-]);
-const MetadataType = t.intersection([
- t.type({
- apiAuth: t.type({
- env: t.string,
- objects: t.string
- }),
- clientId: t.string,
- contextAri: t.string,
- tokens: t.array(XisRequestTokenType),
- appContext: AppContext,
- tracing: t.type({
- traceId: t.string,
- spanId: t.string
- })
- }),
- t.partial({
- aaid: t.string,
- featureFlags: t.array(t.string),
- appToken: t.string,
- proxy: t.intersection([
- t.type({
- token: t.string,
- url: t.string
- }),
- t.partial({
- host: t.string
- })
- ]),
- timeout: t.number,
- rms: t.type({
- url: t.string,
- host: t.string
- }),
- limits: t.record(t.string, t.number),
- license: exports.LicenseType,
- fetchAllowList: t.array(t.string),
- externalAuth: t.array(ExternalAuthMetaData)
- })
-]);
-const VariableType = t.type({
- secure: t.boolean,
- key: t.string,
- value: t.union([t.string, t.undefined])
-});
-exports.ExternalRequestBodyType = t.intersection([
- t.type({
- _meta: MetadataType,
- body: t.Dictionary,
- handler: t.string
- }),
- t.partial({
- variables: t.array(VariableType)
- })
-]);
-exports.InvocationType = t.type({
- request: exports.ExternalRequestBodyType,
- ctx: t.type({
- requestId: t.string,
- timeout: t.number,
- traceId: t.string
- })
-});
Modified: package/package.json
Index: package/package.json
===================================================================
--- package/package.json
+++ package/package.json
@@ -1,7 +1,7 @@
{
"name": "@forge/runtime",
- "version": "6.0.0-next.0-experimental-97e4b11",
+ "version": "6.0.0-next.1",
"description": "A Node.js runtime for Atlassian app functions",
"author": "Atlassian",
"license": "SEE LICENSE IN LICENSE.txt",
"main": "out/index.js",
@@ -14,42 +14,10 @@
},
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/node": "20.19.0",
- "@types/node-fetch": "^2.6.11",
- "@types/ws": "^7.4.7",
- "jest": "^29.7.0",
- "jest-junit": "^16.0.0",
- "nock": "13.5.4",
- "tmp": "^0.2.3",
- "ts-jest": "29.1.1",
- "ts-loader": "^9.5.1",
- "typescript": "4.8.4"
+ "jest": "^29.7.0"
},
- "dependencies": {
- "@forge/util": "1.4.9",
- "fp-ts": "^2.16.2",
- "io-ts": "^2.2.21",
- "io-ts-reporters": "^2.0.1",
- "node-fetch": "2.7.0",
- "tslib": "^2.6.2",
- "ws": "^7.5.9",
- "yaml": "^2.3.4"
- },
- "jest": {
- "preset": "ts-jest",
- "testEnvironment": "node",
- "roots": [
- "src"
- ],
- "reporters": [
- "default",
- "jest-junit"
- ]
- },
- "jest-junit": {
- "outputDirectory": "./test-reports"
- },
"publishConfig": {
"registry": "https://packages.atlassian.com/api/npm/npm-public/"
}
}
Modified: package/out/index.d.ts.map
Index: package/out/index.d.ts.map
===================================================================
--- package/out/index.d.ts.map
+++ package/out/index.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAA2B,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAmB,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAE1B,wBAAgB,mBAAmB,IAAI,SAAS,CAE/C;AAED,wBAAgB,WAAW,IAAI,uBAAuB,EAAE,CAevD;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,gBAAgB,EAAE,aAAa,CAAC;IAChC,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,qBAAa,yBAA0B,SAAQ,KAAK;CAAG;AAMvD,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,OAAO,GAAG,mBAAmB,CAO3E;AAED,wBAAgB,MAAM,CAAC,UAAU,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAE9E"}
\ No newline at end of file
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEpD,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAE1B,wBAAgB,WAAW,IAAI,uBAAuB,EAAE,CAevD"}
\ No newline at end of file
Modified: package/out/sandbox/index.d.ts.map
Index: package/out/sandbox/index.d.ts.map
===================================================================
--- package/out/sandbox/index.d.ts.map
+++ package/out/sandbox/index.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sandbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,WAAW,CAAC"}
\ No newline at end of file
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sandbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC"}
\ No newline at end of file
Modified: package/out/sandbox/invocation-event.d.ts.map
Index: package/out/sandbox/invocation-event.d.ts.map
===================================================================
--- package/out/sandbox/invocation-event.d.ts.map
+++ package/out/sandbox/invocation-event.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"invocation-event.d.ts","sourceRoot":"","sources":["../../src/sandbox/invocation-event.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,cAAM,sBAAuB,SAAQ,YAAY;CAAG;AAEpD,eAAO,MAAM,4BAA4B,wBAA+B,CAAC;AAGzE,eAAO,MAAM,YAAY,WAAW,CAAC;AAGrC,eAAO,MAAM,2BAA2B,0BAA0B,CAAC;AAGnE,eAAO,MAAM,4BAA4B,2BAA2B,CAAC;AAErE,oBAAY,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC;AAE5C,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,IAAI,aAAa,CAEhE;AAED,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE;QACP,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;QACzB,OAAO,EAAE;YAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;SAAE,CAAC;KACpC,CAAC;CACH;AAED,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE;QACT,IAAI,EAAE,WAAW,CAAC;QAClB,OAAO,EAAE;YAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;SAAE,CAAC;KACpC,CAAC;CACH;AAED,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE;QACP,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;QACzB,OAAO,EAAE;YAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;SAAE,CAAC;KACpC,CAAC;CACH;AAED,MAAM,WAAW,yBAAyB;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE;QACT,IAAI,EAAE,WAAW,CAAC;QAClB,OAAO,EAAE;YAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;SAAE,CAAC;KACpC,CAAC;CACH;AAWD,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,aAAa,CAAC;CAC7B;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQ/C;AAED,wBAAgB,8BAA8B,CAAC,UAAU,EAAE,iBAAiB,EAAE,YAAY,EAAE,qBAAqB,QAUhH;AAED,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,iBAAiB,EAAE,YAAY,EAAE,sBAAsB,QAQlH;AAED,wBAAgB,UAAU,CAAC,UAAU,EAAE,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,QAQxG"}
\ No newline at end of file
+{"version":3,"file":"invocation-event.d.ts","sourceRoot":"","sources":["../../src/sandbox/invocation-event.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,oBAAY,QAAQ;IAClB,KAAK,KAAK;IACV,IAAI,KAAK;IACT,IAAI,KAAK;IACT,KAAK,KAAK;IACV,KAAK,KAAK;CACX;AAED,cAAM,sBAAuB,SAAQ,YAAY;CAAG;AAEpD,eAAO,MAAM,4BAA4B,wBAA+B,CAAC;AAGzE,eAAO,MAAM,YAAY,WAAW,CAAC;AAErC,oBAAY,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC;AAW5C,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,aAAa,CAAC;CAC7B"}
\ No newline at end of file
Modified: package/out/request.d.ts.map
Index: package/out/request.d.ts.map
===================================================================
--- package/out/request.d.ts.map
+++ package/out/request.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AA0B3B,QAAA,MAAM,mBAAmB;;;;;;;;;IAYvB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;IAetB,CAAC;AAmBH,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAsChB,CAAC;AAEH,QAAA,MAAM,YAAY;;;;EAIhB,CAAC;AAIH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASlC,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOzB,CAAC;AAEH,oBAAY,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,YAAY,CAAC,CAAC;AACpE,oBAAY,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,CAAC;AACnD,oBAAY,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC;AACzD,oBAAY,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,YAAY,CAAC,CAAC;AACrD,oBAAY,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACnE,oBAAY,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
\ No newline at end of file
+{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":"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"}
\ No newline at end of file
Modified: package/out/result.d.ts.map
Index: package/out/result.d.ts.map
===================================================================
--- package/out/result.d.ts.map
+++ package/out/result.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../src/result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,CAAC,EAAE;QACR,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,EAAE,CAAC;IACJ,MAAM,EAAE,MAAM,CAAC;IAGf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE;QACN,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IAEF,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
\ No newline at end of file
+{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../src/result.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,GAAG,CAAC;IACV,OAAO,CAAC,EAAE;QACR,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,EAAE,CAAC;IACJ,MAAM,EAAE,MAAM,CAAC;IAGf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE;QACN,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IAEF,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
\ No newline at end of file
Modified: package/out/sandbox/sandbox.d.ts.map
Index: package/out/sandbox/sandbox.d.ts.map
===================================================================
--- package/out/sandbox/sandbox.d.ts.map
+++ package/out/sandbox/sandbox.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../src/sandbox/sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,oBAAY,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAGD,oBAAY,eAAe,GAAG,GAAG,CAAC;AAClC,oBAAY,cAAc,GAAG,GAAG,CAAC;AAEjC,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CACL,oBAAoB,EAAE,oBAAoB,EAC1C,gBAAgB,EAAE,aAAa,EAC/B,SAAS,CAAC,EAAE,SAAS,GACpB,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC7B,IAAI,IAAI,IAAI,CAAC;CACd"}
\ No newline at end of file
+{"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../src/sandbox/sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,oBAAY,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACjE,IAAI,IAAI,IAAI,CAAC;CACd"}
\ No newline at end of file
Modified: package/CHANGELOG.md
Index: package/CHANGELOG.md
===================================================================
--- package/CHANGELOG.md
+++ package/CHANGELOG.md
@@ -1,11 +1,11 @@
# @forge/runtime
-## 6.0.0-next.0-experimental-97e4b11
+## 6.0.0-next.1
-### Major Changes
+### Minor Changes
-- 8f2a3c9: Update the package to build on Node 20
+- ba634d9: Remove further sandbox runtime related components
## 6.0.0-next.0
### Major Changes
Modified: package/out/index.d.ts
Index: package/out/index.d.ts
===================================================================
--- package/out/index.d.ts
+++ package/out/index.d.ts
@@ -1,30 +1,6 @@
-import { ExternalRequestBody, ExternalRequestVariable } from './request';
-import { InvocationResult } from './result';
-import { Sandbox } from './sandbox';
-import { Inspector } from './sandbox/inspector';
-import { LimitsTracker } from './limits';
-import { XenInvocationRequest } from './sandbox/invocation-request';
-export * from './app-manifest';
-export * from './config';
-export * from './context';
-export * from './feature-flag';
-export * from './metrics';
+import { ExternalRequestVariable } from './request';
export * from './request';
export * from './result';
-export * from './snapshot';
-export * from './limits';
-export * from './logger';
export * from './sandbox';
-export declare function initializeInspector(): Inspector;
export declare function getUserVars(): ExternalRequestVariable[];
-export interface InvocationConfig {
- sandbox: Sandbox;
- xenInvocationRequest: XenInvocationRequest;
- invocationLimits: LimitsTracker;
- inspector?: Inspector;
-}
-export declare class InvocationValidationError extends Error {
-}
-export declare function validateInvocation(invocation: unknown): ExternalRequestBody;
-export declare function invoke(invocation: InvocationConfig): Promise<InvocationResult>;
//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
Modified: package/out/sandbox/index.d.ts
Index: package/out/sandbox/index.d.ts
===================================================================
--- package/out/sandbox/index.d.ts
+++ package/out/sandbox/index.d.ts
@@ -1,5 +1,3 @@
-export * from './inspector';
export * from './invocation-event';
-export * from './invocation-request';
export * from './sandbox';
//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
Modified: package/out/sandbox/invocation-event.d.ts
Index: package/out/sandbox/invocation-event.d.ts
===================================================================
--- package/out/sandbox/invocation-event.d.ts
+++ package/out/sandbox/invocation-event.d.ts
@@ -1,63 +1,21 @@
/// <reference types="node" resolution-mode="require"/>
import { EventEmitter } from 'events';
-import { InvocationRequest } from './invocation-request';
-import { LogLevel } from '../logger';
+export declare enum LogLevel {
+ DEBUG = 20,
+ INFO = 30,
+ WARN = 40,
+ ERROR = 50,
+ FATAL = 60
+}
declare class InvocationEventEmitter extends EventEmitter {
}
export declare const StaticInvocationEventEmitter: InvocationEventEmitter;
export declare const EVENT_P3_LOG = "p3-log";
-export declare const EVENT_NETWORK_REQUEST_START = "network-request-start";
-export declare const EVENT_NETWORK_REQUEST_FINISH = "network-request-finish";
export declare type NonEmptyArray = [any, ...any[]];
-export declare function isNonEmptyArray(arr: any[]): arr is NonEmptyArray;
-export interface NetworkStartEventData {
- url: string;
- request: {
- body: ArrayBuffer | null;
- headers: {
- [k: string]: string[];
- };
- };
-}
-export interface NetworkFinishEventData {
- url: string;
- error?: string;
- response?: {
- body: ArrayBuffer;
- headers: {
- [k: string]: string[];
- };
- };
-}
-export interface NetworkRequestStartEvent {
- invocationId: string;
- hostname: string;
- request: {
- body: ArrayBuffer | null;
- headers: {
- [k: string]: string[];
- };
- };
-}
-export interface NetworkRequestFinishEvent {
- invocationId: string;
- hostname: string;
- error?: string;
- response?: {
- body: ArrayBuffer;
- headers: {
- [k: string]: string[];
- };
- };
-}
export interface P3LogEvent {
invocationId: string;
logLevel: number;
logArguments: NonEmptyArray;
}
-export declare function getHostname(url: string): string;
-export declare function invokeNetworkRequestStartEvent(invocation: InvocationRequest, networkEvent: NetworkStartEventData): void;
-export declare function invokeNetworkRequestFinishEvent(invocation: InvocationRequest, networkEvent: NetworkFinishEventData): void;
-export declare function p3LogEvent(invocation: InvocationRequest, logLevel: LogLevel, logArguments: NonEmptyArray): void;
export {};
//# sourceMappingURL=invocation-event.d.ts.map
\ No newline at end of file
Modified: package/out/request.d.ts
Index: package/out/request.d.ts
===================================================================
--- package/out/request.d.ts
+++ package/out/request.d.ts
@@ -1,340 +1,93 @@
-import * as t from 'io-ts';
-declare const XisRequestTokenType: t.IntersectionC<[t.TypeC<{
- id: t.StringC;
- service: t.StringC;
- token: t.StringC;
-}>, t.PartialC<{
- externalAccountId: t.StringC;
- displayName: t.StringC;
- avatarUrl: t.UnionC<[t.StringC, t.UndefinedC]>;
- scopes: t.ArrayC<t.StringC>;
-}>]>;
-export declare const LicenseType: t.IntersectionC<[t.TypeC<{
- isActive: t.BooleanC;
-}>, t.PartialC<{
- billingPeriod: t.UnionC<[t.StringC, t.NullC]>;
- capabilitySet: t.UnionC<[t.StringC, t.NullC]>;
- ccpEntitlementId: t.UnionC<[t.StringC, t.NullC]>;
- ccpEntitlementSlug: t.UnionC<[t.StringC, t.NullC]>;
- isEvaluation: t.UnionC<[t.BooleanC, t.NullC]>;
- subscriptionEndDate: t.UnionC<[t.StringC, t.NullC]>;
- supportEntitlementNumber: t.UnionC<[t.StringC, t.NullC]>;
- trialEndDate: t.UnionC<[t.StringC, t.NullC]>;
- type: t.UnionC<[t.StringC, t.NullC]>;
-}>]>;
-declare const MetadataType: t.IntersectionC<[t.TypeC<{
- apiAuth: t.TypeC<{
- env: t.StringC;
- objects: t.StringC;
- }>;
- clientId: t.StringC;
- contextAri: t.StringC;
- tokens: t.ArrayC<t.IntersectionC<[t.TypeC<{
- id: t.StringC;
- service: t.StringC;
- token: t.StringC;
- }>, t.PartialC<{
- externalAccountId: t.StringC;
- displayName: t.StringC;
- avatarUrl: t.UnionC<[t.StringC, t.UndefinedC]>;
- scopes: t.ArrayC<t.StringC>;
- }>]>>;
- appContext: t.IntersectionC<[t.TypeC<{
- appId: t.StringC;
- appVersion: t.StringC;
- environmentId: t.StringC;
- environmentType: t.StringC;
- invocationId: t.StringC;
- installationId: t.StringC;
- functionKey: t.StringC;
- moduleType: t.StringC;
- moduleKey: t.StringC;
- }>, t.PartialC<{
- license: t.IntersectionC<[t.TypeC<{
- isActive: t.BooleanC;
- }>, t.PartialC<{
- billingPeriod: t.UnionC<[t.StringC, t.NullC]>;
- capabilitySet: t.UnionC<[t.StringC, t.NullC]>;
- ccpEntitlementId: t.UnionC<[t.StringC, t.NullC]>;
- ccpEntitlementSlug: t.UnionC<[t.StringC, t.NullC]>;
- isEvaluation: t.UnionC<[t.BooleanC, t.NullC]>;
- subscriptionEndDate: t.UnionC<[t.StringC, t.NullC]>;
- supportEntitlementNumber: t.UnionC<[t.StringC, t.NullC]>;
- trialEndDate: t.UnionC<[t.StringC, t.NullC]>;
- type: t.UnionC<[t.StringC, t.NullC]>;
- }>]>;
- }>]>;
- tracing: t.TypeC<{
- traceId: t.StringC;
- spanId: t.StringC;
- }>;
-}>, t.PartialC<{
- aaid: t.StringC;
- featureFlags: t.ArrayC<t.StringC>;
- appToken: t.StringC;
- proxy: t.IntersectionC<[t.TypeC<{
- token: t.StringC;
- url: t.StringC;
- }>, t.PartialC<{
- host: t.StringC;
- }>]>;
- timeout: t.NumberC;
- rms: t.TypeC<{
- url: t.StringC;
- host: t.StringC;
- }>;
- limits: t.RecordC<t.StringC, t.NumberC>;
- license: t.IntersectionC<[t.TypeC<{
- isActive: t.BooleanC;
- }>, t.PartialC<{
- billingPeriod: t.UnionC<[t.StringC, t.NullC]>;
- capabilitySet: t.UnionC<[t.StringC, t.NullC]>;
- ccpEntitlementId: t.UnionC<[t.StringC, t.NullC]>;
- ccpEntitlementSlug: t.UnionC<[t.StringC, t.NullC]>;
- isEvaluation: t.UnionC<[t.BooleanC, t.NullC]>;
- subscriptionEndDate: t.UnionC<[t.StringC, t.NullC]>;
- supportEntitlementNumber: t.UnionC<[t.StringC, t.NullC]>;
- trialEndDate: t.UnionC<[t.StringC, t.NullC]>;
- type: t.UnionC<[t.StringC, t.NullC]>;
- }>]>;
- fetchAllowList: t.ArrayC<t.StringC>;
- externalAuth: t.ArrayC<t.TypeC<{
- service: t.StringC;
- remotes: t.ArrayC<t.TypeC<{
- baseUrl: t.StringC;
- key: t.StringC;
- }>>;
- accounts: t.ArrayC<t.IntersectionC<[t.TypeC<{
- id: t.StringC;
- externalAccountId: t.StringC;
- displayName: t.StringC;
- scopes: t.ArrayC<t.StringC>;
- }>, t.PartialC<{
- avatarUrl: t.StringC;
- }>]>>;
- }>>;
-}>]>;
-declare const VariableType: t.TypeC<{
- secure: t.BooleanC;
- key: t.StringC;
- value: t.UnionC<[t.StringC, t.UndefinedC]>;
-}>;
-export declare const ExternalRequestBodyType: t.IntersectionC<[t.TypeC<{
- _meta: t.IntersectionC<[t.TypeC<{
- apiAuth: t.TypeC<{
- env: t.StringC;
- objects: t.StringC;
- }>;
- clientId: t.StringC;
- contextAri: t.StringC;
- tokens: t.ArrayC<t.IntersectionC<[t.TypeC<{
- id: t.StringC;
- service: t.StringC;
- token: t.StringC;
- }>, t.PartialC<{
- externalAccountId: t.StringC;
- displayName: t.StringC;
- avatarUrl: t.UnionC<[t.StringC, t.UndefinedC]>;
- scopes: t.ArrayC<t.StringC>;
- }>]>>;
- appContext: t.IntersectionC<[t.TypeC<{
- appId: t.StringC;
- appVersion: t.StringC;
- environmentId: t.StringC;
- environmentType: t.StringC;
- invocationId: t.StringC;
- installationId: t.StringC;
- functionKey: t.StringC;
- moduleType: t.StringC;
- moduleKey: t.StringC;
- }>, t.PartialC<{
- license: t.IntersectionC<[t.TypeC<{
- isActive: t.BooleanC;
- }>, t.PartialC<{
- billingPeriod: t.UnionC<[t.StringC, t.NullC]>;
- capabilitySet: t.UnionC<[t.StringC, t.NullC]>;
- ccpEntitlementId: t.UnionC<[t.StringC, t.NullC]>;
- ccpEntitlementSlug: t.UnionC<[t.StringC, t.NullC]>;
- isEvaluation: t.UnionC<[t.BooleanC, t.NullC]>;
- subscriptionEndDate: t.UnionC<[t.StringC, t.NullC]>;
- supportEntitlementNumber: t.UnionC<[t.StringC, t.NullC]>;
- trialEndDate: t.UnionC<[t.StringC, t.NullC]>;
- type: t.UnionC<[t.StringC, t.NullC]>;
- }>]>;
- }>]>;
- tracing: t.TypeC<{
- traceId: t.StringC;
- spanId: t.StringC;
- }>;
- }>, t.PartialC<{
- aaid: t.StringC;
- featureFlags: t.ArrayC<t.StringC>;
- appToken: t.StringC;
- proxy: t.IntersectionC<[t.TypeC<{
- token: t.StringC;
- url: t.StringC;
- }>, t.PartialC<{
- host: t.StringC;
- }>]>;
- timeout: t.NumberC;
- rms: t.TypeC<{
- url: t.StringC;
- host: t.StringC;
- }>;
- limits: t.RecordC<t.StringC, t.NumberC>;
- license: t.IntersectionC<[t.TypeC<{
- isActive: t.BooleanC;
- }>, t.PartialC<{
- billingPeriod: t.UnionC<[t.StringC, t.NullC]>;
- capabilitySet: t.UnionC<[t.StringC, t.NullC]>;
- ccpEntitlementId: t.UnionC<[t.StringC, t.NullC]>;
- ccpEntitlementSlug: t.UnionC<[t.StringC, t.NullC]>;
- isEvaluation: t.UnionC<[t.BooleanC, t.NullC]>;
- subscriptionEndDate: t.UnionC<[t.StringC, t.NullC]>;
- supportEntitlementNumber: t.UnionC<[t.StringC, t.NullC]>;
- trialEndDate: t.UnionC<[t.StringC, t.NullC]>;
- type: t.UnionC<[t.StringC, t.NullC]>;
- }>]>;
- fetchAllowList: t.ArrayC<t.StringC>;
- externalAuth: t.ArrayC<t.TypeC<{
- service: t.StringC;
- remotes: t.ArrayC<t.TypeC<{
- baseUrl: t.StringC;
- key: t.StringC;
- }>>;
- accounts: t.ArrayC<t.IntersectionC<[t.TypeC<{
- id: t.StringC;
- externalAccountId: t.StringC;
- displayName: t.StringC;
- scopes: t.ArrayC<t.StringC>;
- }>, t.PartialC<{
- avatarUrl: t.StringC;
- }>]>>;
- }>>;
- }>]>;
- body: t.UnknownRecordC;
- handler: t.StringC;
-}>, t.PartialC<{
- variables: t.ArrayC<t.TypeC<{
- secure: t.BooleanC;
- key: t.StringC;
- value: t.UnionC<[t.StringC, t.UndefinedC]>;
- }>>;
-}>]>;
-export declare const InvocationType: t.TypeC<{
- request: t.IntersectionC<[t.TypeC<{
- _meta: t.IntersectionC<[t.TypeC<{
- apiAuth: t.TypeC<{
- env: t.StringC;
- objects: t.StringC;
- }>;
- clientId: t.StringC;
- contextAri: t.StringC;
- tokens: t.ArrayC<t.IntersectionC<[t.TypeC<{
- id: t.StringC;
- service: t.StringC;
- token: t.StringC;
- }>, t.PartialC<{
- externalAccountId: t.StringC;
- displayName: t.StringC;
- avatarUrl: t.UnionC<[t.StringC, t.UndefinedC]>;
- scopes: t.ArrayC<t.StringC>;
- }>]>>;
- appContext: t.IntersectionC<[t.TypeC<{
- appId: t.StringC;
- appVersion: t.StringC;
- environmentId: t.StringC;
- environmentType: t.StringC;
- invocationId: t.StringC;
- installationId: t.StringC;
- functionKey: t.StringC;
- moduleType: t.StringC;
- moduleKey: t.StringC;
- }>, t.PartialC<{
- license: t.IntersectionC<[t.TypeC<{
- isActive: t.BooleanC;
- }>, t.PartialC<{
- billingPeriod: t.UnionC<[t.StringC, t.NullC]>;
- capabilitySet: t.UnionC<[t.StringC, t.NullC]>;
- ccpEntitlementId: t.UnionC<[t.StringC, t.NullC]>;
- ccpEntitlementSlug: t.UnionC<[t.StringC, t.NullC]>;
- isEvaluation: t.UnionC<[t.BooleanC, t.NullC]>;
- subscriptionEndDate: t.UnionC<[t.StringC, t.NullC]>;
- supportEntitlementNumber: t.UnionC<[t.StringC, t.NullC]>;
- trialEndDate: t.UnionC<[t.StringC, t.NullC]>;
- type: t.UnionC<[t.StringC, t.NullC]>;
- }>]>;
- }>]>;
- tracing: t.TypeC<{
- traceId: t.StringC;
- spanId: t.StringC;
- }>;
- }>, t.PartialC<{
- aaid: t.StringC;
- featureFlags: t.ArrayC<t.StringC>;
- appToken: t.StringC;
- proxy: t.IntersectionC<[t.TypeC<{
- token: t.StringC;
- url: t.StringC;
- }>, t.PartialC<{
- host: t.StringC;
- }>]>;
- timeout: t.NumberC;
- rms: t.TypeC<{
- url: t.StringC;
- host: t.StringC;
- }>;
- limits: t.RecordC<t.StringC, t.NumberC>;
- license: t.IntersectionC<[t.TypeC<{
- isActive: t.BooleanC;
- }>, t.PartialC<{
- billingPeriod: t.UnionC<[t.StringC, t.NullC]>;
- capabilitySet: t.UnionC<[t.StringC, t.NullC]>;
- ccpEntitlementId: t.UnionC<[t.StringC, t.NullC]>;
- ccpEntitlementSlug: t.UnionC<[t.StringC, t.NullC]>;
- isEvaluation: t.UnionC<[t.BooleanC, t.NullC]>;
- subscriptionEndDate: t.UnionC<[t.StringC, t.NullC]>;
- supportEntitlementNumber: t.UnionC<[t.StringC, t.NullC]>;
- trialEndDate: t.UnionC<[t.StringC, t.NullC]>;
- type: t.UnionC<[t.StringC, t.NullC]>;
- }>]>;
- fetchAllowList: t.ArrayC<t.StringC>;
- externalAuth: t.ArrayC<t.TypeC<{
- service: t.StringC;
- remotes: t.ArrayC<t.TypeC<{
- baseUrl: t.StringC;
- key: t.StringC;
- }>>;
- accounts: t.ArrayC<t.IntersectionC<[t.TypeC<{
- id: t.StringC;
- externalAccountId: t.StringC;
- displayName: t.StringC;
- scopes: t.ArrayC<t.StringC>;
- }>, t.PartialC<{
- avatarUrl: t.StringC;
- }>]>>;
- }>>;
- }>]>;
- body: t.UnknownRecordC;
- handler: t.StringC;
- }>, t.PartialC<{
- variables: t.ArrayC<t.TypeC<{
- secure: t.BooleanC;
- key: t.StringC;
- value: t.UnionC<[t.StringC, t.UndefinedC]>;
- }>>;
- }>]>;
- ctx: t.TypeC<{
- requestId: t.StringC;
- timeout: t.NumberC;
- traceId: t.StringC;
- }>;
-}>;
-export declare type ExternalRequestVariable = t.TypeOf<typeof VariableType>;
-export declare type License = t.TypeOf<typeof LicenseType>;
-export declare type Invocation = t.TypeOf<typeof InvocationType>;
-export declare type Metadata = t.TypeOf<typeof MetadataType>;
-export declare type XisRequestToken = t.TypeOf<typeof XisRequestTokenType>;
-export declare type ExternalRequestBody = t.TypeOf<typeof ExternalRequestBodyType>;
+interface Remote {
+ baseUrl: string;
+ key: string;
+}
+interface ExternalAuthMetaDataAccount {
+ id: string;
+ externalAccountId: string;
+ displayName: string;
+ scopes: string[];
+ avatarUrl?: string;
+}
+interface ExternalAuthMetaData {
+ service: string;
+ remotes: Remote[];
+ accounts: ExternalAuthMetaDataAccount[];
+}
+interface XisRequestTokenType {
+ id: string;
+ service: string;
+ token: string;
+ externalAccountId?: string;
+ displayName?: string;
+ avatarUrl?: string;
+ scopes?: string[];
+}
+export interface License {
+ isActive: boolean;
+ billingPeriod?: string | null;
+ capabilitySet?: string | null;
+ ccpEntitlementId?: string | null;
+ ccpEntitlementSlug?: string | null;
+ isEvaluation?: boolean | null;
+ subscriptionEndDate?: string | null;
+ supportEntitlementNumber?: string | null;
+ trialEndDate?: string | null;
+ type?: string | null;
+}
+interface AppContext {
+ appId: string;
+ appVersion: string;
+ environmentId: string;
+ environmentType: string;
+ invocationId: string;
+ installationId: string;
+ functionKey: string;
+ moduleType: string;
+ moduleKey: string;
+ license?: License;
+}
+export interface Metadata {
+ apiAuth: {
+ env: string;
+ objects: string;
+ };
+ clientId: string;
+ contextAri: string;
+ tokens: XisRequestTokenType[];
+ appContext: AppContext;
+ tracing: {
+ traceId: string;
+ spanId: string;
+ };
+ aaid?: string;
+ featureFlags?: string[];
+ appToken?: string;
+ proxy?: {
+ token: string;
+ url: string;
+ host?: string;
+ };
+ timeout?: number;
+ rms?: {
+ url: string;
+ host: string;
+ };
+ limits?: Record<string, number>;
+ license?: License;
+ fetchAllowList?: string[];
+ externalAuth?: ExternalAuthMetaData[];
+}
+export interface ExternalRequestVariable {
+ secure: boolean;
+ key: string;
+ value: string | undefined;
+}
+export interface ExternalRequestBody {
+ _meta: Metadata;
+ body: Record<string, unknown>;
+ handler: string;
+ variables?: ExternalRequestVariable[];
+}
export {};
//# sourceMappingURL=request.d.ts.map
\ No newline at end of file
Modified: package/out/result.d.ts
Index: package/out/result.d.ts
===================================================================
--- package/out/result.d.ts
+++ package/out/result.d.ts
@@ -1,7 +1,6 @@
-import { FunctionResult } from './sandbox';
export interface InvocationResult {
- body: FunctionResult;
+ body: any;
metrics?: {
[key: string]: any;
}[];
status: number;
Modified: package/out/sandbox/sandbox.d.ts
Index: package/out/sandbox/sandbox.d.ts
===================================================================
--- package/out/sandbox/sandbox.d.ts
+++ package/out/sandbox/sandbox.d.ts
@@ -1,23 +1,15 @@
-import { Inspector } from './inspector';
+import { ExternalRequestBody } from '../request';
import { InvocationResult } from '../result';
-import { LimitsTracker } from '../limits/tracker';
-import { XenInvocationRequest } from './invocation-request';
export declare type SandboxConfig = {
modName: string;
appPath: string;
handler: string;
timeout?: number;
- isolateMemory: number;
debugPort?: number;
};
-export interface FunctionEvent {
- [key: string]: any;
-}
-export declare type FunctionContext = any;
-export declare type FunctionResult = any;
export interface Sandbox {
name: string;
- execute(xenInvocationRequest: XenInvocationRequest, invocationLimits: LimitsTracker, inspector?: Inspector): Promise<InvocationResult>;
+ execute(request: ExternalRequestBody): Promise<InvocationResult>;
stop(): void;
}
//# sourceMappingURL=sandbox.d.ts.map
\ No newline at end of file