@nulvless/nulvless-js 0.1.8 → 0.2.2

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/index.d.cts CHANGED
@@ -17,7 +17,7 @@ interface NulvlessStorage {
17
17
  removeItem(key: string): Promise<void>;
18
18
  }
19
19
 
20
- type Language = 'en-US' | 'pt-BR';
20
+ type Language = 'en-US' | 'pt-BR' | 'pt-PT';
21
21
  interface Phone {
22
22
  /** Country dial code — e.g. "+55" */
23
23
  country_code: string;
@@ -669,6 +669,7 @@ interface Session {
669
669
  updated_at: string;
670
670
  expires_at: string;
671
671
  sudo_expires_at?: string | null;
672
+ oauth_client_id?: string | null;
672
673
  }
673
674
  type OAuthAppType = 'public' | 'confidential';
674
675
  type OAuthAppTokenEndpointAuthMethod = 'none' | 'client_secret_basic' | 'client_secret_post';
@@ -1951,23 +1952,27 @@ interface SendSMSParams {
1951
1952
  params?: Record<string, unknown>;
1952
1953
  }
1953
1954
  type NotificationChannel = 'email' | 'sms' | 'webhook';
1954
- type TemplateLanguage = 'en-US' | 'pt-BR';
1955
+ type TemplateLanguage = 'en-US' | 'pt-BR' | 'pt-PT';
1956
+ interface TemplateTranslation {
1957
+ language: TemplateLanguage;
1958
+ subject?: string;
1959
+ content?: string;
1960
+ last_submission?: string;
1961
+ created_at?: string;
1962
+ updated_at?: string;
1963
+ }
1955
1964
  interface Template {
1956
- id: string;
1957
- name?: string;
1958
- description?: string;
1959
1965
  slug: string;
1960
1966
  channel: NotificationChannel;
1961
- subject?: string;
1962
- content: string;
1967
+ name?: string;
1968
+ description?: string;
1963
1969
  url?: string;
1964
1970
  config?: Record<string, unknown>;
1965
- language: TemplateLanguage;
1966
- last_submission?: string;
1967
- /** `true` when this is a platform-level common template, not a custom one. */
1968
1971
  common: boolean;
1969
- created_at: string;
1970
- updated_at: string;
1972
+ customized: boolean;
1973
+ translations: TemplateTranslation[];
1974
+ created_at?: string;
1975
+ updated_at?: string;
1971
1976
  }
1972
1977
  interface CreateTemplateParams {
1973
1978
  slug: string;
@@ -1985,17 +1990,19 @@ interface CreateTemplateParams {
1985
1990
  interface UpdateTemplateParams {
1986
1991
  name?: string;
1987
1992
  description?: string;
1988
- subject?: string;
1989
- content?: string;
1990
1993
  url?: string;
1991
1994
  config?: Record<string, unknown>;
1992
1995
  }
1996
+ interface TranslationParams {
1997
+ subject?: string;
1998
+ content: string;
1999
+ }
1993
2000
  interface TemplateFilters {
1994
2001
  page?: number;
1995
2002
  page_size?: number;
1996
2003
  sort?: 'asc' | 'desc';
1997
2004
  channel?: NotificationChannel;
1998
- language?: TemplateLanguage;
2005
+ authored?: boolean;
1999
2006
  }
2000
2007
  interface PaginatedTemplates {
2001
2008
  items: Template[];
@@ -2031,32 +2038,43 @@ declare class TemplatesClient {
2031
2038
  */
2032
2039
  create(params: CreateTemplateParams, options?: RequestOptions): Promise<NulvlessResult<Template>>;
2033
2040
  /**
2034
- * Updates an existing template.
2041
+ * Updates the name, description, URL or config of a template.
2035
2042
  *
2036
- * `language` defaults to `'en-US'` when omitted.
2043
+ * @example
2044
+ * await nulvless.comms.templates.update('email', 'welcome', { name: 'Welcome' })
2045
+ */
2046
+ update(channel: NotificationChannel, slug: string, params: UpdateTemplateParams, options?: RequestOptions): Promise<NulvlessResult<Template>>;
2047
+ /**
2048
+ * Creates or replaces a template translation.
2049
+ *
2050
+ * @example
2051
+ * await nulvless.comms.templates.putTranslation('email', 'welcome', 'pt-BR', { subject: 'Olá!', content: '<h1>Olá {{name}}</h1>' })
2052
+ */
2053
+ putTranslation(channel: NotificationChannel, slug: string, language: TemplateLanguage, params: TranslationParams, options?: RequestOptions): Promise<NulvlessResult<Template>>;
2054
+ /**
2055
+ * Deletes a template translation.
2037
2056
  *
2038
2057
  * @example
2039
- * await nulvless.comms.templates.update('email', 'welcome', { subject: 'Welcome aboard!' })
2058
+ * await nulvless.comms.templates.deleteTranslation('email', 'welcome', 'pt-BR')
2040
2059
  */
2041
- update(channel: NotificationChannel, slug: string, params: UpdateTemplateParams, language?: TemplateLanguage, options?: RequestOptions): Promise<NulvlessResult<Template>>;
2060
+ deleteTranslation(channel: NotificationChannel, slug: string, language: TemplateLanguage, options?: RequestOptions): Promise<NulvlessResult<Template>>;
2042
2061
  /**
2043
- * Deletes a template.
2062
+ * Deletes a template and its translations.
2044
2063
  *
2045
- * `language` defaults to `'en-US'` when omitted.
2064
+ * @example
2065
+ * await nulvless.comms.templates.delete('email', 'welcome')
2046
2066
  */
2047
- delete(channel: NotificationChannel, slug: string, language?: TemplateLanguage, options?: RequestOptions): Promise<NulvlessResult<Template>>;
2067
+ delete(channel: NotificationChannel, slug: string, options?: RequestOptions): Promise<NulvlessResult<Template>>;
2048
2068
  /**
2049
2069
  * Returns a template by channel and slug, falling back to the common template
2050
2070
  * if no custom one exists.
2051
2071
  *
2052
- * `language` defaults to `'en-US'` when omitted.
2053
- *
2054
- * The response includes `common: true` when the returned template is the
2055
- * platform-level fallback rather than a custom override.
2072
+ * @example
2073
+ * const { data } = await nulvless.comms.templates.get('email', 'welcome')
2056
2074
  */
2057
- get(channel: NotificationChannel, slug: string, language?: TemplateLanguage, options?: RequestOptions): Promise<NulvlessResult<Template>>;
2075
+ get(channel: NotificationChannel, slug: string, options?: RequestOptions): Promise<NulvlessResult<Template>>;
2058
2076
  /**
2059
- * Returns a paginated list of templates, optionally filtered by channel and language.
2077
+ * Returns a paginated list of templates, optionally filtered by channel.
2060
2078
  *
2061
2079
  * @example
2062
2080
  * const { data } = await nulvless.comms.templates.list({ channel: 'email', page_size: 20 })
@@ -2354,4 +2372,4 @@ declare function createClient(url: string, publicKey: string, options?: ClientOp
2354
2372
  */
2355
2373
  declare function createServerClient(url: string, privateKey: string, options?: ServerClientOptions): NulvlessServerClient;
2356
2374
 
2357
- export { AUTH_CACHE_HEADERS, type AccountEntry, type AddEmailIdentityParams, type AddPhoneIdentityParams, AdminClient, type AdminCreateUserParams, type AdminUpdateUserParams, type AssuranceLevel, AuthBrowserClient, AuthClient, type AuthErrorCode, AuthEventEmitter, type AuthEvents, type AuthFactorStatus, type AuthMethod, type AuthMethods, type AuthOptions, AuthServerClient, type Authenticated, type BlockGrantParams, type Challenge, type ChallengeSubject, type ChangeChallengeParams, type ChangePasswordParams, type ClientOptions, CommsClient, type CommsErrorCode, type ConfirmationType, type CreateChallengeParams, type CreateRoleParams, type CreateTemplateParams, type EdgeFunctionErrorCode, EmailClient, type EnableFactorParams, type EnrollFactorParams, type ErrorCode, type ExchangeOAuthCodeParams, type FactorEnrollment, FactorsClient, type GatewayErrorCode, type Grant, type GrantMembers, type GrantStatus, GrantsClient, HttpClient, type Identity, type IdentityType, type Invite, type InviteParams, type Language, type LeaveGrantParams, type LookupMatch, type LookupParams, type LookupResult, type MFAMethod, type Nonce, type NotificationChannel, NulvlessClient, type NulvlessError, NulvlessException, type NulvlessResult, NulvlessServerClient, type NulvlessStorage, type OAuthApp, type OAuthAppGrantType, type OAuthAppTokenEndpointAuthMethod, type OAuthAppType, type OAuthAuthorization, type OAuthAuthorizeParams, OAuthClient, type OAuthConsentAction, type OAuthConsentResult, type OAuthDiscovery, OAuthGrantsClient, type OAuthJWKS, type OAuthPrompt, type OAuthProvider, type OAuthTokenResponse, type OAuthUserGrant, type OAuthUserInfo, type PaginateGrantsParams, type PaginateUsersParams, type Paginated, type PaginatedTemplates, type PaginationSort, type Phone, type RecoverParams, type RefreshOAuthTokenParams, type RefreshTokenParams, type RegisterOAuthAppParams, type RemoveIdentityParams, type RequestOptions, type ResetPasswordParams, type RevokeGrantParams, type RevokeSessionParams, type Role, type SdkErrorCode, SecurityClient, type SendEmailParams, type SendOTPToUpdateEmailParams, type SendOTPToUpdatePhoneParams, type SendSMSParams, type ServerClientOptions, type Session, type SessionFingerPrint, SessionManager, SessionsClient, type SetGrantParams, type SignInMethod, type SignInParams, type SignInWithOTPParams, type SignOutScope, type SignUpParams, SmsClient, Storage, type StoredSession, type SudoMethod, type Template, type TemplateFilters, type TemplateLanguage, TemplatesClient, type TokenType, type UnenrollFactorParams, type UpdateGrantParams, type UpdateIdentityParams, type UpdateOAuthAppParams, type UpdateRoleParams, type UpdateTemplateParams, type User, type UserGender, type UserProfile, UsersClient, type Verified, type VerifyChallengeParams, type VerifyParams, type VerifyReason, applyAuthCacheHeaders, createClient, createServerClient, forwardUserHeaders };
2375
+ export { AUTH_CACHE_HEADERS, type AccountEntry, type AddEmailIdentityParams, type AddPhoneIdentityParams, AdminClient, type AdminCreateUserParams, type AdminUpdateUserParams, type AssuranceLevel, AuthBrowserClient, AuthClient, type AuthErrorCode, AuthEventEmitter, type AuthEvents, type AuthFactorStatus, type AuthMethod, type AuthMethods, type AuthOptions, AuthServerClient, type Authenticated, type BlockGrantParams, type Challenge, type ChallengeSubject, type ChangeChallengeParams, type ChangePasswordParams, type ClientOptions, CommsClient, type CommsErrorCode, type ConfirmationType, type CreateChallengeParams, type CreateRoleParams, type CreateTemplateParams, type EdgeFunctionErrorCode, EmailClient, type EnableFactorParams, type EnrollFactorParams, type ErrorCode, type ExchangeOAuthCodeParams, type FactorEnrollment, FactorsClient, type GatewayErrorCode, type Grant, type GrantMembers, type GrantStatus, GrantsClient, HttpClient, type Identity, type IdentityType, type Invite, type InviteParams, type Language, type LeaveGrantParams, type LookupMatch, type LookupParams, type LookupResult, type MFAMethod, type Nonce, type NotificationChannel, NulvlessClient, type NulvlessError, NulvlessException, type NulvlessResult, NulvlessServerClient, type NulvlessStorage, type OAuthApp, type OAuthAppGrantType, type OAuthAppTokenEndpointAuthMethod, type OAuthAppType, type OAuthAuthorization, type OAuthAuthorizeParams, OAuthClient, type OAuthConsentAction, type OAuthConsentResult, type OAuthDiscovery, OAuthGrantsClient, type OAuthJWKS, type OAuthPrompt, type OAuthProvider, type OAuthTokenResponse, type OAuthUserGrant, type OAuthUserInfo, type PaginateGrantsParams, type PaginateUsersParams, type Paginated, type PaginatedTemplates, type PaginationSort, type Phone, type RecoverParams, type RefreshOAuthTokenParams, type RefreshTokenParams, type RegisterOAuthAppParams, type RemoveIdentityParams, type RequestOptions, type ResetPasswordParams, type RevokeGrantParams, type RevokeSessionParams, type Role, type SdkErrorCode, SecurityClient, type SendEmailParams, type SendOTPToUpdateEmailParams, type SendOTPToUpdatePhoneParams, type SendSMSParams, type ServerClientOptions, type Session, type SessionFingerPrint, SessionManager, SessionsClient, type SetGrantParams, type SignInMethod, type SignInParams, type SignInWithOTPParams, type SignOutScope, type SignUpParams, SmsClient, Storage, type StoredSession, type SudoMethod, type Template, type TemplateFilters, type TemplateLanguage, type TemplateTranslation, TemplatesClient, type TokenType, type TranslationParams, type UnenrollFactorParams, type UpdateGrantParams, type UpdateIdentityParams, type UpdateOAuthAppParams, type UpdateRoleParams, type UpdateTemplateParams, type User, type UserGender, type UserProfile, UsersClient, type Verified, type VerifyChallengeParams, type VerifyParams, type VerifyReason, applyAuthCacheHeaders, createClient, createServerClient, forwardUserHeaders };
package/dist/index.d.ts CHANGED
@@ -17,7 +17,7 @@ interface NulvlessStorage {
17
17
  removeItem(key: string): Promise<void>;
18
18
  }
19
19
 
20
- type Language = 'en-US' | 'pt-BR';
20
+ type Language = 'en-US' | 'pt-BR' | 'pt-PT';
21
21
  interface Phone {
22
22
  /** Country dial code — e.g. "+55" */
23
23
  country_code: string;
@@ -669,6 +669,7 @@ interface Session {
669
669
  updated_at: string;
670
670
  expires_at: string;
671
671
  sudo_expires_at?: string | null;
672
+ oauth_client_id?: string | null;
672
673
  }
673
674
  type OAuthAppType = 'public' | 'confidential';
674
675
  type OAuthAppTokenEndpointAuthMethod = 'none' | 'client_secret_basic' | 'client_secret_post';
@@ -1951,23 +1952,27 @@ interface SendSMSParams {
1951
1952
  params?: Record<string, unknown>;
1952
1953
  }
1953
1954
  type NotificationChannel = 'email' | 'sms' | 'webhook';
1954
- type TemplateLanguage = 'en-US' | 'pt-BR';
1955
+ type TemplateLanguage = 'en-US' | 'pt-BR' | 'pt-PT';
1956
+ interface TemplateTranslation {
1957
+ language: TemplateLanguage;
1958
+ subject?: string;
1959
+ content?: string;
1960
+ last_submission?: string;
1961
+ created_at?: string;
1962
+ updated_at?: string;
1963
+ }
1955
1964
  interface Template {
1956
- id: string;
1957
- name?: string;
1958
- description?: string;
1959
1965
  slug: string;
1960
1966
  channel: NotificationChannel;
1961
- subject?: string;
1962
- content: string;
1967
+ name?: string;
1968
+ description?: string;
1963
1969
  url?: string;
1964
1970
  config?: Record<string, unknown>;
1965
- language: TemplateLanguage;
1966
- last_submission?: string;
1967
- /** `true` when this is a platform-level common template, not a custom one. */
1968
1971
  common: boolean;
1969
- created_at: string;
1970
- updated_at: string;
1972
+ customized: boolean;
1973
+ translations: TemplateTranslation[];
1974
+ created_at?: string;
1975
+ updated_at?: string;
1971
1976
  }
1972
1977
  interface CreateTemplateParams {
1973
1978
  slug: string;
@@ -1985,17 +1990,19 @@ interface CreateTemplateParams {
1985
1990
  interface UpdateTemplateParams {
1986
1991
  name?: string;
1987
1992
  description?: string;
1988
- subject?: string;
1989
- content?: string;
1990
1993
  url?: string;
1991
1994
  config?: Record<string, unknown>;
1992
1995
  }
1996
+ interface TranslationParams {
1997
+ subject?: string;
1998
+ content: string;
1999
+ }
1993
2000
  interface TemplateFilters {
1994
2001
  page?: number;
1995
2002
  page_size?: number;
1996
2003
  sort?: 'asc' | 'desc';
1997
2004
  channel?: NotificationChannel;
1998
- language?: TemplateLanguage;
2005
+ authored?: boolean;
1999
2006
  }
2000
2007
  interface PaginatedTemplates {
2001
2008
  items: Template[];
@@ -2031,32 +2038,43 @@ declare class TemplatesClient {
2031
2038
  */
2032
2039
  create(params: CreateTemplateParams, options?: RequestOptions): Promise<NulvlessResult<Template>>;
2033
2040
  /**
2034
- * Updates an existing template.
2041
+ * Updates the name, description, URL or config of a template.
2035
2042
  *
2036
- * `language` defaults to `'en-US'` when omitted.
2043
+ * @example
2044
+ * await nulvless.comms.templates.update('email', 'welcome', { name: 'Welcome' })
2045
+ */
2046
+ update(channel: NotificationChannel, slug: string, params: UpdateTemplateParams, options?: RequestOptions): Promise<NulvlessResult<Template>>;
2047
+ /**
2048
+ * Creates or replaces a template translation.
2049
+ *
2050
+ * @example
2051
+ * await nulvless.comms.templates.putTranslation('email', 'welcome', 'pt-BR', { subject: 'Olá!', content: '<h1>Olá {{name}}</h1>' })
2052
+ */
2053
+ putTranslation(channel: NotificationChannel, slug: string, language: TemplateLanguage, params: TranslationParams, options?: RequestOptions): Promise<NulvlessResult<Template>>;
2054
+ /**
2055
+ * Deletes a template translation.
2037
2056
  *
2038
2057
  * @example
2039
- * await nulvless.comms.templates.update('email', 'welcome', { subject: 'Welcome aboard!' })
2058
+ * await nulvless.comms.templates.deleteTranslation('email', 'welcome', 'pt-BR')
2040
2059
  */
2041
- update(channel: NotificationChannel, slug: string, params: UpdateTemplateParams, language?: TemplateLanguage, options?: RequestOptions): Promise<NulvlessResult<Template>>;
2060
+ deleteTranslation(channel: NotificationChannel, slug: string, language: TemplateLanguage, options?: RequestOptions): Promise<NulvlessResult<Template>>;
2042
2061
  /**
2043
- * Deletes a template.
2062
+ * Deletes a template and its translations.
2044
2063
  *
2045
- * `language` defaults to `'en-US'` when omitted.
2064
+ * @example
2065
+ * await nulvless.comms.templates.delete('email', 'welcome')
2046
2066
  */
2047
- delete(channel: NotificationChannel, slug: string, language?: TemplateLanguage, options?: RequestOptions): Promise<NulvlessResult<Template>>;
2067
+ delete(channel: NotificationChannel, slug: string, options?: RequestOptions): Promise<NulvlessResult<Template>>;
2048
2068
  /**
2049
2069
  * Returns a template by channel and slug, falling back to the common template
2050
2070
  * if no custom one exists.
2051
2071
  *
2052
- * `language` defaults to `'en-US'` when omitted.
2053
- *
2054
- * The response includes `common: true` when the returned template is the
2055
- * platform-level fallback rather than a custom override.
2072
+ * @example
2073
+ * const { data } = await nulvless.comms.templates.get('email', 'welcome')
2056
2074
  */
2057
- get(channel: NotificationChannel, slug: string, language?: TemplateLanguage, options?: RequestOptions): Promise<NulvlessResult<Template>>;
2075
+ get(channel: NotificationChannel, slug: string, options?: RequestOptions): Promise<NulvlessResult<Template>>;
2058
2076
  /**
2059
- * Returns a paginated list of templates, optionally filtered by channel and language.
2077
+ * Returns a paginated list of templates, optionally filtered by channel.
2060
2078
  *
2061
2079
  * @example
2062
2080
  * const { data } = await nulvless.comms.templates.list({ channel: 'email', page_size: 20 })
@@ -2354,4 +2372,4 @@ declare function createClient(url: string, publicKey: string, options?: ClientOp
2354
2372
  */
2355
2373
  declare function createServerClient(url: string, privateKey: string, options?: ServerClientOptions): NulvlessServerClient;
2356
2374
 
2357
- export { AUTH_CACHE_HEADERS, type AccountEntry, type AddEmailIdentityParams, type AddPhoneIdentityParams, AdminClient, type AdminCreateUserParams, type AdminUpdateUserParams, type AssuranceLevel, AuthBrowserClient, AuthClient, type AuthErrorCode, AuthEventEmitter, type AuthEvents, type AuthFactorStatus, type AuthMethod, type AuthMethods, type AuthOptions, AuthServerClient, type Authenticated, type BlockGrantParams, type Challenge, type ChallengeSubject, type ChangeChallengeParams, type ChangePasswordParams, type ClientOptions, CommsClient, type CommsErrorCode, type ConfirmationType, type CreateChallengeParams, type CreateRoleParams, type CreateTemplateParams, type EdgeFunctionErrorCode, EmailClient, type EnableFactorParams, type EnrollFactorParams, type ErrorCode, type ExchangeOAuthCodeParams, type FactorEnrollment, FactorsClient, type GatewayErrorCode, type Grant, type GrantMembers, type GrantStatus, GrantsClient, HttpClient, type Identity, type IdentityType, type Invite, type InviteParams, type Language, type LeaveGrantParams, type LookupMatch, type LookupParams, type LookupResult, type MFAMethod, type Nonce, type NotificationChannel, NulvlessClient, type NulvlessError, NulvlessException, type NulvlessResult, NulvlessServerClient, type NulvlessStorage, type OAuthApp, type OAuthAppGrantType, type OAuthAppTokenEndpointAuthMethod, type OAuthAppType, type OAuthAuthorization, type OAuthAuthorizeParams, OAuthClient, type OAuthConsentAction, type OAuthConsentResult, type OAuthDiscovery, OAuthGrantsClient, type OAuthJWKS, type OAuthPrompt, type OAuthProvider, type OAuthTokenResponse, type OAuthUserGrant, type OAuthUserInfo, type PaginateGrantsParams, type PaginateUsersParams, type Paginated, type PaginatedTemplates, type PaginationSort, type Phone, type RecoverParams, type RefreshOAuthTokenParams, type RefreshTokenParams, type RegisterOAuthAppParams, type RemoveIdentityParams, type RequestOptions, type ResetPasswordParams, type RevokeGrantParams, type RevokeSessionParams, type Role, type SdkErrorCode, SecurityClient, type SendEmailParams, type SendOTPToUpdateEmailParams, type SendOTPToUpdatePhoneParams, type SendSMSParams, type ServerClientOptions, type Session, type SessionFingerPrint, SessionManager, SessionsClient, type SetGrantParams, type SignInMethod, type SignInParams, type SignInWithOTPParams, type SignOutScope, type SignUpParams, SmsClient, Storage, type StoredSession, type SudoMethod, type Template, type TemplateFilters, type TemplateLanguage, TemplatesClient, type TokenType, type UnenrollFactorParams, type UpdateGrantParams, type UpdateIdentityParams, type UpdateOAuthAppParams, type UpdateRoleParams, type UpdateTemplateParams, type User, type UserGender, type UserProfile, UsersClient, type Verified, type VerifyChallengeParams, type VerifyParams, type VerifyReason, applyAuthCacheHeaders, createClient, createServerClient, forwardUserHeaders };
2375
+ export { AUTH_CACHE_HEADERS, type AccountEntry, type AddEmailIdentityParams, type AddPhoneIdentityParams, AdminClient, type AdminCreateUserParams, type AdminUpdateUserParams, type AssuranceLevel, AuthBrowserClient, AuthClient, type AuthErrorCode, AuthEventEmitter, type AuthEvents, type AuthFactorStatus, type AuthMethod, type AuthMethods, type AuthOptions, AuthServerClient, type Authenticated, type BlockGrantParams, type Challenge, type ChallengeSubject, type ChangeChallengeParams, type ChangePasswordParams, type ClientOptions, CommsClient, type CommsErrorCode, type ConfirmationType, type CreateChallengeParams, type CreateRoleParams, type CreateTemplateParams, type EdgeFunctionErrorCode, EmailClient, type EnableFactorParams, type EnrollFactorParams, type ErrorCode, type ExchangeOAuthCodeParams, type FactorEnrollment, FactorsClient, type GatewayErrorCode, type Grant, type GrantMembers, type GrantStatus, GrantsClient, HttpClient, type Identity, type IdentityType, type Invite, type InviteParams, type Language, type LeaveGrantParams, type LookupMatch, type LookupParams, type LookupResult, type MFAMethod, type Nonce, type NotificationChannel, NulvlessClient, type NulvlessError, NulvlessException, type NulvlessResult, NulvlessServerClient, type NulvlessStorage, type OAuthApp, type OAuthAppGrantType, type OAuthAppTokenEndpointAuthMethod, type OAuthAppType, type OAuthAuthorization, type OAuthAuthorizeParams, OAuthClient, type OAuthConsentAction, type OAuthConsentResult, type OAuthDiscovery, OAuthGrantsClient, type OAuthJWKS, type OAuthPrompt, type OAuthProvider, type OAuthTokenResponse, type OAuthUserGrant, type OAuthUserInfo, type PaginateGrantsParams, type PaginateUsersParams, type Paginated, type PaginatedTemplates, type PaginationSort, type Phone, type RecoverParams, type RefreshOAuthTokenParams, type RefreshTokenParams, type RegisterOAuthAppParams, type RemoveIdentityParams, type RequestOptions, type ResetPasswordParams, type RevokeGrantParams, type RevokeSessionParams, type Role, type SdkErrorCode, SecurityClient, type SendEmailParams, type SendOTPToUpdateEmailParams, type SendOTPToUpdatePhoneParams, type SendSMSParams, type ServerClientOptions, type Session, type SessionFingerPrint, SessionManager, SessionsClient, type SetGrantParams, type SignInMethod, type SignInParams, type SignInWithOTPParams, type SignOutScope, type SignUpParams, SmsClient, Storage, type StoredSession, type SudoMethod, type Template, type TemplateFilters, type TemplateLanguage, type TemplateTranslation, TemplatesClient, type TokenType, type TranslationParams, type UnenrollFactorParams, type UpdateGrantParams, type UpdateIdentityParams, type UpdateOAuthAppParams, type UpdateRoleParams, type UpdateTemplateParams, type User, type UserGender, type UserProfile, UsersClient, type Verified, type VerifyChallengeParams, type VerifyParams, type VerifyReason, applyAuthCacheHeaders, createClient, createServerClient, forwardUserHeaders };
package/dist/index.mjs CHANGED
@@ -1950,9 +1950,6 @@ var AuthServerClient = class extends AuthClient {
1950
1950
  };
1951
1951
 
1952
1952
  // src/comms/templates/index.ts
1953
- function templatePath(channel, slug, language) {
1954
- return language ? route`/templates/${channel}/${slug}/${language}` : route`/templates/${channel}/${slug}`;
1955
- }
1956
1953
  var TemplatesClient = class {
1957
1954
  constructor(http) {
1958
1955
  this.http = http;
@@ -1969,38 +1966,53 @@ var TemplatesClient = class {
1969
1966
  return this.http.post("/templates", params, options);
1970
1967
  }
1971
1968
  /**
1972
- * Updates an existing template.
1969
+ * Updates the name, description, URL or config of a template.
1973
1970
  *
1974
- * `language` defaults to `'en-US'` when omitted.
1971
+ * @example
1972
+ * await nulvless.comms.templates.update('email', 'welcome', { name: 'Welcome' })
1973
+ */
1974
+ update(channel, slug, params, options) {
1975
+ return this.http.patch(route`/templates/${channel}/${slug}`, params, options);
1976
+ }
1977
+ /**
1978
+ * Creates or replaces a template translation.
1975
1979
  *
1976
1980
  * @example
1977
- * await nulvless.comms.templates.update('email', 'welcome', { subject: 'Welcome aboard!' })
1981
+ * await nulvless.comms.templates.putTranslation('email', 'welcome', 'pt-BR', { subject: 'Olá!', content: '<h1>Olá {{name}}</h1>' })
1978
1982
  */
1979
- update(channel, slug, params, language, options) {
1980
- return this.http.patch(templatePath(channel, slug, language), params, options);
1983
+ putTranslation(channel, slug, language, params, options) {
1984
+ return this.http.put(route`/templates/${channel}/${slug}/${language}`, params, options);
1981
1985
  }
1982
1986
  /**
1983
- * Deletes a template.
1987
+ * Deletes a template translation.
1984
1988
  *
1985
- * `language` defaults to `'en-US'` when omitted.
1989
+ * @example
1990
+ * await nulvless.comms.templates.deleteTranslation('email', 'welcome', 'pt-BR')
1986
1991
  */
1987
- delete(channel, slug, language, options) {
1988
- return this.http.delete(templatePath(channel, slug, language), options);
1992
+ deleteTranslation(channel, slug, language, options) {
1993
+ return this.http.delete(route`/templates/${channel}/${slug}/${language}`, options);
1994
+ }
1995
+ /**
1996
+ * Deletes a template and its translations.
1997
+ *
1998
+ * @example
1999
+ * await nulvless.comms.templates.delete('email', 'welcome')
2000
+ */
2001
+ delete(channel, slug, options) {
2002
+ return this.http.delete(route`/templates/${channel}/${slug}`, options);
1989
2003
  }
1990
2004
  /**
1991
2005
  * Returns a template by channel and slug, falling back to the common template
1992
2006
  * if no custom one exists.
1993
2007
  *
1994
- * `language` defaults to `'en-US'` when omitted.
1995
- *
1996
- * The response includes `common: true` when the returned template is the
1997
- * platform-level fallback rather than a custom override.
2008
+ * @example
2009
+ * const { data } = await nulvless.comms.templates.get('email', 'welcome')
1998
2010
  */
1999
- get(channel, slug, language, options) {
2000
- return this.http.get(templatePath(channel, slug, language), options);
2011
+ get(channel, slug, options) {
2012
+ return this.http.get(route`/templates/${channel}/${slug}`, options);
2001
2013
  }
2002
2014
  /**
2003
- * Returns a paginated list of templates, optionally filtered by channel and language.
2015
+ * Returns a paginated list of templates, optionally filtered by channel.
2004
2016
  *
2005
2017
  * @example
2006
2018
  * const { data } = await nulvless.comms.templates.list({ channel: 'email', page_size: 20 })
@@ -2013,7 +2025,7 @@ var TemplatesClient = class {
2013
2025
  ...filters?.page_size !== void 0 ? { page_size: filters.page_size } : {},
2014
2026
  ...filters?.sort ? { sort: filters.sort } : {},
2015
2027
  ...filters?.channel ? { channel: filters.channel } : {},
2016
- ...filters?.language ? { language: filters.language } : {}
2028
+ ...filters?.authored ? { authored: filters.authored } : {}
2017
2029
  }
2018
2030
  });
2019
2031
  }