@forge/bridge 2.6.1 → 3.0.0-experimental-5c9420a
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/CHANGELOG.md +18 -0
- package/out/index.d.ts +1 -0
- package/out/index.d.ts.map +1 -1
- package/out/index.js +1 -0
- package/out/invokeRemote/index.d.ts +2 -0
- package/out/invokeRemote/index.d.ts.map +1 -0
- package/out/invokeRemote/index.js +4 -0
- package/out/invokeRemote/invokeRemote.d.ts +8 -0
- package/out/invokeRemote/invokeRemote.d.ts.map +1 -0
- package/out/invokeRemote/invokeRemote.js +19 -0
- package/out/types.d.ts +11 -3
- package/out/types.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @forge/bridge
|
|
2
2
|
|
|
3
|
+
## 3.0.0-experimental-5c9420a
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- e734722: Add invokeRemote API which is used by Custom UI apps to perform a request against a remote resource
|
|
8
|
+
|
|
9
|
+
## 3.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- 1de47d7: The `license` field from an app's context object now has updated properties and returns additional information. Updating the `license` type in this version to reflect these changes.
|
|
14
|
+
|
|
15
|
+
## 3.0.0-next.0
|
|
16
|
+
|
|
17
|
+
### Major Changes
|
|
18
|
+
|
|
19
|
+
- 1de47d7: The `license` field from an app's context object now has updated properties and returns additional information. Updating the `license` type in this version to reflect these changes.
|
|
20
|
+
|
|
3
21
|
## 2.6.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/out/index.d.ts
CHANGED
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
|
package/out/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./invoke"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./invokeRemote"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./view"), exports);
|
|
6
7
|
tslib_1.__exportStar(require("./router"), exports);
|
|
7
8
|
tslib_1.__exportStar(require("./modal"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/invokeRemote/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface InvokeRemoteInput {
|
|
2
|
+
path: string;
|
|
3
|
+
method: 'GET' | 'OPTIONS' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
4
|
+
headers?: unknown;
|
|
5
|
+
body?: unknown;
|
|
6
|
+
}
|
|
7
|
+
export declare const invokeRemote: <T>(input: InvokeRemoteInput) => Promise<T>;
|
|
8
|
+
//# sourceMappingURL=invokeRemote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invokeRemote.d.ts","sourceRoot":"","sources":["../../src/invokeRemote/invokeRemote.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,KAAK,GAAG,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;IAChE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAkBD,eAAO,MAAM,YAAY,6CAKxB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.invokeRemote = void 0;
|
|
4
|
+
const bridge_1 = require("../bridge");
|
|
5
|
+
const errors_1 = require("../errors");
|
|
6
|
+
const utils_1 = require("../utils");
|
|
7
|
+
const callBridge = (0, bridge_1.getCallBridge)();
|
|
8
|
+
const validatePayload = (payload) => {
|
|
9
|
+
if (!payload)
|
|
10
|
+
return;
|
|
11
|
+
if (Object.values(payload).some((val) => typeof val === 'function')) {
|
|
12
|
+
throw new errors_1.BridgeAPIError('Passing functions as part of the payload is not supported!');
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const _invokeRemote = (input) => {
|
|
16
|
+
validatePayload(input);
|
|
17
|
+
return callBridge('invoke', input);
|
|
18
|
+
};
|
|
19
|
+
exports.invokeRemote = (0, utils_1.withRateLimiter)(_invokeRemote, 500, 1000 * 25, 'Resolver calls are rate limited at 500req/25s');
|
package/out/types.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface FullContext {
|
|
|
13
13
|
accountId?: string;
|
|
14
14
|
cloudId?: string;
|
|
15
15
|
extension: ExtensionData;
|
|
16
|
-
license?:
|
|
16
|
+
license?: LicenseDetails;
|
|
17
17
|
localId: string;
|
|
18
18
|
locale: string;
|
|
19
19
|
moduleKey: string;
|
|
@@ -23,8 +23,16 @@ export interface FullContext {
|
|
|
23
23
|
interface ExtensionData {
|
|
24
24
|
[k: string]: any;
|
|
25
25
|
}
|
|
26
|
-
interface
|
|
27
|
-
|
|
26
|
+
export interface LicenseDetails {
|
|
27
|
+
active: boolean;
|
|
28
|
+
billingPeriod: string;
|
|
29
|
+
ccpEntitlementId: string;
|
|
30
|
+
ccpEntitlementSlug: string;
|
|
31
|
+
isEvaluation: boolean;
|
|
32
|
+
subscriptionEndDate: string | null;
|
|
33
|
+
supportEntitlementNumber: string | null;
|
|
34
|
+
trialEndDate: string | null;
|
|
35
|
+
type: string;
|
|
28
36
|
}
|
|
29
37
|
export type Subscription = {
|
|
30
38
|
unsubscribe: () => void;
|
package/out/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;KACzB,GAAG,IAAI,MAAM,GAAG,MAAM,GAAG,GAAG;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;AAExD,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACnC,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,GAAG,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,YAAY,CAAC,CAAC;AAEhD,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,aAAa,CAAC;IACzB,OAAO,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;KACzB,GAAG,IAAI,MAAM,GAAG,MAAM,GAAG,GAAG;CAC9B,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