@managespace/sdk 0.1.158-extensions → 0.1.159
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/README.md +2 -723
- package/dist/extensibility/functions/project/billing.d.ts +7 -0
- package/dist/extensibility/functions/project/billing.d.ts.map +1 -1
- package/dist/extensibility/functions/project/billing.js +5 -0
- package/dist/extensibility/types/control.d.ts +1 -1
- package/dist/extensibility/types/control.d.ts.map +1 -1
- package/dist/generated/apis/default-api.d.ts +9 -1
- package/dist/generated/apis/default-api.d.ts.map +1 -1
- package/dist/generated/apis/default-api.js +28 -0
- package/dist/generated/apis/index.d.ts +0 -1
- package/dist/generated/apis/index.d.ts.map +1 -1
- package/dist/generated/apis/index.js +0 -1
- package/dist/generated/models/index.d.ts +1 -2
- package/dist/generated/models/index.d.ts.map +1 -1
- package/dist/generated/models/index.js +1 -2
- package/dist/generated/models/payment-gateway-client-token-response.d.ts +47 -0
- package/dist/generated/models/payment-gateway-client-token-response.d.ts.map +1 -0
- package/dist/generated/models/payment-gateway-client-token-response.js +63 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/package.deploy.json +7 -3
- package/package.json +2 -5
- package/src/extensibility/functions/project/billing.ts +6 -0
- package/src/extensibility/types/control.ts +1 -0
- package/src/generated/.openapi-generator/FILES +1 -3
- package/src/generated/apis/default-api.ts +37 -0
- package/src/generated/apis/index.ts +0 -1
- package/src/generated/models/index.ts +1 -2
- package/src/generated/models/payment-gateway-client-token-response.ts +87 -0
- package/src/index.ts +0 -1
- package/dist/extensions/host-bridge.d.ts +0 -166
- package/dist/extensions/host-bridge.d.ts.map +0 -1
- package/dist/extensions/host-bridge.js +0 -259
- package/dist/extensions/index.d.ts +0 -40
- package/dist/extensions/index.d.ts.map +0 -1
- package/dist/extensions/index.js +0 -55
- package/dist/extensions/types.d.ts +0 -111
- package/dist/extensions/types.d.ts.map +0 -1
- package/dist/extensions/types.js +0 -2
- package/dist/generated/apis/extensions-api.d.ts +0 -98
- package/dist/generated/apis/extensions-api.d.ts.map +0 -1
- package/dist/generated/apis/extensions-api.js +0 -295
- package/dist/generated/models/extension-org.d.ts +0 -64
- package/dist/generated/models/extension-org.d.ts.map +0 -1
- package/dist/generated/models/extension-org.js +0 -70
- package/dist/generated/models/extension.d.ts +0 -106
- package/dist/generated/models/extension.d.ts.map +0 -1
- package/dist/generated/models/extension.js +0 -98
- package/src/extensions/host-bridge.ts +0 -272
- package/src/extensions/index.ts +0 -40
- package/src/extensions/types.ts +0 -120
- package/src/generated/apis/extensions-api.ts +0 -362
- package/src/generated/models/extension-org.ts +0 -119
- package/src/generated/models/extension.ts +0 -182
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ManageSpace API
|
|
3
|
+
* ManageSpace API Documentation
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface PaymentGatewayClientTokenResponse
|
|
16
|
+
*/
|
|
17
|
+
export interface PaymentGatewayClientTokenResponse {
|
|
18
|
+
/**
|
|
19
|
+
* Payment gateway type
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof PaymentGatewayClientTokenResponse
|
|
22
|
+
*/
|
|
23
|
+
gateway: PaymentGatewayClientTokenResponseGateway;
|
|
24
|
+
/**
|
|
25
|
+
* Client token for SDK initialisation
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof PaymentGatewayClientTokenResponse
|
|
28
|
+
*/
|
|
29
|
+
clientToken: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @export
|
|
33
|
+
*/
|
|
34
|
+
export declare const PaymentGatewayClientTokenResponseGateway: {
|
|
35
|
+
readonly braintree: "braintree";
|
|
36
|
+
readonly stripe: "stripe";
|
|
37
|
+
};
|
|
38
|
+
export type PaymentGatewayClientTokenResponseGateway = typeof PaymentGatewayClientTokenResponseGateway[keyof typeof PaymentGatewayClientTokenResponseGateway];
|
|
39
|
+
/**
|
|
40
|
+
* Check if a given object implements the PaymentGatewayClientTokenResponse interface.
|
|
41
|
+
*/
|
|
42
|
+
export declare function instanceOfPaymentGatewayClientTokenResponse(value: object): value is PaymentGatewayClientTokenResponse;
|
|
43
|
+
export declare function PaymentGatewayClientTokenResponseFromJSON(json: any): PaymentGatewayClientTokenResponse;
|
|
44
|
+
export declare function PaymentGatewayClientTokenResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaymentGatewayClientTokenResponse;
|
|
45
|
+
export declare function PaymentGatewayClientTokenResponseToJSON(json: any): PaymentGatewayClientTokenResponse;
|
|
46
|
+
export declare function PaymentGatewayClientTokenResponseToJSONTyped(value?: PaymentGatewayClientTokenResponse | null, ignoreDiscriminator?: boolean): any;
|
|
47
|
+
//# sourceMappingURL=payment-gateway-client-token-response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-gateway-client-token-response.d.ts","sourceRoot":"","sources":["../../../src/generated/models/payment-gateway-client-token-response.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AAGH;;;;GAIG;AACH,MAAM,WAAW,iCAAiC;IAC9C;;;;OAIG;IACH,OAAO,EAAE,wCAAwC,CAAC;IAClD;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;CACvB;AAGD;;GAEG;AACH,eAAO,MAAM,wCAAwC;;;CAG3C,CAAC;AACX,MAAM,MAAM,wCAAwC,GAAG,OAAO,wCAAwC,CAAC,MAAM,OAAO,wCAAwC,CAAC,CAAC;AAG9J;;GAEG;AACH,wBAAgB,2CAA2C,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,iCAAiC,CAIrH;AAED,wBAAgB,yCAAyC,CAAC,IAAI,EAAE,GAAG,GAAG,iCAAiC,CAEtG;AAED,wBAAgB,8CAA8C,CAAC,IAAI,EAAE,GAAG,EAAE,mBAAmB,EAAE,OAAO,GAAG,iCAAiC,CASzI;AAED,wBAAgB,uCAAuC,CAAC,IAAI,EAAE,GAAG,GAAG,iCAAiC,CAEpG;AAED,wBAAgB,4CAA4C,CAAC,KAAK,CAAC,EAAE,iCAAiC,GAAG,IAAI,EAAE,mBAAmB,GAAE,OAAe,GAAG,GAAG,CAUxJ"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/**
|
|
6
|
+
* ManageSpace API
|
|
7
|
+
* ManageSpace API Documentation
|
|
8
|
+
*
|
|
9
|
+
* The version of the OpenAPI document: 1.0.0
|
|
10
|
+
*
|
|
11
|
+
*
|
|
12
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
13
|
+
* https://openapi-generator.tech
|
|
14
|
+
* Do not edit the class manually.
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.PaymentGatewayClientTokenResponseGateway = void 0;
|
|
18
|
+
exports.instanceOfPaymentGatewayClientTokenResponse = instanceOfPaymentGatewayClientTokenResponse;
|
|
19
|
+
exports.PaymentGatewayClientTokenResponseFromJSON = PaymentGatewayClientTokenResponseFromJSON;
|
|
20
|
+
exports.PaymentGatewayClientTokenResponseFromJSONTyped = PaymentGatewayClientTokenResponseFromJSONTyped;
|
|
21
|
+
exports.PaymentGatewayClientTokenResponseToJSON = PaymentGatewayClientTokenResponseToJSON;
|
|
22
|
+
exports.PaymentGatewayClientTokenResponseToJSONTyped = PaymentGatewayClientTokenResponseToJSONTyped;
|
|
23
|
+
/**
|
|
24
|
+
* @export
|
|
25
|
+
*/
|
|
26
|
+
exports.PaymentGatewayClientTokenResponseGateway = {
|
|
27
|
+
braintree: 'braintree',
|
|
28
|
+
stripe: 'stripe'
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Check if a given object implements the PaymentGatewayClientTokenResponse interface.
|
|
32
|
+
*/
|
|
33
|
+
function instanceOfPaymentGatewayClientTokenResponse(value) {
|
|
34
|
+
if (!('gateway' in value) || value['gateway'] === undefined)
|
|
35
|
+
return false;
|
|
36
|
+
if (!('clientToken' in value) || value['clientToken'] === undefined)
|
|
37
|
+
return false;
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
function PaymentGatewayClientTokenResponseFromJSON(json) {
|
|
41
|
+
return PaymentGatewayClientTokenResponseFromJSONTyped(json, false);
|
|
42
|
+
}
|
|
43
|
+
function PaymentGatewayClientTokenResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
44
|
+
if (json == null) {
|
|
45
|
+
return json;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
'gateway': json['gateway'],
|
|
49
|
+
'clientToken': json['clientToken'],
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function PaymentGatewayClientTokenResponseToJSON(json) {
|
|
53
|
+
return PaymentGatewayClientTokenResponseToJSONTyped(json, false);
|
|
54
|
+
}
|
|
55
|
+
function PaymentGatewayClientTokenResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
56
|
+
if (value == null) {
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
'gateway': value['gateway'],
|
|
61
|
+
'clientToken': value['clientToken'],
|
|
62
|
+
};
|
|
63
|
+
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./extensibility"), exports);
|
|
18
|
-
__exportStar(require("./extensions"), exports);
|
|
19
18
|
__exportStar(require("./generated"), exports);
|
|
20
19
|
__exportStar(require("./realtime"), exports);
|
package/package.deploy.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@managespace/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.158-extensions",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "tsc -w --preserveWatchOutput",
|
|
6
6
|
"build": "tsc",
|
|
7
7
|
"lint:check": "eslint .",
|
|
8
8
|
"lint:fix": "eslint --fix .",
|
|
9
9
|
"lint:fix:cache": "eslint --fix .",
|
|
10
|
-
"upload": "tsc && npm publish"
|
|
10
|
+
"upload": "tsc && npm publish",
|
|
11
|
+
"upload:beta": "tsc && npm publish --tag extensions"
|
|
11
12
|
},
|
|
12
13
|
"main": "./dist/index.js",
|
|
13
14
|
"types": "./dist/index.d.ts",
|
|
@@ -29,5 +30,8 @@
|
|
|
29
30
|
"typescript": "~5.4.2",
|
|
30
31
|
"@repo/eslint-config": "*",
|
|
31
32
|
"@repo/typescript-config": "*"
|
|
32
|
-
}
|
|
33
|
+
},
|
|
34
|
+
"tags": [
|
|
35
|
+
"beta"
|
|
36
|
+
]
|
|
33
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@managespace/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.159",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "tsc -w --preserveWatchOutput",
|
|
6
6
|
"build": "tsc",
|
|
@@ -30,8 +30,5 @@
|
|
|
30
30
|
"typescript": "~5.4.2",
|
|
31
31
|
"@repo/eslint-config": "*",
|
|
32
32
|
"@repo/typescript-config": "*"
|
|
33
|
-
}
|
|
34
|
-
"tags": [
|
|
35
|
-
"beta"
|
|
36
|
-
]
|
|
33
|
+
}
|
|
37
34
|
}
|
|
@@ -558,4 +558,10 @@ export namespace Billing {
|
|
|
558
558
|
|
|
559
559
|
payload!: GetRefundsQuery;
|
|
560
560
|
}
|
|
561
|
+
|
|
562
|
+
export class GetClientToken implements ExtPlugin {
|
|
563
|
+
responseType!: { gateway: 'braintree' | 'stripe'; clientToken: string };
|
|
564
|
+
|
|
565
|
+
payload!: Record<string, never>;
|
|
566
|
+
}
|
|
561
567
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
apis/default-api.ts
|
|
2
|
-
apis/extensions-api.ts
|
|
3
2
|
apis/index.ts
|
|
4
3
|
index.ts
|
|
5
4
|
models/accounts-receivable-report-filters.ts
|
|
@@ -104,8 +103,6 @@ models/extensibility-function-instance.ts
|
|
|
104
103
|
models/extensibility-function-metadata.ts
|
|
105
104
|
models/extensibility-repo.ts
|
|
106
105
|
models/extensibility-status.ts
|
|
107
|
-
models/extension-org.ts
|
|
108
|
-
models/extension.ts
|
|
109
106
|
models/field-area.ts
|
|
110
107
|
models/field-preferences.ts
|
|
111
108
|
models/field-type.ts
|
|
@@ -183,6 +180,7 @@ models/org.ts
|
|
|
183
180
|
models/page-meta.ts
|
|
184
181
|
models/paginated.ts
|
|
185
182
|
models/past-due-balances-report-filters.ts
|
|
183
|
+
models/payment-gateway-client-token-response.ts
|
|
186
184
|
models/payment-method.ts
|
|
187
185
|
models/payment-run-filter-condition.ts
|
|
188
186
|
models/payment-run-filter-options.ts
|
|
@@ -152,6 +152,7 @@ import type {
|
|
|
152
152
|
Org,
|
|
153
153
|
PastDueBalancesReportFilters,
|
|
154
154
|
Payment,
|
|
155
|
+
PaymentGatewayClientTokenResponse,
|
|
155
156
|
PaymentMethod,
|
|
156
157
|
PaymentRun,
|
|
157
158
|
PlanCustom,
|
|
@@ -488,6 +489,8 @@ import {
|
|
|
488
489
|
PastDueBalancesReportFiltersToJSON,
|
|
489
490
|
PaymentFromJSON,
|
|
490
491
|
PaymentToJSON,
|
|
492
|
+
PaymentGatewayClientTokenResponseFromJSON,
|
|
493
|
+
PaymentGatewayClientTokenResponseToJSON,
|
|
491
494
|
PaymentMethodFromJSON,
|
|
492
495
|
PaymentMethodToJSON,
|
|
493
496
|
PaymentRunFromJSON,
|
|
@@ -6385,6 +6388,40 @@ export class DefaultApi extends runtime.BaseAPI {
|
|
|
6385
6388
|
return await response.value();
|
|
6386
6389
|
}
|
|
6387
6390
|
|
|
6391
|
+
/**
|
|
6392
|
+
*
|
|
6393
|
+
*/
|
|
6394
|
+
async getPaymentGatewayClientTokenRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaymentGatewayClientTokenResponse>> {
|
|
6395
|
+
const queryParameters: any = {};
|
|
6396
|
+
|
|
6397
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
6398
|
+
|
|
6399
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
6400
|
+
const token = this.configuration.accessToken;
|
|
6401
|
+
const tokenString = await token("bearer", []);
|
|
6402
|
+
|
|
6403
|
+
if (tokenString) {
|
|
6404
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
6405
|
+
}
|
|
6406
|
+
}
|
|
6407
|
+
const response = await this.request({
|
|
6408
|
+
path: `/api/billing/client-token`,
|
|
6409
|
+
method: 'GET',
|
|
6410
|
+
headers: headerParameters,
|
|
6411
|
+
query: queryParameters,
|
|
6412
|
+
}, initOverrides);
|
|
6413
|
+
|
|
6414
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PaymentGatewayClientTokenResponseFromJSON(jsonValue));
|
|
6415
|
+
}
|
|
6416
|
+
|
|
6417
|
+
/**
|
|
6418
|
+
*
|
|
6419
|
+
*/
|
|
6420
|
+
async getPaymentGatewayClientToken(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaymentGatewayClientTokenResponse> {
|
|
6421
|
+
const response = await this.getPaymentGatewayClientTokenRaw(initOverrides);
|
|
6422
|
+
return await response.value();
|
|
6423
|
+
}
|
|
6424
|
+
|
|
6388
6425
|
/**
|
|
6389
6426
|
*/
|
|
6390
6427
|
async getPaymentMethodRaw(requestParameters: GetPaymentMethodRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaymentMethod>> {
|
|
@@ -103,8 +103,6 @@ export * from './extensibility-function-instance';
|
|
|
103
103
|
export * from './extensibility-function-metadata';
|
|
104
104
|
export * from './extensibility-repo';
|
|
105
105
|
export * from './extensibility-status';
|
|
106
|
-
export * from './extension';
|
|
107
|
-
export * from './extension-org';
|
|
108
106
|
export * from './field-area';
|
|
109
107
|
export * from './field-preferences';
|
|
110
108
|
export * from './field-type';
|
|
@@ -182,6 +180,7 @@ export * from './page-meta';
|
|
|
182
180
|
export * from './paginated';
|
|
183
181
|
export * from './past-due-balances-report-filters';
|
|
184
182
|
export * from './payment';
|
|
183
|
+
export * from './payment-gateway-client-token-response';
|
|
185
184
|
export * from './payment-method';
|
|
186
185
|
export * from './payment-run';
|
|
187
186
|
export * from './payment-run-filter-condition';
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* ManageSpace API
|
|
6
|
+
* ManageSpace API Documentation
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { mapValues } from '../runtime';
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @export
|
|
20
|
+
* @interface PaymentGatewayClientTokenResponse
|
|
21
|
+
*/
|
|
22
|
+
export interface PaymentGatewayClientTokenResponse {
|
|
23
|
+
/**
|
|
24
|
+
* Payment gateway type
|
|
25
|
+
* @type {string}
|
|
26
|
+
* @memberof PaymentGatewayClientTokenResponse
|
|
27
|
+
*/
|
|
28
|
+
gateway: PaymentGatewayClientTokenResponseGateway;
|
|
29
|
+
/**
|
|
30
|
+
* Client token for SDK initialisation
|
|
31
|
+
* @type {string}
|
|
32
|
+
* @memberof PaymentGatewayClientTokenResponse
|
|
33
|
+
*/
|
|
34
|
+
clientToken: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @export
|
|
40
|
+
*/
|
|
41
|
+
export const PaymentGatewayClientTokenResponseGateway = {
|
|
42
|
+
braintree: 'braintree',
|
|
43
|
+
stripe: 'stripe'
|
|
44
|
+
} as const;
|
|
45
|
+
export type PaymentGatewayClientTokenResponseGateway = typeof PaymentGatewayClientTokenResponseGateway[keyof typeof PaymentGatewayClientTokenResponseGateway];
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Check if a given object implements the PaymentGatewayClientTokenResponse interface.
|
|
50
|
+
*/
|
|
51
|
+
export function instanceOfPaymentGatewayClientTokenResponse(value: object): value is PaymentGatewayClientTokenResponse {
|
|
52
|
+
if (!('gateway' in value) || value['gateway'] === undefined) return false;
|
|
53
|
+
if (!('clientToken' in value) || value['clientToken'] === undefined) return false;
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function PaymentGatewayClientTokenResponseFromJSON(json: any): PaymentGatewayClientTokenResponse {
|
|
58
|
+
return PaymentGatewayClientTokenResponseFromJSONTyped(json, false);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function PaymentGatewayClientTokenResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaymentGatewayClientTokenResponse {
|
|
62
|
+
if (json == null) {
|
|
63
|
+
return json;
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
|
|
67
|
+
'gateway': json['gateway'],
|
|
68
|
+
'clientToken': json['clientToken'],
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function PaymentGatewayClientTokenResponseToJSON(json: any): PaymentGatewayClientTokenResponse {
|
|
73
|
+
return PaymentGatewayClientTokenResponseToJSONTyped(json, false);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function PaymentGatewayClientTokenResponseToJSONTyped(value?: PaymentGatewayClientTokenResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
77
|
+
if (value == null) {
|
|
78
|
+
return value;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return {
|
|
82
|
+
|
|
83
|
+
'gateway': value['gateway'],
|
|
84
|
+
'clientToken': value['clientToken'],
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
package/src/index.ts
CHANGED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import type { EntityEventHandler, ExtensionContext } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Get the extension context from the ManageSpace host.
|
|
4
|
-
*
|
|
5
|
-
* This returns a promise that resolves when the context is received from the host.
|
|
6
|
-
* Call this early in your extension's lifecycle to get authentication and org context.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* import { getContext } from '@managespace/sdk/extensions';
|
|
11
|
-
*
|
|
12
|
-
* const context = await getContext();
|
|
13
|
-
* console.log('Org ID:', context.orgId);
|
|
14
|
-
* console.log('API URL:', context.apiBaseUrl);
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export declare function getContext(): Promise<ExtensionContext>;
|
|
18
|
-
/**
|
|
19
|
-
* Get the current context synchronously.
|
|
20
|
-
*
|
|
21
|
-
* Returns null if the context has not yet been received from the host.
|
|
22
|
-
* Prefer using `getContext()` which waits for the context to be available.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```typescript
|
|
26
|
-
* import { getCurrentContext } from '@managespace/sdk/extensions';
|
|
27
|
-
*
|
|
28
|
-
* const context = getCurrentContext();
|
|
29
|
-
* if (context) {
|
|
30
|
-
* console.log('Already have context:', context.orgId);
|
|
31
|
-
* }
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
export declare function getCurrentContext(): ExtensionContext | null;
|
|
35
|
-
/**
|
|
36
|
-
* Navigate the ManageSpace host application to a specific path.
|
|
37
|
-
*
|
|
38
|
-
* Use this to navigate users to pages within ManageSpace, such as
|
|
39
|
-
* customer profiles, asset details, or other views.
|
|
40
|
-
*
|
|
41
|
-
* @param path - The path to navigate to (e.g., "/customer/123")
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```typescript
|
|
45
|
-
* import { navigate } from '@managespace/sdk/extensions';
|
|
46
|
-
*
|
|
47
|
-
* // Navigate to a customer profile
|
|
48
|
-
* navigate('/customer/abc-123');
|
|
49
|
-
*
|
|
50
|
-
* // Navigate to the assets page
|
|
51
|
-
* navigate('/assets');
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
export declare function navigate(path: string): void;
|
|
55
|
-
/**
|
|
56
|
-
* Show a toast notification in the ManageSpace host application.
|
|
57
|
-
*
|
|
58
|
-
* Use this for user feedback after actions complete.
|
|
59
|
-
*
|
|
60
|
-
* @param message - The message to display
|
|
61
|
-
* @param variant - The toast type: 'success' or 'error' (default: 'success')
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* ```typescript
|
|
65
|
-
* import { showToast } from '@managespace/sdk/extensions';
|
|
66
|
-
*
|
|
67
|
-
* // Success notification
|
|
68
|
-
* showToast('Customer updated successfully');
|
|
69
|
-
*
|
|
70
|
-
* // Error notification
|
|
71
|
-
* showToast('Failed to save changes', 'error');
|
|
72
|
-
* ```
|
|
73
|
-
*/
|
|
74
|
-
export declare function showToast(message: string, variant?: 'success' | 'error'): void;
|
|
75
|
-
/**
|
|
76
|
-
* Signal to the ManageSpace host that the extension is ready to receive context.
|
|
77
|
-
*
|
|
78
|
-
* Call this after your extension has loaded and set up its message listeners.
|
|
79
|
-
* The host will respond with a CONTEXT_INIT message containing the ExtensionContext.
|
|
80
|
-
*
|
|
81
|
-
* @example
|
|
82
|
-
* ```typescript
|
|
83
|
-
* import { signalReady, getContext } from '@managespace/sdk/extensions';
|
|
84
|
-
*
|
|
85
|
-
* // Signal ready and wait for context
|
|
86
|
-
* signalReady();
|
|
87
|
-
* const context = await getContext();
|
|
88
|
-
* ```
|
|
89
|
-
*/
|
|
90
|
-
export declare function signalReady(): void;
|
|
91
|
-
/**
|
|
92
|
-
* Subscribe to entity events from the ManageSpace host.
|
|
93
|
-
*
|
|
94
|
-
* The host sends events when entities (customers, assets, etc.) are
|
|
95
|
-
* created, updated, or deleted. Use this to keep your extension in sync.
|
|
96
|
-
*
|
|
97
|
-
* @param handler - Callback function to handle entity events
|
|
98
|
-
* @returns Unsubscribe function to remove the handler
|
|
99
|
-
*
|
|
100
|
-
* @example
|
|
101
|
-
* ```typescript
|
|
102
|
-
* import { onEntityEvent } from '@managespace/sdk/extensions';
|
|
103
|
-
*
|
|
104
|
-
* const unsubscribe = onEntityEvent((event) => {
|
|
105
|
-
* if (event.entityType === 'customer' && event.action === 'updated') {
|
|
106
|
-
* console.log('Customer updated:', event.entityId);
|
|
107
|
-
* refreshCustomerData();
|
|
108
|
-
* }
|
|
109
|
-
* });
|
|
110
|
-
*
|
|
111
|
-
* // Later, to stop listening:
|
|
112
|
-
* unsubscribe();
|
|
113
|
-
* ```
|
|
114
|
-
*/
|
|
115
|
-
export declare function onEntityEvent(handler: EntityEventHandler): () => void;
|
|
116
|
-
/**
|
|
117
|
-
* Create a configured fetch function for calling the ManageSpace API.
|
|
118
|
-
*
|
|
119
|
-
* This returns a fetch wrapper that automatically includes credentials
|
|
120
|
-
* and sets the correct headers for API calls.
|
|
121
|
-
*
|
|
122
|
-
* @param context - The extension context from getContext()
|
|
123
|
-
* @returns A fetch function configured for ManageSpace API calls
|
|
124
|
-
*
|
|
125
|
-
* @example
|
|
126
|
-
* ```typescript
|
|
127
|
-
* import { getContext, createApiFetch } from '@managespace/sdk/extensions';
|
|
128
|
-
*
|
|
129
|
-
* const context = await getContext();
|
|
130
|
-
* const apiFetch = createApiFetch(context);
|
|
131
|
-
*
|
|
132
|
-
* // Fetch customers
|
|
133
|
-
* const response = await apiFetch('/api/crm/customers/queries', {
|
|
134
|
-
* method: 'POST',
|
|
135
|
-
* body: JSON.stringify({
|
|
136
|
-
* pageOptions: { offset: 0, limit: 20 }
|
|
137
|
-
* })
|
|
138
|
-
* });
|
|
139
|
-
* const data = await response.json();
|
|
140
|
-
* ```
|
|
141
|
-
*/
|
|
142
|
-
export declare function createApiFetch(context: ExtensionContext): (path: string, options?: RequestInit) => Promise<Response>;
|
|
143
|
-
/**
|
|
144
|
-
* Create a configured fetch function for calling your extension's BFF.
|
|
145
|
-
*
|
|
146
|
-
* This returns a fetch wrapper that forwards credentials to your BFF,
|
|
147
|
-
* allowing it to make authenticated calls to the ManageSpace API.
|
|
148
|
-
*
|
|
149
|
-
* @param context - The extension context from getContext()
|
|
150
|
-
* @returns A fetch function configured for BFF calls, or null if no BFF is configured
|
|
151
|
-
*
|
|
152
|
-
* @example
|
|
153
|
-
* ```typescript
|
|
154
|
-
* import { getContext, createBffFetch } from '@managespace/sdk/extensions';
|
|
155
|
-
*
|
|
156
|
-
* const context = await getContext();
|
|
157
|
-
* const bffFetch = createBffFetch(context);
|
|
158
|
-
*
|
|
159
|
-
* if (bffFetch) {
|
|
160
|
-
* const response = await bffFetch('/api/enriched-customers');
|
|
161
|
-
* const data = await response.json();
|
|
162
|
-
* }
|
|
163
|
-
* ```
|
|
164
|
-
*/
|
|
165
|
-
export declare function createBffFetch(context: ExtensionContext): ((path: string, options?: RequestInit) => Promise<Response>) | null;
|
|
166
|
-
//# sourceMappingURL=host-bridge.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"host-bridge.d.ts","sourceRoot":"","sources":["../../src/extensions/host-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAER,kBAAkB,EAClB,gBAAgB,EAGnB,MAAM,SAAS,CAAC;AAiCjB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAQtD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,IAAI,gBAAgB,GAAG,IAAI,CAE3D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAM3C;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,SAAS,GAAG,OAAmB,GAAG,IAAI,CAMzF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAGlC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,IAAI,CAKrE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,cAAc,CAC1B,OAAO,EAAE,gBAAgB,GAC1B,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAY5D;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,cAAc,CAC1B,OAAO,EAAE,gBAAgB,GAC1B,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,IAAI,CAgBrE"}
|