@skedulo/pulse-solution-services 0.0.22 → 0.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +147 -0
  2. package/dist/clients/index.js +1 -1
  3. package/dist/clients/rap-client.js +1 -0
  4. package/dist/constants/tenant-endpoints.js +1 -1
  5. package/dist/core/execution-context.js +1 -1
  6. package/dist/index.d.ts +131 -0
  7. package/dist/interfaces/index.js +1 -1
  8. package/dist/interfaces/rap.js +1 -0
  9. package/dist/logging/decorators/index.d.ts +1 -0
  10. package/dist/logging/decorators/log-method.d.ts +7 -0
  11. package/dist/monitoring/decorators/monitor-call.d.ts +6 -0
  12. package/dist/services/cache/cache-service.d.ts +70 -0
  13. package/dist/services/cache/index.d.ts +1 -0
  14. package/dist/services/cache/storage/config-var-cache-storage.d.ts +40 -0
  15. package/dist/services/cache/storage/in-memory-cache-storage.d.ts +32 -0
  16. package/dist/services/cache/storage/index.d.ts +2 -0
  17. package/dist/services/graph-batch/configs/graph-batch-config.d.ts +18 -0
  18. package/dist/services/graph-batch/configs/unique-graph-batch-config.d.ts +16 -0
  19. package/dist/services/graph-batch/graph-batch.d.ts +56 -0
  20. package/dist/services/graph-batch/index.d.ts +5 -0
  21. package/dist/services/graph-batch/pagination-strategy.d.ts +5 -0
  22. package/dist/services/graph-batch/unique-graph-batch.d.ts +28 -0
  23. package/dist/services/graphql/graphql-query-builder.d.ts +93 -0
  24. package/dist/services/graphql/graphql-query-builder.js +1 -1
  25. package/dist/services/graphql/graphql-service.d.ts +106 -0
  26. package/dist/services/graphql/index.d.ts +2 -0
  27. package/dist/services/graphql/queries.d.ts +20 -0
  28. package/dist/services/graphql/queries.js +1 -1
  29. package/dist/services/graphql/queries.test.d.ts +1 -0
  30. package/dist/services/graphql/queries.test.js +1 -1
  31. package/dist/services/index.js +1 -1
  32. package/dist/services/rap-service.js +1 -0
  33. package/dist/services/resource-availability/builder/data-service.d.ts +10 -0
  34. package/dist/services/resource-availability/builder/index.d.ts +3 -0
  35. package/dist/services/resource-availability/builder/resource-availability-service.d.ts +8 -0
  36. package/dist/services/resource-availability/builder/resource-builder.d.ts +17 -0
  37. package/dist/services/resource-availability/builder/resource-query-param.d.ts +23 -0
  38. package/dist/services/resource-availability/index.d.ts +2 -0
  39. package/dist/services/resource-availability/validator/index.d.ts +4 -0
  40. package/dist/services/resource-availability/validator/resource-job-validation.d.ts +11 -0
  41. package/dist/services/resource-availability/validator/resource-validation-option.d.ts +5 -0
  42. package/dist/services/resource-availability/validator/resource-validator.d.ts +13 -0
  43. package/dist/services/resource-availability/validator/validation-result.d.ts +12 -0
  44. package/package.json +4 -3
