
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@skedulo/pulse-solutions-framework
Advanced tools
A comprehensive TypeScript service library for GraphQL-based data operations with support for complex object relationships, batch processing, and advanced querying capabilities.
npm install @skedulo/pulse-solutions-framework
import { createObjectDefinition, MappingType, ObjectDefinition } from '@skedulo/pulse-solutions-framework'
export const JobsDefinition: ObjectDefinition = createObjectDefinition({
objectName: 'Jobs',
fieldConfigs: [
{ fieldName: 'UID' }, //mappingType: MappingType.string as default
{ fieldName: 'Name', readonly: true },
{ fieldName: 'Account', mappingType: MappingType.reference, referenceObject: 'Accounts' },
{
fieldName: 'JobAllocations',
mappingType: MappingType.relatedList,
referenceObject: 'JobAllocations',
parentField: 'Job'
},
{ fieldName: 'JobAllocationTimeSource', mappingType: MappingType.boolean },
{ fieldName: 'Quantity', mappingType: MappingType.number },
{ fieldName: 'Start', mappingType: MappingType.datetime }
]
})
Property | Type | Default | Description |
---|---|---|---|
objectName | string | Required | Name of the primary object |
objectDefinitions | Record<string, ObjectDefinition> | Required | Collection of object definitions |
import { createBaseService, ServiceSetting } from '@skedulo/pulse-solutions-framework'
import * as objectDefinitions from './my-object-definitions'
interface Jobs extends BaseModel {
AccountId: string
JobStatus: string
// ... other fields
}
const settings: ServiceSetting = {
objectName: 'Jobs',
objectDefinitions: objectDefinitions
}
const jobsService = createBaseService<Jobs>(settings)
import { QueryModel, Operator } from '@skedulo/pulse-solutions-framework'
// Simple query
const queryModels: QueryModel[] = [
{
conditions: [
['AccountId', Operator.EQUAL, 'account-uid'],
['JobStatus', Operator.NOT_IN, ['Cancelled']]
],
orderBy: 'CreatedDate DESC'
}
]
const result = await jobsService.query(queryModels)
// Insert records
const recordsToInsert: Jobs[] = [
{ AccountId: 'account-uid-1', JobStatus: 'Queued' },
{ AccountId: 'account-uid-2', JobStatus: 'Queued' }
]
// Update records
const recordsToUpdate: Jobs[] = [{ UID: 'existing-id', AccountId: 'account-uid', JobStatus: 'Pending Dispatch' }]
// Delete records
const recordsToDelete: Jobs[] = [{ UID: 'existing-id', _IsDeleted: true }]
await jobsService.save([...recordsToInsert, ...recordsToUpdate, ...recordsToDelete])
const complexQuery: QueryModel[] = [
{
conditions: [
['Start', Operator.GREATER_OR_EQUAL, '2025-01-01T00:00:00.000Z'],
['End', Operator.LESS_OR_EQUAL, '2025-12-31T00:00:00.000Z'],
['JobStatus', Operator.IN, ['Pending Allocation', 'Pending Dispatch']]
],
customLogic: '(1 AND 2) AND 3', // Reference conditions by index
orderBy: 'CreatedDate DESC'
}
]
const periodQuery: QueryModel[] = [
{
conditions: [[['Start', 'End'], Operator.PERIOD, ['2025-01-01T00:00:00.000Z', '2025-12-31T00:00:00.000Z']]]
}
]
const customQuery: QueryModel[] = [
{
conditions: [['my_custom_query', Operator.CUSTOM, 'ContactId != null AND ContactId != ""']]
}
]
const jobsWithJobAllocationsQuery: QueryModel[] = [
{
conditions: [['JobStatus', Operator.NOT_IN, ['Cancelled']]],
orderBy: 'CreatedDate DESC'
},
{
relatedList: 'JobAllocations',
conditions: [['Status', Operator.NOT_IN, ['Deleted', 'Declined']]]
}
]
const options: QueryOptions = {
readOnly: true // Optimize for read-only operations
}
const result = await jobsService.query(queryModels, options)
const options: SaveOptions = {
sourceRecords: [], // Original records for change detection
bulkOperation: true, // Enable bulk operation mode
suppressChangeEvents: true // Suppress change events
}
const result = await jobsService.save(records, options)
Operator | GraphQL Equivalent | Description |
---|---|---|
EQUAL | == | Equality comparison |
NOT_EQUAL | != | Inequality comparison |
IN | IN | Value in array |
NOT_IN | NOTIN | Value not in array |
GREATER | > | Greater than |
GREATER_OR_EQUAL | >= | Greater than or equal |
LESS | < | Less than |
LESS_OR_EQUAL | <= | Less than or equal |
INCLUDES | INCLUDES | String value included |
EXCLUDES | EXCLUDES | String value excluded |
INCLUDES_ALL | Custom | All string values included |
INCLUDES_ANY | Custom | Any string included |
EXCLUDES_ALL | Custom | All string values excluded |
PERIOD | Custom | Date range overlap |
PERIOD_INCLUDE_NULL | Custom | Date range overlap including records have period fields value is null |
CUSTOM | Custom | Raw GraphQL condition |
interface DataService<T extends BaseModel> {
newQueryBuilder(queryModels: QueryModel[]): GraphQLQueryBuilder
query(queryModels: QueryModel[], options?: QueryOptions): Promise<GetListResponse<T>>
save(objects: T[], options?: SaveOptions<T>): Promise<SaveResult[]>
}
interface QueryModel {
conditions?: [string | string[], Operator, any][]
customLogic?: string
orderBy?: string
limit?: number
relatedList?: string
overriddenFields?: string
}
sourceRecords
for optimal update performancebulkOperation: true
for large datasets. This helps optimize large-scale mutationssuppressChangeEvents: true
for large datasets. This disables change history tracking, helping to minimize delays.The recurring-service
module provides utilities for generating recurring dates based on customizable patterns. It supports daily, weekly, monthly, and yearly recurrence rules with advanced options like skipping specific dates, handling timezones, and limiting occurrences.
luxon
.The following generators are available for creating recurring dates:
Each generator implements the RecurringGenerator
interface and provides the following methods:
generateDates(pattern: RecurringPattern): DateTime[]
getRepeatMode(): RepeatMode
The module defines the following key types in types.ts:
RecurringPattern
: Configuration object for defining recurrence rules.RecurringGenerator
: Interface for generators.import { dailyRecurringGenerator } from './generators/daily-generator'
import { RepeatMode, EndMode, RecurringPattern } from './types'
const generator = dailyRecurringGenerator()
const pattern: RecurringPattern = {
startDate: '2024-01-01',
timezoneSidId: 'UTC',
repeatMode: RepeatMode.Daily,
every: 1,
endMode: EndMode.After,
endAfterNumberOccurrences: 5
}
const dates = generator.generateDates(pattern)
console.log(dates.map(date => date.toISODate()))
// Output: ['2024-01-01', '2024-01-02', '2024-01-03', '2024-01-04', '2024-01-05']
import { monthlyRecurringGenerator } from './generators/monthly-generator'
import { RepeatMode, EndMode, RecurringPattern } from './types'
const generator = monthlyRecurringGenerator()
const pattern: RecurringPattern = {
startDate: '2024-01-15',
timezoneSidId: 'UTC',
repeatMode: RepeatMode.Monthly,
every: 1,
endMode: EndMode.After,
endAfterNumberOccurrences: 3,
repeatOnDayOfMonth: 15,
skippedDates: ['2024-02-15']
}
const dates = generator.generateDates(pattern)
console.log(dates.map(date => date.toISODate()))
// Output: ['2024-01-15', '2024-03-15', '2024-04-15']
import { yearlyRecurringGenerator } from './generators/yearly-generator'
import { RepeatMode, EndMode, RecurringPattern } from './types'
const generator = yearlyRecurringGenerator()
const pattern: RecurringPattern = {
startDate: '2024-02-29',
timezoneSidId: 'UTC',
repeatMode: RepeatMode.Yearly,
every: 1,
endMode: EndMode.After,
endAfterNumberOccurrences: 2
}
const dates = generator.generateDates(pattern)
console.log(dates.map(date => date.toISODate()))
// Output: ['2024-02-29', '2025-02-28']
Unit tests for the recurring service are located in the unit-test/recurring-service
folder. Each generator and helper function is thoroughly tested with various edge cases.
FAQs
Pulse Solutions Framework
The npm package @skedulo/pulse-solutions-framework receives a total of 248 weekly downloads. As such, @skedulo/pulse-solutions-framework popularity was classified as not popular.
We found that @skedulo/pulse-solutions-framework demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 33 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.