@adspireai/adspire-node-sdk 1.0.10 → 1.0.12

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/dist/sdk.gen.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';
2
- import type { RegisterUserData, RegisterUserResponses, RegisterUserErrors, LoginUserData, LoginUserResponses, LoginUserErrors, GetMeData, GetMeResponses, GetMeErrors, LogoutUserData, LogoutUserResponses, LogoutUserErrors, RefreshTokenData, RefreshTokenResponses, RefreshTokenErrors } from './types.gen';
2
+ import type { RegisterUserData, RegisterUserResponses, RegisterUserErrors, LoginUserData, LoginUserResponses, LoginUserErrors, GetMeData, GetMeResponses, GetMeErrors, LogoutUserData, LogoutUserResponses, LogoutUserErrors, RefreshTokenData, RefreshTokenResponses, RefreshTokenErrors, SendResetLinkEmailData, SendResetLinkEmailResponses, SendResetLinkEmailErrors, ResetPasswordData, ResetPasswordResponses, ResetPasswordErrors } from './types.gen';
3
3
  export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
4
4
  /**
5
5
  * You can provide a client instance returned by `createClient()` instead of
@@ -38,3 +38,13 @@ export declare const logoutUser: <ThrowOnError extends boolean = false>(options?
38
38
  * Refreshes the current JWT token and returns a new one
39
39
  */
40
40
  export declare const refreshToken: <ThrowOnError extends boolean = false>(options?: Options<RefreshTokenData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<RefreshTokenResponses, RefreshTokenErrors, ThrowOnError, "fields">;
41
+ /**
42
+ * Send password reset link
43
+ * Sends a password reset link to the user's email address.
44
+ */
45
+ export declare const sendResetLinkEmail: <ThrowOnError extends boolean = false>(options: Options<SendResetLinkEmailData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<SendResetLinkEmailResponses, SendResetLinkEmailErrors, ThrowOnError, "fields">;
46
+ /**
47
+ * Reset user password
48
+ * Resets the user's password using a valid reset token.
49
+ */
50
+ export declare const resetPassword: <ThrowOnError extends boolean = false>(options: Options<ResetPasswordData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<ResetPasswordResponses, ResetPasswordErrors, ThrowOnError, "fields">;
package/dist/sdk.gen.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // This file is auto-generated by @hey-api/openapi-ts
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.refreshToken = exports.logoutUser = exports.getMe = exports.loginUser = exports.registerUser = void 0;
4
+ exports.resetPassword = exports.sendResetLinkEmail = exports.refreshToken = exports.logoutUser = exports.getMe = exports.loginUser = exports.registerUser = void 0;
5
5
  const client_gen_1 = require("./client.gen");
6
6
  /**
7
7
  * Register a new user
@@ -71,4 +71,36 @@ const refreshToken = (options) => {
71
71
  });
72
72
  };
73
73
  exports.refreshToken = refreshToken;
74
+ /**
75
+ * Send password reset link
76
+ * Sends a password reset link to the user's email address.
77
+ */
78
+ const sendResetLinkEmail = (options) => {
79
+ var _a;
80
+ return ((_a = options.client) !== null && _a !== void 0 ? _a : client_gen_1.client).post({
81
+ url: '/api/auth/password/email',
82
+ ...options,
83
+ headers: {
84
+ 'Content-Type': 'application/json',
85
+ ...options.headers
86
+ }
87
+ });
88
+ };
89
+ exports.sendResetLinkEmail = sendResetLinkEmail;
90
+ /**
91
+ * Reset user password
92
+ * Resets the user's password using a valid reset token.
93
+ */
94
+ const resetPassword = (options) => {
95
+ var _a;
96
+ return ((_a = options.client) !== null && _a !== void 0 ? _a : client_gen_1.client).post({
97
+ url: '/api/auth/password/reset',
98
+ ...options,
99
+ headers: {
100
+ 'Content-Type': 'application/json',
101
+ ...options.headers
102
+ }
103
+ });
104
+ };
105
+ exports.resetPassword = resetPassword;
74
106
  //# sourceMappingURL=sdk.gen.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.gen.js","sourceRoot":"","sources":["../src/sdk.gen.ts"],"names":[],"mappings":";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CAAC,OAAO;SACrB;KACJ,CAAC,CAAC;AACP,CAAC,CAAC;AATW,QAAA,aAAa,iBASxB"}
@@ -124,6 +124,73 @@ export type RefreshTokenResponses = {
124
124
  };
125
125
  };
126
126
  export type RefreshTokenResponse = RefreshTokenResponses[keyof RefreshTokenResponses];
127
+ export type SendResetLinkEmailData = {
128
+ body: {
129
+ /**
130
+ * The email address of the user requesting a password reset.
131
+ */
132
+ email: string;
133
+ };
134
+ path?: never;
135
+ query?: never;
136
+ url: '/api/auth/password/email';
137
+ };
138
+ export type SendResetLinkEmailErrors = {
139
+ /**
140
+ * User not found
141
+ */
142
+ 404: {
143
+ message?: string;
144
+ };
145
+ /**
146
+ * Validation error
147
+ */
148
+ 422: {
149
+ message?: string;
150
+ errors?: {
151
+ [key: string]: unknown;
152
+ };
153
+ };
154
+ };
155
+ export type SendResetLinkEmailError = SendResetLinkEmailErrors[keyof SendResetLinkEmailErrors];
156
+ export type SendResetLinkEmailResponses = {
157
+ /**
158
+ * Password reset link sent
159
+ */
160
+ 200: {
161
+ message?: string;
162
+ };
163
+ };
164
+ export type SendResetLinkEmailResponse = SendResetLinkEmailResponses[keyof SendResetLinkEmailResponses];
165
+ export type ResetPasswordData = {
166
+ body: {
167
+ email: string;
168
+ token: string;
169
+ password: string;
170
+ password_confirmation: string;
171
+ };
172
+ path?: never;
173
+ query?: never;
174
+ url: '/api/auth/password/reset';
175
+ };
176
+ export type ResetPasswordErrors = {
177
+ /**
178
+ * Validation error or invalid token
179
+ */
180
+ 422: {
181
+ error?: string;
182
+ };
183
+ };
184
+ export type ResetPasswordError = ResetPasswordErrors[keyof ResetPasswordErrors];
185
+ export type ResetPasswordResponses = {
186
+ /**
187
+ * Password has been reset
188
+ */
189
+ 200: {
190
+ message?: string;
191
+ };
192
+ };
193
+ export type ResetPasswordResponse = ResetPasswordResponses[keyof ResetPasswordResponses];
127
194
  export type ClientOptions = {
128
195
  baseUrl: 'https://stage-api.adspire.ai' | (string & {});
129
196
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adspireai/adspire-node-sdk",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "Official Node.js SDK for AdspireAI API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",