naystack 1.5.9 → 1.5.11
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/README.md +646 -91
- package/dist/auth/constants.d.mts +4 -0
- package/dist/auth/constants.d.ts +4 -0
- package/dist/auth/email/client.d.mts +149 -0
- package/dist/auth/email/client.d.ts +149 -0
- package/dist/auth/email/index.cjs.js +2 -20
- package/dist/auth/email/index.d.mts +41 -1
- package/dist/auth/email/index.d.ts +41 -1
- package/dist/auth/email/index.esm.js +1 -17
- package/dist/auth/email/routes/delete.cjs.js +0 -1
- package/dist/auth/email/routes/delete.d.mts +5 -0
- package/dist/auth/email/routes/delete.d.ts +5 -0
- package/dist/auth/email/routes/delete.esm.js +0 -1
- package/dist/auth/email/routes/get.d.mts +5 -0
- package/dist/auth/email/routes/get.d.ts +5 -0
- package/dist/auth/email/routes/post.cjs.js +0 -1
- package/dist/auth/email/routes/post.d.mts +5 -0
- package/dist/auth/email/routes/post.d.ts +5 -0
- package/dist/auth/email/routes/post.esm.js +0 -1
- package/dist/auth/email/routes/put.cjs.js +0 -1
- package/dist/auth/email/routes/put.d.mts +5 -0
- package/dist/auth/email/routes/put.d.ts +5 -0
- package/dist/auth/email/routes/put.esm.js +0 -1
- package/dist/auth/email/token.d.mts +62 -0
- package/dist/auth/email/token.d.ts +62 -0
- package/dist/auth/email/types.d.mts +22 -0
- package/dist/auth/email/types.d.ts +22 -0
- package/dist/auth/email/utils.cjs.js +0 -18
- package/dist/auth/email/utils.d.mts +41 -3
- package/dist/auth/email/utils.d.ts +41 -3
- package/dist/auth/email/utils.esm.js +0 -16
- package/dist/auth/google/get.d.mts +5 -0
- package/dist/auth/google/get.d.ts +5 -0
- package/dist/auth/google/index.d.mts +39 -0
- package/dist/auth/google/index.d.ts +39 -0
- package/dist/auth/index.cjs.js +4 -22
- package/dist/auth/index.d.mts +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.esm.js +3 -19
- package/dist/auth/instagram/client.d.mts +19 -0
- package/dist/auth/instagram/client.d.ts +19 -0
- package/dist/auth/instagram/index.d.mts +37 -0
- package/dist/auth/instagram/index.d.ts +37 -0
- package/dist/auth/instagram/route.d.mts +5 -0
- package/dist/auth/instagram/route.d.ts +5 -0
- package/dist/auth/instagram/utils.d.mts +13 -0
- package/dist/auth/instagram/utils.d.ts +13 -0
- package/dist/auth/types.d.mts +24 -0
- package/dist/auth/types.d.ts +24 -0
- package/dist/auth/utils/errors.d.mts +10 -0
- package/dist/auth/utils/errors.d.ts +10 -0
- package/dist/auth/utils/token.d.mts +20 -0
- package/dist/auth/utils/token.d.ts +20 -0
- package/dist/client/hooks.d.mts +59 -0
- package/dist/client/hooks.d.ts +59 -0
- package/dist/client/seo.d.mts +46 -0
- package/dist/client/seo.d.ts +46 -0
- package/dist/env.d.mts +61 -0
- package/dist/env.d.ts +61 -0
- package/dist/file/client.d.mts +53 -1
- package/dist/file/client.d.ts +53 -1
- package/dist/file/index.cjs.js +0 -1
- package/dist/file/index.esm.js +0 -1
- package/dist/file/put.cjs.js +0 -1
- package/dist/file/put.d.mts +11 -0
- package/dist/file/put.d.ts +11 -0
- package/dist/file/put.esm.js +0 -1
- package/dist/file/setup.cjs.js +0 -1
- package/dist/file/setup.d.mts +48 -0
- package/dist/file/setup.d.ts +48 -0
- package/dist/file/setup.esm.js +0 -1
- package/dist/file/utils.d.mts +41 -0
- package/dist/file/utils.d.ts +41 -0
- package/dist/graphql/client.d.mts +113 -0
- package/dist/graphql/client.d.ts +113 -0
- package/dist/graphql/errors.d.mts +26 -0
- package/dist/graphql/errors.d.ts +26 -0
- package/dist/graphql/index.cjs.js +2 -3
- package/dist/graphql/index.esm.js +2 -3
- package/dist/graphql/init.cjs.js +0 -1
- package/dist/graphql/init.d.mts +33 -0
- package/dist/graphql/init.d.ts +33 -0
- package/dist/graphql/init.esm.js +0 -1
- package/dist/graphql/server.d.mts +88 -0
- package/dist/graphql/server.d.ts +88 -0
- package/dist/graphql/types.d.mts +21 -0
- package/dist/graphql/types.d.ts +21 -0
- package/dist/graphql/utils.d.mts +217 -0
- package/dist/graphql/utils.d.ts +217 -0
- package/dist/index.d.mts +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/socials/instagram/getters.d.mts +115 -0
- package/dist/socials/instagram/getters.d.ts +115 -0
- package/dist/socials/instagram/setters.d.mts +18 -0
- package/dist/socials/instagram/setters.d.ts +18 -0
- package/dist/socials/instagram/types.d.mts +46 -0
- package/dist/socials/instagram/types.d.ts +46 -0
- package/dist/socials/instagram/utils.d.mts +19 -0
- package/dist/socials/instagram/utils.d.ts +19 -0
- package/dist/socials/instagram/webhook.d.mts +31 -0
- package/dist/socials/instagram/webhook.d.ts +31 -0
- package/dist/socials/meta-webhook.d.mts +11 -0
- package/dist/socials/meta-webhook.d.ts +11 -0
- package/dist/socials/threads/getters.d.mts +57 -0
- package/dist/socials/threads/getters.d.ts +57 -0
- package/dist/socials/threads/setters.d.mts +59 -0
- package/dist/socials/threads/setters.d.ts +59 -0
- package/dist/socials/threads/types.d.mts +9 -0
- package/dist/socials/threads/types.d.ts +9 -0
- package/dist/socials/threads/utils.d.mts +19 -0
- package/dist/socials/threads/utils.d.ts +19 -0
- package/dist/socials/threads/webhook.d.mts +30 -0
- package/dist/socials/threads/webhook.d.ts +30 -0
- package/package.json +9 -5
package/dist/graphql/utils.d.ts
CHANGED
|
@@ -2,20 +2,29 @@ import { GraphQLScalarType } from 'graphql';
|
|
|
2
2
|
import { ClassType, Query, Arg } from 'type-graphql';
|
|
3
3
|
import { AuthorizedContext, Context } from './types.js';
|
|
4
4
|
|
|
5
|
+
/** Options for @Query() / @Mutation() return type (e.g. nullable). */
|
|
5
6
|
type ReturnOptions = Parameters<typeof Query>[1];
|
|
7
|
+
/** Options for @Arg() (e.g. nullable). */
|
|
6
8
|
type ArgsOptions = Parameters<typeof Arg>[2];
|
|
9
|
+
/** Maps nullable keys to optional and normalizes null/undefined. */
|
|
7
10
|
type NormalizeNullUndefined<T> = {
|
|
8
11
|
[K in keyof T as null extends T[K] ? K : never]?: Exclude<T[K], undefined>;
|
|
9
12
|
} & {
|
|
10
13
|
[K in keyof T as null extends T[K] ? never : K]: undefined extends T[K] ? Exclude<T[K], undefined> | null : T[K];
|
|
11
14
|
};
|
|
15
|
+
/** Adds nullable option to Query/Arg options. */
|
|
12
16
|
type NullableOptions<T, X extends boolean> = T & {
|
|
13
17
|
nullable: X;
|
|
14
18
|
};
|
|
19
|
+
/** Resolves a GraphQL type (class, scalar, primitive) to TS type. */
|
|
15
20
|
type ParsedGQLType<T, MergeNullUndefined extends boolean> = T extends StringConstructor ? string : T extends NumberConstructor ? number : T extends BooleanConstructor ? boolean : T extends GraphQLScalarType<infer U> ? U : T extends ClassType<infer U> ? MergeNullUndefined extends true ? NormalizeNullUndefined<U> : U : T extends Record<infer K, string | number> ? T[K] : void;
|
|
21
|
+
/** Array-aware ParsedGQLType. */
|
|
16
22
|
type ParsedGQLTypeWithArray<T, MergeNullUndefined extends boolean> = T extends Array<infer U> ? ParsedGQLType<U, MergeNullUndefined>[] : ParsedGQLType<T, MergeNullUndefined>;
|
|
23
|
+
/** Adds null/undefined when nullable. */
|
|
17
24
|
type ParsedGQLTypeWithNullability<T, IsNullable extends boolean, MergeNullUndefined extends boolean> = IsNullable extends true ? ParsedGQLTypeWithArray<T, MergeNullUndefined> | null | undefined : ParsedGQLTypeWithArray<T, MergeNullUndefined>;
|
|
25
|
+
/** Allows resolver to return T or Promise<T>. */
|
|
18
26
|
type Promisify<T> = T | Promise<T>;
|
|
27
|
+
/** Base for query/field definition (output, input, options). */
|
|
19
28
|
interface BaseDefinition<T, U, IsAuth extends boolean = false, OutputNullable extends boolean = false, InputNullable extends boolean = false> {
|
|
20
29
|
output: T;
|
|
21
30
|
outputOptions?: NullableOptions<ReturnOptions, OutputNullable>;
|
|
@@ -23,26 +32,234 @@ interface BaseDefinition<T, U, IsAuth extends boolean = false, OutputNullable ex
|
|
|
23
32
|
inputOptions?: NullableOptions<ArgsOptions, InputNullable>;
|
|
24
33
|
authorized?: IsAuth;
|
|
25
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Full query/mutation definition returned by {@link query}. Contains the resolver function,
|
|
37
|
+
* plus `.call()` and `.authCall()` for direct server-side invocation.
|
|
38
|
+
*
|
|
39
|
+
* @category GraphQL
|
|
40
|
+
*/
|
|
26
41
|
interface QueryDefinition<T, U, IsAuth extends boolean = false, OutputNullable extends boolean = false, InputNullable extends boolean = false, R extends Promisify<ParsedGQLTypeWithNullability<T, OutputNullable, true>> = Promisify<ParsedGQLTypeWithNullability<T, OutputNullable, true>>> extends BaseDefinition<T, U, IsAuth, OutputNullable, InputNullable> {
|
|
27
42
|
fn: (ctx: IsAuth extends true ? AuthorizedContext : Context, data: ParsedGQLTypeWithNullability<U, InputNullable, false>) => R;
|
|
43
|
+
/** Calls the resolver server-side. For authorized queries, reads the refresh cookie; for non-authorized, passes null userId. */
|
|
28
44
|
call: (data: ParsedGQLTypeWithNullability<U, InputNullable, false>) => Promise<Awaited<R>>;
|
|
45
|
+
/** Calls the resolver server-side with authentication (always reads the refresh cookie). Use in Server Components. */
|
|
29
46
|
authCall: (data: ParsedGQLTypeWithNullability<U, InputNullable, false>) => Promise<Awaited<R>>;
|
|
30
47
|
mutation?: boolean;
|
|
31
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Defines a type-graphql query or mutation with typed input/output and optional auth.
|
|
51
|
+
* Use with {@link QueryLibrary} to build resolver classes for `initGraphQLServer`.
|
|
52
|
+
*
|
|
53
|
+
* Each query definition gets `.call(data)` and `.authCall(data)` methods for direct server-side invocation
|
|
54
|
+
* (e.g. in Server Components or other resolvers). Both are cached via React's `cache()`.
|
|
55
|
+
*
|
|
56
|
+
* @param fn - Resolver function: `(ctx, data) => result`.
|
|
57
|
+
* - `ctx` is `Context` (or `AuthorizedContext` when `authorized: true`) with `userId`.
|
|
58
|
+
* - `data` is the typed GraphQL input (or `void` if no input).
|
|
59
|
+
* @param options - Configuration for the query/mutation.
|
|
60
|
+
* @param options.output - The GraphQL return type (type-graphql `@ObjectType` class, `String`, `Boolean`, `Number`, etc.).
|
|
61
|
+
* @param options.input - Optional GraphQL input type (`@InputType` class or scalar) for the `input` argument.
|
|
62
|
+
* @param options.outputOptions - Optional. Set `{ nullable: true }` to allow null returns.
|
|
63
|
+
* @param options.inputOptions - Optional. Set `{ nullable: true }` to allow null input.
|
|
64
|
+
* @param options.authorized - If `true`, the resolver requires an authenticated user. `ctx` is typed as `AuthorizedContext` (non-null `userId`).
|
|
65
|
+
* @param options.mutation - If `true`, registers as a `@Mutation`; otherwise registers as a `@Query`.
|
|
66
|
+
* @returns A `QueryDefinition` with `.call(data)` and `.authCall(data)` for server-side invocation.
|
|
67
|
+
*
|
|
68
|
+
* @example Simple query (no input, nullable output):
|
|
69
|
+
* ```ts
|
|
70
|
+
* import { query } from "naystack/graphql";
|
|
71
|
+
*
|
|
72
|
+
* export default query(
|
|
73
|
+
* async (ctx) => {
|
|
74
|
+
* if (!ctx.userId) return null;
|
|
75
|
+
* const [user] = await db.select().from(UserTable).where(eq(UserTable.id, ctx.userId));
|
|
76
|
+
* return user || null;
|
|
77
|
+
* },
|
|
78
|
+
* { output: User, outputOptions: { nullable: true } },
|
|
79
|
+
* );
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* @example Mutation with input and authorization:
|
|
83
|
+
* ```ts
|
|
84
|
+
* export default query(
|
|
85
|
+
* async (ctx, input: SubmitFeedbackInput) => {
|
|
86
|
+
* await db.insert(FeedbackTable).values({ userId: ctx.userId, score: input.score, text: input.text });
|
|
87
|
+
* return true;
|
|
88
|
+
* },
|
|
89
|
+
* { output: Boolean, input: SubmitFeedbackInput, authorized: true, mutation: true },
|
|
90
|
+
* );
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* @example Server-side invocation in a Server Component:
|
|
94
|
+
* ```ts
|
|
95
|
+
* const user = await getCurrentUser.authCall(); // Reads refresh cookie for auth
|
|
96
|
+
* const planets = await getPlanets.call(); // No auth needed
|
|
97
|
+
* ```
|
|
98
|
+
*
|
|
99
|
+
* @category GraphQL
|
|
100
|
+
*/
|
|
32
101
|
declare function query<T, U, IsAuth extends boolean = false, OutputNullable extends boolean = false, InputNullable extends boolean = false, R extends Promisify<ParsedGQLTypeWithNullability<T, OutputNullable, true>> = Promisify<ParsedGQLTypeWithNullability<T, OutputNullable, true>>>(fn: (ctx: IsAuth extends true ? AuthorizedContext : Context, data: ParsedGQLTypeWithNullability<U, InputNullable, false>) => R, options: Omit<QueryDefinition<T, U, IsAuth, OutputNullable, InputNullable, R>, "fn" | "authCall" | "call">): QueryDefinition<T, U, IsAuth, OutputNullable, InputNullable, R>;
|
|
102
|
+
/**
|
|
103
|
+
* Full field resolver definition returned by {@link field}. Contains the resolver function,
|
|
104
|
+
* plus `.call()` and `.authCall()` for direct server-side invocation.
|
|
105
|
+
*
|
|
106
|
+
* @category GraphQL
|
|
107
|
+
*/
|
|
33
108
|
interface FieldResolverDefinition<T, U, Root, IsAuth extends boolean = false, OutputNullable extends boolean = false, InputNullable extends boolean = false, R extends Promisify<ParsedGQLTypeWithNullability<T, OutputNullable, true>> = Promisify<ParsedGQLTypeWithNullability<T, OutputNullable, true>>> extends BaseDefinition<T, U, IsAuth, OutputNullable, InputNullable> {
|
|
34
109
|
fn: (root: Root, ctx: IsAuth extends true ? AuthorizedContext : Context, data: ParsedGQLTypeWithNullability<U, InputNullable, false>) => R;
|
|
110
|
+
/** Calls the field resolver server-side. For authorized fields, reads the refresh cookie. */
|
|
35
111
|
call: (root: Root, data: ParsedGQLTypeWithNullability<U, InputNullable, false>) => Promise<Awaited<R>>;
|
|
112
|
+
/** Calls the field resolver server-side with authentication (always reads the refresh cookie). */
|
|
36
113
|
authCall: (root: Root, data: ParsedGQLTypeWithNullability<U, InputNullable, false>) => Promise<Awaited<R>>;
|
|
37
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Defines a type-graphql field resolver with typed root, context, and input.
|
|
117
|
+
* Use with {@link FieldLibrary} to attach computed fields to a parent GraphQL type.
|
|
118
|
+
*
|
|
119
|
+
* Like `query()`, each field definition gets `.call(root, data)` and `.authCall(root, data)` for server-side invocation.
|
|
120
|
+
*
|
|
121
|
+
* @param fn - Resolver function: `(root, ctx, data) => result`.
|
|
122
|
+
* - `root` is the parent object (e.g. the `User` row from the database).
|
|
123
|
+
* - `ctx` is `Context` (or `AuthorizedContext` when `authorized: true`).
|
|
124
|
+
* - `data` is the optional typed input argument.
|
|
125
|
+
* @param options - Configuration (same as `query()` but without `mutation`).
|
|
126
|
+
* @returns A `FieldResolverDefinition` with `.call` and `.authCall` for server-side invocation.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```ts
|
|
130
|
+
* import { field } from "naystack/graphql";
|
|
131
|
+
*
|
|
132
|
+
* // Resolve the "seller" field on a Property type
|
|
133
|
+
* const seller = field(
|
|
134
|
+
* async (property: PropertyDB) => {
|
|
135
|
+
* if (!property.sellerId) return null;
|
|
136
|
+
* const [seller] = await db.select().from(ContactTable).where(eq(ContactTable.id, property.sellerId));
|
|
137
|
+
* return seller || null;
|
|
138
|
+
* },
|
|
139
|
+
* { output: ContactGQL, outputOptions: { nullable: true } },
|
|
140
|
+
* );
|
|
141
|
+
* ```
|
|
142
|
+
*
|
|
143
|
+
* @example Inline in a FieldLibrary:
|
|
144
|
+
* ```ts
|
|
145
|
+
* const OrgFields = FieldLibrary<OrgDB>(OrgGQL, {
|
|
146
|
+
* access: field(
|
|
147
|
+
* async (root, ctx) => {
|
|
148
|
+
* if (!ctx.userId) return null;
|
|
149
|
+
* return checkOrgAccess(ctx.userId, root.id);
|
|
150
|
+
* },
|
|
151
|
+
* { output: AccessRole, outputOptions: { nullable: true } },
|
|
152
|
+
* ),
|
|
153
|
+
* });
|
|
154
|
+
* ```
|
|
155
|
+
*
|
|
156
|
+
* @category GraphQL
|
|
157
|
+
*/
|
|
38
158
|
declare function field<T, U, IsAuth extends boolean, Root, OutputNullable extends boolean = false, InputNullable extends boolean = false, R extends Promisify<ParsedGQLTypeWithNullability<T, OutputNullable, true>> = Promisify<ParsedGQLTypeWithNullability<T, OutputNullable, true>>>(fn: (root: Root, ctx: IsAuth extends true ? AuthorizedContext : Context, data: ParsedGQLTypeWithNullability<U, InputNullable, false>) => R, options: Omit<FieldResolverDefinition<T, U, Root, IsAuth, OutputNullable, InputNullable, R>, "fn" | "authCall" | "call">): FieldResolverDefinition<T, U, Root, IsAuth, OutputNullable, InputNullable, R>;
|
|
159
|
+
/**
|
|
160
|
+
* Builds a type-graphql `@Resolver` class from a map of query/mutation definitions created with {@link query}.
|
|
161
|
+
* Each key in the `queries` object becomes a Query or Mutation field on the GraphQL schema.
|
|
162
|
+
*
|
|
163
|
+
* Pass the returned class in the `resolvers` array of `initGraphQLServer`.
|
|
164
|
+
*
|
|
165
|
+
* @param queries - Object mapping GraphQL field names to `QueryDefinition`s (from `query()`).
|
|
166
|
+
* Each key becomes the field name in the schema. Mutations are determined by `{ mutation: true }` in the definition.
|
|
167
|
+
* @returns A `@Resolver` class suitable for `initGraphQLServer`.
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* ```ts
|
|
171
|
+
* import { QueryLibrary, query } from "naystack/graphql";
|
|
172
|
+
* import getCurrentUser from "./resolvers/get-current-user";
|
|
173
|
+
* import updateUser from "./resolvers/update-user";
|
|
174
|
+
* import onboardUser from "./resolvers/onboard-user";
|
|
175
|
+
*
|
|
176
|
+
* export const UserResolvers = QueryLibrary({
|
|
177
|
+
* getCurrentUser, // becomes Query.getCurrentUser
|
|
178
|
+
* updateUser, // becomes Mutation.updateUser (if mutation: true)
|
|
179
|
+
* onboardUser, // becomes Mutation.onboardUser (if mutation: true)
|
|
180
|
+
* });
|
|
181
|
+
* ```
|
|
182
|
+
*
|
|
183
|
+
* @category GraphQL
|
|
184
|
+
*/
|
|
39
185
|
declare function QueryLibrary<T extends Record<string, QueryDefinition<any, any, any, any, any, any>>>(queries: T): {
|
|
40
186
|
new (): {};
|
|
41
187
|
};
|
|
188
|
+
/**
|
|
189
|
+
* Builds a type-graphql `@Resolver(() => type)` class that resolves computed fields on a parent GraphQL type.
|
|
190
|
+
* Each key in the `queries` object becomes a `@FieldResolver` on that type.
|
|
191
|
+
*
|
|
192
|
+
* Pass the returned class in the `resolvers` array of `initGraphQLServer`.
|
|
193
|
+
*
|
|
194
|
+
* @typeParam X - The database/plain type of the parent object (e.g. `UserDB`).
|
|
195
|
+
* @param type - The parent GraphQL type class (e.g. `User`). Must be a `@ObjectType` class.
|
|
196
|
+
* @param queries - Object mapping field names to `FieldResolverDefinition`s (from `field()`).
|
|
197
|
+
* @returns A `@Resolver` class for the given type; pass it in `initGraphQLServer`'s resolvers array.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* ```ts
|
|
201
|
+
* import { FieldLibrary, field } from "naystack/graphql";
|
|
202
|
+
* import { User } from "./types";
|
|
203
|
+
* import type { UserDB } from "./db";
|
|
204
|
+
* import organizations from "./resolvers/organizations-field";
|
|
205
|
+
*
|
|
206
|
+
* export const UserFieldResolvers = FieldLibrary<UserDB>(User, {
|
|
207
|
+
* organizations, // Resolves User.organizations from the UserDB row
|
|
208
|
+
* });
|
|
209
|
+
* ```
|
|
210
|
+
*
|
|
211
|
+
* @example With inline field definitions:
|
|
212
|
+
* ```ts
|
|
213
|
+
* export const OrgFieldResolvers = FieldLibrary<OrgDB>(OrgGQL, {
|
|
214
|
+
* access: field(
|
|
215
|
+
* async (root, ctx) => checkOrgAccess(ctx.userId, root.id),
|
|
216
|
+
* { output: AccessRole, outputOptions: { nullable: true } },
|
|
217
|
+
* ),
|
|
218
|
+
* });
|
|
219
|
+
* ```
|
|
220
|
+
*
|
|
221
|
+
* @category GraphQL
|
|
222
|
+
*/
|
|
42
223
|
declare function FieldLibrary<X extends object, T extends Record<string, FieldResolverDefinition<any, any, X, any, any, any, any>> = Record<string, FieldResolverDefinition<any, any, X, any, any, any, any>>>(type: ClassType, queries: T): {
|
|
43
224
|
new (): {};
|
|
44
225
|
};
|
|
226
|
+
/**
|
|
227
|
+
* Infers the TypeScript return type of a query definition's `.call()` method.
|
|
228
|
+
* Use this to type component props that receive query results, ensuring full type safety.
|
|
229
|
+
*
|
|
230
|
+
* @typeParam T - A `QueryDefinition` (the default export from a resolver file created with `query()`).
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* ```ts
|
|
234
|
+
* import type { QueryResponseType } from "naystack/graphql";
|
|
235
|
+
* import type getCurrentUser from "@/app/api/(graphql)/User/resolvers/get-current-user";
|
|
236
|
+
* import type getDeal from "@/app/api/(graphql)/Deal/queries/get-deal";
|
|
237
|
+
*
|
|
238
|
+
* interface Props {
|
|
239
|
+
* user: QueryResponseType<typeof getCurrentUser>;
|
|
240
|
+
* deal: QueryResponseType<typeof getDeal>;
|
|
241
|
+
* }
|
|
242
|
+
* ```
|
|
243
|
+
*
|
|
244
|
+
* @category GraphQL
|
|
245
|
+
*/
|
|
45
246
|
type QueryResponseType<T extends QueryDefinition<any, any, any, any, any, any>> = Awaited<ReturnType<T["call"]>>;
|
|
247
|
+
/**
|
|
248
|
+
* Infers the TypeScript return type of a field resolver definition's `.call()` method.
|
|
249
|
+
* Use this to type the resolved field value.
|
|
250
|
+
*
|
|
251
|
+
* @typeParam T - A `FieldResolverDefinition` (from `field()`).
|
|
252
|
+
*
|
|
253
|
+
* @example
|
|
254
|
+
* ```ts
|
|
255
|
+
* import type { FieldResponseType } from "naystack/graphql";
|
|
256
|
+
* import type organizationsField from "./resolvers/organizations-field";
|
|
257
|
+
*
|
|
258
|
+
* type Orgs = FieldResponseType<typeof organizationsField>;
|
|
259
|
+
* ```
|
|
260
|
+
*
|
|
261
|
+
* @category GraphQL
|
|
262
|
+
*/
|
|
46
263
|
type FieldResponseType<T extends FieldResolverDefinition<any, any, any, any, any, any, any>> = Awaited<ReturnType<T["call"]>>;
|
|
47
264
|
|
|
48
265
|
export { FieldLibrary, type FieldResponseType, QueryLibrary, type QueryResponseType, field, query };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Naystack — a minimal, powerful stack for Next.js app development.
|
|
3
|
+
*
|
|
4
|
+
* Use subpath imports for the specific module you need:
|
|
5
|
+
* - `naystack/auth` — Email/Google/Instagram authentication
|
|
6
|
+
* - `naystack/auth/email/client` — Client-side auth hooks (useLogin, useSignUp, etc.)
|
|
7
|
+
* - `naystack/graphql` — GraphQL server: query, field, QueryLibrary, FieldLibrary, initGraphQLServer
|
|
8
|
+
* - `naystack/graphql/client` — Client-side GraphQL hooks (useAuthQuery, useAuthMutation, ApolloWrapper)
|
|
9
|
+
* - `naystack/graphql/server` — Server-side GraphQL utilities (Injector, query)
|
|
10
|
+
* - `naystack/file` — S3 file upload setup
|
|
11
|
+
* - `naystack/file/client` — Client-side file upload hook (useFileUpload)
|
|
12
|
+
* - `naystack/client` — Client hooks (useVisibility, useBreakpoint) and SEO (setupSEO)
|
|
13
|
+
* - `naystack/socials` — Instagram and Threads API helpers
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
1
17
|
declare const hello = "world";
|
|
2
18
|
|
|
3
19
|
export { hello };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Naystack — a minimal, powerful stack for Next.js app development.
|
|
3
|
+
*
|
|
4
|
+
* Use subpath imports for the specific module you need:
|
|
5
|
+
* - `naystack/auth` — Email/Google/Instagram authentication
|
|
6
|
+
* - `naystack/auth/email/client` — Client-side auth hooks (useLogin, useSignUp, etc.)
|
|
7
|
+
* - `naystack/graphql` — GraphQL server: query, field, QueryLibrary, FieldLibrary, initGraphQLServer
|
|
8
|
+
* - `naystack/graphql/client` — Client-side GraphQL hooks (useAuthQuery, useAuthMutation, ApolloWrapper)
|
|
9
|
+
* - `naystack/graphql/server` — Server-side GraphQL utilities (Injector, query)
|
|
10
|
+
* - `naystack/file` — S3 file upload setup
|
|
11
|
+
* - `naystack/file/client` — Client-side file upload hook (useFileUpload)
|
|
12
|
+
* - `naystack/client` — Client hooks (useVisibility, useBreakpoint) and SEO (setupSEO)
|
|
13
|
+
* - `naystack/socials` — Instagram and Threads API helpers
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
1
17
|
declare const hello = "world";
|
|
2
18
|
|
|
3
19
|
export { hello };
|
|
@@ -1,9 +1,71 @@
|
|
|
1
1
|
import { InstagramConversation, InstagramError, InstagramMedia, InstagramMessage, InstagramUser } from './types.mjs';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Fetches an Instagram user's profile. Defaults to the authenticated user (`"me"`).
|
|
5
|
+
*
|
|
6
|
+
* @param token - Instagram access token.
|
|
7
|
+
* @param id - User id to fetch. Defaults to `"me"` (the token owner).
|
|
8
|
+
* @param fields - Optional array of field names to request. Default: `["username", "followers_count", "media_count"]`.
|
|
9
|
+
* @returns Promise of user data (typed as `T`, defaults to {@link InstagramUser}).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { getInstagramUser } from "naystack/socials";
|
|
14
|
+
*
|
|
15
|
+
* const user = await getInstagramUser(accessToken);
|
|
16
|
+
* console.log(user?.username, user?.followers_count);
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @category Socials
|
|
20
|
+
*/
|
|
3
21
|
declare const getInstagramUser: <T = InstagramUser>(token: string, id?: string, fields?: string[]) => Promise<(T & InstagramError) | null>;
|
|
22
|
+
/**
|
|
23
|
+
* Fetches the authenticated user's recent Instagram media.
|
|
24
|
+
*
|
|
25
|
+
* @param token - Instagram access token.
|
|
26
|
+
* @param fields - Optional array of field names. Default: `["like_count", "comments_count", "permalink"]`.
|
|
27
|
+
* @param limit - Maximum number of items to return. Default: `12`.
|
|
28
|
+
* @returns Promise of `{ data: T[] }` where T defaults to {@link InstagramMedia}.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* import { getInstagramMedia } from "naystack/socials";
|
|
33
|
+
*
|
|
34
|
+
* const media = await getInstagramMedia(accessToken, undefined, 10);
|
|
35
|
+
* for (const item of media?.data ?? []) {
|
|
36
|
+
* console.log(item.permalink, item.like_count);
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @category Socials
|
|
41
|
+
*/
|
|
4
42
|
declare const getInstagramMedia: <T = InstagramMedia>(token: string, fields?: string[], limit?: number) => Promise<({
|
|
5
43
|
data: T[];
|
|
6
44
|
} & InstagramError) | null>;
|
|
45
|
+
/**
|
|
46
|
+
* Fetches Instagram conversations (DM threads) with pagination support.
|
|
47
|
+
*
|
|
48
|
+
* @param token - Instagram access token.
|
|
49
|
+
* @param limit - Page size. Default: `25`.
|
|
50
|
+
* @param cursor - Optional pagination cursor (from a previous `fetchMore`).
|
|
51
|
+
* @returns Promise of `{ data: InstagramConversation[], fetchMore?: () => Promise<...> }`.
|
|
52
|
+
* Call `fetchMore()` to load the next page.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* import { getInstagramConversations } from "naystack/socials";
|
|
57
|
+
*
|
|
58
|
+
* const convos = await getInstagramConversations(accessToken, 25);
|
|
59
|
+
* for (const convo of convos.data ?? []) {
|
|
60
|
+
* console.log(convo.participants, convo.messages);
|
|
61
|
+
* }
|
|
62
|
+
* if (convos.fetchMore) {
|
|
63
|
+
* const nextPage = await convos.fetchMore();
|
|
64
|
+
* }
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @category Socials
|
|
68
|
+
*/
|
|
7
69
|
declare const getInstagramConversations: (token: string, limit?: number, cursor?: string) => Promise<{
|
|
8
70
|
data: {
|
|
9
71
|
messages: {
|
|
@@ -19,10 +81,53 @@ declare const getInstagramConversations: (token: string, limit?: number, cursor?
|
|
|
19
81
|
}[] | undefined;
|
|
20
82
|
fetchMore: (() => Promise</*elided*/ any>) | undefined;
|
|
21
83
|
}>;
|
|
84
|
+
/**
|
|
85
|
+
* Fetches conversations filtered by a specific Instagram user id.
|
|
86
|
+
*
|
|
87
|
+
* @param token - Instagram access token.
|
|
88
|
+
* @param userID - The Instagram user id to filter conversations by.
|
|
89
|
+
* @returns Promise of `{ data: InstagramConversation[] }`.
|
|
90
|
+
*
|
|
91
|
+
* @category Socials
|
|
92
|
+
*/
|
|
22
93
|
declare const getInstagramConversationsByUser: (token: string, userID: string) => Promise<({
|
|
23
94
|
data: InstagramConversation[];
|
|
24
95
|
} & InstagramError) | null>;
|
|
96
|
+
/**
|
|
97
|
+
* Fetches the single conversation between the authenticated user and the given user.
|
|
98
|
+
* Filters for conversations with exactly 2 participants.
|
|
99
|
+
*
|
|
100
|
+
* @param token - Instagram access token.
|
|
101
|
+
* @param userID - The other participant's Instagram user id.
|
|
102
|
+
* @returns Promise of a single `InstagramConversation` or `undefined` if not found.
|
|
103
|
+
*
|
|
104
|
+
* @category Socials
|
|
105
|
+
*/
|
|
25
106
|
declare const getInstagramConversationByUser: (token: string, userID: string) => Promise<InstagramConversation | undefined>;
|
|
107
|
+
/**
|
|
108
|
+
* Fetches a single Instagram conversation by id with messages and participants.
|
|
109
|
+
* Supports pagination for messages via `fetchMore`.
|
|
110
|
+
*
|
|
111
|
+
* @param token - Instagram access token.
|
|
112
|
+
* @param id - Conversation id.
|
|
113
|
+
* @param cursor - Optional pagination cursor for messages.
|
|
114
|
+
* @returns Promise of `{ messages, participants, fetchMore? }`.
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```ts
|
|
118
|
+
* import { getInstagramConversation } from "naystack/socials";
|
|
119
|
+
*
|
|
120
|
+
* const convo = await getInstagramConversation(accessToken, conversationId);
|
|
121
|
+
* for (const msg of convo.messages ?? []) {
|
|
122
|
+
* console.log(msg.id, msg.created_time);
|
|
123
|
+
* }
|
|
124
|
+
* if (convo.fetchMore) {
|
|
125
|
+
* const older = await convo.fetchMore();
|
|
126
|
+
* }
|
|
127
|
+
* ```
|
|
128
|
+
*
|
|
129
|
+
* @category Socials
|
|
130
|
+
*/
|
|
26
131
|
declare const getInstagramConversation: (token: string, id: string, cursor?: string) => Promise<{
|
|
27
132
|
messages: {
|
|
28
133
|
id: string;
|
|
@@ -34,6 +139,16 @@ declare const getInstagramConversation: (token: string, id: string, cursor?: str
|
|
|
34
139
|
}[] | undefined;
|
|
35
140
|
fetchMore: (() => Promise</*elided*/ any>) | undefined;
|
|
36
141
|
}>;
|
|
142
|
+
/**
|
|
143
|
+
* Fetches a single Instagram message by id.
|
|
144
|
+
*
|
|
145
|
+
* @param token - Instagram access token.
|
|
146
|
+
* @param id - Message id.
|
|
147
|
+
* @param fields - Optional array of field names. Default: `["id", "created_time", "from", "to", "message"]`.
|
|
148
|
+
* @returns Promise of message data (typed as `T`, defaults to {@link InstagramMessage}).
|
|
149
|
+
*
|
|
150
|
+
* @category Socials
|
|
151
|
+
*/
|
|
37
152
|
declare const getInstagramMessage: <T = InstagramMessage>(token: string, id: string, fields?: string[]) => Promise<(T & InstagramError) | null>;
|
|
38
153
|
|
|
39
154
|
export { getInstagramConversation, getInstagramConversationByUser, getInstagramConversations, getInstagramConversationsByUser, getInstagramMedia, getInstagramMessage, getInstagramUser };
|
|
@@ -1,9 +1,71 @@
|
|
|
1
1
|
import { InstagramConversation, InstagramError, InstagramMedia, InstagramMessage, InstagramUser } from './types.js';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Fetches an Instagram user's profile. Defaults to the authenticated user (`"me"`).
|
|
5
|
+
*
|
|
6
|
+
* @param token - Instagram access token.
|
|
7
|
+
* @param id - User id to fetch. Defaults to `"me"` (the token owner).
|
|
8
|
+
* @param fields - Optional array of field names to request. Default: `["username", "followers_count", "media_count"]`.
|
|
9
|
+
* @returns Promise of user data (typed as `T`, defaults to {@link InstagramUser}).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { getInstagramUser } from "naystack/socials";
|
|
14
|
+
*
|
|
15
|
+
* const user = await getInstagramUser(accessToken);
|
|
16
|
+
* console.log(user?.username, user?.followers_count);
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @category Socials
|
|
20
|
+
*/
|
|
3
21
|
declare const getInstagramUser: <T = InstagramUser>(token: string, id?: string, fields?: string[]) => Promise<(T & InstagramError) | null>;
|
|
22
|
+
/**
|
|
23
|
+
* Fetches the authenticated user's recent Instagram media.
|
|
24
|
+
*
|
|
25
|
+
* @param token - Instagram access token.
|
|
26
|
+
* @param fields - Optional array of field names. Default: `["like_count", "comments_count", "permalink"]`.
|
|
27
|
+
* @param limit - Maximum number of items to return. Default: `12`.
|
|
28
|
+
* @returns Promise of `{ data: T[] }` where T defaults to {@link InstagramMedia}.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* import { getInstagramMedia } from "naystack/socials";
|
|
33
|
+
*
|
|
34
|
+
* const media = await getInstagramMedia(accessToken, undefined, 10);
|
|
35
|
+
* for (const item of media?.data ?? []) {
|
|
36
|
+
* console.log(item.permalink, item.like_count);
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @category Socials
|
|
41
|
+
*/
|
|
4
42
|
declare const getInstagramMedia: <T = InstagramMedia>(token: string, fields?: string[], limit?: number) => Promise<({
|
|
5
43
|
data: T[];
|
|
6
44
|
} & InstagramError) | null>;
|
|
45
|
+
/**
|
|
46
|
+
* Fetches Instagram conversations (DM threads) with pagination support.
|
|
47
|
+
*
|
|
48
|
+
* @param token - Instagram access token.
|
|
49
|
+
* @param limit - Page size. Default: `25`.
|
|
50
|
+
* @param cursor - Optional pagination cursor (from a previous `fetchMore`).
|
|
51
|
+
* @returns Promise of `{ data: InstagramConversation[], fetchMore?: () => Promise<...> }`.
|
|
52
|
+
* Call `fetchMore()` to load the next page.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* import { getInstagramConversations } from "naystack/socials";
|
|
57
|
+
*
|
|
58
|
+
* const convos = await getInstagramConversations(accessToken, 25);
|
|
59
|
+
* for (const convo of convos.data ?? []) {
|
|
60
|
+
* console.log(convo.participants, convo.messages);
|
|
61
|
+
* }
|
|
62
|
+
* if (convos.fetchMore) {
|
|
63
|
+
* const nextPage = await convos.fetchMore();
|
|
64
|
+
* }
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @category Socials
|
|
68
|
+
*/
|
|
7
69
|
declare const getInstagramConversations: (token: string, limit?: number, cursor?: string) => Promise<{
|
|
8
70
|
data: {
|
|
9
71
|
messages: {
|
|
@@ -19,10 +81,53 @@ declare const getInstagramConversations: (token: string, limit?: number, cursor?
|
|
|
19
81
|
}[] | undefined;
|
|
20
82
|
fetchMore: (() => Promise</*elided*/ any>) | undefined;
|
|
21
83
|
}>;
|
|
84
|
+
/**
|
|
85
|
+
* Fetches conversations filtered by a specific Instagram user id.
|
|
86
|
+
*
|
|
87
|
+
* @param token - Instagram access token.
|
|
88
|
+
* @param userID - The Instagram user id to filter conversations by.
|
|
89
|
+
* @returns Promise of `{ data: InstagramConversation[] }`.
|
|
90
|
+
*
|
|
91
|
+
* @category Socials
|
|
92
|
+
*/
|
|
22
93
|
declare const getInstagramConversationsByUser: (token: string, userID: string) => Promise<({
|
|
23
94
|
data: InstagramConversation[];
|
|
24
95
|
} & InstagramError) | null>;
|
|
96
|
+
/**
|
|
97
|
+
* Fetches the single conversation between the authenticated user and the given user.
|
|
98
|
+
* Filters for conversations with exactly 2 participants.
|
|
99
|
+
*
|
|
100
|
+
* @param token - Instagram access token.
|
|
101
|
+
* @param userID - The other participant's Instagram user id.
|
|
102
|
+
* @returns Promise of a single `InstagramConversation` or `undefined` if not found.
|
|
103
|
+
*
|
|
104
|
+
* @category Socials
|
|
105
|
+
*/
|
|
25
106
|
declare const getInstagramConversationByUser: (token: string, userID: string) => Promise<InstagramConversation | undefined>;
|
|
107
|
+
/**
|
|
108
|
+
* Fetches a single Instagram conversation by id with messages and participants.
|
|
109
|
+
* Supports pagination for messages via `fetchMore`.
|
|
110
|
+
*
|
|
111
|
+
* @param token - Instagram access token.
|
|
112
|
+
* @param id - Conversation id.
|
|
113
|
+
* @param cursor - Optional pagination cursor for messages.
|
|
114
|
+
* @returns Promise of `{ messages, participants, fetchMore? }`.
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```ts
|
|
118
|
+
* import { getInstagramConversation } from "naystack/socials";
|
|
119
|
+
*
|
|
120
|
+
* const convo = await getInstagramConversation(accessToken, conversationId);
|
|
121
|
+
* for (const msg of convo.messages ?? []) {
|
|
122
|
+
* console.log(msg.id, msg.created_time);
|
|
123
|
+
* }
|
|
124
|
+
* if (convo.fetchMore) {
|
|
125
|
+
* const older = await convo.fetchMore();
|
|
126
|
+
* }
|
|
127
|
+
* ```
|
|
128
|
+
*
|
|
129
|
+
* @category Socials
|
|
130
|
+
*/
|
|
26
131
|
declare const getInstagramConversation: (token: string, id: string, cursor?: string) => Promise<{
|
|
27
132
|
messages: {
|
|
28
133
|
id: string;
|
|
@@ -34,6 +139,16 @@ declare const getInstagramConversation: (token: string, id: string, cursor?: str
|
|
|
34
139
|
}[] | undefined;
|
|
35
140
|
fetchMore: (() => Promise</*elided*/ any>) | undefined;
|
|
36
141
|
}>;
|
|
142
|
+
/**
|
|
143
|
+
* Fetches a single Instagram message by id.
|
|
144
|
+
*
|
|
145
|
+
* @param token - Instagram access token.
|
|
146
|
+
* @param id - Message id.
|
|
147
|
+
* @param fields - Optional array of field names. Default: `["id", "created_time", "from", "to", "message"]`.
|
|
148
|
+
* @returns Promise of message data (typed as `T`, defaults to {@link InstagramMessage}).
|
|
149
|
+
*
|
|
150
|
+
* @category Socials
|
|
151
|
+
*/
|
|
37
152
|
declare const getInstagramMessage: <T = InstagramMessage>(token: string, id: string, fields?: string[]) => Promise<(T & InstagramError) | null>;
|
|
38
153
|
|
|
39
154
|
export { getInstagramConversation, getInstagramConversationByUser, getInstagramConversations, getInstagramConversationsByUser, getInstagramMedia, getInstagramMessage, getInstagramUser };
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import { InstagramError } from './types.mjs';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Sends a text message to an Instagram user via the Instagram Messaging API.
|
|
5
|
+
*
|
|
6
|
+
* @param token - Instagram access token.
|
|
7
|
+
* @param to - Recipient's Instagram user id.
|
|
8
|
+
* @param text - Message text to send.
|
|
9
|
+
* @returns Promise of `{ recipient_id, message_id }` on success.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { sendInstagramMessage } from "naystack/socials";
|
|
14
|
+
*
|
|
15
|
+
* const result = await sendInstagramMessage(accessToken, recipientId, "Hello!");
|
|
16
|
+
* console.log("Sent message:", result?.message_id);
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @category Socials
|
|
20
|
+
*/
|
|
3
21
|
declare const sendInstagramMessage: (token: string, to: string, text: string) => Promise<({
|
|
4
22
|
recipient_id?: string;
|
|
5
23
|
message_id?: string;
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import { InstagramError } from './types.js';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Sends a text message to an Instagram user via the Instagram Messaging API.
|
|
5
|
+
*
|
|
6
|
+
* @param token - Instagram access token.
|
|
7
|
+
* @param to - Recipient's Instagram user id.
|
|
8
|
+
* @param text - Message text to send.
|
|
9
|
+
* @returns Promise of `{ recipient_id, message_id }` on success.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { sendInstagramMessage } from "naystack/socials";
|
|
14
|
+
*
|
|
15
|
+
* const result = await sendInstagramMessage(accessToken, recipientId, "Hello!");
|
|
16
|
+
* console.log("Sent message:", result?.message_id);
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @category Socials
|
|
20
|
+
*/
|
|
3
21
|
declare const sendInstagramMessage: (token: string, to: string, text: string) => Promise<({
|
|
4
22
|
recipient_id?: string;
|
|
5
23
|
message_id?: string;
|