@constructive-sdk/cli 0.20.7 → 0.20.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/admin/orm/client.d.ts +30 -0
- package/admin/orm/client.js +41 -1
- package/admin/orm/realtime.d.ts +142 -0
- package/admin/orm/realtime.js +104 -0
- package/auth/orm/client.d.ts +30 -0
- package/auth/orm/client.js +41 -1
- package/auth/orm/realtime.d.ts +142 -0
- package/auth/orm/realtime.js +104 -0
- package/esm/admin/orm/client.d.ts +30 -0
- package/esm/admin/orm/client.js +39 -0
- package/esm/admin/orm/realtime.d.ts +142 -0
- package/esm/admin/orm/realtime.js +100 -0
- package/esm/auth/orm/client.d.ts +30 -0
- package/esm/auth/orm/client.js +39 -0
- package/esm/auth/orm/realtime.d.ts +142 -0
- package/esm/auth/orm/realtime.js +100 -0
- package/esm/objects/orm/client.d.ts +30 -0
- package/esm/objects/orm/client.js +39 -0
- package/esm/objects/orm/realtime.d.ts +142 -0
- package/esm/objects/orm/realtime.js +100 -0
- package/esm/public/cli/commands.js +1 -3
- package/esm/public/cli/executor.d.ts +0 -5
- package/esm/public/orm/client.d.ts +30 -0
- package/esm/public/orm/client.js +39 -0
- package/esm/public/orm/index.d.ts +0 -5
- package/esm/public/orm/input-types.d.ts +0 -11
- package/esm/public/orm/mutation/index.d.ts +1 -9
- package/esm/public/orm/mutation/index.js +0 -12
- package/esm/public/orm/realtime.d.ts +142 -0
- package/esm/public/orm/realtime.js +100 -0
- package/objects/orm/client.d.ts +30 -0
- package/objects/orm/client.js +41 -1
- package/objects/orm/realtime.d.ts +142 -0
- package/objects/orm/realtime.js +104 -0
- package/package.json +2 -2
- package/public/cli/commands.js +1 -3
- package/public/cli/executor.d.ts +0 -5
- package/public/orm/client.d.ts +30 -0
- package/public/orm/client.js +41 -1
- package/public/orm/index.d.ts +0 -5
- package/public/orm/input-types.d.ts +0 -11
- package/public/orm/mutation/index.d.ts +1 -9
- package/public/orm/mutation/index.js +0 -12
- package/public/orm/realtime.d.ts +142 -0
- package/public/orm/realtime.js +104 -0
- package/esm/public/cli/commands/append-smart-tags.d.ts +0 -8
- package/esm/public/cli/commands/append-smart-tags.js +0 -34
- package/public/cli/commands/append-smart-tags.d.ts +0 -8
- package/public/cli/commands/append-smart-tags.js +0 -36
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { OrmClient } from '../client';
|
|
7
7
|
import { QueryBuilder } from '../query-builder';
|
|
8
8
|
import type { InferSelectResult, StrictSelect } from '../select-types';
|
|
9
|
-
import type { SendAccountDeletionEmailInput, SignOutInput, AcceptDatabaseTransferInput, CancelDatabaseTransferInput, RejectDatabaseTransferInput, DisconnectAccountInput, RevokeApiKeyInput, RevokeSessionInput, VerifyPasswordInput, VerifyTotpInput, SubmitAppInviteCodeInput, SubmitOrgInviteCodeInput, CheckPasswordInput, ConfirmDeleteAccountInput, SetPasswordInput, VerifyEmailInput, FreezeObjectsInput, InitEmptyRepoInput, ConstructBlueprintInput, ProvisionNewUserInput, ResetPasswordInput, RemoveNodeAtPathInput, CopyTemplateToBlueprintInput, ProvisionSpatialRelationInput, BootstrapUserInput, SetFieldOrderInput,
|
|
9
|
+
import type { SendAccountDeletionEmailInput, SignOutInput, AcceptDatabaseTransferInput, CancelDatabaseTransferInput, RejectDatabaseTransferInput, DisconnectAccountInput, RevokeApiKeyInput, RevokeSessionInput, VerifyPasswordInput, VerifyTotpInput, SubmitAppInviteCodeInput, SubmitOrgInviteCodeInput, CheckPasswordInput, ConfirmDeleteAccountInput, SetPasswordInput, VerifyEmailInput, FreezeObjectsInput, InitEmptyRepoInput, ConstructBlueprintInput, ProvisionNewUserInput, ResetPasswordInput, RemoveNodeAtPathInput, CopyTemplateToBlueprintInput, ProvisionSpatialRelationInput, BootstrapUserInput, SetFieldOrderInput, ProvisionUniqueConstraintInput, ProvisionFullTextSearchInput, ProvisionIndexInput, SetDataAtPathInput, SetPropsAndCommitInput, ProvisionDatabaseWithUserInput, InsertNodeAtPathInput, UpdateNodeAtPathInput, SetAndCommitInput, ProvisionRelationInput, ApplyRlsInput, SignInCrossOriginInput, CreateUserDatabaseInput, ExtendTokenExpiresInput, CreateApiKeyInput, SendVerificationEmailInput, ForgotPasswordInput, SignUpInput, RequestCrossOriginTokenInput, SignInInput, ProvisionTableInput, ProvisionBucketInput, SendAccountDeletionEmailPayload, SignOutPayload, AcceptDatabaseTransferPayload, CancelDatabaseTransferPayload, RejectDatabaseTransferPayload, DisconnectAccountPayload, RevokeApiKeyPayload, RevokeSessionPayload, VerifyPasswordPayload, VerifyTotpPayload, SubmitAppInviteCodePayload, SubmitOrgInviteCodePayload, CheckPasswordPayload, ConfirmDeleteAccountPayload, SetPasswordPayload, VerifyEmailPayload, FreezeObjectsPayload, InitEmptyRepoPayload, ConstructBlueprintPayload, ProvisionNewUserPayload, ResetPasswordPayload, RemoveNodeAtPathPayload, CopyTemplateToBlueprintPayload, ProvisionSpatialRelationPayload, BootstrapUserPayload, SetFieldOrderPayload, ProvisionUniqueConstraintPayload, ProvisionFullTextSearchPayload, ProvisionIndexPayload, SetDataAtPathPayload, SetPropsAndCommitPayload, ProvisionDatabaseWithUserPayload, InsertNodeAtPathPayload, UpdateNodeAtPathPayload, SetAndCommitPayload, ProvisionRelationPayload, ApplyRlsPayload, SignInCrossOriginPayload, CreateUserDatabasePayload, ExtendTokenExpiresPayload, CreateApiKeyPayload, SendVerificationEmailPayload, ForgotPasswordPayload, SignUpPayload, RequestCrossOriginTokenPayload, SignInPayload, ProvisionTablePayload, ProvisionBucketPayload, SendAccountDeletionEmailPayloadSelect, SignOutPayloadSelect, AcceptDatabaseTransferPayloadSelect, CancelDatabaseTransferPayloadSelect, RejectDatabaseTransferPayloadSelect, DisconnectAccountPayloadSelect, RevokeApiKeyPayloadSelect, RevokeSessionPayloadSelect, VerifyPasswordPayloadSelect, VerifyTotpPayloadSelect, SubmitAppInviteCodePayloadSelect, SubmitOrgInviteCodePayloadSelect, CheckPasswordPayloadSelect, ConfirmDeleteAccountPayloadSelect, SetPasswordPayloadSelect, VerifyEmailPayloadSelect, FreezeObjectsPayloadSelect, InitEmptyRepoPayloadSelect, ConstructBlueprintPayloadSelect, ProvisionNewUserPayloadSelect, ResetPasswordPayloadSelect, RemoveNodeAtPathPayloadSelect, CopyTemplateToBlueprintPayloadSelect, ProvisionSpatialRelationPayloadSelect, BootstrapUserPayloadSelect, SetFieldOrderPayloadSelect, ProvisionUniqueConstraintPayloadSelect, ProvisionFullTextSearchPayloadSelect, ProvisionIndexPayloadSelect, SetDataAtPathPayloadSelect, SetPropsAndCommitPayloadSelect, ProvisionDatabaseWithUserPayloadSelect, InsertNodeAtPathPayloadSelect, UpdateNodeAtPathPayloadSelect, SetAndCommitPayloadSelect, ProvisionRelationPayloadSelect, ApplyRlsPayloadSelect, SignInCrossOriginPayloadSelect, CreateUserDatabasePayloadSelect, ExtendTokenExpiresPayloadSelect, CreateApiKeyPayloadSelect, SendVerificationEmailPayloadSelect, ForgotPasswordPayloadSelect, SignUpPayloadSelect, RequestCrossOriginTokenPayloadSelect, SignInPayloadSelect, ProvisionTablePayloadSelect, ProvisionBucketPayloadSelect } from '../input-types';
|
|
10
10
|
export interface SendAccountDeletionEmailVariables {
|
|
11
11
|
input: SendAccountDeletionEmailInput;
|
|
12
12
|
}
|
|
@@ -97,9 +97,6 @@ export interface BootstrapUserVariables {
|
|
|
97
97
|
export interface SetFieldOrderVariables {
|
|
98
98
|
input: SetFieldOrderInput;
|
|
99
99
|
}
|
|
100
|
-
export interface AppendSmartTagsVariables {
|
|
101
|
-
input: AppendSmartTagsInput;
|
|
102
|
-
}
|
|
103
100
|
/**
|
|
104
101
|
* Variables for provisionUniqueConstraint
|
|
105
102
|
* Creates a unique constraint on a table. Accepts a jsonb definition with columns (array of field names). Graceful: skips if the exact same unique constraint already exists.
|
|
@@ -343,11 +340,6 @@ export declare function createMutationOperations(client: OrmClient): {
|
|
|
343
340
|
} & StrictSelect<S, SetFieldOrderPayloadSelect>) => QueryBuilder<{
|
|
344
341
|
setFieldOrder: InferSelectResult<SetFieldOrderPayload, S> | null;
|
|
345
342
|
}>;
|
|
346
|
-
appendSmartTags: <S extends AppendSmartTagsPayloadSelect>(args: AppendSmartTagsVariables, options: {
|
|
347
|
-
select: S;
|
|
348
|
-
} & StrictSelect<S, AppendSmartTagsPayloadSelect>) => QueryBuilder<{
|
|
349
|
-
appendSmartTags: InferSelectResult<AppendSmartTagsPayload, S> | null;
|
|
350
|
-
}>;
|
|
351
343
|
provisionUniqueConstraint: <S extends ProvisionUniqueConstraintPayloadSelect>(args: ProvisionUniqueConstraintVariables, options: {
|
|
352
344
|
select: S;
|
|
353
345
|
} & StrictSelect<S, ProvisionUniqueConstraintPayloadSelect>) => QueryBuilder<{
|
|
@@ -317,18 +317,6 @@ function createMutationOperations(client) {
|
|
|
317
317
|
},
|
|
318
318
|
], input_types_1.connectionFieldsMap, 'SetFieldOrderPayload'),
|
|
319
319
|
}),
|
|
320
|
-
appendSmartTags: (args, options) => new query_builder_1.QueryBuilder({
|
|
321
|
-
client,
|
|
322
|
-
operation: 'mutation',
|
|
323
|
-
operationName: 'AppendSmartTags',
|
|
324
|
-
fieldName: 'appendSmartTags',
|
|
325
|
-
...(0, query_builder_1.buildCustomDocument)('mutation', 'AppendSmartTags', 'appendSmartTags', options.select, args, [
|
|
326
|
-
{
|
|
327
|
-
name: 'input',
|
|
328
|
-
type: 'AppendSmartTagsInput!',
|
|
329
|
-
},
|
|
330
|
-
], input_types_1.connectionFieldsMap, 'AppendSmartTagsPayload'),
|
|
331
|
-
}),
|
|
332
320
|
provisionUniqueConstraint: (args, options) => new query_builder_1.QueryBuilder({
|
|
333
321
|
client,
|
|
334
322
|
operation: 'mutation',
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Realtime Manager - WebSocket subscription support
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
interface WsGraphQLError {
|
|
7
|
+
readonly message: string;
|
|
8
|
+
readonly [key: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
interface WsExecutionResult<TData = Record<string, unknown>> {
|
|
11
|
+
data?: TData | null;
|
|
12
|
+
errors?: readonly WsGraphQLError[];
|
|
13
|
+
extensions?: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
interface WsSink<T> {
|
|
16
|
+
next(value: T): void;
|
|
17
|
+
error(error: unknown): void;
|
|
18
|
+
complete(): void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Minimal interface matching the graphql-ws Client.
|
|
22
|
+
* Consumers pass a concrete instance via RealtimeConfig.client.
|
|
23
|
+
*/
|
|
24
|
+
export interface WsClient {
|
|
25
|
+
subscribe<TData = Record<string, unknown>>(payload: {
|
|
26
|
+
query: string;
|
|
27
|
+
variables?: Record<string, unknown>;
|
|
28
|
+
}, sink: WsSink<WsExecutionResult<TData>>): () => void;
|
|
29
|
+
dispose(): void;
|
|
30
|
+
}
|
|
31
|
+
/** The DML operation that triggered the subscription event */
|
|
32
|
+
export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE';
|
|
33
|
+
/** Connection state of the WebSocket */
|
|
34
|
+
export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting';
|
|
35
|
+
/** Listener for connection state changes */
|
|
36
|
+
export type ConnectionStateListener = (state: ConnectionState) => void;
|
|
37
|
+
/** Function returned by subscribe() to cancel the subscription */
|
|
38
|
+
export type Unsubscribe = () => void;
|
|
39
|
+
/**
|
|
40
|
+
* A realtime subscription event delivered to the client.
|
|
41
|
+
*
|
|
42
|
+
* @typeParam T - The row type of the subscribed table
|
|
43
|
+
*/
|
|
44
|
+
export interface SubscriptionEvent<T> {
|
|
45
|
+
/** The DML operation that triggered this event */
|
|
46
|
+
operation: SubscriptionOperation;
|
|
47
|
+
/** The current row data (null for DELETE if row is no longer visible) */
|
|
48
|
+
data: T | null;
|
|
49
|
+
/** Previous field values (populated on UPDATE when available) */
|
|
50
|
+
previousValues?: Partial<T>;
|
|
51
|
+
/** Server-side timestamp of when the change occurred */
|
|
52
|
+
timestamp: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Options for creating a subscription.
|
|
56
|
+
*
|
|
57
|
+
* @typeParam T - The row type of the subscribed table
|
|
58
|
+
* @typeParam TFilter - The filter type for the table
|
|
59
|
+
*/
|
|
60
|
+
export interface SubscribeOptions<T, TFilter = Record<string, unknown>> {
|
|
61
|
+
/** Server-side filter to limit which events are delivered */
|
|
62
|
+
filter?: TFilter;
|
|
63
|
+
/** Called when a subscription event is received */
|
|
64
|
+
onEvent: (event: SubscriptionEvent<T>) => void;
|
|
65
|
+
/** Called when the subscription encounters an error */
|
|
66
|
+
onError?: (error: Error) => void;
|
|
67
|
+
/** Called when the subscription completes (server-initiated close) */
|
|
68
|
+
onComplete?: () => void;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Metadata about a subscription field, used internally to map
|
|
72
|
+
* table names to GraphQL subscription field names and types.
|
|
73
|
+
*/
|
|
74
|
+
export interface SubscriptionFieldMeta {
|
|
75
|
+
/** The GraphQL subscription field name (e.g., 'onContactChanged') */
|
|
76
|
+
fieldName: string;
|
|
77
|
+
/** The table name in the source schema (e.g., 'contact') */
|
|
78
|
+
tableName: string;
|
|
79
|
+
/** The data field name inside the subscription payload (e.g., 'contact') */
|
|
80
|
+
dataFieldName: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Configuration for the realtime (WebSocket) connection.
|
|
84
|
+
* Pass this as the `realtime` option in OrmClientConfig.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* import { createClient } from 'graphql-ws';
|
|
89
|
+
*
|
|
90
|
+
* const client = createOrmClient({
|
|
91
|
+
* endpoint: 'https://api.example.com/graphql',
|
|
92
|
+
* realtime: {
|
|
93
|
+
* client: createClient({ url: 'wss://api.example.com/graphql' }),
|
|
94
|
+
* },
|
|
95
|
+
* });
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export interface RealtimeConfig {
|
|
99
|
+
/**
|
|
100
|
+
* A graphql-ws Client instance (or any object satisfying WsClient).
|
|
101
|
+
* The consumer creates this themselves, giving full control over
|
|
102
|
+
* connection options, auth, and transport.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```ts
|
|
106
|
+
* import { createClient } from 'graphql-ws';
|
|
107
|
+
* const wsClient = createClient({ url: 'wss://...' });
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
client: WsClient;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Manages a graphql-ws WebSocket client and multiplexes
|
|
114
|
+
* subscriptions over it. Created by OrmClient when `realtime`
|
|
115
|
+
* config is provided.
|
|
116
|
+
*/
|
|
117
|
+
export declare class RealtimeManager {
|
|
118
|
+
private wsClient;
|
|
119
|
+
private connectionState;
|
|
120
|
+
private stateListeners;
|
|
121
|
+
private activeSubscriptions;
|
|
122
|
+
constructor(config: RealtimeConfig);
|
|
123
|
+
/**
|
|
124
|
+
* Subscribe to a GraphQL subscription operation.
|
|
125
|
+
* Models call this with typed metadata and documents.
|
|
126
|
+
*/
|
|
127
|
+
subscribe<T>(meta: SubscriptionFieldMeta, document: string, variables: Record<string, unknown>, options: {
|
|
128
|
+
onEvent: (event: SubscriptionEvent<T>) => void;
|
|
129
|
+
onError?: (error: Error) => void;
|
|
130
|
+
onComplete?: () => void;
|
|
131
|
+
}): Unsubscribe;
|
|
132
|
+
/** Register a listener for connection state changes */
|
|
133
|
+
onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe;
|
|
134
|
+
/** Get current connection state */
|
|
135
|
+
getConnectionState(): ConnectionState;
|
|
136
|
+
/** Number of active subscriptions */
|
|
137
|
+
getActiveSubscriptionCount(): number;
|
|
138
|
+
/** Dispose the manager and close the WebSocket connection */
|
|
139
|
+
dispose(): void;
|
|
140
|
+
private setConnectionState;
|
|
141
|
+
}
|
|
142
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Realtime Manager - WebSocket subscription support
|
|
4
|
+
* @generated by @constructive-io/graphql-codegen
|
|
5
|
+
* DO NOT EDIT - changes will be overwritten
|
|
6
|
+
*/
|
|
7
|
+
// Minimal type shims so this module compiles without graphql-ws
|
|
8
|
+
// installed. Consumers supply a WsClient via RealtimeConfig;
|
|
9
|
+
// the SDK itself never imports or requires graphql-ws.
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.RealtimeManager = void 0;
|
|
12
|
+
// ============================================================================
|
|
13
|
+
// RealtimeManager
|
|
14
|
+
// ============================================================================
|
|
15
|
+
/**
|
|
16
|
+
* Manages a graphql-ws WebSocket client and multiplexes
|
|
17
|
+
* subscriptions over it. Created by OrmClient when `realtime`
|
|
18
|
+
* config is provided.
|
|
19
|
+
*/
|
|
20
|
+
class RealtimeManager {
|
|
21
|
+
wsClient;
|
|
22
|
+
connectionState = 'disconnected';
|
|
23
|
+
stateListeners = new Set();
|
|
24
|
+
activeSubscriptions = 0;
|
|
25
|
+
constructor(config) {
|
|
26
|
+
this.wsClient = config.client;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Subscribe to a GraphQL subscription operation.
|
|
30
|
+
* Models call this with typed metadata and documents.
|
|
31
|
+
*/
|
|
32
|
+
subscribe(meta, document, variables, options) {
|
|
33
|
+
this.activeSubscriptions++;
|
|
34
|
+
let disposed = false;
|
|
35
|
+
const cleanup = this.wsClient.subscribe({ query: document, variables }, {
|
|
36
|
+
next: (result) => {
|
|
37
|
+
if (disposed)
|
|
38
|
+
return;
|
|
39
|
+
if (result.errors) {
|
|
40
|
+
options.onError?.(new Error(result.errors.map((e) => e.message).join('; ')));
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const payload = result.data?.[meta.fieldName];
|
|
44
|
+
if (!payload)
|
|
45
|
+
return;
|
|
46
|
+
const event = {
|
|
47
|
+
operation: payload.event ?? 'UPDATE',
|
|
48
|
+
data: payload[meta.dataFieldName] ?? null,
|
|
49
|
+
previousValues: payload.previousValues,
|
|
50
|
+
timestamp: payload.timestamp ?? new Date().toISOString(),
|
|
51
|
+
};
|
|
52
|
+
options.onEvent(event);
|
|
53
|
+
},
|
|
54
|
+
error: (err) => {
|
|
55
|
+
if (disposed)
|
|
56
|
+
return;
|
|
57
|
+
options.onError?.(err instanceof Error ? err : new Error(String(err)));
|
|
58
|
+
},
|
|
59
|
+
complete: () => {
|
|
60
|
+
if (disposed)
|
|
61
|
+
return;
|
|
62
|
+
options.onComplete?.();
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
return () => {
|
|
66
|
+
if (disposed)
|
|
67
|
+
return;
|
|
68
|
+
disposed = true;
|
|
69
|
+
this.activeSubscriptions--;
|
|
70
|
+
cleanup();
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/** Register a listener for connection state changes */
|
|
74
|
+
onConnectionStateChange(listener) {
|
|
75
|
+
this.stateListeners.add(listener);
|
|
76
|
+
return () => {
|
|
77
|
+
this.stateListeners.delete(listener);
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/** Get current connection state */
|
|
81
|
+
getConnectionState() {
|
|
82
|
+
return this.connectionState;
|
|
83
|
+
}
|
|
84
|
+
/** Number of active subscriptions */
|
|
85
|
+
getActiveSubscriptionCount() {
|
|
86
|
+
return this.activeSubscriptions;
|
|
87
|
+
}
|
|
88
|
+
/** Dispose the manager and close the WebSocket connection */
|
|
89
|
+
dispose() {
|
|
90
|
+
this.wsClient.dispose();
|
|
91
|
+
this.stateListeners.clear();
|
|
92
|
+
this.activeSubscriptions = 0;
|
|
93
|
+
this.setConnectionState('disconnected');
|
|
94
|
+
}
|
|
95
|
+
setConnectionState(state) {
|
|
96
|
+
if (this.connectionState === state)
|
|
97
|
+
return;
|
|
98
|
+
this.connectionState = state;
|
|
99
|
+
for (const listener of this.stateListeners) {
|
|
100
|
+
listener(state);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.RealtimeManager = RealtimeManager;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI command for mutation appendSmartTags
|
|
3
|
-
* @generated by @constructive-io/graphql-codegen
|
|
4
|
-
* DO NOT EDIT - changes will be overwritten
|
|
5
|
-
*/
|
|
6
|
-
import { CLIOptions, Inquirerer } from 'inquirerer';
|
|
7
|
-
declare const _default: (argv: Partial<Record<string, unknown>>, prompter: Inquirerer, _options: CLIOptions) => Promise<void>;
|
|
8
|
-
export default _default;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { getClient } from '../executor';
|
|
2
|
-
import { unflattenDotNotation, buildSelectFromPaths } from '../utils';
|
|
3
|
-
export default async (argv, prompter, _options) => {
|
|
4
|
-
try {
|
|
5
|
-
if (argv.help || argv.h) {
|
|
6
|
-
console.log('append-smart-tags - appendSmartTags\n\nUsage: append-smart-tags [OPTIONS]\n');
|
|
7
|
-
process.exit(0);
|
|
8
|
-
}
|
|
9
|
-
const answers = await prompter.prompt(argv, [
|
|
10
|
-
{
|
|
11
|
-
type: 'text',
|
|
12
|
-
name: 'input',
|
|
13
|
-
message: 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.',
|
|
14
|
-
required: true,
|
|
15
|
-
},
|
|
16
|
-
]);
|
|
17
|
-
const client = getClient();
|
|
18
|
-
const parsedAnswers = unflattenDotNotation(answers);
|
|
19
|
-
const selectFields = buildSelectFromPaths(argv.select ?? 'clientMutationId');
|
|
20
|
-
const result = await client.mutation
|
|
21
|
-
.appendSmartTags(parsedAnswers, {
|
|
22
|
-
select: selectFields,
|
|
23
|
-
})
|
|
24
|
-
.execute();
|
|
25
|
-
console.log(JSON.stringify(result, null, 2));
|
|
26
|
-
}
|
|
27
|
-
catch (error) {
|
|
28
|
-
console.error('Failed: appendSmartTags');
|
|
29
|
-
if (error instanceof Error) {
|
|
30
|
-
console.error(error.message);
|
|
31
|
-
}
|
|
32
|
-
process.exit(1);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI command for mutation appendSmartTags
|
|
3
|
-
* @generated by @constructive-io/graphql-codegen
|
|
4
|
-
* DO NOT EDIT - changes will be overwritten
|
|
5
|
-
*/
|
|
6
|
-
import { CLIOptions, Inquirerer } from 'inquirerer';
|
|
7
|
-
declare const _default: (argv: Partial<Record<string, unknown>>, prompter: Inquirerer, _options: CLIOptions) => Promise<void>;
|
|
8
|
-
export default _default;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const executor_1 = require("../executor");
|
|
4
|
-
const utils_1 = require("../utils");
|
|
5
|
-
exports.default = async (argv, prompter, _options) => {
|
|
6
|
-
try {
|
|
7
|
-
if (argv.help || argv.h) {
|
|
8
|
-
console.log('append-smart-tags - appendSmartTags\n\nUsage: append-smart-tags [OPTIONS]\n');
|
|
9
|
-
process.exit(0);
|
|
10
|
-
}
|
|
11
|
-
const answers = await prompter.prompt(argv, [
|
|
12
|
-
{
|
|
13
|
-
type: 'text',
|
|
14
|
-
name: 'input',
|
|
15
|
-
message: 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.',
|
|
16
|
-
required: true,
|
|
17
|
-
},
|
|
18
|
-
]);
|
|
19
|
-
const client = (0, executor_1.getClient)();
|
|
20
|
-
const parsedAnswers = (0, utils_1.unflattenDotNotation)(answers);
|
|
21
|
-
const selectFields = (0, utils_1.buildSelectFromPaths)(argv.select ?? 'clientMutationId');
|
|
22
|
-
const result = await client.mutation
|
|
23
|
-
.appendSmartTags(parsedAnswers, {
|
|
24
|
-
select: selectFields,
|
|
25
|
-
})
|
|
26
|
-
.execute();
|
|
27
|
-
console.log(JSON.stringify(result, null, 2));
|
|
28
|
-
}
|
|
29
|
-
catch (error) {
|
|
30
|
-
console.error('Failed: appendSmartTags');
|
|
31
|
-
if (error instanceof Error) {
|
|
32
|
-
console.error(error.message);
|
|
33
|
-
}
|
|
34
|
-
process.exit(1);
|
|
35
|
-
}
|
|
36
|
-
};
|