skedyul 1.7.27 → 1.7.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/.build-stamp CHANGED
@@ -1 +1 @@
1
- 1787542758884
1
+ 1788249705157
@@ -31,11 +31,12 @@ export interface InstallConfig {
31
31
  export interface ProvisionConfig {
32
32
  /** Global environment variables (developer-level, shared across all installs) */
33
33
  env?: EnvSchema;
34
- /** INTERNAL model definitions (app-owned, not visible to users) */
34
+ /** INTERNAL model definitions for data shared across installs */
35
35
  models?: ModelDefinition[];
36
36
  /**
37
- * App entity contracts for install-time CRM maps (not shared models).
37
+ * App entity contracts for install-time CRM maps (not shared or internal models).
38
38
  * Workplaces map these to CRM; workflows apply maps via app-handle Liquid filters.
39
+ * Runtime `instance.*('<entity>')` resolves the mapped workplace model.
39
40
  */
40
41
  entities?: EntityDefinition[];
41
42
  /** Relationship definitions between INTERNAL models */
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Sync direction for events:
3
+ * - 'inbound': Events from external system → platform (e.g. Google Calendar changes)
4
+ * - 'outbound': Events from platform CRM → external system (e.g. pushing CRM changes to Google)
5
+ */
6
+ export type EventDirection = 'inbound' | 'outbound';
1
7
  /**
2
8
  * App event definition for integration executable config.
3
9
  *
@@ -15,6 +21,13 @@ export interface AppEventDefinition {
15
21
  group?: string;
16
22
  /** Optional Lucide icon name for pickers */
17
23
  icon?: string;
24
+ /**
25
+ * Sync direction for this event type.
26
+ * - 'inbound': External system → platform (e.g. webhook events from Google)
27
+ * - 'outbound': Platform CRM → external (e.g. CRM instance.updated triggers)
28
+ * Defaults to 'inbound' for app.* events when not specified.
29
+ */
30
+ direction?: EventDirection;
18
31
  /**
19
32
  * Example flat domain payload for liquid context reference (e.g. external_id, phone, …).
20
33
  * Not the full emit payload — studio/branch metadata is added at emit time.
@@ -2,8 +2,10 @@
2
2
  * App entity definition types.
3
3
  *
4
4
  * Entities describe external/logical payload shapes that workplaces map to CRM
5
- * via install-time CRM maps. They are NOT shared models — the app does not own
6
- * CRM writes; workflows/agents apply maps.
5
+ * via install-time CRM maps. They are NOT shared models and they are NOT
6
+ * internal models (internal models are for data shared across installs).
7
+ * Workflows apply maps with an app-handle Liquid filter. Runtime
8
+ * `instance.list/create/update('<entity>')` also resolves the mapped workplace model.
7
9
  */
8
10
  import type { BaseDefinition, FieldOption } from './base';
9
11
  /**
@@ -52,8 +54,10 @@ export interface EntityFieldDefinition {
52
54
  /** Whether this field should be mapped for a complete configuration */
53
55
  required?: boolean;
54
56
  /**
55
- * Global FieldDefinition handle to attach when CRM apply creates or
56
- * retargets the mapped workplace field (e.g. `calendar/recurrence`).
57
+ * Optional global FieldDefinition handle to attach when CRM apply creates
58
+ * or retargets the mapped workplace field (e.g. `calendar/recurrence`,
59
+ * `calendar/series_id`, `phone`). Core looks this up by handle; do not
60
+ * mint a private definition.
57
61
  */
58
62
  definition?: string;
59
63
  /** Enum options when the source value is constrained */
@@ -109,6 +109,12 @@ export interface ReceiveMessageInput {
109
109
  contact?: ReceiveMessageContact;
110
110
  /** Optional remote/external message ID (provider message id) */
111
111
  remoteId?: string;
112
+ /**
113
+ * How many files will be linked via attachFilesToMessage after this call.
114
+ * When set, the platform holds thread.message.received until that many
115
+ * attachments land (or a timeout), so consumers see the files.
116
+ */
117
+ expectedAttachmentCount?: number;
112
118
  }
113
119
  /**
114
120
  * Parameters for creating a communication channel.
@@ -208,7 +214,9 @@ export declare const communicationChannel: {
208
214
  * - Before: attachments are stashed on MessageInbox and linked when the message is created
209
215
  * - After: rows are created immediately and `thread.attachment.received` is emitted
210
216
  *
211
- * Typical flow for email/MMS: `receiveMessage` → `file.upload` → `attachFilesToMessage`.
217
+ * Typical flow for email/MMS: `receiveMessage({ expectedAttachmentCount })` →
218
+ * `file.upload` → `attachFilesToMessage`. Pass `expectedAttachmentCount` so
219
+ * `thread.message.received` waits for the files.
212
220
  *
213
221
  * @example
214
222
  * ```ts
@@ -1343,7 +1343,7 @@ var EntityFieldDefinitionSchema = z8.object({
1343
1343
  /** @deprecated Prefer isUnique */
1344
1344
  matchCandidate: z8.boolean().optional(),
1345
1345
  required: z8.boolean().optional(),
1346
- /** Global FieldDefinition handle (e.g. calendar/recurrence) */
1346
+ /** Global FieldDefinition handle (e.g. calendar/recurrence, calendar/series_id) */
1347
1347
  definition: z8.string().optional(),
1348
1348
  options: z8.array(
1349
1349
  z8.union([
@@ -1993,9 +1993,9 @@ var BatchOperationDefinitionSchema = z8.object({
1993
1993
  });
1994
1994
  var ProvisionConfigSchema = z8.object({
1995
1995
  env: EnvSchemaSchema.optional(),
1996
- /** INTERNAL model definitions (app-owned, not visible to users) */
1996
+ /** INTERNAL model definitions for data shared across installs */
1997
1997
  models: z8.array(ModelDefinitionSchema).optional(),
1998
- /** App entity contracts for install-time CRM maps (not shared models) */
1998
+ /** App entity contracts for install-time CRM maps (not shared or internal models) */
1999
1999
  entities: z8.array(EntityDefinitionSchema).optional(),
2000
2000
  /** Relationship definitions between INTERNAL models */
2001
2001
  relationships: z8.array(RelationshipDefinitionSchema).optional(),
@@ -2674,7 +2674,8 @@ var communicationChannel = {
2674
2674
  from: input.from,
2675
2675
  message: input.message,
2676
2676
  contact: input.contact,
2677
- ...input.remoteId ? { remoteId: input.remoteId } : {}
2677
+ ...input.remoteId ? { remoteId: input.remoteId } : {},
2678
+ ...input.expectedAttachmentCount != null ? { expectedAttachmentCount: input.expectedAttachmentCount } : {}
2678
2679
  });
2679
2680
  return data;
2680
2681
  },
@@ -2685,7 +2686,9 @@ var communicationChannel = {
2685
2686
  * - Before: attachments are stashed on MessageInbox and linked when the message is created
2686
2687
  * - After: rows are created immediately and `thread.attachment.received` is emitted
2687
2688
  *
2688
- * Typical flow for email/MMS: `receiveMessage` → `file.upload` → `attachFilesToMessage`.
2689
+ * Typical flow for email/MMS: `receiveMessage({ expectedAttachmentCount })` →
2690
+ * `file.upload` → `attachFilesToMessage`. Pass `expectedAttachmentCount` so
2691
+ * `thread.message.received` waits for the files.
2689
2692
  *
2690
2693
  * @example
2691
2694
  * ```ts
package/dist/index.d.ts CHANGED
@@ -48,3 +48,4 @@ export type { MessageBulkRecipient, MessageBulkSendInput, MessageBulkSendOutput,
48
48
  export type { QueueTouchPoint } from './types';
49
49
  export { toGsm7, estimateSmsSegments } from './tools/sms/gsm7';
50
50
  export type { SmsEncoding, SmsSegmentEstimate } from './tools/sms/gsm7';
51
+ export type { EventDirection } from './config/types/app-event';
package/dist/index.js CHANGED
@@ -1734,7 +1734,7 @@ var EntityFieldDefinitionSchema = import_v48.z.object({
1734
1734
  /** @deprecated Prefer isUnique */
1735
1735
  matchCandidate: import_v48.z.boolean().optional(),
1736
1736
  required: import_v48.z.boolean().optional(),
1737
- /** Global FieldDefinition handle (e.g. calendar/recurrence) */
1737
+ /** Global FieldDefinition handle (e.g. calendar/recurrence, calendar/series_id) */
1738
1738
  definition: import_v48.z.string().optional(),
1739
1739
  options: import_v48.z.array(
1740
1740
  import_v48.z.union([
@@ -2384,9 +2384,9 @@ var BatchOperationDefinitionSchema = import_v48.z.object({
2384
2384
  });
2385
2385
  var ProvisionConfigSchema = import_v48.z.object({
2386
2386
  env: EnvSchemaSchema.optional(),
2387
- /** INTERNAL model definitions (app-owned, not visible to users) */
2387
+ /** INTERNAL model definitions for data shared across installs */
2388
2388
  models: import_v48.z.array(ModelDefinitionSchema).optional(),
2389
- /** App entity contracts for install-time CRM maps (not shared models) */
2389
+ /** App entity contracts for install-time CRM maps (not shared or internal models) */
2390
2390
  entities: import_v48.z.array(EntityDefinitionSchema).optional(),
2391
2391
  /** Relationship definitions between INTERNAL models */
2392
2392
  relationships: import_v48.z.array(RelationshipDefinitionSchema).optional(),
@@ -3065,7 +3065,8 @@ var communicationChannel = {
3065
3065
  from: input.from,
3066
3066
  message: input.message,
3067
3067
  contact: input.contact,
3068
- ...input.remoteId ? { remoteId: input.remoteId } : {}
3068
+ ...input.remoteId ? { remoteId: input.remoteId } : {},
3069
+ ...input.expectedAttachmentCount != null ? { expectedAttachmentCount: input.expectedAttachmentCount } : {}
3069
3070
  });
3070
3071
  return data;
3071
3072
  },
@@ -3076,7 +3077,9 @@ var communicationChannel = {
3076
3077
  * - Before: attachments are stashed on MessageInbox and linked when the message is created
3077
3078
  * - After: rows are created immediately and `thread.attachment.received` is emitted
3078
3079
  *
3079
- * Typical flow for email/MMS: `receiveMessage` → `file.upload` → `attachFilesToMessage`.
3080
+ * Typical flow for email/MMS: `receiveMessage({ expectedAttachmentCount })` →
3081
+ * `file.upload` → `attachFilesToMessage`. Pass `expectedAttachmentCount` so
3082
+ * `thread.message.received` waits for the files.
3080
3083
  *
3081
3084
  * @example
3082
3085
  * ```ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skedyul",
3
- "version": "1.7.27",
3
+ "version": "1.7.28",
4
4
  "description": "The Skedyul SDK for Node.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -82,7 +82,7 @@
82
82
  "build": "rm -rf dist tsconfig.tsbuildinfo && tsc --emitDeclarationOnly && pnpm exec tsup-node && node -e \"require('fs').mkdirSync('dist',{recursive:true}); require('fs').writeFileSync('dist/.build-stamp', String(Date.now()))\"",
83
83
  "db:generate": "echo 'No database generation needed for this package'",
84
84
  "dev:watch": "npx nodemon --watch src --ext js,ts --exec \"pnpm run build\"",
85
- "test": "tsc --project tsconfig.tests.json && node --test dist-tests/tests/server.test.js dist-tests/tests/cli.test.js dist-tests/tests/cli-api.test.js dist-tests/tests/agent-schema-v3.test.js dist-tests/tests/ratelimit.test.js dist-tests/tests/sequencer.test.js dist-tests/tests/config-loader.test.js dist-tests/tests/gsm7.test.js dist-tests/tests/batch-operation.test.js"
85
+ "test": "tsc --project tsconfig.tests.json && node --test dist-tests/tests/server.test.js dist-tests/tests/cli.test.js dist-tests/tests/cli-api.test.js dist-tests/tests/agent-schema-v3.test.js dist-tests/tests/entity-field-definition.test.js dist-tests/tests/ratelimit.test.js dist-tests/tests/sequencer.test.js dist-tests/tests/config-loader.test.js dist-tests/tests/gsm7.test.js dist-tests/tests/batch-operation.test.js"
86
86
  },
87
87
  "keywords": [
88
88
  "mcp",