skedyul 1.0.8 → 1.0.9

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
- 1772517901674
1
+ 1772576645071
@@ -62,12 +62,11 @@ export interface BaseDefinition {
62
62
  */
63
63
  export type Scope = 'internal' | 'shared';
64
64
  /**
65
- * Field owner determines who can modify a field's value.
66
- * - 'app': Only the app can modify (via tools/webhooks)
67
- * - 'workplace': Only the user can modify (via UI)
68
- * - 'both': Either can modify
65
+ * Field owner determines who controls the field definition.
66
+ * - 'app': App controls the definition (options, validation). Creates app-scoped definitions.
67
+ * - 'shared': Workplace controls the definition. Field can be shared across apps.
69
68
  */
70
- export type FieldOwner = 'app' | 'workplace' | 'both';
69
+ export type FieldOwner = 'app' | 'shared';
71
70
  /**
72
71
  * Visibility setting for environment variables.
73
72
  * - 'visible': Value is shown in UI
@@ -74,8 +74,13 @@ export interface FieldDefinition {
74
74
  type?: FieldType;
75
75
  /** Reference to a shared field definition by handle */
76
76
  definitionHandle?: string;
77
- /** Inline definition with options and constraints */
78
- definition?: InlineFieldDefinition;
77
+ /**
78
+ * Inline definition with options/constraints, OR string reference to global definition.
79
+ * - String: References global definition (e.g., 'phone', 'email')
80
+ * - Object: Inline definition with options
81
+ * - Omitted: Auto-creates workplace definition as <subdomain>/<model>/<field>
82
+ */
83
+ definition?: InlineFieldDefinition | string;
79
84
  /** Whether this field is required */
80
85
  required?: boolean;
81
86
  /** Whether this field must be unique across all records */
@@ -90,7 +95,7 @@ export interface FieldDefinition {
90
95
  description?: string;
91
96
  /** Visibility settings */
92
97
  visibility?: FieldVisibility;
93
- /** Who can modify this field */
98
+ /** Who controls the field definition: 'app' or 'shared' */
94
99
  owner?: FieldOwner;
95
100
  }
96
101
  /**
@@ -652,65 +652,6 @@ export declare const resource: {
652
652
  */
653
653
  link(params: ResourceLinkParams): Promise<ResourceLinkResult>;
654
654
  };
655
- /**
656
- * Parameters for creating a contact association link.
657
- */
658
- export interface ContactAssociationLinkCreateParams {
659
- /** Communication channel ID to link */
660
- communicationChannelId: string;
661
- /** Model ID to associate contacts with */
662
- modelId: string;
663
- /** Field ID providing the identifier (phone/email) */
664
- identifierFieldId: string;
665
- }
666
- /**
667
- * Result from contactAssociationLink.create
668
- */
669
- export interface ContactAssociationLinkCreateResult {
670
- /** Created ContactAssociationLink ID */
671
- id: string;
672
- /** Model name for display */
673
- modelName: string;
674
- /** Field label for display */
675
- identifierFieldLabel: string;
676
- }
677
- export declare const contactAssociationLink: {
678
- /**
679
- * Create a contact association link between a channel and a model.
680
- *
681
- * Links a CommunicationChannel to a Model, specifying which field
682
- * provides the identifier value (phone/email) for contact association.
683
- *
684
- * The API token determines the context (app installation is embedded in sk_wkp_ tokens).
685
- *
686
- * @param params - Link creation parameters
687
- *
688
- * @example
689
- * ```ts
690
- * // Link a phone channel to the Clients model using the phone field
691
- * const link = await contactAssociationLink.create({
692
- * communicationChannelId: channel.id,
693
- * modelId: clientsModelId,
694
- * identifierFieldId: phoneFieldId,
695
- * })
696
- * ```
697
- */
698
- create(params: ContactAssociationLinkCreateParams): Promise<ContactAssociationLinkCreateResult>;
699
- /**
700
- * List contact association links for a channel.
701
- *
702
- * @param communicationChannelId - Channel to list links for
703
- */
704
- list(communicationChannelId: string): Promise<ContactAssociationLinkCreateResult[]>;
705
- /**
706
- * Delete a contact association link.
707
- *
708
- * @param id - ContactAssociationLink ID to delete
709
- */
710
- delete(id: string): Promise<{
711
- success: boolean;
712
- }>;
713
- };
714
655
  /**
715
656
  * Text content part for multimodal messages.
716
657
  */
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ai = exports.contactAssociationLink = exports.resource = exports.webhook = exports.file = exports.token = exports.instance = exports.communicationChannel = exports.workplace = void 0;
3
+ exports.ai = exports.resource = exports.webhook = exports.file = exports.token = exports.instance = exports.communicationChannel = exports.workplace = void 0;
4
4
  exports.runWithConfig = runWithConfig;
