@eide/foir-cli 0.1.47 → 0.3.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,209 +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
- /** Which data field to display as the record name in list views */
94
- displayField?: InputMaybe<Scalars['String']['input']>;
95
- /** Array of field definitions (must be an array, not an object!) */
96
- fields: Array<FieldDefinitionInput>;
97
- hooks?: InputMaybe<Scalars['JSON']['input']>;
98
- icon?: InputMaybe<Scalars['String']['input']>;
99
- key: Scalars['String']['input'];
100
- name: Scalars['String']['input'];
101
- pluralName?: InputMaybe<Scalars['String']['input']>;
102
- };
103
- type ApplyConfigOperationInput = {
104
- category?: InputMaybe<Scalars['String']['input']>;
105
- description?: InputMaybe<Scalars['String']['input']>;
106
- endpoint: Scalars['String']['input'];
107
- key: Scalars['String']['input'];
108
- name: Scalars['String']['input'];
109
- precondition?: InputMaybe<OperationPreconditionInput>;
110
- quotas?: InputMaybe<Array<OperationQuotaInput>>;
111
- retryPolicy?: InputMaybe<RetryPolicyInput>;
112
- timeoutMs?: InputMaybe<Scalars['Int']['input']>;
113
- touchPoints?: InputMaybe<Array<Scalars['String']['input']>>;
114
- };
115
- type ApplyConfigPlacementInput = {
116
- allowedOrigin?: InputMaybe<Scalars['String']['input']>;
117
- height?: InputMaybe<Scalars['String']['input']>;
118
- hideContentTab?: InputMaybe<Scalars['Boolean']['input']>;
119
- modelKeys?: InputMaybe<Array<Scalars['String']['input']>>;
120
- tabName?: InputMaybe<Scalars['String']['input']>;
121
- type: Scalars['String']['input'];
122
- url: Scalars['String']['input'];
123
- };
124
- type ApplyConfigScheduleInput = {
125
- cron: Scalars['String']['input'];
126
- description?: InputMaybe<Scalars['String']['input']>;
127
- isActive?: InputMaybe<Scalars['Boolean']['input']>;
128
- key: Scalars['String']['input'];
129
- name: Scalars['String']['input'];
130
- /** Key of the operation this schedule triggers */
131
- operationKey: Scalars['String']['input'];
132
- timezone?: InputMaybe<Scalars['String']['input']>;
133
- };
134
- type ApplyConfigSegmentInput = {
135
- description?: InputMaybe<Scalars['String']['input']>;
136
- evaluationMode?: InputMaybe<Scalars['String']['input']>;
137
- isActive?: InputMaybe<Scalars['Boolean']['input']>;
138
- key: Scalars['String']['input'];
139
- name: Scalars['String']['input'];
140
- rules: Scalars['JSON']['input'];
141
- };
142
- /** Field definition for a model */
143
- type FieldDefinitionInput = {
144
- config?: InputMaybe<Scalars['JSON']['input']>;
145
- defaultValue?: InputMaybe<Scalars['JSON']['input']>;
146
- helpText?: InputMaybe<Scalars['String']['input']>;
147
- id?: InputMaybe<Scalars['String']['input']>;
148
- isTranslatable?: InputMaybe<Scalars['Boolean']['input']>;
149
- key: Scalars['String']['input'];
150
- label: Scalars['String']['input'];
151
- placeholder?: InputMaybe<Scalars['String']['input']>;
152
- required?: InputMaybe<Scalars['Boolean']['input']>;
153
- type: Scalars['String']['input'];
154
- validation?: InputMaybe<Array<ValidationRuleInput>>;
155
- };
156
- /** Model configuration options */
157
- type ModelConfigInput = {
158
- customerScoped?: InputMaybe<Scalars['Boolean']['input']>;
159
- publishing?: InputMaybe<Scalars['Boolean']['input']>;
160
- sharing?: InputMaybe<SharingConfigInput>;
161
- variants?: InputMaybe<Scalars['Boolean']['input']>;
162
- versioning?: InputMaybe<Scalars['Boolean']['input']>;
163
- };
164
- /** Pre-execution guard input for operation create/update */
165
- type OperationPreconditionInput = {
166
- /** Custom error message when precondition fails */
167
- message?: InputMaybe<Scalars['String']['input']>;
168
- /** Rule expression (RuleExpression as JSON) — must evaluate to true */
169
- rule?: InputMaybe<Scalars['JSON']['input']>;
170
- /** Segment key — customer must be a member to execute */
171
- segmentKey?: InputMaybe<Scalars['String']['input']>;
172
- };
173
- /** Quota rule input for operation create/update */
174
- type OperationQuotaInput = {
175
- /** Optional condition expression (RuleExpression as JSON) */
176
- condition?: InputMaybe<Scalars['JSON']['input']>;
177
- /** Duration window in seconds */
178
- duration: Scalars['Int']['input'];
179
- /** Max points per duration window (0 = unlimited) */
180
- points: Scalars['Int']['input'];
181
- /** Scope for quota tracking: customer, user, or tenant */
182
- scope: Scalars['String']['input'];
183
- /** Segment key to match (null = default/fallback rule) */
184
- segmentKey?: InputMaybe<Scalars['String']['input']>;
185
- };
186
- /** Retry policy for operations */
187
- type RetryPolicyInput = {
188
- backoffMs: Scalars['Int']['input'];
189
- backoffMultiplier: Scalars['Float']['input'];
190
- maxRetries: Scalars['Int']['input'];
191
- };
192
- /** Sharing configuration */
193
- type SharingConfigInput = {
194
- enabled: Scalars['Boolean']['input'];
195
- requireAcceptance?: InputMaybe<Scalars['Boolean']['input']>;
196
- };
197
- /**
198
- * Input type for validation rules
199
- * The rule can be a simple string (e.g., "required", "email") or a complex expression object
200
- */
201
- type ValidationRuleInput = {
202
- message?: InputMaybe<Scalars['String']['input']>;
203
- rule: Scalars['JSON']['input'];
204
- value?: InputMaybe<Scalars['JSON']['input']>;
205
- };
206
-
207
1
  /**
208
2
  * Config definition helpers.
209
3
  *
@@ -222,8 +16,102 @@ type ValidationRuleInput = {
222
16
  * });
223
17
  * ```
224
18
  */
