cliodot 1.2.2 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +81 -0
- package/dist/AuthAppClient.d.ts +1 -0
- package/dist/AuthAppClient.d.ts.map +1 -1
- package/dist/AuthAppClient.js +199 -1
- package/dist/CommercialAppClient.d.ts +178 -0
- package/dist/CommercialAppClient.d.ts.map +1 -0
- package/dist/CommercialAppClient.js +576 -0
- package/dist/ConnectorBuilder.js +104 -1
- package/dist/Events.d.ts +2 -0
- package/dist/Events.d.ts.map +1 -1
- package/dist/Events.js +325 -1
- package/dist/Flosync.js +296 -1
- package/dist/FlosyncClient.js +429 -1
- package/dist/FunctionBuilder.js +65 -1
- package/dist/IdentityAppClient.d.ts +23 -0
- package/dist/IdentityAppClient.d.ts.map +1 -0
- package/dist/IdentityAppClient.js +197 -0
- package/dist/MemoryAppClient.d.ts +28 -0
- package/dist/MemoryAppClient.d.ts.map +1 -0
- package/dist/MemoryAppClient.js +149 -0
- package/dist/MemoryClient.d.ts +8 -0
- package/dist/MemoryClient.d.ts.map +1 -0
- package/dist/MemoryClient.js +20 -0
- package/dist/OAuthAppClient.d.ts +1 -0
- package/dist/OAuthAppClient.d.ts.map +1 -1
- package/dist/OAuthAppClient.js +269 -1
- package/dist/ProviderServicesClient.d.ts +24 -0
- package/dist/ProviderServicesClient.d.ts.map +1 -0
- package/dist/ProviderServicesClient.js +158 -0
- package/dist/Surface.d.ts +2 -0
- package/dist/Surface.d.ts.map +1 -1
- package/dist/Surface.js +255 -1
- package/dist/ValidatorBuilder.js +24 -1
- package/dist/Webhooks.d.ts +20 -0
- package/dist/Webhooks.d.ts.map +1 -0
- package/dist/Webhooks.js +61 -0
- package/dist/WorkflowBuilder.js +279 -1
- package/dist/__tests__/CommercialAppClient.test.d.ts +2 -0
- package/dist/__tests__/CommercialAppClient.test.d.ts.map +1 -0
- package/dist/__tests__/CommercialAppClient.test.js +217 -0
- package/dist/__tests__/Events.test.js +191 -1
- package/dist/__tests__/IdentityAppClient.test.d.ts +2 -0
- package/dist/__tests__/IdentityAppClient.test.d.ts.map +1 -0
- package/dist/__tests__/IdentityAppClient.test.js +232 -0
- package/dist/__tests__/OAuthAppClient.test.js +300 -1
- package/dist/__tests__/ProviderServicesClient.test.d.ts +2 -0
- package/dist/__tests__/ProviderServicesClient.test.d.ts.map +1 -0
- package/dist/__tests__/ProviderServicesClient.test.js +131 -0
- package/dist/__tests__/Surface.test.js +150 -1
- package/dist/__tests__/errors.test.js +54 -1
- package/dist/__tests__/function.test.js +58 -1
- package/dist/__tests__/helpers.d.ts +5 -0
- package/dist/__tests__/helpers.d.ts.map +1 -0
- package/dist/__tests__/helpers.js +10 -0
- package/dist/__tests__/localhost-lookup.test.d.ts +2 -0
- package/dist/__tests__/localhost-lookup.test.d.ts.map +1 -0
- package/dist/__tests__/localhost-lookup.test.js +26 -0
- package/dist/__tests__/parse-api-error.test.js +26 -1
- package/dist/__tests__/runner.test.js +156 -1
- package/dist/connectors/builtin.js +354 -1
- package/dist/connectors/registry.js +300 -1
- package/dist/decorators/build.js +105 -1
- package/dist/decorators/connector.js +56 -1
- package/dist/decorators/index.js +34 -1
- package/dist/decorators/metadata.js +338 -1
- package/dist/decorators/steps.js +220 -1
- package/dist/decorators/workflow.js +52 -1
- package/dist/errors.js +76 -1
- package/dist/http/__tests__/cliodot-request.environment.test.d.ts +2 -0
- package/dist/http/__tests__/cliodot-request.environment.test.d.ts.map +1 -0
- package/dist/http/__tests__/cliodot-request.environment.test.js +37 -0
- package/dist/http/__tests__/cliodot-result.test.d.ts +2 -0
- package/dist/http/__tests__/cliodot-result.test.d.ts.map +1 -0
- package/dist/http/__tests__/cliodot-result.test.js +57 -0
- package/dist/http/__tests__/events-instance-id.test.d.ts +2 -0
- package/dist/http/__tests__/events-instance-id.test.d.ts.map +1 -0
- package/dist/http/__tests__/events-instance-id.test.js +45 -0
- package/dist/http/cliodot-request.d.ts +35 -0
- package/dist/http/cliodot-request.d.ts.map +1 -0
- package/dist/http/cliodot-request.js +105 -0
- package/dist/http/cliodot-result.d.ts +40 -0
- package/dist/http/cliodot-result.d.ts.map +1 -0
- package/dist/http/cliodot-result.js +139 -0
- package/dist/http/create-client.d.ts +3 -0
- package/dist/http/create-client.d.ts.map +1 -0
- package/dist/http/create-client.js +14 -0
- package/dist/http/events-instance-id.d.ts +11 -0
- package/dist/http/events-instance-id.d.ts.map +1 -0
- package/dist/http/events-instance-id.js +86 -0
- package/dist/http/localhost-lookup.d.ts +12 -0
- package/dist/http/localhost-lookup.d.ts.map +1 -0
- package/dist/http/localhost-lookup.js +67 -0
- package/dist/http/parse-api-error.js +56 -1
- package/dist/http/sanitize-execution-headers.js +79 -1
- package/dist/identity-offline-verify.d.ts +6 -0
- package/dist/identity-offline-verify.d.ts.map +1 -0
- package/dist/identity-offline-verify.js +174 -0
- package/dist/identity-token-cache.d.ts +6 -0
- package/dist/identity-token-cache.d.ts.map +1 -0
- package/dist/identity-token-cache.js +51 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +108 -1
- package/dist/runner/ProcessorEngine.js +1311 -1
- package/dist/runner/connector.executor.js +1786 -1
- package/dist/runner/utilities/math.executor.js +153 -1
- package/dist/runner/utilities/random.executor.js +151 -1
- package/dist/runner/utilities/string.executor.js +825 -1
- package/dist/template.js +127 -1
- package/dist/transformers/StepsToNodesTransformer.js +214 -1
- package/dist/transformers/WorkflowTransformer.js +189 -1
- package/dist/types/auth-app.api.d.ts +2 -0
- package/dist/types/auth-app.api.d.ts.map +1 -1
- package/dist/types/auth-app.api.js +2 -1
- package/dist/types/builtin.js +2 -1
- package/dist/types/client.api.js +2 -1
- package/dist/types/commercial-app.api.d.ts +963 -0
- package/dist/types/commercial-app.api.d.ts.map +1 -0
- package/dist/types/commercial-app.api.js +2 -0
- package/dist/types/connector.js +2 -1
- package/dist/types/context.js +2 -1
- package/dist/types/event-app.api.d.ts +8 -0
- package/dist/types/event-app.api.d.ts.map +1 -1
- package/dist/types/event-app.api.js +2 -1
- package/dist/types/function.js +2 -1
- package/dist/types/identity-app.api.d.ts +99 -0
- package/dist/types/identity-app.api.d.ts.map +1 -0
- package/dist/types/identity-app.api.js +2 -0
- package/dist/types/index.js +23 -1
- package/dist/types/memory-app.api.d.ts +140 -0
- package/dist/types/memory-app.api.d.ts.map +1 -0
- package/dist/types/memory-app.api.js +2 -0
- package/dist/types/oauth-app.api.d.ts +2 -0
- package/dist/types/oauth-app.api.d.ts.map +1 -1
- package/dist/types/oauth-app.api.js +105 -1
- package/dist/types/provider-services.api.d.ts +98 -0
- package/dist/types/provider-services.api.d.ts.map +1 -0
- package/dist/types/provider-services.api.js +2 -0
- package/dist/types/validator.js +2 -1
- package/dist/types/webhook-app.api.d.ts +2 -0
- package/dist/types/webhook-app.api.d.ts.map +1 -0
- package/dist/types/webhook-app.api.js +2 -0
- package/dist/types/workflow.js +33 -1
- package/dist/validators/validators.js +478 -1
- package/dist/variable.js +37 -1
- package/package.json +3 -2
|
@@ -1 +1,300 @@
|
|
|
1
|
-
'use strict';const _0xfd15f8=_0x4e40;(function(_0x1aff81,_0x2b03aa){const _0x425403=_0x4e40,_0x3521ed=_0x1aff81();while(!![]){try{const _0x128999=parseInt(_0x425403(0x276))/0x1+-parseInt(_0x425403(0x2bd))/0x2*(-parseInt(_0x425403(0x293))/0x3)+parseInt(_0x425403(0x2a6))/0x4*(-parseInt(_0x425403(0x1ea))/0x5)+-parseInt(_0x425403(0x23d))/0x6*(parseInt(_0x425403(0x286))/0x7)+-parseInt(_0x425403(0x1ee))/0x8+-parseInt(_0x425403(0x266))/0x9*(parseInt(_0x425403(0x229))/0xa)+parseInt(_0x425403(0x243))/0xb;if(_0x128999===_0x2b03aa)break;else _0x3521ed['push'](_0x3521ed['shift']());}catch(_0x9274d0){_0x3521ed['push'](_0x3521ed['shift']());}}}(_0x302a,0x2ced4));Object[_0xfd15f8(0x25d)](exports,_0xfd15f8(0x285),{'value':!![]}),exports[_0xfd15f8(0x2bf)]=exports[_0xfd15f8(0x298)]=void 0x0,exports[_0xfd15f8(0x21f)]=defineCustomConnector,exports[_0xfd15f8(0x20f)]=defineCustomConnectorFromList,exports[_0xfd15f8(0x27a)]=defineRemoteConnectorRef,exports['isTypedConnectorDef']=isTypedConnectorDef,exports[_0xfd15f8(0x1fa)]=isCustomConnectorDef,exports[_0xfd15f8(0x26e)]=defineTypedConnector,exports[_0xfd15f8(0x29f)]=getConnectorActions,exports['listBuiltInConnectors']=listBuiltInConnectors,exports['ConnectorId']={'Database':{'MongoDB':'mongodb.system','MySQL':_0xfd15f8(0x259),'PostgreSQL':_0xfd15f8(0x2d3),'Redis':'redis.system'},'Auth':{'Bearer':'bearer.system','ApiKey':'api_key.system','Basic':_0xfd15f8(0x221),'CustomHeader':_0xfd15f8(0x2b2)},'Utility':{'DateTime':_0xfd15f8(0x282),'String':_0xfd15f8(0x25a),'Random':_0xfd15f8(0x1f5),'Math':_0xfd15f8(0x2b7),'Compare':'utility.compare','Geo':_0xfd15f8(0x2d2)},'Encryption':{'Base64':'base64.encryption','Hash':_0xfd15f8(0x283),'AES':_0xfd15f8(0x20a),'RSA':_0xfd15f8(0x1e9),'HMAC':_0xfd15f8(0x274),'Password':_0xfd15f8(0x2c9)},'Responder':{'Json':_0xfd15f8(0x22c)},'Condition':{'Logic':_0xfd15f8(0x2be)},'Cliodot':_0xfd15f8(0x299)},exports[_0xfd15f8(0x2bf)]={[exports[_0xfd15f8(0x298)][_0xfd15f8(0x2a5)]['MongoDB']]:{'insertOne':_0xfd15f8(0x291),'insertMany':_0xfd15f8(0x231),'findOne':_0xfd15f8(0x2cf),'find':_0xfd15f8(0x233),'updateOne':_0xfd15f8(0x262),'deleteOne':_0xfd15f8(0x2c4)},[exports[_0xfd15f8(0x298)]['Database'][_0xfd15f8(0x2a8)]]:{'query':_0xfd15f8(0x29b)},[exports[_0xfd15f8(0x298)]['Database'][_0xfd15f8(0x2af)]]:{'query':_0xfd15f8(0x29b)},[exports[_0xfd15f8(0x298)][_0xfd15f8(0x2a5)][_0xfd15f8(0x1f9)]]:{'get':_0xfd15f8(0x2a3),'set':_0xfd15f8(0x1f4),'delete':_0xfd15f8(0x2c0),'hset':_0xfd15f8(0x287),'hget':'redis.hget','lpush':_0xfd15f8(0x228),'lpop':_0xfd15f8(0x23a),'zadd':'redis.zadd','create_hash':'redis.create_hash','delete_key':_0xfd15f8(0x203)},[exports[_0xfd15f8(0x298)]['Auth'][_0xfd15f8(0x1f8)]]:{'bearer_create':_0xfd15f8(0x2b4),'bearer_validate':_0xfd15f8(0x21c),'create':_0xfd15f8(0x204),'validate':_0xfd15f8(0x244)},[exports[_0xfd15f8(0x298)][_0xfd15f8(0x25b)]['ApiKey']]:{'api_key_create':_0xfd15f8(0x2ce),'api_key_validate':_0xfd15f8(0x263),'create':'create','validate':_0xfd15f8(0x244)},[exports['ConnectorId'][_0xfd15f8(0x25b)][_0xfd15f8(0x260)]]:{'basic_create':'basic.create','basic_validate':'basic.validate','create':'create','validate':'validate'},[exports[_0xfd15f8(0x298)][_0xfd15f8(0x25b)]['CustomHeader']]:{'custom_header_create':_0xfd15f8(0x29e),'custom_header_validate':_0xfd15f8(0x28d),'create':'create','validate':'validate'},[exports[_0xfd15f8(0x298)]['Utility'][_0xfd15f8(0x279)]]:{'get_current_date':_0xfd15f8(0x210),'get_current_time':_0xfd15f8(0x2c1),'get_current_datetime':_0xfd15f8(0x27f),'format':_0xfd15f8(0x24d),'format_date':_0xfd15f8(0x27b),'parse_date':'parse_date','add_time':'add_time','subtract_time':_0xfd15f8(0x1fb),'diff_between_dates':_0xfd15f8(0x22f),'start_of_day':_0xfd15f8(0x2c8),'end_of_day':'end_of_day','start_of_week':_0xfd15f8(0x2d0),'end_of_week':_0xfd15f8(0x296),'start_of_month':_0xfd15f8(0x28f),'end_of_month':'end_of_month','start_of_year':_0xfd15f8(0x2bb),'end_of_year':'end_of_year','convert_timezone':_0xfd15f8(0x278),'get_timezone':_0xfd15f8(0x25e),'list_timezones':'list_timezones','is_leap_year':_0xfd15f8(0x2ae),'get_unix_timestamp':_0xfd15f8(0x226),'from_unix_timestamp':_0xfd15f8(0x257)},[exports[_0xfd15f8(0x298)][_0xfd15f8(0x26b)]['String']]:{'concat':'concat','split':_0xfd15f8(0x2c6),'join':'join','replace':_0xfd15f8(0x1f1),'replace_all':_0xfd15f8(0x239),'trim':'trim','trim_start':_0xfd15f8(0x2c3),'trim_end':_0xfd15f8(0x230),'to_uppercase':_0xfd15f8(0x2a1),'to_lowercase':'to_lowercase','capitalize':_0xfd15f8(0x1eb),'substring':_0xfd15f8(0x24e),'length':_0xfd15f8(0x256),'contains':_0xfd15f8(0x1f2),'starts_with':_0xfd15f8(0x2ab),'ends_with':_0xfd15f8(0x20b),'remove_whitespace':'remove_whitespace','slugify':_0xfd15f8(0x271),'pad_start':'pad_start','pad_end':_0xfd15f8(0x2ad),'reverse':_0xfd15f8(0x2ba),'encode_base64':'encode_base64','decode_base64':_0xfd15f8(0x21b),'encode_uri':_0xfd15f8(0x200),'decode_uri':_0xfd15f8(0x2aa),'after':_0xfd15f8(0x222),'after_last':'after_last','before':_0xfd15f8(0x240),'before_last':_0xfd15f8(0x201),'between':_0xfd15f8(0x2a4),'between_first':_0xfd15f8(0x238),'camel':'camel','char_at':_0xfd15f8(0x2d5),'chop_start':_0xfd15f8(0x2a2),'chop_end':_0xfd15f8(0x225),'contains_all':_0xfd15f8(0x290),'doesnt_contain':_0xfd15f8(0x1ed),'doesnt_start_with':'doesnt_start_with','doesnt_end_with':_0xfd15f8(0x294),'deduplicate':'deduplicate','excerpt':_0xfd15f8(0x1fe),'finish':'finish','start':_0xfd15f8(0x24b),'headline':_0xfd15f8(0x2b5),'is':'is','is_ascii':_0xfd15f8(0x223),'is_json':_0xfd15f8(0x227),'is_ulid':'is_ulid','is_url':'is_url','is_uuid':_0xfd15f8(0x22e),'is_empty':_0xfd15f8(0x21d),'is_match':_0xfd15f8(0x1ef),'kebab':_0xfd15f8(0x213),'snake':_0xfd15f8(0x1f3),'studly':_0xfd15f8(0x281),'title':_0xfd15f8(0x2a7),'lcfirst':_0xfd15f8(0x218),'ucfirst':_0xfd15f8(0x255),'ucwords':_0xfd15f8(0x1fd),'ucsplit':'ucsplit','limit':_0xfd15f8(0x214),'mask':_0xfd15f8(0x28c),'match':_0xfd15f8(0x23e),'match_all':_0xfd15f8(0x284),'pad_both':'pad_both','plural':_0xfd15f8(0x248),'singular':_0xfd15f8(0x253),'position':_0xfd15f8(0x217),'random':'random','remove':_0xfd15f8(0x20e),'repeat':_0xfd15f8(0x261),'replace_array':_0xfd15f8(0x2b1),'replace_first':_0xfd15f8(0x277),'replace_last':_0xfd15f8(0x26f),'replace_matches':_0xfd15f8(0x1ff),'replace_start':_0xfd15f8(0x26c),'replace_end':_0xfd15f8(0x28e),'squish':_0xfd15f8(0x270),'substr':_0xfd15f8(0x1f6),'substr_count':'substr_count','substr_replace':'substr_replace','swap':_0xfd15f8(0x272),'take':_0xfd15f8(0x2a0),'word_count':_0xfd15f8(0x241),'word_wrap':_0xfd15f8(0x2b8),'words':_0xfd15f8(0x26a),'wrap':_0xfd15f8(0x254),'unwrap':'unwrap','uuid':'uuid','ulid':_0xfd15f8(0x22a),'strip_tags':_0xfd15f8(0x2cc),'ascii':_0xfd15f8(0x23c),'apa':_0xfd15f8(0x2d4),'class_basename':_0xfd15f8(0x22d)},[exports[_0xfd15f8(0x298)][_0xfd15f8(0x26b)][_0xfd15f8(0x23b)]]:{'random_int':_0xfd15f8(0x216),'random_float':'random_float','random_string':_0xfd15f8(0x288),'random_uuid':_0xfd15f8(0x2b9),'uuid':_0xfd15f8(0x235),'random_boolean':_0xfd15f8(0x220),'random_choice':_0xfd15f8(0x2cb),'random_password':_0xfd15f8(0x2b3),'random_hex':_0xfd15f8(0x297),'random_alphanumeric':_0xfd15f8(0x234),'random_date':_0xfd15f8(0x251),'random_color':_0xfd15f8(0x237),'shuffle_array':_0xfd15f8(0x209)},[exports[_0xfd15f8(0x298)][_0xfd15f8(0x26b)][_0xfd15f8(0x29d)]]:{'add':_0xfd15f8(0x245),'subtract':_0xfd15f8(0x269),'multiply':'multiply','divide':'divide','modulo':_0xfd15f8(0x215),'power':_0xfd15f8(0x2b0),'round':_0xfd15f8(0x2d6),'floor':_0xfd15f8(0x208),'ceil':_0xfd15f8(0x275),'abs':_0xfd15f8(0x205),'min':_0xfd15f8(0x232),'max':_0xfd15f8(0x295),'average':_0xfd15f8(0x224),'sum':_0xfd15f8(0x2c5),'clamp':_0xfd15f8(0x1f0),'random_between':_0xfd15f8(0x25c),'percentage':_0xfd15f8(0x20c),'percentage_of':_0xfd15f8(0x264),'sqrt':'sqrt','log':_0xfd15f8(0x2ca)},[exports['ConnectorId']['Utility'][_0xfd15f8(0x249)]]:{'diff_objects':'diff_objects','diff_arrays':'diff_arrays','compare_strings':_0xfd15f8(0x211),'compare_numbers':_0xfd15f8(0x1ec),'compare_dates':_0xfd15f8(0x289),'is_changed':_0xfd15f8(0x24f),'is_equal':_0xfd15f8(0x250),'is_not_equal':_0xfd15f8(0x246),'is_greater_than':'is_greater_than','is_less_than':_0xfd15f8(0x2c2),'is_between':_0xfd15f8(0x20d),'is_empty':_0xfd15f8(0x21d),'is_null_or_undefined':_0xfd15f8(0x28a),'is_same_type':_0xfd15f8(0x206),'deep_equal':'deep_equal','shallow_equal':'shallow_equal','similarity_score':_0xfd15f8(0x2ac),'array_intersection':_0xfd15f8(0x21e),'array_union':_0xfd15f8(0x292),'array_difference':'array_difference'},[exports[_0xfd15f8(0x298)]['Utility'][_0xfd15f8(0x27c)]]:{'calculate_distance':'calculate_distance','point_in_polygon':_0xfd15f8(0x247),'get_bounding_box':_0xfd15f8(0x236),'reverse_geocode':'reverse_geocode','geocode':_0xfd15f8(0x2b6),'convert_coordinates':_0xfd15f8(0x219)},[exports[_0xfd15f8(0x298)][_0xfd15f8(0x27e)][_0xfd15f8(0x2cd)]]:{'encode':'base64.encode','decode':_0xfd15f8(0x29a)},[exports['ConnectorId']['Encryption']['Hash']]:{'hash':'hash','md5':_0xfd15f8(0x29c),'sha1':_0xfd15f8(0x26d),'sha256':_0xfd15f8(0x265),'sha512':'hash.sha512'},[exports[_0xfd15f8(0x298)][_0xfd15f8(0x27e)]['AES']]:{'encrypt':_0xfd15f8(0x2c7),'decrypt':_0xfd15f8(0x280),'generate_key':_0xfd15f8(0x242),'generate_iv':_0xfd15f8(0x27d)},[exports[_0xfd15f8(0x298)][_0xfd15f8(0x27e)][_0xfd15f8(0x2d1)]]:{'generate_keypair':'rsa.generate_keypair','encrypt':_0xfd15f8(0x28b),'decrypt':_0xfd15f8(0x267),'sign':_0xfd15f8(0x2a9),'verify':'rsa.verify'},[exports['ConnectorId'][_0xfd15f8(0x27e)]['HMAC']]:{'create':_0xfd15f8(0x21a),'verify':_0xfd15f8(0x207)},[exports[_0xfd15f8(0x298)][_0xfd15f8(0x27e)]['Password']]:{'argon2_hash':_0xfd15f8(0x252),'argon2_verify':_0xfd15f8(0x268),'pbkdf2_hash':'password.pbkdf2_hash','pbkdf2_verify':'password.pbkdf2_verify','scrypt_hash':_0xfd15f8(0x22b),'scrypt_verify':'password.scrypt_verify','bcrypt_hash':_0xfd15f8(0x24a),'bcrypt_verify':_0xfd15f8(0x23f),'generate_salt':_0xfd15f8(0x258)}};function defineCustomConnector(_0x39e214,_0x274559){return{'id':_0x39e214,'actions':_0x274559};}function defineCustomConnectorFromList(_0x70338f,_0x4dfc19){const _0x4713c2=_0xfd15f8,_0x2ddd01=Object[_0x4713c2(0x1fc)](_0x4dfc19['map'](_0x4038ed=>[_0x4038ed,_0x4038ed]));return{'id':_0x70338f,'actions':_0x2ddd01};}function defineRemoteConnectorRef(_0x4dda57,_0x1377e9){return{'id':_0x4dda57,'actions':_0x1377e9};}function isTypedConnectorDef(_0x5ee28d){const _0x2b53c7=_0xfd15f8;return typeof _0x5ee28d===_0x2b53c7(0x25f)&&_0x5ee28d!==null&&_0x2b53c7(0x273)in _0x5ee28d&&'id'in _0x5ee28d&&_0x2b53c7(0x24c)in _0x5ee28d&&typeof _0x5ee28d['id']===_0x2b53c7(0x1f7);}function isCustomConnectorDef(_0x2b64bd){const _0x3308db=_0xfd15f8;return typeof _0x2b64bd===_0x3308db(0x25f)&&_0x2b64bd!==null&&'id'in _0x2b64bd&&_0x3308db(0x24c)in _0x2b64bd&&typeof _0x2b64bd['id']===_0x3308db(0x1f7)&&typeof _0x2b64bd['actions']==='object';}function _0x4e40(_0xfb4072,_0x4a6418){_0xfb4072=_0xfb4072-0x1e9;const _0x302add=_0x302a();let _0x4e4080=_0x302add[_0xfb4072];if(_0x4e40['jSbvZn']===undefined){var _0x449d84=function(_0x1a87cc){const _0x1bb213='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x39e214='',_0x274559='';for(let _0x70338f=0x0,_0x4dfc19,_0x2ddd01,_0x4038ed=0x0;_0x2ddd01=_0x1a87cc['charAt'](_0x4038ed++);~_0x2ddd01&&(_0x4dfc19=_0x70338f%0x4?_0x4dfc19*0x40+_0x2ddd01:_0x2ddd01,_0x70338f++%0x4)?_0x39e214+=String['fromCharCode'](0xff&_0x4dfc19>>(-0x2*_0x70338f&0x6)):0x0){_0x2ddd01=_0x1bb213['indexOf'](_0x2ddd01);}for(let _0x4dda57=0x0,_0x1377e9=_0x39e214['length'];_0x4dda57<_0x1377e9;_0x4dda57++){_0x274559+='%'+('00'+_0x39e214['charCodeAt'](_0x4dda57)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x274559);};_0x4e40['rFRKSC']=_0x449d84,_0x4e40['sRqfbq']={},_0x4e40['jSbvZn']=!![];}const _0x1ec2da=_0x302add[0x0],_0x1da343=_0xfb4072+_0x1ec2da,_0x569dc0=_0x4e40['sRqfbq'][_0x1da343];return!_0x569dc0?(_0x4e4080=_0x4e40['rFRKSC'](_0x4e4080),_0x4e40['sRqfbq'][_0x1da343]=_0x4e4080):_0x4e4080=_0x569dc0,_0x4e4080;}function defineTypedConnector(_0x56c664,_0x1dd487,_0x11a46a){return{'id':_0x56c664,'actions':_0x1dd487,'__schemas':_0x11a46a};}function getConnectorActions(_0x1d9465){const _0x1f38e1=_0xfd15f8,_0x55474d=exports[_0x1f38e1(0x2bf)][_0x1d9465];if(!_0x55474d)return[];return Object['values'](_0x55474d);}function listBuiltInConnectors(){const _0x85bcb1=_0xfd15f8,_0xf6c6f=[];for(const [_0x2c73cf,_0x30f1dc]of Object[_0x85bcb1(0x202)](exports['ConnectorActions'])){_0xf6c6f[_0x85bcb1(0x212)]({'id':_0x2c73cf,'category':_0x2c73cf[_0x85bcb1(0x2bc)]('.')?_0x2c73cf[_0x85bcb1(0x2c6)]('.')[0x0]:'custom','actions':Object['values'](_0x30f1dc)});}return _0xf6c6f;}function _0x302a(){const _0x466ce9=['CMvKAxmUzgvSzxrL','z2v0x2n1CNjLBNrFDgLTzq','AxnFBgvZC190AgfU','DhjPBv9ZDgfYDa','zgvSzxrLt25L','C3vT','C3bSAxq','ywvZlMvUy3j5Chq','C3rHCNrFB2zFzgf5','CgfZC3DVCMqUzw5JCNLWDgLVBG','Bg9N','CMfUzg9Tx2nOB2LJzq','C3rYAxbFDgfNCW','qMfZzty0','yxbPx2TLEs5JCMvHDgu','zMLUze9Uzq','C3rHCNrFB2zFD2vLAW','uLnb','DxrPBgL0Es5Nzw8','Cg9ZDgDYzxmUC3LZDgvT','yxbH','y2HHCL9HDa','CM91BMq','CNnHlMvUy3j5ChrPB24','otbAD25sze0','y2fWAxrHBgL6zq','y29TCgfYzv9UDw1IzxjZ','zg9LC250x2nVBNrHAw4','mtyXotu3nNvivKfoBW','AxnFBwf0y2G','y2XHBxa','CMvWBgfJzq','y29UDgfPBNm','C25HA2u','CMvKAxmUC2v0','DxrPBgL0Es5Yyw5KB20','C3vIC3rY','C3rYAw5N','qMvHCMvY','uMvKAxm','AxndDxn0B21dB25Uzwn0B3jezwy','C3vIDhjHy3rFDgLTzq','zNjVBuvUDhjPzxm','Dwn3B3jKCW','zxHJzxjWDa','CMvWBgfJzv9TyxrJAgvZ','zw5JB2rLx3vYAq','yMvMB3jLx2XHC3q','zw50CMLLCW','CMvKAxmUzgvSzxrLx2TLEq','y3jLyxrL','ywjZ','AxnFC2fTzv90ExbL','Ag1HyY52zxjPzNK','zMXVB3i','C2H1zMzSzv9HCNjHEq','ywvZlMvUy3j5ChrPB24','zw5KC193AxrO','CgvYy2vUDgfNzq','AxnFyMv0D2vLBG','CMvTB3zL','zgvMAw5Lq3vZDg9Tq29UBMvJDg9YrNjVBuXPC3q','z2v0x2n1CNjLBNrFzgf0zq','y29TCgfYzv9ZDhjPBMDZ','ChvZAa','A2vIywi','BgLTAxq','Bw9KDwXV','CMfUzg9Tx2LUDa','Cg9ZAxrPB24','BgnMAxjZDa','y29UDMvYDf9JB29YzgLUyxrLCW','Ag1HyY5JCMvHDgu','zgvJB2rLx2jHC2u2na','yMvHCMvYlNzHBgLKyxrL','AxnFzw1WDhK','yxjYyxLFAw50zxjZzwn0Aw9U','zgvMAw5Lq3vZDg9Tq29UBMvJDg9Y','CMfUzg9Tx2jVB2XLyw4','yMfZAwmUC3LZDgvT','ywz0zxi','AxnFyxnJAwK','yxzLCMfNzq','y2HVCf9LBMq','z2v0x3vUAxHFDgLTzxn0yw1W','AxnFANnVBG','CMvKAxmUBhb1C2G','ndG4mJyWtK10EvLV','DwXPza','CgfZC3DVCMqUC2nYExb0x2HHC2G','ANnVBI5YzxnWB25Kzxi','y2XHC3nFyMfZzw5HBwu','AxnFDxvPza','zgLMzL9Izxr3zwvUx2rHDgvZ','DhjPBv9LBMq','Aw5Zzxj0twfUEq','BwLU','zMLUza','CMfUzg9Tx2fSCgHHBNvTzxjPyW','DxvPza','z2v0x2jVDw5KAw5Nx2jVEa','CMfUzg9Tx2nVBg9Y','yMv0D2vLBL9MAxjZDa','CMvWBgfJzv9HBgW','CMvKAxmUBhbVCa','uMfUzg9T','yxnJAwK','ndjct2zgzNC','Bwf0y2G','CgfZC3DVCMqUyMnYExb0x3zLCMLMEq','yMvMB3jL','D29Yzf9JB3vUDa','ywvZlMDLBMvYyxrLx2TLEq','mta3nZGZmJHowxPAwem','DMfSAwrHDgu','ywrK','AxnFBM90x2vXDwfS','Cg9PBNrFAw5FCg9SEwDVBG','CgX1CMfS','q29TCgfYzq','CgfZC3DVCMqUyMnYExb0x2HHC2G','C3rHCNq','ywn0Aw9UCW','zM9YBwf0','C3vIC3rYAw5N','AxnFy2HHBMDLza','AxnFzxf1ywW','CMfUzg9Tx2rHDgu','CgfZC3DVCMqUyxjNB24Yx2HHC2G','C2LUz3vSyxi','D3jHCa','DwnMAxjZDa','BgvUz3rO','zNjVBv91BML4x3rPBwvZDgfTCa','CgfZC3DVCMqUz2vUzxjHDgvFC2fSDa','BxLZCwWUC3LZDgvT','DxrPBgL0Es5ZDhjPBMC','qxv0Aa','CMfUzg9Tx2jLDhDLzw4','zgvMAw5LuhjVCgvYDhK','z2v0x3rPBwv6B25L','B2jQzwn0','qMfZAwm','CMvWzwf0','DxbKyxrLt25L','yxbPx2TLEs52ywXPzgf0zq','CgvYy2vUDgfNzv9VzG','AgfZAc5ZAgeYnty','mZz5Aufpz2e','CNnHlMrLy3j5Chq','CgfZC3DVCMqUyxjNB24Yx3zLCMLMEq','C3vIDhjHy3q','D29Yzhm','vxrPBgL0Eq','CMvWBgfJzv9ZDgfYDa','AgfZAc5ZAgeX','zgvMAw5LvhLWzwrdB25Uzwn0B3i','CMvWBgfJzv9Syxn0','C3f1AxnO','C2X1z2LMEq','C3DHCa','x19Zy2HLBwfZ','Ag1HyY5LBMnYExb0Aw9U','y2vPBa','nJqZmZvYu2zNt08','CMvWBgfJzv9MAxjZDa','y29UDMvYDf90Aw1LEM9Uzq','rgf0zvrPBwu','zgvMAw5LuMvTB3rLq29UBMvJDg9YuMvM','zM9YBwf0x2rHDgu','r2vV','ywvZlMDLBMvYyxrLx2L2','rw5JCNLWDgLVBG','z2v0x2n1CNjLBNrFzgf0zxrPBwu','ywvZlMrLy3j5Chq','C3r1zgX5','DxrPBgL0Es5KyxrLx3rPBwu','AgfZAc5LBMnYExb0Aw9U','Bwf0y2HFywXS','x19LC01VzhvSzq','mZyZntaZvfrwtKrN','CMvKAxmUAhnLDa','CMfUzg9Tx3n0CMLUzW','y29TCgfYzv9KyxrLCW','AxnFBNvSBf9VCL91BMrLzMLUzwq','CNnHlMvUy3j5Chq','BwfZAW','y3vZDg9Tx2HLywrLCI52ywXPzgf0zq','CMvWBgfJzv9LBMq','C3rHCNrFB2zFBw9UDgG','y29UDgfPBNnFywXS','Aw5Zzxj0t25L','yxjYyxLFDw5PB24','mZLSuuHNqLu','zg9LC250x2vUzf93AxrO','Bwf4','zw5Kx29Mx3DLzwS','CMfUzg9Tx2HLEa','q29UBMvJDg9Yswq','y2XPB2rVDa','yMfZzty0lMrLy29Kzq','CxvLCNK','AgfZAc5Tzdu','twf0Aa','y3vZDg9Tx2HLywrLCI5JCMvHDgu','z2v0q29UBMvJDg9Yqwn0Aw9UCW','DgfRzq','Dg9FDxbWzxjJyxnL','y2HVCf9ZDgfYDa','CMvKAxmUz2v0','yMv0D2vLBG','rgf0ywjHC2u','nJi1mdHervrwBvq','DgL0Bgu','txLtuuW','CNnHlNnPz24','zgvJB2rLx3vYAq','C3rHCNrZx3DPDgG','C2LTAwXHCML0Ev9Zy29Yzq','CgfKx2vUza','AxnFBgvHCf95zwfY','ug9ZDgDYzvnrta','Cg93zxi','CMvWBgfJzv9HCNjHEq','y3vZDg9Tx2HLywrLCI5ZExn0zw0','CMfUzg9Tx3bHC3n3B3jK','yMvHCMvYlMnYzwf0zq','AgvHzgXPBMu','z2vVy29Kzq','DxrPBgL0Es5TyxrO','D29Yzf93CMfW','CMfUzg9Tx3v1Awq','CMv2zxjZzq','C3rHCNrFB2zFEwvHCG','Aw5JBhvKzxm','mJGWntHgCKTUDMG','y29UzgL0Aw9UlMXVz2LJ','q29UBMvJDg9Yqwn0Aw9UCW'];_0x302a=function(){return _0x466ce9;};return _0x302a();}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConnectorActions = exports.ConnectorId = void 0;
|
|
4
|
+
exports.defineCustomConnector = defineCustomConnector;
|
|
5
|
+
exports.defineCustomConnectorFromList = defineCustomConnectorFromList;
|
|
6
|
+
exports.defineRemoteConnectorRef = defineRemoteConnectorRef;
|
|
7
|
+
exports.isTypedConnectorDef = isTypedConnectorDef;
|
|
8
|
+
exports.isCustomConnectorDef = isCustomConnectorDef;
|
|
9
|
+
exports.defineTypedConnector = defineTypedConnector;
|
|
10
|
+
exports.getConnectorActions = getConnectorActions;
|
|
11
|
+
exports.listBuiltInConnectors = listBuiltInConnectors;
|
|
12
|
+
exports.ConnectorId = {
|
|
13
|
+
Database: {
|
|
14
|
+
MongoDB: "mongodb.system",
|
|
15
|
+
MySQL: "mysql.system",
|
|
16
|
+
PostgreSQL: "postgres.system",
|
|
17
|
+
Redis: "redis.system",
|
|
18
|
+
},
|
|
19
|
+
Auth: {
|
|
20
|
+
Bearer: "bearer.system",
|
|
21
|
+
ApiKey: "api_key.system",
|
|
22
|
+
Basic: "basic.system",
|
|
23
|
+
CustomHeader: "custom_header.system",
|
|
24
|
+
},
|
|
25
|
+
Utility: {
|
|
26
|
+
DateTime: "utility.date_time",
|
|
27
|
+
String: "utility.string",
|
|
28
|
+
Random: "utility.random",
|
|
29
|
+
Math: "utility.math",
|
|
30
|
+
Compare: "utility.compare",
|
|
31
|
+
Geo: "utility.geo",
|
|
32
|
+
},
|
|
33
|
+
Encryption: {
|
|
34
|
+
Base64: "base64.encryption",
|
|
35
|
+
Hash: "hash.encryption",
|
|
36
|
+
AES: "aes.encryption",
|
|
37
|
+
RSA: "rsa.encryption",
|
|
38
|
+
HMAC: "hmac.encryption",
|
|
39
|
+
Password: "password.encryption",
|
|
40
|
+
},
|
|
41
|
+
Responder: {
|
|
42
|
+
Json: "json.responder",
|
|
43
|
+
},
|
|
44
|
+
Condition: {
|
|
45
|
+
Logic: "condition.logic",
|
|
46
|
+
},
|
|
47
|
+
Cliodot: "cliodot",
|
|
48
|
+
};
|
|
49
|
+
exports.ConnectorActions = {
|
|
50
|
+
[exports.ConnectorId.Database.MongoDB]: {
|
|
51
|
+
insertOne: "insertOne",
|
|
52
|
+
insertMany: "insertMany",
|
|
53
|
+
findOne: "findOne",
|
|
54
|
+
find: "find",
|
|
55
|
+
updateOne: "updateOne",
|
|
56
|
+
deleteOne: "deleteOne",
|
|
57
|
+
},
|
|
58
|
+
[exports.ConnectorId.Database.MySQL]: {
|
|
59
|
+
query: "query",
|
|
60
|
+
},
|
|
61
|
+
[exports.ConnectorId.Database.PostgreSQL]: {
|
|
62
|
+
query: "query",
|
|
63
|
+
},
|
|
64
|
+
[exports.ConnectorId.Database.Redis]: {
|
|
65
|
+
get: "redis.get",
|
|
66
|
+
set: "redis.set",
|
|
67
|
+
delete: "redis.delete",
|
|
68
|
+
hset: "redis.hset",
|
|
69
|
+
hget: "redis.hget",
|
|
70
|
+
lpush: "redis.lpush",
|
|
71
|
+
lpop: "redis.lpop",
|
|
72
|
+
zadd: "redis.zadd",
|
|
73
|
+
create_hash: "redis.create_hash",
|
|
74
|
+
delete_key: "redis.delete_key",
|
|
75
|
+
},
|
|
76
|
+
[exports.ConnectorId.Auth.Bearer]: {
|
|
77
|
+
bearer_create: "bearer.create",
|
|
78
|
+
bearer_validate: "bearer.validate",
|
|
79
|
+
create: "create",
|
|
80
|
+
validate: "validate",
|
|
81
|
+
},
|
|
82
|
+
[exports.ConnectorId.Auth.ApiKey]: {
|
|
83
|
+
api_key_create: "api_key.create",
|
|
84
|
+
api_key_validate: "api_key.validate",
|
|
85
|
+
create: "create",
|
|
86
|
+
validate: "validate",
|
|
87
|
+
},
|
|
88
|
+
[exports.ConnectorId.Auth.Basic]: {
|
|
89
|
+
basic_create: "basic.create",
|
|
90
|
+
basic_validate: "basic.validate",
|
|
91
|
+
create: "create",
|
|
92
|
+
validate: "validate",
|
|
93
|
+
},
|
|
94
|
+
[exports.ConnectorId.Auth.CustomHeader]: {
|
|
95
|
+
custom_header_create: "custom_header.create",
|
|
96
|
+
custom_header_validate: "custom_header.validate",
|
|
97
|
+
create: "create",
|
|
98
|
+
validate: "validate",
|
|
99
|
+
},
|
|
100
|
+
[exports.ConnectorId.Utility.DateTime]: {
|
|
101
|
+
get_current_date: "get_current_date",
|
|
102
|
+
get_current_time: "get_current_time",
|
|
103
|
+
get_current_datetime: "get_current_datetime",
|
|
104
|
+
format: "format",
|
|
105
|
+
format_date: "format_date",
|
|
106
|
+
parse_date: "parse_date",
|
|
107
|
+
add_time: "add_time",
|
|
108
|
+
subtract_time: "subtract_time",
|
|
109
|
+
diff_between_dates: "diff_between_dates",
|
|
110
|
+
start_of_day: "start_of_day",
|
|
111
|
+
end_of_day: "end_of_day",
|
|
112
|
+
start_of_week: "start_of_week",
|
|
113
|
+
end_of_week: "end_of_week",
|
|
114
|
+
start_of_month: "start_of_month",
|
|
115
|
+
end_of_month: "end_of_month",
|
|
116
|
+
start_of_year: "start_of_year",
|
|
117
|
+
end_of_year: "end_of_year",
|
|
118
|
+
convert_timezone: "convert_timezone",
|
|
119
|
+
get_timezone: "get_timezone",
|
|
120
|
+
list_timezones: "list_timezones",
|
|
121
|
+
is_leap_year: "is_leap_year",
|
|
122
|
+
get_unix_timestamp: "get_unix_timestamp",
|
|
123
|
+
from_unix_timestamp: "from_unix_timestamp",
|
|
124
|
+
},
|
|
125
|
+
[exports.ConnectorId.Utility.String]: {
|
|
126
|
+
concat: "concat", split: "split", join: "join", replace: "replace", replace_all: "replace_all", trim: "trim", trim_start: "trim_start", trim_end: "trim_end",
|
|
127
|
+
to_uppercase: "to_uppercase", to_lowercase: "to_lowercase", capitalize: "capitalize", substring: "substring", length: "length", contains: "contains", starts_with: "starts_with", ends_with: "ends_with",
|
|
128
|
+
remove_whitespace: "remove_whitespace", slugify: "slugify", pad_start: "pad_start", pad_end: "pad_end", reverse: "reverse", encode_base64: "encode_base64", decode_base64: "decode_base64",
|
|
129
|
+
encode_uri: "encode_uri", decode_uri: "decode_uri", after: "after", after_last: "after_last", before: "before", before_last: "before_last", between: "between", between_first: "between_first",
|
|
130
|
+
camel: "camel", char_at: "char_at", chop_start: "chop_start", chop_end: "chop_end", contains_all: "contains_all", doesnt_contain: "doesnt_contain", doesnt_start_with: "doesnt_start_with", doesnt_end_with: "doesnt_end_with",
|
|
131
|
+
deduplicate: "deduplicate", excerpt: "excerpt", finish: "finish", start: "start", headline: "headline", is: "is", is_ascii: "is_ascii", is_json: "is_json", is_ulid: "is_ulid", is_url: "is_url", is_uuid: "is_uuid", is_empty: "is_empty", is_match: "is_match",
|
|
132
|
+
kebab: "kebab", snake: "snake", studly: "studly", title: "title", lcfirst: "lcfirst", ucfirst: "ucfirst", ucwords: "ucwords", ucsplit: "ucsplit", limit: "limit", mask: "mask", match: "match", match_all: "match_all",
|
|
133
|
+
pad_both: "pad_both", plural: "plural", singular: "singular", position: "position", random: "random", remove: "remove", repeat: "repeat", replace_array: "replace_array", replace_first: "replace_first", replace_last: "replace_last",
|
|
134
|
+
replace_matches: "replace_matches", replace_start: "replace_start", replace_end: "replace_end", squish: "squish", substr: "substr", substr_count: "substr_count", substr_replace: "substr_replace", swap: "swap", take: "take",
|
|
135
|
+
word_count: "word_count", word_wrap: "word_wrap", words: "words", wrap: "wrap", unwrap: "unwrap", uuid: "uuid", ulid: "ulid", strip_tags: "strip_tags", ascii: "ascii", apa: "apa", class_basename: "class_basename",
|
|
136
|
+
},
|
|
137
|
+
[exports.ConnectorId.Utility.Random]: {
|
|
138
|
+
random_int: "random_int", random_float: "random_float", random_string: "random_string", random_uuid: "random_uuid", uuid: "uuid", random_boolean: "random_boolean", random_choice: "random_choice",
|
|
139
|
+
random_password: "random_password", random_hex: "random_hex", random_alphanumeric: "random_alphanumeric", random_date: "random_date", random_color: "random_color", shuffle_array: "shuffle_array",
|
|
140
|
+
},
|
|
141
|
+
[exports.ConnectorId.Utility.Math]: {
|
|
142
|
+
add: "add", subtract: "subtract", multiply: "multiply", divide: "divide", modulo: "modulo", power: "power", round: "round", floor: "floor", ceil: "ceil",
|
|
143
|
+
abs: "abs", min: "min", max: "max", average: "average", sum: "sum", clamp: "clamp", random_between: "random_between", percentage: "percentage", percentage_of: "percentage_of", sqrt: "sqrt", log: "log",
|
|
144
|
+
},
|
|
145
|
+
[exports.ConnectorId.Utility.Compare]: {
|
|
146
|
+
diff_objects: "diff_objects",
|
|
147
|
+
diff_arrays: "diff_arrays",
|
|
148
|
+
compare_strings: "compare_strings",
|
|
149
|
+
compare_numbers: "compare_numbers",
|
|
150
|
+
compare_dates: "compare_dates",
|
|
151
|
+
is_changed: "is_changed",
|
|
152
|
+
is_equal: "is_equal",
|
|
153
|
+
is_not_equal: "is_not_equal",
|
|
154
|
+
is_greater_than: "is_greater_than",
|
|
155
|
+
is_less_than: "is_less_than",
|
|
156
|
+
is_between: "is_between",
|
|
157
|
+
is_empty: "is_empty",
|
|
158
|
+
is_null_or_undefined: "is_null_or_undefined",
|
|
159
|
+
is_same_type: "is_same_type",
|
|
160
|
+
deep_equal: "deep_equal",
|
|
161
|
+
shallow_equal: "shallow_equal",
|
|
162
|
+
similarity_score: "similarity_score",
|
|
163
|
+
array_intersection: "array_intersection",
|
|
164
|
+
array_union: "array_union",
|
|
165
|
+
array_difference: "array_difference",
|
|
166
|
+
},
|
|
167
|
+
[exports.ConnectorId.Utility.Geo]: {
|
|
168
|
+
calculate_distance: "calculate_distance",
|
|
169
|
+
point_in_polygon: "point_in_polygon",
|
|
170
|
+
get_bounding_box: "get_bounding_box",
|
|
171
|
+
reverse_geocode: "reverse_geocode",
|
|
172
|
+
geocode: "geocode",
|
|
173
|
+
convert_coordinates: "convert_coordinates",
|
|
174
|
+
},
|
|
175
|
+
[exports.ConnectorId.Encryption.Base64]: {
|
|
176
|
+
encode: "base64.encode",
|
|
177
|
+
decode: "base64.decode",
|
|
178
|
+
},
|
|
179
|
+
[exports.ConnectorId.Encryption.Hash]: {
|
|
180
|
+
hash: "hash",
|
|
181
|
+
md5: "hash.md5",
|
|
182
|
+
sha1: "hash.sha1",
|
|
183
|
+
sha256: "hash.sha256",
|
|
184
|
+
sha512: "hash.sha512",
|
|
185
|
+
},
|
|
186
|
+
[exports.ConnectorId.Encryption.AES]: {
|
|
187
|
+
encrypt: "aes.encrypt",
|
|
188
|
+
decrypt: "aes.decrypt",
|
|
189
|
+
generate_key: "aes.generate_key",
|
|
190
|
+
generate_iv: "aes.generate_iv",
|
|
191
|
+
},
|
|
192
|
+
[exports.ConnectorId.Encryption.RSA]: {
|
|
193
|
+
generate_keypair: "rsa.generate_keypair",
|
|
194
|
+
encrypt: "rsa.encrypt",
|
|
195
|
+
decrypt: "rsa.decrypt",
|
|
196
|
+
sign: "rsa.sign",
|
|
197
|
+
verify: "rsa.verify",
|
|
198
|
+
},
|
|
199
|
+
[exports.ConnectorId.Encryption.HMAC]: {
|
|
200
|
+
create: "hmac.create",
|
|
201
|
+
verify: "hmac.verify",
|
|
202
|
+
},
|
|
203
|
+
[exports.ConnectorId.Encryption.Password]: {
|
|
204
|
+
argon2_hash: "password.argon2_hash",
|
|
205
|
+
argon2_verify: "password.argon2_verify",
|
|
206
|
+
pbkdf2_hash: "password.pbkdf2_hash",
|
|
207
|
+
pbkdf2_verify: "password.pbkdf2_verify",
|
|
208
|
+
scrypt_hash: "password.scrypt_hash",
|
|
209
|
+
scrypt_verify: "password.scrypt_verify",
|
|
210
|
+
bcrypt_hash: "password.bcrypt_hash",
|
|
211
|
+
bcrypt_verify: "password.bcrypt_verify",
|
|
212
|
+
generate_salt: "password.generate_salt",
|
|
213
|
+
},
|
|
214
|
+
};
|
|
215
|
+
function defineCustomConnector(id, actions) {
|
|
216
|
+
return { id, actions };
|
|
217
|
+
}
|
|
218
|
+
function defineCustomConnectorFromList(id, actionList) {
|
|
219
|
+
const actions = Object.fromEntries(actionList.map((a) => [a, a]));
|
|
220
|
+
return { id, actions };
|
|
221
|
+
}
|
|
222
|
+
function defineRemoteConnectorRef(serverConnectorId, actions) {
|
|
223
|
+
return { id: serverConnectorId, actions };
|
|
224
|
+
}
|
|
225
|
+
function isTypedConnectorDef(v) {
|
|
226
|
+
return (typeof v === "object" &&
|
|
227
|
+
v !== null &&
|
|
228
|
+
"__schemas" in v &&
|
|
229
|
+
"id" in v &&
|
|
230
|
+
"actions" in v &&
|
|
231
|
+
typeof v.id === "string");
|
|
232
|
+
}
|
|
233
|
+
function isCustomConnectorDef(v) {
|
|
234
|
+
return (typeof v === "object" &&
|
|
235
|
+
v !== null &&
|
|
236
|
+
"id" in v &&
|
|
237
|
+
"actions" in v &&
|
|
238
|
+
typeof v.id === "string" &&
|
|
239
|
+
typeof v.actions === "object");
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Define a connector with fully typed actions, payloads, and responses.
|
|
243
|
+
* Use this for remote connectors where you don't have the implementation locally
|
|
244
|
+
* but want full type safety when building workflows.
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* ```ts
|
|
248
|
+
* const Paystack = defineTypedConnector("paystack", {
|
|
249
|
+
* initializeTransaction: "Initialize Transaction",
|
|
250
|
+
* verifyTransaction: "Verify Transaction",
|
|
251
|
+
* listTransactions: "List Transactions",
|
|
252
|
+
* }, {
|
|
253
|
+
* initializeTransaction: {
|
|
254
|
+
* body: {} as { email: string; amount: number; reference?: string },
|
|
255
|
+
* response: {} as { authorization_url: string; access_code: string; reference: string },
|
|
256
|
+
* },
|
|
257
|
+
* verifyTransaction: {
|
|
258
|
+
* pathParams: {} as { reference: string },
|
|
259
|
+
* response: {} as { status: string; amount: number; currency: string },
|
|
260
|
+
* },
|
|
261
|
+
* listTransactions: {
|
|
262
|
+
* params: {} as { page?: number; perPage?: number; status?: string },
|
|
263
|
+
* response: {} as { data: Array<{ reference: string; amount: number }> },
|
|
264
|
+
* },
|
|
265
|
+
* });
|
|
266
|
+
*
|
|
267
|
+
* // Full type safety:
|
|
268
|
+
* type InitBody = ConnectorBody<typeof Paystack, "initializeTransaction">;
|
|
269
|
+
* // => { email: string; amount: number; reference?: string }
|
|
270
|
+
*
|
|
271
|
+
* type VerifyResponse = ConnectorResponse<typeof Paystack, "verifyTransaction">;
|
|
272
|
+
* // => { status: string; amount: number; currency: string }
|
|
273
|
+
* ```
|
|
274
|
+
*
|
|
275
|
+
* For optional runtime checks against real HTTP JSON, give each `response` value a **concrete sample object** with the same keys and representative JavaScript types (for example `{ status: "", amount: 0, currency: "" }` instead of `{} as { ... }`). Empty objects produce no runtime shape hints; samples enable shallow key and `typeof` warnings when the mapped connector response diverges.
|
|
276
|
+
*/
|
|
277
|
+
function defineTypedConnector(id, actions, schemas) {
|
|
278
|
+
return {
|
|
279
|
+
id,
|
|
280
|
+
actions,
|
|
281
|
+
__schemas: schemas,
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
function getConnectorActions(connectorId) {
|
|
285
|
+
const actions = exports.ConnectorActions[connectorId];
|
|
286
|
+
if (!actions)
|
|
287
|
+
return [];
|
|
288
|
+
return Object.values(actions);
|
|
289
|
+
}
|
|
290
|
+
function listBuiltInConnectors() {
|
|
291
|
+
const result = [];
|
|
292
|
+
for (const [id, actionsObj] of Object.entries(exports.ConnectorActions)) {
|
|
293
|
+
result.push({
|
|
294
|
+
id,
|
|
295
|
+
category: id.includes(".") ? id.split(".")[0] : "custom",
|
|
296
|
+
actions: Object.values(actionsObj),
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
return result;
|
|
300
|
+
}
|
package/dist/decorators/build.js
CHANGED
|
@@ -1 +1,105 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildWorkflowFromClass = buildWorkflowFromClass;
|
|
4
|
+
exports.buildConnectorFromClass = buildConnectorFromClass;
|
|
5
|
+
const workflow_1 = require("../types/workflow");
|
|
6
|
+
const metadata_1 = require("./metadata");
|
|
7
|
+
function buildWorkflowFromClass(workflowClass) {
|
|
8
|
+
const meta = (0, metadata_1.getOrCreateWorkflowMeta)(workflowClass);
|
|
9
|
+
const workflowIdRaw = meta.workflowId ?? (0, metadata_1.inferWorkflowIdFromClassName)(workflowClass?.name ?? "workflow");
|
|
10
|
+
const workflowName = meta.workflowName ?? workflowIdRaw;
|
|
11
|
+
const sortedSteps = [...(meta.steps ?? [])].sort((a, b) => a.orderKey - b.orderKey);
|
|
12
|
+
const steps = [];
|
|
13
|
+
let prevMainStepId = undefined;
|
|
14
|
+
for (const s of sortedSteps) {
|
|
15
|
+
const mainId = (0, metadata_1.sanitizeStepId)(s.stepId);
|
|
16
|
+
const stage = s.stage ?? "pre";
|
|
17
|
+
const methodFn = workflowClass?.prototype?.[s.methodKey];
|
|
18
|
+
let extractedBody = undefined;
|
|
19
|
+
if (typeof methodFn === "function") {
|
|
20
|
+
const methodSource = methodFn.toString();
|
|
21
|
+
const openIdx = methodSource.indexOf("{");
|
|
22
|
+
const closeIdx = methodSource.lastIndexOf("}");
|
|
23
|
+
if (openIdx >= 0 && closeIdx > openIdx) {
|
|
24
|
+
let body = methodSource.slice(openIdx + 1, closeIdx);
|
|
25
|
+
body = body.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/.*$/gm, "").trim();
|
|
26
|
+
if (body.length > 0)
|
|
27
|
+
extractedBody = body;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
let mainStep = s.factory(mainId);
|
|
31
|
+
if (stage === "post" && extractedBody) {
|
|
32
|
+
mainStep.post_source = extractedBody;
|
|
33
|
+
}
|
|
34
|
+
mainStep = (0, metadata_1.withThenElse)(mainStep, s.then, s.else);
|
|
35
|
+
const hasPreInjection = stage === "pre" && extractedBody;
|
|
36
|
+
const preId = hasPreInjection ? `${mainId}_pre` : undefined;
|
|
37
|
+
mainStep.input_from = hasPreInjection ? preId : prevMainStepId;
|
|
38
|
+
steps.push(mainStep);
|
|
39
|
+
if (stage === "pre" && extractedBody) {
|
|
40
|
+
steps.splice(steps.length - 1, 0, {
|
|
41
|
+
id: preId,
|
|
42
|
+
type: workflow_1.WorkflowStepType.CODE,
|
|
43
|
+
source: extractedBody,
|
|
44
|
+
input_from: prevMainStepId,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
prevMainStepId = mainId;
|
|
48
|
+
}
|
|
49
|
+
const trigger = meta.trigger ?? { type: workflow_1.WorkflowTriggerType.MANUAL };
|
|
50
|
+
const workflow = {
|
|
51
|
+
_id: (0, metadata_1.sanitizeStepId)(workflowIdRaw),
|
|
52
|
+
name: workflowName,
|
|
53
|
+
trigger,
|
|
54
|
+
steps,
|
|
55
|
+
status: "active",
|
|
56
|
+
__rawId: workflowIdRaw,
|
|
57
|
+
};
|
|
58
|
+
return workflow;
|
|
59
|
+
}
|
|
60
|
+
function buildConnectorFromClass(ConnectorClass) {
|
|
61
|
+
const meta = ConnectorClass[Symbol.for("cliodot:connectorMeta")];
|
|
62
|
+
if (!meta) {
|
|
63
|
+
throw new Error(`Class ${ConnectorClass.name} is not decorated with @ConnectorClass`);
|
|
64
|
+
}
|
|
65
|
+
const actionsMap = {};
|
|
66
|
+
const endpoints = [];
|
|
67
|
+
for (const action of meta.actions) {
|
|
68
|
+
actionsMap[action.methodKey] = action.actionName;
|
|
69
|
+
if (action.type === "endpoint") {
|
|
70
|
+
endpoints.push({
|
|
71
|
+
name: action.actionName,
|
|
72
|
+
method: action.httpConfig.method,
|
|
73
|
+
path: action.httpConfig.path,
|
|
74
|
+
...action.httpConfig, // includes config object
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const instance = new ConnectorClass();
|
|
79
|
+
const connectorDef = {
|
|
80
|
+
_id: meta.connectorId,
|
|
81
|
+
id: meta.connectorId, // keeping id for backwards compatibility
|
|
82
|
+
name: meta.connectorName,
|
|
83
|
+
actions: actionsMap,
|
|
84
|
+
...meta.config, // Spread user provided config (type: "REST", base_url, auth, etc.)
|
|
85
|
+
};
|
|
86
|
+
// If endpoints are found, attach them as REST mappings natively.
|
|
87
|
+
if (endpoints.length > 0) {
|
|
88
|
+
connectorDef.endpoints = endpoints;
|
|
89
|
+
}
|
|
90
|
+
const hasCustomActions = meta.actions.some((a) => a.type === "custom");
|
|
91
|
+
if (hasCustomActions) {
|
|
92
|
+
connectorDef.execute = async (actionName, options) => {
|
|
93
|
+
const actionMeta = meta.actions.find((a) => a.actionName === actionName ||
|
|
94
|
+
a.methodKey === actionName ||
|
|
95
|
+
actionsMap[a.methodKey] === actionName);
|
|
96
|
+
if (!actionMeta)
|
|
97
|
+
throw new Error(`Action ${actionName} not found on connector ${meta.connectorId}`);
|
|
98
|
+
if (actionMeta.type === "custom") {
|
|
99
|
+
return instance[actionMeta.methodKey](options);
|
|
100
|
+
}
|
|
101
|
+
throw new Error(`Action ${actionName} is an HTTP endpoint and should be executed by the SDK runner inherently.`);
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
return connectorDef;
|
|
105
|
+
}
|
|
@@ -1 +1,56 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConnectorClass = ConnectorClass;
|
|
4
|
+
exports.ActionEndpoint = ActionEndpoint;
|
|
5
|
+
exports.ActionCustom = ActionCustom;
|
|
6
|
+
const metadata_1 = require("./metadata");
|
|
7
|
+
/**
|
|
8
|
+
* Marks a class as a Connector Definition
|
|
9
|
+
*/
|
|
10
|
+
function ConnectorClass(connectorId, connectorName, config) {
|
|
11
|
+
return function (ctor) {
|
|
12
|
+
const meta = (0, metadata_1.getOrCreateConnectorMeta)(ctor);
|
|
13
|
+
meta.connectorId = connectorId;
|
|
14
|
+
if (typeof connectorName === "object") {
|
|
15
|
+
meta.connectorName = connectorId;
|
|
16
|
+
meta.config = connectorName;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
meta.connectorName = connectorName || connectorId;
|
|
20
|
+
meta.config = config || {};
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Registers a remote HTTP execution action.
|
|
26
|
+
*/
|
|
27
|
+
function ActionEndpoint(actionName, method, path, config) {
|
|
28
|
+
return function (target, propertyKey) {
|
|
29
|
+
const ctor = target.constructor;
|
|
30
|
+
const meta = (0, metadata_1.getOrCreateConnectorMeta)(ctor);
|
|
31
|
+
meta.actions.push({
|
|
32
|
+
actionName,
|
|
33
|
+
methodKey: propertyKey,
|
|
34
|
+
type: "endpoint",
|
|
35
|
+
httpConfig: {
|
|
36
|
+
method,
|
|
37
|
+
path,
|
|
38
|
+
...config,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Registers a custom execution method locally on the class instance.
|
|
45
|
+
*/
|
|
46
|
+
function ActionCustom(actionName) {
|
|
47
|
+
return function (target, propertyKey) {
|
|
48
|
+
const ctor = target.constructor;
|
|
49
|
+
const meta = (0, metadata_1.getOrCreateConnectorMeta)(ctor);
|
|
50
|
+
meta.actions.push({
|
|
51
|
+
actionName,
|
|
52
|
+
methodKey: propertyKey,
|
|
53
|
+
type: "custom",
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
}
|
package/dist/decorators/index.js
CHANGED
|
@@ -1 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildConnectorFromClass = exports.buildWorkflowFromClass = exports.ActionCustom = exports.ActionEndpoint = exports.ConnectorClass = exports.Step = exports.Notify = exports.Delay = exports.Log = exports.Loop = exports.CallWorkflow = exports.Call = exports.Code = exports.Responder = exports.Encrypt = exports.Auth = exports.Transform = exports.Condition = exports.Validator = exports.Db = exports.Util = exports.Connector = exports.Schedule = exports.Job = exports.Webhook = exports.Http = exports.Workflow = void 0;
|
|
4
|
+
var workflow_1 = require("./workflow");
|
|
5
|
+
Object.defineProperty(exports, "Workflow", { enumerable: true, get: function () { return workflow_1.Workflow; } });
|
|
6
|
+
Object.defineProperty(exports, "Http", { enumerable: true, get: function () { return workflow_1.Http; } });
|
|
7
|
+
Object.defineProperty(exports, "Webhook", { enumerable: true, get: function () { return workflow_1.Webhook; } });
|
|
8
|
+
Object.defineProperty(exports, "Job", { enumerable: true, get: function () { return workflow_1.Job; } });
|
|
9
|
+
Object.defineProperty(exports, "Schedule", { enumerable: true, get: function () { return workflow_1.Schedule; } });
|
|
10
|
+
var steps_1 = require("./steps");
|
|
11
|
+
Object.defineProperty(exports, "Connector", { enumerable: true, get: function () { return steps_1.Connector; } });
|
|
12
|
+
Object.defineProperty(exports, "Util", { enumerable: true, get: function () { return steps_1.Util; } });
|
|
13
|
+
Object.defineProperty(exports, "Db", { enumerable: true, get: function () { return steps_1.Db; } });
|
|
14
|
+
Object.defineProperty(exports, "Validator", { enumerable: true, get: function () { return steps_1.Validator; } });
|
|
15
|
+
Object.defineProperty(exports, "Condition", { enumerable: true, get: function () { return steps_1.Condition; } });
|
|
16
|
+
Object.defineProperty(exports, "Transform", { enumerable: true, get: function () { return steps_1.Transform; } });
|
|
17
|
+
Object.defineProperty(exports, "Auth", { enumerable: true, get: function () { return steps_1.Auth; } });
|
|
18
|
+
Object.defineProperty(exports, "Encrypt", { enumerable: true, get: function () { return steps_1.Encrypt; } });
|
|
19
|
+
Object.defineProperty(exports, "Responder", { enumerable: true, get: function () { return steps_1.Responder; } });
|
|
20
|
+
Object.defineProperty(exports, "Code", { enumerable: true, get: function () { return steps_1.Code; } });
|
|
21
|
+
Object.defineProperty(exports, "Call", { enumerable: true, get: function () { return steps_1.Call; } });
|
|
22
|
+
Object.defineProperty(exports, "CallWorkflow", { enumerable: true, get: function () { return steps_1.CallWorkflow; } });
|
|
23
|
+
Object.defineProperty(exports, "Loop", { enumerable: true, get: function () { return steps_1.Loop; } });
|
|
24
|
+
Object.defineProperty(exports, "Log", { enumerable: true, get: function () { return steps_1.Log; } });
|
|
25
|
+
Object.defineProperty(exports, "Delay", { enumerable: true, get: function () { return steps_1.Delay; } });
|
|
26
|
+
Object.defineProperty(exports, "Notify", { enumerable: true, get: function () { return steps_1.Notify; } });
|
|
27
|
+
Object.defineProperty(exports, "Step", { enumerable: true, get: function () { return steps_1.Step; } });
|
|
28
|
+
var connector_1 = require("./connector");
|
|
29
|
+
Object.defineProperty(exports, "ConnectorClass", { enumerable: true, get: function () { return connector_1.ConnectorClass; } });
|
|
30
|
+
Object.defineProperty(exports, "ActionEndpoint", { enumerable: true, get: function () { return connector_1.ActionEndpoint; } });
|
|
31
|
+
Object.defineProperty(exports, "ActionCustom", { enumerable: true, get: function () { return connector_1.ActionCustom; } });
|
|
32
|
+
var build_1 = require("./build");
|
|
33
|
+
Object.defineProperty(exports, "buildWorkflowFromClass", { enumerable: true, get: function () { return build_1.buildWorkflowFromClass; } });
|
|
34
|
+
Object.defineProperty(exports, "buildConnectorFromClass", { enumerable: true, get: function () { return build_1.buildConnectorFromClass; } });
|