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