@eide/foir-cli 0.1.45 → 0.1.46
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/cli.js +315 -138
- package/dist/{generated-xEC9Cfzw.d.ts → lib/config-helpers.d.ts} +95 -77
- package/dist/lib/config-helpers.js +41 -0
- package/dist/schema.graphql +93 -63
- package/package.json +4 -12
- package/dist/lib/extension-helpers.d.ts +0 -100
- package/dist/lib/extension-helpers.js +0 -23
- package/dist/lib/hook-helpers.d.ts +0 -108
- package/dist/lib/hook-helpers.js +0 -15
- package/dist/lib/seed-helpers.d.ts +0 -124
- package/dist/lib/seed-helpers.js +0 -23
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { I as InstallExtensionInput, F as FieldDefinitionInput, a as InstallExtensionModelInput, b as InstallExtensionOperationInput, c as InstallExtensionSegmentInput } from '../generated-xEC9Cfzw.js';
|
|
2
|
-
export { d as InstallExtensionAuthProviderInput, e as InstallExtensionCustomerProfileSchemaInput, f as InstallExtensionPlacementInput } from '../generated-xEC9Cfzw.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Extension configuration helpers.
|
|
6
|
-
*
|
|
7
|
-
* These helpers provide type-safe configuration for extension installation
|
|
8
|
-
* using types generated from the platform's GraphQL schema.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* import { defineExtension } from '@eide/foir-cli/extensions';
|
|
13
|
-
*
|
|
14
|
-
* export default defineExtension({
|
|
15
|
-
* key: 'my-extension',
|
|
16
|
-
* name: 'My Extension',
|
|
17
|
-
* models: [...]
|
|
18
|
-
* });
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Define an extension manifest with full type safety.
|
|
24
|
-
*
|
|
25
|
-
* This is a pass-through function that provides IntelliSense and
|
|
26
|
-
* compile-time validation for extension configurations.
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```typescript
|
|
30
|
-
* export default defineExtension({
|
|
31
|
-
* key: 'my-extension',
|
|
32
|
-
* name: 'My Extension',
|
|
33
|
-
* models: [{
|
|
34
|
-
* key: 'my_model',
|
|
35
|
-
* name: 'My Model',
|
|
36
|
-
* fields: [
|
|
37
|
-
* { key: 'title', type: 'text', label: 'Title', required: true }
|
|
38
|
-
* ]
|
|
39
|
-
* }]
|
|
40
|
-
* });
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
declare function defineExtension(config: InstallExtensionInput): InstallExtensionInput;
|
|
44
|
-
/**
|
|
45
|
-
* Define a model with type-safe field definitions.
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```typescript
|
|
49
|
-
* const myModel = defineModel({
|
|
50
|
-
* key: 'my_model',
|
|
51
|
-
* name: 'My Model',
|
|
52
|
-
* fields: [
|
|
53
|
-
* { key: 'title', type: 'text', label: 'Title', required: true }
|
|
54
|
-
* ]
|
|
55
|
-
* });
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
declare function defineModel(model: InstallExtensionModelInput): InstallExtensionModelInput;
|
|
59
|
-
/**
|
|
60
|
-
* Define a field with type safety.
|
|
61
|
-
*
|
|
62
|
-
* @example
|
|
63
|
-
* ```typescript
|
|
64
|
-
* const titleField = defineField({
|
|
65
|
-
* key: 'title',
|
|
66
|
-
* type: 'text',
|
|
67
|
-
* label: 'Title',
|
|
68
|
-
* required: true
|
|
69
|
-
* });
|
|
70
|
-
* ```
|
|
71
|
-
*/
|
|
72
|
-
declare function defineField(field: FieldDefinitionInput): FieldDefinitionInput;
|
|
73
|
-
/**
|
|
74
|
-
* Define an operation with type safety.
|
|
75
|
-
*
|
|
76
|
-
* @example
|
|
77
|
-
* ```typescript
|
|
78
|
-
* const myOperation = defineOperation({
|
|
79
|
-
* key: 'my-operation',
|
|
80
|
-
* name: 'My Operation',
|
|
81
|
-
* endpoint: '/operations/my-operation'
|
|
82
|
-
* });
|
|
83
|
-
* ```
|
|
84
|
-
*/
|
|
85
|
-
declare function defineOperation(operation: InstallExtensionOperationInput): InstallExtensionOperationInput;
|
|
86
|
-
/**
|
|
87
|
-
* Define a segment with type safety.
|
|
88
|
-
*
|
|
89
|
-
* @example
|
|
90
|
-
* ```typescript
|
|
91
|
-
* const proSegment = defineSegment({
|
|
92
|
-
* key: 'pro',
|
|
93
|
-
* name: 'Pro',
|
|
94
|
-
* rules: { type: 'condition', ... },
|
|
95
|
-
* });
|
|
96
|
-
* ```
|
|
97
|
-
*/
|
|
98
|
-
declare function defineSegment(segment: InstallExtensionSegmentInput): InstallExtensionSegmentInput;
|
|
99
|
-
|
|
100
|
-
export { FieldDefinitionInput, InstallExtensionInput, InstallExtensionModelInput, InstallExtensionOperationInput, InstallExtensionSegmentInput, defineExtension, defineField, defineModel, defineOperation, defineSegment };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// src/lib/extension-helpers.ts
|
|
2
|
-
function defineExtension(config) {
|
|
3
|
-
return config;
|
|
4
|
-
}
|
|
5
|
-
function defineModel(model) {
|
|
6
|
-
return model;
|
|
7
|
-
}
|
|
8
|
-
function defineField(field) {
|
|
9
|
-
return field;
|
|
10
|
-
}
|
|
11
|
-
function defineOperation(operation) {
|
|
12
|
-
return operation;
|
|
13
|
-
}
|
|
14
|
-
function defineSegment(segment) {
|
|
15
|
-
return segment;
|
|
16
|
-
}
|
|
17
|
-
export {
|
|
18
|
-
defineExtension,
|
|
19
|
-
defineField,
|
|
20
|
-
defineModel,
|
|
21
|
-
defineOperation,
|
|
22
|
-
defineSegment
|
|
23
|
-
};
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { C as CreateHookInput, H as HookFilterInput } from '../generated-xEC9Cfzw.js';
|
|
2
|
-
export { g as HookEvent, U as UpdateHookInput } from '../generated-xEC9Cfzw.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Hook configuration helpers.
|
|
6
|
-
*
|
|
7
|
-
* These helpers provide type-safe configuration for creating and managing
|
|
8
|
-
* hooks using types generated from the platform's GraphQL schema.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* import { defineHook } from '@eide/foir-cli/hooks';
|
|
13
|
-
*
|
|
14
|
-
* export default defineHook({
|
|
15
|
-
* key: 'notify-on-publish',
|
|
16
|
-
* name: 'Notify on Publish',
|
|
17
|
-
* event: 'RECORD_PUBLISHED',
|
|
18
|
-
* targetType: 'operation',
|
|
19
|
-
* operationKey: 'send-notification',
|
|
20
|
-
* filter: {
|
|
21
|
-
* modelKey: 'blog_post',
|
|
22
|
-
* condition: {
|
|
23
|
-
* type: 'condition',
|
|
24
|
-
* left: { type: 'context', path: 'customer.profile.plan' },
|
|
25
|
-
* operator: 'in',
|
|
26
|
-
* right: { type: 'literal', value: ['pro', 'enterprise'] },
|
|
27
|
-
* },
|
|
28
|
-
* },
|
|
29
|
-
* });
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Define a hook with full type safety.
|
|
35
|
-
*
|
|
36
|
-
* Provides IntelliSense for all hook fields including:
|
|
37
|
-
* - `key`, `name`, `event` (required)
|
|
38
|
-
* - `targetType`: 'operation' (default) or 'notification'
|
|
39
|
-
* - `operationKey`: key of the operation to execute (when targetType='operation')
|
|
40
|
-
* - `notificationConfig`: notification settings (when targetType='notification')
|
|
41
|
-
* - `filter.modelKey`: only fire for records of this model
|
|
42
|
-
* - `filter.customerSegmentKey`: only fire for customers in this segment
|
|
43
|
-
* - `filter.condition`: rule expression (JSON) for conditional execution
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```typescript
|
|
47
|
-
* // Operation hook
|
|
48
|
-
* const hook = defineHook({
|
|
49
|
-
* key: 'sync-on-create',
|
|
50
|
-
* name: 'Sync on Create',
|
|
51
|
-
* event: 'RECORD_CREATED',
|
|
52
|
-
* operationKey: 'sync-to-external',
|
|
53
|
-
* filter: { modelKey: 'product' },
|
|
54
|
-
* });
|
|
55
|
-
*
|
|
56
|
-
* // Notification hook with condition
|
|
57
|
-
* const notifyHook = defineHook({
|
|
58
|
-
* key: 'alert-vip-update',
|
|
59
|
-
* name: 'Alert on VIP Update',
|
|
60
|
-
* event: 'RECORD_UPDATED',
|
|
61
|
-
* targetType: 'notification',
|
|
62
|
-
* notificationConfig: {
|
|
63
|
-
* title: 'VIP record updated',
|
|
64
|
-
* audience: { type: 'segment', segmentId: 'vip-customers' },
|
|
65
|
-
* },
|
|
66
|
-
* filter: {
|
|
67
|
-
* condition: {
|
|
68
|
-
* type: 'condition',
|
|
69
|
-
* left: { type: 'context', path: 'customer.profile.tier' },
|
|
70
|
-
* operator: 'equals',
|
|
71
|
-
* right: { type: 'literal', value: 'vip', valueType: 'string' },
|
|
72
|
-
* },
|
|
73
|
-
* },
|
|
74
|
-
* });
|
|
75
|
-
* ```
|
|
76
|
-
*/
|
|
77
|
-
declare function defineHook(hook: CreateHookInput): CreateHookInput;
|
|
78
|
-
/**
|
|
79
|
-
* Define multiple hooks with type safety.
|
|
80
|
-
*
|
|
81
|
-
* @example
|
|
82
|
-
* ```typescript
|
|
83
|
-
* export const hooks = defineHooks([
|
|
84
|
-
* { key: 'on-create', name: 'On Create', event: 'RECORD_CREATED', operationKey: 'sync' },
|
|
85
|
-
* { key: 'on-delete', name: 'On Delete', event: 'RECORD_DELETED', operationKey: 'cleanup' },
|
|
86
|
-
* ]);
|
|
87
|
-
* ```
|
|
88
|
-
*/
|
|
89
|
-
declare function defineHooks(hooks: CreateHookInput[]): CreateHookInput[];
|
|
90
|
-
/**
|
|
91
|
-
* Define a hook filter with type safety.
|
|
92
|
-
*
|
|
93
|
-
* @example
|
|
94
|
-
* ```typescript
|
|
95
|
-
* const filter = defineHookFilter({
|
|
96
|
-
* modelKey: 'blog_post',
|
|
97
|
-
* condition: {
|
|
98
|
-
* type: 'condition',
|
|
99
|
-
* left: { type: 'field', path: 'status' },
|
|
100
|
-
* operator: 'equals',
|
|
101
|
-
* right: { type: 'literal', value: 'published', valueType: 'string' },
|
|
102
|
-
* },
|
|
103
|
-
* });
|
|
104
|
-
* ```
|
|
105
|
-
*/
|
|
106
|
-
declare function defineHookFilter(filter: HookFilterInput): HookFilterInput;
|
|
107
|
-
|
|
108
|
-
export { CreateHookInput, HookFilterInput, defineHook, defineHookFilter, defineHooks };
|
package/dist/lib/hook-helpers.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// src/lib/hook-helpers.ts
|
|
2
|
-
function defineHook(hook) {
|
|
3
|
-
return hook;
|
|
4
|
-
}
|
|
5
|
-
function defineHooks(hooks) {
|
|
6
|
-
return hooks;
|
|
7
|
-
}
|
|
8
|
-
function defineHookFilter(filter) {
|
|
9
|
-
return filter;
|
|
10
|
-
}
|
|
11
|
-
export {
|
|
12
|
-
defineHook,
|
|
13
|
-
defineHookFilter,
|
|
14
|
-
defineHooks
|
|
15
|
-
};
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { F as FieldDefinitionInput, h as CreateModelInput, i as CreateRecordInput } from '../generated-xEC9Cfzw.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Model and record seed configuration helpers.
|
|
5
|
-
*
|
|
6
|
-
* These helpers provide type-safe configuration for seeding models and records
|
|
7
|
-
* using types generated from the platform's GraphQL schema.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* import { defineModels, defineRecords } from '@eide/foir-cli/seed';
|
|
12
|
-
*
|
|
13
|
-
* // Define models
|
|
14
|
-
* export const models = defineModels([
|
|
15
|
-
* {
|
|
16
|
-
* key: 'my_model',
|
|
17
|
-
* name: 'My Model',
|
|
18
|
-
* fields: [...]
|
|
19
|
-
* }
|
|
20
|
-
* ]);
|
|
21
|
-
*
|
|
22
|
-
* // Define records
|
|
23
|
-
* export const records = defineRecords([
|
|
24
|
-
* {
|
|
25
|
-
* modelKey: 'my_model',
|
|
26
|
-
* naturalKey: 'my-record',
|
|
27
|
-
* data: { ... }
|
|
28
|
-
* }
|
|
29
|
-
* ]);
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Define a single model with type safety.
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```typescript
|
|
38
|
-
* export default defineModel({
|
|
39
|
-
* key: 'tilly_page',
|
|
40
|
-
* name: 'Tilly Page',
|
|
41
|
-
* fields: [
|
|
42
|
-
* { key: 'title', type: 'text', label: 'Title', required: true }
|
|
43
|
-
* ],
|
|
44
|
-
* config: {
|
|
45
|
-
* versioning: true,
|
|
46
|
-
* publishing: true
|
|
47
|
-
* }
|
|
48
|
-
* });
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
declare function defineModel(model: CreateModelInput): CreateModelInput;
|
|
52
|
-
/**
|
|
53
|
-
* Define multiple models with type safety.
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```typescript
|
|
57
|
-
* export default defineModels([
|
|
58
|
-
* {
|
|
59
|
-
* key: 'model_a',
|
|
60
|
-
* name: 'Model A',
|
|
61
|
-
* fields: [...]
|
|
62
|
-
* },
|
|
63
|
-
* {
|
|
64
|
-
* key: 'model_b',
|
|
65
|
-
* name: 'Model B',
|
|
66
|
-
* fields: [...]
|
|
67
|
-
* }
|
|
68
|
-
* ]);
|
|
69
|
-
* ```
|
|
70
|
-
*/
|
|
71
|
-
declare function defineModels(models: CreateModelInput[]): CreateModelInput[];
|
|
72
|
-
/**
|
|
73
|
-
* Define a single record with type safety.
|
|
74
|
-
*
|
|
75
|
-
* @example
|
|
76
|
-
* ```typescript
|
|
77
|
-
* export default defineRecord({
|
|
78
|
-
* modelKey: 'tilly_page',
|
|
79
|
-
* naturalKey: 'home',
|
|
80
|
-
* data: {
|
|
81
|
-
* title: 'Home Page',
|
|
82
|
-
* blocks: [...]
|
|
83
|
-
* }
|
|
84
|
-
* });
|
|
85
|
-
* ```
|
|
86
|
-
*/
|
|
87
|
-
declare function defineRecord(record: CreateRecordInput): CreateRecordInput;
|
|
88
|
-
/**
|
|
89
|
-
* Define multiple records with type safety.
|
|
90
|
-
*
|
|
91
|
-
* @example
|
|
92
|
-
* ```typescript
|
|
93
|
-
* export default defineRecords([
|
|
94
|
-
* {
|
|
95
|
-
* modelKey: 'tilly_page',
|
|
96
|
-
* naturalKey: 'home',
|
|
97
|
-
* data: { title: 'Home' }
|
|
98
|
-
* },
|
|
99
|
-
* {
|
|
100
|
-
* modelKey: 'tilly_page',
|
|
101
|
-
* naturalKey: 'about',
|
|
102
|
-
* data: { title: 'About' }
|
|
103
|
-
* }
|
|
104
|
-
* ]);
|
|
105
|
-
* ```
|
|
106
|
-
*/
|
|
107
|
-
declare function defineRecords(records: CreateRecordInput[]): CreateRecordInput[];
|
|
108
|
-
/**
|
|
109
|
-
* Define a field with type safety.
|
|
110
|
-
* Alias of the extension helper for convenience.
|
|
111
|
-
*
|
|
112
|
-
* @example
|
|
113
|
-
* ```typescript
|
|
114
|
-
* const titleField = defineField({
|
|
115
|
-
* key: 'title',
|
|
116
|
-
* type: 'text',
|
|
117
|
-
* label: 'Title',
|
|
118
|
-
* required: true
|
|
119
|
-
* });
|
|
120
|
-
* ```
|
|
121
|
-
*/
|
|
122
|
-
declare function defineField(field: FieldDefinitionInput): FieldDefinitionInput;
|
|
123
|
-
|
|
124
|
-
export { CreateModelInput, CreateRecordInput, FieldDefinitionInput, defineField, defineModel, defineModels, defineRecord, defineRecords };
|
package/dist/lib/seed-helpers.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// src/lib/seed-helpers.ts
|
|
2
|
-
function defineModel(model) {
|
|
3
|
-
return model;
|
|
4
|
-
}
|
|
5
|
-
function defineModels(models) {
|
|
6
|
-
return models;
|
|
7
|
-
}
|
|
8
|
-
function defineRecord(record) {
|
|
9
|
-
return record;
|
|
10
|
-
}
|
|
11
|
-
function defineRecords(records) {
|
|
12
|
-
return records;
|
|
13
|
-
}
|
|
14
|
-
function defineField(field) {
|
|
15
|
-
return field;
|
|
16
|
-
}
|
|
17
|
-
export {
|
|
18
|
-
defineField,
|
|
19
|
-
defineModel,
|
|
20
|
-
defineModels,
|
|
21
|
-
defineRecord,
|
|
22
|
-
defineRecords
|
|
23
|
-
};
|