@eide/foir-cli 0.1.46 → 0.2.0

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.
@@ -1,207 +1,3 @@
1
- type Maybe<T> = T | null;
2
- type InputMaybe<T> = Maybe<T>;
3
- /** All built-in and custom scalars, mapped to their actual values */
4
- type Scalars = {
5
- ID: {
6
- input: string;
7
- output: string;
8
- };
9
- String: {
10
- input: string;
11
- output: string;
12
- };
13
- Boolean: {
14
- input: boolean;
15
- output: boolean;
16
- };
17
- Int: {
18
- input: number;
19
- output: number;
20
- };
21
- Float: {
22
- input: number;
23
- output: number;
24
- };
25
- /** The `BigInt` scalar type represents non-fractional signed whole numeric values. */
26
- BigInt: {
27
- input: any;
28
- output: any;
29
- };
30
- DateTime: {
31
- input: string;
32
- output: string;
33
- };
34
- JSON: {
35
- input: unknown;
36
- output: unknown;
37
- };
38
- };
39
- type ApplyConfigAuthProviderInput = {
40
- captureMetadata?: InputMaybe<Scalars['Boolean']['input']>;
41
- config: Scalars['JSON']['input'];
42
- enabled?: InputMaybe<Scalars['Boolean']['input']>;
43
- isDefault?: InputMaybe<Scalars['Boolean']['input']>;
44
- key: Scalars['String']['input'];
45
- name: Scalars['String']['input'];
46
- priority?: InputMaybe<Scalars['Int']['input']>;
47
- type: Scalars['String']['input'];
48
- verifyExternalCustomer?: InputMaybe<Scalars['Boolean']['input']>;
49
- };
50
- type ApplyConfigCustomerProfileSchemaInput = {
51
- /** Array of field definitions for customer profile */
52
- fields: Array<FieldDefinitionInput>;
53
- publicFields?: InputMaybe<Array<Scalars['String']['input']>>;
54
- };
55
- type ApplyConfigHookInput$1 = {
56
- description?: InputMaybe<Scalars['String']['input']>;
57
- event: Scalars['String']['input'];
58
- filter?: InputMaybe<Scalars['JSON']['input']>;
59
- isActive?: InputMaybe<Scalars['Boolean']['input']>;
60
- key: Scalars['String']['input'];
61
- name: Scalars['String']['input'];
62
- notificationConfig?: InputMaybe<Scalars['JSON']['input']>;
63
- operationKey?: InputMaybe<Scalars['String']['input']>;
64
- targetType?: InputMaybe<Scalars['String']['input']>;
65
- };
66
- /** Full config provisioning input — one manifest, full setup. */
67
- type ApplyConfigInput = {
68
- authProviders?: InputMaybe<Array<ApplyConfigAuthProviderInput>>;
69
- config?: InputMaybe<Scalars['JSON']['input']>;
70
- configType?: InputMaybe<Scalars['String']['input']>;
71
- connectionDomain?: InputMaybe<Scalars['String']['input']>;
72
- credentials?: InputMaybe<Scalars['JSON']['input']>;
73
- customerProfileSchema?: InputMaybe<ApplyConfigCustomerProfileSchemaInput>;
74
- description?: InputMaybe<Scalars['String']['input']>;
75
- direction?: InputMaybe<Scalars['String']['input']>;
76
- /** If true, delete existing config before applying (force reinstall) */
77
- force?: InputMaybe<Scalars['Boolean']['input']>;
78
- hooks?: InputMaybe<Array<ApplyConfigHookInput$1>>;
79
- key: Scalars['String']['input'];
80
- models?: InputMaybe<Array<ApplyConfigModelInput>>;
81
- name: Scalars['String']['input'];
82
- /** Base URL prepended to relative operation endpoints */
83
- operationBaseUrl?: InputMaybe<Scalars['String']['input']>;
84
- operations?: InputMaybe<Array<ApplyConfigOperationInput>>;
85
- placements?: InputMaybe<Array<ApplyConfigPlacementInput>>;
86
- schedules?: InputMaybe<Array<ApplyConfigScheduleInput>>;
87
- segments?: InputMaybe<Array<ApplyConfigSegmentInput>>;
88
- };
89
- type ApplyConfigModelInput = {
90
- category?: InputMaybe<Scalars['String']['input']>;
91
- config?: InputMaybe<ModelConfigInput>;
92
- description?: InputMaybe<Scalars['String']['input']>;
93
- /** Array of field definitions (must be an array, not an object!) */
94
- fields: Array<FieldDefinitionInput>;
95
- hooks?: InputMaybe<Scalars['JSON']['input']>;
96
- icon?: InputMaybe<Scalars['String']['input']>;
97
- key: Scalars['String']['input'];
98
- name: Scalars['String']['input'];
99
- pluralName?: InputMaybe<Scalars['String']['input']>;
100
- };
101
- type ApplyConfigOperationInput = {
102
- category?: InputMaybe<Scalars['String']['input']>;
103
- description?: InputMaybe<Scalars['String']['input']>;
104
- endpoint: Scalars['String']['input'];
105
- key: Scalars['String']['input'];
106
- name: Scalars['String']['input'];
107
- precondition?: InputMaybe<OperationPreconditionInput>;
108
- quotas?: InputMaybe<Array<OperationQuotaInput>>;
109
- retryPolicy?: InputMaybe<RetryPolicyInput>;
110
- timeoutMs?: InputMaybe<Scalars['Int']['input']>;
111
- touchPoints?: InputMaybe<Array<Scalars['String']['input']>>;
112
- };
113
- type ApplyConfigPlacementInput = {
114
- allowedOrigin?: InputMaybe<Scalars['String']['input']>;
115
- height?: InputMaybe<Scalars['String']['input']>;
116
- hideContentTab?: InputMaybe<Scalars['Boolean']['input']>;
117
- modelKeys?: InputMaybe<Array<Scalars['String']['input']>>;
118
- tabName?: InputMaybe<Scalars['String']['input']>;
119
- type: Scalars['String']['input'];
120
- url: Scalars['String']['input'];
121
- };
122
- type ApplyConfigScheduleInput = {
123
- cron: Scalars['String']['input'];
124
- description?: InputMaybe<Scalars['String']['input']>;
125
- isActive?: InputMaybe<Scalars['Boolean']['input']>;
126
- key: Scalars['String']['input'];
127
- name: Scalars['String']['input'];
128
- /** Key of the operation this schedule triggers */
129
- operationKey: Scalars['String']['input'];
130
- timezone?: InputMaybe<Scalars['String']['input']>;
131
- };
132
- type ApplyConfigSegmentInput = {
133
- description?: InputMaybe<Scalars['String']['input']>;
134
- evaluationMode?: InputMaybe<Scalars['String']['input']>;
135
- isActive?: InputMaybe<Scalars['Boolean']['input']>;
136
- key: Scalars['String']['input'];
137
- name: Scalars['String']['input'];
138
- rules: Scalars['JSON']['input'];
139
- };
140
- /** Field definition for a model */
141
- type FieldDefinitionInput = {
142
- config?: InputMaybe<Scalars['JSON']['input']>;
143
- defaultValue?: InputMaybe<Scalars['JSON']['input']>;
144
- helpText?: InputMaybe<Scalars['String']['input']>;
145
- id?: InputMaybe<Scalars['String']['input']>;
146
- isTranslatable?: InputMaybe<Scalars['Boolean']['input']>;
147
- key: Scalars['String']['input'];
148
- label: Scalars['String']['input'];
149
- placeholder?: InputMaybe<Scalars['String']['input']>;
150
- required?: InputMaybe<Scalars['Boolean']['input']>;
151
- type: Scalars['String']['input'];
152
- validation?: InputMaybe<Array<ValidationRuleInput>>;
153
- };
154
- /** Model configuration options */
155
- type ModelConfigInput = {
156
- customerScoped?: InputMaybe<Scalars['Boolean']['input']>;
157
- publishing?: InputMaybe<Scalars['Boolean']['input']>;
158
- sharing?: InputMaybe<SharingConfigInput>;
159
- variants?: InputMaybe<Scalars['Boolean']['input']>;
160
- versioning?: InputMaybe<Scalars['Boolean']['input']>;
161
- };
162
- /** Pre-execution guard input for operation create/update */
163
- type OperationPreconditionInput = {
164
- /** Custom error message when precondition fails */
165
- message?: InputMaybe<Scalars['String']['input']>;
166
- /** Rule expression (RuleExpression as JSON) — must evaluate to true */
167
- rule?: InputMaybe<Scalars['JSON']['input']>;
168
- /** Segment key — customer must be a member to execute */
169
- segmentKey?: InputMaybe<Scalars['String']['input']>;
170
- };
171
- /** Quota rule input for operation create/update */
172
- type OperationQuotaInput = {
173
- /** Optional condition expression (RuleExpression as JSON) */
174
- condition?: InputMaybe<Scalars['JSON']['input']>;
175
- /** Duration window in seconds */
176
- duration: Scalars['Int']['input'];
177
- /** Max points per duration window (0 = unlimited) */
178
- points: Scalars['Int']['input'];
179
- /** Scope for quota tracking: customer, user, or tenant */
180
- scope: Scalars['String']['input'];
181
- /** Segment key to match (null = default/fallback rule) */
182
- segmentKey?: InputMaybe<Scalars['String']['input']>;
183
- };
184
- /** Retry policy for operations */
185
- type RetryPolicyInput = {
186
- backoffMs: Scalars['Int']['input'];
187
- backoffMultiplier: Scalars['Float']['input'];
188
- maxRetries: Scalars['Int']['input'];
189
- };
190
- /** Sharing configuration */
191
- type SharingConfigInput = {
192
- enabled: Scalars['Boolean']['input'];
193
- requireAcceptance?: InputMaybe<Scalars['Boolean']['input']>;
194
- };
195
- /**
196
- * Input type for validation rules
197
- * The rule can be a simple string (e.g., "required", "email") or a complex expression object
198
- */
199
- type ValidationRuleInput = {
200
- message?: InputMaybe<Scalars['String']['input']>;
201
- rule: Scalars['JSON']['input'];
202
- value?: InputMaybe<Scalars['JSON']['input']>;
203
- };
204
-
205
1
  /**
206
2
  * Config definition helpers.
207
3
  *
@@ -220,8 +16,92 @@ type ValidationRuleInput = {
220
16
  * });
221
17
  * ```
222
18
  */
