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