@alfe.ai/integration-manifest 0.0.7 → 0.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/index.d.ts +6 -5
- package/dist/index.js +7 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { z } from "zod";
|
|
|
8
8
|
* These are the canonical types used by all packages that interact with
|
|
9
9
|
* integration manifests -- registry, lifecycle manager, CLI, etc.
|
|
10
10
|
*/
|
|
11
|
-
type ConfigFieldType = 'secret' | 'string' | 'number' | 'boolean' | 'enum' | 'select' | 'multi_select' | 'oauth_connect'
|
|
11
|
+
type ConfigFieldType = 'secret' | 'string' | 'number' | 'boolean' | 'enum' | 'select' | 'multi_select' | 'oauth_connect';
|
|
12
12
|
interface SelectOption {
|
|
13
13
|
value: string;
|
|
14
14
|
label: string;
|
|
@@ -88,11 +88,13 @@ interface IntegrationPricingPlan {
|
|
|
88
88
|
interval?: 'month' | 'year';
|
|
89
89
|
}
|
|
90
90
|
interface IntegrationPricing {
|
|
91
|
-
type: 'free' | 'paid';
|
|
91
|
+
type: 'free' | 'paid' | 'usage';
|
|
92
92
|
/** Single price (shorthand for integrations with one plan) */
|
|
93
93
|
price?: number;
|
|
94
94
|
currency?: string;
|
|
95
95
|
interval?: 'month' | 'year';
|
|
96
|
+
/** Description of usage-based pricing (for type: 'usage') */
|
|
97
|
+
description?: string;
|
|
96
98
|
/** Multiple plans/tiers (e.g., starter, growth, scale) */
|
|
97
99
|
plans?: Record<string, IntegrationPricingPlan>;
|
|
98
100
|
}
|
|
@@ -190,7 +192,6 @@ declare const ConfigFieldTypeSchema: z.ZodEnum<{
|
|
|
190
192
|
select: "select";
|
|
191
193
|
multi_select: "multi_select";
|
|
192
194
|
oauth_connect: "oauth_connect";
|
|
193
|
-
phone_number_picker: "phone_number_picker";
|
|
194
195
|
}>;
|
|
195
196
|
/** Structured option for select/multi_select fields */
|
|
196
197
|
declare const SelectOptionSchema: z.ZodObject<{
|
|
@@ -208,7 +209,6 @@ declare const ConfigSchemaFieldSchema: z.ZodObject<{
|
|
|
208
209
|
select: "select";
|
|
209
210
|
multi_select: "multi_select";
|
|
210
211
|
oauth_connect: "oauth_connect";
|
|
211
|
-
phone_number_picker: "phone_number_picker";
|
|
212
212
|
}>;
|
|
213
213
|
label: z.ZodString;
|
|
214
214
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -324,7 +324,6 @@ declare const IntegrationManifestSchema: z.ZodObject<{
|
|
|
324
324
|
select: "select";
|
|
325
325
|
multi_select: "multi_select";
|
|
326
326
|
oauth_connect: "oauth_connect";
|
|
327
|
-
phone_number_picker: "phone_number_picker";
|
|
328
327
|
}>;
|
|
329
328
|
label: z.ZodString;
|
|
330
329
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -374,6 +373,7 @@ declare const IntegrationManifestSchema: z.ZodObject<{
|
|
|
374
373
|
type: z.ZodEnum<{
|
|
375
374
|
free: "free";
|
|
376
375
|
paid: "paid";
|
|
376
|
+
usage: "usage";
|
|
377
377
|
}>;
|
|
378
378
|
price: z.ZodOptional<z.ZodNumber>;
|
|
379
379
|
currency: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
@@ -381,6 +381,7 @@ declare const IntegrationManifestSchema: z.ZodObject<{
|
|
|
381
381
|
month: "month";
|
|
382
382
|
year: "year";
|
|
383
383
|
}>>;
|
|
384
|
+
description: z.ZodOptional<z.ZodString>;
|
|
384
385
|
plans: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
385
386
|
name: z.ZodString;
|
|
386
387
|
price: z.ZodNumber;
|
package/dist/index.js
CHANGED
|
@@ -17,8 +17,7 @@ const ConfigFieldTypeSchema = z.enum([
|
|
|
17
17
|
"enum",
|
|
18
18
|
"select",
|
|
19
19
|
"multi_select",
|
|
20
|
-
"oauth_connect"
|
|
21
|
-
"phone_number_picker"
|
|
20
|
+
"oauth_connect"
|
|
22
21
|
]);
|
|
23
22
|
/** Structured option for select/multi_select fields */
|
|
24
23
|
const SelectOptionSchema = z.object({
|
|
@@ -99,10 +98,15 @@ const IntegrationPricingPlanSchema = z.object({
|
|
|
99
98
|
interval: z.enum(["month", "year"]).optional().default("month")
|
|
100
99
|
});
|
|
101
100
|
const IntegrationPricingSchema = z.object({
|
|
102
|
-
type: z.enum([
|
|
101
|
+
type: z.enum([
|
|
102
|
+
"free",
|
|
103
|
+
"paid",
|
|
104
|
+
"usage"
|
|
105
|
+
]),
|
|
103
106
|
price: z.number().positive().optional(),
|
|
104
107
|
currency: z.string().length(3).optional().default("USD"),
|
|
105
108
|
interval: z.enum(["month", "year"]).optional(),
|
|
109
|
+
description: z.string().optional(),
|
|
106
110
|
plans: z.record(z.string(), IntegrationPricingPlanSchema).optional()
|
|
107
111
|
}).refine((pricing) => {
|
|
108
112
|
if (pricing.type === "paid") {
|
|
@@ -176,9 +180,6 @@ function buildConfigValidationSchema(configSchema) {
|
|
|
176
180
|
case "oauth_connect":
|
|
177
181
|
fieldSchema = z.string();
|
|
178
182
|
break;
|
|
179
|
-
case "phone_number_picker":
|
|
180
|
-
fieldSchema = z.string();
|
|
181
|
-
break;
|
|
182
183
|
case "number":
|
|
183
184
|
fieldSchema = z.number();
|
|
184
185
|
break;
|