223
-
224
- type ApplyConfigHookInput = NonNullable<ApplyConfigInput['hooks']>[number];
19
+ interface FieldDefinitionInput {
20
+ key: string;
21
+ type: string;
22
+ label?: string;
23
+ required?: boolean;
24
+ helpText?: string;
25
+ placeholder?: string;
26
+ config?: Record<string, unknown>;
27
+ itemType?: string;
28
+ storage?: string;
29
+ templateZone?: string;
30
+ zoneOrder?: number;
31
+ }
32
+ interface ApplyConfigModelInput {
33
+ key: string;
34
+ name: string;
35
+ fields?: FieldDefinitionInput[];
36
+ config?: Record<string, unknown>;
37
+ }
38
+ interface ApplyConfigOperationInput {
39
+ key: string;
40
+ name: string;
41
+ description?: string;
42
+ category?: string;
43
+ handler?: string;
44
+ config?: Record<string, unknown>;
45
+ isActive?: boolean;
46
+ }
47
+ interface ApplyConfigSegmentInput {
48
+ key: string;
49
+ name: string;
50
+ description?: string;
51
+ rules?: Record<string, unknown>;
52
+ evaluationMode?: string;
53
+ isActive?: boolean;
54
+ }
55
+ interface ApplyConfigScheduleInput {
56
+ operationKey: string;
57
+ cron: string;
58
+ timezone?: string;
59
+ enabled?: boolean;
60
+ payload?: Record<string, unknown>;
61
+ }
62
+ interface ApplyConfigAuthProviderInput {
63
+ key: string;
64
+ name: string;
65
+ type: string;
66
+ config?: Record<string, unknown>;
67
+ enabled?: boolean;
68
+ isDefault?: boolean;
69
+ priority?: number;
70
+ }
71
+ interface ApplyConfigPlacementInput {
72
+ type: string;
73
+ url: string;
74
+ allowedOrigin?: string;
75
+ height?: number;
76
+ tabName?: string;
77
+ hideContentTab?: boolean;
78
+ modelKeys?: string[];
79
+ }
80
+ interface ApplyConfigHookInput {
81
+ event: string;
82
+ type: string;
83
+ url?: string;
84
+ method?: string;
85
+ async?: boolean;
86
+ headers?: Record<string, string>;
87
+ additionalData?: Record<string, unknown>;
88
+ expression?: Record<string, unknown>;
89
+ hooks?: ApplyConfigHookInput[];
90
+ }
91
+ interface ApplyConfigInput {
92
+ key: string;
93
+ name: string;
94
+ configType?: string;
95
+ force?: boolean;
96
+ models?: ApplyConfigModelInput[];
97
+ operations?: ApplyConfigOperationInput[];
98
+ segments?: ApplyConfigSegmentInput[];
99
+ schedules?: ApplyConfigScheduleInput[];
100
+ hooks?: ApplyConfigHookInput[];
101
+ authProviders?: ApplyConfigAuthProviderInput[];
102
+ placements?: ApplyConfigPlacementInput[];
103
+ [key: string]: unknown;
104
+ }
225
105
  /** Define a complete config manifest. */
