@constructive-sdk/cli 0.3.0 → 0.7.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.
- package/admin/cli/commands/app-admin-grant.js +2 -2
- package/admin/cli/commands/app-grant.js +2 -2
- package/admin/cli/commands/app-membership-default.js +4 -4
- package/admin/cli/commands/app-membership.js +14 -14
- package/admin/cli/commands/app-owner-grant.js +2 -2
- package/admin/cli/commands/claimed-invite.js +2 -2
- package/admin/cli/commands/invite.js +6 -6
- package/admin/cli/commands/org-admin-grant.js +2 -2
- package/admin/cli/commands/org-chart-edge-grant.js +2 -2
- package/admin/cli/commands/org-claimed-invite.js +2 -2
- package/admin/cli/commands/org-grant.js +2 -2
- package/admin/cli/commands/org-invite.js +6 -6
- package/admin/cli/commands/org-member.js +2 -2
- package/admin/cli/commands/org-membership-default.js +6 -6
- package/admin/cli/commands/org-membership.js +12 -12
- package/admin/cli/commands/org-owner-grant.js +2 -2
- package/admin/cli/commands/submit-invite-code.js +1 -1
- package/admin/cli/commands/submit-org-invite-code.js +1 -1
- package/admin/cli/index.js +2 -2
- package/admin/cli/utils.d.ts +13 -0
- package/admin/cli/utils.js +25 -0
- package/admin/orm/input-types.d.ts +7 -280
- package/admin/orm/query-builder.d.ts +6 -4
- package/admin/orm/query-builder.js +13 -3
- package/admin/orm/select-types.d.ts +4 -2
- package/auth/cli/commands/audit-log.js +2 -2
- package/auth/cli/commands/check-password.js +1 -1
- package/auth/cli/commands/confirm-delete-account.js +1 -1
- package/auth/cli/commands/connected-account.js +4 -4
- package/auth/cli/commands/crypto-address.js +4 -4
- package/auth/cli/commands/email.js +4 -4
- package/auth/cli/commands/extend-token-expires.js +1 -1
- package/auth/cli/commands/forgot-password.js +1 -1
- package/auth/cli/commands/one-time-token.js +1 -1
- package/auth/cli/commands/phone-number.js +4 -4
- package/auth/cli/commands/reset-password.js +1 -1
- package/auth/cli/commands/send-account-deletion-email.js +1 -1
- package/auth/cli/commands/send-verification-email.js +1 -1
- package/auth/cli/commands/set-password.js +1 -1
- package/auth/cli/commands/sign-in-one-time-token.js +1 -1
- package/auth/cli/commands/sign-in.js +1 -1
- package/auth/cli/commands/sign-out.js +1 -1
- package/auth/cli/commands/sign-up.js +1 -1
- package/auth/cli/commands/verify-email.js +1 -1
- package/auth/cli/commands/verify-password.js +1 -1
- package/auth/cli/commands/verify-totp.js +1 -1
- package/auth/cli/index.js +2 -2
- package/auth/cli/utils.d.ts +13 -0
- package/auth/cli/utils.js +25 -0
- package/auth/orm/input-types.d.ts +7 -63
- package/auth/orm/query-builder.d.ts +6 -4
- package/auth/orm/query-builder.js +13 -3
- package/auth/orm/select-types.d.ts +4 -2
- package/esm/admin/cli/commands/app-admin-grant.js +2 -2
- package/esm/admin/cli/commands/app-grant.js +2 -2
- package/esm/admin/cli/commands/app-membership-default.js +4 -4
- package/esm/admin/cli/commands/app-membership.js +14 -14
- package/esm/admin/cli/commands/app-owner-grant.js +2 -2
- package/esm/admin/cli/commands/claimed-invite.js +2 -2
- package/esm/admin/cli/commands/invite.js +6 -6
- package/esm/admin/cli/commands/org-admin-grant.js +2 -2
- package/esm/admin/cli/commands/org-chart-edge-grant.js +2 -2
- package/esm/admin/cli/commands/org-claimed-invite.js +2 -2
- package/esm/admin/cli/commands/org-grant.js +2 -2
- package/esm/admin/cli/commands/org-invite.js +6 -6
- package/esm/admin/cli/commands/org-member.js +2 -2
- package/esm/admin/cli/commands/org-membership-default.js +6 -6
- package/esm/admin/cli/commands/org-membership.js +12 -12
- package/esm/admin/cli/commands/org-owner-grant.js +2 -2
- package/esm/admin/cli/commands/submit-invite-code.js +2 -2
- package/esm/admin/cli/commands/submit-org-invite-code.js +2 -2
- package/esm/admin/cli/index.js +2 -2
- package/esm/admin/cli/utils.d.ts +13 -0
- package/esm/admin/cli/utils.js +24 -0
- package/esm/admin/orm/input-types.d.ts +7 -280
- package/esm/admin/orm/query-builder.d.ts +6 -4
- package/esm/admin/orm/query-builder.js +13 -3
- package/esm/admin/orm/select-types.d.ts +4 -2
- package/esm/auth/cli/commands/audit-log.js +2 -2
- package/esm/auth/cli/commands/check-password.js +2 -2
- package/esm/auth/cli/commands/confirm-delete-account.js +2 -2
- package/esm/auth/cli/commands/connected-account.js +4 -4
- package/esm/auth/cli/commands/crypto-address.js +4 -4
- package/esm/auth/cli/commands/email.js +4 -4
- package/esm/auth/cli/commands/extend-token-expires.js +2 -2
- package/esm/auth/cli/commands/forgot-password.js +2 -2
- package/esm/auth/cli/commands/one-time-token.js +2 -2
- package/esm/auth/cli/commands/phone-number.js +4 -4
- package/esm/auth/cli/commands/reset-password.js +2 -2
- package/esm/auth/cli/commands/send-account-deletion-email.js +2 -2
- package/esm/auth/cli/commands/send-verification-email.js +2 -2
- package/esm/auth/cli/commands/set-password.js +2 -2
- package/esm/auth/cli/commands/sign-in-one-time-token.js +2 -2
- package/esm/auth/cli/commands/sign-in.js +2 -2
- package/esm/auth/cli/commands/sign-out.js +2 -2
- package/esm/auth/cli/commands/sign-up.js +2 -2
- package/esm/auth/cli/commands/verify-email.js +2 -2
- package/esm/auth/cli/commands/verify-password.js +2 -2
- package/esm/auth/cli/commands/verify-totp.js +2 -2
- package/esm/auth/cli/index.js +2 -2
- package/esm/auth/cli/utils.d.ts +13 -0
- package/esm/auth/cli/utils.js +24 -0
- package/esm/auth/orm/input-types.d.ts +7 -63
- package/esm/auth/orm/query-builder.d.ts +6 -4
- package/esm/auth/orm/query-builder.js +13 -3
- package/esm/auth/orm/select-types.d.ts +4 -2
- package/esm/objects/cli/commands/freeze-objects.js +2 -2
- package/esm/objects/cli/commands/get-all-record.js +1 -1
- package/esm/objects/cli/commands/init-empty-repo.js +2 -2
- package/esm/objects/cli/commands/insert-node-at-path.js +2 -2
- package/esm/objects/cli/commands/object.js +4 -4
- package/esm/objects/cli/commands/remove-node-at-path.js +2 -2
- package/esm/objects/cli/commands/set-and-commit.js +2 -2
- package/esm/objects/cli/commands/set-data-at-path.js +2 -2
- package/esm/objects/cli/commands/set-props-and-commit.js +2 -2
- package/esm/objects/cli/commands/update-node-at-path.js +2 -2
- package/esm/objects/cli/index.js +2 -2
- package/esm/objects/cli/utils.d.ts +13 -0
- package/esm/objects/cli/utils.js +24 -0
- package/esm/objects/orm/input-types.d.ts +7 -39
- package/esm/objects/orm/query-builder.d.ts +6 -4
- package/esm/objects/orm/query-builder.js +13 -3
- package/esm/objects/orm/select-types.d.ts +4 -2
- package/esm/public/cli/commands/api-module.js +2 -2
- package/esm/public/cli/commands/api.js +2 -2
- package/esm/public/cli/commands/app-admin-grant.js +2 -2
- package/esm/public/cli/commands/app-grant.js +2 -2
- package/esm/public/cli/commands/app-membership-default.js +4 -4
- package/esm/public/cli/commands/app-membership.js +14 -14
- package/esm/public/cli/commands/app-owner-grant.js +2 -2
- package/esm/public/cli/commands/apply-rls.js +2 -2
- package/esm/public/cli/commands/ast-migration.js +4 -4
- package/esm/public/cli/commands/audit-log.js +2 -2
- package/esm/public/cli/commands/bootstrap-user.js +2 -2
- package/esm/public/cli/commands/check-constraint.js +4 -4
- package/esm/public/cli/commands/check-password.js +2 -2
- package/esm/public/cli/commands/claimed-invite.js +2 -2
- package/esm/public/cli/commands/confirm-delete-account.js +2 -2
- package/esm/public/cli/commands/connected-account.js +4 -4
- package/esm/public/cli/commands/create-user-database.js +2 -2
- package/esm/public/cli/commands/crypto-address.js +4 -4
- package/esm/public/cli/commands/database-provision-module.js +4 -4
- package/esm/public/cli/commands/default-privilege.js +2 -2
- package/esm/public/cli/commands/denormalized-table-field.js +4 -4
- package/esm/public/cli/commands/email.js +4 -4
- package/esm/public/cli/commands/extend-token-expires.js +2 -2
- package/esm/public/cli/commands/field-module.js +2 -2
- package/esm/public/cli/commands/field.js +12 -12
- package/esm/public/cli/commands/foreign-key-constraint.js +2 -2
- package/esm/public/cli/commands/forgot-password.js +2 -2
- package/esm/public/cli/commands/freeze-objects.js +2 -2
- package/esm/public/cli/commands/get-all-record.js +1 -1
- package/esm/public/cli/commands/index.js +8 -8
- package/esm/public/cli/commands/init-empty-repo.js +2 -2
- package/esm/public/cli/commands/insert-node-at-path.js +2 -2
- package/esm/public/cli/commands/invite.js +6 -6
- package/esm/public/cli/commands/node-type-registry.js +2 -2
- package/esm/public/cli/commands/object.js +4 -4
- package/esm/public/cli/commands/one-time-token.js +2 -2
- package/esm/public/cli/commands/org-admin-grant.js +2 -2
- package/esm/public/cli/commands/org-chart-edge-grant.js +2 -2
- package/esm/public/cli/commands/org-claimed-invite.js +2 -2
- package/esm/public/cli/commands/org-grant.js +2 -2
- package/esm/public/cli/commands/org-invite.js +6 -6
- package/esm/public/cli/commands/org-member.js +2 -2
- package/esm/public/cli/commands/org-membership-default.js +6 -6
- package/esm/public/cli/commands/org-membership.js +12 -12
- package/esm/public/cli/commands/org-owner-grant.js +2 -2
- package/esm/public/cli/commands/phone-number.js +4 -4
- package/esm/public/cli/commands/policy.js +8 -8
- package/esm/public/cli/commands/primary-key-constraint.js +2 -2
- package/esm/public/cli/commands/provision-database-with-user.js +2 -2
- package/esm/public/cli/commands/relation-provision.js +12 -12
- package/esm/public/cli/commands/remove-node-at-path.js +2 -2
- package/esm/public/cli/commands/reset-password.js +2 -2
- package/esm/public/cli/commands/schema.js +4 -4
- package/esm/public/cli/commands/secure-table-provision.js +10 -10
- package/esm/public/cli/commands/send-account-deletion-email.js +2 -2
- package/esm/public/cli/commands/send-verification-email.js +2 -2
- package/esm/public/cli/commands/set-and-commit.js +2 -2
- package/esm/public/cli/commands/set-data-at-path.js +2 -2
- package/esm/public/cli/commands/set-field-order.js +2 -2
- package/esm/public/cli/commands/set-password.js +2 -2
- package/esm/public/cli/commands/set-props-and-commit.js +2 -2
- package/esm/public/cli/commands/sign-in-one-time-token.js +2 -2
- package/esm/public/cli/commands/sign-in.js +2 -2
- package/esm/public/cli/commands/sign-out.js +2 -2
- package/esm/public/cli/commands/sign-up.js +2 -2
- package/esm/public/cli/commands/site-module.js +2 -2
- package/esm/public/cli/commands/site-theme.js +2 -2
- package/esm/public/cli/commands/sql-migration.js +1 -1
- package/esm/public/cli/commands/submit-invite-code.js +2 -2
- package/esm/public/cli/commands/submit-org-invite-code.js +2 -2
- package/esm/public/cli/commands/table-grant.js +2 -2
- package/esm/public/cli/commands/table-module.js +4 -4
- package/esm/public/cli/commands/table-template-module.js +2 -2
- package/esm/public/cli/commands/table.js +8 -8
- package/esm/public/cli/commands/trigger.js +2 -2
- package/esm/public/cli/commands/unique-constraint.js +2 -2
- package/esm/public/cli/commands/update-node-at-path.js +2 -2
- package/esm/public/cli/commands/verify-email.js +2 -2
- package/esm/public/cli/commands/verify-password.js +2 -2
- package/esm/public/cli/commands/verify-totp.js +2 -2
- package/esm/public/cli/commands/view-grant.js +4 -4
- package/esm/public/cli/commands/view.js +10 -10
- package/esm/public/cli/index.js +2 -2
- package/esm/public/cli/utils.d.ts +13 -0
- package/esm/public/cli/utils.js +24 -0
- package/esm/public/orm/input-types.d.ts +7 -1196
- package/esm/public/orm/query-builder.d.ts +6 -4
- package/esm/public/orm/query-builder.js +13 -3
- package/esm/public/orm/select-types.d.ts +4 -2
- package/objects/cli/commands/freeze-objects.js +1 -1
- package/objects/cli/commands/get-all-record.js +1 -1
- package/objects/cli/commands/init-empty-repo.js +1 -1
- package/objects/cli/commands/insert-node-at-path.js +1 -1
- package/objects/cli/commands/object.js +4 -4
- package/objects/cli/commands/remove-node-at-path.js +1 -1
- package/objects/cli/commands/set-and-commit.js +1 -1
- package/objects/cli/commands/set-data-at-path.js +1 -1
- package/objects/cli/commands/set-props-and-commit.js +1 -1
- package/objects/cli/commands/update-node-at-path.js +1 -1
- package/objects/cli/index.js +2 -2
- package/objects/cli/utils.d.ts +13 -0
- package/objects/cli/utils.js +25 -0
- package/objects/orm/input-types.d.ts +7 -39
- package/objects/orm/query-builder.d.ts +6 -4
- package/objects/orm/query-builder.js +13 -3
- package/objects/orm/select-types.d.ts +4 -2
- package/package.json +6 -6
- package/public/cli/commands/api-module.js +2 -2
- package/public/cli/commands/api.js +2 -2
- package/public/cli/commands/app-admin-grant.js +2 -2
- package/public/cli/commands/app-grant.js +2 -2
- package/public/cli/commands/app-membership-default.js +4 -4
- package/public/cli/commands/app-membership.js +14 -14
- package/public/cli/commands/app-owner-grant.js +2 -2
- package/public/cli/commands/apply-rls.js +1 -1
- package/public/cli/commands/ast-migration.js +4 -4
- package/public/cli/commands/audit-log.js +2 -2
- package/public/cli/commands/bootstrap-user.js +1 -1
- package/public/cli/commands/check-constraint.js +4 -4
- package/public/cli/commands/check-password.js +1 -1
- package/public/cli/commands/claimed-invite.js +2 -2
- package/public/cli/commands/confirm-delete-account.js +1 -1
- package/public/cli/commands/connected-account.js +4 -4
- package/public/cli/commands/create-user-database.js +1 -1
- package/public/cli/commands/crypto-address.js +4 -4
- package/public/cli/commands/database-provision-module.js +4 -4
- package/public/cli/commands/default-privilege.js +2 -2
- package/public/cli/commands/denormalized-table-field.js +4 -4
- package/public/cli/commands/email.js +4 -4
- package/public/cli/commands/extend-token-expires.js +1 -1
- package/public/cli/commands/field-module.js +2 -2
- package/public/cli/commands/field.js +12 -12
- package/public/cli/commands/foreign-key-constraint.js +2 -2
- package/public/cli/commands/forgot-password.js +1 -1
- package/public/cli/commands/freeze-objects.js +1 -1
- package/public/cli/commands/get-all-record.js +1 -1
- package/public/cli/commands/index.js +8 -8
- package/public/cli/commands/init-empty-repo.js +1 -1
- package/public/cli/commands/insert-node-at-path.js +1 -1
- package/public/cli/commands/invite.js +6 -6
- package/public/cli/commands/node-type-registry.js +2 -2
- package/public/cli/commands/object.js +4 -4
- package/public/cli/commands/one-time-token.js +1 -1
- package/public/cli/commands/org-admin-grant.js +2 -2
- package/public/cli/commands/org-chart-edge-grant.js +2 -2
- package/public/cli/commands/org-claimed-invite.js +2 -2
- package/public/cli/commands/org-grant.js +2 -2
- package/public/cli/commands/org-invite.js +6 -6
- package/public/cli/commands/org-member.js +2 -2
- package/public/cli/commands/org-membership-default.js +6 -6
- package/public/cli/commands/org-membership.js +12 -12
- package/public/cli/commands/org-owner-grant.js +2 -2
- package/public/cli/commands/phone-number.js +4 -4
- package/public/cli/commands/policy.js +8 -8
- package/public/cli/commands/primary-key-constraint.js +2 -2
- package/public/cli/commands/provision-database-with-user.js +1 -1
- package/public/cli/commands/relation-provision.js +12 -12
- package/public/cli/commands/remove-node-at-path.js +1 -1
- package/public/cli/commands/reset-password.js +1 -1
- package/public/cli/commands/schema.js +4 -4
- package/public/cli/commands/secure-table-provision.js +10 -10
- package/public/cli/commands/send-account-deletion-email.js +1 -1
- package/public/cli/commands/send-verification-email.js +1 -1
- package/public/cli/commands/set-and-commit.js +1 -1
- package/public/cli/commands/set-data-at-path.js +1 -1
- package/public/cli/commands/set-field-order.js +1 -1
- package/public/cli/commands/set-password.js +1 -1
- package/public/cli/commands/set-props-and-commit.js +1 -1
- package/public/cli/commands/sign-in-one-time-token.js +1 -1
- package/public/cli/commands/sign-in.js +1 -1
- package/public/cli/commands/sign-out.js +1 -1
- package/public/cli/commands/sign-up.js +1 -1
- package/public/cli/commands/site-module.js +2 -2
- package/public/cli/commands/site-theme.js +2 -2
- package/public/cli/commands/sql-migration.js +1 -1
- package/public/cli/commands/submit-invite-code.js +1 -1
- package/public/cli/commands/submit-org-invite-code.js +1 -1
- package/public/cli/commands/table-grant.js +2 -2
- package/public/cli/commands/table-module.js +4 -4
- package/public/cli/commands/table-template-module.js +2 -2
- package/public/cli/commands/table.js +8 -8
- package/public/cli/commands/trigger.js +2 -2
- package/public/cli/commands/unique-constraint.js +2 -2
- package/public/cli/commands/update-node-at-path.js +1 -1
- package/public/cli/commands/verify-email.js +1 -1
- package/public/cli/commands/verify-password.js +1 -1
- package/public/cli/commands/verify-totp.js +1 -1
- package/public/cli/commands/view-grant.js +4 -4
- package/public/cli/commands/view.js +10 -10
- package/public/cli/index.js +2 -2
- package/public/cli/utils.d.ts +13 -0
- package/public/cli/utils.js +25 -0
- package/public/orm/input-types.d.ts +7 -1196
- package/public/orm/query-builder.d.ts +6 -4
- package/public/orm/query-builder.js +13 -3
- package/public/orm/select-types.d.ts +4 -2
|
@@ -34,21 +34,23 @@ export declare class QueryBuilder<TResult> {
|
|
|
34
34
|
getVariables(): Record<string, unknown> | undefined;
|
|
35
35
|
}
|
|
36
36
|
export declare function buildSelections(select: Record<string, unknown> | undefined, connectionFieldsMap?: Record<string, Record<string, string>>, entityType?: string): FieldNode[];
|
|
37
|
-
export declare function buildFindManyDocument<TSelect, TWhere>(operationName: string, queryField: string, select: TSelect, args: {
|
|
37
|
+
export declare function buildFindManyDocument<TSelect, TWhere, TCondition = never>(operationName: string, queryField: string, select: TSelect, args: {
|
|
38
38
|
where?: TWhere;
|
|
39
|
+
condition?: TCondition;
|
|
39
40
|
orderBy?: string[];
|
|
40
41
|
first?: number;
|
|
41
42
|
last?: number;
|
|
42
43
|
after?: string;
|
|
43
44
|
before?: string;
|
|
44
45
|
offset?: number;
|
|
45
|
-
}, filterTypeName: string, orderByTypeName: string, connectionFieldsMap?: Record<string, Record<string, string
|
|
46
|
+
}, filterTypeName: string, orderByTypeName: string, connectionFieldsMap?: Record<string, Record<string, string>>, conditionTypeName?: string): {
|
|
46
47
|
document: string;
|
|
47
48
|
variables: Record<string, unknown>;
|
|
48
49
|
};
|
|
49
|
-
export declare function buildFindFirstDocument<TSelect, TWhere>(operationName: string, queryField: string, select: TSelect, args: {
|
|
50
|
+
export declare function buildFindFirstDocument<TSelect, TWhere, TCondition = never>(operationName: string, queryField: string, select: TSelect, args: {
|
|
50
51
|
where?: TWhere;
|
|
51
|
-
|
|
52
|
+
condition?: TCondition;
|
|
53
|
+
}, filterTypeName: string, connectionFieldsMap?: Record<string, Record<string, string>>, conditionTypeName?: string): {
|
|
52
54
|
document: string;
|
|
53
55
|
variables: Record<string, unknown>;
|
|
54
56
|
};
|
|
@@ -131,13 +131,18 @@ export function buildSelections(select, connectionFieldsMap, entityType) {
|
|
|
131
131
|
// ============================================================================
|
|
132
132
|
// Document Builders
|
|
133
133
|
// ============================================================================
|
|
134
|
-
export function buildFindManyDocument(operationName, queryField, select, args, filterTypeName, orderByTypeName, connectionFieldsMap) {
|
|
134
|
+
export function buildFindManyDocument(operationName, queryField, select, args, filterTypeName, orderByTypeName, connectionFieldsMap, conditionTypeName) {
|
|
135
135
|
const selections = select
|
|
136
136
|
? buildSelections(select, connectionFieldsMap, operationName)
|
|
137
137
|
: [t.field({ name: 'id' })];
|
|
138
138
|
const variableDefinitions = [];
|
|
139
139
|
const queryArgs = [];
|
|
140
140
|
const variables = {};
|
|
141
|
+
addVariable({
|
|
142
|
+
varName: 'condition',
|
|
143
|
+
typeName: conditionTypeName,
|
|
144
|
+
value: args.condition,
|
|
145
|
+
}, variableDefinitions, queryArgs, variables);
|
|
141
146
|
addVariable({
|
|
142
147
|
varName: 'where',
|
|
143
148
|
argName: 'filter',
|
|
@@ -176,7 +181,7 @@ export function buildFindManyDocument(operationName, queryField, select, args, f
|
|
|
176
181
|
});
|
|
177
182
|
return { document: print(document), variables };
|
|
178
183
|
}
|
|
179
|
-
export function buildFindFirstDocument(operationName, queryField, select, args, filterTypeName, connectionFieldsMap) {
|
|
184
|
+
export function buildFindFirstDocument(operationName, queryField, select, args, filterTypeName, connectionFieldsMap, conditionTypeName) {
|
|
180
185
|
const selections = select
|
|
181
186
|
? buildSelections(select, connectionFieldsMap, operationName)
|
|
182
187
|
: [t.field({ name: 'id' })];
|
|
@@ -185,6 +190,11 @@ export function buildFindFirstDocument(operationName, queryField, select, args,
|
|
|
185
190
|
const variables = {};
|
|
186
191
|
// Always add first: 1 for findFirst
|
|
187
192
|
addVariable({ varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, variables);
|
|
193
|
+
addVariable({
|
|
194
|
+
varName: 'condition',
|
|
195
|
+
typeName: conditionTypeName,
|
|
196
|
+
value: args.condition,
|
|
197
|
+
}, variableDefinitions, queryArgs, variables);
|
|
188
198
|
addVariable({
|
|
189
199
|
varName: 'where',
|
|
190
200
|
argName: 'filter',
|
|
@@ -519,7 +529,7 @@ function buildInputMutationDocument(config) {
|
|
|
519
529
|
return print(document);
|
|
520
530
|
}
|
|
521
531
|
function addVariable(spec, definitions, args, variables) {
|
|
522
|
-
if (spec.value === undefined)
|
|
532
|
+
if (spec.value === undefined || !spec.typeName)
|
|
523
533
|
return;
|
|
524
534
|
definitions.push(t.variableDefinition({
|
|
525
535
|
variable: t.variable({ name: spec.varName }),
|
|
@@ -14,9 +14,10 @@ export interface PageInfo {
|
|
|
14
14
|
startCursor?: string | null;
|
|
15
15
|
endCursor?: string | null;
|
|
16
16
|
}
|
|
17
|
-
export interface FindManyArgs<TSelect, TWhere, TOrderBy> {
|
|
17
|
+
export interface FindManyArgs<TSelect, TWhere, TCondition = never, TOrderBy = never> {
|
|
18
18
|
select?: TSelect;
|
|
19
19
|
where?: TWhere;
|
|
20
|
+
condition?: TCondition;
|
|
20
21
|
orderBy?: TOrderBy[];
|
|
21
22
|
first?: number;
|
|
22
23
|
last?: number;
|
|
@@ -24,9 +25,10 @@ export interface FindManyArgs<TSelect, TWhere, TOrderBy> {
|
|
|
24
25
|
before?: string;
|
|
25
26
|
offset?: number;
|
|
26
27
|
}
|
|
27
|
-
export interface FindFirstArgs<TSelect, TWhere> {
|
|
28
|
+
export interface FindFirstArgs<TSelect, TWhere, TCondition = never> {
|
|
28
29
|
select?: TSelect;
|
|
29
30
|
where?: TWhere;
|
|
31
|
+
condition?: TCondition;
|
|
30
32
|
}
|
|
31
33
|
export interface CreateArgs<TSelect, TData> {
|
|
32
34
|
data: TData;
|
|
@@ -154,7 +154,7 @@ async function handleCreate(argv, prompter) {
|
|
|
154
154
|
skipPrompt: true,
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
|
-
type: '
|
|
157
|
+
type: 'boolean',
|
|
158
158
|
name: 'success',
|
|
159
159
|
message: 'success',
|
|
160
160
|
required: true,
|
|
@@ -239,7 +239,7 @@ async function handleUpdate(argv, prompter) {
|
|
|
239
239
|
skipPrompt: true,
|
|
240
240
|
},
|
|
241
241
|
{
|
|
242
|
-
type: '
|
|
242
|
+
type: 'boolean',
|
|
243
243
|
name: 'success',
|
|
244
244
|
message: 'success',
|
|
245
245
|
required: false,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../executor';
|
|
2
|
-
import {
|
|
2
|
+
import { unflattenDotNotation, buildSelectFromPaths } from '../utils';
|
|
3
3
|
export default async (argv, prompter, _options) => {
|
|
4
4
|
try {
|
|
5
5
|
if (argv.help || argv.h) {
|
|
@@ -15,7 +15,7 @@ export default async (argv, prompter, _options) => {
|
|
|
15
15
|
},
|
|
16
16
|
]);
|
|
17
17
|
const client = getClient();
|
|
18
|
-
const parsedAnswers =
|
|
18
|
+
const parsedAnswers = unflattenDotNotation(answers);
|
|
19
19
|
const selectFields = buildSelectFromPaths(argv.select ?? 'clientMutationId');
|
|
20
20
|
const result = await client.mutation
|
|
21
21
|
.checkPassword(parsedAnswers, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../executor';
|
|
2
|
-
import {
|
|
2
|
+
import { unflattenDotNotation, buildSelectFromPaths } from '../utils';
|
|
3
3
|
export default async (argv, prompter, _options) => {
|
|
4
4
|
try {
|
|
5
5
|
if (argv.help || argv.h) {
|
|
@@ -15,7 +15,7 @@ export default async (argv, prompter, _options) => {
|
|
|
15
15
|
},
|
|
16
16
|
]);
|
|
17
17
|
const client = getClient();
|
|
18
|
-
const parsedAnswers =
|
|
18
|
+
const parsedAnswers = unflattenDotNotation(answers);
|
|
19
19
|
const selectFields = buildSelectFromPaths(argv.select ?? 'clientMutationId');
|
|
20
20
|
const result = await client.mutation
|
|
21
21
|
.confirmDeleteAccount(parsedAnswers, {
|
|
@@ -139,13 +139,13 @@ async function handleCreate(argv, prompter) {
|
|
|
139
139
|
required: true,
|
|
140
140
|
},
|
|
141
141
|
{
|
|
142
|
-
type: '
|
|
142
|
+
type: 'json',
|
|
143
143
|
name: 'details',
|
|
144
144
|
message: 'details',
|
|
145
145
|
required: true,
|
|
146
146
|
},
|
|
147
147
|
{
|
|
148
|
-
type: '
|
|
148
|
+
type: 'boolean',
|
|
149
149
|
name: 'isVerified',
|
|
150
150
|
message: 'isVerified',
|
|
151
151
|
required: false,
|
|
@@ -215,13 +215,13 @@ async function handleUpdate(argv, prompter) {
|
|
|
215
215
|
required: false,
|
|
216
216
|
},
|
|
217
217
|
{
|
|
218
|
-
type: '
|
|
218
|
+
type: 'json',
|
|
219
219
|
name: 'details',
|
|
220
220
|
message: 'details',
|
|
221
221
|
required: false,
|
|
222
222
|
},
|
|
223
223
|
{
|
|
224
|
-
type: '
|
|
224
|
+
type: 'boolean',
|
|
225
225
|
name: 'isVerified',
|
|
226
226
|
message: 'isVerified',
|
|
227
227
|
required: false,
|
|
@@ -130,14 +130,14 @@ async function handleCreate(argv, prompter) {
|
|
|
130
130
|
required: true,
|
|
131
131
|
},
|
|
132
132
|
{
|
|
133
|
-
type: '
|
|
133
|
+
type: 'boolean',
|
|
134
134
|
name: 'isVerified',
|
|
135
135
|
message: 'isVerified',
|
|
136
136
|
required: false,
|
|
137
137
|
skipPrompt: true,
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
|
-
type: '
|
|
140
|
+
type: 'boolean',
|
|
141
141
|
name: 'isPrimary',
|
|
142
142
|
message: 'isPrimary',
|
|
143
143
|
required: false,
|
|
@@ -199,14 +199,14 @@ async function handleUpdate(argv, prompter) {
|
|
|
199
199
|
required: false,
|
|
200
200
|
},
|
|
201
201
|
{
|
|
202
|
-
type: '
|
|
202
|
+
type: 'boolean',
|
|
203
203
|
name: 'isVerified',
|
|
204
204
|
message: 'isVerified',
|
|
205
205
|
required: false,
|
|
206
206
|
skipPrompt: true,
|
|
207
207
|
},
|
|
208
208
|
{
|
|
209
|
-
type: '
|
|
209
|
+
type: 'boolean',
|
|
210
210
|
name: 'isPrimary',
|
|
211
211
|
message: 'isPrimary',
|
|
212
212
|
required: false,
|
|
@@ -130,14 +130,14 @@ async function handleCreate(argv, prompter) {
|
|
|
130
130
|
required: true,
|
|
131
131
|
},
|
|
132
132
|
{
|
|
133
|
-
type: '
|
|
133
|
+
type: 'boolean',
|
|
134
134
|
name: 'isVerified',
|
|
135
135
|
message: 'isVerified',
|
|
136
136
|
required: false,
|
|
137
137
|
skipPrompt: true,
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
|
-
type: '
|
|
140
|
+
type: 'boolean',
|
|
141
141
|
name: 'isPrimary',
|
|
142
142
|
message: 'isPrimary',
|
|
143
143
|
required: false,
|
|
@@ -199,14 +199,14 @@ async function handleUpdate(argv, prompter) {
|
|
|
199
199
|
required: false,
|
|
200
200
|
},
|
|
201
201
|
{
|
|
202
|
-
type: '
|
|
202
|
+
type: 'boolean',
|
|
203
203
|
name: 'isVerified',
|
|
204
204
|
message: 'isVerified',
|
|
205
205
|
required: false,
|
|
206
206
|
skipPrompt: true,
|
|
207
207
|
},
|
|
208
208
|
{
|
|
209
|
-
type: '
|
|
209
|
+
type: 'boolean',
|
|
210
210
|
name: 'isPrimary',
|
|
211
211
|
message: 'isPrimary',
|
|
212
212
|
required: false,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../executor';
|
|
2
|
-
import {
|
|
2
|
+
import { unflattenDotNotation, buildSelectFromPaths } from '../utils';
|
|
3
3
|
export default async (argv, prompter, _options) => {
|
|
4
4
|
try {
|
|
5
5
|
if (argv.help || argv.h) {
|
|
@@ -15,7 +15,7 @@ export default async (argv, prompter, _options) => {
|
|
|
15
15
|
},
|
|
16
16
|
]);
|
|
17
17
|
const client = getClient();
|
|
18
|
-
const parsedAnswers =
|
|
18
|
+
const parsedAnswers = unflattenDotNotation(answers);
|
|
19
19
|
const selectFields = buildSelectFromPaths(argv.select ?? 'clientMutationId');
|
|
20
20
|
const result = await client.mutation
|
|
21
21
|
.extendTokenExpires(parsedAnswers, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../executor';
|
|
2
|
-
import {
|
|
2
|
+
import { unflattenDotNotation, buildSelectFromPaths } from '../utils';
|
|
3
3
|
export default async (argv, prompter, _options) => {
|
|
4
4
|
try {
|
|
5
5
|
if (argv.help || argv.h) {
|
|
@@ -15,7 +15,7 @@ export default async (argv, prompter, _options) => {
|
|
|
15
15
|
},
|
|
16
16
|
]);
|
|
17
17
|
const client = getClient();
|
|
18
|
-
const parsedAnswers =
|
|
18
|
+
const parsedAnswers = unflattenDotNotation(answers);
|
|
19
19
|
const selectFields = buildSelectFromPaths(argv.select ?? 'clientMutationId');
|
|
20
20
|
const result = await client.mutation
|
|
21
21
|
.forgotPassword(parsedAnswers, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../executor';
|
|
2
|
-
import {
|
|
2
|
+
import { unflattenDotNotation, buildSelectFromPaths } from '../utils';
|
|
3
3
|
export default async (argv, prompter, _options) => {
|
|
4
4
|
try {
|
|
5
5
|
if (argv.help || argv.h) {
|
|
@@ -15,7 +15,7 @@ export default async (argv, prompter, _options) => {
|
|
|
15
15
|
},
|
|
16
16
|
]);
|
|
17
17
|
const client = getClient();
|
|
18
|
-
const parsedAnswers =
|
|
18
|
+
const parsedAnswers = unflattenDotNotation(answers);
|
|
19
19
|
const selectFields = buildSelectFromPaths(argv.select ?? 'clientMutationId');
|
|
20
20
|
const result = await client.mutation
|
|
21
21
|
.oneTimeToken(parsedAnswers, {
|
|
@@ -139,14 +139,14 @@ async function handleCreate(argv, prompter) {
|
|
|
139
139
|
required: true,
|
|
140
140
|
},
|
|
141
141
|
{
|
|
142
|
-
type: '
|
|
142
|
+
type: 'boolean',
|
|
143
143
|
name: 'isVerified',
|
|
144
144
|
message: 'isVerified',
|
|
145
145
|
required: false,
|
|
146
146
|
skipPrompt: true,
|
|
147
147
|
},
|
|
148
148
|
{
|
|
149
|
-
type: '
|
|
149
|
+
type: 'boolean',
|
|
150
150
|
name: 'isPrimary',
|
|
151
151
|
message: 'isPrimary',
|
|
152
152
|
required: false,
|
|
@@ -216,14 +216,14 @@ async function handleUpdate(argv, prompter) {
|
|
|
216
216
|
required: false,
|
|
217
217
|
},
|
|
218
218
|
{
|
|
219
|
-
type: '
|
|
219
|
+
type: 'boolean',
|
|
220
220
|
name: 'isVerified',
|
|
221
221
|
message: 'isVerified',
|
|
222
222
|
required: false,
|
|
223
223
|
skipPrompt: true,
|
|
224
224
|
},
|
|
225
225
|
{
|
|
226
|
-
type: '
|
|
226
|
+
type: 'boolean',
|
|
227
227
|
name: 'isPrimary',
|
|
228
228
|
message: 'isPrimary',
|
|
229
229
|
required: false,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../executor';
|
|
2
|
-
import {
|
|
2
|
+
import { unflattenDotNotation, buildSelectFromPaths } from '../utils';
|
|
3
3
|
export default async (argv, prompter, _options) => {
|
|
4
4
|
try {
|
|
5
5
|
if (argv.help || argv.h) {
|
|
@@ -15,7 +15,7 @@ export default async (argv, prompter, _options) => {
|
|
|
15
15
|
},
|
|
16
16
|
]);
|
|
17
17
|
const client = getClient();
|
|
18
|
-
const parsedAnswers =
|
|
18
|
+
const parsedAnswers = unflattenDotNotation(answers);
|
|
19
19
|
const selectFields = buildSelectFromPaths(argv.select ?? 'clientMutationId');
|
|
20
20
|
const result = await client.mutation
|
|
21
21
|
.resetPassword(parsedAnswers, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../executor';
|
|
2
|
-
import {
|
|
2
|
+
import { unflattenDotNotation, buildSelectFromPaths } from '../utils';
|
|
3
3
|
export default async (argv, prompter, _options) => {
|
|
4
4
|
try {
|
|
5
5
|
if (argv.help || argv.h) {
|
|
@@ -15,7 +15,7 @@ export default async (argv, prompter, _options) => {
|
|
|
15
15
|
},
|
|
16
16
|
]);
|
|
17
17
|
const client = getClient();
|
|
18
|
-
const parsedAnswers =
|
|
18
|
+
const parsedAnswers = unflattenDotNotation(answers);
|
|
19
19
|
const selectFields = buildSelectFromPaths(argv.select ?? 'clientMutationId');
|
|
20
20
|
const result = await client.mutation
|
|
21
21
|
.sendAccountDeletionEmail(parsedAnswers, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../executor';
|
|
2
|
-
import {
|
|
2
|
+
import { unflattenDotNotation, buildSelectFromPaths } from '../utils';
|
|
3
3
|
export default async (argv, prompter, _options) => {
|
|
4
4
|
try {
|
|
5
5
|
if (argv.help || argv.h) {
|
|
@@ -15,7 +15,7 @@ export default async (argv, prompter, _options) => {
|
|
|
15
15
|
},
|
|
16
16
|
]);
|
|
17
17
|
const client = getClient();
|
|
18
|
-
const parsedAnswers =
|
|
18
|
+
const parsedAnswers = unflattenDotNotation(answers);
|
|
19
19
|
const selectFields = buildSelectFromPaths(argv.select ?? 'clientMutationId');
|
|
20
20
|
const result = await client.mutation
|
|
21
21
|
.sendVerificationEmail(parsedAnswers, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../executor';
|
|
2
|
-
import {
|
|
2
|
+
import { unflattenDotNotation, buildSelectFromPaths } from '../utils';
|
|
3
3
|
export default async (argv, prompter, _options) => {
|
|
4
4
|
try {
|
|
5
5
|
if (argv.help || argv.h) {
|
|
@@ -15,7 +15,7 @@ export default async (argv, prompter, _options) => {
|
|
|
15
15
|
},
|
|
16
16
|
]);
|
|
17
17
|
const client = getClient();
|
|
18
|
-
const parsedAnswers =
|
|
18
|
+
const parsedAnswers = unflattenDotNotation(answers);
|
|
19
19
|
const selectFields = buildSelectFromPaths(argv.select ?? 'clientMutationId');
|
|
20
20
|
const result = await client.mutation
|
|
21
21
|
.setPassword(parsedAnswers, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../executor';
|
|
2
|
-
import {
|
|
2
|
+
import { unflattenDotNotation, buildSelectFromPaths } from '../utils';
|
|
3
3
|
export default async (argv, prompter, _options) => {
|
|
4
4
|
try {
|
|
5
5
|
if (argv.help || argv.h) {
|
|
@@ -15,7 +15,7 @@ export default async (argv, prompter, _options) => {
|
|
|
15
15
|
},
|
|
16
16
|
]);
|
|
17
17
|
const client = getClient();
|
|
18
|
-
const parsedAnswers =
|
|
18
|
+
const parsedAnswers = unflattenDotNotation(answers);
|
|
19
19
|
const selectFields = buildSelectFromPaths(argv.select ?? 'clientMutationId');
|
|
20
20
|
const result = await client.mutation
|
|
21
21
|
.signInOneTimeToken(parsedAnswers, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../executor';
|
|
2
|
-
import {
|
|
2
|
+
import { unflattenDotNotation, buildSelectFromPaths } from '../utils';
|
|
3
3
|
export default async (argv, prompter, _options) => {
|
|
4
4
|
try {
|
|
5
5
|
if (argv.help || argv.h) {
|
|
@@ -15,7 +15,7 @@ export default async (argv, prompter, _options) => {
|
|
|
15
15
|
},
|
|
16
16
|
]);
|
|
17
17
|
const client = getClient();
|
|
18
|
-
const parsedAnswers =
|
|
18
|
+
const parsedAnswers = unflattenDotNotation(answers);
|
|
19
19
|
const selectFields = buildSelectFromPaths(argv.select ?? 'clientMutationId');
|
|
20
20
|
const result = await client.mutation
|
|
21
21
|
.signIn(parsedAnswers, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../executor';
|
|
2
|
-
import {
|
|
2
|
+
import { unflattenDotNotation, buildSelectFromPaths } from '../utils';
|
|
3
3
|
export default async (argv, prompter, _options) => {
|
|
4
4
|
try {
|
|
5
5
|
if (argv.help || argv.h) {
|
|
@@ -15,7 +15,7 @@ export default async (argv, prompter, _options) => {
|
|
|
15
15
|
},
|
|
16
16
|
]);
|
|
17
17
|
const client = getClient();
|
|
18
|
-
const parsedAnswers =
|
|
18
|
+
const parsedAnswers = unflattenDotNotation(answers);
|
|
19
19
|
const selectFields = buildSelectFromPaths(argv.select ?? 'clientMutationId');
|
|
20
20
|
const result = await client.mutation
|
|
21
21
|
.signOut(parsedAnswers, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../executor';
|
|
2
|
-
import {
|
|
2
|
+
import { unflattenDotNotation, buildSelectFromPaths } from '../utils';
|
|
3
3
|
export default async (argv, prompter, _options) => {
|
|
4
4
|
try {
|
|
5
5
|
if (argv.help || argv.h) {
|
|
@@ -15,7 +15,7 @@ export default async (argv, prompter, _options) => {
|
|
|
15
15
|
},
|
|
16
16
|
]);
|
|
17
17
|
const client = getClient();
|
|
18
|
-
const parsedAnswers =
|
|
18
|
+
const parsedAnswers = unflattenDotNotation(answers);
|
|
19
19
|
const selectFields = buildSelectFromPaths(argv.select ?? 'clientMutationId');
|
|
20
20
|
const result = await client.mutation
|
|
21
21
|
.signUp(parsedAnswers, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../executor';
|
|
2
|
-
import {
|
|
2
|
+
import { unflattenDotNotation, buildSelectFromPaths } from '../utils';
|
|
3
3
|
export default async (argv, prompter, _options) => {
|
|
4
4
|
try {
|
|
5
5
|
if (argv.help || argv.h) {
|
|
@@ -15,7 +15,7 @@ export default async (argv, prompter, _options) => {
|
|
|
15
15
|
},
|
|
16
16
|
]);
|
|
17
17
|
const client = getClient();
|
|
18
|
-
const parsedAnswers =
|
|
18
|
+
const parsedAnswers = unflattenDotNotation(answers);
|
|
19
19
|
const selectFields = buildSelectFromPaths(argv.select ?? 'clientMutationId');
|
|
20
20
|
const result = await client.mutation
|
|
21
21
|
.verifyEmail(parsedAnswers, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../executor';
|
|
2
|
-
import {
|
|
2
|
+
import { unflattenDotNotation, buildSelectFromPaths } from '../utils';
|
|
3
3
|
export default async (argv, prompter, _options) => {
|
|
4
4
|
try {
|
|
5
5
|
if (argv.help || argv.h) {
|
|
@@ -15,7 +15,7 @@ export default async (argv, prompter, _options) => {
|
|
|
15
15
|
},
|
|
16
16
|
]);
|
|
17
17
|
const client = getClient();
|
|
18
|
-
const parsedAnswers =
|
|
18
|
+
const parsedAnswers = unflattenDotNotation(answers);
|
|
19
19
|
const selectFields = buildSelectFromPaths(argv.select ?? 'clientMutationId');
|
|
20
20
|
const result = await client.mutation
|
|
21
21
|
.verifyPassword(parsedAnswers, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getClient } from '../executor';
|
|
2
|
-
import {
|
|
2
|
+
import { unflattenDotNotation, buildSelectFromPaths } from '../utils';
|
|
3
3
|
export default async (argv, prompter, _options) => {
|
|
4
4
|
try {
|
|
5
5
|
if (argv.help || argv.h) {
|
|
@@ -15,7 +15,7 @@ export default async (argv, prompter, _options) => {
|
|
|
15
15
|
},
|
|
16
16
|
]);
|
|
17
17
|
const client = getClient();
|
|
18
|
-
const parsedAnswers =
|
|
18
|
+
const parsedAnswers = unflattenDotNotation(answers);
|
|
19
19
|
const selectFields = buildSelectFromPaths(argv.select ?? 'clientMutationId');
|
|
20
20
|
const result = await client.mutation
|
|
21
21
|
.verifyTotp(parsedAnswers, {
|
package/esm/auth/cli/index.js
CHANGED
|
@@ -10,9 +10,9 @@ if (process.argv.includes('--version') || process.argv.includes('-v')) {
|
|
|
10
10
|
console.log(pkg.version);
|
|
11
11
|
process.exit(0);
|
|
12
12
|
}
|
|
13
|
-
// Check for --tty false to enable non-interactive mode (noTty)
|
|
13
|
+
// Check for --tty false or --no-tty to enable non-interactive mode (noTty)
|
|
14
14
|
const ttyIdx = process.argv.indexOf('--tty');
|
|
15
|
-
const noTty = ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false';
|
|
15
|
+
const noTty = (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty');
|
|
16
16
|
const options = {
|
|
17
17
|
noTty,
|
|
18
18
|
minimistOpts: { alias: { v: 'version', h: 'help' } },
|
package/esm/auth/cli/utils.d.ts
CHANGED
|
@@ -20,6 +20,19 @@ export declare function stripUndefined(obj: Record<string, unknown>, schema?: Fi
|
|
|
20
20
|
* from the CLI prompt. This parses it into a proper object.
|
|
21
21
|
*/
|
|
22
22
|
export declare function parseMutationInput(answers: Record<string, unknown>): Record<string, unknown>;
|
|
23
|
+
/**
|
|
24
|
+
* Reconstruct nested objects from dot-notation CLI answers.
|
|
25
|
+
* When INPUT_OBJECT args are flattened to dot-notation questions
|
|
26
|
+
* (e.g. `--input.email foo --input.password bar`), this function
|
|
27
|
+
* rebuilds the nested structure expected by the ORM:
|
|
28
|
+
*
|
|
29
|
+
* { 'input.email': 'foo', 'input.password': 'bar' }
|
|
30
|
+
* → { input: { email: 'foo', password: 'bar' } }
|
|
31
|
+
*
|
|
32
|
+
* Non-dotted keys are passed through unchanged.
|
|
33
|
+
* Uses `nested-obj` for safe nested property setting.
|
|
34
|
+
*/
|
|
35
|
+
export declare function unflattenDotNotation(answers: Record<string, unknown>): Record<string, unknown>;
|
|
23
36
|
/**
|
|
24
37
|
* Build a select object from a comma-separated list of dot-notation paths.
|
|
25
38
|
* Uses `nested-obj` to parse paths like 'clientMutationId,result.accessToken,result.userId'
|
package/esm/auth/cli/utils.js
CHANGED
|
@@ -115,6 +115,30 @@ export function parseMutationInput(answers) {
|
|
|
115
115
|
}
|
|
116
116
|
return answers;
|
|
117
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* Reconstruct nested objects from dot-notation CLI answers.
|
|
120
|
+
* When INPUT_OBJECT args are flattened to dot-notation questions
|
|
121
|
+
* (e.g. `--input.email foo --input.password bar`), this function
|
|
122
|
+
* rebuilds the nested structure expected by the ORM:
|
|
123
|
+
*
|
|
124
|
+
* { 'input.email': 'foo', 'input.password': 'bar' }
|
|
125
|
+
* → { input: { email: 'foo', password: 'bar' } }
|
|
126
|
+
*
|
|
127
|
+
* Non-dotted keys are passed through unchanged.
|
|
128
|
+
* Uses `nested-obj` for safe nested property setting.
|
|
129
|
+
*/
|
|
130
|
+
export function unflattenDotNotation(answers) {
|
|
131
|
+
const result = {};
|
|
132
|
+
for (const [key, value] of Object.entries(answers)) {
|
|
133
|
+
if (key.includes('.')) {
|
|
134
|
+
objectPath.set(result, key, value);
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
result[key] = value;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return result;
|
|
141
|
+
}
|
|
118
142
|
/**
|
|
119
143
|
* Build a select object from a comma-separated list of dot-notation paths.
|
|
120
144
|
* Uses `nested-obj` to parse paths like 'clientMutationId,result.accessToken,result.userId'
|