package/README.md CHANGED
@@ -18,6 +18,8 @@
18
18
  - [Availability API Client](#availability-api-client)
19
19
  - [Files API Client](#files-api-client)
20
20
  - [Artifact Client](#artifact-client)
21
+ - [RAP Client](#rap-client)
22
+ - [RAP Service](#rap-service)
21
23
  - [GraphQL Service](#graphql-service)
22
24
  - [Query Data](#query-data)
23
25
  - [Query by Pages](#query-by-pages)
@@ -534,6 +536,151 @@ await client.delete(
534
536
  );
535
537
  ```
536
538
 
539
+ #### RAP Client
540
+ Manages Record Access Policies (RAP) for row-level security via the `/authorization/policies` endpoints.
541
+
542
+ **Policies**
543
+ ```javascript
544
+ // Get all policies
545
+ const policies: RapPolicy[] = await context.rapClient.getPolicies();
546
+
547
+ // Get a single policy by ID
548
+ const policy: RapPolicy = await context.rapClient.getPolicy('<policy_id>');
549
+
550
+ // Create a new policy
551
+ const newPolicy: RapPolicy = await context.rapClient.createPolicy({
552
+ name: "Data isolation by region",
553
+ description: "Any data related to a region is isolated based on the user's regions",
554
+ enabled: true
555
+ });
556
+
557
+ // Create a policy with inline rules
558
+ const policyWithRules: RapPolicy = await context.rapClient.createPolicy({
559
+ name: "Resource data isolation",
560
+ description: "Resources can only see their own data",
561
+ enabled: true,
562
+ rules: [
563
+ {
564
+ policyId: "", // Auto-assigned by the API when rules are created inline
565
+ description: "Resource: Only Jobs I'm allocated to",
566
+ objectType: "Jobs",
567
+ filter: "UID IN (SELECT JobId FROM JobAllocations WHERE ResourceId == '{{resourceId}}' AND Status != 'Declined' AND Status != 'Deleted')",
568
+ accessType: "deny",
569
+ permissionsExcluded: ["skedulo.tenant.schedule.allocation.dispatch"]
570
+ }
571
+ ]
572
+ });
573
+
574
+ // Update (replace) a policy
575
+ const updatedPolicy: RapPolicy = await context.rapClient.updatePolicy('<policy_id>', {
576
+ name: "Data isolation by region",
577
+ description: "Updated description",
578
+ enabled: false
579
+ });
580
+
581
+ // Delete a policy
582
+ await context.rapClient.deletePolicy('<policy_id>');
583
+ ```
584
+
585
+ **Rules**
586
+ ```javascript
587
+ // Create a rule linked to a policy
588
+ const rule: RapRule = await context.rapClient.createRule({
589
+ policyId: "<policy_id>",
590
+ description: "Resource: Only Jobs I'm allocated to",
591
+ objectType: "Jobs",
592
+ filter: "UID IN (SELECT JobId FROM JobAllocations WHERE ResourceId == '{{resourceId}}' AND Status != 'Declined' AND Status != 'Deleted')",
593
+ accessType: "deny",
594
+ permissionsExcluded: ["skedulo.tenant.schedule.allocation.dispatch"]
595
+ });
596
+
597
+ // Create a pattern-based rule (applies to all objects with a Region lookup)
598
+ const patternRule: RapRule = await context.rapClient.createRule({
599
+ policyId: "<policy_id>",
600
+ description: "Pattern: Only objects for regions the user has access to",
601
+ objectType: "hasLookup:Region",
602
+ filter: "RegionId IN (SELECT RegionId FROM UserRegions WHERE UserId == '{{userId}}')",
603
+ accessType: "deny",
604
+ permissionsExcluded: []
605
+ });
606
+
607
+ // Update a rule
608
+ const updatedRule: RapRule = await context.rapClient.updateRule('<rule_id>', {
609
+ policyId: "<policy_id>",
610
+ description: "Resource: Activities I'm allocated to",
611
+ objectType: "Activities",
612
+ filter: "ResourceId == '{{resourceId}}'",
613
+ accessType: "deny",
614
+ permissionsExcluded: ["skedulo.tenant.schedule.allocation.dispatch"]
615
+ });
616
+
617
+ // Delete a rule
618
+ await context.rapClient.deleteRule('<rule_id>');
619
+ ```
620
+
621
+ **Templates**
622
+ ```javascript
623
+ // List all available policy templates
624
+ const templates: RapTemplate[] = await context.rapClient.getTemplates();
625
+
626
+ // Apply a template to create a new policy
627
+ const policyFromTemplate: RapPolicy = await context.rapClient.applyTemplate('<template_id>');
628
+ ```
629
+
630
+ ### RAP Service
631
+ The RAP Service provides higher-level operations for exporting and importing Record Access Policies between tenants.
632
+
633
+ **Export policies**
634
+ ```javascript
635
+ // Export all policies from the current tenant
636
+ const allPolicies: RapPolicy[] = await context.rapService.exportPolicies();
637
+
638
+ // Export a single policy by ID
639
+ const singlePolicy: RapPolicy = await context.rapService.exportPolicy('<policy_id>');
640
+ ```
641
+
642
+ **Import policies**
643
+ ```javascript
644
+ // Import policies into the current tenant (e.g. from an export)
645
+ const importedPolicies: RapPolicy[] = await context.rapService.importPolicies(allPolicies);
646
+
647
+ // Import a single policy
648
+ const importedPolicy: RapPolicy = await context.rapService.importPolicy(singlePolicy);
649
+ ```
650
+
651
+ **Deploy policies (replace all)**
652
+ ```javascript
653
+ // Replace all policies in the target tenant with the exported set
654
+ // This deletes existing policies first, then imports the new ones
655
+ const deployedPolicies: RapPolicy[] = await context.rapService.deployPolicies(allPolicies);
656
+ ```
657
+
658
+ **Delete all policies**
659
+ ```javascript
660
+ // Remove all policies from the current tenant
661
+ const deletedCount: number = await context.rapService.deleteAllPolicies();
662
+ ```
663
+
664
+ **Copy policies between tenants**
665
+ ```javascript
666
+ // 1. Export from source tenant
667
+ const sourceContext = ExecutionContext.fromCredentials({
668
+ apiServer: "https://api.skedulo.com",
669
+ apiToken: sourceToken,
670
+ });
671
+ const policies = await sourceContext.rapService.exportPolicies();
672
+
673
+ // 2. Import into target tenant
674
+ const targetContext = ExecutionContext.fromCredentials({
675
+ apiServer: "https://api.skedulo.com",
676
+ apiToken: targetToken,
677
+ });
678
+ const imported = await targetContext.rapService.importPolicies(policies);
679
+
680
+ // Or replace all policies in the target tenant
681
+ const deployed = await targetContext.rapService.deployPolicies(policies);
682
+ ```
683
+
537
684
  ### GraphQL Service
538
685
 
539
686
  #### Query data
@@ -1 +1 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,i){void 0===i&&(i=t);var o=Object.getOwnPropertyDescriptor(r,t);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,i,o)}:function(e,r,t,i){void 0===i&&(i=t),e[i]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./artifact-client"),exports),__exportStar(require("./availability-api-client"),exports),__exportStar(require("./base-client"),exports),__exportStar(require("./config-features-client"),exports),__exportStar(require("./config-template-client"),exports),__exportStar(require("./config-var-client"),exports),__exportStar(require("./files-api-client"),exports),__exportStar(require("./geo-api-client"),exports),__exportStar(require("./graphql-client"),exports),__exportStar(require("./metadata-client"),exports),__exportStar(require("./mobile-notification-client"),exports),__exportStar(require("./org-preference-client"),exports),__exportStar(require("./vocabulary-client"),exports);
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,i){void 0===i&&(i=t);var o=Object.getOwnPropertyDescriptor(r,t);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,i,o)}:function(e,r,t,i){void 0===i&&(i=t),e[i]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./artifact-client"),exports),__exportStar(require("./availability-api-client"),exports),__exportStar(require("./base-client"),exports),__exportStar(require("./config-features-client"),exports),__exportStar(require("./config-template-client"),exports),__exportStar(require("./config-var-client"),exports),__exportStar(require("./files-api-client"),exports),__exportStar(require("./geo-api-client"),exports),__exportStar(require("./graphql-client"),exports),__exportStar(require("./metadata-client"),exports),__exportStar(require("./mobile-notification-client"),exports),__exportStar(require("./org-preference-client"),exports),__exportStar(require("./rap-client"),exports),__exportStar(require("./vocabulary-client"),exports);
@@ -0,0 +1 @@
1
+ "use strict";var __decorate=this&&this.__decorate||function(t,e,n,a){var o,i=arguments.length,r=i<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,n):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,a);else for(var _=t.length-1;_>=0;_--)(o=t[_])&&(r=(i<3?o(r):i>3?o(e,n,r):o(e,n))||r);return i>3&&r&&Object.defineProperty(e,n,r),r},__metadata=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},__awaiter=this&&this.__awaiter||function(t,e,n,a){return new(n||(n=Promise))(function(o,i){function r(t){try{d(a.next(t))}catch(t){i(t)}}function _(t){try{d(a.throw(t))}catch(t){i(t)}}function d(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(r,_)}d((a=a.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.RapClient=void 0;const constants_1=require("../constants"),monitor_call_1=require("../monitoring/decorators/monitor-call"),base_client_1=require("./base-client");class RapClient extends base_client_1.BaseClient{getPolicies(){return __awaiter(this,void 0,void 0,function*(){return yield this._performRequest({endpoint:constants_1.TENANT_ENDPOINTS.RAP.POLICIES})})}getPolicy(t){return __awaiter(this,void 0,void 0,function*(){return yield this._performRequest({endpoint:constants_1.TENANT_ENDPOINTS.RAP.POLICY(t)})})}createPolicy(t){return __awaiter(this,void 0,void 0,function*(){return yield this._performRequest({method:constants_1.HttpMethod.POST,endpoint:constants_1.TENANT_ENDPOINTS.RAP.POLICIES,body:t})})}updatePolicy(t,e){return __awaiter(this,void 0,void 0,function*(){return yield this._performRequest({method:constants_1.HttpMethod.PUT,endpoint:constants_1.TENANT_ENDPOINTS.RAP.POLICY(t),body:e})})}deletePolicy(t){return __awaiter(this,void 0,void 0,function*(){return yield this._performRequest({method:constants_1.HttpMethod.DELETE,endpoint:constants_1.TENANT_ENDPOINTS.RAP.POLICY(t)})})}createRule(t){return __awaiter(this,void 0,void 0,function*(){return yield this._performRequest({method:constants_1.HttpMethod.POST,endpoint:constants_1.TENANT_ENDPOINTS.RAP.RULES,body:t})})}updateRule(t,e){return __awaiter(this,void 0,void 0,function*(){return yield this._performRequest({method:constants_1.HttpMethod.PUT,endpoint:constants_1.TENANT_ENDPOINTS.RAP.RULE(t),body:e})})}deleteRule(t){return __awaiter(this,void 0,void 0,function*(){return yield this._performRequest({method:constants_1.HttpMethod.DELETE,endpoint:constants_1.TENANT_ENDPOINTS.RAP.RULE(t)})})}getTemplates(){return __awaiter(this,void 0,void 0,function*(){return yield this._performRequest({endpoint:constants_1.TENANT_ENDPOINTS.RAP.TEMPLATES})})}applyTemplate(t){return __awaiter(this,void 0,void 0,function*(){return yield this._performRequest({method:constants_1.HttpMethod.POST,endpoint:constants_1.TENANT_ENDPOINTS.RAP.APPLY_TEMPLATE(t)})})}}exports.RapClient=RapClient,__decorate([(0,monitor_call_1.MonitorCall)(),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],RapClient.prototype,"getPolicies",null),__decorate([(0,monitor_call_1.MonitorCall)(),__metadata("design:type",Function),__metadata("design:paramtypes",[String]),__metadata("design:returntype",Promise)],RapClient.prototype,"getPolicy",null),__decorate([(0,monitor_call_1.MonitorCall)(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],RapClient.prototype,"createPolicy",null),__decorate([(0,monitor_call_1.MonitorCall)(),__metadata("design:type",Function),__metadata("design:paramtypes",[String,Object]),__metadata("design:returntype",Promise)],RapClient.prototype,"updatePolicy",null),__decorate([(0,monitor_call_1.MonitorCall)(),__metadata("design:type",Function),__metadata("design:paramtypes",[String]),__metadata("design:returntype",Promise)],RapClient.prototype,"deletePolicy",null),__decorate([(0,monitor_call_1.MonitorCall)(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],RapClient.prototype,"createRule",null),__decorate([(0,monitor_call_1.MonitorCall)(),__metadata("design:type",Function),__metadata("design:paramtypes",[String,Object]),__metadata("design:returntype",Promise)],RapClient.prototype,"updateRule",null),__decorate([(0,monitor_call_1.MonitorCall)(),__metadata("design:type",Function),__metadata("design:paramtypes",[String]),__metadata("design:returntype",Promise)],RapClient.prototype,"deleteRule",null),__decorate([(0,monitor_call_1.MonitorCall)(),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],RapClient.prototype,"getTemplates",null),__decorate([(0,monitor_call_1.MonitorCall)(),__metadata("design:type",Function),__metadata("design:paramtypes",[String]),__metadata("design:returntype",Promise)],RapClient.prototype,"applyTemplate",null);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TENANT_ENDPOINTS=void 0,exports.TENANT_ENDPOINTS={CONFIG_VAR:{CREATE:"configuration/extension",GET:e=>`configuration/extension/${e}`,UPDATE:e=>`configuration/extension/${e}`,DELETE:e=>`configuration/extension/${e}`,SEARCH:"configuration/extension/search"},GRAPHQL:{SINGLE:"graphql/graphql",BATCH:"graphql/graphql/batch"},METADATA:{ALL:"custom/metadata",OBJECT:e=>`custom/metadata/${e}`},ORG_PREFERENCE:{GET:"config/org_preference",UPDATE:"config/org_preference"},CONFIG_TEMPLATE:{GET_TEMPLATES:e=>`config/templates/${e}`,GET_VALUES:e=>`config/template/${e}/values`,UPDATE_VALUES:e=>`config/template/${e}/values`,CREATE:"config/template",DELETE:e=>`config/template/${e}`},CONFIG_FEATURES:{GET:"config/features",UPDATE:e=>`config/features/${e}`},VOCABULARY:{GET_ITEMS:(e,t)=>`custom/vocabulary/${e}/${t}`,ADD_ITEM:(e,t)=>`custom/vocabulary/${e}/${t}`,UPDATE_ITEM:(e,t,i)=>`custom/vocabulary/${e}/${t}/${i}`},NOTIFICATIONS:{GET_TEMPLATES:"notifications/v2/templates",DELETE_TEMPLATE:(e,t)=>`notifications/v2/template/${e}/${t}`,SET_TEMPLATE:(e,t)=>`notifications/v2/template/${e}/${t}`,DISPATCH:"notifications/dispatch",NOTIFY:"notifications/notify",NOTIFY_CANCEL:"notifications/notify_cancel",ONE_OFF:"notifications/oneoff",SEND_SMS:"notifications/sms",SMS_CONFIRMATION_REQUEST:"notifications/sms/confirmation_request"},GEOSERVICES:{DISTANCE_MATRIX:"geoservices/distanceMatrix",DIRECTIONS:"geoservices/directions",GEOCODE:"geoservices/geocode",AUTOCOMPLETE:"geoservices/autocomplete",PLACE:"geoservices/place",TIMEZONE:"geoservices/timezone"},AVAILABILITY:{SIMPLE:"availability/simple",PATTERNS:"availability/patterns"},FILES:{AVATAR:"files/avatar",ATTACHMENTS:e=>`files/attachments/${e}`}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TENANT_ENDPOINTS=void 0,exports.TENANT_ENDPOINTS={CONFIG_VAR:{CREATE:"configuration/extension",GET:i=>`configuration/extension/${i}`,UPDATE:i=>`configuration/extension/${i}`,DELETE:i=>`configuration/extension/${i}`,SEARCH:"configuration/extension/search"},GRAPHQL:{SINGLE:"graphql/graphql",BATCH:"graphql/graphql/batch"},METADATA:{ALL:"custom/metadata",OBJECT:i=>`custom/metadata/${i}`},ORG_PREFERENCE:{GET:"config/org_preference",UPDATE:"config/org_preference"},CONFIG_TEMPLATE:{GET_TEMPLATES:i=>`config/templates/${i}`,GET_VALUES:i=>`config/template/${i}/values`,UPDATE_VALUES:i=>`config/template/${i}/values`,CREATE:"config/template",DELETE:i=>`config/template/${i}`},CONFIG_FEATURES:{GET:"config/features",UPDATE:i=>`config/features/${i}`},VOCABULARY:{GET_ITEMS:(i,e)=>`custom/vocabulary/${i}/${e}`,ADD_ITEM:(i,e)=>`custom/vocabulary/${i}/${e}`,UPDATE_ITEM:(i,e,t)=>`custom/vocabulary/${i}/${e}/${t}`},NOTIFICATIONS:{GET_TEMPLATES:"notifications/v2/templates",DELETE_TEMPLATE:(i,e)=>`notifications/v2/template/${i}/${e}`,SET_TEMPLATE:(i,e)=>`notifications/v2/template/${i}/${e}`,DISPATCH:"notifications/dispatch",NOTIFY:"notifications/notify",NOTIFY_CANCEL:"notifications/notify_cancel",ONE_OFF:"notifications/oneoff",SEND_SMS:"notifications/sms",SMS_CONFIRMATION_REQUEST:"notifications/sms/confirmation_request"},GEOSERVICES:{DISTANCE_MATRIX:"geoservices/distanceMatrix",DIRECTIONS:"geoservices/directions",GEOCODE:"geoservices/geocode",AUTOCOMPLETE:"geoservices/autocomplete",PLACE:"geoservices/place",TIMEZONE:"geoservices/timezone"},AVAILABILITY:{SIMPLE:"availability/simple",PATTERNS:"availability/patterns"},FILES:{AVATAR:"files/avatar",ATTACHMENTS:i=>`files/attachments/${i}`},RAP:{POLICIES:"authorization/policies",POLICY:i=>`authorization/policies/${i}`,TEMPLATES:"authorization/policies/templates",APPLY_TEMPLATE:i=>`authorization/policies/templates/${i}/apply`,RULES:"authorization/policies/rules",RULE:i=>`authorization/policies/rules/${i}`}};
@@ -1 +1 @@
1
- "use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ExecutionContext=void 0;const function_utilities_1=require("@skedulo/function-utilities"),clients_1=require("../clients"),artifact_client_1=require("../clients/artifact-client"),availability_api_client_1=require("../clients/availability-api-client"),config_features_client_1=require("../clients/config-features-client"),config_template_client_1=require("../clients/config-template-client"),config_var_client_1=require("../clients/config-var-client"),files_api_client_1=require("../clients/files-api-client"),geo_api_client_1=require("../clients/geo-api-client"),graphql_client_1=require("../clients/graphql-client"),metadata_client_1=require("../clients/metadata-client"),mobile_notification_client_1=require("../clients/mobile-notification-client"),org_preference_client_1=require("../clients/org-preference-client"),vocabulary_client_1=require("../clients/vocabulary-client"),logger_1=__importDefault(require("../logging/logger")),monitoring_constants_1=require("../monitoring/monitoring-constants"),monitoring_registry_1=require("../monitoring/monitoring-registry"),cache_service_1=require("../services/cache/cache-service"),storage_1=require("../services/cache/storage"),geoservice_1=require("../services/geoservice"),graphql_1=require("../services/graphql"),lock_service_1=require("../services/lock-service"),metadata_service_1=require("../services/metadata-service"),data_service_1=require("../services/resource-availability/builder/data-service"),resource_availability_service_1=require("../services/resource-availability/builder/resource-availability-service"),resource_builder_1=require("../services/resource-availability/builder/resource-builder"),utils_1=require("../utils"),request_header_constants_1=require("./request-header-constants");class ExecutionContext{constructor(e,i={},t){this.logger=logger_1.default,this.services=new Map,this.skedContext=e,this.contextData={},this._executionOptions=i,this.baseConfig={apiToken:e.auth.token,apiServer:e.auth.baseUrl},(0,monitoring_registry_1.initGlobalMonitorManager)(t)}static fromContext(e,i={},t=monitoring_constants_1.DEFAULT_THRESHOLD_CONFIG){return new ExecutionContext(e,i,Object.assign(Object.assign({},monitoring_constants_1.DEFAULT_THRESHOLD_CONFIG),t))}static fromCredentials(e,i={},t=monitoring_constants_1.DEFAULT_THRESHOLD_CONFIG){const r={Authorization:`Bearer ${e.apiToken}`,[request_header_constants_1.REQUEST_HEADERS.SKED_API_SERVER]:e.apiServer},n=(0,function_utilities_1.createSkedContext)(r);return new ExecutionContext(n,i,Object.assign(Object.assign({},monitoring_constants_1.DEFAULT_THRESHOLD_CONFIG),t))}set executionOptions(e){this._executionOptions=Object.assign(Object.assign({},this._executionOptions),e)}get executionOptions(){return this._executionOptions}getOrCreateService(e,i){return this.services.has(e)||this.services.set(e,i()),this.services.get(e)}get configHelper(){return this.getOrCreateService("configHelper",()=>new utils_1.ConfigHelper(this.skedContext.configVars))}get baseClient(){return this.getOrCreateService("baseClient",()=>new clients_1.BaseClient(this.baseConfig,this.executionOptions))}get graphqlClient(){return this.getOrCreateService("graphqlClient",()=>new graphql_client_1.GraphQLClient(this.baseConfig,this.executionOptions))}get graphqlService(){return this.getOrCreateService("graphqlService",()=>new graphql_1.GraphQLService(this.graphqlClient))}get metadataClient(){return this.getOrCreateService("metadataClient",()=>new metadata_client_1.MetadataClient(this.baseConfig,this.executionOptions))}get metadataService(){return this.getOrCreateService("metadataService",()=>new metadata_service_1.MetadataService(this.metadataClient))}get vocabularyClient(){return this.getOrCreateService("vocabularyClient",()=>new vocabulary_client_1.VocabularyClient(this.baseConfig,this.executionOptions))}get orgPreferencesClient(){return this.getOrCreateService("orgPreferencesClient",()=>new org_preference_client_1.OrgPreferenceClient(this.baseConfig,this.executionOptions))}get configTemplateClient(){return this.getOrCreateService("configTemplateClient",()=>new config_template_client_1.ConfigTemplateClient(this.baseConfig,this.executionOptions))}get configFeaturesClient(){return this.getOrCreateService("configFeaturesClient",()=>new config_features_client_1.ConfigFeaturesClient(this.baseConfig,this.executionOptions))}get configVarClient(){return this.getOrCreateService("configVarClient",()=>new config_var_client_1.ConfigVarClient(this.baseConfig,this.executionOptions))}get mobileNotificationClient(){return this.getOrCreateService("mobileNotificationClient",()=>new mobile_notification_client_1.MobileNotificationClient(this.baseConfig,this.executionOptions))}get geoAPIClient(){return this.getOrCreateService("geoAPIClient",()=>new geo_api_client_1.GeoAPIClient(this.baseConfig,this.executionOptions))}get availabilityAPIClient(){return this.getOrCreateService("availabilityAPIClient",()=>new availability_api_client_1.AvailabilityAPIClient(this.baseConfig,this.executionOptions))}get filesAPIClient(){return this.getOrCreateService("filesAPIClient",()=>new files_api_client_1.FilesAPIClient(this.baseConfig,this.executionOptions))}get geoService(){return this.getOrCreateService("geoService",()=>new geoservice_1.GeoService(this.geoAPIClient))}get lockService(){return this.getOrCreateService("lockService",()=>new lock_service_1.LockService(this.configVarClient))}get configVarCache(){return this.getOrCreateService("configVarCache",()=>new cache_service_1.CacheService(new storage_1.ConfigVarCacheStorage(this.configVarClient)))}get inMemoryCache(){return this.getOrCreateService("inMemoryCache",()=>{const e=new cache_service_1.CacheService(new storage_1.InMemoryCacheStorage);return e.setSecondaryCache(this.configVarCache),e})}get resourceAvailabilityService(){return this.getOrCreateService("resourceAvailabilityService",()=>new resource_availability_service_1.ResourceAvailabilityService(this.availabilityAPIClient))}get dataService(){return this.getOrCreateService("dataService",()=>new data_service_1.DataService(this.graphqlService))}get resourceBuilder(){return this.getOrCreateService("resourceBuilder",()=>new resource_builder_1.ResourceBuilder(this.dataService,this.resourceAvailabilityService))}newQueryBuilder(e){const i=new graphql_1.GraphQLQueryBuilder(e);return i.setGraphqlService(this.graphqlService),i}newArtifactClient(e){return this.getOrCreateService(`${e}Client`,()=>new artifact_client_1.ArtifactClient(this.baseConfig,e,this.executionOptions))}dispose(){this.services.clear()}getExecutionMetrics(){return(0,monitoring_registry_1.getGlobalMonitorManager)().getExecutionMetrics()}}exports.ExecutionContext=ExecutionContext,ExecutionContext.instance=null;
1
+ "use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ExecutionContext=void 0;const function_utilities_1=require("@skedulo/function-utilities"),clients_1=require("../clients"),artifact_client_1=require("../clients/artifact-client"),availability_api_client_1=require("../clients/availability-api-client"),config_features_client_1=require("../clients/config-features-client"),config_template_client_1=require("../clients/config-template-client"),config_var_client_1=require("../clients/config-var-client"),files_api_client_1=require("../clients/files-api-client"),geo_api_client_1=require("../clients/geo-api-client"),graphql_client_1=require("../clients/graphql-client"),metadata_client_1=require("../clients/metadata-client"),mobile_notification_client_1=require("../clients/mobile-notification-client"),org_preference_client_1=require("../clients/org-preference-client"),rap_client_1=require("../clients/rap-client"),vocabulary_client_1=require("../clients/vocabulary-client"),logger_1=__importDefault(require("../logging/logger")),monitoring_constants_1=require("../monitoring/monitoring-constants"),monitoring_registry_1=require("../monitoring/monitoring-registry"),cache_service_1=require("../services/cache/cache-service"),storage_1=require("../services/cache/storage"),geoservice_1=require("../services/geoservice"),graphql_1=require("../services/graphql"),lock_service_1=require("../services/lock-service"),metadata_service_1=require("../services/metadata-service"),rap_service_1=require("../services/rap-service"),data_service_1=require("../services/resource-availability/builder/data-service"),resource_availability_service_1=require("../services/resource-availability/builder/resource-availability-service"),resource_builder_1=require("../services/resource-availability/builder/resource-builder"),utils_1=require("../utils"),request_header_constants_1=require("./request-header-constants");class ExecutionContext{constructor(e,i={},t){this.logger=logger_1.default,this.services=new Map,this.skedContext=e,this.contextData={},this._executionOptions=i,this.baseConfig={apiToken:e.auth.token,apiServer:e.auth.baseUrl},(0,monitoring_registry_1.initGlobalMonitorManager)(t)}static fromContext(e,i={},t=monitoring_constants_1.DEFAULT_THRESHOLD_CONFIG){return new ExecutionContext(e,i,Object.assign(Object.assign({},monitoring_constants_1.DEFAULT_THRESHOLD_CONFIG),t))}static fromCredentials(e,i={},t=monitoring_constants_1.DEFAULT_THRESHOLD_CONFIG){const r={Authorization:`Bearer ${e.apiToken}`,[request_header_constants_1.REQUEST_HEADERS.SKED_API_SERVER]:e.apiServer},n=(0,function_utilities_1.createSkedContext)(r);return new ExecutionContext(n,i,Object.assign(Object.assign({},monitoring_constants_1.DEFAULT_THRESHOLD_CONFIG),t))}set executionOptions(e){this._executionOptions=Object.assign(Object.assign({},this._executionOptions),e)}get executionOptions(){return this._executionOptions}getOrCreateService(e,i){return this.services.has(e)||this.services.set(e,i()),this.services.get(e)}get configHelper(){return this.getOrCreateService("configHelper",()=>new utils_1.ConfigHelper(this.skedContext.configVars))}get baseClient(){return this.getOrCreateService("baseClient",()=>new clients_1.BaseClient(this.baseConfig,this.executionOptions))}get graphqlClient(){return this.getOrCreateService("graphqlClient",()=>new graphql_client_1.GraphQLClient(this.baseConfig,this.executionOptions))}get graphqlService(){return this.getOrCreateService("graphqlService",()=>new graphql_1.GraphQLService(this.graphqlClient))}get metadataClient(){return this.getOrCreateService("metadataClient",()=>new metadata_client_1.MetadataClient(this.baseConfig,this.executionOptions))}get metadataService(){return this.getOrCreateService("metadataService",()=>new metadata_service_1.MetadataService(this.metadataClient))}get vocabularyClient(){return this.getOrCreateService("vocabularyClient",()=>new vocabulary_client_1.VocabularyClient(this.baseConfig,this.executionOptions))}get orgPreferencesClient(){return this.getOrCreateService("orgPreferencesClient",()=>new org_preference_client_1.OrgPreferenceClient(this.baseConfig,this.executionOptions))}get configTemplateClient(){return this.getOrCreateService("configTemplateClient",()=>new config_template_client_1.ConfigTemplateClient(this.baseConfig,this.executionOptions))}get configFeaturesClient(){return this.getOrCreateService("configFeaturesClient",()=>new config_features_client_1.ConfigFeaturesClient(this.baseConfig,this.executionOptions))}get configVarClient(){return this.getOrCreateService("configVarClient",()=>new config_var_client_1.ConfigVarClient(this.baseConfig,this.executionOptions))}get mobileNotificationClient(){return this.getOrCreateService("mobileNotificationClient",()=>new mobile_notification_client_1.MobileNotificationClient(this.baseConfig,this.executionOptions))}get geoAPIClient(){return this.getOrCreateService("geoAPIClient",()=>new geo_api_client_1.GeoAPIClient(this.baseConfig,this.executionOptions))}get availabilityAPIClient(){return this.getOrCreateService("availabilityAPIClient",()=>new availability_api_client_1.AvailabilityAPIClient(this.baseConfig,this.executionOptions))}get filesAPIClient(){return this.getOrCreateService("filesAPIClient",()=>new files_api_client_1.FilesAPIClient(this.baseConfig,this.executionOptions))}get geoService(){return this.getOrCreateService("geoService",()=>new geoservice_1.GeoService(this.geoAPIClient))}get lockService(){return this.getOrCreateService("lockService",()=>new lock_service_1.LockService(this.configVarClient))}get configVarCache(){return this.getOrCreateService("configVarCache",()=>new cache_service_1.CacheService(new storage_1.ConfigVarCacheStorage(this.configVarClient)))}get inMemoryCache(){return this.getOrCreateService("inMemoryCache",()=>{const e=new cache_service_1.CacheService(new storage_1.InMemoryCacheStorage);return e.setSecondaryCache(this.configVarCache),e})}get rapClient(){return this.getOrCreateService("rapClient",()=>new rap_client_1.RapClient(this.baseConfig,this.executionOptions))}get rapService(){return this.getOrCreateService("rapService",()=>new rap_service_1.RapService(this.rapClient))}get resourceAvailabilityService(){return this.getOrCreateService("resourceAvailabilityService",()=>new resource_availability_service_1.ResourceAvailabilityService(this.availabilityAPIClient))}get dataService(){return this.getOrCreateService("dataService",()=>new data_service_1.DataService(this.graphqlService))}get resourceBuilder(){return this.getOrCreateService("resourceBuilder",()=>new resource_builder_1.ResourceBuilder(this.dataService,this.resourceAvailabilityService))}newQueryBuilder(e){const i=new graphql_1.GraphQLQueryBuilder(e);return i.setGraphqlService(this.graphqlService),i}newArtifactClient(e){return this.getOrCreateService(`${e}Client`,()=>new artifact_client_1.ArtifactClient(this.baseConfig,e,this.executionOptions))}dispose(){this.services.clear()}getExecutionMetrics(){return(0,monitoring_registry_1.getGlobalMonitorManager)().getExecutionMetrics()}}exports.ExecutionContext=ExecutionContext,ExecutionContext.instance=null;
package/dist/index.d.ts CHANGED
@@ -117,6 +117,14 @@ export declare const TENANT_ENDPOINTS: {
117
117
  readonly AVATAR: "files/avatar";
118
118
  readonly ATTACHMENTS: (parentId: string) => string;
119
119
  };
120
+ readonly RAP: {
121
+ readonly POLICIES: "authorization/policies";
122
+ readonly POLICY: (policyId: string) => string;
123
+ readonly TEMPLATES: "authorization/policies/templates";
124
+ readonly APPLY_TEMPLATE: (templateId: string) => string;
125
+ readonly RULES: "authorization/policies/rules";
126
+ readonly RULE: (ruleId: string) => string;
127
+ };
120
128
  };
121
129
  /**
122
130
  * Represents execution options for GraphQL requests.
@@ -952,6 +960,74 @@ export declare class OrgPreferenceClient extends BaseClient {
952
960
  */
953
961
  deploy(newConfig: Record<string, any>): Promise<Record<string, any>>;
954
962
  }
963
+ export interface RapRule {
964
+ id?: string;
965
+ policyId: string;
966
+ description: string;
967
+ objectType: string;
968
+ filter: string;
969
+ accessType: "deny";
970
+ permissionsExcluded: string[];
971
+ }
972
+ export interface RapPolicy {
973
+ id?: string;
974
+ name: string;
975
+ description: string;
976
+ enabled: boolean;
977
+ rules?: RapRule[];
978
+ }
979
+ export interface RapTemplate {
980
+ id: string;
981
+ name: string;
982
+ description: string;
983
+ }
984
+ /**
985
+ * Client for managing Record Access Policies (RAP) through the Authorization API.
986
+ * Provides methods to create, retrieve, update, and delete policies and rules,
987
+ * as well as manage policy templates.
988
+ */
989
+ export declare class RapClient extends BaseClient {
990
+ /**
991
+ * Retrieves all policies.
992
+ */
993
+ getPolicies(): Promise<RapPolicy[]>;
994
+ /**
995
+ * Retrieves a single policy by ID.
996
+ */
997
+ getPolicy(policyId: string): Promise<RapPolicy>;
998
+ /**
999
+ * Creates a new policy. Optionally include rules in the payload.
1000
+ */
1001
+ createPolicy(policy: RapPolicy): Promise<RapPolicy>;
1002
+ /**
1003
+ * Updates an existing policy by ID.
1004
+ */
1005
+ updatePolicy(policyId: string, policy: Partial<RapPolicy>): Promise<RapPolicy>;
1006
+ /**
1007
+ * Deletes a policy by ID.
1008
+ */
1009
+ deletePolicy(policyId: string): Promise<void>;
1010
+ /**
1011
+ * Creates a new rule linked to a policy.
1012
+ */
1013
+ createRule(rule: RapRule): Promise<RapRule>;
1014
+ /**
1015
+ * Updates an existing rule by ID.
1016
+ */
1017
+ updateRule(ruleId: string, rule: RapRule): Promise<RapRule>;
1018
+ /**
1019
+ * Deletes a rule by ID.
1020
+ */
1021
+ deleteRule(ruleId: string): Promise<void>;
1022
+ /**
1023
+ * Retrieves all available policy templates.
1024
+ */
1025
+ getTemplates(): Promise<RapTemplate[]>;
1026
+ /**
1027
+ * Applies a template to create a new policy.
1028
+ */
1029
+ applyTemplate(templateId: string): Promise<RapPolicy>;
1030
+ }
955
1031
  export interface VocabularyItem {
956
1032
  value: string;
957
1033
  label: string;
@@ -1400,6 +1476,59 @@ export declare class MetadataService {
1400
1476
  */
1401
1477
  getPicklistValues(metadata: ObjectMetadata): Record<string, string[]>;
1402
1478
  }
1479
+ /**
1480
+ * Service for exporting and importing Record Access Policies (RAP) between tenants.
1481
+ * Wraps the RapClient to provide higher-level export/import operations.
1482
+ */
1483
+ export declare class RapService {
1484
+ private client;
1485
+ constructor(client: RapClient);
1486
+ /**
1487
+ * Exports all policies (with their rules) from the current tenant.
1488
+ *
1489
+ * @returns An array of policies including their nested rules.
1490
+ */
1491
+ exportPolicies(): Promise<RapPolicy[]>;
1492
+ /**
1493
+ * Imports an array of policies into the current tenant.
1494
+ * Each policy (and its rules) is created via the API. The API accepts
1495
+ * the full policy object including ID fields, so payloads exported from
1496
+ * a source tenant can be passed directly.
1497
+ *
1498
+ * @param policies - The policies to import, typically from {@link exportPolicies}.
1499
+ * @returns The created policies as returned by the API.
1500
+ */
1501
+ importPolicies(policies: RapPolicy[]): Promise<RapPolicy[]>;
1502
+ /**
1503
+ * Exports a single policy by ID.
1504
+ *
1505
+ * @param policyId - The ID of the policy to export.
1506
+ * @returns The policy including its rules.
1507
+ */
1508
+ exportPolicy(policyId: string): Promise<RapPolicy>;
1509
+ /**
1510
+ * Imports a single policy into the current tenant.
1511
+ *
1512
+ * @param policy - The policy to import.
1513
+ * @returns The created policy as returned by the API.
1514
+ */
1515
+ importPolicy(policy: RapPolicy): Promise<RapPolicy>;
1516
+ /**
1517
+ * Removes all policies from the current tenant.
1518
+ * Retrieves all policies first, then deletes each one.
1519
+ *
1520
+ * @returns The number of policies deleted.
1521
+ */
1522
+ deleteAllPolicies(): Promise<number>;
1523
+ /**
1524
+ * Replaces all policies in the current tenant with the provided set.
1525
+ * This deletes existing policies first, then imports the new ones.
1526
+ *
1527
+ * @param policies - The policies to deploy.
1528
+ * @returns The created policies as returned by the API.
1529
+ */
1530
+ deployPolicies(policies: RapPolicy[]): Promise<RapPolicy[]>;
1531
+ }
1403
1532
  export declare class ResourceQueryParam {
1404
1533
  resourceIds?: Set<string>;
1405
1534
  regionIds?: Set<string>;
@@ -1535,6 +1664,8 @@ export declare class ExecutionContext {
1535
1664
  get lockService(): LockService;
1536
1665
  get configVarCache(): CacheService<any>;
1537
1666
  get inMemoryCache(): CacheService<any>;
1667
+ get rapClient(): RapClient;
1668
+ get rapService(): RapService;
1538
1669
  get resourceAvailabilityService(): ResourceAvailabilityService;
1539
1670
  get dataService(): DataService;
1540
1671
  get resourceBuilder(): ResourceBuilder;
@@ -1 +1 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,i){void 0===i&&(i=t);var o=Object.getOwnPropertyDescriptor(r,t);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,i,o)}:function(e,r,t,i){void 0===i&&(i=t),e[i]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./api-client"),exports),__exportStar(require("./availability"),exports),__exportStar(require("./config-template"),exports),__exportStar(require("./config-var"),exports),__exportStar(require("./files"),exports),__exportStar(require("./geoservice-interfaces"),exports),__exportStar(require("./graphql"),exports),__exportStar(require("./lock-service-interfaces"),exports),__exportStar(require("./metadata"),exports),__exportStar(require("./mobile-notification"),exports),__exportStar(require("./vocabulary"),exports);
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,i){void 0===i&&(i=t);var o=Object.getOwnPropertyDescriptor(r,t);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,i,o)}:function(e,r,t,i){void 0===i&&(i=t),e[i]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./api-client"),exports),__exportStar(require("./availability"),exports),__exportStar(require("./config-template"),exports),__exportStar(require("./config-var"),exports),__exportStar(require("./files"),exports),__exportStar(require("./geoservice-interfaces"),exports),__exportStar(require("./graphql"),exports),__exportStar(require("./lock-service-interfaces"),exports),__exportStar(require("./metadata"),exports),__exportStar(require("./mobile-notification"),exports),__exportStar(require("./rap"),exports),__exportStar(require("./vocabulary"),exports);
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -0,0 +1 @@
1
+ export * from "./log-method";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This decorator logs the input arguments and output results of a method,
3
+ * including error handling with ANSI color-coded logs for better console readability.
4
+ * It allows selective logging based on the `LOG_NAMESPACE` environment variable.
5
+ * Uses Winston logger but retains ANSI colors for console logs.
6
+ */
7
+ export declare function LogMethod(namespace?: string): (target: any, propertyKey: any, descriptor: any) => any;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Decorator factory that takes a MonitoringManager instance and an optional
3
+ * explicit methodIdentifier override. If not provided, the decorator will
4
+ * default to ClassName.MethodName.
5
+ */
6
+ export declare function MonitorCall(methodIdentifier?: string): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
@@ -0,0 +1,70 @@
1
+ export declare class CacheService<T> {
2
+ private storage;
3
+ private secondaryCache?;
4
+ /**
5
+ * Creates an instance of CacheService.
6
+ * @param {CacheStorage<string>} storage - The cache storage implementation.
7
+ */
8
+ constructor(storage: CacheStorage<string>);
9
+ /**
10
+ * Sets a secondary cache service to use as a fallback.
11
+ * @param {CacheService<T>} secondaryCache - The secondary cache service.
12
+ * @returns {void}
13
+ */
14
+ setSecondaryCache(secondaryCache: CacheService<T>): void;
15
+ /**
16
+ * Retrieves a cached value by key.
17
+ * If the value is not found, it attempts to retrieve it from a secondary service or loader.
18
+ * @param {string} key - The cache key.
19
+ * @param {object} options - Optional parameters.
20
+ * @param {CacheLoader<T>} [options.loader] - A function to load the value if not cached.
21
+ * @param {boolean} [options.useSecondaryCache] - Whether to use the secondary cache service.
22
+ * @returns {Promise<T | null>} - The cached value or null if not found or expired.
23
+ */
24
+ get(key: string, options?: CacheOptions<T>): Promise<T | null>;
25
+ /**
26
+ * Stores a value in the cache with an optional TTL.
27
+ * @param {string} key - The cache key.
28
+ * @param {T} value - The value to store.
29
+ * @param {object} options - Optional parameters.
30
+ * @returns {Promise<void>}
31
+ */
32
+ set(key: string, value: T, options?: CacheOptions<T>): Promise<void>;
33
+ /**
34
+ * Deletes a specific key from the cache.
35
+ * @param {string} key - The cache key to delete.
36
+ * @returns {Promise<void>}
37
+ */
38
+ delete(key: string): Promise<void>;
39
+ /**
40
+ * Clears all cache entries.
41
+ * @returns {Promise<void>}
42
+ */
43
+ clear(): Promise<void>;
44
+ /**
45
+ * Adds the cache key prefix to a key if it is not already present.
46
+ * @param {string} key - The cache key.
47
+ * @returns {string} - The key with the prefix
48
+ */
49
+ addPrefix(key: string): string;
50
+ /**
51
+ * Deserializes the cached metadata and returns the original value in the correct type.
52
+ * @param {any} metadata - The cached metadata object.
53
+ * @returns {T} - The deserialized value.
54
+ */
55
+ private deserialize;
56
+ }
57
+ /**
58
+ * Interface for cache storage.
59
+ * This defines the basic storage operations without loader logic.
60
+ */
61
+ export interface CacheStorage<T = any> {
62
+ set(key: string, value: T): Promise<void>;
63
+ get(key: string): Promise<T | null>;
64
+ delete(key: string): Promise<void>;
65
+ clear(): Promise<void>;
66
+ }
67
+ export interface CacheOptions<T> {
68
+ ttl?: number;
69
+ useSecondaryCache?: boolean;
70
+ }
@@ -0,0 +1 @@
1
+ export * from "./cache-service";
@@ -0,0 +1,40 @@
1
+ import { ConfigVarClient } from "../../../clients";
2
+ import { CacheStorage } from "../cache-service";
3
+ /**
4
+ * Implementation of CacheStorage using ConfigVarClient.
5
+ * This class interacts with a configuration variable service to store and retrieve values.
6
+ */
7
+ export declare class ConfigVarCacheStorage<T = any> implements CacheStorage<T> {
8
+ private configVarClient;
9
+ /**
10
+ * Creates an instance of ConfigVarCacheStorage.
11
+ * @param {ConfigVarClient} configVarService - The client used to interact with the configuration variable service.
12
+ */
13
+ constructor(configVarService: ConfigVarClient);
14
+ /**
15
+ * Stores a value in the configuration variable service.
16
+ * If the key already exists, it updates the value.
17
+ * @param {string} key - The cache key.
18
+ * @param {T} value - The value to store.
19
+ * @returns {Promise<void>}
20
+ */
21
+ set(key: string, value: T): Promise<void>;
22
+ /**
23
+ * Retrieves a cached value by key from the configuration variable service.
24
+ * @param {string} key - The cache key.
25
+ * @returns {Promise<T | null>} - The cached value or null if not found.
26
+ */
27
+ get(key: string): Promise<T | null>;
28
+ /**
29
+ * Deletes a specific key from the cache.
30
+ * @param {string} key - The cache key to delete.
31
+ * @returns {Promise<void>}
32
+ */
33
+ delete(key: string): Promise<void>;
34
+ /**
35
+ * Clears all cache entries.
36
+ * Note: This operation is not supported by ConfigVarCacheStorage.
37
+ * @returns {Promise<void>}
38
+ */
39
+ clear(): Promise<void>;
40
+ }
@@ -0,0 +1,32 @@
1
+ import { CacheStorage } from "../cache-service";
2
+ /**
3
+ * Implementation of CacheStorage using an in-memory Map.
4
+ * This class provides a simple key-value store that resides in memory.
5
+ */
6
+ export declare class InMemoryCacheStorage<T = any> implements CacheStorage<T> {
7
+ private cache;
8
+ /**
9
+ * Stores a value in the cache.
10
+ * @param {string} key - The cache key.
11
+ * @param {T} value - The value to store.
12
+ * @returns {Promise<void>}
13
+ */
14
+ set(key: string, value: T): Promise<void>;
15
+ /**
16
+ * Retrieves a cached value by key.
17
+ * @param {string} key - The cache key.
18
+ * @returns {Promise<T | null>} - The cached value or null if not found.
19
+ */
20
+ get(key: string): Promise<T | null>;
21
+ /**
22
+ * Deletes a specific key from the cache.
23
+ * @param {string} key - The cache key to delete.
24
+ * @returns {Promise<void>}
25
+ */
26
+ delete(key: string): Promise<void>;
27
+ /**
28
+ * Clears all cache entries.
29
+ * @returns {Promise<void>}
30
+ */
31
+ clear(): Promise<void>;
32
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./config-var-cache-storage";
2
+ export * from "./in-memory-cache-storage";
@@ -0,0 +1,18 @@
1
+ import { PaginationStrategy } from "../pagination-strategy";
2
+ /**
3
+ * Default configuration values for `GraphBatchConfig`.
4
+ */
5
+ export declare const DEFAULT_GRAPH_BATCH_CONFIG: GraphBatchConfig;
6
+ /**
7
+ * Configuration options for `GraphBatch`.
8
+ */
9
+ export interface GraphBatchConfig {
10
+ strategy: PaginationStrategy;
11
+ batchSize: number;
12
+ maxBatches: number;
13
+ delaySeconds: number;
14
+ }
15
+ /**
16
+ * Merges user-provided config with default values.
17
+ */
18
+ export declare function initializeConfig(config: Partial<GraphBatchConfig> | undefined): GraphBatchConfig;
@@ -0,0 +1,16 @@
1
+ import { GraphBatchConfig } from "./graph-batch-config";
2
+ /**
3
+ * Default configuration values for `UniqueGraphBatchConfig`.
4
+ */
5
+ export declare const DEFAULT_UNIQUE_GRAPH_BATCH_CONFIG: UniqueGraphBatchConfig;
6
+ /**
7
+ * Configuration options for `UniqueGraphBatch`.
8
+ */
9
+ export interface UniqueGraphBatchConfig extends GraphBatchConfig {
10
+ name?: string;
11
+ lockTtl?: number;
12
+ }
13
+ /**
14
+ * Merges user-provided config with default values for `UniqueGraphBatch`.
15
+ */
16
+ export declare function initializeUniqueConfig(config: Partial<UniqueGraphBatchConfig> | undefined): UniqueGraphBatchConfig;
@@ -0,0 +1,56 @@
1
+ import { ExecutionContext } from "../../core";
2
+ import { QueryResult } from "../../interfaces";
3
+ import { GraphQLQueryBuilder } from "../graphql";
4
+ import { GraphBatchConfig } from "./configs/graph-batch-config";
5
+ /**
6
+ * Base class for batch processing with pagination support.
7
+ */
8
+ export declare abstract class GraphBatch {
9
+ protected context: ExecutionContext;
10
+ protected config: GraphBatchConfig;
11
+ protected queryBuilder?: GraphQLQueryBuilder;
12
+ protected queryResult?: QueryResult;
13
+ private startTime;
14
+ constructor(context: ExecutionContext, config?: Partial<GraphBatchConfig>);
15
+ /**
16
+ * Runs the batch process, handling pagination, execution, and accumulation of results.
17
+ *
18
+ * @returns The accumulated result of the batch process.
19
+ */
20
+ run(): Promise<void>;
21
+ /**
22
+ * Initializes the query builder. This method must be overridden in subclasses.
23
+ *
24
+ * @returns A configured GraphQL query builder.
25
+ */
26
+ protected abstract start(): Promise<GraphQLQueryBuilder>;
27
+ /**
28
+ * Processes a batch of records and accumulates the result.
29
+ *
30
+ * @param records The batch of records retrieved from the query.
31
+ */
32
+ protected abstract execute(records: any[]): Promise<void>;
33
+ /**
34
+ * Final cleanup or logging after the batch process completes.
35
+ */
36
+ protected finish(): Promise<void>;
37
+ /**
38
+ * Fetches the next page of data based on the pagination strategy.
39
+ *
40
+ * @returns The result of the query execution.
41
+ */
42
+ protected fetchNextPage(): Promise<QueryResult>;
43
+ /**
44
+ * Checks if the maximum number of batches has been reached.
45
+ *
46
+ * @param currentBatchCount The number of batches processed so far.
47
+ * @returns `true` if the maximum limit is reached, otherwise `false`.
48
+ */
49
+ protected isMaxBatchesReached(currentBatchCount: number): boolean;
50
+ /**
51
+ * Delays execution for a specified time.
52
+ *
53
+ * @param ms The time in milliseconds to delay.
54
+ */
55
+ protected delay(ms: number): Promise<void>;
56
+ }
@@ -0,0 +1,5 @@
1
+ export * from "./configs/graph-batch-config";
2
+ export * from "./configs/unique-graph-batch-config";
3
+ export * from "./graph-batch";
4
+ export * from "./pagination-strategy";
5
+ export * from "./unique-graph-batch";
@@ -0,0 +1,5 @@
1
+ export declare enum PaginationStrategy {
2
+ CURSOR = "cursor",
3
+ OFFSET = "offset",
4
+ NONE = "none"
5
+ }
@@ -0,0 +1,28 @@
1
+ import { ExecutionContext } from "../../core/execution-context";
2
+ import { GraphQLQueryBuilder } from "../graphql";
3
+ import { UniqueGraphBatchConfig } from "./configs/unique-graph-batch-config";
4
+ import { GraphBatch } from "./graph-batch";
5
+ /**
6
+ * UniqueGraphBatch ensures that only one instance of a batch with the same name can run at a time.
7
+ */
8
+ export declare class UniqueGraphBatch extends GraphBatch {
9
+ private name;
10
+ private lockTtl;
11
+ constructor(context: ExecutionContext, config?: Partial<UniqueGraphBatchConfig>);
12
+ /**
13
+ * Runs the batch process with lock enforcement.
14
+ */
15
+ run(): Promise<void>;
16
+ /**
17
+ * Abstract method implementation - Initialize query builder.
18
+ */
19
+ protected start(): Promise<GraphQLQueryBuilder>;
20
+ /**
21
+ * Abstract method implementation - Process batch records.
22
+ */
23
+ protected execute(records: any[]): Promise<void>;
24
+ /**
25
+ * Overrides the finish method to ensure lock cleanup.
26
+ */
27
+ protected finish(): Promise<void>;
28
+ }
@@ -0,0 +1,93 @@
1
+ import { GraphqlQueryParams, QueryResult } from "../../interfaces/graphql";
2
+ import { GraphQLService } from "./graphql-service";
3
+ /**
4
+ * A utility class for building GraphQL queries dynamically.
5
+ */
6
+ export declare class GraphQLQueryBuilder {
7
+ private objectName;
8
+ operationName: string;
9
+ private fields;
10
+ private filters;
11
+ private first?;
12
+ private limit?;
13
+ private offset?;
14
+ private orderBy?;
15
+ private after?;
16
+ private parentQueries;
17
+ private childQueries;
18
+ private isParent;
19
+ private graphqlService;
20
+ private queryParams;
21
+ /**
22
+ * Creates an instance of GraphQLQueryBuilder.
23
+ * @param {GraphqlQueryParams} queryParams - The parameters for the query.
24
+ * @param {boolean} [isParent=false] - Indicates if this query is a parent query.
25
+ */
26
+ constructor(queryParams: GraphqlQueryParams, isParent?: boolean);
27
+ /**
28
+ * Sets the GraphQL service to use for executing the query.
29
+ */
30
+ setGraphqlService(graphqlService: GraphQLService): void;
31
+ /**
32
+ * Specifies the fields to be retrieved. Prevents duplicates.
33
+ */
34
+ withFields(fields: string[]): this;
35
+ /**
36
+ * Adds a filter condition to the query.
37
+ */
38
+ withFilter(condition: string): this;
39
+ /**
40
+ * Sets a limit on the number of records to retrieve using 'limit' parameter.
41
+ * This is the recommended approach.
42
+ */
43
+ withLimit(limit: number): this;
44
+ /**
45
+ * Sets a limit on the number of records to retrieve using 'first' parameter.
46
+ * Use this when you specifically need the 'first' parameter.
47
+ */
48
+ withFirst(first: number): this;
49
+ /**
50
+ * Sets an offset for pagination.
51
+ */
52
+ withOffset(offset: number): this;
53
+ /**
54
+ * Sets the order in which records should be retrieved.
55
+ */
56
+ withOrderBy(orderBy: string): this;
57
+ /**
58
+ * Applies cursor-based pagination.
59
+ */
60
+ withCursor(after: string): this;
61
+ /**
62
+ * Creates a parent query.
63
+ */
64
+ withParentQuery(objectName: string): GraphQLQueryBuilder;
65
+ /**
66
+ * Creates a child query.
67
+ */
68
+ withChildQuery(objectName: string): GraphQLQueryBuilder;
69
+ /**
70
+ * Recursively builds the GraphQL query fields, handling nested queries.
71
+ */
72
+ private formatQueryFields;
73
+ /**
74
+ * Builds the GraphQL query parameters in a structured format.
75
+ */
76
+ build(): GraphqlQueryParams;
77
+ /**
78
+ * Executes the query using the GraphQL service.
79
+ */
80
+ execute(): Promise<QueryResult>;
81
+ /**
82
+ * Executes all queries for the configured object, fetching records from the specified page range, up to a maximum of 20 pages.
83
+ * @param {number} [fromPage=1] - The starting page number (1-based, defaults to 1).
84
+ * @param {number} [toPage=20] - The ending page number (defaults to 20, capped at 20).
85
+ * @returns {Promise<QueryResult>} - A query result containing all records in the page range and pagination info.
86
+ * @throws {Error} - If the query execution fails, no GraphQL service is set, or invalid page parameters are provided.
87
+ */
88
+ executeAll(fromPage?: number, toPage?: number): Promise<QueryResult>;
89
+ /**
90
+ * Generates a string representation of the GraphQL query for debugging.
91
+ */
92
+ toString(): string;
93
+ }
@@ -1 +1 @@
1
- "use strict";var __awaiter=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(s,a){function o(e){try{h(i.next(e))}catch(e){a(e)}}function n(e){try{h(i.throw(e))}catch(e){a(e)}}function h(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,n)}h((i=i.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.GraphQLQueryBuilder=void 0;class GraphQLQueryBuilder{constructor(e,t=!1){this.fields=new Set(["UID"]),this.filters=[],this.parentQueries={},this.childQueries={},this.graphqlService=null,this.queryParams=e,this.objectName=e.objectName.charAt(0).toLowerCase()+e.objectName.slice(1),this.operationName=e.operationName,this.isParent=t}setGraphqlService(e){this.graphqlService=e}withFields(e){return e.forEach(e=>this.fields.add(e)),this}withFilter(e){if(this.isParent)throw new Error("Cannot apply filters to a parent query.");return this.filters.push(e),this}withLimit(e){if(this.isParent)throw new Error("Cannot apply limit to a parent query.");return this.limit=e,this}withFirst(e){if(this.isParent)throw new Error("Cannot apply limit to a parent query.");return this.first=e,this}withOffset(e){if(this.isParent)throw new Error("Cannot apply offset to a parent query.");return this.offset=e,this}withOrderBy(e){if(this.isParent)throw new Error("Cannot apply orderBy to a parent query.");return this.orderBy=e,this}withCursor(e){if(this.isParent)throw new Error("Cannot apply cursor to a parent query.");return this.after=e,this}withParentQuery(e){const t=new GraphQLQueryBuilder({objectName:e,operationName:this.operationName},!0);return this.parentQueries[e]=t,t}withChildQuery(e){const t=new GraphQLQueryBuilder({objectName:e,operationName:this.operationName});return this.childQueries[e]=t,t}formatQueryFields(){const e=Object.entries(this.parentQueries).map(([e,t])=>`${e} { ${t.formatQueryFields()} }`).join(", "),t=Object.entries(this.childQueries).map(([e,t])=>{const r=t.build();return`${e} ${r.filter?`(filter: "${r.filter}")`:""} { ${r.fields||"UID"} }`}).join(", ");return[...this.fields,e,t].filter(Boolean).join(", ")}build(){return{objectName:this.objectName,operationName:this.operationName,fields:this.formatQueryFields(),filter:this.filters.length>0?this.filters.join(" AND "):void 0,first:this.first,limit:this.limit,offset:this.offset,orderBy:this.orderBy,after:this.after,readOnly:this.queryParams.readOnly}}execute(){return __awaiter(this,void 0,void 0,function*(){if(!this.graphqlService)return Promise.reject(new Error("No GraphQL service set for query execution."));const e=this.build();return e.readOnly=this.queryParams.readOnly,yield this.graphqlService.query(e)})}executeAll(){return __awaiter(this,arguments,void 0,function*(e=1,t=20){if(!this.graphqlService)throw new Error("No GraphQL service set for query execution.");if(e<1)throw new Error("fromPage must be at least 1.");if(t<e)throw new Error("toPage must be greater than or equal to fromPage.");const r=Math.min(t,20),i=this.build(),s=yield this.graphqlService.query(i),a=s.totalCount;if(0===a)return{records:[],totalCount:0,pageInfo:{hasNextPage:!1},endCursor:"",endOffset:0};const o=this.limit||this.first||200,n=Math.ceil(a/o),h=Math.min(r,n);if(0===Math.max(0,h-e+1))return{records:[],totalCount:a,pageInfo:{hasNextPage:h<n},endCursor:"",endOffset:(e-1)*o};const u=[];for(let t=e-1;t<h;t++){const e=new GraphQLQueryBuilder({objectName:this.objectName,operationName:this.operationName,readOnly:this.queryParams.readOnly});e.setGraphqlService(this.graphqlService),e.fields=new Set(this.fields),e.filters=[...this.filters],void 0!==this.limit?e.limit=o:e.first=o,e.offset=t*o,e.orderBy=this.orderBy,e.after=this.after,u.push(e)}const l=yield this.graphqlService.queryBatch(u),f=l.flatMap(e=>e.records),c=l[l.length-1];return{records:f,totalCount:s.totalCount,pageInfo:c.pageInfo,endCursor:c.endCursor,endOffset:c.endOffset}})}toString(){return`{ ${this.objectName} { ${this.formatQueryFields()} } }`}}exports.GraphQLQueryBuilder=GraphQLQueryBuilder;
1
+ "use strict";var __awaiter=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(s,a){function o(e){try{h(i.next(e))}catch(e){a(e)}}function n(e){try{h(i.throw(e))}catch(e){a(e)}}function h(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,n)}h((i=i.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.GraphQLQueryBuilder=void 0;class GraphQLQueryBuilder{constructor(e,t=!1){this.fields=new Set(["UID"]),this.filters=[],this.parentQueries={},this.childQueries={},this.graphqlService=null,this.queryParams=e,this.objectName=e.objectName.charAt(0).toLowerCase()+e.objectName.slice(1),this.operationName=e.operationName,this.isParent=t}setGraphqlService(e){this.graphqlService=e}withFields(e){return e.forEach(e=>this.fields.add(e)),this}withFilter(e){if(this.isParent)throw new Error("Cannot apply filters to a parent query.");return this.filters.push(e),this}withLimit(e){if(this.isParent)throw new Error("Cannot apply limit to a parent query.");return this.limit=e,this}withFirst(e){if(this.isParent)throw new Error("Cannot apply limit to a parent query.");return this.first=e,this}withOffset(e){if(this.isParent)throw new Error("Cannot apply offset to a parent query.");return this.offset=e,this}withOrderBy(e){if(this.isParent)throw new Error("Cannot apply orderBy to a parent query.");return this.orderBy=e,this}withCursor(e){if(this.isParent)throw new Error("Cannot apply cursor to a parent query.");return this.after=e,this}withParentQuery(e){const t=new GraphQLQueryBuilder({objectName:e,operationName:this.operationName},!0);return this.parentQueries[e]=t,t}withChildQuery(e){const t=new GraphQLQueryBuilder({objectName:e,operationName:this.operationName});return this.childQueries[e]=t,t}formatQueryFields(){const e=Object.entries(this.parentQueries).map(([e,t])=>`${e} { ${t.formatQueryFields()} }`).join(", "),t=Object.entries(this.childQueries).map(([e,t])=>{const r=t.build(),i=[];r.filter&&i.push(`filter: "${r.filter}"`),r.orderBy&&i.push(`orderBy: "${r.orderBy}"`),void 0!==r.limit&&void 0!==this.limit&&i.push(`limit: ${r.limit}`);return`${e} ${i.length>0?`(${i.join(", ")})`:""} { ${r.fields||"UID"} }`}).join(", ");return[...this.fields,e,t].filter(Boolean).join(", ")}build(){return{objectName:this.objectName,operationName:this.operationName,fields:this.formatQueryFields(),filter:this.filters.length>0?this.filters.join(" AND "):void 0,first:this.first,limit:this.limit,offset:this.offset,orderBy:this.orderBy,after:this.after,readOnly:this.queryParams.readOnly}}execute(){return __awaiter(this,void 0,void 0,function*(){if(!this.graphqlService)return Promise.reject(new Error("No GraphQL service set for query execution."));const e=this.build();return e.readOnly=this.queryParams.readOnly,yield this.graphqlService.query(e)})}executeAll(){return __awaiter(this,arguments,void 0,function*(e=1,t=20){if(!this.graphqlService)throw new Error("No GraphQL service set for query execution.");if(e<1)throw new Error("fromPage must be at least 1.");if(t<e)throw new Error("toPage must be greater than or equal to fromPage.");const r=Math.min(t,20),i=this.build(),s=yield this.graphqlService.query(i),a=s.totalCount;if(0===a)return{records:[],totalCount:0,pageInfo:{hasNextPage:!1},endCursor:"",endOffset:0};const o=this.limit||this.first||200,n=Math.ceil(a/o),h=Math.min(r,n);if(0===Math.max(0,h-e+1))return{records:[],totalCount:a,pageInfo:{hasNextPage:h<n},endCursor:"",endOffset:(e-1)*o};const u=[];for(let t=e-1;t<h;t++){const e=new GraphQLQueryBuilder({objectName:this.objectName,operationName:this.operationName,readOnly:this.queryParams.readOnly});e.setGraphqlService(this.graphqlService),e.fields=new Set(this.fields),e.filters=[...this.filters],e.childQueries=Object.assign({},this.childQueries),e.parentQueries=Object.assign({},this.parentQueries),void 0!==this.limit?e.limit=o:e.first=o,e.offset=t*o,e.orderBy=this.orderBy,e.after=this.after,u.push(e)}const l=yield this.graphqlService.queryBatch(u),f=l.flatMap(e=>e.records),c=l[l.length-1];return{records:f,totalCount:s.totalCount,pageInfo:c.pageInfo,endCursor:c.endCursor,endOffset:c.endOffset}})}toString(){return`{ ${this.objectName} { ${this.formatQueryFields()} } }`}}exports.GraphQLQueryBuilder=GraphQLQueryBuilder;
@@ -0,0 +1,106 @@
1
+ import { GraphQLClient } from "../../clients/graphql-client";
2
+ import { GraphqlMutationParams, GraphqlQueryParams, MutationResult, QueryResult } from "../../interfaces/graphql";
3
+ import { GraphQLQueryBuilder } from "./graphql-query-builder";
4
+ /**
5
+ * Service for executing GraphQL queries and mutations.
6
+ */
7
+ export declare class GraphQLService {
8
+ private client;
9
+ /**
10
+ * Constructor to initialize the GraphQL client.
11
+ * @param {GraphQLClient} client - The GraphQL client instance.
12
+ */
13
+ constructor(client: GraphQLClient);
14
+ /**
15
+ * Executes a GraphQL query.
16
+ * @param {GraphqlQueryParams} params - The parameters for the GraphQL query.
17
+ * @returns {Promise<QueryResult>} - The query result containing records and pagination info.
18
+ * @throws {Error} - If the query execution fails.
19
+ */
20
+ query(params: GraphqlQueryParams): Promise<QueryResult>;
21
+ /**
22
+ * Executes a batch of queries.
23
+ * @param {GraphQLQueryBuilder[]} builders - Array of query builders.
24
+ * @returns {Promise<QueryResult[]>} - Array of query results.
25
+ */
26
+ queryBatch(builders: GraphQLQueryBuilder[]): Promise<QueryResult[]>;
27
+ /**
28
+ * Executes a batch of GraphQL queries.
29
+ * @param {GraphqlQueryParams[]} paramsArray - An array of query parameters.
30
+ * @returns {Promise<QueryResult[]>} - An array of query results.
31
+ * @throws {Error} - If the batch execution fails.
32
+ */
33
+ private executeBatchQueries;
34
+ /**
35
+ * Executes a GraphQL mutation.
36
+ * @param {GraphqlMutationParams} params - The parameters for the GraphQL mutation.
37
+ * @returns {Promise<MutationResult>} - The mutation result containing affected UIDs.
38
+ * @throws {Error} - If the mutation execution fails or the operation is invalid.
39
+ */
40
+ mutate(params: GraphqlMutationParams): Promise<MutationResult>;
41
+ /**
42
+ * Executes a batch of GraphQL mutations.
43
+ * @param {GraphqlMutationParams[]} paramsArray - An array of mutation parameters.
44
+ * @returns {Promise<MutationResult[]>} - An array of mutation results.
45
+ * @throws {Error} - If the batch execution fails or if any mutation has empty records.
46
+ */
47
+ mutateBatch(paramsArray: GraphqlMutationParams[]): Promise<MutationResult[]>;
48
+ /**
49
+ * Deletes objects using a GraphQL mutation.
50
+ * @param {GraphqlMutationParams} params - The parameters for the delete mutation.
51
+ * @returns {Promise<MutationResult>} - The mutation result containing deleted UIDs.
52
+ * @throws {Error} - If the delete operation fails.
53
+ */
54
+ delete(params: GraphqlMutationParams): Promise<MutationResult>;
55
+ /**
56
+ * Updates objects using a GraphQL mutation.
57
+ * @param {GraphqlMutationParams} params - The parameters for the update mutation.
58
+ * @returns {Promise<MutationResult>} - The mutation result containing updated UIDs.
59
+ * @throws {Error} - If the update operation fails.
60
+ */
61
+ update(params: GraphqlMutationParams): Promise<MutationResult>;
62
+ /**
63
+ * Inserts objects using a GraphQL mutation.
64
+ * @param {GraphqlMutationParams} params - The parameters for the insert mutation.
65
+ * @returns {Promise<MutationResult>} - The mutation result containing inserted UIDs.
66
+ * @throws {Error} - If the insert operation fails.
67
+ */
68
+ insert(params: GraphqlMutationParams): Promise<MutationResult>;
69
+ /**
70
+ * Upserts objects using a GraphQL mutation.
71
+ * @param {GraphqlMutationParams} params - The parameters for the upsert mutation, including keyField.
72
+ * @returns {Promise<MutationResult>} - The mutation result containing upserted UIDs.
73
+ * @throws {Error} - If the upsert operation fails.
74
+ */
75
+ upsert(params: GraphqlMutationParams): Promise<MutationResult>;
76
+ /**
77
+ * Extracts UIDs from a mutation response.
78
+ * @param {MutationResult} response - The mutation response containing the schema.
79
+ * @returns {string[]} - An array of UIDs extracted from the response.
80
+ */
81
+ extractUIDs(response: MutationResult): string[];
82
+ /**
83
+ * Converts object name to GraphQL query name format.
84
+ * @param {string} objectName - The object name to convert.
85
+ * @returns {string} - The formatted query name.
86
+ */
87
+ private getQueryName;
88
+ /**
89
+ * Generates headers for GraphQL queries.
90
+ * @param {GraphqlQueryParams} params - The query parameters containing operationName and readOnly flag.
91
+ * @returns {Record<string, string>} - The headers for the query request.
92
+ */
93
+ private getQueryHeaders;
94
+ /**
95
+ * Generates headers for GraphQL mutations.
96
+ * @param {GraphqlMutationParams} params - The mutation parameters containing operationName and optional flags.
97
+ * @returns {Record<string, string>} - The headers for the mutation request.
98
+ */
99
+ private getMutationHeaders;
100
+ /**
101
+ * Generates operation header for GraphQL requests.
102
+ * @param {string} operationName - The name of the GraphQL operation.
103
+ * @returns {Record<string, string>} - The operation header.
104
+ */
105
+ private getOperationHeader;
106
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./graphql-query-builder";
2
+ export * from "./graphql-service";
@@ -0,0 +1,20 @@
1
+ import { GraphqlMutationParams, GraphqlQueryParams } from "../../interfaces/graphql";
2
+ /**
3
+ * Constructs a GraphQL query to fetch records for a given object.
4
+ * @param {GraphqlQueryParams} params - The parameters for the GraphQL query.
5
+ * @returns {string} - The constructed GraphQL query string.
6
+ */
7
+ export declare const FETCH_RECORDS_QUERY: ({ objectName, operationName, filter, first, limit, offset, after, orderBy, fields, }: GraphqlQueryParams) => string;
8
+ /**
9
+ * Constructs a GraphQL mutation to delete objects.
10
+ * @param {GraphqlMutationParams} params - The parameters for the GraphQL mutation.
11
+ * @returns {string} - The constructed GraphQL mutation string.
12
+ */
13
+ export declare const DELETE_OBJECTS_MUTATION: ({ objectName, operationName, records }: GraphqlMutationParams) => string;
14
+ /**
15
+ * Constructs a GraphQL mutation to insert, update, or upsert objects.
16
+ * @param {GraphqlMutationParams} params - The parameters for the GraphQL mutation.
17
+ * @returns {string} - The constructed GraphQL mutation string.
18
+ * @throws {Error} - If the operation type is invalid.
19
+ */
20
+ export declare const MUTATE_OBJECTS_MUTATION: ({ objectName, operationName, records, operation, keyField, }: GraphqlMutationParams) => string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MUTATE_OBJECTS_MUTATION=exports.DELETE_OBJECTS_MUTATION=exports.FETCH_RECORDS_QUERY=void 0;const serializeGraphQLValue=e=>{if(Array.isArray(e)){return`[${e.map(e=>serializeGraphQLValue(e)).join(", ")}]`}return"string"==typeof e?`"${e}"`:String(e)},FETCH_RECORDS_QUERY=({objectName:e,operationName:n,filter:t,first:r=200,limit:i,offset:o=0,after:a,orderBy:s,fields:T})=>{const E=void 0!==i,$=E?i:r;return`\n query ${n} {\n ${e}(${[t?`filter: "${t}"`:"",a?`after: "${a}"`:"",E?`limit: ${$}`:`first: ${$}`,o?`offset: ${o}`:"",s?`orderBy: "${s}"`:""].filter(e=>e).join(", ")}) {\n totalCount\n pageInfo{\n hasNextPage\n }\n edges {\n cursor\n offset\n node {\n ${T||"UID"}\n }\n }\n }\n }\n `};exports.FETCH_RECORDS_QUERY=FETCH_RECORDS_QUERY;const DELETE_OBJECTS_MUTATION=({objectName:e,operationName:n,records:t})=>`\n mutation ${n} {\n schema {\n ${t.map((n,t)=>`alias${t+1}:delete${e}(UID: "${n.UID}")`).join("\n ")}\n }\n }`;exports.DELETE_OBJECTS_MUTATION=DELETE_OBJECTS_MUTATION;const MUTATE_OBJECTS_MUTATION=({objectName:e,operationName:n,records:t,operation:r,keyField:i})=>{let o;return o="upsert"===r?t.map((n,t)=>`\n alias${t+1}:upsert${e}(\n keyField: "${i||"UID"}",\n input: {\n ${Object.entries(n).map(([e,n])=>`${e}: ${serializeGraphQLValue(n)}`).join(", ")}\n }\n )\n `).join("\n "):t.map((n,t)=>`\n alias${t+1}:${r}${e}(\n input: {\n ${Object.entries(n).map(([e,n])=>`${e}: ${serializeGraphQLValue(n)}`).join(", ")}\n }\n )\n `).join("\n "),`\n mutation ${n} {\n schema {\n ${o}\n }\n }\n `};exports.MUTATE_OBJECTS_MUTATION=MUTATE_OBJECTS_MUTATION;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MUTATE_OBJECTS_MUTATION=exports.DELETE_OBJECTS_MUTATION=exports.FETCH_RECORDS_QUERY=void 0;const serializeGraphQLValue=e=>{if(Array.isArray(e)){return`[${e.map(e=>serializeGraphQLValue(e)).join(", ")}]`}return"string"==typeof e?JSON.stringify(e):String(e)},FETCH_RECORDS_QUERY=({objectName:e,operationName:n,filter:t,first:r=200,limit:i,offset:o=0,after:a,orderBy:s,fields:T})=>{const E=void 0!==i,$=E?i:r;return`\n query ${n} {\n ${e}(${[t?`filter: "${t}"`:"",a?`after: "${a}"`:"",E?`limit: ${$}`:`first: ${$}`,o?`offset: ${o}`:"",s?`orderBy: "${s}"`:""].filter(e=>e).join(", ")}) {\n totalCount\n pageInfo{\n hasNextPage\n }\n edges {\n cursor\n offset\n node {\n ${T||"UID"}\n }\n }\n }\n }\n `};exports.FETCH_RECORDS_QUERY=FETCH_RECORDS_QUERY;const DELETE_OBJECTS_MUTATION=({objectName:e,operationName:n,records:t})=>`\n mutation ${n} {\n schema {\n ${t.map((n,t)=>`alias${t+1}:delete${e}(UID: "${n.UID}")`).join("\n ")}\n }\n }`;exports.DELETE_OBJECTS_MUTATION=DELETE_OBJECTS_MUTATION;const MUTATE_OBJECTS_MUTATION=({objectName:e,operationName:n,records:t,operation:r,keyField:i})=>{let o;return o="upsert"===r?t.map((n,t)=>`\n alias${t+1}:upsert${e}(\n keyField: "${i||"UID"}",\n input: {\n ${Object.entries(n).map(([e,n])=>`${e}: ${serializeGraphQLValue(n)}`).join(", ")}\n }\n )\n `).join("\n "):t.map((n,t)=>`\n alias${t+1}:${r}${e}(\n input: {\n ${Object.entries(n).map(([e,n])=>`${e}: ${serializeGraphQLValue(n)}`).join(", ")}\n }\n )\n `).join("\n "),`\n mutation ${n} {\n schema {\n ${o}\n }\n }\n `};exports.MUTATE_OBJECTS_MUTATION=MUTATE_OBJECTS_MUTATION;
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const queries_1=require("./queries"),constants_1=require("../../constants");describe("GraphQL Queries - Mutation Builder",()=>{describe("MUTATE_OBJECTS_MUTATION",()=>{it("should properly serialize arrays in multipicklist fields for insert operations",()=>{const t={objectName:"Jobs",operationName:"CreateJobWithMultipicklist",records:[{UID:"test-job-1",Name:"Test Job",CustomDifficulty:["Easy","Hard"],RegionId:"region-123"}],operation:constants_1.GraphqlOperations.INSERT},e=(0,queries_1.MUTATE_OBJECTS_MUTATION)(t);expect(e).toContain('CustomDifficulty: ["Easy", "Hard"]'),expect(e).not.toContain("CustomDifficulty: Easy,Hard"),expect(e).toContain('Name: "Test Job"'),expect(e).toContain('RegionId: "region-123"')}),it("should properly serialize arrays in multipicklist fields for update operations",()=>{const t={objectName:"Jobs",operationName:"UpdateJobWithMultipicklist",records:[{UID:"test-job-1",CustomDifficulty:["Medium","Expert"],Status:"Dispatched"}],operation:constants_1.GraphqlOperations.UPDATE},e=(0,queries_1.MUTATE_OBJECTS_MUTATION)(t);expect(e).toContain('CustomDifficulty: ["Medium", "Expert"]'),expect(e).toContain('Status: "Dispatched"'),expect(e).toContain("updateJobs")}),it("should properly serialize arrays in multipicklist fields for upsert operations",()=>{const t={objectName:"Jobs",operationName:"UpsertJobWithMultipicklist",records:[{UID:"test-job-1",Name:"Upserted Job",CustomDifficulty:["Easy","Medium","Hard"],Priority:5}],operation:constants_1.GraphqlOperations.UPSERT,keyField:"UID"},e=(0,queries_1.MUTATE_OBJECTS_MUTATION)(t);expect(e).toContain('CustomDifficulty: ["Easy", "Medium", "Hard"]'),expect(e).toContain("Priority: 5"),expect(e).toContain('keyField: "UID"'),expect(e).toContain("upsertJobs")}),it("should handle empty arrays correctly",()=>{const t={objectName:"Jobs",operationName:"CreateJobWithEmptyArray",records:[{UID:"test-job-1",Name:"Test Job",CustomDifficulty:[],Tags:["urgent"]}],operation:constants_1.GraphqlOperations.INSERT},e=(0,queries_1.MUTATE_OBJECTS_MUTATION)(t);expect(e).toContain("CustomDifficulty: []"),expect(e).toContain('Tags: ["urgent"]')}),it("should handle mixed data types correctly",()=>{const t={objectName:"Jobs",operationName:"CreateJobWithMixedTypes",records:[{UID:"test-job-1",Name:"Test Job",CustomDifficulty:["Easy","Hard"],Priority:5,IsActive:!0,Duration:2.5,Notes:null,Metadata:{type:"maintenance",urgent:!0}}],operation:constants_1.GraphqlOperations.INSERT},e=(0,queries_1.MUTATE_OBJECTS_MUTATION)(t);expect(e).toContain('CustomDifficulty: ["Easy", "Hard"]'),expect(e).toContain("Priority: 5"),expect(e).toContain("IsActive: true"),expect(e).toContain("Duration: 2.5"),expect(e).toContain("Notes: null"),expect(e).toContain('Metadata: { type: "maintenance", urgent: true }')}),it("should handle nested arrays in objects",()=>{const t={objectName:"Jobs",operationName:"CreateJobWithNestedArrays",records:[{UID:"test-job-1",Name:"Test Job",Configuration:{skills:["plumbing","electrical"],levels:[1,2,3],active:!0}}],operation:constants_1.GraphqlOperations.INSERT},e=(0,queries_1.MUTATE_OBJECTS_MUTATION)(t);expect(e).toContain('Configuration: { skills: ["plumbing", "electrical"], levels: [1, 2, 3], active: true }')})})});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const constants_1=require("../../constants"),queries_1=require("./queries");describe("MUTATE_OBJECTS_MUTATION value escaping",()=>{const e=(e,t=constants_1.GraphqlOperations.INSERT)=>(0,queries_1.MUTATE_OBJECTS_MUTATION)({objectName:"Product2",operationName:"pull",operation:t,records:[e]});it("escapes double quotes in string values so the GraphQL string literal is not closed early",()=>{const t=e({Name:"Smart Hub",Description:'7" touchscreen panel'});expect(t).toContain('Description: "7\\" touchscreen panel"'),expect(t).not.toContain('Description: "7" touchscreen panel"')}),it("escapes backslashes and newlines",()=>{const t=e({Note:"back\\slash and\nnewline"});expect(t).toContain('Note: "back\\\\slash and\\nnewline"')}),it("escapes quotes inside string-array elements",()=>{const t=e({Tags:['a"b',"c"]});expect(t).toContain('Tags: ["a\\"b", "c"]')}),it("leaves non-string scalars unquoted",()=>{const t=e({IsActive:!0,Qty:15});expect(t).toContain("IsActive: true"),expect(t).toContain("Qty: 15")}),it("escapes the keyField path on upsert too",()=>{const t=e({UID:"x",Description:'say "hi"'},constants_1.GraphqlOperations.UPSERT);expect(t).toContain('Description: "say \\"hi\\""')})});
@@ -1 +1 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,i){void 0===i&&(i=t);var o=Object.getOwnPropertyDescriptor(r,t);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,i,o)}:function(e,r,t,i){void 0===i&&(i=t),e[i]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./cache"),exports),__exportStar(require("./geoservice"),exports),__exportStar(require("./graph-batch"),exports),__exportStar(require("./graphql"),exports),__exportStar(require("./lock-service"),exports),__exportStar(require("./metadata-service"),exports),__exportStar(require("./resource-availability"),exports);
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,i){void 0===i&&(i=t);var o=Object.getOwnPropertyDescriptor(r,t);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,i,o)}:function(e,r,t,i){void 0===i&&(i=t),e[i]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./cache"),exports),__exportStar(require("./geoservice"),exports),__exportStar(require("./graph-batch"),exports),__exportStar(require("./graphql"),exports),__exportStar(require("./lock-service"),exports),__exportStar(require("./metadata-service"),exports),__exportStar(require("./rap-service"),exports),__exportStar(require("./resource-availability"),exports);
@@ -0,0 +1 @@
1
+ "use strict";var __awaiter=this&&this.__awaiter||function(i,t,e,o){return new(e||(e=Promise))(function(r,n){function c(i){try{s(o.next(i))}catch(i){n(i)}}function l(i){try{s(o.throw(i))}catch(i){n(i)}}function s(i){var t;i.done?r(i.value):(t=i.value,t instanceof e?t:new e(function(i){i(t)})).then(c,l)}s((o=o.apply(i,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.RapService=void 0;class RapService{constructor(i){this.client=i}exportPolicies(){return __awaiter(this,void 0,void 0,function*(){return yield this.client.getPolicies()})}importPolicies(i){return __awaiter(this,void 0,void 0,function*(){const t=[];for(const e of i){const i=yield this.client.createPolicy(e);t.push(i)}return t})}exportPolicy(i){return __awaiter(this,void 0,void 0,function*(){return yield this.client.getPolicy(i)})}importPolicy(i){return __awaiter(this,void 0,void 0,function*(){return yield this.client.createPolicy(i)})}deleteAllPolicies(){return __awaiter(this,void 0,void 0,function*(){const i=yield this.client.getPolicies();for(const t of i)t.id&&(yield this.client.deletePolicy(t.id));return i.length})}deployPolicies(i){return __awaiter(this,void 0,void 0,function*(){return yield this.deleteAllPolicies(),yield this.importPolicies(i)})}}exports.RapService=RapService;
@@ -0,0 +1,10 @@
1
+ import { GraphqlQueryParams } from "../../../interfaces";
2
+ import { GraphQLQueryBuilder, GraphQLService } from "../../graphql";
3
+ import { ResourceQueryParam } from "./resource-query-param";
4
+ export declare class DataService {
5
+ private graphqlService;
6
+ constructor(graphqlService: GraphQLService);
7
+ getResources(param: ResourceQueryParam): Promise<Record<string, any>[]>;
8
+ getHolidays(regionIds: string[], startTime?: Date, endTime?: Date): Promise<Record<string, any>>;
9
+ newQueryBuilder(params: GraphqlQueryParams): GraphQLQueryBuilder;
10
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./resource-availability-service";
2
+ export * from "./resource-builder";
3
+ export * from "./resource-query-param";
@@ -0,0 +1,8 @@
1
+ import { AvailabilityAPIClient } from "../../../clients/availability-api-client";
2
+ import { BaseEvent } from "../../../core/tenant-entities";
3
+ import { ResourceQueryParam } from "./resource-query-param";
4
+ export declare class ResourceAvailabilityService {
5
+ private availabilityAPIClient;
6
+ constructor(availabilityAPIClient: AvailabilityAPIClient);
7
+ getAvailabilityPatterns(param: ResourceQueryParam): Promise<Map<string, BaseEvent[]>>;
8
+ }
@@ -0,0 +1,17 @@
1
+ import { Resource } from "../../../core/tenant-entities";
2
+ import { DataService } from "./data-service";
3
+ import { ResourceAvailabilityService } from "./resource-availability-service";
4
+ import { ResourceQueryParam } from "./resource-query-param";
5
+ export declare class ResourceBuilder {
6
+ private dataService;
7
+ private availabilityService;
8
+ constructor(dataService: DataService, availabilityService: ResourceAvailabilityService);
9
+ build(queryParam: ResourceQueryParam): Promise<Resource[]>;
10
+ private loadAvailabilityPatterns;
11
+ private loadActivityEvents;
12
+ private loadAvailabilityEvents;
13
+ private loadJobAllocationEvents;
14
+ private loadResourceShiftEvents;
15
+ private loadHolidayEvents;
16
+ protected buildMore(resources: Resource[]): Resource[];
17
+ }
@@ -0,0 +1,23 @@
1
+ export declare class ResourceQueryParam {
2
+ resourceIds?: Set<string>;
3
+ regionIds?: Set<string>;
4
+ startTime: Date;
5
+ endTime: Date;
6
+ timezone: string;
7
+ respectResourceTimezone: boolean;
8
+ mergeAvailability: boolean;
9
+ mergeEvents: boolean;
10
+ useTag: boolean;
11
+ useJobAllocation: boolean;
12
+ useResourceShift: boolean;
13
+ useActivity: boolean;
14
+ useAvailability: boolean;
15
+ useAvailabilityTemplate: boolean;
16
+ useAvailabilityPattern: boolean;
17
+ useHoliday: boolean;
18
+ excludedJAStatus: Set<string>;
19
+ excludedJobStatus: Set<string>;
20
+ availabilityStatus: Set<string>;
21
+ resourceTypes: Set<string>;
22
+ constructor();
23
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./builder";
2
+ export * from "./validator";
@@ -0,0 +1,4 @@
1
+ export * from "./resource-job-validation";
2
+ export * from "./resource-validation-option";
3
+ export * from "./resource-validator";
4
+ export * from "./validation-result";
@@ -0,0 +1,11 @@
1
+ import { BaseEvent, Job, Resource, Tag } from "../../../core/tenant-entities";
2
+ import { ResourceValidationOption } from "./resource-validation-option";
3
+ export declare class ResourceJobValidation {
4
+ resource: Partial<Resource>;
5
+ job: Partial<Job>;
6
+ availableEvent: BaseEvent | null;
7
+ conflictEvents: BaseEvent[];
8
+ missingTags: Tag[];
9
+ constructor(resource: Partial<Resource>, job: Partial<Job>, availableEvent?: BaseEvent | null, conflictEvents?: BaseEvent[], missingTags?: Tag[]);
10
+ isQualified(option: ResourceValidationOption): boolean;
11
+ }
@@ -0,0 +1,5 @@
1
+ export interface ResourceValidationOption {
2
+ checkAvailability: boolean;
3
+ checkConflict: boolean;
4
+ checkTag: boolean;
5
+ }
@@ -0,0 +1,13 @@
1
+ import { Job, Resource } from "../../../core/tenant-entities";
2
+ import { ResourceValidationOption } from "./resource-validation-option";
3
+ import { ValidationResult } from "./validation-result";
4
+ export declare class ResourceValidator {
5
+ private readonly option;
6
+ constructor(option: ResourceValidationOption);
7
+ validate(resources: Resource[], jobs: Job[]): ValidationResult;
8
+ private validateResource;
9
+ private findAvailableEvent;
10
+ private findConflictingEvents;
11
+ private findMissingTags;
12
+ private prepareData;
13
+ }
@@ -0,0 +1,12 @@
1
+ import { Job, Resource } from "../../../core/tenant-entities";
2
+ import { ResourceJobValidation } from "./resource-job-validation";
3
+ import { ResourceValidationOption } from "./resource-validation-option";
4
+ export declare class ValidationResult {
5
+ private readonly validations;
6
+ private readonly option;
7
+ constructor(validations: ResourceJobValidation[], option: ResourceValidationOption);
8
+ getQualifiedResources(): Partial<Resource>[];
9
+ getJobsWithXQualifiedResources(minQualifiedResources: number): Partial<Job>[];
10
+ getUnqualifiedJobsWithReasons(): ResourceJobValidation[];
11
+ format(): any[];
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skedulo/pulse-solution-services",
3
- "version": "0.0.22",
3
+ "version": "0.0.25",
4
4
  "description": "A collection of services and utilities to support solution development on the Pulse platform.",
5
5
  "author": "Skedulo",
6
6
  "license": "MIT",
@@ -42,7 +42,7 @@
42
42
  "typedoc": "^0.28.1"
43
43
  },
44
44
  "dependencies": {
45
- "@skedulo/function-utilities": "^0.0.6",
45
+ "@skedulo/function-utilities": "^0.0.8",
46
46
  "dayjs": "^1.11.13",
47
47
  "p-queue": "^8.1.0",
48
48
  "timezone": "^1.0.23",
@@ -50,5 +50,6 @@
50
50
  "utc": "^0.1.0",
51
51
  "uuid": "8",
52
52
  "winston": "^3.17.0"
53
- }
53
+ },
54
+ "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
54
55
  }