@membranehq/sdk 0.17.5 → 0.17.6
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/dist/bundle.d.ts +6 -6
- package/dist/bundle.js +5182 -5182
- package/dist/bundle.js.map +1 -1
- package/dist/dts/accessors/action-instances-accessors.d.ts +1 -1
- package/dist/dts/accessors/actions-accessors.d.ts +1 -1
- package/dist/dts/accessors/app-data-schema-instances-accessors.d.ts +1 -1
- package/dist/dts/accessors/app-data-schemas-accessors.d.ts +1 -1
- package/dist/dts/accessors/app-event-subscriptions-accessors.d.ts +1 -1
- package/dist/dts/accessors/app-event-types-accessors.d.ts +1 -1
- package/dist/dts/accessors/connections-accessors.d.ts +5 -5
- package/dist/dts/accessors/customers-accessors.d.ts +1 -1
- package/dist/dts/accessors/data-link-table-instances-accessors.d.ts +1 -1
- package/dist/dts/accessors/data-link-tables-accessors.d.ts +1 -1
- package/dist/dts/accessors/data-sources-accessors.d.ts +1 -1
- package/dist/dts/accessors/external-event-subscriptions-accessors.d.ts +1 -1
- package/dist/dts/accessors/field-mapping-instances-accessors.d.ts +1 -1
- package/dist/dts/accessors/field-mappings-accessors.d.ts +1 -1
- package/dist/dts/accessors/flow-instances-accessors.d.ts +1 -1
- package/dist/dts/accessors/flows-accessors.d.ts +1 -1
- package/dist/dts/accessors/integrations-accessors.d.ts +5 -5
- package/dist/dts/accessors/scenarios-accessors.d.ts +1 -1
- package/dist/dts/accessors/screens-accessors.d.ts +1 -1
- package/dist/dts/alerts/utils.d.ts +1 -1
- package/dist/dts/client.d.ts +1 -1
- package/dist/dts/data-filter/index.d.ts +1 -1
- package/dist/dts/formulas/base.d.ts +1 -1
- package/dist/dts/formulas/eval.d.ts +1 -1
- package/dist/dts/formulas/findAppRecordId.d.ts +1 -1
- package/dist/dts/formulas/findExternalRecordId.d.ts +1 -1
- package/dist/dts/formulas/record.d.ts +1 -1
- package/dist/dts/workspace-elements/api/actions-api.d.ts +1 -1
- package/dist/dts/workspace-elements/api/data-link-table-instances-api.d.ts +1 -1
- package/dist/dts/workspace-elements/api/data-sources-api.d.ts +2 -2
- package/dist/dts/workspace-elements/api/field-mapping-instances-api.d.ts +1 -1
- package/dist/dts/workspace-elements/api/field-mappings-api.d.ts +1 -1
- package/dist/dts/workspace-elements/api/flows-api.d.ts +1 -1
- package/dist/dts/workspace-elements/base/actions/index.d.ts +2 -2
- package/dist/dts/workspace-elements/base/connectors/auth.d.ts +1 -1
- package/dist/dts/workspace-elements/base/connectors/functions.d.ts +1 -1
- package/dist/dts/workspace-elements/base/connectors/operations/handlers.d.ts +1 -1
- package/dist/dts/workspace-elements/base/data-collections/data-locations/collections/events/methods.d.ts +1 -1
- package/dist/dts/workspace-elements/base/data-collections/schemas.d.ts +1 -1
- package/dist/dts/workspace-elements/base/data-collections/udm/index.d.ts +1 -1
- package/dist/dts/workspace-elements/base/data-collections/utils.d.ts +1 -1
- package/dist/dts/workspaces/compare.d.ts +1 -1
- package/dist/index.browser.d.mts +437 -437
- package/dist/index.browser.d.ts +437 -437
- package/dist/index.browser.js +1114 -1114
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +1114 -1114
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.mts +437 -437
- package/dist/index.node.d.ts +437 -437
- package/dist/index.node.js +1114 -1114
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +1114 -1114
- package/dist/index.node.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.browser.mjs
CHANGED
|
@@ -4003,6 +4003,97 @@ class ConnectionSpec {
|
|
|
4003
4003
|
}
|
|
4004
4004
|
}
|
|
4005
4005
|
|
|
4006
|
+
var FunctionType;
|
|
4007
|
+
(function (FunctionType) {
|
|
4008
|
+
FunctionType["mapping"] = "mapping";
|
|
4009
|
+
FunctionType["operationMapping"] = "operation-mapping";
|
|
4010
|
+
FunctionType["restApiMapping"] = "rest-api-mapping";
|
|
4011
|
+
FunctionType["graphqlApiMapping"] = "graphql-api-mapping";
|
|
4012
|
+
FunctionType["javascript"] = "javascript";
|
|
4013
|
+
})(FunctionType || (FunctionType = {}));
|
|
4014
|
+
const BaseFunctionDefinition = z.object({
|
|
4015
|
+
type: z.enum([
|
|
4016
|
+
FunctionType.mapping,
|
|
4017
|
+
FunctionType.operationMapping,
|
|
4018
|
+
FunctionType.restApiMapping,
|
|
4019
|
+
FunctionType.graphqlApiMapping,
|
|
4020
|
+
FunctionType.javascript,
|
|
4021
|
+
]),
|
|
4022
|
+
});
|
|
4023
|
+
const GenericFunctionDefinition = z
|
|
4024
|
+
.object({
|
|
4025
|
+
type: z.enum(['mapping', 'operation-mapping', 'rest-api-mapping', 'graphql-api-mapping', 'javascript']).optional(),
|
|
4026
|
+
})
|
|
4027
|
+
.loose();
|
|
4028
|
+
|
|
4029
|
+
const GraphQLFieldMappingSchema = z.lazy(() => z.object({
|
|
4030
|
+
field: z.string(),
|
|
4031
|
+
args: z.record(z.string(), z.any()).optional(),
|
|
4032
|
+
subFields: z.array(GraphQLFieldMappingSchema).optional(),
|
|
4033
|
+
}));
|
|
4034
|
+
const GraphQLApiMappingSchema = z.object({
|
|
4035
|
+
path: z.string(),
|
|
4036
|
+
operationType: z.enum(['query', 'mutation']),
|
|
4037
|
+
requestMapping: z.array(GraphQLFieldMappingSchema),
|
|
4038
|
+
responseMapping: z.any().optional(),
|
|
4039
|
+
});
|
|
4040
|
+
const GraphqlApiMappingFunction = z.object({
|
|
4041
|
+
type: z.literal(FunctionType.graphqlApiMapping),
|
|
4042
|
+
mapping: GraphQLApiMappingSchema,
|
|
4043
|
+
});
|
|
4044
|
+
|
|
4045
|
+
const JavascriptFunction = z.object({
|
|
4046
|
+
type: z.literal(FunctionType.javascript),
|
|
4047
|
+
code: z.string(),
|
|
4048
|
+
});
|
|
4049
|
+
|
|
4050
|
+
const MappingSchema = z.any();
|
|
4051
|
+
const MappingFunction = z.object({
|
|
4052
|
+
type: z.literal(FunctionType.mapping),
|
|
4053
|
+
mapping: MappingSchema,
|
|
4054
|
+
});
|
|
4055
|
+
|
|
4056
|
+
const OperationMappingSchema = z.object({
|
|
4057
|
+
operationKey: z.string(),
|
|
4058
|
+
inputMapping: z.any().optional(),
|
|
4059
|
+
outputMapping: z.any().optional(),
|
|
4060
|
+
});
|
|
4061
|
+
const OperationMappingFunction = z.object({
|
|
4062
|
+
type: z.literal(FunctionType.operationMapping),
|
|
4063
|
+
mapping: OperationMappingSchema,
|
|
4064
|
+
});
|
|
4065
|
+
|
|
4066
|
+
const RequestMappingSchema = z.object({
|
|
4067
|
+
pathParameters: z.any().optional(),
|
|
4068
|
+
query: z.any().optional(),
|
|
4069
|
+
data: z.any().optional(),
|
|
4070
|
+
headers: z.any().optional(),
|
|
4071
|
+
});
|
|
4072
|
+
const RestApiMappingSchema = z.object({
|
|
4073
|
+
path: z.string(),
|
|
4074
|
+
method: z.string(),
|
|
4075
|
+
requestMapping: RequestMappingSchema,
|
|
4076
|
+
responseMapping: z.any().optional(),
|
|
4077
|
+
});
|
|
4078
|
+
const OpenapiMappingSchema = z.object({
|
|
4079
|
+
path: z.string(),
|
|
4080
|
+
method: z.string(),
|
|
4081
|
+
requestMapping: RequestMappingSchema,
|
|
4082
|
+
responseMapping: z.any().optional(),
|
|
4083
|
+
});
|
|
4084
|
+
const RestApiMappingFunction = z.object({
|
|
4085
|
+
type: z.literal(FunctionType.restApiMapping),
|
|
4086
|
+
mapping: RestApiMappingSchema,
|
|
4087
|
+
});
|
|
4088
|
+
|
|
4089
|
+
const FunctionDefinition = z.union([
|
|
4090
|
+
MappingFunction,
|
|
4091
|
+
OperationMappingFunction,
|
|
4092
|
+
RestApiMappingFunction,
|
|
4093
|
+
GraphqlApiMappingFunction,
|
|
4094
|
+
JavascriptFunction,
|
|
4095
|
+
]);
|
|
4096
|
+
|
|
4006
4097
|
var ConnectorMethodImplementationType;
|
|
4007
4098
|
(function (ConnectorMethodImplementationType) {
|
|
4008
4099
|
ConnectorMethodImplementationType["mapping"] = "mapping";
|
|
@@ -4399,97 +4490,6 @@ const REST_API_CLIENT_SCHEMA$1 = {
|
|
|
4399
4490
|
},
|
|
4400
4491
|
};
|
|
4401
4492
|
|
|
4402
|
-
var FunctionType;
|
|
4403
|
-
(function (FunctionType) {
|
|
4404
|
-
FunctionType["mapping"] = "mapping";
|
|
4405
|
-
FunctionType["operationMapping"] = "operation-mapping";
|
|
4406
|
-
FunctionType["restApiMapping"] = "rest-api-mapping";
|
|
4407
|
-
FunctionType["graphqlApiMapping"] = "graphql-api-mapping";
|
|
4408
|
-
FunctionType["javascript"] = "javascript";
|
|
4409
|
-
})(FunctionType || (FunctionType = {}));
|
|
4410
|
-
const BaseFunctionDefinition = z.object({
|
|
4411
|
-
type: z.enum([
|
|
4412
|
-
FunctionType.mapping,
|
|
4413
|
-
FunctionType.operationMapping,
|
|
4414
|
-
FunctionType.restApiMapping,
|
|
4415
|
-
FunctionType.graphqlApiMapping,
|
|
4416
|
-
FunctionType.javascript,
|
|
4417
|
-
]),
|
|
4418
|
-
});
|
|
4419
|
-
const GenericFunctionDefinition = z
|
|
4420
|
-
.object({
|
|
4421
|
-
type: z.enum(['mapping', 'operation-mapping', 'rest-api-mapping', 'graphql-api-mapping', 'javascript']).optional(),
|
|
4422
|
-
})
|
|
4423
|
-
.loose();
|
|
4424
|
-
|
|
4425
|
-
const GraphQLFieldMappingSchema = z.lazy(() => z.object({
|
|
4426
|
-
field: z.string(),
|
|
4427
|
-
args: z.record(z.string(), z.any()).optional(),
|
|
4428
|
-
subFields: z.array(GraphQLFieldMappingSchema).optional(),
|
|
4429
|
-
}));
|
|
4430
|
-
const GraphQLApiMappingSchema = z.object({
|
|
4431
|
-
path: z.string(),
|
|
4432
|
-
operationType: z.enum(['query', 'mutation']),
|
|
4433
|
-
requestMapping: z.array(GraphQLFieldMappingSchema),
|
|
4434
|
-
responseMapping: z.any().optional(),
|
|
4435
|
-
});
|
|
4436
|
-
const GraphqlApiMappingFunction = z.object({
|
|
4437
|
-
type: z.literal(FunctionType.graphqlApiMapping),
|
|
4438
|
-
mapping: GraphQLApiMappingSchema,
|
|
4439
|
-
});
|
|
4440
|
-
|
|
4441
|
-
const JavascriptFunction = z.object({
|
|
4442
|
-
type: z.literal(FunctionType.javascript),
|
|
4443
|
-
code: z.string(),
|
|
4444
|
-
});
|
|
4445
|
-
|
|
4446
|
-
const MappingSchema = z.any();
|
|
4447
|
-
const MappingFunction = z.object({
|
|
4448
|
-
type: z.literal(FunctionType.mapping),
|
|
4449
|
-
mapping: MappingSchema,
|
|
4450
|
-
});
|
|
4451
|
-
|
|
4452
|
-
const OperationMappingSchema = z.object({
|
|
4453
|
-
operationKey: z.string(),
|
|
4454
|
-
inputMapping: z.any().optional(),
|
|
4455
|
-
outputMapping: z.any().optional(),
|
|
4456
|
-
});
|
|
4457
|
-
const OperationMappingFunction = z.object({
|
|
4458
|
-
type: z.literal(FunctionType.operationMapping),
|
|
4459
|
-
mapping: OperationMappingSchema,
|
|
4460
|
-
});
|
|
4461
|
-
|
|
4462
|
-
const RequestMappingSchema = z.object({
|
|
4463
|
-
pathParameters: z.any().optional(),
|
|
4464
|
-
query: z.any().optional(),
|
|
4465
|
-
data: z.any().optional(),
|
|
4466
|
-
headers: z.any().optional(),
|
|
4467
|
-
});
|
|
4468
|
-
const RestApiMappingSchema = z.object({
|
|
4469
|
-
path: z.string(),
|
|
4470
|
-
method: z.string(),
|
|
4471
|
-
requestMapping: RequestMappingSchema,
|
|
4472
|
-
responseMapping: z.any().optional(),
|
|
4473
|
-
});
|
|
4474
|
-
const OpenapiMappingSchema = z.object({
|
|
4475
|
-
path: z.string(),
|
|
4476
|
-
method: z.string(),
|
|
4477
|
-
requestMapping: RequestMappingSchema,
|
|
4478
|
-
responseMapping: z.any().optional(),
|
|
4479
|
-
});
|
|
4480
|
-
const RestApiMappingFunction = z.object({
|
|
4481
|
-
type: z.literal(FunctionType.restApiMapping),
|
|
4482
|
-
mapping: RestApiMappingSchema,
|
|
4483
|
-
});
|
|
4484
|
-
|
|
4485
|
-
const FunctionDefinition = z.union([
|
|
4486
|
-
MappingFunction,
|
|
4487
|
-
OperationMappingFunction,
|
|
4488
|
-
RestApiMappingFunction,
|
|
4489
|
-
GraphqlApiMappingFunction,
|
|
4490
|
-
JavascriptFunction,
|
|
4491
|
-
]);
|
|
4492
|
-
|
|
4493
4493
|
const CONNECTOR_DATA_DIR = 'data';
|
|
4494
4494
|
const CONNECTOR_OPERATIONS_DIR = 'operations';
|
|
4495
4495
|
const CONNECTOR_DOCS_DIR = 'docs';
|
|
@@ -4665,369 +4665,528 @@ var DataCollectionEventType;
|
|
|
4665
4665
|
DataCollectionEventType["DELETED"] = "deleted";
|
|
4666
4666
|
})(DataCollectionEventType || (DataCollectionEventType = {}));
|
|
4667
4667
|
|
|
4668
|
-
const
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
];
|
|
4668
|
+
const structuredClone$1 = (structuredClonePolyfill === null || structuredClonePolyfill === void 0 ? void 0 : structuredClonePolyfill.default) || structuredClonePolyfill;
|
|
4669
|
+
function isNil(value) {
|
|
4670
|
+
return value == null;
|
|
4671
|
+
}
|
|
4672
|
+
function omitBy(obj, check) {
|
|
4673
|
+
obj = { ...obj };
|
|
4674
|
+
Object.entries(obj).forEach(([key, value]) => check(value) && delete obj[key]);
|
|
4675
|
+
return obj;
|
|
4676
|
+
}
|
|
4677
|
+
function isEmptyValue(value) {
|
|
4678
|
+
if (isNil(value)) {
|
|
4679
|
+
return true;
|
|
4680
|
+
}
|
|
4681
|
+
if (typeof value === 'symbol') {
|
|
4682
|
+
return true;
|
|
4683
|
+
}
|
|
4684
|
+
if (typeof value === 'boolean') {
|
|
4685
|
+
return false;
|
|
4686
|
+
}
|
|
4687
|
+
if (typeof value === 'number') {
|
|
4688
|
+
return isNaN(value);
|
|
4689
|
+
}
|
|
4690
|
+
if (typeof value === 'string') {
|
|
4691
|
+
return value.trim().length === 0;
|
|
4692
|
+
}
|
|
4693
|
+
const tag = value.toString();
|
|
4694
|
+
if (tag === '[object Map]' || tag === '[object Set]') {
|
|
4695
|
+
return !value.size;
|
|
4696
|
+
}
|
|
4697
|
+
return typeof value === 'object' && Object.keys(value).length === 0;
|
|
4698
|
+
}
|
|
4699
|
+
const simpleUniqueId = () => {
|
|
4700
|
+
return Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)
|
|
4701
|
+
.toString(36)
|
|
4702
|
+
.padStart(11, '0')
|
|
4703
|
+
.substring(0, 11);
|
|
4704
|
+
};
|
|
4675
4705
|
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
}
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
}
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
supportedImplementationTypes: DataLocationMethodImplementationTypes,
|
|
4722
|
-
};
|
|
4723
|
-
|
|
4724
|
-
const DataCollectionMethodDelete = {
|
|
4725
|
-
name: 'Delete',
|
|
4726
|
-
description: 'Delete a data record from the collection by id',
|
|
4727
|
-
getInputSchema: ({ collectionHandler, parameters, credentialsSchema }) => {
|
|
4706
|
+
function getDataLocationMethodPath(locationKey, methodKey) {
|
|
4707
|
+
return `data/${locationKey}/${toKebabCase(methodKey)}`;
|
|
4708
|
+
}
|
|
4709
|
+
function dataLocationParametersMatch({ locationParameters, targetParameters, }) {
|
|
4710
|
+
targetParameters = typeof targetParameters === 'object' && targetParameters ? targetParameters : {};
|
|
4711
|
+
locationParameters = typeof locationParameters === 'object' && locationParameters ? locationParameters : {};
|
|
4712
|
+
for (const [key, value] of Object.entries(targetParameters)) {
|
|
4713
|
+
if (locationParameters[key] !== value) {
|
|
4714
|
+
return false;
|
|
4715
|
+
}
|
|
4716
|
+
}
|
|
4717
|
+
return true;
|
|
4718
|
+
}
|
|
4719
|
+
function parseDataLocationPath(path) {
|
|
4720
|
+
if (!path) {
|
|
4721
|
+
return undefined;
|
|
4722
|
+
}
|
|
4723
|
+
if (path.startsWith('/')) {
|
|
4724
|
+
path = path.slice(1);
|
|
4725
|
+
}
|
|
4726
|
+
if (!path.startsWith('data/')) {
|
|
4727
|
+
throw new Error(`Invalid data location path: ${path}. It should start with "data/"`);
|
|
4728
|
+
}
|
|
4729
|
+
path = path.slice(5);
|
|
4730
|
+
const [key, query] = path.split('?');
|
|
4731
|
+
const parameters = Object.fromEntries(new URLSearchParams(query).entries());
|
|
4732
|
+
return { key, parameters };
|
|
4733
|
+
}
|
|
4734
|
+
function makeDataLocationPath(pointer) {
|
|
4735
|
+
var _a;
|
|
4736
|
+
const normalizedPointer = normalizePointer(pointer);
|
|
4737
|
+
if (normalizedPointer === null || normalizedPointer === void 0 ? void 0 : normalizedPointer.key) {
|
|
4738
|
+
let path = `/data/${normalizedPointer.key}`;
|
|
4739
|
+
const parameters = omitBy((_a = normalizedPointer.parameters) !== null && _a !== void 0 ? _a : {}, isNil);
|
|
4740
|
+
if (Object.keys(parameters).length > 0) {
|
|
4741
|
+
path += `?${new URLSearchParams(parameters).toString()}`;
|
|
4742
|
+
}
|
|
4743
|
+
return path;
|
|
4744
|
+
}
|
|
4745
|
+
else {
|
|
4746
|
+
return undefined;
|
|
4747
|
+
}
|
|
4748
|
+
}
|
|
4749
|
+
function normalizePointer(pointer) {
|
|
4750
|
+
if (typeof pointer === 'string' && pointer.startsWith('/data/')) {
|
|
4728
4751
|
return {
|
|
4729
|
-
|
|
4730
|
-
properties: nonEmptyObjectProperties({
|
|
4731
|
-
id: {
|
|
4732
|
-
type: 'string',
|
|
4733
|
-
referenceCollection: { key: collectionHandler === null || collectionHandler === void 0 ? void 0 : collectionHandler.key, parameters },
|
|
4734
|
-
},
|
|
4735
|
-
credentials: credentialsSchema,
|
|
4736
|
-
}),
|
|
4752
|
+
key: pointer.slice(6),
|
|
4737
4753
|
};
|
|
4738
|
-
}
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4754
|
+
}
|
|
4755
|
+
return pointer;
|
|
4756
|
+
}
|
|
4757
|
+
function makeDataLocationOperationPath(collectionPath, operation) {
|
|
4758
|
+
const [path, query] = (collectionPath !== null && collectionPath !== void 0 ? collectionPath : '').split('?');
|
|
4759
|
+
return urljoin(path, operation, query ? `?${query}` : '');
|
|
4760
|
+
}
|
|
4761
|
+
function isSameDataLocation(location1, location2) {
|
|
4762
|
+
if (location1.key !== location2.key) {
|
|
4763
|
+
return false;
|
|
4764
|
+
}
|
|
4765
|
+
const cleanParameters1 = location1.parameters && Object.keys(location1.parameters).length > 0 ? location1.parameters : undefined;
|
|
4766
|
+
const cleanParameters2 = location2.parameters && Object.keys(location2.parameters).length > 0 ? location2.parameters : undefined;
|
|
4767
|
+
if (!deepEqual(cleanParameters1, cleanParameters2)) {
|
|
4768
|
+
return false;
|
|
4769
|
+
}
|
|
4770
|
+
return true;
|
|
4771
|
+
}
|
|
4772
|
+
function isDataLocationMethodSupported(location, methodKey) {
|
|
4773
|
+
var _a;
|
|
4774
|
+
const method = (_a = location === null || location === void 0 ? void 0 : location.methods) === null || _a === void 0 ? void 0 : _a[methodKey];
|
|
4775
|
+
return method && method.implementationType !== ConnectorMethodImplementationType.notSupported;
|
|
4776
|
+
}
|
|
4777
|
+
function getDataCollectionCreateFields(spec) {
|
|
4778
|
+
if (!spec)
|
|
4779
|
+
return undefined;
|
|
4780
|
+
if (!spec.fieldsSchema)
|
|
4781
|
+
return undefined;
|
|
4782
|
+
if (!spec.create)
|
|
4783
|
+
return undefined;
|
|
4784
|
+
let schema = excludeReadOnlyFieldsFromSchema(spec.fieldsSchema);
|
|
4785
|
+
if (spec.create.fields) {
|
|
4786
|
+
schema = pickFieldsFromSchema(schema, spec.create.fields);
|
|
4787
|
+
}
|
|
4788
|
+
if (spec.create.excludedFields) {
|
|
4789
|
+
schema = excludeFieldsFromSchema(schema, spec.create.excludedFields);
|
|
4790
|
+
}
|
|
4791
|
+
return schema;
|
|
4792
|
+
}
|
|
4793
|
+
function getDataCollectionUpdateFields(spec) {
|
|
4794
|
+
if (!spec)
|
|
4795
|
+
return undefined;
|
|
4796
|
+
if (!spec.fieldsSchema)
|
|
4797
|
+
return undefined;
|
|
4798
|
+
if (!spec.update)
|
|
4799
|
+
return undefined;
|
|
4800
|
+
let schema = excludeReadOnlyFieldsFromSchema(spec.fieldsSchema);
|
|
4801
|
+
if (spec.update.fields) {
|
|
4802
|
+
schema = pickFieldsFromSchema(schema, spec.update.fields);
|
|
4803
|
+
}
|
|
4804
|
+
if (spec.update.excludedFields) {
|
|
4805
|
+
schema = excludeFieldsFromSchema(schema, spec.update.excludedFields);
|
|
4806
|
+
}
|
|
4807
|
+
return schema;
|
|
4808
|
+
}
|
|
4809
|
+
function getWritableFieldsSchema(spec) {
|
|
4810
|
+
if (!spec)
|
|
4811
|
+
return undefined;
|
|
4812
|
+
if (!spec.fieldsSchema)
|
|
4813
|
+
return undefined;
|
|
4814
|
+
return mergeSchemas([getDataCollectionCreateFields(spec), getDataCollectionUpdateFields(spec)]);
|
|
4815
|
+
}
|
|
4816
|
+
function getReferenceCollectionPointerForSchema(schema) {
|
|
4817
|
+
if ((schema === null || schema === void 0 ? void 0 : schema.referenceCollection) && schema.referenceCollection.key) {
|
|
4818
|
+
return schema.referenceCollection;
|
|
4819
|
+
}
|
|
4820
|
+
else if (schema === null || schema === void 0 ? void 0 : schema.referenceCollectionPath) {
|
|
4821
|
+
return parseDataLocationPath(schema.referenceCollectionPath);
|
|
4822
|
+
}
|
|
4823
|
+
else if (schema === null || schema === void 0 ? void 0 : schema.referenceCollectionUri) {
|
|
4824
|
+
return parseDataLocationPath(schema.referenceCollectionUri);
|
|
4825
|
+
}
|
|
4826
|
+
else {
|
|
4827
|
+
return undefined;
|
|
4828
|
+
}
|
|
4829
|
+
}
|
|
4830
|
+
function getReferenceCollectionPathForSchema(schema) {
|
|
4831
|
+
const pointer = getReferenceCollectionPointerForSchema(schema);
|
|
4832
|
+
return makeDataLocationPath(pointer);
|
|
4833
|
+
}
|
|
4742
4834
|
|
|
4743
|
-
const
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4835
|
+
const FIELDS_SCHEMA$G = {
|
|
4836
|
+
type: 'object',
|
|
4837
|
+
properties: {
|
|
4838
|
+
id: { type: 'string', readOnly: true },
|
|
4839
|
+
title: { type: 'string' },
|
|
4840
|
+
description: { type: 'string' },
|
|
4841
|
+
type: { type: 'string' },
|
|
4842
|
+
durationSeconds: { type: 'number' },
|
|
4843
|
+
location: { type: 'string' },
|
|
4844
|
+
isRecurrent: { type: 'boolean' },
|
|
4845
|
+
participants: {
|
|
4846
|
+
type: 'array',
|
|
4847
|
+
items: {
|
|
4848
|
+
type: 'object',
|
|
4849
|
+
properties: {
|
|
4850
|
+
userId: { type: 'string' },
|
|
4851
|
+
contactId: { type: 'string' },
|
|
4756
4852
|
},
|
|
4757
4853
|
},
|
|
4758
|
-
}
|
|
4854
|
+
},
|
|
4855
|
+
status: { type: 'string' },
|
|
4856
|
+
contactId: {
|
|
4857
|
+
type: 'string',
|
|
4858
|
+
referenceUdm: 'contacts',
|
|
4859
|
+
},
|
|
4860
|
+
companyId: {
|
|
4861
|
+
type: 'string',
|
|
4862
|
+
referenceUdm: 'companies',
|
|
4863
|
+
},
|
|
4864
|
+
dealId: {
|
|
4865
|
+
type: 'string',
|
|
4866
|
+
referenceUdm: 'deals',
|
|
4867
|
+
},
|
|
4868
|
+
leadId: {
|
|
4869
|
+
type: 'string',
|
|
4870
|
+
referenceUdm: 'leads',
|
|
4871
|
+
},
|
|
4872
|
+
ownerId: {
|
|
4873
|
+
type: 'string',
|
|
4874
|
+
referenceUdm: 'users',
|
|
4875
|
+
},
|
|
4876
|
+
startTime: {
|
|
4877
|
+
type: 'string',
|
|
4878
|
+
format: 'date-time',
|
|
4879
|
+
},
|
|
4880
|
+
endTime: {
|
|
4881
|
+
type: 'string',
|
|
4882
|
+
format: 'date-time',
|
|
4883
|
+
},
|
|
4884
|
+
dueTime: {
|
|
4885
|
+
type: 'string',
|
|
4886
|
+
format: 'date-time',
|
|
4887
|
+
},
|
|
4888
|
+
createdTime: {
|
|
4889
|
+
type: 'string',
|
|
4890
|
+
format: 'date-time',
|
|
4891
|
+
readOnly: true,
|
|
4892
|
+
},
|
|
4893
|
+
createdBy: {
|
|
4894
|
+
type: 'string',
|
|
4895
|
+
referenceUdm: 'users',
|
|
4896
|
+
readOnly: true,
|
|
4897
|
+
},
|
|
4898
|
+
updatedTime: {
|
|
4899
|
+
type: 'string',
|
|
4900
|
+
format: 'date-time',
|
|
4901
|
+
readOnly: true,
|
|
4902
|
+
},
|
|
4903
|
+
updatedBy: {
|
|
4904
|
+
type: 'string',
|
|
4905
|
+
referenceUdm: 'users',
|
|
4906
|
+
readOnly: true,
|
|
4907
|
+
},
|
|
4759
4908
|
},
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
}
|
|
4769
|
-
if (queryFieldsSchema === null || queryFieldsSchema === void 0 ? void 0 : queryFieldsSchema.properties) {
|
|
4770
|
-
schema.properties = {
|
|
4771
|
-
...schema.properties,
|
|
4772
|
-
query: transformVariablesWith(queryFieldsSchema, (locator) => `query.${locatorToField(locator)}`),
|
|
4773
|
-
};
|
|
4774
|
-
}
|
|
4775
|
-
return schema;
|
|
4909
|
+
};
|
|
4910
|
+
const FallbackFieldsMap = {
|
|
4911
|
+
fromActivitiesToTasks: {
|
|
4912
|
+
subject: {
|
|
4913
|
+
$var: 'title',
|
|
4914
|
+
},
|
|
4915
|
+
content: {
|
|
4916
|
+
$var: 'description',
|
|
4917
|
+
},
|
|
4776
4918
|
},
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4919
|
+
fromTasksToActivities: {
|
|
4920
|
+
title: {
|
|
4921
|
+
$var: 'subject',
|
|
4922
|
+
},
|
|
4923
|
+
description: {
|
|
4924
|
+
$var: 'content',
|
|
4925
|
+
},
|
|
4926
|
+
},
|
|
4927
|
+
fromActivitiesToNotes: {
|
|
4928
|
+
content: {
|
|
4929
|
+
$var: 'description',
|
|
4930
|
+
},
|
|
4931
|
+
},
|
|
4932
|
+
fromNotesToActivities: {
|
|
4933
|
+
description: {
|
|
4934
|
+
$var: 'content',
|
|
4935
|
+
},
|
|
4936
|
+
},
|
|
4937
|
+
fromActivitiesToEmails: {
|
|
4938
|
+
subject: {
|
|
4939
|
+
$var: 'title',
|
|
4940
|
+
},
|
|
4941
|
+
body: {
|
|
4942
|
+
$var: 'description',
|
|
4943
|
+
},
|
|
4944
|
+
},
|
|
4945
|
+
fromEmailsToActivities: {
|
|
4946
|
+
title: {
|
|
4947
|
+
$var: 'subject',
|
|
4948
|
+
},
|
|
4949
|
+
description: {
|
|
4950
|
+
$var: 'body',
|
|
4951
|
+
},
|
|
4791
4952
|
},
|
|
4792
|
-
supportedImplementationTypes: DataLocationMethodImplementationTypes,
|
|
4793
4953
|
};
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
properties: nonEmptyObjectProperties({
|
|
4801
|
-
id: {
|
|
4802
|
-
type: 'string',
|
|
4803
|
-
referenceCollection: { key: collectionHandler === null || collectionHandler === void 0 ? void 0 : collectionHandler.key, parameters },
|
|
4804
|
-
},
|
|
4805
|
-
credentials: credentialsSchema,
|
|
4806
|
-
}),
|
|
4807
|
-
}),
|
|
4808
|
-
getOutputSchema: ({ collectionSpec }) => {
|
|
4809
|
-
var _a;
|
|
4810
|
-
return ({
|
|
4811
|
-
type: 'object',
|
|
4812
|
-
properties: {
|
|
4813
|
-
record: (_a = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema) !== null && _a !== void 0 ? _a : { type: 'object' },
|
|
4814
|
-
},
|
|
4815
|
-
});
|
|
4954
|
+
const udm$G = {
|
|
4955
|
+
singularName: 'activity',
|
|
4956
|
+
pluralName: 'activities',
|
|
4957
|
+
fieldsSchema: FIELDS_SCHEMA$G,
|
|
4958
|
+
list: {
|
|
4959
|
+
filterFields: ['type', 'companyId', 'contactId', 'dealId', 'leadId', 'ownerId'],
|
|
4816
4960
|
},
|
|
4817
|
-
|
|
4961
|
+
match: {
|
|
4962
|
+
fields: ['type', 'companyId', 'contactId', 'dealId', 'leadId', 'ownerId'],
|
|
4963
|
+
},
|
|
4964
|
+
populateFields,
|
|
4965
|
+
udmFallbacks: [
|
|
4966
|
+
{
|
|
4967
|
+
udm: 'tasks',
|
|
4968
|
+
importFields: FallbackFieldsMap.fromTasksToActivities,
|
|
4969
|
+
exportFields: FallbackFieldsMap.fromActivitiesToTasks,
|
|
4970
|
+
},
|
|
4971
|
+
{
|
|
4972
|
+
udm: 'meetings',
|
|
4973
|
+
},
|
|
4974
|
+
{
|
|
4975
|
+
udm: 'notes',
|
|
4976
|
+
importFields: FallbackFieldsMap.fromNotesToActivities,
|
|
4977
|
+
exportFields: FallbackFieldsMap.fromActivitiesToNotes,
|
|
4978
|
+
},
|
|
4979
|
+
{
|
|
4980
|
+
udm: 'emails',
|
|
4981
|
+
importFields: FallbackFieldsMap.fromEmailsToActivities,
|
|
4982
|
+
exportFields: FallbackFieldsMap.fromActivitiesToEmails,
|
|
4983
|
+
},
|
|
4984
|
+
],
|
|
4818
4985
|
};
|
|
4986
|
+
function populateFields(fields) {
|
|
4987
|
+
const result = JSON.parse(JSON.stringify(fields));
|
|
4988
|
+
if (!result.dueTime) {
|
|
4989
|
+
result.dueTime = result.endTime || result.startTime;
|
|
4990
|
+
}
|
|
4991
|
+
if (!result.startTime) {
|
|
4992
|
+
result.startTime = result.dueTime || result.endTime;
|
|
4993
|
+
}
|
|
4994
|
+
if (!result.endTime) {
|
|
4995
|
+
result.endTime = result.dueTime || result.startTime;
|
|
4996
|
+
}
|
|
4997
|
+
return result;
|
|
4998
|
+
}
|
|
4819
4999
|
|
|
4820
|
-
const
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
5000
|
+
const FIELDS_SCHEMA$F = {
|
|
5001
|
+
type: 'object',
|
|
5002
|
+
properties: {
|
|
5003
|
+
id: { type: 'string', readOnly: true },
|
|
5004
|
+
number: { type: 'string' },
|
|
5005
|
+
name: { type: 'string' },
|
|
5006
|
+
memo: { type: 'string' },
|
|
5007
|
+
status: { type: 'string' },
|
|
5008
|
+
paymentMethod: { type: 'string' },
|
|
5009
|
+
supplierId: { type: 'string', referenceUdm: 'suppliers' },
|
|
5010
|
+
currency: { type: 'string' },
|
|
5011
|
+
payments: {
|
|
5012
|
+
type: 'array',
|
|
5013
|
+
items: {
|
|
5014
|
+
type: 'string',
|
|
5015
|
+
referenceUdm: 'payments',
|
|
5016
|
+
},
|
|
5017
|
+
},
|
|
5018
|
+
lineItems: {
|
|
5019
|
+
type: 'array',
|
|
5020
|
+
items: {
|
|
5021
|
+
type: 'object',
|
|
5022
|
+
properties: {
|
|
5023
|
+
id: { type: 'string' },
|
|
5024
|
+
itemName: { type: 'string' },
|
|
5025
|
+
description: { type: 'string' },
|
|
5026
|
+
code: { type: 'string' },
|
|
5027
|
+
type: { type: 'string' },
|
|
5028
|
+
companyId: { type: 'string', referenceUdm: 'companies' },
|
|
5029
|
+
ledgerAccountId: { type: 'string', referenceUdm: 'ledger-accounts' },
|
|
5030
|
+
quantity: { type: 'number' },
|
|
5031
|
+
unitPrice: { type: 'number' },
|
|
5032
|
+
unitOfMeasure: { type: 'string' },
|
|
5033
|
+
purchasePrice: { type: 'number' },
|
|
5034
|
+
salesPrice: { type: 'number' },
|
|
5035
|
+
taxable: { type: 'boolean' },
|
|
5036
|
+
taxAmount: { type: 'number' },
|
|
5037
|
+
totalAmount: { type: 'number' },
|
|
4832
5038
|
},
|
|
4833
5039
|
},
|
|
4834
|
-
}
|
|
5040
|
+
},
|
|
5041
|
+
totalAmount: { type: 'number' },
|
|
5042
|
+
totalTax: { type: 'number' },
|
|
5043
|
+
exchangeRate: { type: 'number' },
|
|
5044
|
+
totalDiscount: { type: 'number' },
|
|
5045
|
+
subTotal: { type: 'number' },
|
|
5046
|
+
balance: { type: 'number' },
|
|
5047
|
+
ledgerAccountId: { type: 'string', referenceUdm: 'ledger-accounts' },
|
|
5048
|
+
issueDate: {
|
|
5049
|
+
type: 'string',
|
|
5050
|
+
format: 'date-time',
|
|
5051
|
+
},
|
|
5052
|
+
dueDate: {
|
|
5053
|
+
type: 'string',
|
|
5054
|
+
format: 'date-time',
|
|
5055
|
+
},
|
|
5056
|
+
paidOnDate: {
|
|
5057
|
+
type: 'string',
|
|
5058
|
+
format: 'date-time',
|
|
5059
|
+
},
|
|
5060
|
+
createdTime: { type: 'string', format: 'date-time', readOnly: true },
|
|
5061
|
+
createdBy: { type: 'string', referenceUdm: 'users', readOnly: true },
|
|
5062
|
+
updatedTime: { type: 'string', format: 'date-time', readOnly: true },
|
|
5063
|
+
updatedBy: { type: 'string', referenceUdm: 'users', readOnly: true },
|
|
4835
5064
|
},
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
type: 'object',
|
|
4844
|
-
properties: nonEmptyObjectProperties({
|
|
4845
|
-
filter: filterSchema,
|
|
4846
|
-
cursor: {
|
|
4847
|
-
type: 'string',
|
|
4848
|
-
description: 'Cursor returned in response to the previous "list" request',
|
|
4849
|
-
},
|
|
4850
|
-
credentials: credentialsSchema,
|
|
4851
|
-
}),
|
|
4852
|
-
};
|
|
5065
|
+
};
|
|
5066
|
+
const udm$F = {
|
|
5067
|
+
singularName: 'bill',
|
|
5068
|
+
pluralName: 'bills',
|
|
5069
|
+
fieldsSchema: FIELDS_SCHEMA$F,
|
|
5070
|
+
list: {
|
|
5071
|
+
filterFields: ['name', 'number', 'status', 'supplierId'],
|
|
4853
5072
|
},
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
return ({
|
|
4857
|
-
type: 'object',
|
|
4858
|
-
properties: {
|
|
4859
|
-
records: {
|
|
4860
|
-
type: 'array',
|
|
4861
|
-
items: (_a = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema) !== null && _a !== void 0 ? _a : { type: 'object' },
|
|
4862
|
-
},
|
|
4863
|
-
cursor: {
|
|
4864
|
-
type: 'string',
|
|
4865
|
-
description: 'Cursor to request the next page of results',
|
|
4866
|
-
},
|
|
4867
|
-
},
|
|
4868
|
-
});
|
|
5073
|
+
match: {
|
|
5074
|
+
fields: ['name', 'number', 'status', 'supplierId'],
|
|
4869
5075
|
},
|
|
4870
|
-
supportedImplementationTypes: DataLocationMethodImplementationTypes,
|
|
4871
5076
|
};
|
|
4872
5077
|
|
|
4873
|
-
const
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
type: '
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
}
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
}),
|
|
4921
|
-
}),
|
|
4922
|
-
getOutputSchema: ({ collectionSpec }) => {
|
|
4923
|
-
var _a;
|
|
4924
|
-
return ({
|
|
4925
|
-
type: 'object',
|
|
4926
|
-
properties: {
|
|
4927
|
-
records: {
|
|
4928
|
-
type: 'array',
|
|
4929
|
-
items: (_a = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema) !== null && _a !== void 0 ? _a : { type: 'object' },
|
|
4930
|
-
},
|
|
4931
|
-
cursor: { type: 'string' },
|
|
4932
|
-
},
|
|
4933
|
-
});
|
|
5078
|
+
const FIELDS_SCHEMA$E = {
|
|
5079
|
+
type: 'object',
|
|
5080
|
+
properties: {
|
|
5081
|
+
id: { type: 'string', readOnly: true },
|
|
5082
|
+
fullName: { type: 'string' },
|
|
5083
|
+
firstName: { type: 'string' },
|
|
5084
|
+
lastName: { type: 'string' },
|
|
5085
|
+
primaryEmail: { type: 'string' },
|
|
5086
|
+
campaignId: {
|
|
5087
|
+
type: 'string',
|
|
5088
|
+
referenceUdm: 'campaigns',
|
|
5089
|
+
},
|
|
5090
|
+
contactId: {
|
|
5091
|
+
type: 'string',
|
|
5092
|
+
referenceUdm: 'contacts',
|
|
5093
|
+
},
|
|
5094
|
+
leadId: {
|
|
5095
|
+
type: 'string',
|
|
5096
|
+
referenceUdm: 'leads',
|
|
5097
|
+
},
|
|
5098
|
+
source: { type: 'string' },
|
|
5099
|
+
status: { type: 'string' },
|
|
5100
|
+
companyId: {
|
|
5101
|
+
type: 'string',
|
|
5102
|
+
referenceUdm: 'companies',
|
|
5103
|
+
},
|
|
5104
|
+
jobTitle: { type: 'string' },
|
|
5105
|
+
hasOptedOutOfEmail: { type: 'boolean' },
|
|
5106
|
+
createdTime: {
|
|
5107
|
+
type: 'string',
|
|
5108
|
+
format: 'date-time',
|
|
5109
|
+
},
|
|
5110
|
+
createdBy: {
|
|
5111
|
+
type: 'string',
|
|
5112
|
+
readOnly: true,
|
|
5113
|
+
referenceUdm: 'users',
|
|
5114
|
+
},
|
|
5115
|
+
updatedTime: {
|
|
5116
|
+
type: 'string',
|
|
5117
|
+
readOnly: true,
|
|
5118
|
+
format: 'date-time',
|
|
5119
|
+
},
|
|
5120
|
+
updatedBy: {
|
|
5121
|
+
type: 'string',
|
|
5122
|
+
readOnly: true,
|
|
5123
|
+
referenceUdm: 'users',
|
|
5124
|
+
},
|
|
4934
5125
|
},
|
|
4935
|
-
supportedImplementationTypes: DataLocationMethodImplementationTypes,
|
|
4936
5126
|
};
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
type: 'array',
|
|
4953
|
-
items: { type: 'string', enum: fields },
|
|
4954
|
-
},
|
|
4955
|
-
},
|
|
4956
|
-
};
|
|
5127
|
+
const udm$E = {
|
|
5128
|
+
singularName: 'campaign-member',
|
|
5129
|
+
pluralName: 'campaign-members',
|
|
5130
|
+
fieldsSchema: FIELDS_SCHEMA$E,
|
|
5131
|
+
list: {
|
|
5132
|
+
filterFields: [
|
|
5133
|
+
'primaryEmail',
|
|
5134
|
+
'fullName',
|
|
5135
|
+
'firstName',
|
|
5136
|
+
'lastName',
|
|
5137
|
+
'campaignId',
|
|
5138
|
+
'contactId',
|
|
5139
|
+
'leadId',
|
|
5140
|
+
'companyId',
|
|
5141
|
+
],
|
|
4957
5142
|
},
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
let fieldsSchema = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema;
|
|
4961
|
-
if (method === null || method === void 0 ? void 0 : method.fields) {
|
|
4962
|
-
fieldsSchema = pickFieldsFromSchema(fieldsSchema, method.fields);
|
|
4963
|
-
}
|
|
4964
|
-
if (method === null || method === void 0 ? void 0 : method.excludedFields) {
|
|
4965
|
-
fieldsSchema = excludeFieldsFromSchema(fieldsSchema, method.excludedFields);
|
|
4966
|
-
}
|
|
4967
|
-
return {
|
|
4968
|
-
type: 'object',
|
|
4969
|
-
properties: nonEmptyObjectProperties({
|
|
4970
|
-
id: {
|
|
4971
|
-
type: 'string',
|
|
4972
|
-
referenceCollection: { key: collectionHandler === null || collectionHandler === void 0 ? void 0 : collectionHandler.key, parameters },
|
|
4973
|
-
},
|
|
4974
|
-
fields: (_a = transformVariablesWith(fieldsSchema, (locator) => `fields.${locatorToField(locator)}`)) !== null && _a !== void 0 ? _a : {
|
|
4975
|
-
type: 'object',
|
|
4976
|
-
},
|
|
4977
|
-
credentials: credentialsSchema,
|
|
4978
|
-
}),
|
|
4979
|
-
};
|
|
5143
|
+
match: {
|
|
5144
|
+
fields: ['primaryEmail', 'fullName', 'firstName', 'lastName', 'campaignId', 'contactId', 'leadId', 'companyId'],
|
|
4980
5145
|
},
|
|
4981
|
-
getOutputSchema: ({}) => ({
|
|
4982
|
-
type: 'object',
|
|
4983
|
-
properties: {
|
|
4984
|
-
id: { type: 'string' },
|
|
4985
|
-
},
|
|
4986
|
-
}),
|
|
4987
|
-
supportedImplementationTypes: DataLocationMethodImplementationTypes,
|
|
4988
5146
|
};
|
|
4989
5147
|
|
|
4990
|
-
const FIELDS_SCHEMA$
|
|
5148
|
+
const FIELDS_SCHEMA$D = {
|
|
4991
5149
|
type: 'object',
|
|
4992
5150
|
properties: {
|
|
4993
5151
|
id: { type: 'string', readOnly: true },
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
type: { type: 'string' },
|
|
4997
|
-
durationSeconds: { type: 'number' },
|
|
4998
|
-
location: { type: 'string' },
|
|
4999
|
-
isRecurrent: { type: 'boolean' },
|
|
5000
|
-
participants: {
|
|
5001
|
-
type: 'array',
|
|
5002
|
-
items: {
|
|
5003
|
-
type: 'object',
|
|
5004
|
-
properties: {
|
|
5005
|
-
userId: { type: 'string' },
|
|
5006
|
-
contactId: { type: 'string' },
|
|
5007
|
-
},
|
|
5008
|
-
},
|
|
5152
|
+
name: {
|
|
5153
|
+
type: 'string',
|
|
5009
5154
|
},
|
|
5010
|
-
|
|
5011
|
-
|
|
5155
|
+
cost: {
|
|
5156
|
+
type: 'number',
|
|
5157
|
+
},
|
|
5158
|
+
description: {
|
|
5012
5159
|
type: 'string',
|
|
5013
|
-
referenceUdm: 'contacts',
|
|
5014
5160
|
},
|
|
5015
|
-
|
|
5161
|
+
source: {
|
|
5016
5162
|
type: 'string',
|
|
5017
|
-
referenceUdm: 'companies',
|
|
5018
5163
|
},
|
|
5019
|
-
|
|
5164
|
+
stage: {
|
|
5020
5165
|
type: 'string',
|
|
5021
|
-
referenceUdm: 'deals',
|
|
5022
5166
|
},
|
|
5023
|
-
|
|
5167
|
+
type: {
|
|
5024
5168
|
type: 'string',
|
|
5025
|
-
referenceUdm: 'leads',
|
|
5026
5169
|
},
|
|
5027
5170
|
ownerId: {
|
|
5028
5171
|
type: 'string',
|
|
5029
5172
|
referenceUdm: 'users',
|
|
5030
5173
|
},
|
|
5174
|
+
sentCount: {
|
|
5175
|
+
type: 'number',
|
|
5176
|
+
readOnly: true,
|
|
5177
|
+
},
|
|
5178
|
+
replyCount: {
|
|
5179
|
+
type: 'number',
|
|
5180
|
+
readOnly: true,
|
|
5181
|
+
},
|
|
5182
|
+
openCount: {
|
|
5183
|
+
type: 'number',
|
|
5184
|
+
readOnly: true,
|
|
5185
|
+
},
|
|
5186
|
+
clickCount: {
|
|
5187
|
+
type: 'number',
|
|
5188
|
+
readOnly: true,
|
|
5189
|
+
},
|
|
5031
5190
|
startTime: {
|
|
5032
5191
|
type: 'string',
|
|
5033
5192
|
format: 'date-time',
|
|
@@ -5036,10 +5195,6 @@ const FIELDS_SCHEMA$G = {
|
|
|
5036
5195
|
type: 'string',
|
|
5037
5196
|
format: 'date-time',
|
|
5038
5197
|
},
|
|
5039
|
-
dueTime: {
|
|
5040
|
-
type: 'string',
|
|
5041
|
-
format: 'date-time',
|
|
5042
|
-
},
|
|
5043
5198
|
createdTime: {
|
|
5044
5199
|
type: 'string',
|
|
5045
5200
|
format: 'date-time',
|
|
@@ -5060,477 +5215,167 @@ const FIELDS_SCHEMA$G = {
|
|
|
5060
5215
|
referenceUdm: 'users',
|
|
5061
5216
|
readOnly: true,
|
|
5062
5217
|
},
|
|
5218
|
+
lastActivityTime: {
|
|
5219
|
+
type: 'string',
|
|
5220
|
+
format: 'date-time',
|
|
5221
|
+
readOnly: true,
|
|
5222
|
+
},
|
|
5063
5223
|
},
|
|
5064
5224
|
};
|
|
5065
|
-
const
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5225
|
+
const MODIFIABLE_FIELDS$2 = ['name', 'description', 'ownerId', 'startTime', 'endTime', 'cost', 'source', 'stage', 'type'];
|
|
5226
|
+
const udm$D = {
|
|
5227
|
+
singularName: 'campaign',
|
|
5228
|
+
pluralName: 'campaigns',
|
|
5229
|
+
fieldsSchema: FIELDS_SCHEMA$D,
|
|
5230
|
+
categories: ['Marketing Automation', 'Sales', 'CRM', 'Ads'],
|
|
5231
|
+
list: {
|
|
5232
|
+
filterFields: ['name', 'source', 'stage', 'type', 'ownerId'],
|
|
5073
5233
|
},
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
$var: 'subject',
|
|
5077
|
-
},
|
|
5078
|
-
description: {
|
|
5079
|
-
$var: 'content',
|
|
5080
|
-
},
|
|
5234
|
+
find: {
|
|
5235
|
+
queryFields: ['name', 'source', 'stage', 'type', 'ownerId'],
|
|
5081
5236
|
},
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
$var: 'description',
|
|
5085
|
-
},
|
|
5237
|
+
match: {
|
|
5238
|
+
fields: ['name', 'source', 'stage', 'type', 'ownerId'],
|
|
5086
5239
|
},
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
$var: 'content',
|
|
5090
|
-
},
|
|
5091
|
-
},
|
|
5092
|
-
fromActivitiesToEmails: {
|
|
5093
|
-
subject: {
|
|
5094
|
-
$var: 'title',
|
|
5095
|
-
},
|
|
5096
|
-
body: {
|
|
5097
|
-
$var: 'description',
|
|
5098
|
-
},
|
|
5240
|
+
create: {
|
|
5241
|
+
fields: MODIFIABLE_FIELDS$2,
|
|
5099
5242
|
},
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
$var: 'subject',
|
|
5103
|
-
},
|
|
5104
|
-
description: {
|
|
5105
|
-
$var: 'body',
|
|
5106
|
-
},
|
|
5243
|
+
update: {
|
|
5244
|
+
fields: MODIFIABLE_FIELDS$2,
|
|
5107
5245
|
},
|
|
5108
5246
|
};
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5247
|
+
|
|
5248
|
+
const AddressSchema = {
|
|
5249
|
+
type: 'object',
|
|
5250
|
+
properties: {
|
|
5251
|
+
type: { type: 'string' },
|
|
5252
|
+
full: { type: 'string' },
|
|
5253
|
+
street: { type: 'string' },
|
|
5254
|
+
city: { type: 'string' },
|
|
5255
|
+
state: { type: 'string' },
|
|
5256
|
+
country: { type: 'string' },
|
|
5257
|
+
zip: { type: 'string' },
|
|
5115
5258
|
},
|
|
5116
|
-
|
|
5117
|
-
|
|
5259
|
+
};
|
|
5260
|
+
const PhoneEmailSchema = {
|
|
5261
|
+
type: 'object',
|
|
5262
|
+
properties: {
|
|
5263
|
+
value: { type: 'string' },
|
|
5264
|
+
type: { type: 'string' },
|
|
5118
5265
|
},
|
|
5119
|
-
populateFields,
|
|
5120
|
-
udmFallbacks: [
|
|
5121
|
-
{
|
|
5122
|
-
udm: 'tasks',
|
|
5123
|
-
importFields: FallbackFieldsMap.fromTasksToActivities,
|
|
5124
|
-
exportFields: FallbackFieldsMap.fromActivitiesToTasks,
|
|
5125
|
-
},
|
|
5126
|
-
{
|
|
5127
|
-
udm: 'meetings',
|
|
5128
|
-
},
|
|
5129
|
-
{
|
|
5130
|
-
udm: 'notes',
|
|
5131
|
-
importFields: FallbackFieldsMap.fromNotesToActivities,
|
|
5132
|
-
exportFields: FallbackFieldsMap.fromActivitiesToNotes,
|
|
5133
|
-
},
|
|
5134
|
-
{
|
|
5135
|
-
udm: 'emails',
|
|
5136
|
-
importFields: FallbackFieldsMap.fromEmailsToActivities,
|
|
5137
|
-
exportFields: FallbackFieldsMap.fromActivitiesToEmails,
|
|
5138
|
-
},
|
|
5139
|
-
],
|
|
5140
5266
|
};
|
|
5141
|
-
function populateFields(fields) {
|
|
5142
|
-
const result = JSON.parse(JSON.stringify(fields));
|
|
5143
|
-
if (!result.dueTime) {
|
|
5144
|
-
result.dueTime = result.endTime || result.startTime;
|
|
5145
|
-
}
|
|
5146
|
-
if (!result.startTime) {
|
|
5147
|
-
result.startTime = result.dueTime || result.endTime;
|
|
5148
|
-
}
|
|
5149
|
-
if (!result.endTime) {
|
|
5150
|
-
result.endTime = result.dueTime || result.startTime;
|
|
5151
|
-
}
|
|
5152
|
-
return result;
|
|
5153
|
-
}
|
|
5154
5267
|
|
|
5155
|
-
const FIELDS_SCHEMA$
|
|
5268
|
+
const FIELDS_SCHEMA$C = {
|
|
5156
5269
|
type: 'object',
|
|
5157
5270
|
properties: {
|
|
5158
5271
|
id: { type: 'string', readOnly: true },
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
memo: { type: 'string' },
|
|
5162
|
-
status: { type: 'string' },
|
|
5163
|
-
paymentMethod: { type: 'string' },
|
|
5164
|
-
supplierId: { type: 'string', referenceUdm: 'suppliers' },
|
|
5165
|
-
currency: { type: 'string' },
|
|
5166
|
-
payments: {
|
|
5167
|
-
type: 'array',
|
|
5168
|
-
items: {
|
|
5169
|
-
type: 'string',
|
|
5170
|
-
referenceUdm: 'payments',
|
|
5171
|
-
},
|
|
5272
|
+
name: {
|
|
5273
|
+
type: 'string',
|
|
5172
5274
|
},
|
|
5173
|
-
|
|
5275
|
+
websiteUrl: {
|
|
5276
|
+
type: 'string',
|
|
5277
|
+
},
|
|
5278
|
+
phones: {
|
|
5174
5279
|
type: 'array',
|
|
5175
|
-
items:
|
|
5176
|
-
type: 'object',
|
|
5177
|
-
properties: {
|
|
5178
|
-
id: { type: 'string' },
|
|
5179
|
-
itemName: { type: 'string' },
|
|
5180
|
-
description: { type: 'string' },
|
|
5181
|
-
code: { type: 'string' },
|
|
5182
|
-
type: { type: 'string' },
|
|
5183
|
-
companyId: { type: 'string', referenceUdm: 'companies' },
|
|
5184
|
-
ledgerAccountId: { type: 'string', referenceUdm: 'ledger-accounts' },
|
|
5185
|
-
quantity: { type: 'number' },
|
|
5186
|
-
unitPrice: { type: 'number' },
|
|
5187
|
-
unitOfMeasure: { type: 'string' },
|
|
5188
|
-
purchasePrice: { type: 'number' },
|
|
5189
|
-
salesPrice: { type: 'number' },
|
|
5190
|
-
taxable: { type: 'boolean' },
|
|
5191
|
-
taxAmount: { type: 'number' },
|
|
5192
|
-
totalAmount: { type: 'number' },
|
|
5193
|
-
},
|
|
5194
|
-
},
|
|
5280
|
+
items: PhoneEmailSchema,
|
|
5195
5281
|
},
|
|
5196
|
-
|
|
5197
|
-
totalTax: { type: 'number' },
|
|
5198
|
-
exchangeRate: { type: 'number' },
|
|
5199
|
-
totalDiscount: { type: 'number' },
|
|
5200
|
-
subTotal: { type: 'number' },
|
|
5201
|
-
balance: { type: 'number' },
|
|
5202
|
-
ledgerAccountId: { type: 'string', referenceUdm: 'ledger-accounts' },
|
|
5203
|
-
issueDate: {
|
|
5282
|
+
primaryPhone: {
|
|
5204
5283
|
type: 'string',
|
|
5205
|
-
format: 'date-time',
|
|
5206
5284
|
},
|
|
5207
|
-
|
|
5285
|
+
description: {
|
|
5208
5286
|
type: 'string',
|
|
5209
|
-
format: 'date-time',
|
|
5210
5287
|
},
|
|
5211
|
-
|
|
5288
|
+
currency: {
|
|
5212
5289
|
type: 'string',
|
|
5213
|
-
format: 'date-time',
|
|
5214
5290
|
},
|
|
5215
|
-
|
|
5216
|
-
createdBy: { type: 'string', referenceUdm: 'users', readOnly: true },
|
|
5217
|
-
updatedTime: { type: 'string', format: 'date-time', readOnly: true },
|
|
5218
|
-
updatedBy: { type: 'string', referenceUdm: 'users', readOnly: true },
|
|
5219
|
-
},
|
|
5220
|
-
};
|
|
5221
|
-
const udm$F = {
|
|
5222
|
-
singularName: 'bill',
|
|
5223
|
-
pluralName: 'bills',
|
|
5224
|
-
fieldsSchema: FIELDS_SCHEMA$F,
|
|
5225
|
-
list: {
|
|
5226
|
-
filterFields: ['name', 'number', 'status', 'supplierId'],
|
|
5227
|
-
},
|
|
5228
|
-
match: {
|
|
5229
|
-
fields: ['name', 'number', 'status', 'supplierId'],
|
|
5230
|
-
},
|
|
5231
|
-
};
|
|
5232
|
-
|
|
5233
|
-
const FIELDS_SCHEMA$E = {
|
|
5234
|
-
type: 'object',
|
|
5235
|
-
properties: {
|
|
5236
|
-
id: { type: 'string', readOnly: true },
|
|
5237
|
-
fullName: { type: 'string' },
|
|
5238
|
-
firstName: { type: 'string' },
|
|
5239
|
-
lastName: { type: 'string' },
|
|
5240
|
-
primaryEmail: { type: 'string' },
|
|
5241
|
-
campaignId: {
|
|
5291
|
+
industry: {
|
|
5242
5292
|
type: 'string',
|
|
5243
|
-
referenceUdm: 'campaigns',
|
|
5244
5293
|
},
|
|
5245
|
-
|
|
5294
|
+
ownerId: {
|
|
5246
5295
|
type: 'string',
|
|
5247
|
-
referenceUdm: '
|
|
5296
|
+
referenceUdm: 'users',
|
|
5248
5297
|
},
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5298
|
+
primaryAddress: AddressSchema,
|
|
5299
|
+
addresses: {
|
|
5300
|
+
type: 'array',
|
|
5301
|
+
items: AddressSchema,
|
|
5252
5302
|
},
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
companyId: {
|
|
5256
|
-
type: 'string',
|
|
5257
|
-
referenceUdm: 'companies',
|
|
5303
|
+
numberOfEmployees: {
|
|
5304
|
+
type: 'number',
|
|
5258
5305
|
},
|
|
5259
|
-
jobTitle: { type: 'string' },
|
|
5260
|
-
hasOptedOutOfEmail: { type: 'boolean' },
|
|
5261
5306
|
createdTime: {
|
|
5262
5307
|
type: 'string',
|
|
5263
5308
|
format: 'date-time',
|
|
5264
5309
|
},
|
|
5265
5310
|
createdBy: {
|
|
5266
5311
|
type: 'string',
|
|
5267
|
-
readOnly: true,
|
|
5268
5312
|
referenceUdm: 'users',
|
|
5313
|
+
readOnly: true,
|
|
5269
5314
|
},
|
|
5270
5315
|
updatedTime: {
|
|
5271
5316
|
type: 'string',
|
|
5272
|
-
readOnly: true,
|
|
5273
5317
|
format: 'date-time',
|
|
5318
|
+
readOnly: true,
|
|
5274
5319
|
},
|
|
5275
5320
|
updatedBy: {
|
|
5276
5321
|
type: 'string',
|
|
5277
|
-
readOnly: true,
|
|
5278
5322
|
referenceUdm: 'users',
|
|
5323
|
+
readOnly: true,
|
|
5324
|
+
},
|
|
5325
|
+
lastActivityTime: {
|
|
5326
|
+
type: 'string',
|
|
5327
|
+
format: 'date-time',
|
|
5328
|
+
readOnly: true,
|
|
5279
5329
|
},
|
|
5280
5330
|
},
|
|
5281
5331
|
};
|
|
5282
|
-
const udm$
|
|
5283
|
-
singularName: '
|
|
5284
|
-
pluralName: '
|
|
5285
|
-
fieldsSchema: FIELDS_SCHEMA$
|
|
5332
|
+
const udm$C = {
|
|
5333
|
+
singularName: 'company',
|
|
5334
|
+
pluralName: 'companies',
|
|
5335
|
+
fieldsSchema: FIELDS_SCHEMA$C,
|
|
5286
5336
|
list: {
|
|
5287
|
-
filterFields: [
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
'lastName',
|
|
5292
|
-
'campaignId',
|
|
5293
|
-
'contactId',
|
|
5294
|
-
'leadId',
|
|
5295
|
-
'companyId',
|
|
5296
|
-
],
|
|
5337
|
+
filterFields: ['ownerId', 'name', 'websiteUrl', 'industry'],
|
|
5338
|
+
},
|
|
5339
|
+
find: {
|
|
5340
|
+
queryFields: ['ownerId', 'name', 'websiteUrl', 'industry'],
|
|
5297
5341
|
},
|
|
5298
5342
|
match: {
|
|
5299
|
-
fields: ['
|
|
5343
|
+
fields: ['ownerId', 'name', 'websiteUrl', 'industry'],
|
|
5344
|
+
},
|
|
5345
|
+
fieldFallbacks: {
|
|
5346
|
+
'primaryAddress.full': [
|
|
5347
|
+
{
|
|
5348
|
+
$concat: {
|
|
5349
|
+
values: [
|
|
5350
|
+
{ $var: 'primaryAddress.street' },
|
|
5351
|
+
{ $var: 'primaryAddress.city' },
|
|
5352
|
+
{ $var: 'primaryAddress.state' },
|
|
5353
|
+
{ $var: 'primaryAddress.zip' },
|
|
5354
|
+
{ $var: 'primaryAddress.country' },
|
|
5355
|
+
],
|
|
5356
|
+
delimiter: ', ',
|
|
5357
|
+
},
|
|
5358
|
+
},
|
|
5359
|
+
],
|
|
5300
5360
|
},
|
|
5301
5361
|
};
|
|
5302
5362
|
|
|
5303
|
-
const FIELDS_SCHEMA$
|
|
5363
|
+
const FIELDS_SCHEMA$B = {
|
|
5304
5364
|
type: 'object',
|
|
5305
5365
|
properties: {
|
|
5306
5366
|
id: { type: 'string', readOnly: true },
|
|
5307
|
-
name: {
|
|
5367
|
+
name: { type: 'string' },
|
|
5368
|
+
description: { type: 'string' },
|
|
5369
|
+
source: { type: 'string' },
|
|
5370
|
+
type: { type: 'string' },
|
|
5371
|
+
ownerId: {
|
|
5308
5372
|
type: 'string',
|
|
5373
|
+
referenceUdm: 'users',
|
|
5309
5374
|
},
|
|
5310
|
-
|
|
5311
|
-
type: 'number',
|
|
5312
|
-
},
|
|
5313
|
-
description: {
|
|
5375
|
+
createdTime: {
|
|
5314
5376
|
type: 'string',
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
type: 'string',
|
|
5318
|
-
},
|
|
5319
|
-
stage: {
|
|
5320
|
-
type: 'string',
|
|
5321
|
-
},
|
|
5322
|
-
type: {
|
|
5323
|
-
type: 'string',
|
|
5324
|
-
},
|
|
5325
|
-
ownerId: {
|
|
5326
|
-
type: 'string',
|
|
5327
|
-
referenceUdm: 'users',
|
|
5328
|
-
},
|
|
5329
|
-
sentCount: {
|
|
5330
|
-
type: 'number',
|
|
5331
|
-
readOnly: true,
|
|
5332
|
-
},
|
|
5333
|
-
replyCount: {
|
|
5334
|
-
type: 'number',
|
|
5335
|
-
readOnly: true,
|
|
5336
|
-
},
|
|
5337
|
-
openCount: {
|
|
5338
|
-
type: 'number',
|
|
5339
|
-
readOnly: true,
|
|
5340
|
-
},
|
|
5341
|
-
clickCount: {
|
|
5342
|
-
type: 'number',
|
|
5343
|
-
readOnly: true,
|
|
5344
|
-
},
|
|
5345
|
-
startTime: {
|
|
5346
|
-
type: 'string',
|
|
5347
|
-
format: 'date-time',
|
|
5348
|
-
},
|
|
5349
|
-
endTime: {
|
|
5350
|
-
type: 'string',
|
|
5351
|
-
format: 'date-time',
|
|
5352
|
-
},
|
|
5353
|
-
createdTime: {
|
|
5354
|
-
type: 'string',
|
|
5355
|
-
format: 'date-time',
|
|
5356
|
-
readOnly: true,
|
|
5357
|
-
},
|
|
5358
|
-
createdBy: {
|
|
5359
|
-
type: 'string',
|
|
5360
|
-
referenceUdm: 'users',
|
|
5361
|
-
readOnly: true,
|
|
5362
|
-
},
|
|
5363
|
-
updatedTime: {
|
|
5364
|
-
type: 'string',
|
|
5365
|
-
format: 'date-time',
|
|
5366
|
-
readOnly: true,
|
|
5367
|
-
},
|
|
5368
|
-
updatedBy: {
|
|
5369
|
-
type: 'string',
|
|
5370
|
-
referenceUdm: 'users',
|
|
5371
|
-
readOnly: true,
|
|
5372
|
-
},
|
|
5373
|
-
lastActivityTime: {
|
|
5374
|
-
type: 'string',
|
|
5375
|
-
format: 'date-time',
|
|
5376
|
-
readOnly: true,
|
|
5377
|
-
},
|
|
5378
|
-
},
|
|
5379
|
-
};
|
|
5380
|
-
const MODIFIABLE_FIELDS$2 = ['name', 'description', 'ownerId', 'startTime', 'endTime', 'cost', 'source', 'stage', 'type'];
|
|
5381
|
-
const udm$D = {
|
|
5382
|
-
singularName: 'campaign',
|
|
5383
|
-
pluralName: 'campaigns',
|
|
5384
|
-
fieldsSchema: FIELDS_SCHEMA$D,
|
|
5385
|
-
categories: ['Marketing Automation', 'Sales', 'CRM', 'Ads'],
|
|
5386
|
-
list: {
|
|
5387
|
-
filterFields: ['name', 'source', 'stage', 'type', 'ownerId'],
|
|
5388
|
-
},
|
|
5389
|
-
find: {
|
|
5390
|
-
queryFields: ['name', 'source', 'stage', 'type', 'ownerId'],
|
|
5391
|
-
},
|
|
5392
|
-
match: {
|
|
5393
|
-
fields: ['name', 'source', 'stage', 'type', 'ownerId'],
|
|
5394
|
-
},
|
|
5395
|
-
create: {
|
|
5396
|
-
fields: MODIFIABLE_FIELDS$2,
|
|
5397
|
-
},
|
|
5398
|
-
update: {
|
|
5399
|
-
fields: MODIFIABLE_FIELDS$2,
|
|
5400
|
-
},
|
|
5401
|
-
};
|
|
5402
|
-
|
|
5403
|
-
const AddressSchema = {
|
|
5404
|
-
type: 'object',
|
|
5405
|
-
properties: {
|
|
5406
|
-
type: { type: 'string' },
|
|
5407
|
-
full: { type: 'string' },
|
|
5408
|
-
street: { type: 'string' },
|
|
5409
|
-
city: { type: 'string' },
|
|
5410
|
-
state: { type: 'string' },
|
|
5411
|
-
country: { type: 'string' },
|
|
5412
|
-
zip: { type: 'string' },
|
|
5413
|
-
},
|
|
5414
|
-
};
|
|
5415
|
-
const PhoneEmailSchema = {
|
|
5416
|
-
type: 'object',
|
|
5417
|
-
properties: {
|
|
5418
|
-
value: { type: 'string' },
|
|
5419
|
-
type: { type: 'string' },
|
|
5420
|
-
},
|
|
5421
|
-
};
|
|
5422
|
-
|
|
5423
|
-
const FIELDS_SCHEMA$C = {
|
|
5424
|
-
type: 'object',
|
|
5425
|
-
properties: {
|
|
5426
|
-
id: { type: 'string', readOnly: true },
|
|
5427
|
-
name: {
|
|
5428
|
-
type: 'string',
|
|
5429
|
-
},
|
|
5430
|
-
websiteUrl: {
|
|
5431
|
-
type: 'string',
|
|
5432
|
-
},
|
|
5433
|
-
phones: {
|
|
5434
|
-
type: 'array',
|
|
5435
|
-
items: PhoneEmailSchema,
|
|
5436
|
-
},
|
|
5437
|
-
primaryPhone: {
|
|
5438
|
-
type: 'string',
|
|
5439
|
-
},
|
|
5440
|
-
description: {
|
|
5441
|
-
type: 'string',
|
|
5442
|
-
},
|
|
5443
|
-
currency: {
|
|
5444
|
-
type: 'string',
|
|
5445
|
-
},
|
|
5446
|
-
industry: {
|
|
5447
|
-
type: 'string',
|
|
5448
|
-
},
|
|
5449
|
-
ownerId: {
|
|
5450
|
-
type: 'string',
|
|
5451
|
-
referenceUdm: 'users',
|
|
5452
|
-
},
|
|
5453
|
-
primaryAddress: AddressSchema,
|
|
5454
|
-
addresses: {
|
|
5455
|
-
type: 'array',
|
|
5456
|
-
items: AddressSchema,
|
|
5457
|
-
},
|
|
5458
|
-
numberOfEmployees: {
|
|
5459
|
-
type: 'number',
|
|
5460
|
-
},
|
|
5461
|
-
createdTime: {
|
|
5462
|
-
type: 'string',
|
|
5463
|
-
format: 'date-time',
|
|
5464
|
-
},
|
|
5465
|
-
createdBy: {
|
|
5466
|
-
type: 'string',
|
|
5467
|
-
referenceUdm: 'users',
|
|
5468
|
-
readOnly: true,
|
|
5469
|
-
},
|
|
5470
|
-
updatedTime: {
|
|
5471
|
-
type: 'string',
|
|
5472
|
-
format: 'date-time',
|
|
5473
|
-
readOnly: true,
|
|
5474
|
-
},
|
|
5475
|
-
updatedBy: {
|
|
5476
|
-
type: 'string',
|
|
5477
|
-
referenceUdm: 'users',
|
|
5478
|
-
readOnly: true,
|
|
5479
|
-
},
|
|
5480
|
-
lastActivityTime: {
|
|
5481
|
-
type: 'string',
|
|
5482
|
-
format: 'date-time',
|
|
5483
|
-
readOnly: true,
|
|
5484
|
-
},
|
|
5485
|
-
},
|
|
5486
|
-
};
|
|
5487
|
-
const udm$C = {
|
|
5488
|
-
singularName: 'company',
|
|
5489
|
-
pluralName: 'companies',
|
|
5490
|
-
fieldsSchema: FIELDS_SCHEMA$C,
|
|
5491
|
-
list: {
|
|
5492
|
-
filterFields: ['ownerId', 'name', 'websiteUrl', 'industry'],
|
|
5493
|
-
},
|
|
5494
|
-
find: {
|
|
5495
|
-
queryFields: ['ownerId', 'name', 'websiteUrl', 'industry'],
|
|
5496
|
-
},
|
|
5497
|
-
match: {
|
|
5498
|
-
fields: ['ownerId', 'name', 'websiteUrl', 'industry'],
|
|
5499
|
-
},
|
|
5500
|
-
fieldFallbacks: {
|
|
5501
|
-
'primaryAddress.full': [
|
|
5502
|
-
{
|
|
5503
|
-
$concat: {
|
|
5504
|
-
values: [
|
|
5505
|
-
{ $var: 'primaryAddress.street' },
|
|
5506
|
-
{ $var: 'primaryAddress.city' },
|
|
5507
|
-
{ $var: 'primaryAddress.state' },
|
|
5508
|
-
{ $var: 'primaryAddress.zip' },
|
|
5509
|
-
{ $var: 'primaryAddress.country' },
|
|
5510
|
-
],
|
|
5511
|
-
delimiter: ', ',
|
|
5512
|
-
},
|
|
5513
|
-
},
|
|
5514
|
-
],
|
|
5515
|
-
},
|
|
5516
|
-
};
|
|
5517
|
-
|
|
5518
|
-
const FIELDS_SCHEMA$B = {
|
|
5519
|
-
type: 'object',
|
|
5520
|
-
properties: {
|
|
5521
|
-
id: { type: 'string', readOnly: true },
|
|
5522
|
-
name: { type: 'string' },
|
|
5523
|
-
description: { type: 'string' },
|
|
5524
|
-
source: { type: 'string' },
|
|
5525
|
-
type: { type: 'string' },
|
|
5526
|
-
ownerId: {
|
|
5527
|
-
type: 'string',
|
|
5528
|
-
referenceUdm: 'users',
|
|
5529
|
-
},
|
|
5530
|
-
createdTime: {
|
|
5531
|
-
type: 'string',
|
|
5532
|
-
format: 'date-time',
|
|
5533
|
-
readOnly: true,
|
|
5377
|
+
format: 'date-time',
|
|
5378
|
+
readOnly: true,
|
|
5534
5379
|
},
|
|
5535
5380
|
createdBy: {
|
|
5536
5381
|
type: 'string',
|
|
@@ -7948,173 +7793,6 @@ const udm = {
|
|
|
7948
7793
|
},
|
|
7949
7794
|
};
|
|
7950
7795
|
|
|
7951
|
-
const structuredClone$1 = (structuredClonePolyfill === null || structuredClonePolyfill === void 0 ? void 0 : structuredClonePolyfill.default) || structuredClonePolyfill;
|
|
7952
|
-
function isNil(value) {
|
|
7953
|
-
return value == null;
|
|
7954
|
-
}
|
|
7955
|
-
function omitBy(obj, check) {
|
|
7956
|
-
obj = { ...obj };
|
|
7957
|
-
Object.entries(obj).forEach(([key, value]) => check(value) && delete obj[key]);
|
|
7958
|
-
return obj;
|
|
7959
|
-
}
|
|
7960
|
-
function isEmptyValue(value) {
|
|
7961
|
-
if (isNil(value)) {
|
|
7962
|
-
return true;
|
|
7963
|
-
}
|
|
7964
|
-
if (typeof value === 'symbol') {
|
|
7965
|
-
return true;
|
|
7966
|
-
}
|
|
7967
|
-
if (typeof value === 'boolean') {
|
|
7968
|
-
return false;
|
|
7969
|
-
}
|
|
7970
|
-
if (typeof value === 'number') {
|
|
7971
|
-
return isNaN(value);
|
|
7972
|
-
}
|
|
7973
|
-
if (typeof value === 'string') {
|
|
7974
|
-
return value.trim().length === 0;
|
|
7975
|
-
}
|
|
7976
|
-
const tag = value.toString();
|
|
7977
|
-
if (tag === '[object Map]' || tag === '[object Set]') {
|
|
7978
|
-
return !value.size;
|
|
7979
|
-
}
|
|
7980
|
-
return typeof value === 'object' && Object.keys(value).length === 0;
|
|
7981
|
-
}
|
|
7982
|
-
const simpleUniqueId = () => {
|
|
7983
|
-
return Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)
|
|
7984
|
-
.toString(36)
|
|
7985
|
-
.padStart(11, '0')
|
|
7986
|
-
.substring(0, 11);
|
|
7987
|
-
};
|
|
7988
|
-
|
|
7989
|
-
function getDataLocationMethodPath(locationKey, methodKey) {
|
|
7990
|
-
return `data/${locationKey}/${toKebabCase(methodKey)}`;
|
|
7991
|
-
}
|
|
7992
|
-
function dataLocationParametersMatch({ locationParameters, targetParameters, }) {
|
|
7993
|
-
targetParameters = typeof targetParameters === 'object' && targetParameters ? targetParameters : {};
|
|
7994
|
-
locationParameters = typeof locationParameters === 'object' && locationParameters ? locationParameters : {};
|
|
7995
|
-
for (const [key, value] of Object.entries(targetParameters)) {
|
|
7996
|
-
if (locationParameters[key] !== value) {
|
|
7997
|
-
return false;
|
|
7998
|
-
}
|
|
7999
|
-
}
|
|
8000
|
-
return true;
|
|
8001
|
-
}
|
|
8002
|
-
function parseDataLocationPath(path) {
|
|
8003
|
-
if (!path) {
|
|
8004
|
-
return undefined;
|
|
8005
|
-
}
|
|
8006
|
-
if (path.startsWith('/')) {
|
|
8007
|
-
path = path.slice(1);
|
|
8008
|
-
}
|
|
8009
|
-
if (!path.startsWith('data/')) {
|
|
8010
|
-
throw new Error(`Invalid data location path: ${path}. It should start with "data/"`);
|
|
8011
|
-
}
|
|
8012
|
-
path = path.slice(5);
|
|
8013
|
-
const [key, query] = path.split('?');
|
|
8014
|
-
const parameters = Object.fromEntries(new URLSearchParams(query).entries());
|
|
8015
|
-
return { key, parameters };
|
|
8016
|
-
}
|
|
8017
|
-
function makeDataLocationPath(pointer) {
|
|
8018
|
-
var _a;
|
|
8019
|
-
const normalizedPointer = normalizePointer(pointer);
|
|
8020
|
-
if (normalizedPointer === null || normalizedPointer === void 0 ? void 0 : normalizedPointer.key) {
|
|
8021
|
-
let path = `/data/${normalizedPointer.key}`;
|
|
8022
|
-
const parameters = omitBy((_a = normalizedPointer.parameters) !== null && _a !== void 0 ? _a : {}, isNil);
|
|
8023
|
-
if (Object.keys(parameters).length > 0) {
|
|
8024
|
-
path += `?${new URLSearchParams(parameters).toString()}`;
|
|
8025
|
-
}
|
|
8026
|
-
return path;
|
|
8027
|
-
}
|
|
8028
|
-
else {
|
|
8029
|
-
return undefined;
|
|
8030
|
-
}
|
|
8031
|
-
}
|
|
8032
|
-
function normalizePointer(pointer) {
|
|
8033
|
-
if (typeof pointer === 'string' && pointer.startsWith('/data/')) {
|
|
8034
|
-
return {
|
|
8035
|
-
key: pointer.slice(6),
|
|
8036
|
-
};
|
|
8037
|
-
}
|
|
8038
|
-
return pointer;
|
|
8039
|
-
}
|
|
8040
|
-
function makeDataLocationOperationPath(collectionPath, operation) {
|
|
8041
|
-
const [path, query] = (collectionPath !== null && collectionPath !== void 0 ? collectionPath : '').split('?');
|
|
8042
|
-
return urljoin(path, operation, query ? `?${query}` : '');
|
|
8043
|
-
}
|
|
8044
|
-
function isSameDataLocation(location1, location2) {
|
|
8045
|
-
if (location1.key !== location2.key) {
|
|
8046
|
-
return false;
|
|
8047
|
-
}
|
|
8048
|
-
const cleanParameters1 = location1.parameters && Object.keys(location1.parameters).length > 0 ? location1.parameters : undefined;
|
|
8049
|
-
const cleanParameters2 = location2.parameters && Object.keys(location2.parameters).length > 0 ? location2.parameters : undefined;
|
|
8050
|
-
if (!deepEqual(cleanParameters1, cleanParameters2)) {
|
|
8051
|
-
return false;
|
|
8052
|
-
}
|
|
8053
|
-
return true;
|
|
8054
|
-
}
|
|
8055
|
-
function isDataLocationMethodSupported(location, methodKey) {
|
|
8056
|
-
var _a;
|
|
8057
|
-
const method = (_a = location === null || location === void 0 ? void 0 : location.methods) === null || _a === void 0 ? void 0 : _a[methodKey];
|
|
8058
|
-
return method && method.implementationType !== ConnectorMethodImplementationType.notSupported;
|
|
8059
|
-
}
|
|
8060
|
-
function getDataCollectionCreateFields(spec) {
|
|
8061
|
-
if (!spec)
|
|
8062
|
-
return undefined;
|
|
8063
|
-
if (!spec.fieldsSchema)
|
|
8064
|
-
return undefined;
|
|
8065
|
-
if (!spec.create)
|
|
8066
|
-
return undefined;
|
|
8067
|
-
let schema = excludeReadOnlyFieldsFromSchema(spec.fieldsSchema);
|
|
8068
|
-
if (spec.create.fields) {
|
|
8069
|
-
schema = pickFieldsFromSchema(schema, spec.create.fields);
|
|
8070
|
-
}
|
|
8071
|
-
if (spec.create.excludedFields) {
|
|
8072
|
-
schema = excludeFieldsFromSchema(schema, spec.create.excludedFields);
|
|
8073
|
-
}
|
|
8074
|
-
return schema;
|
|
8075
|
-
}
|
|
8076
|
-
function getDataCollectionUpdateFields(spec) {
|
|
8077
|
-
if (!spec)
|
|
8078
|
-
return undefined;
|
|
8079
|
-
if (!spec.fieldsSchema)
|
|
8080
|
-
return undefined;
|
|
8081
|
-
if (!spec.update)
|
|
8082
|
-
return undefined;
|
|
8083
|
-
let schema = excludeReadOnlyFieldsFromSchema(spec.fieldsSchema);
|
|
8084
|
-
if (spec.update.fields) {
|
|
8085
|
-
schema = pickFieldsFromSchema(schema, spec.update.fields);
|
|
8086
|
-
}
|
|
8087
|
-
if (spec.update.excludedFields) {
|
|
8088
|
-
schema = excludeFieldsFromSchema(schema, spec.update.excludedFields);
|
|
8089
|
-
}
|
|
8090
|
-
return schema;
|
|
8091
|
-
}
|
|
8092
|
-
function getWritableFieldsSchema(spec) {
|
|
8093
|
-
if (!spec)
|
|
8094
|
-
return undefined;
|
|
8095
|
-
if (!spec.fieldsSchema)
|
|
8096
|
-
return undefined;
|
|
8097
|
-
return mergeSchemas([getDataCollectionCreateFields(spec), getDataCollectionUpdateFields(spec)]);
|
|
8098
|
-
}
|
|
8099
|
-
function getReferenceCollectionPointerForSchema(schema) {
|
|
8100
|
-
if ((schema === null || schema === void 0 ? void 0 : schema.referenceCollection) && schema.referenceCollection.key) {
|
|
8101
|
-
return schema.referenceCollection;
|
|
8102
|
-
}
|
|
8103
|
-
else if (schema === null || schema === void 0 ? void 0 : schema.referenceCollectionPath) {
|
|
8104
|
-
return parseDataLocationPath(schema.referenceCollectionPath);
|
|
8105
|
-
}
|
|
8106
|
-
else if (schema === null || schema === void 0 ? void 0 : schema.referenceCollectionUri) {
|
|
8107
|
-
return parseDataLocationPath(schema.referenceCollectionUri);
|
|
8108
|
-
}
|
|
8109
|
-
else {
|
|
8110
|
-
return undefined;
|
|
8111
|
-
}
|
|
8112
|
-
}
|
|
8113
|
-
function getReferenceCollectionPathForSchema(schema) {
|
|
8114
|
-
const pointer = getReferenceCollectionPointerForSchema(schema);
|
|
8115
|
-
return makeDataLocationPath(pointer);
|
|
8116
|
-
}
|
|
8117
|
-
|
|
8118
7796
|
var UDM;
|
|
8119
7797
|
(function (UDM) {
|
|
8120
7798
|
UDM["ACTIVITIES"] = "activities";
|
|
@@ -8249,113 +7927,435 @@ function findUdmDefaultCollection(spec, udm, useFallback = true) {
|
|
|
8249
7927
|
}
|
|
8250
7928
|
if ((_h = (_g = (_f = (_e = spec.udm) === null || _e === void 0 ? void 0 : _e[udm]) === null || _f === void 0 ? void 0 : _f.collectionMappings) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.key) {
|
|
8251
7929
|
return {
|
|
8252
|
-
key: spec.udm[udm].collectionMappings[0].key,
|
|
7930
|
+
key: spec.udm[udm].collectionMappings[0].key,
|
|
7931
|
+
};
|
|
7932
|
+
}
|
|
7933
|
+
const udmSpec = UNIFIED_DATA_MODELS[udm];
|
|
7934
|
+
if (!udmSpec) {
|
|
7935
|
+
throw new BadRequestError(`Unknown UDM: ${udm}`);
|
|
7936
|
+
}
|
|
7937
|
+
if (useFallback) {
|
|
7938
|
+
for (const fallback of (_j = udmSpec.udmFallbacks) !== null && _j !== void 0 ? _j : []) {
|
|
7939
|
+
const pointer = findUdmDefaultCollection(spec, fallback.udm, false);
|
|
7940
|
+
if (pointer) {
|
|
7941
|
+
return pointer;
|
|
7942
|
+
}
|
|
7943
|
+
}
|
|
7944
|
+
}
|
|
7945
|
+
return undefined;
|
|
7946
|
+
}
|
|
7947
|
+
function addUdmFallbackFields(fields, udm) {
|
|
7948
|
+
if (!udm) {
|
|
7949
|
+
return fields;
|
|
7950
|
+
}
|
|
7951
|
+
const udmSpec = UNIFIED_DATA_MODELS[udm];
|
|
7952
|
+
if (!udmSpec) {
|
|
7953
|
+
throw new BadRequestError(`Unknown UDM: ${udm}`);
|
|
7954
|
+
}
|
|
7955
|
+
if (!udmSpec.fieldFallbacks) {
|
|
7956
|
+
return fields;
|
|
7957
|
+
}
|
|
7958
|
+
let result = structuredClone$1(fields);
|
|
7959
|
+
for (const fieldKeyWithFallbacks of Object.keys(udmSpec.fieldFallbacks)) {
|
|
7960
|
+
const currentValue = getValueAtLocator(fields, fieldKeyWithFallbacks);
|
|
7961
|
+
if (currentValue !== undefined)
|
|
7962
|
+
continue;
|
|
7963
|
+
for (const fallbackValue of udmSpec.fieldFallbacks[fieldKeyWithFallbacks]) {
|
|
7964
|
+
const varFormulaLocators = getVariableLocators(fallbackValue);
|
|
7965
|
+
const varLocators = [];
|
|
7966
|
+
for (const varFormulaLocator of varFormulaLocators) {
|
|
7967
|
+
const formula = getFormula$1(getValueAtLocator(fallbackValue, varFormulaLocator));
|
|
7968
|
+
varLocators.push(formula.locator);
|
|
7969
|
+
}
|
|
7970
|
+
const fallbackValueHasDependencies = varLocators.some((locator) => getValueAtLocator(fields, locator) !== undefined);
|
|
7971
|
+
if (fallbackValueHasDependencies) {
|
|
7972
|
+
result = setValueAtLocator(result, fieldKeyWithFallbacks, transformVars(fallbackValue, fields));
|
|
7973
|
+
break;
|
|
7974
|
+
}
|
|
7975
|
+
}
|
|
7976
|
+
}
|
|
7977
|
+
return result;
|
|
7978
|
+
}
|
|
7979
|
+
|
|
7980
|
+
const DATA_RECORD_SCHEMA = {
|
|
7981
|
+
type: 'object',
|
|
7982
|
+
properties: {
|
|
7983
|
+
id: {
|
|
7984
|
+
type: 'string',
|
|
7985
|
+
},
|
|
7986
|
+
name: {
|
|
7987
|
+
type: 'string',
|
|
7988
|
+
},
|
|
7989
|
+
uri: {
|
|
7990
|
+
type: 'string',
|
|
7991
|
+
format: 'url',
|
|
7992
|
+
},
|
|
7993
|
+
createdTime: {
|
|
7994
|
+
type: 'string',
|
|
7995
|
+
format: 'datetime',
|
|
7996
|
+
},
|
|
7997
|
+
updatedTime: {
|
|
7998
|
+
type: 'string',
|
|
7999
|
+
format: 'datetime',
|
|
8000
|
+
},
|
|
8001
|
+
deletedTime: {
|
|
8002
|
+
type: 'string',
|
|
8003
|
+
format: 'datetime',
|
|
8004
|
+
},
|
|
8005
|
+
createdById: {
|
|
8006
|
+
type: 'string',
|
|
8007
|
+
},
|
|
8008
|
+
updatedById: {
|
|
8009
|
+
type: 'string',
|
|
8010
|
+
},
|
|
8011
|
+
},
|
|
8012
|
+
};
|
|
8013
|
+
function makeDataRecordSchema({ fieldsSchema, udm, rawFieldsSchema, }) {
|
|
8014
|
+
var _a, _b, _c;
|
|
8015
|
+
const schema = structuredClone$1(DATA_RECORD_SCHEMA);
|
|
8016
|
+
schema.properties = {
|
|
8017
|
+
...((_a = schema.properties) !== null && _a !== void 0 ? _a : {}),
|
|
8018
|
+
fields: fieldsSchema !== null && fieldsSchema !== void 0 ? fieldsSchema : { type: 'object' },
|
|
8019
|
+
};
|
|
8020
|
+
if (udm) {
|
|
8021
|
+
const unifiedModel = UNIFIED_DATA_MODELS[udm];
|
|
8022
|
+
if (unifiedModel === null || unifiedModel === void 0 ? void 0 : unifiedModel.fieldsSchema) {
|
|
8023
|
+
schema.properties = {
|
|
8024
|
+
...((_b = schema.properties) !== null && _b !== void 0 ? _b : {}),
|
|
8025
|
+
unifiedFields: unifiedModel.fieldsSchema,
|
|
8026
|
+
};
|
|
8027
|
+
}
|
|
8028
|
+
}
|
|
8029
|
+
if (rawFieldsSchema) {
|
|
8030
|
+
schema.properties = {
|
|
8031
|
+
...((_c = schema.properties) !== null && _c !== void 0 ? _c : {}),
|
|
8032
|
+
rawFields: rawFieldsSchema,
|
|
8033
|
+
};
|
|
8034
|
+
}
|
|
8035
|
+
return schema;
|
|
8036
|
+
}
|
|
8037
|
+
|
|
8038
|
+
const DataLocationMethodImplementationTypes = [
|
|
8039
|
+
ConnectorMethodImplementationType.operationMapping,
|
|
8040
|
+
ConnectorMethodImplementationType.restApiMapping,
|
|
8041
|
+
ConnectorMethodImplementationType.graphqlApiMapping,
|
|
8042
|
+
ConnectorMethodImplementationType.javascript,
|
|
8043
|
+
ConnectorMethodImplementationType.notSupported,
|
|
8044
|
+
];
|
|
8045
|
+
|
|
8046
|
+
const DataCollectionMethodCreate = {
|
|
8047
|
+
name: 'Create',
|
|
8048
|
+
description: 'Create a new data record in the collection',
|
|
8049
|
+
getConfigSchema: ({ collectionSpec }) => {
|
|
8050
|
+
var _a, _b;
|
|
8051
|
+
const fields = Object.keys((_b = (_a = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema) === null || _a === void 0 ? void 0 : _a.properties) !== null && _b !== void 0 ? _b : {}).map(locatorToField);
|
|
8052
|
+
return {
|
|
8053
|
+
type: 'object',
|
|
8054
|
+
properties: {
|
|
8055
|
+
fields: {
|
|
8056
|
+
type: 'array',
|
|
8057
|
+
items: { type: 'string', enum: fields },
|
|
8058
|
+
},
|
|
8059
|
+
excludedFields: {
|
|
8060
|
+
type: 'array',
|
|
8061
|
+
items: { type: 'string', enum: fields },
|
|
8062
|
+
},
|
|
8063
|
+
},
|
|
8064
|
+
};
|
|
8065
|
+
},
|
|
8066
|
+
getInputSchema: ({ collectionSpec, method, credentialsSchema }) => {
|
|
8067
|
+
var _a;
|
|
8068
|
+
let fieldsSchema = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema;
|
|
8069
|
+
if (method === null || method === void 0 ? void 0 : method.fields) {
|
|
8070
|
+
fieldsSchema = pickFieldsFromSchema(fieldsSchema, method.fields);
|
|
8071
|
+
}
|
|
8072
|
+
if (method === null || method === void 0 ? void 0 : method.excludedFields) {
|
|
8073
|
+
fieldsSchema = excludeFieldsFromSchema(fieldsSchema, method.excludedFields);
|
|
8074
|
+
}
|
|
8075
|
+
return {
|
|
8076
|
+
type: 'object',
|
|
8077
|
+
properties: nonEmptyObjectProperties({
|
|
8078
|
+
fields: (_a = transformVariablesWith(fieldsSchema, (locator) => `fields.${locatorToField(locator)}`)) !== null && _a !== void 0 ? _a : {
|
|
8079
|
+
type: 'object',
|
|
8080
|
+
},
|
|
8081
|
+
credentials: credentialsSchema,
|
|
8082
|
+
}),
|
|
8083
|
+
};
|
|
8084
|
+
},
|
|
8085
|
+
getOutputSchema: ({}) => ({
|
|
8086
|
+
type: 'object',
|
|
8087
|
+
properties: {
|
|
8088
|
+
id: { type: 'string' },
|
|
8089
|
+
},
|
|
8090
|
+
}),
|
|
8091
|
+
supportedImplementationTypes: DataLocationMethodImplementationTypes,
|
|
8092
|
+
};
|
|
8093
|
+
|
|
8094
|
+
const DataCollectionMethodDelete = {
|
|
8095
|
+
name: 'Delete',
|
|
8096
|
+
description: 'Delete a data record from the collection by id',
|
|
8097
|
+
getInputSchema: ({ collectionHandler, parameters, credentialsSchema }) => {
|
|
8098
|
+
return {
|
|
8099
|
+
type: 'object',
|
|
8100
|
+
properties: nonEmptyObjectProperties({
|
|
8101
|
+
id: {
|
|
8102
|
+
type: 'string',
|
|
8103
|
+
referenceCollection: { key: collectionHandler === null || collectionHandler === void 0 ? void 0 : collectionHandler.key, parameters },
|
|
8104
|
+
},
|
|
8105
|
+
credentials: credentialsSchema,
|
|
8106
|
+
}),
|
|
8107
|
+
};
|
|
8108
|
+
},
|
|
8109
|
+
getOutputSchema: () => null,
|
|
8110
|
+
supportedImplementationTypes: DataLocationMethodImplementationTypes,
|
|
8111
|
+
};
|
|
8112
|
+
|
|
8113
|
+
const DataCollectionMethodFind = {
|
|
8114
|
+
isDeprecated: true,
|
|
8115
|
+
name: 'Find',
|
|
8116
|
+
description: 'Find a list of data records in the collection',
|
|
8117
|
+
getConfigSchema: ({ collectionSpec }) => {
|
|
8118
|
+
var _a, _b;
|
|
8119
|
+
const fields = Object.keys((_b = (_a = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema) === null || _a === void 0 ? void 0 : _a.properties) !== null && _b !== void 0 ? _b : {}).map(locatorToField);
|
|
8120
|
+
return {
|
|
8121
|
+
type: 'object',
|
|
8122
|
+
properties: {
|
|
8123
|
+
queryFields: {
|
|
8124
|
+
type: 'array',
|
|
8125
|
+
items: { type: 'string', enum: fields },
|
|
8126
|
+
},
|
|
8127
|
+
},
|
|
8128
|
+
};
|
|
8129
|
+
},
|
|
8130
|
+
getInputSchema: ({ collectionSpec, method, credentialsSchema }) => {
|
|
8131
|
+
const queryFieldsSchema = pickFieldsFromSchema(collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema, method === null || method === void 0 ? void 0 : method.queryFields);
|
|
8132
|
+
const schema = {
|
|
8133
|
+
type: 'object',
|
|
8134
|
+
properties: nonEmptyObjectProperties({
|
|
8135
|
+
cursor: { type: 'string' },
|
|
8136
|
+
credentials: credentialsSchema,
|
|
8137
|
+
}),
|
|
8138
|
+
};
|
|
8139
|
+
if (queryFieldsSchema === null || queryFieldsSchema === void 0 ? void 0 : queryFieldsSchema.properties) {
|
|
8140
|
+
schema.properties = {
|
|
8141
|
+
...schema.properties,
|
|
8142
|
+
query: transformVariablesWith(queryFieldsSchema, (locator) => `query.${locatorToField(locator)}`),
|
|
8143
|
+
};
|
|
8144
|
+
}
|
|
8145
|
+
return schema;
|
|
8146
|
+
},
|
|
8147
|
+
getOutputSchema: ({ collectionSpec }) => {
|
|
8148
|
+
var _a;
|
|
8149
|
+
return ({
|
|
8150
|
+
type: 'object',
|
|
8151
|
+
properties: {
|
|
8152
|
+
records: {
|
|
8153
|
+
type: 'array',
|
|
8154
|
+
items: (_a = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema) !== null && _a !== void 0 ? _a : { type: 'object' },
|
|
8155
|
+
},
|
|
8156
|
+
cursor: {
|
|
8157
|
+
type: 'string',
|
|
8158
|
+
},
|
|
8159
|
+
},
|
|
8160
|
+
});
|
|
8161
|
+
},
|
|
8162
|
+
supportedImplementationTypes: DataLocationMethodImplementationTypes,
|
|
8163
|
+
};
|
|
8164
|
+
|
|
8165
|
+
const DataCollectionMethodFindById = {
|
|
8166
|
+
name: 'Find by ID',
|
|
8167
|
+
description: 'Find a single data record in the collection by its id',
|
|
8168
|
+
getInputSchema: ({ collectionHandler, parameters, credentialsSchema }) => ({
|
|
8169
|
+
type: 'object',
|
|
8170
|
+
properties: nonEmptyObjectProperties({
|
|
8171
|
+
id: {
|
|
8172
|
+
type: 'string',
|
|
8173
|
+
referenceCollection: { key: collectionHandler === null || collectionHandler === void 0 ? void 0 : collectionHandler.key, parameters },
|
|
8174
|
+
},
|
|
8175
|
+
credentials: credentialsSchema,
|
|
8176
|
+
}),
|
|
8177
|
+
}),
|
|
8178
|
+
getOutputSchema: ({ collectionSpec }) => {
|
|
8179
|
+
var _a;
|
|
8180
|
+
return ({
|
|
8181
|
+
type: 'object',
|
|
8182
|
+
properties: {
|
|
8183
|
+
record: (_a = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema) !== null && _a !== void 0 ? _a : { type: 'object' },
|
|
8184
|
+
},
|
|
8185
|
+
});
|
|
8186
|
+
},
|
|
8187
|
+
supportedImplementationTypes: DataLocationMethodImplementationTypes,
|
|
8188
|
+
};
|
|
8189
|
+
|
|
8190
|
+
const DataCollectionMethodList = {
|
|
8191
|
+
name: 'List',
|
|
8192
|
+
description: 'Return all data records from the collection',
|
|
8193
|
+
getConfigSchema: ({ collectionSpec }) => {
|
|
8194
|
+
var _a, _b;
|
|
8195
|
+
const fields = Object.keys((_b = (_a = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema) === null || _a === void 0 ? void 0 : _a.properties) !== null && _b !== void 0 ? _b : {}).map(locatorToField);
|
|
8196
|
+
return {
|
|
8197
|
+
type: 'object',
|
|
8198
|
+
properties: {
|
|
8199
|
+
filterFields: {
|
|
8200
|
+
type: 'array',
|
|
8201
|
+
items: { type: 'string', enum: fields },
|
|
8202
|
+
},
|
|
8203
|
+
},
|
|
8204
|
+
};
|
|
8205
|
+
},
|
|
8206
|
+
getInputSchema: ({ method, collectionSpec, credentialsSchema }) => {
|
|
8207
|
+
const fieldsSchema = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema;
|
|
8208
|
+
let filterSchema;
|
|
8209
|
+
if (method === null || method === void 0 ? void 0 : method.filterFields) {
|
|
8210
|
+
filterSchema = pickFieldsFromSchema(fieldsSchema, method.filterFields);
|
|
8211
|
+
}
|
|
8212
|
+
return {
|
|
8213
|
+
type: 'object',
|
|
8214
|
+
properties: nonEmptyObjectProperties({
|
|
8215
|
+
filter: filterSchema,
|
|
8216
|
+
cursor: {
|
|
8217
|
+
type: 'string',
|
|
8218
|
+
description: 'Cursor returned in response to the previous "list" request',
|
|
8219
|
+
},
|
|
8220
|
+
credentials: credentialsSchema,
|
|
8221
|
+
}),
|
|
8222
|
+
};
|
|
8223
|
+
},
|
|
8224
|
+
getOutputSchema: ({ collectionSpec }) => {
|
|
8225
|
+
var _a;
|
|
8226
|
+
return ({
|
|
8227
|
+
type: 'object',
|
|
8228
|
+
properties: {
|
|
8229
|
+
records: {
|
|
8230
|
+
type: 'array',
|
|
8231
|
+
items: (_a = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema) !== null && _a !== void 0 ? _a : { type: 'object' },
|
|
8232
|
+
},
|
|
8233
|
+
cursor: {
|
|
8234
|
+
type: 'string',
|
|
8235
|
+
description: 'Cursor to request the next page of results',
|
|
8236
|
+
},
|
|
8237
|
+
},
|
|
8238
|
+
});
|
|
8239
|
+
},
|
|
8240
|
+
supportedImplementationTypes: DataLocationMethodImplementationTypes,
|
|
8241
|
+
};
|
|
8242
|
+
|
|
8243
|
+
const DataCollectionMethodMatch = {
|
|
8244
|
+
name: 'Match',
|
|
8245
|
+
description: 'Find a single matching record in a data collection by a set of fields',
|
|
8246
|
+
getConfigSchema: ({ collectionSpec }) => {
|
|
8247
|
+
var _a, _b;
|
|
8248
|
+
const fields = Object.keys((_b = (_a = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema) === null || _a === void 0 ? void 0 : _a.properties) !== null && _b !== void 0 ? _b : {}).map(locatorToField);
|
|
8249
|
+
return {
|
|
8250
|
+
type: 'object',
|
|
8251
|
+
properties: {
|
|
8252
|
+
fields: {
|
|
8253
|
+
type: 'array',
|
|
8254
|
+
items: { type: 'string', enum: fields },
|
|
8255
|
+
},
|
|
8256
|
+
},
|
|
8253
8257
|
};
|
|
8254
|
-
}
|
|
8255
|
-
|
|
8256
|
-
|
|
8257
|
-
|
|
8258
|
-
|
|
8259
|
-
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
-
|
|
8263
|
-
|
|
8264
|
-
|
|
8265
|
-
|
|
8266
|
-
|
|
8267
|
-
|
|
8268
|
-
|
|
8269
|
-
|
|
8270
|
-
|
|
8271
|
-
|
|
8272
|
-
|
|
8273
|
-
|
|
8274
|
-
|
|
8275
|
-
|
|
8276
|
-
}
|
|
8277
|
-
if (!udmSpec.fieldFallbacks) {
|
|
8278
|
-
return fields;
|
|
8279
|
-
}
|
|
8280
|
-
let result = structuredClone$1(fields);
|
|
8281
|
-
for (const fieldKeyWithFallbacks of Object.keys(udmSpec.fieldFallbacks)) {
|
|
8282
|
-
const currentValue = getValueAtLocator(fields, fieldKeyWithFallbacks);
|
|
8283
|
-
if (currentValue !== undefined)
|
|
8284
|
-
continue;
|
|
8285
|
-
for (const fallbackValue of udmSpec.fieldFallbacks[fieldKeyWithFallbacks]) {
|
|
8286
|
-
const varFormulaLocators = getVariableLocators(fallbackValue);
|
|
8287
|
-
const varLocators = [];
|
|
8288
|
-
for (const varFormulaLocator of varFormulaLocators) {
|
|
8289
|
-
const formula = getFormula$1(getValueAtLocator(fallbackValue, varFormulaLocator));
|
|
8290
|
-
varLocators.push(formula.locator);
|
|
8291
|
-
}
|
|
8292
|
-
const fallbackValueHasDependencies = varLocators.some((locator) => getValueAtLocator(fields, locator) !== undefined);
|
|
8293
|
-
if (fallbackValueHasDependencies) {
|
|
8294
|
-
result = setValueAtLocator(result, fieldKeyWithFallbacks, transformVars(fallbackValue, fields));
|
|
8295
|
-
break;
|
|
8296
|
-
}
|
|
8297
|
-
}
|
|
8298
|
-
}
|
|
8299
|
-
return result;
|
|
8300
|
-
}
|
|
8258
|
+
},
|
|
8259
|
+
getInputSchema: ({ collectionSpec, method, credentialsSchema }) => {
|
|
8260
|
+
const fieldsSchema = pickFieldsFromSchema(collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema, method === null || method === void 0 ? void 0 : method.fields);
|
|
8261
|
+
return {
|
|
8262
|
+
type: 'object',
|
|
8263
|
+
properties: nonEmptyObjectProperties({
|
|
8264
|
+
query: transformVariablesWith(fieldsSchema !== null && fieldsSchema !== void 0 ? fieldsSchema : {}, (locator) => `query.${locatorToField(locator)}`),
|
|
8265
|
+
credentials: credentialsSchema,
|
|
8266
|
+
}),
|
|
8267
|
+
};
|
|
8268
|
+
},
|
|
8269
|
+
getOutputSchema: ({ collectionSpec }) => {
|
|
8270
|
+
var _a;
|
|
8271
|
+
return ({
|
|
8272
|
+
type: 'object',
|
|
8273
|
+
properties: {
|
|
8274
|
+
record: (_a = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema) !== null && _a !== void 0 ? _a : { type: 'object' },
|
|
8275
|
+
},
|
|
8276
|
+
});
|
|
8277
|
+
},
|
|
8278
|
+
supportedImplementationTypes: DataLocationMethodImplementationTypes,
|
|
8279
|
+
};
|
|
8301
8280
|
|
|
8302
|
-
const
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
|
|
8306
|
-
|
|
8307
|
-
|
|
8308
|
-
|
|
8309
|
-
type: 'string',
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
|
|
8313
|
-
|
|
8314
|
-
|
|
8315
|
-
|
|
8316
|
-
type: '
|
|
8317
|
-
|
|
8318
|
-
|
|
8319
|
-
|
|
8320
|
-
|
|
8321
|
-
|
|
8322
|
-
|
|
8323
|
-
|
|
8324
|
-
|
|
8325
|
-
format: 'datetime',
|
|
8326
|
-
},
|
|
8327
|
-
createdById: {
|
|
8328
|
-
type: 'string',
|
|
8329
|
-
},
|
|
8330
|
-
updatedById: {
|
|
8331
|
-
type: 'string',
|
|
8332
|
-
},
|
|
8281
|
+
const DataCollectionMethodSearch = {
|
|
8282
|
+
name: 'Search',
|
|
8283
|
+
description: 'Find data records in a collection by a string query',
|
|
8284
|
+
getInputSchema: ({ credentialsSchema }) => ({
|
|
8285
|
+
type: 'object',
|
|
8286
|
+
properties: nonEmptyObjectProperties({
|
|
8287
|
+
query: { type: 'string' },
|
|
8288
|
+
cursor: { type: 'string' },
|
|
8289
|
+
credentials: credentialsSchema,
|
|
8290
|
+
}),
|
|
8291
|
+
}),
|
|
8292
|
+
getOutputSchema: ({ collectionSpec }) => {
|
|
8293
|
+
var _a;
|
|
8294
|
+
return ({
|
|
8295
|
+
type: 'object',
|
|
8296
|
+
properties: {
|
|
8297
|
+
records: {
|
|
8298
|
+
type: 'array',
|
|
8299
|
+
items: (_a = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema) !== null && _a !== void 0 ? _a : { type: 'object' },
|
|
8300
|
+
},
|
|
8301
|
+
cursor: { type: 'string' },
|
|
8302
|
+
},
|
|
8303
|
+
});
|
|
8333
8304
|
},
|
|
8305
|
+
supportedImplementationTypes: DataLocationMethodImplementationTypes,
|
|
8334
8306
|
};
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
|
|
8338
|
-
|
|
8339
|
-
|
|
8340
|
-
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
|
|
8344
|
-
|
|
8345
|
-
|
|
8346
|
-
|
|
8347
|
-
|
|
8348
|
-
|
|
8307
|
+
|
|
8308
|
+
const DataCollectionMethodUpdate = {
|
|
8309
|
+
name: 'Update',
|
|
8310
|
+
description: 'Update one data record in the collection by its id',
|
|
8311
|
+
getConfigSchema: ({ collectionSpec }) => {
|
|
8312
|
+
var _a, _b;
|
|
8313
|
+
const fields = Object.keys((_b = (_a = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema) === null || _a === void 0 ? void 0 : _a.properties) !== null && _b !== void 0 ? _b : {}).map(locatorToField);
|
|
8314
|
+
return {
|
|
8315
|
+
type: 'object',
|
|
8316
|
+
properties: {
|
|
8317
|
+
fields: {
|
|
8318
|
+
type: 'array',
|
|
8319
|
+
items: { type: 'string', enum: fields },
|
|
8320
|
+
},
|
|
8321
|
+
excludedFields: {
|
|
8322
|
+
type: 'array',
|
|
8323
|
+
items: { type: 'string', enum: fields },
|
|
8324
|
+
},
|
|
8325
|
+
},
|
|
8326
|
+
};
|
|
8327
|
+
},
|
|
8328
|
+
getInputSchema: ({ collectionSpec, collectionHandler, credentialsSchema, method, parameters }) => {
|
|
8329
|
+
var _a;
|
|
8330
|
+
let fieldsSchema = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema;
|
|
8331
|
+
if (method === null || method === void 0 ? void 0 : method.fields) {
|
|
8332
|
+
fieldsSchema = pickFieldsFromSchema(fieldsSchema, method.fields);
|
|
8349
8333
|
}
|
|
8350
|
-
|
|
8351
|
-
|
|
8352
|
-
|
|
8353
|
-
|
|
8354
|
-
|
|
8334
|
+
if (method === null || method === void 0 ? void 0 : method.excludedFields) {
|
|
8335
|
+
fieldsSchema = excludeFieldsFromSchema(fieldsSchema, method.excludedFields);
|
|
8336
|
+
}
|
|
8337
|
+
return {
|
|
8338
|
+
type: 'object',
|
|
8339
|
+
properties: nonEmptyObjectProperties({
|
|
8340
|
+
id: {
|
|
8341
|
+
type: 'string',
|
|
8342
|
+
referenceCollection: { key: collectionHandler === null || collectionHandler === void 0 ? void 0 : collectionHandler.key, parameters },
|
|
8343
|
+
},
|
|
8344
|
+
fields: (_a = transformVariablesWith(fieldsSchema, (locator) => `fields.${locatorToField(locator)}`)) !== null && _a !== void 0 ? _a : {
|
|
8345
|
+
type: 'object',
|
|
8346
|
+
},
|
|
8347
|
+
credentials: credentialsSchema,
|
|
8348
|
+
}),
|
|
8355
8349
|
};
|
|
8356
|
-
}
|
|
8357
|
-
|
|
8358
|
-
|
|
8350
|
+
},
|
|
8351
|
+
getOutputSchema: ({}) => ({
|
|
8352
|
+
type: 'object',
|
|
8353
|
+
properties: {
|
|
8354
|
+
id: { type: 'string' },
|
|
8355
|
+
},
|
|
8356
|
+
}),
|
|
8357
|
+
supportedImplementationTypes: DataLocationMethodImplementationTypes,
|
|
8358
|
+
};
|
|
8359
8359
|
|
|
8360
8360
|
const GetEventConfig = {
|
|
8361
8361
|
fileKey: 'connector-event-get-event-config',
|
|
@@ -15470,25 +15470,6 @@ const CreateClusterRequest = z.object({
|
|
|
15470
15470
|
});
|
|
15471
15471
|
const ListClustersQuery = PaginationQuery;
|
|
15472
15472
|
|
|
15473
|
-
class UI {
|
|
15474
|
-
constructor(client) {
|
|
15475
|
-
this.client = client;
|
|
15476
|
-
}
|
|
15477
|
-
async connect(options = {}) {
|
|
15478
|
-
const { url, postData } = await this.client.getScreensPostData('connect', {
|
|
15479
|
-
...options,
|
|
15480
|
-
allowMultipleConnections: options.allowMultipleConnections ? '1' : '',
|
|
15481
|
-
connectorParameters: options.connectorParameters ? JSON.stringify(options.connectorParameters) : undefined,
|
|
15482
|
-
});
|
|
15483
|
-
return new Promise((resolve) => {
|
|
15484
|
-
return openIframeWithPost(url, postData, {
|
|
15485
|
-
onClose: () => resolve(null),
|
|
15486
|
-
onSuccess: (connection) => resolve(connection),
|
|
15487
|
-
});
|
|
15488
|
-
});
|
|
15489
|
-
}
|
|
15490
|
-
}
|
|
15491
|
-
|
|
15492
15473
|
const API_VERSIONS = {
|
|
15493
15474
|
LEGACY: 'legacy',
|
|
15494
15475
|
'2025-10-21': '2025-10-21',
|
|
@@ -15740,6 +15721,25 @@ class MembraneApiClient {
|
|
|
15740
15721
|
}
|
|
15741
15722
|
}
|
|
15742
15723
|
|
|
15724
|
+
class UI {
|
|
15725
|
+
constructor(client) {
|
|
15726
|
+
this.client = client;
|
|
15727
|
+
}
|
|
15728
|
+
async connect(options = {}) {
|
|
15729
|
+
const { url, postData } = await this.client.getScreensPostData('connect', {
|
|
15730
|
+
...options,
|
|
15731
|
+
allowMultipleConnections: options.allowMultipleConnections ? '1' : '',
|
|
15732
|
+
connectorParameters: options.connectorParameters ? JSON.stringify(options.connectorParameters) : undefined,
|
|
15733
|
+
});
|
|
15734
|
+
return new Promise((resolve) => {
|
|
15735
|
+
return openIframeWithPost(url, postData, {
|
|
15736
|
+
onClose: () => resolve(null),
|
|
15737
|
+
onSuccess: (connection) => resolve(connection),
|
|
15738
|
+
});
|
|
15739
|
+
});
|
|
15740
|
+
}
|
|
15741
|
+
}
|
|
15742
|
+
|
|
15743
15743
|
class MembraneClient extends MembraneApiClient {
|
|
15744
15744
|
constructor(options) {
|
|
15745
15745
|
super(options);
|