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