cliodot 1.2.3 → 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 +2 -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 +50 -9
- package/dist/CommercialAppClient.d.ts.map +1 -1
- package/dist/CommercialAppClient.js +576 -1
- 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 +1 -0
- package/dist/IdentityAppClient.d.ts.map +1 -1
- package/dist/IdentityAppClient.js +197 -1
- package/dist/MemoryAppClient.d.ts +1 -0
- package/dist/MemoryAppClient.d.ts.map +1 -1
- package/dist/MemoryAppClient.js +149 -1
- package/dist/MemoryClient.js +20 -1
- 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.js +61 -1
- 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.js +232 -1
- 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.js +174 -1
- package/dist/identity-token-cache.js +51 -1
- package/dist/index.d.ts +1 -1
- 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 +407 -11
- package/dist/types/commercial-app.api.d.ts.map +1 -1
- package/dist/types/commercial-app.api.js +2 -1
- 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 +2 -0
- package/dist/types/identity-app.api.d.ts.map +1 -1
- package/dist/types/identity-app.api.js +2 -1
- package/dist/types/index.js +23 -1
- package/dist/types/memory-app.api.d.ts +2 -0
- package/dist/types/memory-app.api.d.ts.map +1 -1
- package/dist/types/memory-app.api.js +2 -1
- 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.js +2 -1
- 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 _0x1d9f35=_0x36ab;(function(_0xf2e805,_0xcea8fa){const _0x4a07f3=_0x36ab,_0x364db6=_0xf2e805();while(!![]){try{const _0x592af6=parseInt(_0x4a07f3(0x24d))/0x1*(-parseInt(_0x4a07f3(0x214))/0x2)+-parseInt(_0x4a07f3(0x225))/0x3*(parseInt(_0x4a07f3(0x1eb))/0x4)+parseInt(_0x4a07f3(0x203))/0x5+-parseInt(_0x4a07f3(0x24f))/0x6+-parseInt(_0x4a07f3(0x2af))/0x7*(parseInt(_0x4a07f3(0x1d1))/0x8)+-parseInt(_0x4a07f3(0x22a))/0x9*(parseInt(_0x4a07f3(0x20c))/0xa)+-parseInt(_0x4a07f3(0x1cd))/0xb*(-parseInt(_0x4a07f3(0x2ab))/0xc);if(_0x592af6===_0xcea8fa)break;else _0x364db6['push'](_0x364db6['shift']());}catch(_0x2baf0e){_0x364db6['push'](_0x364db6['shift']());}}}(_0x4df6,0xe4d31));Object[_0x1d9f35(0x228)](exports,'__esModule',{'value':!![]}),exports[_0x1d9f35(0x1d8)]=exports['ConnectorId']=void 0x0,exports[_0x1d9f35(0x1df)]=defineCustomConnector,exports[_0x1d9f35(0x1f6)]=defineCustomConnectorFromList,exports['defineRemoteConnectorRef']=defineRemoteConnectorRef,exports['isTypedConnectorDef']=isTypedConnectorDef,exports[_0x1d9f35(0x224)]=isCustomConnectorDef,exports['defineTypedConnector']=defineTypedConnector,exports['getConnectorActions']=getConnectorActions,exports[_0x1d9f35(0x273)]=listBuiltInConnectors,exports[_0x1d9f35(0x24a)]={'Database':{'MongoDB':_0x1d9f35(0x1ec),'MySQL':_0x1d9f35(0x252),'PostgreSQL':_0x1d9f35(0x21e),'Redis':_0x1d9f35(0x29e)},'Auth':{'Bearer':_0x1d9f35(0x238),'ApiKey':_0x1d9f35(0x227),'Basic':'basic.system','CustomHeader':_0x1d9f35(0x1fc)},'Utility':{'DateTime':_0x1d9f35(0x1db),'String':_0x1d9f35(0x284),'Random':_0x1d9f35(0x1ff),'Math':_0x1d9f35(0x1fa),'Compare':'utility.compare','Geo':'utility.geo'},'Encryption':{'Base64':_0x1d9f35(0x23c),'Hash':_0x1d9f35(0x1e0),'AES':'aes.encryption','RSA':'rsa.encryption','HMAC':_0x1d9f35(0x21a),'Password':_0x1d9f35(0x229)},'Responder':{'Json':_0x1d9f35(0x22e)},'Condition':{'Logic':'condition.logic'},'Cliodot':'cliodot'},exports[_0x1d9f35(0x1d8)]={[exports[_0x1d9f35(0x24a)][_0x1d9f35(0x255)]['MongoDB']]:{'insertOne':_0x1d9f35(0x219),'insertMany':_0x1d9f35(0x257),'findOne':_0x1d9f35(0x201),'find':_0x1d9f35(0x1dc),'updateOne':_0x1d9f35(0x1d7),'deleteOne':'deleteOne'},[exports['ConnectorId'][_0x1d9f35(0x255)]['MySQL']]:{'query':_0x1d9f35(0x294)},[exports[_0x1d9f35(0x24a)][_0x1d9f35(0x255)][_0x1d9f35(0x28b)]]:{'query':'query'},[exports[_0x1d9f35(0x24a)][_0x1d9f35(0x255)]['Redis']]:{'get':_0x1d9f35(0x1e1),'set':_0x1d9f35(0x206),'delete':'redis.delete','hset':'redis.hset','hget':_0x1d9f35(0x24e),'lpush':'redis.lpush','lpop':_0x1d9f35(0x1d4),'zadd':_0x1d9f35(0x297),'create_hash':'redis.create_hash','delete_key':_0x1d9f35(0x290)},[exports[_0x1d9f35(0x24a)][_0x1d9f35(0x22f)][_0x1d9f35(0x261)]]:{'bearer_create':_0x1d9f35(0x1e8),'bearer_validate':_0x1d9f35(0x234),'create':_0x1d9f35(0x2a4),'validate':_0x1d9f35(0x2a8)},[exports[_0x1d9f35(0x24a)][_0x1d9f35(0x22f)][_0x1d9f35(0x1f3)]]:{'api_key_create':_0x1d9f35(0x209),'api_key_validate':'api_key.validate','create':_0x1d9f35(0x2a4),'validate':_0x1d9f35(0x2a8)},[exports[_0x1d9f35(0x24a)][_0x1d9f35(0x22f)][_0x1d9f35(0x226)]]:{'basic_create':'basic.create','basic_validate':'basic.validate','create':_0x1d9f35(0x2a4),'validate':_0x1d9f35(0x2a8)},[exports[_0x1d9f35(0x24a)][_0x1d9f35(0x22f)][_0x1d9f35(0x29d)]]:{'custom_header_create':_0x1d9f35(0x26f),'custom_header_validate':'custom_header.validate','create':_0x1d9f35(0x2a4),'validate':_0x1d9f35(0x2a8)},[exports[_0x1d9f35(0x24a)][_0x1d9f35(0x1ce)][_0x1d9f35(0x1d6)]]:{'get_current_date':_0x1d9f35(0x259),'get_current_time':_0x1d9f35(0x269),'get_current_datetime':_0x1d9f35(0x2b2),'format':_0x1d9f35(0x256),'format_date':'format_date','parse_date':'parse_date','add_time':_0x1d9f35(0x2a1),'subtract_time':'subtract_time','diff_between_dates':_0x1d9f35(0x1cc),'start_of_day':_0x1d9f35(0x296),'end_of_day':'end_of_day','start_of_week':_0x1d9f35(0x2ad),'end_of_week':'end_of_week','start_of_month':'start_of_month','end_of_month':_0x1d9f35(0x20f),'start_of_year':_0x1d9f35(0x1d9),'end_of_year':'end_of_year','convert_timezone':_0x1d9f35(0x275),'get_timezone':_0x1d9f35(0x216),'list_timezones':'list_timezones','is_leap_year':'is_leap_year','get_unix_timestamp':_0x1d9f35(0x233),'from_unix_timestamp':_0x1d9f35(0x22c)},[exports[_0x1d9f35(0x24a)][_0x1d9f35(0x1ce)][_0x1d9f35(0x2aa)]]:{'concat':'concat','split':_0x1d9f35(0x2a0),'join':_0x1d9f35(0x1f0),'replace':'replace','replace_all':_0x1d9f35(0x264),'trim':_0x1d9f35(0x20b),'trim_start':_0x1d9f35(0x1d5),'trim_end':'trim_end','to_uppercase':_0x1d9f35(0x26a),'to_lowercase':_0x1d9f35(0x1dd),'capitalize':'capitalize','substring':_0x1d9f35(0x299),'length':_0x1d9f35(0x215),'contains':_0x1d9f35(0x27a),'starts_with':_0x1d9f35(0x267),'ends_with':_0x1d9f35(0x1ed),'remove_whitespace':_0x1d9f35(0x298),'slugify':_0x1d9f35(0x262),'pad_start':_0x1d9f35(0x211),'pad_end':_0x1d9f35(0x1de),'reverse':'reverse','encode_base64':_0x1d9f35(0x1e7),'decode_base64':_0x1d9f35(0x28c),'encode_uri':'encode_uri','decode_uri':_0x1d9f35(0x235),'after':_0x1d9f35(0x29c),'after_last':_0x1d9f35(0x242),'before':_0x1d9f35(0x1fd),'before_last':_0x1d9f35(0x25f),'between':'between','between_first':'between_first','camel':_0x1d9f35(0x292),'char_at':_0x1d9f35(0x25c),'chop_start':_0x1d9f35(0x20e),'chop_end':'chop_end','contains_all':'contains_all','doesnt_contain':'doesnt_contain','doesnt_start_with':_0x1d9f35(0x23e),'doesnt_end_with':_0x1d9f35(0x220),'deduplicate':'deduplicate','excerpt':_0x1d9f35(0x286),'finish':_0x1d9f35(0x279),'start':'start','headline':_0x1d9f35(0x1ee),'is':'is','is_ascii':_0x1d9f35(0x23b),'is_json':'is_json','is_ulid':_0x1d9f35(0x263),'is_url':_0x1d9f35(0x29f),'is_uuid':_0x1d9f35(0x28e),'is_empty':_0x1d9f35(0x20a),'is_match':_0x1d9f35(0x243),'kebab':_0x1d9f35(0x245),'snake':_0x1d9f35(0x281),'studly':'studly','title':_0x1d9f35(0x26b),'lcfirst':_0x1d9f35(0x200),'ucfirst':_0x1d9f35(0x221),'ucwords':_0x1d9f35(0x23d),'ucsplit':_0x1d9f35(0x29a),'limit':_0x1d9f35(0x244),'mask':_0x1d9f35(0x2a9),'match':_0x1d9f35(0x26e),'match_all':_0x1d9f35(0x24c),'pad_both':_0x1d9f35(0x25b),'plural':_0x1d9f35(0x20d),'singular':'singular','position':_0x1d9f35(0x28f),'random':_0x1d9f35(0x25d),'remove':_0x1d9f35(0x1cf),'repeat':_0x1d9f35(0x2b3),'replace_array':_0x1d9f35(0x29b),'replace_first':_0x1d9f35(0x251),'replace_last':_0x1d9f35(0x1e9),'replace_matches':_0x1d9f35(0x288),'replace_start':'replace_start','replace_end':_0x1d9f35(0x2a5),'squish':_0x1d9f35(0x1f1),'substr':_0x1d9f35(0x21f),'substr_count':'substr_count','substr_replace':_0x1d9f35(0x247),'swap':'swap','take':_0x1d9f35(0x283),'word_count':_0x1d9f35(0x230),'word_wrap':_0x1d9f35(0x289),'words':_0x1d9f35(0x278),'wrap':_0x1d9f35(0x208),'unwrap':_0x1d9f35(0x254),'uuid':_0x1d9f35(0x1da),'ulid':_0x1d9f35(0x293),'strip_tags':_0x1d9f35(0x210),'ascii':_0x1d9f35(0x272),'apa':'apa','class_basename':'class_basename'},[exports[_0x1d9f35(0x24a)][_0x1d9f35(0x1ce)][_0x1d9f35(0x202)]]:{'random_int':'random_int','random_float':_0x1d9f35(0x268),'random_string':_0x1d9f35(0x271),'random_uuid':_0x1d9f35(0x1f2),'uuid':'uuid','random_boolean':_0x1d9f35(0x2a2),'random_choice':_0x1d9f35(0x21d),'random_password':_0x1d9f35(0x265),'random_hex':_0x1d9f35(0x1fb),'random_alphanumeric':'random_alphanumeric','random_date':_0x1d9f35(0x258),'random_color':_0x1d9f35(0x28d),'shuffle_array':_0x1d9f35(0x285)},[exports['ConnectorId'][_0x1d9f35(0x1ce)][_0x1d9f35(0x1fe)]]:{'add':_0x1d9f35(0x280),'subtract':'subtract','multiply':_0x1d9f35(0x27f),'divide':_0x1d9f35(0x241),'modulo':_0x1d9f35(0x231),'power':_0x1d9f35(0x287),'round':'round','floor':_0x1d9f35(0x1d3),'ceil':_0x1d9f35(0x2b1),'abs':_0x1d9f35(0x1ef),'min':'min','max':'max','average':'average','sum':_0x1d9f35(0x28a),'clamp':_0x1d9f35(0x223),'random_between':_0x1d9f35(0x274),'percentage':_0x1d9f35(0x1ea),'percentage_of':'percentage_of','sqrt':'sqrt','log':_0x1d9f35(0x217)},[exports[_0x1d9f35(0x24a)][_0x1d9f35(0x1ce)]['Compare']]:{'diff_objects':_0x1d9f35(0x27c),'diff_arrays':_0x1d9f35(0x295),'compare_strings':_0x1d9f35(0x25a),'compare_numbers':_0x1d9f35(0x249),'compare_dates':_0x1d9f35(0x260),'is_changed':_0x1d9f35(0x246),'is_equal':'is_equal','is_not_equal':_0x1d9f35(0x23a),'is_greater_than':_0x1d9f35(0x270),'is_less_than':'is_less_than','is_between':'is_between','is_empty':_0x1d9f35(0x20a),'is_null_or_undefined':_0x1d9f35(0x253),'is_same_type':'is_same_type','deep_equal':_0x1d9f35(0x2ae),'shallow_equal':_0x1d9f35(0x248),'similarity_score':_0x1d9f35(0x237),'array_intersection':_0x1d9f35(0x1e3),'array_union':_0x1d9f35(0x1d0),'array_difference':_0x1d9f35(0x2a3)},[exports[_0x1d9f35(0x24a)][_0x1d9f35(0x1ce)][_0x1d9f35(0x22d)]]:{'calculate_distance':_0x1d9f35(0x27d),'point_in_polygon':'point_in_polygon','get_bounding_box':'get_bounding_box','reverse_geocode':_0x1d9f35(0x23f),'geocode':_0x1d9f35(0x27e),'convert_coordinates':_0x1d9f35(0x25e)},[exports['ConnectorId'][_0x1d9f35(0x2ac)][_0x1d9f35(0x1d2)]]:{'encode':_0x1d9f35(0x239),'decode':_0x1d9f35(0x21b)},[exports['ConnectorId'][_0x1d9f35(0x2ac)][_0x1d9f35(0x2a6)]]:{'hash':_0x1d9f35(0x236),'md5':_0x1d9f35(0x1f8),'sha1':_0x1d9f35(0x1e6),'sha256':'hash.sha256','sha512':_0x1d9f35(0x1f7)},[exports[_0x1d9f35(0x24a)][_0x1d9f35(0x2ac)][_0x1d9f35(0x212)]]:{'encrypt':_0x1d9f35(0x1e4),'decrypt':'aes.decrypt','generate_key':_0x1d9f35(0x1e2),'generate_iv':_0x1d9f35(0x232)},[exports['ConnectorId'][_0x1d9f35(0x2ac)][_0x1d9f35(0x27b)]]:{'generate_keypair':_0x1d9f35(0x277),'encrypt':_0x1d9f35(0x291),'decrypt':'rsa.decrypt','sign':_0x1d9f35(0x204),'verify':_0x1d9f35(0x22b)},[exports[_0x1d9f35(0x24a)]['Encryption'][_0x1d9f35(0x266)]]:{'create':_0x1d9f35(0x1f5),'verify':_0x1d9f35(0x24b)},[exports[_0x1d9f35(0x24a)][_0x1d9f35(0x2ac)][_0x1d9f35(0x1cb)]]:{'argon2_hash':_0x1d9f35(0x2b0),'argon2_verify':_0x1d9f35(0x205),'pbkdf2_hash':_0x1d9f35(0x26c),'pbkdf2_verify':_0x1d9f35(0x26d),'scrypt_hash':_0x1d9f35(0x213),'scrypt_verify':_0x1d9f35(0x218),'bcrypt_hash':_0x1d9f35(0x1f9),'bcrypt_verify':'password.bcrypt_verify','generate_salt':_0x1d9f35(0x240)}};function defineCustomConnector(_0x2f30b7,_0x3881ac){return{'id':_0x2f30b7,'actions':_0x3881ac};}function defineCustomConnectorFromList(_0x2fd629,_0x43cbd6){const _0x26a996=_0x1d9f35,_0x4fef3f=Object[_0x26a996(0x207)](_0x43cbd6[_0x26a996(0x282)](_0x25de90=>[_0x25de90,_0x25de90]));return{'id':_0x2fd629,'actions':_0x4fef3f};}function defineRemoteConnectorRef(_0x537cff,_0x106ffd){return{'id':_0x537cff,'actions':_0x106ffd};}function isTypedConnectorDef(_0x211b17){const _0x2a1fe8=_0x1d9f35;return typeof _0x211b17===_0x2a1fe8(0x276)&&_0x211b17!==null&&_0x2a1fe8(0x1e5)in _0x211b17&&'id'in _0x211b17&&_0x2a1fe8(0x1f4)in _0x211b17&&typeof _0x211b17['id']==='string';}function isCustomConnectorDef(_0x412aa1){const _0x4f6b6c=_0x1d9f35;return typeof _0x412aa1===_0x4f6b6c(0x276)&&_0x412aa1!==null&&'id'in _0x412aa1&&_0x4f6b6c(0x1f4)in _0x412aa1&&typeof _0x412aa1['id']===_0x4f6b6c(0x250)&&typeof _0x412aa1[_0x4f6b6c(0x1f4)]==='object';}function _0x4df6(){const _0x2ae59a=['A2vIywi','AxnFy2HHBMDLza','C3vIC3rYx3jLCgXHy2u','C2HHBgXVD19LCxvHBa','y29TCgfYzv9UDw1IzxjZ','q29UBMvJDg9Yswq','Ag1HyY52zxjPzNK','Bwf0y2HFywXS','mNrtqwfNsG','CMvKAxmUAgDLDa','mteWntu1nZbKsM1iC1K','C3rYAw5N','CMvWBgfJzv9MAxjZDa','BxLZCwWUC3LZDgvT','AxnFBNvSBf9VCL91BMrLzMLUzwq','Dw53CMfW','rgf0ywjHC2u','zM9YBwf0','Aw5Zzxj0twfUEq','CMfUzg9Tx2rHDgu','z2v0x2n1CNjLBNrFzgf0zq','y29TCgfYzv9ZDhjPBMDZ','CgfKx2jVDgG','y2HHCL9HDa','CMfUzg9T','y29UDMvYDf9JB29YzgLUyxrLCW','yMvMB3jLx2XHC3q','y29TCgfYzv9KyxrLCW','qMvHCMvY','C2X1z2LMEq','AxnFDwXPza','CMvWBgfJzv9HBgW','CMfUzg9Tx3bHC3n3B3jK','se1bqW','C3rHCNrZx3DPDgG','CMfUzg9Tx2zSB2f0','z2v0x2n1CNjLBNrFDgLTzq','Dg9FDxbWzxjJyxnL','DgL0Bgu','CgfZC3DVCMqUCgjRzgyYx2HHC2G','CgfZC3DVCMqUCgjRzgyYx3zLCMLMEq','Bwf0y2G','y3vZDg9Tx2HLywrLCI5JCMvHDgu','AxnFz3jLyxrLCL90AgfU','CMfUzg9Tx3n0CMLUzW','yxnJAwK','BgLZDej1AwX0sw5dB25Uzwn0B3jZ','CMfUzg9Tx2jLDhDLzw4','y29UDMvYDf90Aw1LEM9Uzq','B2jQzwn0','CNnHlMDLBMvYyxrLx2TLExbHAxi','D29Yzhm','zMLUAxnO','y29UDgfPBNm','uLnb','zgLMzL9VyMPLy3rZ','y2fSy3vSyxrLx2rPC3rHBMnL','z2vVy29Kzq','BxvSDgLWBhK','ywrK','C25HA2u','BwfW','DgfRzq','DxrPBgL0Es5ZDhjPBMC','C2H1zMzSzv9HCNjHEq','zxHJzxjWDa','Cg93zxi','CMvWBgfJzv9TyxrJAgvZ','D29Yzf93CMfW','C3vT','ug9ZDgDYzvnrta','zgvJB2rLx2jHC2u2na','CMfUzg9Tx2nVBg9Y','AxnFDxvPza','Cg9ZAxrPB24','CMvKAxmUzgvSzxrLx2TLEq','CNnHlMvUy3j5Chq','y2fTzwW','DwXPza','CxvLCNK','zgLMzL9HCNjHExm','C3rHCNrFB2zFzgf5','CMvKAxmUEMfKza','CMvTB3zLx3DOAxrLC3bHy2u','C3vIC3rYAw5N','DwnZCgXPDa','CMvWBgfJzv9HCNjHEq','ywz0zxi','q3vZDg9TsgvHzgvY','CMvKAxmUC3LZDgvT','AxnFDxjS','C3bSAxq','ywrKx3rPBwu','CMfUzg9Tx2jVB2XLyw4','yxjYyxLFzgLMzMvYzw5Jzq','y3jLyxrL','CMvWBgfJzv9LBMq','sgfZAa','Aw5JBhvKzxm','DMfSAwrHDgu','BwfZAW','u3rYAw5N','mtmYuxfcuhbp','rw5JCNLWDgLVBG','C3rHCNrFB2zFD2vLAW','zgvLCf9LCxvHBa','n1r0wvHIvG','CgfZC3DVCMqUyxjNB24Yx2HHC2G','y2vPBa','z2v0x2n1CNjLBNrFzgf0zxrPBwu','CMvWzwf0','ugfZC3DVCMq','zgLMzL9Izxr3zwvUx2rHDgvZ','nteXndi5nLjeq2fLDq','vxrPBgL0Eq','CMvTB3zL','yxjYyxLFDw5PB24','nJy0nZi4og5orfz0va','qMfZzty0','zMXVB3i','CMvKAxmUBhbVCa','DhjPBv9ZDgfYDa','rgf0zvrPBwu','DxbKyxrLt25L','q29UBMvJDg9Yqwn0Aw9UCW','C3rHCNrFB2zFEwvHCG','DxvPza','DxrPBgL0Es5KyxrLx3rPBwu','zMLUza','Dg9FBg93zxjJyxnL','CgfKx2vUza','zgvMAw5Lq3vZDg9Tq29UBMvJDg9Y','AgfZAc5LBMnYExb0Aw9U','CMvKAxmUz2v0','ywvZlMDLBMvYyxrLx2TLEq','yxjYyxLFAw50zxjZzwn0Aw9U','ywvZlMvUy3j5Chq','x19Zy2HLBwfZ','AgfZAc5ZAgeX','zw5JB2rLx2jHC2u2na','yMvHCMvYlMnYzwf0zq','CMvWBgfJzv9Syxn0','CgvYy2vUDgfNzq','nejNAvHqyq','Bw9Uz29KyI5ZExn0zw0','zw5KC193AxrO','AgvHzgXPBMu','ywjZ','AM9PBG','C3f1AxnO','CMfUzg9Tx3v1Awq','qxbPs2v5','ywn0Aw9UCW','Ag1HyY5JCMvHDgu','zgvMAw5Lq3vZDg9Tq29UBMvJDg9YrNjVBuXPC3q','AgfZAc5ZAge1mti','AgfZAc5Tzdu','CgfZC3DVCMqUyMnYExb0x2HHC2G','DxrPBgL0Es5TyxrO','CMfUzg9Tx2HLEa','y3vZDg9Tx2HLywrLCI5ZExn0zw0','yMvMB3jL','twf0Aa','DxrPBgL0Es5Yyw5KB20','BgnMAxjZDa','zMLUze9Uzq','uMfUzg9T','nZu3odm2mhLruvnZAW','CNnHlNnPz24','CgfZC3DVCMqUyxjNB24Yx3zLCMLMEq','CMvKAxmUC2v0','zNjVBuvUDhjPzxm','D3jHCa','yxbPx2TLEs5JCMvHDgu','AxnFzw1WDhK','DhjPBq','mZbgugnNs3C','CgX1CMfS','y2HVCf9ZDgfYDa','zw5Kx29Mx21VBNrO','C3rYAxbFDgfNCW','CgfKx3n0yxj0','quvt','CgfZC3DVCMqUC2nYExb0x2HHC2G','odi3otqYwKHLuLDw','BgvUz3rO','z2v0x3rPBwv6B25L','Bg9N','CgfZC3DVCMqUC2nYExb0x3zLCMLMEq','Aw5Zzxj0t25L','Ag1HyY5LBMnYExb0Aw9U','yMfZzty0lMrLy29Kzq','zw50CMLLCW','CMfUzg9Tx2nOB2LJzq','Cg9ZDgDYzxmUC3LZDgvT','C3vIC3rY','zg9LC250x2vUzf93AxrO','DwnMAxjZDa','DMfSDwvZ','y2XHBxa','AxndDxn0B21dB25Uzwn0B3jezwy','ndGYnJG1nKDgEMfXuW','qMfZAwm','yxbPx2TLEs5ZExn0zw0','zgvMAw5LuhjVCgvYDhK','CgfZC3DVCMqUzw5JCNLWDgLVBG','mtC0nJKWoxniCNvVtq','CNnHlNzLCMLMEq','zNjVBv91BML4x3rPBwvZDgfTCa','r2vV','ANnVBI5YzxnWB25Kzxi','qxv0Aa','D29Yzf9JB3vUDa','Bw9KDwXV','ywvZlMDLBMvYyxrLx2L2','z2v0x3vUAxHFDgLTzxn0yw1W','yMvHCMvYlNzHBgLKyxrL','zgvJB2rLx3vYAq','AgfZAa','C2LTAwXHCML0Ev9Zy29Yzq','yMvHCMvYlNn5C3rLBq','yMfZzty0lMvUy29Kzq','AxnFBM90x2vXDwfS','AxnFyxnJAwK','yMfZzty0lMvUy3j5ChrPB24','Dwn3B3jKCW','zg9LC250x3n0yxj0x3DPDgG','CMv2zxjZzv9Nzw9JB2rL','CgfZC3DVCMqUz2vUzxjHDgvFC2fSDa','zgL2AwrL','ywz0zxjFBgfZDa','AxnFBwf0y2G','BgLTAxq'];_0x4df6=function(){return _0x2ae59a;};return _0x4df6();}function _0x36ab(_0x443ddd,_0x1f224d){_0x443ddd=_0x443ddd-0x1cb;const _0x4df6f0=_0x4df6();let _0x36ab39=_0x4df6f0[_0x443ddd];if(_0x36ab['kNVgPy']===undefined){var _0x35ae83=function(_0x480031){const _0x142d54='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2f30b7='',_0x3881ac='';for(let _0x2fd629=0x0,_0x43cbd6,_0x4fef3f,_0x25de90=0x0;_0x4fef3f=_0x480031['charAt'](_0x25de90++);~_0x4fef3f&&(_0x43cbd6=_0x2fd629%0x4?_0x43cbd6*0x40+_0x4fef3f:_0x4fef3f,_0x2fd629++%0x4)?_0x2f30b7+=String['fromCharCode'](0xff&_0x43cbd6>>(-0x2*_0x2fd629&0x6)):0x0){_0x4fef3f=_0x142d54['indexOf'](_0x4fef3f);}for(let _0x537cff=0x0,_0x106ffd=_0x2f30b7['length'];_0x537cff<_0x106ffd;_0x537cff++){_0x3881ac+='%'+('00'+_0x2f30b7['charCodeAt'](_0x537cff)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3881ac);};_0x36ab['fxvsSQ']=_0x35ae83,_0x36ab['PgFHka']={},_0x36ab['kNVgPy']=!![];}const _0xc8077d=_0x4df6f0[0x0],_0x47af26=_0x443ddd+_0xc8077d,_0xece161=_0x36ab['PgFHka'][_0x47af26];return!_0xece161?(_0x36ab39=_0x36ab['fxvsSQ'](_0x36ab39),_0x36ab['PgFHka'][_0x47af26]=_0x36ab39):_0x36ab39=_0xece161,_0x36ab39;}function defineTypedConnector(_0xa8dfaf,_0x2a7c40,_0x4237d4){return{'id':_0xa8dfaf,'actions':_0x2a7c40,'__schemas':_0x4237d4};}function getConnectorActions(_0x5a72c3){const _0x3d6a7e=_0x1d9f35,_0x17410e=exports[_0x3d6a7e(0x1d8)][_0x5a72c3];if(!_0x17410e)return[];return Object[_0x3d6a7e(0x222)](_0x17410e);}function listBuiltInConnectors(){const _0x418c62=_0x1d9f35,_0x19aceb=[];for(const [_0x30075b,_0x2e66ec]of Object[_0x418c62(0x21c)](exports[_0x418c62(0x1d8)])){_0x19aceb['push']({'id':_0x30075b,'category':_0x30075b[_0x418c62(0x2a7)]('.')?_0x30075b[_0x418c62(0x2a0)]('.')[0x0]:'custom','actions':Object[_0x418c62(0x222)](_0x2e66ec)});}return _0x19aceb;}
|
|
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; } });
|