226
106
  declare function defineConfig(config: ApplyConfigInput): ApplyConfigInput;
227
107
  /** @deprecated Use `defineConfig` instead. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eide/foir-cli",
3
- "version": "0.1.46",
3
+ "version": "0.2.0",
4
4
  "description": "Universal platform CLI for Foir platform",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -31,8 +31,6 @@
31
31
  "lint:fix": "eslint src/ --fix",
32
32
  "test": "vitest run",
33
33
  "test:watch": "vitest watch",
34
- "codegen": "graphql-codegen --config codegen.ts",
35
- "codegen:watch": "graphql-codegen --config codegen.ts --watch",
36
34
  "prepublishOnly": "pnpm run build",
37
35
  "release:patch": "pnpm version patch",
38
36
  "release:minor": "pnpm version minor",
@@ -43,31 +41,26 @@
43
41
  "eide",
44
42
  "cms",
45
43
  "cli",
46
- "graphql",
47
44
  "platform"
48
45
  ],
49
46
  "author": "EIDE Team",
50
47
  "license": "UNLICENSED",
51
48
  "dependencies": {
49
+ "@bufbuild/protobuf": "^2.0.0",
50
+ "@connectrpc/connect": "^2.0.0",
51
+ "@connectrpc/connect-node": "^2.0.0",
52
+ "@foir/connect-clients": "workspace:*",
52
53
  "chalk": "^5.3.0",
53
54
  "commander": "^12.1.0",
54
55
  "dotenv": "^16.4.5",
55
- "graphql": "^16.9.0",
56
- "graphql-request": "^7.1.2",
57
56
  "inquirer": "^9.2.12",
58
57
  "open": "^10.1.0",
59
58
  "ora": "^8.1.1",
60
59
  "prettier": "^3.4.2"
61
60
  },
62
61
  "devDependencies": {
63
- "@foir/platform": "workspace:*",
64
- "@graphql-codegen/cli": "^5.0.3",
65
- "@graphql-codegen/typed-document-node": "^5.0.12",
66
- "@graphql-codegen/typescript": "^4.1.2",
67
- "@graphql-codegen/typescript-operations": "^4.4.0",
68
- "@graphql-typed-document-node/core": "^3.2.0",
69
- "@types/inquirer": "^9.0.7",
70
62
  "@eide/command-registry": "workspace:*",
63
+ "@types/inquirer": "^9.0.7",
71
64
  "@types/node": "^22.5.0",
72
65
  "tsup": "^8.5.1",
73
66
  "tsx": "^4.20.0",
@@ -79,7 +72,7 @@
79
72
  },
80
73
  "repository": {
81
74
  "type": "git",
82
- "url": "https://github.com/eidebuild/eide.git",
75
+ "url": "https://github.com/eidestudio/foir.git",
83
76
  "directory": "packages/cli"
84
77
  }
85
78
  }