5
5
  exports.configure = configure;
6
6
  exports.getConfig = getConfig;
@@ -619,50 +619,6 @@ exports.resource = {
619
619
  return data;
620
620
  },
621
621
  };
622
- exports.contactAssociationLink = {
623
- /**
624
- * Create a contact association link between a channel and a model.
625
- *
626
- * Links a CommunicationChannel to a Model, specifying which field
627
- * provides the identifier value (phone/email) for contact association.
628
- *
629
- * The API token determines the context (app installation is embedded in sk_wkp_ tokens).
630
- *
631
- * @param params - Link creation parameters
632
- *
633
- * @example
634
- * ```ts
635
- * // Link a phone channel to the Clients model using the phone field
636
- * const link = await contactAssociationLink.create({
637
- * communicationChannelId: channel.id,
638
- * modelId: clientsModelId,
639
- * identifierFieldId: phoneFieldId,
640
- * })
641
- * ```
642
- */
643
- async create(params) {
644
- const { data } = await callCore('contactAssociationLink.create', { ...params });
645
- return data;
646
- },
647
- /**
648
- * List contact association links for a channel.
649
- *
650
- * @param communicationChannelId - Channel to list links for
651
- */
652
- async list(communicationChannelId) {
653
- const { data } = await callCore('contactAssociationLink.list', { communicationChannelId });
654
- return data;
655
- },
656
- /**
657
- * Delete a contact association link.
658
- *
659
- * @param id - ContactAssociationLink ID to delete
660
- */
661
- async delete(id) {
662
- const { data } = await callCore('contactAssociationLink.delete', { id });
663
- return data;
664
- },
665
- };
666
622
  /**
667
623
  * Convert a Zod schema to JSON Schema format for transport using Zod's built-in conversion.
668
624
  * Uses z.toJSONSchema() from Zod 4 for accurate schema conversion.
package/dist/index.d.ts CHANGED
@@ -7,8 +7,8 @@ export { DEFAULT_DOCKERFILE } from './dockerfile';
7
7
  export { InstallError, MissingRequiredFieldError, AuthenticationError, InvalidConfigurationError, ConnectionError, AppAuthInvalidError, } from './errors';
8
8
  export type { InstallErrorCode } from './errors';
9
9
  export { z };
10
- export { workplace, communicationChannel, instance, token, file, webhook, resource, contactAssociationLink, ai, configure, getConfig, runWithConfig, } from './core/client';
11
- export type { InstanceContext, InstanceData, InstanceMeta, InstancePagination, InstanceListResult, InstanceListArgs, FileInfo, FileUrlResponse, FileUploadParams, FileUploadResult, WebhookCreateResult, WebhookListItem, WebhookDeleteByNameOptions, WebhookListOptions, ResourceLinkParams, ResourceLinkResult, ContactAssociationLinkCreateParams, ContactAssociationLinkCreateResult, AITextContent, AIFileContent, AIImageContent, AIMessageContent, AIMessage, GenerateObjectOptions, GenerateObjectResult, } from './core/client';
10
+ export { workplace, communicationChannel, instance, token, file, webhook, resource, ai, configure, getConfig, runWithConfig, } from './core/client';
11
+ export type { InstanceContext, InstanceData, InstanceMeta, InstancePagination, InstanceListResult, InstanceListArgs, FileInfo, FileUrlResponse, FileUploadParams, FileUploadResult, WebhookCreateResult, WebhookListItem, WebhookDeleteByNameOptions, WebhookListOptions, ResourceLinkParams, ResourceLinkResult, AITextContent, AIFileContent, AIImageContent, AIMessageContent, AIMessage, GenerateObjectOptions, GenerateObjectResult, } from './core/client';
12
12
  export { createContextLogger } from './server/logger';
13
13
  export type { ContextLogger } from './server/logger';
14
14
  declare const _default: {
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.getRequiredInstallEnvKeys = exports.getAllEnvKeys = exports.CONFIG_FILE_NAMES = exports.validateConfig = exports.loadConfig = exports.defineNavigation = exports.defineEnv = exports.defineAgent = exports.defineWorkflow = exports.definePage = exports.defineChannel = exports.defineModel = exports.defineConfig = exports.createContextLogger = exports.runWithConfig = exports.getConfig = exports.configure = exports.ai = exports.contactAssociationLink = exports.resource = exports.webhook = exports.file = exports.token = exports.instance = exports.communicationChannel = exports.workplace = exports.z = exports.AppAuthInvalidError = exports.ConnectionError = exports.InvalidConfigurationError = exports.AuthenticationError = exports.MissingRequiredFieldError = exports.InstallError = exports.DEFAULT_DOCKERFILE = exports.server = exports.ToolResponseMetaSchema = void 0;
17
+ exports.getRequiredInstallEnvKeys = exports.getAllEnvKeys = exports.CONFIG_FILE_NAMES = exports.validateConfig = exports.loadConfig = exports.defineNavigation = exports.defineEnv = exports.defineAgent = exports.defineWorkflow = exports.definePage = exports.defineChannel = exports.defineModel = exports.defineConfig = exports.createContextLogger = exports.runWithConfig = exports.getConfig = exports.configure = exports.ai = exports.resource = exports.webhook = exports.file = exports.token = exports.instance = exports.communicationChannel = exports.workplace = exports.z = exports.AppAuthInvalidError = exports.ConnectionError = exports.InvalidConfigurationError = exports.AuthenticationError = exports.MissingRequiredFieldError = exports.InstallError = exports.DEFAULT_DOCKERFILE = exports.server = exports.ToolResponseMetaSchema = void 0;
18
18
  const v4_1 = require("zod/v4");
19
19
  Object.defineProperty(exports, "z", { enumerable: true, get: function () { return v4_1.z; } });
20
20
  __exportStar(require("./types"), exports);
@@ -41,7 +41,6 @@ Object.defineProperty(exports, "token", { enumerable: true, get: function () { r
41
41
  Object.defineProperty(exports, "file", { enumerable: true, get: function () { return client_1.file; } });
42
42
  Object.defineProperty(exports, "webhook", { enumerable: true, get: function () { return client_1.webhook; } });
43
43
  Object.defineProperty(exports, "resource", { enumerable: true, get: function () { return client_1.resource; } });
44
- Object.defineProperty(exports, "contactAssociationLink", { enumerable: true, get: function () { return client_1.contactAssociationLink; } });
45
44
  Object.defineProperty(exports, "ai", { enumerable: true, get: function () { return client_1.ai; } });
46
45
  Object.defineProperty(exports, "configure", { enumerable: true, get: function () { return client_1.configure; } });
47
46
  Object.defineProperty(exports, "getConfig", { enumerable: true, get: function () { return client_1.getConfig; } });
package/dist/schemas.d.ts CHANGED
@@ -31,8 +31,7 @@ export declare const ComputeLayerTypeSchema: z.ZodEnum<{
31
31
  }>;
32
32
  export declare const FieldOwnerSchema: z.ZodEnum<{
33
33
  APP: "APP";
34
- WORKPLACE: "WORKPLACE";
35
- BOTH: "BOTH";
34
+ SHARED: "SHARED";
36
35
  }>;
37
36
  export declare const StructuredFilterSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
38
37
  export declare const ModelDependencySchema: z.ZodObject<{
@@ -109,7 +108,7 @@ export declare const ModelFieldDefinitionSchema: z.ZodObject<{
109
108
  OBJECT: "OBJECT";
110
109
  }>>;
111
110
  definitionHandle: z.ZodOptional<z.ZodString>;
112
- definition: z.ZodOptional<z.ZodObject<{
111
+ definition: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
113
112
  limitChoices: z.ZodOptional<z.ZodNumber>;
114
113
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
115
114
  label: z.ZodString;
@@ -122,7 +121,7 @@ export declare const ModelFieldDefinitionSchema: z.ZodObject<{
122
121
  max: z.ZodOptional<z.ZodNumber>;
123
122
  relatedModel: z.ZodOptional<z.ZodString>;
124
123
  pattern: z.ZodOptional<z.ZodString>;
125
- }, z.core.$strip>>;
124
+ }, z.core.$strip>, z.ZodString]>>;
126
125
  required: z.ZodOptional<z.ZodBoolean>;
127
126
  unique: z.ZodOptional<z.ZodBoolean>;
128
127
  system: z.ZodOptional<z.ZodBoolean>;
@@ -138,8 +137,7 @@ export declare const ModelFieldDefinitionSchema: z.ZodObject<{
138
137
  }, z.core.$strip>>;
139
138
  owner: z.ZodOptional<z.ZodEnum<{
140
139
  APP: "APP";
141
- WORKPLACE: "WORKPLACE";
142
- BOTH: "BOTH";
140
+ SHARED: "SHARED";
143
141
  }>>;
144
142
  }, z.core.$strip>;
145
143
  export declare const ModelDefinitionSchema: z.ZodObject<{
@@ -165,7 +163,7 @@ export declare const ModelDefinitionSchema: z.ZodObject<{
165
163
  OBJECT: "OBJECT";
166
164
  }>>;
167
165
  definitionHandle: z.ZodOptional<z.ZodString>;
168
- definition: z.ZodOptional<z.ZodObject<{
166
+ definition: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
169
167
  limitChoices: z.ZodOptional<z.ZodNumber>;
170
168
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
171
169
  label: z.ZodString;
@@ -178,7 +176,7 @@ export declare const ModelDefinitionSchema: z.ZodObject<{
178
176
  max: z.ZodOptional<z.ZodNumber>;
179
177
  relatedModel: z.ZodOptional<z.ZodString>;
180
178
  pattern: z.ZodOptional<z.ZodString>;
181
- }, z.core.$strip>>;
179
+ }, z.core.$strip>, z.ZodString]>>;
182
180
  required: z.ZodOptional<z.ZodBoolean>;
183
181
  unique: z.ZodOptional<z.ZodBoolean>;
184
182
  system: z.ZodOptional<z.ZodBoolean>;
@@ -194,8 +192,7 @@ export declare const ModelDefinitionSchema: z.ZodObject<{
194
192
  }, z.core.$strip>>;
195
193
  owner: z.ZodOptional<z.ZodEnum<{
196
194
  APP: "APP";
197
- WORKPLACE: "WORKPLACE";
198
- BOTH: "BOTH";
195
+ SHARED: "SHARED";
199
196
  }>>;
200
197
  }, z.core.$strip>>;
201
198
  requires: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
@@ -2809,7 +2806,7 @@ export declare const InstallConfigSchema: z.ZodObject<{
2809
2806
  OBJECT: "OBJECT";
2810
2807
  }>>;
2811
2808
  definitionHandle: z.ZodOptional<z.ZodString>;
2812
- definition: z.ZodOptional<z.ZodObject<{
2809
+ definition: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
2813
2810
  limitChoices: z.ZodOptional<z.ZodNumber>;
2814
2811
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
2815
2812
  label: z.ZodString;
@@ -2822,7 +2819,7 @@ export declare const InstallConfigSchema: z.ZodObject<{
2822
2819
  max: z.ZodOptional<z.ZodNumber>;
2823
2820
  relatedModel: z.ZodOptional<z.ZodString>;
2824
2821
  pattern: z.ZodOptional<z.ZodString>;
2825
- }, z.core.$strip>>;
2822
+ }, z.core.$strip>, z.ZodString]>>;
2826
2823
  required: z.ZodOptional<z.ZodBoolean>;
2827
2824
  unique: z.ZodOptional<z.ZodBoolean>;
2828
2825
  system: z.ZodOptional<z.ZodBoolean>;
@@ -2838,8 +2835,7 @@ export declare const InstallConfigSchema: z.ZodObject<{
2838
2835
  }, z.core.$strip>>;
2839
2836
  owner: z.ZodOptional<z.ZodEnum<{
2840
2837
  APP: "APP";
2841
- WORKPLACE: "WORKPLACE";
2842
- BOTH: "BOTH";
2838
+ SHARED: "SHARED";
2843
2839
  }>>;
2844
2840
  }, z.core.$strip>>;
2845
2841
  requires: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
@@ -2911,7 +2907,7 @@ export declare const ProvisionConfigSchema: z.ZodObject<{
2911
2907
  OBJECT: "OBJECT";
2912
2908
  }>>;
2913
2909
  definitionHandle: z.ZodOptional<z.ZodString>;
2914
- definition: z.ZodOptional<z.ZodObject<{
2910
+ definition: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
2915
2911
  limitChoices: z.ZodOptional<z.ZodNumber>;
2916
2912
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
2917
2913
  label: z.ZodString;
@@ -2924,7 +2920,7 @@ export declare const ProvisionConfigSchema: z.ZodObject<{
2924
2920
  max: z.ZodOptional<z.ZodNumber>;
2925
2921
  relatedModel: z.ZodOptional<z.ZodString>;
2926
2922
  pattern: z.ZodOptional<z.ZodString>;
2927
- }, z.core.$strip>>;
2923
+ }, z.core.$strip>, z.ZodString]>>;
2928
2924
  required: z.ZodOptional<z.ZodBoolean>;
2929
2925
  unique: z.ZodOptional<z.ZodBoolean>;
2930
2926
  system: z.ZodOptional<z.ZodBoolean>;
@@ -2940,8 +2936,7 @@ export declare const ProvisionConfigSchema: z.ZodObject<{
2940
2936
  }, z.core.$strip>>;
2941
2937
  owner: z.ZodOptional<z.ZodEnum<{
2942
2938
  APP: "APP";
2943
- WORKPLACE: "WORKPLACE";
2944
- BOTH: "BOTH";
2939
+ SHARED: "SHARED";
2945
2940
  }>>;
2946
2941
  }, z.core.$strip>>;
2947
2942
  requires: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
@@ -3538,7 +3533,7 @@ export declare const SkedyulConfigSchema: z.ZodObject<{
3538
3533
  OBJECT: "OBJECT";
3539
3534
  }>>;
3540
3535
  definitionHandle: z.ZodOptional<z.ZodString>;
3541
- definition: z.ZodOptional<z.ZodObject<{
3536
+ definition: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
3542
3537
  limitChoices: z.ZodOptional<z.ZodNumber>;
3543
3538
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
3544
3539
  label: z.ZodString;
@@ -3551,7 +3546,7 @@ export declare const SkedyulConfigSchema: z.ZodObject<{
3551
3546
  max: z.ZodOptional<z.ZodNumber>;
3552
3547
  relatedModel: z.ZodOptional<z.ZodString>;
3553
3548
  pattern: z.ZodOptional<z.ZodString>;
3554
- }, z.core.$strip>>;
3549
+ }, z.core.$strip>, z.ZodString]>>;
3555
3550
  required: z.ZodOptional<z.ZodBoolean>;
3556
3551
  unique: z.ZodOptional<z.ZodBoolean>;
3557
3552
  system: z.ZodOptional<z.ZodBoolean>;
@@ -3567,8 +3562,7 @@ export declare const SkedyulConfigSchema: z.ZodObject<{
3567
3562
  }, z.core.$strip>>;
3568
3563
  owner: z.ZodOptional<z.ZodEnum<{
3569
3564
  APP: "APP";
3570
- WORKPLACE: "WORKPLACE";
3571
- BOTH: "BOTH";
3565
+ SHARED: "SHARED";
3572
3566
  }>>;
3573
3567
  }, z.core.$strip>>;
3574
3568
  requires: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
package/dist/schemas.js CHANGED
@@ -27,7 +27,7 @@ exports.ComputeLayerTypeSchema = v4_1.z.enum(['serverless', 'dedicated']);
27
27
  // ─────────────────────────────────────────────────────────────────────────────
28
28
  // Resource Dependencies
29
29
  // ─────────────────────────────────────────────────────────────────────────────
30
- exports.FieldOwnerSchema = v4_1.z.enum(['APP', 'WORKPLACE', 'BOTH']);
30
+ exports.FieldOwnerSchema = v4_1.z.enum(['APP', 'SHARED']);
31
31
  const PrimitiveSchema = v4_1.z.union([v4_1.z.string(), v4_1.z.number(), v4_1.z.boolean()]);
32
32
  exports.StructuredFilterSchema = v4_1.z.record(v4_1.z.string(), v4_1.z.record(v4_1.z.string(), v4_1.z.union([PrimitiveSchema, v4_1.z.array(PrimitiveSchema)])));
33
33
  exports.ModelDependencySchema = v4_1.z.object({
@@ -87,7 +87,7 @@ exports.ModelFieldDefinitionSchema = v4_1.z.object({
87
87
  label: v4_1.z.string(),
88
88
  type: exports.FieldDataTypeSchema.optional(),
89
89
  definitionHandle: v4_1.z.string().optional(),
90
- definition: exports.InlineFieldDefinitionSchema.optional(),
90
+ definition: v4_1.z.union([exports.InlineFieldDefinitionSchema, v4_1.z.string()]).optional(),
91
91
  required: v4_1.z.boolean().optional(),
92
92
  unique: v4_1.z.boolean().optional(),
93
93
  system: v4_1.z.boolean().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skedyul",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "The Skedyul SDK for Node.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",