225
-
226
- 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
+ /** HTTP endpoint URL that the platform calls when this operation is triggered. */
44
+ endpoint?: string;
45
+ config?: Record<string, unknown>;
46
+ isActive?: boolean;
47
+ }
48
+ interface ApplyConfigSegmentInput {
49
+ key: string;
50
+ name: string;
51
+ description?: string;
52
+ rules?: Record<string, unknown>;
53
+ evaluationMode?: string;
54
+ isActive?: boolean;
55
+ }
56
+ interface ApplyConfigScheduleInput {
57
+ operationKey: string;
58
+ cron: string;
59
+ timezone?: string;
60
+ enabled?: boolean;
61
+ payload?: Record<string, unknown>;
62
+ }
63
+ interface ApplyConfigAuthProviderInput {
64
+ key: string;
65
+ name: string;
66
+ type: string;
67
+ config?: Record<string, unknown>;
68
+ enabled?: boolean;
69
+ isDefault?: boolean;
70
+ priority?: number;
71
+ }
72
+ interface ApplyConfigPlacementInput {
73
+ type: string;
74
+ url: string;
75
+ allowedOrigin?: string;
76
+ height?: number;
77
+ tabName?: string;
78
+ hideContentTab?: boolean;
79
+ modelKeys?: string[];
80
+ }
81
+ interface ApplyConfigHookInput {
82
+ /** Unique key for this hook. */
83
+ key?: string;
84
+ /** Display name. */
85
+ name?: string;
86
+ /** Lifecycle event that triggers this hook. */
87
+ event: string;
88
+ /** Key of the operation to execute. */
89
+ operationKey?: string;
90
+ /** Filter to scope the hook (e.g., `{ modelKey: 'redirect' }`). */
91
+ filter?: Record<string, unknown>;
92
+ type?: string;
93
+ url?: string;
94
+ method?: string;
95
+ async?: boolean;
96
+ headers?: Record<string, string>;
97
+ additionalData?: Record<string, unknown>;
98
+ expression?: Record<string, unknown>;
99
+ hooks?: ApplyConfigHookInput[];
100
+ }
101
+ interface ApplyConfigInput {
102
+ key: string;
103
+ name: string;
104
+ configType?: string;
105
+ force?: boolean;
106
+ models?: ApplyConfigModelInput[];
107
+ operations?: ApplyConfigOperationInput[];
108
+ segments?: ApplyConfigSegmentInput[];
109
+ schedules?: ApplyConfigScheduleInput[];
110
+ hooks?: ApplyConfigHookInput[];
111
+ authProviders?: ApplyConfigAuthProviderInput[];
112
+ placements?: ApplyConfigPlacementInput[];
113
+ [key: string]: unknown;
114
+ }
227
115
  /** Define a complete config manifest. */
228
116
  declare function defineConfig(config: ApplyConfigInput): ApplyConfigInput;
229
117
  /** @deprecated Use `defineConfig` instead. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eide/foir-cli",
3
- "version": "0.1.47",
3
+ "version": "0.3.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,32 +41,31 @@
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
+ "@eide/foir-connect-clients": "0.2.2",
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",
56
+ "graphql": "^16.13.2",
57
+ "graphql-request": "^7.4.0",
57
58
  "inquirer": "^9.2.12",
58
59
  "open": "^10.1.0",
59
60
  "ora": "^8.1.1",
60
61
  "prettier": "^3.4.2"
61
62
  },
62
63
  "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
64
  "@types/inquirer": "^9.0.7",
70
- "@eide/command-registry": "workspace:*",
71
65
  "@types/node": "^22.5.0",
66
+ "@typescript-eslint/eslint-plugin": "^8.58.0",
67
+ "@typescript-eslint/parser": "^8.58.0",
68
+ "eslint": "^10.1.0",
72
69
  "tsup": "^8.5.1",
73
70
  "tsx": "^4.20.0",
74
71
  "typescript": "5.9.2",
@@ -79,7 +76,7 @@
79
76
  },
80
77
  "repository": {
81
78
  "type": "git",
82
- "url": "https://github.com/eidestudio/foir.git",
83
- "directory": "packages/cli"
84
- }
85
- }
79
+ "url": "https://github.com/eidestudio/foir-cli.git"
80
+ },
81
+ "packageManager": "pnpm@9.15.4"
82
+ }