diff --git a/apps/dashboard/src/hooks/use-feature-flag.tsx b/apps/dashboard/src/hooks/use-feature-flag.tsx
index 261de1ca828..fe1e5645308 100644
--- a/apps/dashboard/src/hooks/use-feature-flag.tsx
+++ b/apps/dashboard/src/hooks/use-feature-flag.tsx
@@ -1,4 +1,4 @@
-import { FeatureFlags, FeatureFlagsKeysEnum, prepareBooleanStringFeatureFlag } from '@novu/shared';
+import { FeatureFlagsKeysEnum, prepareBooleanStringFeatureFlag } from '@novu/shared';
import { useFlags } from 'launchdarkly-react-client-sdk';
import { IS_ENTERPRISE, IS_SELF_HOSTED, LAUNCH_DARKLY_CLIENT_SIDE_ID } from '../config';
@@ -10,16 +10,6 @@ function isLaunchDarklyEnabled() {
return !!LAUNCH_DARKLY_CLIENT_SIDE_ID && !(IS_SELF_HOSTED && IS_ENTERPRISE);
}
-export const useFeatureFlagMap = (defaultValue = false): FeatureFlags => {
- const flags = useFlags();
-
- return Object.keys(flags).reduce((acc: FeatureFlags, flag: string) => {
- acc[flag as keyof FeatureFlags] = flags[flag] ?? defaultValue;
-
- return acc;
- }, {} as FeatureFlags);
-};
-
export const useFeatureFlag = (key: FeatureFlagsKeysEnum, defaultValue = false): boolean => {
const flags = useFlags();
diff --git a/apps/dashboard/src/pages/index.ts b/apps/dashboard/src/pages/index.ts
index 9557d9110c2..5720eaf3a60 100644
--- a/apps/dashboard/src/pages/index.ts
+++ b/apps/dashboard/src/pages/index.ts
@@ -9,13 +9,11 @@ export * from './integrations-list-page';
export * from './invitation-accept';
export * from './layouts';
export * from './organization-list';
-export * from './questionnaire-page';
export * from './settings';
export * from './sign-in';
export * from './sign-up';
export * from './sso-sign-in';
export * from './translations';
-export * from './usecase-select-page';
export * from './verify-email';
export * from './welcome-page';
export * from './workflows';
diff --git a/apps/dashboard/src/pages/questionnaire-page.tsx b/apps/dashboard/src/pages/questionnaire-page.tsx
deleted file mode 100644
index 148d691cda0..00000000000
--- a/apps/dashboard/src/pages/questionnaire-page.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { PageMeta } from '@/components/page-meta';
-import { AuthCard } from '../components/auth/auth-card';
-import { MobileMessage } from '../components/auth/mobile-message';
-import { QuestionnaireForm } from '../components/auth/questionnaire-form';
-
-export function QuestionnairePage() {
- return (
- <>
-
-
-
-
-
- >
- );
-}
diff --git a/apps/dashboard/src/pages/usecase-select-page.tsx b/apps/dashboard/src/pages/usecase-select-page.tsx
deleted file mode 100644
index 2ec00931355..00000000000
--- a/apps/dashboard/src/pages/usecase-select-page.tsx
+++ /dev/null
@@ -1,236 +0,0 @@
-import { useOrganization } from '@clerk/clerk-react';
-import { ChannelTypeEnum } from '@novu/shared';
-import * as Sentry from '@sentry/react';
-import { useMutation } from '@tanstack/react-query';
-import { AnimatePresence, motion } from 'motion/react';
-import { useEffect, useState } from 'react';
-import { Helmet } from 'react-helmet-async';
-import { useNavigate } from 'react-router-dom';
-import { getChannelOptions } from '@/components/auth/usecases-list.utils';
-import { AnimatedPage } from '@/components/onboarding/animated-page';
-import { useEnvironment } from '@/context/environment/hooks';
-import { useTelemetry } from '@/hooks/use-telemetry';
-import { TelemetryEvent } from '@/utils/telemetry';
-import { updateClerkOrgMetadata } from '../api/organization';
-import { AuthCard } from '../components/auth/auth-card';
-import { UsecaseSelectOnboarding } from '../components/auth/usecase-selector';
-import { OnboardingArrowLeft } from '../components/icons/onboarding-arrow-left';
-import { PageMeta } from '../components/page-meta';
-import { Button } from '../components/primitives/button';
-import { LinkButton } from '../components/primitives/button-link';
-import { ROUTES } from '../utils/routes';
-
-const containerVariants = {
- hidden: { opacity: 0 },
- visible: {
- opacity: 1,
- transition: {
- duration: 0.6,
- ease: [0.22, 1, 0.36, 1],
- staggerChildren: 0.1,
- },
- },
-};
-
-const itemVariants = {
- hidden: { opacity: 0 },
- visible: { opacity: 1 },
-};
-
-export function UsecaseSelectPage() {
- const { organization } = useOrganization();
- const { currentEnvironment } = useEnvironment();
- const navigate = useNavigate();
- const track = useTelemetry();
- const [selectedUseCases, setSelectedUseCases] = useState
([]);
- const [hoveredUseCase, setHoveredUseCase] = useState(null);
-
- useEffect(() => {
- track(TelemetryEvent.USECASE_SELECT_PAGE_VIEWED);
- }, [track]);
-
- useEffect(() => {
- if (organization?.publicMetadata?.useCases) {
- setSelectedUseCases(organization.publicMetadata.useCases as ChannelTypeEnum[]);
- }
- }, [organization]);
-
- const displayedUseCase =
- hoveredUseCase || (selectedUseCases.length > 0 ? selectedUseCases[selectedUseCases.length - 1] : null);
-
- const { mutate: handleContinue, isPending } = useMutation({
- mutationFn: async () => {
- await updateClerkOrgMetadata({
- environment: currentEnvironment!,
- data: {
- useCases: selectedUseCases,
- },
- });
- await organization?.reload();
- },
- onSuccess: () => {
- track(TelemetryEvent.USE_CASE_SELECTED, {
- useCases: selectedUseCases,
- });
-
- if (selectedUseCases.includes(ChannelTypeEnum.IN_APP)) {
- navigate(ROUTES.INBOX_USECASE);
- } else {
- navigate(ROUTES.WELCOME);
- }
- },
- onError: (error) => {
- console.error('Failed to update use cases:', error);
- Sentry.captureException(error);
- },
- });
-
- function handleSkip() {
- track(TelemetryEvent.USE_CASE_SKIPPED);
-
- navigate(ROUTES.INBOX_USECASE);
- }
-
- function handleSelectUseCase(useCase: ChannelTypeEnum) {
- setSelectedUseCases((prev) =>
- prev.includes(useCase) ? prev.filter((item) => item !== useCase) : [...prev, useCase]
- );
- }
-
- function handleSubmit(e: React.FormEvent) {
- e.preventDefault();
-
- if (selectedUseCases.length === 0 || isPending) return;
-
- handleContinue();
- }
-
- const channelOptions = getChannelOptions();
-
- return (
- <>
-
- {channelOptions.map((option) => (
-
- ))}
-
-
-
-
-
-
-
-
-
-
-
- {displayedUseCase && (
- option.id === displayedUseCase)?.image}`}
- alt={`${displayedUseCase}-usecase-illustration`}
- className="h-auto max-h-[500px] w-full object-contain"
- initial={{ opacity: 0, scale: 0.95 }}
- animate={{ opacity: 1, scale: 1 }}
- exit={{ opacity: 0, scale: 0.95 }}
- transition={{
- duration: 0.2,
- ease: [0.22, 1, 0.36, 1],
- }}
- />
- )}
-
- {!displayedUseCase && }
-
-
-
-
-
- >
- );
-}
-
-function EmptyStateView() {
- return (
-
-
-
-
-
-
- Hover on the cards to visualize,
- select all that apply.
-
-
-
- This helps us understand your use-case better with the channels you'd use in your product to communicate with
- your users.
-
-
- don't worry, you can always change later as you build.
-
-
- );
-}
diff --git a/apps/dashboard/src/utils/code-snippets.ts b/apps/dashboard/src/utils/code-snippets.ts
index a7b2c439e99..97faf14cf74 100644
--- a/apps/dashboard/src/utils/code-snippets.ts
+++ b/apps/dashboard/src/utils/code-snippets.ts
@@ -73,7 +73,7 @@ export const createCurlSnippet = ({ identifier, to, payload, secretKey = SECRET_
)}'`;
};
-export const createTriggerRequestBody = ({
+const createTriggerRequestBody = ({
workflowId,
to,
payload,
diff --git a/apps/dashboard/src/utils/liquid-autocomplete.tsx b/apps/dashboard/src/utils/liquid-autocomplete.tsx
index b08792922bf..d142d27b4ba 100644
--- a/apps/dashboard/src/utils/liquid-autocomplete.tsx
+++ b/apps/dashboard/src/utils/liquid-autocomplete.tsx
@@ -246,7 +246,7 @@ const createInfoPanel = ({ component }: { component: React.ReactNode }) => {
* - payload.* (any new field)
* - steps.{valid-step}.events.n.payload.* (any new field)
*/
-export const completions =
+const completions =
(
scopedVariables: LiquidVariable[],
variables: LiquidVariable[],
diff --git a/apps/worker/package.json b/apps/worker/package.json
index 10fc2959699..ce551e3319d 100644
--- a/apps/worker/package.json
+++ b/apps/worker/package.json
@@ -21,8 +21,6 @@
"test:e2e": "cross-env TS_NODE_COMPILER_OPTIONS='{\"strictNullChecks\": false}' NODE_ENV=test NODE_OPTIONS=--no-experimental-strip-types mocha --timeout 10000 --require ts-node/register --exit --file e2e/setup.ts src/**/*.e2e.ts"
},
"dependencies": {
- "ajv": "^8.18.0",
- "ajv-formats": "^2.1.1",
"@aws-sdk/client-secrets-manager": "^3.971.0",
"@nestjs/axios": "3.0.3",
"@nestjs/common": "10.4.18",
@@ -44,9 +42,8 @@
"@sentry/profiling-node": "^8.49.0",
"@sentry/tracing": "^7.40.0",
"@types/newrelic": "^9.14.8",
- "json-logic-js": "^2.0.5",
- "svix": "^1.64.1",
- "lru-cache": "^11.2.4",
+ "ajv": "^8.18.0",
+ "ajv-formats": "^2.1.1",
"axios": "^1.9.0",
"body-parser": "^2.2.1",
"class-transformer": "0.5.1",
@@ -60,8 +57,10 @@
"helmet": "^6.0.1",
"i18next": "^23.7.6",
"inline-css": "^4.0.3",
- "ioredis": "^5.2.4",
+ "ioredis": "^5.10.1",
+ "json-logic-js": "^2.0.5",
"lodash": "^4.18.0",
+ "lru-cache": "^11.2.4",
"nest-raven": "10.1.0",
"newrelic": "^13.12.0",
"reflect-metadata": "0.2.2",
@@ -69,6 +68,7 @@
"rxjs": "7.8.1",
"shortid": "^2.2.17",
"simple-statistics": "^7.8.3",
+ "svix": "^1.64.1",
"uuid": "^8.3.2"
},
"devDependencies": {
@@ -80,11 +80,11 @@
"@types/chai": "^4.2.11",
"@types/express": "4.17.17",
"@types/inline-css": "^3.0.4",
+ "@types/json-logic-js": "^2.0.8",
"@types/mocha": "^10.0.2",
"@types/node": "^22.0.0",
"@types/sinon": "^9.0.0",
"@types/supertest": "^2.0.8",
- "@types/json-logic-js": "^2.0.8",
"chai": "^4.2.0",
"mocha": "^10.2.0",
"sinon": "^9.2.4",
diff --git a/apps/worker/src/app/workflow/usecases/send-message/send-message-email.usecase.ts b/apps/worker/src/app/workflow/usecases/send-message/send-message-email.usecase.ts
index fdd30506ff2..9e1097b4504 100644
--- a/apps/worker/src/app/workflow/usecases/send-message/send-message-email.usecase.ts
+++ b/apps/worker/src/app/workflow/usecases/send-message/send-message-email.usecase.ts
@@ -40,6 +40,7 @@ import {
FeatureFlagsKeysEnum,
IAttachmentOptions,
IEmailOptions,
+ safeJsonStringify,
WebhookEventEnum,
WebhookObjectTypeEnum,
} from '@novu/shared';
@@ -574,7 +575,8 @@ export class SendMessageEmail extends SendMessageBase {
status: ExecutionDetailsStatusEnum.FAILED,
isTest: false,
isRetry: false,
- raw: JSON.stringify(error) === '{}' ? JSON.stringify({ message: error.message }) : JSON.stringify(error),
+ raw:
+ safeJsonStringify(error) === '{}' ? JSON.stringify({ message: error.message }) : safeJsonStringify(error),
})
);
diff --git a/apps/worker/src/app/workflow/usecases/send-message/send-message-push.usecase.spec.ts b/apps/worker/src/app/workflow/usecases/send-message/send-message-push.usecase.spec.ts
index 8dd6a710395..cf1e9e7cb40 100644
--- a/apps/worker/src/app/workflow/usecases/send-message/send-message-push.usecase.spec.ts
+++ b/apps/worker/src/app/workflow/usecases/send-message/send-message-push.usecase.spec.ts
@@ -1,5 +1,5 @@
import { expect } from 'chai';
-import { isSubscriberError, SUBSCRIBER_ERROR_PATTERNS } from './send-message-push.usecase';
+import { isSubscriberError, SUBSCRIBER_ERROR_PATTERNS, serializePushProviderError } from './send-message-push.usecase';
describe('isSubscriberError', () => {
for (const pattern of SUBSCRIBER_ERROR_PATTERNS) {
@@ -22,3 +22,24 @@ describe('isSubscriberError', () => {
expect(isSubscriberError('')).to.be.false;
});
});
+
+describe('serializePushProviderError', () => {
+ it('does not throw when the error object has circular references (e.g. Axios-style)', () => {
+ const circular: Record = { message: 'request failed' };
+ circular.self = circular;
+
+ const serialized = serializePushProviderError(circular);
+ const parsed = JSON.parse(serialized) as { message?: string; self?: string };
+
+ expect(parsed.message).to.equal('request failed');
+ expect(parsed.self).to.equal('[Circular]');
+ });
+
+ it('falls back to message and name for plain Error (JSON.stringify yields empty object)', () => {
+ const serialized = serializePushProviderError(new Error('boom'));
+ const parsed = JSON.parse(serialized) as { message: string; name: string };
+
+ expect(parsed.message).to.equal('boom');
+ expect(parsed.name).to.equal('Error');
+ });
+});
diff --git a/apps/worker/src/app/workflow/usecases/send-message/send-message-push.usecase.ts b/apps/worker/src/app/workflow/usecases/send-message/send-message-push.usecase.ts
index 489904dfd0e..9863c01520a 100644
--- a/apps/worker/src/app/workflow/usecases/send-message/send-message-push.usecase.ts
+++ b/apps/worker/src/app/workflow/usecases/send-message/send-message-push.usecase.ts
@@ -38,6 +38,7 @@ import {
InboxCountTypeEnum,
ProvidersIdEnum,
PushProviderIdEnum,
+ safeJsonStringify,
TriggerOverrides,
WebhookEventEnum,
WebhookObjectTypeEnum,
@@ -72,6 +73,21 @@ export function isSubscriberError(errorMessage: string): boolean {
return SUBSCRIBER_ERROR_PATTERNS.some((pattern) => errorMessage.includes(pattern));
}
+/** Safe for Axios / Node errors that may contain circular socket references. */
+export function serializePushProviderError(error: unknown): string {
+ const serialized = safeJsonStringify(error);
+
+ if (serialized !== '{}') {
+ return serialized;
+ }
+
+ if (error instanceof Error) {
+ return JSON.stringify({ message: error.message, name: error.name });
+ }
+
+ return JSON.stringify({ message: String(error ?? '') });
+}
+
interface IPushProviderOverride {
providerId: PushProviderIdEnum;
overrides: Record;
@@ -643,7 +659,7 @@ export class SendMessagePush extends SendMessageBase {
Logger.log(
{
jobId: command.jobId,
- errorContent: JSON.stringify(e) || e?.message,
+ errorContent: serializePushProviderError(e),
code: e?.code,
message: e?.message,
details: e?.details,
@@ -661,7 +677,7 @@ export class SendMessagePush extends SendMessageBase {
e
);
- const raw = JSON.stringify(e) !== JSON.stringify({}) ? JSON.stringify(e) : JSON.stringify(e.message);
+ const raw = serializePushProviderError(e);
try {
await this.createExecutionDetailsError(DetailEnum.PROVIDER_ERROR, command.job, {
diff --git a/apps/worker/src/app/workflow/usecases/send-message/send-message-type.usecase.ts b/apps/worker/src/app/workflow/usecases/send-message/send-message-type.usecase.ts
index 6c00a3a9837..7725905f914 100644
--- a/apps/worker/src/app/workflow/usecases/send-message/send-message-type.usecase.ts
+++ b/apps/worker/src/app/workflow/usecases/send-message/send-message-type.usecase.ts
@@ -1,5 +1,6 @@
import { CreateExecutionDetails, DetailEnum } from '@novu/application-generic';
import { DeliveryLifecycleState, JobEntity, MessageEntity, MessageRepository } from '@novu/dal';
+import { safeJsonStringify } from '@novu/shared';
import { SendMessageChannelCommand } from './send-message-channel.command';
export enum SendMessageStatus {
@@ -77,7 +78,7 @@ export abstract class SendMessageType {
return error.toString();
}
if (Object.keys(error)?.length > 0) {
- return JSON.stringify(error);
+ return safeJsonStringify(error);
}
return '';
diff --git a/apps/worker/src/config/worker-init.config.ts b/apps/worker/src/config/worker-init.config.ts
index a2f1576ebba..cd625e50346 100644
--- a/apps/worker/src/config/worker-init.config.ts
+++ b/apps/worker/src/config/worker-init.config.ts
@@ -16,7 +16,7 @@ type WorkerModuleTree = { workerClass: WorkerClass; queueDependencies: JobTopicN
type WorkerDepTree = Partial>;
-export const WORKER_MAPPING: WorkerDepTree = {
+const WORKER_MAPPING: WorkerDepTree = {
[JobTopicNameEnum.STANDARD]: {
workerClass: StandardWorker,
queueDependencies: [JobTopicNameEnum.WEB_SOCKETS, JobTopicNameEnum.STANDARD, JobTopicNameEnum.PROCESS_SUBSCRIBER],
diff --git a/apps/ws/package.json b/apps/ws/package.json
index 01230c39eaa..269a20ee143 100644
--- a/apps/ws/package.json
+++ b/apps/ws/package.json
@@ -48,7 +48,7 @@
"dotenv": "^16.4.5",
"envalid": "^8.0.0",
"helmet": "^6.0.1",
- "ioredis": "5.3.2",
+ "ioredis": "5.10.1",
"jsonwebtoken": "9.0.3",
"lodash": "^4.18.0",
"nest-raven": "10.1.0",
diff --git a/libs/internal-sdk/.speakeasy/gen.yaml b/libs/internal-sdk/.speakeasy/gen.yaml
index 57de0348808..99d59ce055e 100755
--- a/libs/internal-sdk/.speakeasy/gen.yaml
+++ b/libs/internal-sdk/.speakeasy/gen.yaml
@@ -68,6 +68,7 @@ typescript:
enableReactQuery: true
enumFormat: union
exportZodModelNamespace: false
+ fixEnumNameSanitization: false
flatAdditionalProperties: false
flattenGlobalSecurity: true
flatteningOrder: body-first
diff --git a/libs/internal-sdk/examples/package.json b/libs/internal-sdk/examples/package.json
index ac38dcd316b..ad7b10c6607 100644
--- a/libs/internal-sdk/examples/package.json
+++ b/libs/internal-sdk/examples/package.json
@@ -15,4 +15,4 @@
"dependencies": {
"@novu/api": "file:.."
}
-}
+}
\ No newline at end of file
diff --git a/libs/internal-sdk/examples/trigger.example.ts b/libs/internal-sdk/examples/trigger.example.ts
index 62873d42136..1b6cc6be526 100644
--- a/libs/internal-sdk/examples/trigger.example.ts
+++ b/libs/internal-sdk/examples/trigger.example.ts
@@ -2,10 +2,8 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import dotenv from 'dotenv';
-
+import dotenv from "dotenv";
dotenv.config();
-
/**
* Example usage of the @novu/api SDK
*
@@ -13,28 +11,28 @@ dotenv.config();
* npm run build && npx tsx trigger.example.ts
*/
-import { Novu } from '@novu/api';
+import { Novu } from "@novu/api";
const novu = new Novu({
security: {
- bearerAuth: '',
+ bearerAuth: "",
},
});
async function main() {
const result = await novu.trigger({
- workflowId: 'workflow_identifier',
+ workflowId: "workflow_identifier",
payload: {
- comment_id: 'string',
- post: {
- text: 'string',
+ "comment_id": "string",
+ "post": {
+ "text": "string",
},
},
overrides: {},
- to: 'SUBSCRIBER_ID',
- actor: '',
+ to: "SUBSCRIBER_ID",
+ actor: "",
context: {
- key: 'org-acme',
+ "key": "org-acme",
},
});
diff --git a/libs/internal-sdk/package.json b/libs/internal-sdk/package.json
index 873d9768021..18981c1c5e3 100644
--- a/libs/internal-sdk/package.json
+++ b/libs/internal-sdk/package.json
@@ -15,15 +15,9 @@
"react-dom": "^18 || ^19"
},
"peerDependenciesMeta": {
- "@tanstack/react-query": {
- "optional": true
- },
- "react": {
- "optional": true
- },
- "react-dom": {
- "optional": true
- }
+ "@tanstack/react-query": {"optional":true},
+ "react": {"optional":true},
+ "react-dom": {"optional":true}
},
"devDependencies": {
"@eslint/js": "^9.26.0",
diff --git a/libs/internal-sdk/src/funcs/activityChartsRetrieve.ts b/libs/internal-sdk/src/funcs/activityChartsRetrieve.ts
index 90e214ec4a1..920691999b2 100644
--- a/libs/internal-sdk/src/funcs/activityChartsRetrieve.ts
+++ b/libs/internal-sdk/src/funcs/activityChartsRetrieve.ts
@@ -30,6 +30,8 @@ import { Result } from "../types/fp.js";
*
* @remarks
* Retrieve chart data for activity analytics and metrics visualization.
+ *
+ * This operation requires {@link Security.bearerAuth} to be set on the `security` parameter when initializing the SDK.
*/
export function activityChartsRetrieve(
client: NovuCore,
@@ -111,7 +113,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/activityRequestsList.ts b/libs/internal-sdk/src/funcs/activityRequestsList.ts
index efc7da34d80..01d9db43369 100644
--- a/libs/internal-sdk/src/funcs/activityRequestsList.ts
+++ b/libs/internal-sdk/src/funcs/activityRequestsList.ts
@@ -30,6 +30,8 @@ import { Result } from "../types/fp.js";
*
* @remarks
* Retrieve a list of activity requests with optional filtering and pagination.
+ *
+ * This operation requires {@link Security.bearerAuth} to be set on the `security` parameter when initializing the SDK.
*/
export function activityRequestsList(
client: NovuCore,
@@ -108,7 +110,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/activityRequestsRetrieve.ts b/libs/internal-sdk/src/funcs/activityRequestsRetrieve.ts
index 8ae0d19bd0c..65fed637f8b 100644
--- a/libs/internal-sdk/src/funcs/activityRequestsRetrieve.ts
+++ b/libs/internal-sdk/src/funcs/activityRequestsRetrieve.ts
@@ -2,40 +2,42 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Retrieve activity request
*
* @remarks
* Retrieve detailed traces and information for a specific activity request by ID.
+ *
+ * This operation requires {@link Security.bearerAuth} to be set on the `security` parameter when initializing the SDK.
*/
export function activityRequestsRetrieve(
client: NovuCore,
requestId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
components.GetRequestResponseDto,
@@ -49,14 +51,19 @@ export function activityRequestsRetrieve(
| SDKValidationError
>
> {
- return new APIPromise($do(client, requestId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ requestId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
requestId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -80,48 +87,51 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.ActivityControllerGetRequestTracesRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.ActivityControllerGetRequestTracesRequest$outboundSchema.parse(
+ value,
+ ),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- requestId: encodeSimple('requestId', payload.requestId, {
+ requestId: encodeSimple("requestId", payload.requestId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/activity/requests/{requestId}')(pathParams);
+ const path = pathToFunc("/v1/activity/requests/{requestId}")(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'ActivityController_getRequestTraces',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "ActivityController_getRequestTraces",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -129,37 +139,34 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
- errorCodes: ['4XX', '5XX'],
+ errorCodes: ["4XX", "5XX"],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -175,12 +182,12 @@ async function $do(
| SDKValidationError
>(
M.json(200, components.GetRequestResponseDto$inboundSchema),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req);
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/activityTrack.ts b/libs/internal-sdk/src/funcs/activityTrack.ts
index 908cedf814f..2eb01453801 100644
--- a/libs/internal-sdk/src/funcs/activityTrack.ts
+++ b/libs/internal-sdk/src/funcs/activityTrack.ts
@@ -2,32 +2,32 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as z from 'zod/v3';
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import * as z from "zod/v3";
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
- * Track activity and engagement events
+ * Track provider activity and engagement events
*
* @remarks
* Track activity and engagement events for a specific delivery provider
@@ -35,7 +35,7 @@ import { Result } from '../types/fp.js';
export function activityTrack(
client: NovuCore,
request: operations.InboundWebhooksControllerHandleWebhookRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
Array,
@@ -49,13 +49,17 @@ export function activityTrack(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.InboundWebhooksControllerHandleWebhookRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -74,53 +78,57 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.InboundWebhooksControllerHandleWebhookRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.InboundWebhooksControllerHandleWebhookRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.RequestBody, { explode: true });
+ const body = encodeJSON("body", payload.RequestBody, { explode: true });
const pathParams = {
- environmentId: encodeSimple('environmentId', payload.environmentId, {
+ environmentId: encodeSimple("environmentId", payload.environmentId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- integrationId: encodeSimple('integrationId', payload.integrationId, {
+ integrationId: encodeSimple("integrationId", payload.integrationId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/inbound-webhooks/delivery-providers/{environmentId}/{integrationId}')(pathParams);
+ const path = pathToFunc(
+ "/v2/inbound-webhooks/delivery-providers/{environmentId}/{integrationId}",
+ )(pathParams);
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'InboundWebhooksController_handleWebhook',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "InboundWebhooksController_handleWebhook",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -128,37 +136,34 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'POST',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "POST",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
- errorCodes: ['4XX', '5XX'],
+ errorCodes: ["4XX", "5XX"],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -174,12 +179,12 @@ async function $do(
| SDKValidationError
>(
M.json(200, z.array(components.WebhookResultDto$inboundSchema)),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req);
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/activityWorkflowRunsList.ts b/libs/internal-sdk/src/funcs/activityWorkflowRunsList.ts
index 90dece641a0..1e96895a77b 100644
--- a/libs/internal-sdk/src/funcs/activityWorkflowRunsList.ts
+++ b/libs/internal-sdk/src/funcs/activityWorkflowRunsList.ts
@@ -2,39 +2,41 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeFormQuery, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* List workflow runs
*
* @remarks
* Retrieve a list of workflow runs with optional filtering and pagination.
+ *
+ * This operation requires {@link Security.bearerAuth} to be set on the `security` parameter when initializing the SDK.
*/
export function activityWorkflowRunsList(
client: NovuCore,
request: operations.ActivityControllerGetWorkflowRunsRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
components.GetWorkflowRunsResponseDto,
@@ -48,13 +50,17 @@ export function activityWorkflowRunsList(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.ActivityControllerGetWorkflowRunsRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -73,58 +79,61 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.ActivityControllerGetWorkflowRunsRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.ActivityControllerGetWorkflowRunsRequest$outboundSchema.parse(
+ value,
+ ),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
- const path = pathToFunc('/v1/activity/workflow-runs')();
+ const path = pathToFunc("/v1/activity/workflow-runs")();
const query = encodeFormQuery({
- channels: payload.channels,
- contextKeys: payload.contextKeys,
- createdGte: payload.createdGte,
- createdLte: payload.createdLte,
- cursor: payload.cursor,
- limit: payload.limit,
- severity: payload.severity,
- statuses: payload.statuses,
- subscriberIds: payload.subscriberIds,
- subscriptionId: payload.subscriptionId,
- topicKey: payload.topicKey,
- transactionIds: payload.transactionIds,
- workflowIds: payload.workflowIds,
+ "channels": payload.channels,
+ "contextKeys": payload.contextKeys,
+ "createdGte": payload.createdGte,
+ "createdLte": payload.createdLte,
+ "cursor": payload.cursor,
+ "limit": payload.limit,
+ "severity": payload.severity,
+ "statuses": payload.statuses,
+ "subscriberIds": payload.subscriberIds,
+ "subscriptionId": payload.subscriptionId,
+ "topicKey": payload.topicKey,
+ "transactionIds": payload.transactionIds,
+ "workflowIds": payload.workflowIds,
});
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'ActivityController_getWorkflowRuns',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "ActivityController_getWorkflowRuns",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -132,38 +141,35 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- query: query,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ query: query,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
- errorCodes: ['4XX', '5XX'],
+ errorCodes: ["4XX", "5XX"],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -179,12 +185,12 @@ async function $do(
| SDKValidationError
>(
M.json(200, components.GetWorkflowRunsResponseDto$inboundSchema),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req);
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/activityWorkflowRunsRetrieve.ts b/libs/internal-sdk/src/funcs/activityWorkflowRunsRetrieve.ts
index 7becdbcf7a6..2f75b4119b4 100644
--- a/libs/internal-sdk/src/funcs/activityWorkflowRunsRetrieve.ts
+++ b/libs/internal-sdk/src/funcs/activityWorkflowRunsRetrieve.ts
@@ -2,40 +2,42 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Retrieve workflow run
*
* @remarks
* Retrieve detailed information for a specific workflow run by ID.
+ *
+ * This operation requires {@link Security.bearerAuth} to be set on the `security` parameter when initializing the SDK.
*/
export function activityWorkflowRunsRetrieve(
client: NovuCore,
workflowRunId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
components.GetWorkflowRunResponseDto,
@@ -49,14 +51,19 @@ export function activityWorkflowRunsRetrieve(
| SDKValidationError
>
> {
- return new APIPromise($do(client, workflowRunId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ workflowRunId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
workflowRunId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -80,48 +87,53 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.ActivityControllerGetWorkflowRunRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.ActivityControllerGetWorkflowRunRequest$outboundSchema.parse(
+ value,
+ ),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- workflowRunId: encodeSimple('workflowRunId', payload.workflowRunId, {
+ workflowRunId: encodeSimple("workflowRunId", payload.workflowRunId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/activity/workflow-runs/{workflowRunId}')(pathParams);
-
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v1/activity/workflow-runs/{workflowRunId}")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'ActivityController_getWorkflowRun',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "ActivityController_getWorkflowRun",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -129,37 +141,34 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
- errorCodes: ['4XX', '5XX'],
+ errorCodes: ["4XX", "5XX"],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -175,12 +184,12 @@ async function $do(
| SDKValidationError
>(
M.json(200, components.GetWorkflowRunResponseDto$inboundSchema),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req);
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/cancel.ts b/libs/internal-sdk/src/funcs/cancel.ts
index def43e99543..76aec991ed7 100644
--- a/libs/internal-sdk/src/funcs/cancel.ts
+++ b/libs/internal-sdk/src/funcs/cancel.ts
@@ -2,28 +2,28 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Cancel triggered event
@@ -32,12 +32,14 @@ import { Result } from '../types/fp.js';
*
* Using a previously generated transactionId during the event trigger,
* will cancel any active or pending workflows. This is useful to cancel active digests, delays etc...
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function cancel(
client: NovuCore,
transactionId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.EventsControllerCancelResponse,
@@ -53,14 +55,19 @@ export function cancel(
| SDKValidationError
>
> {
- return new APIPromise($do(client, transactionId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ transactionId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
transactionId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -86,48 +93,49 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.EventsControllerCancelRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.EventsControllerCancelRequest$outboundSchema.parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- transactionId: encodeSimple('transactionId', payload.transactionId, {
+ transactionId: encodeSimple("transactionId", payload.transactionId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/events/trigger/{transactionId}')(pathParams);
+ const path = pathToFunc("/v1/events/trigger/{transactionId}")(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'EventsController_cancel',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "EventsController_cancel",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -135,53 +143,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'DELETE',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "DELETE",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -204,20 +209,24 @@ async function $do(
>(
M.json(200, operations.EventsControllerCancelResponse$inboundSchema, {
hdrs: true,
- key: 'Result',
+ key: "Result",
}),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/channelConnectionsCreate.ts b/libs/internal-sdk/src/funcs/channelConnectionsCreate.ts
index 6530cae7eef..0f9bd210cde 100644
--- a/libs/internal-sdk/src/funcs/channelConnectionsCreate.ts
+++ b/libs/internal-sdk/src/funcs/channelConnectionsCreate.ts
@@ -31,6 +31,8 @@ import { Result } from "../types/fp.js";
*
* @remarks
* Create a new channel connection for a resource for given integration. Only one channel connection is allowed per resource and integration.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function channelConnectionsCreate(
client: NovuCore,
@@ -120,7 +122,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/channelConnectionsDelete.ts b/libs/internal-sdk/src/funcs/channelConnectionsDelete.ts
index dde261e768f..c98d5fa7aeb 100644
--- a/libs/internal-sdk/src/funcs/channelConnectionsDelete.ts
+++ b/libs/internal-sdk/src/funcs/channelConnectionsDelete.ts
@@ -2,43 +2,46 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Delete a channel connection
*
* @remarks
* Delete a specific channel connection by its unique identifier.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function channelConnectionsDelete(
client: NovuCore,
identifier: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
- operations.ChannelConnectionsControllerDeleteChannelConnectionResponse | undefined,
+ | operations.ChannelConnectionsControllerDeleteChannelConnectionResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -51,18 +54,24 @@ export function channelConnectionsDelete(
| SDKValidationError
>
> {
- return new APIPromise($do(client, identifier, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ identifier,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
identifier: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
- operations.ChannelConnectionsControllerDeleteChannelConnectionResponse | undefined,
+ | operations.ChannelConnectionsControllerDeleteChannelConnectionResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -77,55 +86,59 @@ async function $do(
APICall,
]
> {
- const input: operations.ChannelConnectionsControllerDeleteChannelConnectionRequest = {
- identifier: identifier,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.ChannelConnectionsControllerDeleteChannelConnectionRequest = {
+ identifier: identifier,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.ChannelConnectionsControllerDeleteChannelConnectionRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .ChannelConnectionsControllerDeleteChannelConnectionRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- identifier: encodeSimple('identifier', payload.identifier, {
+ identifier: encodeSimple("identifier", payload.identifier, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/channel-connections/{identifier}')(pathParams);
+ const path = pathToFunc("/v1/channel-connections/{identifier}")(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'ChannelConnectionsController_deleteChannelConnection',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "ChannelConnectionsController_deleteChannelConnection",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -133,53 +146,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'DELETE',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "DELETE",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -188,7 +198,8 @@ async function $do(
};
const [result] = await M.match<
- operations.ChannelConnectionsControllerDeleteChannelConnectionResponse | undefined,
+ | operations.ChannelConnectionsControllerDeleteChannelConnectionResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -200,19 +211,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.nil(204, operations.ChannelConnectionsControllerDeleteChannelConnectionResponse$inboundSchema.optional()),
+ M.nil(
+ 204,
+ operations
+ .ChannelConnectionsControllerDeleteChannelConnectionResponse$inboundSchema
+ .optional(),
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/channelConnectionsList.ts b/libs/internal-sdk/src/funcs/channelConnectionsList.ts
index 8a98fb5987a..77873ad0473 100644
--- a/libs/internal-sdk/src/funcs/channelConnectionsList.ts
+++ b/libs/internal-sdk/src/funcs/channelConnectionsList.ts
@@ -30,6 +30,8 @@ import { Result } from "../types/fp.js";
*
* @remarks
* List all channel connections for a resource.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function channelConnectionsList(
client: NovuCore,
@@ -119,7 +121,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/channelConnectionsRetrieve.ts b/libs/internal-sdk/src/funcs/channelConnectionsRetrieve.ts
index 25879678d6e..959cb9f2e37 100644
--- a/libs/internal-sdk/src/funcs/channelConnectionsRetrieve.ts
+++ b/libs/internal-sdk/src/funcs/channelConnectionsRetrieve.ts
@@ -2,40 +2,42 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Retrieve a channel connection
*
* @remarks
* Retrieve a specific channel connection by its unique identifier.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function channelConnectionsRetrieve(
client: NovuCore,
identifier: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.ChannelConnectionsControllerGetChannelConnectionByIdentifierResponse,
@@ -51,14 +53,19 @@ export function channelConnectionsRetrieve(
| SDKValidationError
>
> {
- return new APIPromise($do(client, identifier, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ identifier,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
identifier: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -77,56 +84,61 @@ async function $do(
APICall,
]
> {
- const input: operations.ChannelConnectionsControllerGetChannelConnectionByIdentifierRequest = {
- identifier: identifier,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.ChannelConnectionsControllerGetChannelConnectionByIdentifierRequest =
+ {
+ identifier: identifier,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
(value) =>
- operations.ChannelConnectionsControllerGetChannelConnectionByIdentifierRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ operations
+ .ChannelConnectionsControllerGetChannelConnectionByIdentifierRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- identifier: encodeSimple('identifier', payload.identifier, {
+ identifier: encodeSimple("identifier", payload.identifier, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/channel-connections/{identifier}')(pathParams);
+ const path = pathToFunc("/v1/channel-connections/{identifier}")(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'ChannelConnectionsController_getChannelConnectionByIdentifier',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID:
+ "ChannelConnectionsController_getChannelConnectionByIdentifier",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -134,53 +146,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -201,22 +210,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.ChannelConnectionsControllerGetChannelConnectionByIdentifierResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .ChannelConnectionsControllerGetChannelConnectionByIdentifierResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/channelConnectionsUpdate.ts b/libs/internal-sdk/src/funcs/channelConnectionsUpdate.ts
index 840652ac204..8ab1ac91470 100644
--- a/libs/internal-sdk/src/funcs/channelConnectionsUpdate.ts
+++ b/libs/internal-sdk/src/funcs/channelConnectionsUpdate.ts
@@ -2,42 +2,45 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Update a channel connection
*
* @remarks
* Update an existing channel connection by its unique identifier.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function channelConnectionsUpdate(
client: NovuCore,
- updateChannelConnectionRequestDto: components.UpdateChannelConnectionRequestDto,
+ updateChannelConnectionRequestDto:
+ components.UpdateChannelConnectionRequestDto,
identifier: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.ChannelConnectionsControllerUpdateChannelConnectionResponse,
@@ -53,15 +56,22 @@ export function channelConnectionsUpdate(
| SDKValidationError
>
> {
- return new APIPromise($do(client, updateChannelConnectionRequestDto, identifier, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ updateChannelConnectionRequestDto,
+ identifier,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
- updateChannelConnectionRequestDto: components.UpdateChannelConnectionRequestDto,
+ updateChannelConnectionRequestDto:
+ components.UpdateChannelConnectionRequestDto,
identifier: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -80,59 +90,63 @@ async function $do(
APICall,
]
> {
- const input: operations.ChannelConnectionsControllerUpdateChannelConnectionRequest = {
- updateChannelConnectionRequestDto: updateChannelConnectionRequestDto,
- identifier: identifier,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.ChannelConnectionsControllerUpdateChannelConnectionRequest = {
+ updateChannelConnectionRequestDto: updateChannelConnectionRequestDto,
+ identifier: identifier,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.ChannelConnectionsControllerUpdateChannelConnectionRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .ChannelConnectionsControllerUpdateChannelConnectionRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.UpdateChannelConnectionRequestDto, {
+ const body = encodeJSON("body", payload.UpdateChannelConnectionRequestDto, {
explode: true,
});
const pathParams = {
- identifier: encodeSimple('identifier', payload.identifier, {
+ identifier: encodeSimple("identifier", payload.identifier, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/channel-connections/{identifier}')(pathParams);
+ const path = pathToFunc("/v1/channel-connections/{identifier}")(pathParams);
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'ChannelConnectionsController_updateChannelConnection',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "ChannelConnectionsController_updateChannelConnection",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -140,53 +154,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PATCH',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PATCH",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -207,22 +218,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.ChannelConnectionsControllerUpdateChannelConnectionResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .ChannelConnectionsControllerUpdateChannelConnectionResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/channelEndpointsCreate.ts b/libs/internal-sdk/src/funcs/channelEndpointsCreate.ts
index 8c817442d44..03d3cb11509 100644
--- a/libs/internal-sdk/src/funcs/channelEndpointsCreate.ts
+++ b/libs/internal-sdk/src/funcs/channelEndpointsCreate.ts
@@ -30,6 +30,8 @@ import { Result } from "../types/fp.js";
*
* @remarks
* Create a new channel endpoint for a resource.
+ *
+ * This operation requires one of {@link Security.bearerAuth}, {@link Security.secretKey}, or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function channelEndpointsCreate(
client: NovuCore,
@@ -117,7 +119,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/channelEndpointsDelete.ts b/libs/internal-sdk/src/funcs/channelEndpointsDelete.ts
index ce24a80a8c4..e32c152c4d5 100644
--- a/libs/internal-sdk/src/funcs/channelEndpointsDelete.ts
+++ b/libs/internal-sdk/src/funcs/channelEndpointsDelete.ts
@@ -2,43 +2,46 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Delete a channel endpoint
*
* @remarks
* Delete a specific channel endpoint by its unique identifier.
+ *
+ * This operation requires one of {@link Security.bearerAuth}, {@link Security.secretKey}, or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function channelEndpointsDelete(
client: NovuCore,
identifier: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
- operations.ChannelEndpointsControllerDeleteChannelEndpointResponse | undefined,
+ | operations.ChannelEndpointsControllerDeleteChannelEndpointResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -51,18 +54,24 @@ export function channelEndpointsDelete(
| SDKValidationError
>
> {
- return new APIPromise($do(client, identifier, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ identifier,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
identifier: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
- operations.ChannelEndpointsControllerDeleteChannelEndpointResponse | undefined,
+ | operations.ChannelEndpointsControllerDeleteChannelEndpointResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -77,55 +86,59 @@ async function $do(
APICall,
]
> {
- const input: operations.ChannelEndpointsControllerDeleteChannelEndpointRequest = {
- identifier: identifier,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.ChannelEndpointsControllerDeleteChannelEndpointRequest = {
+ identifier: identifier,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.ChannelEndpointsControllerDeleteChannelEndpointRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .ChannelEndpointsControllerDeleteChannelEndpointRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- identifier: encodeSimple('identifier', payload.identifier, {
+ identifier: encodeSimple("identifier", payload.identifier, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/channel-endpoints/{identifier}')(pathParams);
+ const path = pathToFunc("/v1/channel-endpoints/{identifier}")(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'ChannelEndpointsController_deleteChannelEndpoint',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "ChannelEndpointsController_deleteChannelEndpoint",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -133,53 +146,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'DELETE',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "DELETE",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -188,7 +198,8 @@ async function $do(
};
const [result] = await M.match<
- operations.ChannelEndpointsControllerDeleteChannelEndpointResponse | undefined,
+ | operations.ChannelEndpointsControllerDeleteChannelEndpointResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -200,19 +211,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.nil(204, operations.ChannelEndpointsControllerDeleteChannelEndpointResponse$inboundSchema.optional()),
+ M.nil(
+ 204,
+ operations
+ .ChannelEndpointsControllerDeleteChannelEndpointResponse$inboundSchema
+ .optional(),
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/channelEndpointsList.ts b/libs/internal-sdk/src/funcs/channelEndpointsList.ts
index de4d4a482c7..661b33eb607 100644
--- a/libs/internal-sdk/src/funcs/channelEndpointsList.ts
+++ b/libs/internal-sdk/src/funcs/channelEndpointsList.ts
@@ -30,6 +30,8 @@ import { Result } from "../types/fp.js";
*
* @remarks
* List all channel endpoints for a resource based on query filters.
+ *
+ * This operation requires one of {@link Security.bearerAuth}, {@link Security.secretKey}, or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function channelEndpointsList(
client: NovuCore,
@@ -120,7 +122,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/channelEndpointsRetrieve.ts b/libs/internal-sdk/src/funcs/channelEndpointsRetrieve.ts
index 6f65f3b78d2..6bd84c018d4 100644
--- a/libs/internal-sdk/src/funcs/channelEndpointsRetrieve.ts
+++ b/libs/internal-sdk/src/funcs/channelEndpointsRetrieve.ts
@@ -2,40 +2,42 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Retrieve a channel endpoint
*
* @remarks
* Retrieve a specific channel endpoint by its unique identifier.
+ *
+ * This operation requires one of {@link Security.bearerAuth}, {@link Security.secretKey}, or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function channelEndpointsRetrieve(
client: NovuCore,
identifier: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.ChannelEndpointsControllerGetChannelEndpointResponse,
@@ -51,14 +53,19 @@ export function channelEndpointsRetrieve(
| SDKValidationError
>
> {
- return new APIPromise($do(client, identifier, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ identifier,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
identifier: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -77,55 +84,59 @@ async function $do(
APICall,
]
> {
- const input: operations.ChannelEndpointsControllerGetChannelEndpointRequest = {
- identifier: identifier,
- idempotencyKey: idempotencyKey,
- };
+ const input: operations.ChannelEndpointsControllerGetChannelEndpointRequest =
+ {
+ identifier: identifier,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.ChannelEndpointsControllerGetChannelEndpointRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .ChannelEndpointsControllerGetChannelEndpointRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- identifier: encodeSimple('identifier', payload.identifier, {
+ identifier: encodeSimple("identifier", payload.identifier, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/channel-endpoints/{identifier}')(pathParams);
+ const path = pathToFunc("/v1/channel-endpoints/{identifier}")(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'ChannelEndpointsController_getChannelEndpoint',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "ChannelEndpointsController_getChannelEndpoint",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -133,53 +144,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -200,22 +208,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.ChannelEndpointsControllerGetChannelEndpointResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .ChannelEndpointsControllerGetChannelEndpointResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/channelEndpointsUpdate.ts b/libs/internal-sdk/src/funcs/channelEndpointsUpdate.ts
index 18674c5ebe3..5349b76b03e 100644
--- a/libs/internal-sdk/src/funcs/channelEndpointsUpdate.ts
+++ b/libs/internal-sdk/src/funcs/channelEndpointsUpdate.ts
@@ -2,42 +2,44 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Update a channel endpoint
*
* @remarks
* Update an existing channel endpoint by its unique identifier.
+ *
+ * This operation requires one of {@link Security.bearerAuth}, {@link Security.secretKey}, or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function channelEndpointsUpdate(
client: NovuCore,
updateChannelEndpointRequestDto: components.UpdateChannelEndpointRequestDto,
identifier: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.ChannelEndpointsControllerUpdateChannelEndpointResponse,
@@ -53,7 +55,13 @@ export function channelEndpointsUpdate(
| SDKValidationError
>
> {
- return new APIPromise($do(client, updateChannelEndpointRequestDto, identifier, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ updateChannelEndpointRequestDto,
+ identifier,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -61,7 +69,7 @@ async function $do(
updateChannelEndpointRequestDto: components.UpdateChannelEndpointRequestDto,
identifier: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -80,59 +88,63 @@ async function $do(
APICall,
]
> {
- const input: operations.ChannelEndpointsControllerUpdateChannelEndpointRequest = {
- updateChannelEndpointRequestDto: updateChannelEndpointRequestDto,
- identifier: identifier,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.ChannelEndpointsControllerUpdateChannelEndpointRequest = {
+ updateChannelEndpointRequestDto: updateChannelEndpointRequestDto,
+ identifier: identifier,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.ChannelEndpointsControllerUpdateChannelEndpointRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .ChannelEndpointsControllerUpdateChannelEndpointRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.UpdateChannelEndpointRequestDto, {
+ const body = encodeJSON("body", payload.UpdateChannelEndpointRequestDto, {
explode: true,
});
const pathParams = {
- identifier: encodeSimple('identifier', payload.identifier, {
+ identifier: encodeSimple("identifier", payload.identifier, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/channel-endpoints/{identifier}')(pathParams);
+ const path = pathToFunc("/v1/channel-endpoints/{identifier}")(pathParams);
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'ChannelEndpointsController_updateChannelEndpoint',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "ChannelEndpointsController_updateChannelEndpoint",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -140,53 +152,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PATCH',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PATCH",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -207,22 +216,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.ChannelEndpointsControllerUpdateChannelEndpointResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .ChannelEndpointsControllerUpdateChannelEndpointResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/contextsCreate.ts b/libs/internal-sdk/src/funcs/contextsCreate.ts
index 51af7c71d50..d35215c8cc7 100644
--- a/libs/internal-sdk/src/funcs/contextsCreate.ts
+++ b/libs/internal-sdk/src/funcs/contextsCreate.ts
@@ -32,6 +32,8 @@ import { Result } from "../types/fp.js";
* @remarks
* Create a new context with the specified type, id, and data. Returns 409 if context already exists.
* **type** and **id** are required fields, **data** is optional, if the context already exists, it returns the 409 response
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function contextsCreate(
client: NovuCore,
@@ -118,7 +120,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/contextsDelete.ts b/libs/internal-sdk/src/funcs/contextsDelete.ts
index 87a5c69fd31..7fc1729b7fc 100644
--- a/libs/internal-sdk/src/funcs/contextsDelete.ts
+++ b/libs/internal-sdk/src/funcs/contextsDelete.ts
@@ -2,28 +2,28 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Delete a context
@@ -31,13 +31,15 @@ import { Result } from '../types/fp.js';
* @remarks
* Delete a context by its type and id.
* **type** and **id** are required fields, if the context does not exist, it returns the 404 response
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function contextsDelete(
client: NovuCore,
type: string,
id: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.ContextsControllerDeleteContextResponse | undefined,
@@ -53,7 +55,13 @@ export function contextsDelete(
| SDKValidationError
>
> {
- return new APIPromise($do(client, type, id, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ type,
+ id,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -61,7 +69,7 @@ async function $do(
type: string,
id: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -88,52 +96,55 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.ContextsControllerDeleteContextRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.ContextsControllerDeleteContextRequest$outboundSchema.parse(
+ value,
+ ),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- id: encodeSimple('id', payload.id, {
+ id: encodeSimple("id", payload.id, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- type: encodeSimple('type', payload.type, {
+ type: encodeSimple("type", payload.type, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/contexts/{type}/{id}')(pathParams);
+ const path = pathToFunc("/v2/contexts/{type}/{id}")(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'ContextsController_deleteContext',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "ContextsController_deleteContext",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -141,53 +152,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'DELETE',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "DELETE",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -208,19 +216,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.nil(204, operations.ContextsControllerDeleteContextResponse$inboundSchema.optional()),
+ M.nil(
+ 204,
+ operations.ContextsControllerDeleteContextResponse$inboundSchema
+ .optional(),
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/contextsList.ts b/libs/internal-sdk/src/funcs/contextsList.ts
index fab148ce7ad..2411ff6826f 100644
--- a/libs/internal-sdk/src/funcs/contextsList.ts
+++ b/libs/internal-sdk/src/funcs/contextsList.ts
@@ -33,6 +33,8 @@ import { Result } from "../types/fp.js";
* **type** and **id** are optional fields, if provided, only contexts with the matching type and id will be returned.
* **search** is an optional field, if provided, only contexts with the matching key pattern will be returned.
* Checkout all possible parameters in the query section below for more details
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function contextsList(
client: NovuCore,
@@ -120,7 +122,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/contextsRetrieve.ts b/libs/internal-sdk/src/funcs/contextsRetrieve.ts
index 3ef6ef877a8..15fbca52c48 100644
--- a/libs/internal-sdk/src/funcs/contextsRetrieve.ts
+++ b/libs/internal-sdk/src/funcs/contextsRetrieve.ts
@@ -2,28 +2,28 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Retrieve a context
@@ -31,13 +31,15 @@ import { Result } from '../types/fp.js';
* @remarks
* Retrieve a specific context by its type and id.
* **type** and **id** are required fields, if the context does not exist, it returns the 404 response
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function contextsRetrieve(
client: NovuCore,
type: string,
id: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.ContextsControllerGetContextResponse,
@@ -53,7 +55,13 @@ export function contextsRetrieve(
| SDKValidationError
>
> {
- return new APIPromise($do(client, type, id, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ type,
+ id,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -61,7 +69,7 @@ async function $do(
type: string,
id: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -88,52 +96,55 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.ContextsControllerGetContextRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.ContextsControllerGetContextRequest$outboundSchema.parse(
+ value,
+ ),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- id: encodeSimple('id', payload.id, {
+ id: encodeSimple("id", payload.id, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- type: encodeSimple('type', payload.type, {
+ type: encodeSimple("type", payload.type, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/contexts/{type}/{id}')(pathParams);
+ const path = pathToFunc("/v2/contexts/{type}/{id}")(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'ContextsController_getContext',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "ContextsController_getContext",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -141,53 +152,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -210,20 +218,24 @@ async function $do(
>(
M.json(200, operations.ContextsControllerGetContextResponse$inboundSchema, {
hdrs: true,
- key: 'Result',
+ key: "Result",
}),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/contextsUpdate.ts b/libs/internal-sdk/src/funcs/contextsUpdate.ts
index 7573cbbc26a..0e48619043a 100644
--- a/libs/internal-sdk/src/funcs/contextsUpdate.ts
+++ b/libs/internal-sdk/src/funcs/contextsUpdate.ts
@@ -2,28 +2,28 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Update a context
@@ -32,11 +32,13 @@ import { Result } from '../types/fp.js';
* Update the data of an existing context.
* **type** and **id** are required fields, **data** is required. Only the data field is updated, the rest of the context is not affected.
* If the context does not exist, it returns the 404 response
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function contextsUpdate(
client: NovuCore,
request: operations.ContextsControllerUpdateContextRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.ContextsControllerUpdateContextResponse,
@@ -52,13 +54,17 @@ export function contextsUpdate(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.ContextsControllerUpdateContextRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -79,55 +85,58 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.ContextsControllerUpdateContextRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.ContextsControllerUpdateContextRequest$outboundSchema.parse(
+ value,
+ ),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.UpdateContextRequestDto, {
+ const body = encodeJSON("body", payload.UpdateContextRequestDto, {
explode: true,
});
const pathParams = {
- id: encodeSimple('id', payload.id, {
+ id: encodeSimple("id", payload.id, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- type: encodeSimple('type', payload.type, {
+ type: encodeSimple("type", payload.type, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/contexts/{type}/{id}')(pathParams);
+ const path = pathToFunc("/v2/contexts/{type}/{id}")(pathParams);
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'ContextsController_updateContext',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "ContextsController_updateContext",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -135,53 +144,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PATCH',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PATCH",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -202,19 +208,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.ContextsControllerUpdateContextResponse$inboundSchema, { hdrs: true, key: 'Result' }),
+ M.json(
+ 200,
+ operations.ContextsControllerUpdateContextResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/environmentVariablesCreate.ts b/libs/internal-sdk/src/funcs/environmentVariablesCreate.ts
index 19d5b98bb92..e1617cb501a 100644
--- a/libs/internal-sdk/src/funcs/environmentVariablesCreate.ts
+++ b/libs/internal-sdk/src/funcs/environmentVariablesCreate.ts
@@ -2,41 +2,44 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
- * Create environment variable
+ * Create a variable
*
* @remarks
* Creates a new environment variable. Keys must be uppercase with underscores only (e.g. BASE_URL). Secret variables are encrypted at rest and masked in API responses.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function environmentVariablesCreate(
client: NovuCore,
- createEnvironmentVariableRequestDto: components.CreateEnvironmentVariableRequestDto,
+ createEnvironmentVariableRequestDto:
+ components.CreateEnvironmentVariableRequestDto,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.EnvironmentVariablesControllerCreateEnvironmentVariableResponse,
@@ -52,14 +55,20 @@ export function environmentVariablesCreate(
| SDKValidationError
>
> {
- return new APIPromise($do(client, createEnvironmentVariableRequestDto, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ createEnvironmentVariableRequestDto,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
- createEnvironmentVariableRequestDto: components.CreateEnvironmentVariableRequestDto,
+ createEnvironmentVariableRequestDto:
+ components.CreateEnvironmentVariableRequestDto,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -78,52 +87,58 @@ async function $do(
APICall,
]
> {
- const input: operations.EnvironmentVariablesControllerCreateEnvironmentVariableRequest = {
- createEnvironmentVariableRequestDto: createEnvironmentVariableRequestDto,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.EnvironmentVariablesControllerCreateEnvironmentVariableRequest =
+ {
+ createEnvironmentVariableRequestDto:
+ createEnvironmentVariableRequestDto,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.EnvironmentVariablesControllerCreateEnvironmentVariableRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .EnvironmentVariablesControllerCreateEnvironmentVariableRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.CreateEnvironmentVariableRequestDto, {
+ const body = encodeJSON("body", payload.CreateEnvironmentVariableRequestDto, {
explode: true,
});
- const path = pathToFunc('/v1/environment-variables')();
+ const path = pathToFunc("/v1/environment-variables")();
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'EnvironmentVariablesController_createEnvironmentVariable',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "EnvironmentVariablesController_createEnvironmentVariable",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -131,53 +146,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'POST',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "POST",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -198,22 +210,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.EnvironmentVariablesControllerCreateEnvironmentVariableResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .EnvironmentVariablesControllerCreateEnvironmentVariableResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail([409, 429]),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/environmentVariablesDelete.ts b/libs/internal-sdk/src/funcs/environmentVariablesDelete.ts
index 042cc95b92d..649a03cd937 100644
--- a/libs/internal-sdk/src/funcs/environmentVariablesDelete.ts
+++ b/libs/internal-sdk/src/funcs/environmentVariablesDelete.ts
@@ -2,43 +2,46 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Delete environment variable
*
* @remarks
- * Deletes an environment variable by id.
+ * Deletes an environment variable by key.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function environmentVariablesDelete(
client: NovuCore,
- variableId: string,
+ variableKey: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
- operations.EnvironmentVariablesControllerDeleteEnvironmentVariableResponse | undefined,
+ | operations.EnvironmentVariablesControllerDeleteEnvironmentVariableResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -51,18 +54,24 @@ export function environmentVariablesDelete(
| SDKValidationError
>
> {
- return new APIPromise($do(client, variableId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ variableKey,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
- variableId: string,
+ variableKey: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
- operations.EnvironmentVariablesControllerDeleteEnvironmentVariableResponse | undefined,
+ | operations.EnvironmentVariablesControllerDeleteEnvironmentVariableResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -77,55 +86,62 @@ async function $do(
APICall,
]
> {
- const input: operations.EnvironmentVariablesControllerDeleteEnvironmentVariableRequest = {
- variableId: variableId,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.EnvironmentVariablesControllerDeleteEnvironmentVariableRequest =
+ {
+ variableKey: variableKey,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.EnvironmentVariablesControllerDeleteEnvironmentVariableRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .EnvironmentVariablesControllerDeleteEnvironmentVariableRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- variableId: encodeSimple('variableId', payload.variableId, {
+ variableKey: encodeSimple("variableKey", payload.variableKey, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/environment-variables/{variableId}')(pathParams);
-
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v1/environment-variables/{variableKey}")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'EnvironmentVariablesController_deleteEnvironmentVariable',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "EnvironmentVariablesController_deleteEnvironmentVariable",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -133,53 +149,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'DELETE',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "DELETE",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -188,7 +201,8 @@ async function $do(
};
const [result] = await M.match<
- operations.EnvironmentVariablesControllerDeleteEnvironmentVariableResponse | undefined,
+ | operations.EnvironmentVariablesControllerDeleteEnvironmentVariableResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -200,21 +214,29 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.nil(204, operations.EnvironmentVariablesControllerDeleteEnvironmentVariableResponse$inboundSchema.optional(), {
- hdrs: true,
- }),
+ M.nil(
+ 204,
+ operations
+ .EnvironmentVariablesControllerDeleteEnvironmentVariableResponse$inboundSchema
+ .optional(),
+ { hdrs: true },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail([404, 429]),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/environmentVariablesList.ts b/libs/internal-sdk/src/funcs/environmentVariablesList.ts
index dd146fa4dbe..b46307a1b04 100644
--- a/libs/internal-sdk/src/funcs/environmentVariablesList.ts
+++ b/libs/internal-sdk/src/funcs/environmentVariablesList.ts
@@ -2,40 +2,42 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeFormQuery, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
- * List environment variables
+ * List all variables
*
* @remarks
* Returns all environment variables for the current organization. Secret values are masked.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function environmentVariablesList(
client: NovuCore,
search?: string | undefined,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.EnvironmentVariablesControllerListEnvironmentVariablesResponse,
@@ -51,14 +53,19 @@ export function environmentVariablesList(
| SDKValidationError
>
> {
- return new APIPromise($do(client, search, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ search,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
search?: string | undefined,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -77,53 +84,57 @@ async function $do(
APICall,
]
> {
- const input: operations.EnvironmentVariablesControllerListEnvironmentVariablesRequest = {
- search: search,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.EnvironmentVariablesControllerListEnvironmentVariablesRequest = {
+ search: search,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.EnvironmentVariablesControllerListEnvironmentVariablesRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .EnvironmentVariablesControllerListEnvironmentVariablesRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
- const path = pathToFunc('/v1/environment-variables')();
+ const path = pathToFunc("/v1/environment-variables")();
const query = encodeFormQuery({
- search: payload.search,
+ "search": payload.search,
});
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'EnvironmentVariablesController_listEnvironmentVariables',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "EnvironmentVariablesController_listEnvironmentVariables",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -131,54 +142,51 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- query: query,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ query: query,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -199,22 +207,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.EnvironmentVariablesControllerListEnvironmentVariablesResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .EnvironmentVariablesControllerListEnvironmentVariablesResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/environmentVariablesRetrieve.ts b/libs/internal-sdk/src/funcs/environmentVariablesRetrieve.ts
index dfb891fb377..454fe22ba31 100644
--- a/libs/internal-sdk/src/funcs/environmentVariablesRetrieve.ts
+++ b/libs/internal-sdk/src/funcs/environmentVariablesRetrieve.ts
@@ -2,40 +2,42 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Get environment variable
*
* @remarks
- * Returns a single environment variable by id. Secret values are masked.
+ * Returns a single environment variable by key. Secret values are masked.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function environmentVariablesRetrieve(
client: NovuCore,
- variableId: string,
+ variableKey: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.EnvironmentVariablesControllerGetEnvironmentVariableResponse,
@@ -51,14 +53,19 @@ export function environmentVariablesRetrieve(
| SDKValidationError
>
> {
- return new APIPromise($do(client, variableId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ variableKey,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
- variableId: string,
+ variableKey: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -77,55 +84,61 @@ async function $do(
APICall,
]
> {
- const input: operations.EnvironmentVariablesControllerGetEnvironmentVariableRequest = {
- variableId: variableId,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.EnvironmentVariablesControllerGetEnvironmentVariableRequest = {
+ variableKey: variableKey,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.EnvironmentVariablesControllerGetEnvironmentVariableRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .EnvironmentVariablesControllerGetEnvironmentVariableRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- variableId: encodeSimple('variableId', payload.variableId, {
+ variableKey: encodeSimple("variableKey", payload.variableKey, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/environment-variables/{variableId}')(pathParams);
-
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v1/environment-variables/{variableKey}")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'EnvironmentVariablesController_getEnvironmentVariable',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "EnvironmentVariablesController_getEnvironmentVariable",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -133,53 +146,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -200,22 +210,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.EnvironmentVariablesControllerGetEnvironmentVariableResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .EnvironmentVariablesControllerGetEnvironmentVariableResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail([404, 429]),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/environmentVariablesUpdate.ts b/libs/internal-sdk/src/funcs/environmentVariablesUpdate.ts
index 4a3bc10492a..58d752caffc 100644
--- a/libs/internal-sdk/src/funcs/environmentVariablesUpdate.ts
+++ b/libs/internal-sdk/src/funcs/environmentVariablesUpdate.ts
@@ -2,42 +2,45 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
- * Update environment variable
+ * Update a variable
*
* @remarks
* Updates an existing environment variable. Providing values replaces all existing per-environment values.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function environmentVariablesUpdate(
client: NovuCore,
- updateEnvironmentVariableRequestDto: components.UpdateEnvironmentVariableRequestDto,
- variableId: string,
+ updateEnvironmentVariableRequestDto:
+ components.UpdateEnvironmentVariableRequestDto,
+ variableKey: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.EnvironmentVariablesControllerUpdateEnvironmentVariableResponse,
@@ -53,15 +56,22 @@ export function environmentVariablesUpdate(
| SDKValidationError
>
> {
- return new APIPromise($do(client, updateEnvironmentVariableRequestDto, variableId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ updateEnvironmentVariableRequestDto,
+ variableKey,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
- updateEnvironmentVariableRequestDto: components.UpdateEnvironmentVariableRequestDto,
- variableId: string,
+ updateEnvironmentVariableRequestDto:
+ components.UpdateEnvironmentVariableRequestDto,
+ variableKey: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -80,59 +90,67 @@ async function $do(
APICall,
]
> {
- const input: operations.EnvironmentVariablesControllerUpdateEnvironmentVariableRequest = {
- updateEnvironmentVariableRequestDto: updateEnvironmentVariableRequestDto,
- variableId: variableId,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.EnvironmentVariablesControllerUpdateEnvironmentVariableRequest =
+ {
+ updateEnvironmentVariableRequestDto:
+ updateEnvironmentVariableRequestDto,
+ variableKey: variableKey,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.EnvironmentVariablesControllerUpdateEnvironmentVariableRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .EnvironmentVariablesControllerUpdateEnvironmentVariableRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.UpdateEnvironmentVariableRequestDto, {
+ const body = encodeJSON("body", payload.UpdateEnvironmentVariableRequestDto, {
explode: true,
});
const pathParams = {
- variableId: encodeSimple('variableId', payload.variableId, {
+ variableKey: encodeSimple("variableKey", payload.variableKey, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/environment-variables/{variableId}')(pathParams);
-
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v1/environment-variables/{variableKey}")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'EnvironmentVariablesController_updateEnvironmentVariable',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "EnvironmentVariablesController_updateEnvironmentVariable",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -140,53 +158,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PATCH',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PATCH",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -207,22 +222,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.EnvironmentVariablesControllerUpdateEnvironmentVariableResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .EnvironmentVariablesControllerUpdateEnvironmentVariableResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail([404, 429]),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/environmentVariablesUsage.ts b/libs/internal-sdk/src/funcs/environmentVariablesUsage.ts
index f6280f48625..fad5f5696ab 100644
--- a/libs/internal-sdk/src/funcs/environmentVariablesUsage.ts
+++ b/libs/internal-sdk/src/funcs/environmentVariablesUsage.ts
@@ -2,40 +2,42 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
- * Get environment variable usage
+ * Retrieve a variable usage
*
* @remarks
- * Returns the workflows that reference this environment variable via {{env.KEY}} in their step controls.
+ * Returns the workflows that reference this environment variable via `{{env.KEY}}` in their step controls. **variableId** is required.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function environmentVariablesUsage(
client: NovuCore,
- variableId: string,
+ variableKey: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.EnvironmentVariablesControllerGetEnvironmentVariableUsageResponse,
@@ -51,14 +53,19 @@ export function environmentVariablesUsage(
| SDKValidationError
>
> {
- return new APIPromise($do(client, variableId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ variableKey,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
- variableId: string,
+ variableKey: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -77,55 +84,62 @@ async function $do(
APICall,
]
> {
- const input: operations.EnvironmentVariablesControllerGetEnvironmentVariableUsageRequest = {
- variableId: variableId,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.EnvironmentVariablesControllerGetEnvironmentVariableUsageRequest =
+ {
+ variableKey: variableKey,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.EnvironmentVariablesControllerGetEnvironmentVariableUsageRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .EnvironmentVariablesControllerGetEnvironmentVariableUsageRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- variableId: encodeSimple('variableId', payload.variableId, {
+ variableKey: encodeSimple("variableKey", payload.variableKey, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/environment-variables/{variableId}/usage')(pathParams);
-
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v1/environment-variables/{variableKey}/usage")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'EnvironmentVariablesController_getEnvironmentVariableUsage',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "EnvironmentVariablesController_getEnvironmentVariableUsage",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -133,53 +147,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -200,22 +211,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.EnvironmentVariablesControllerGetEnvironmentVariableUsageResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .EnvironmentVariablesControllerGetEnvironmentVariableUsageResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail([404, 429]),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/environmentsCreate.ts b/libs/internal-sdk/src/funcs/environmentsCreate.ts
index 7690dbb180d..b0c2b0d944c 100644
--- a/libs/internal-sdk/src/funcs/environmentsCreate.ts
+++ b/libs/internal-sdk/src/funcs/environmentsCreate.ts
@@ -33,6 +33,8 @@ import { Result } from "../types/fp.js";
* Creates a new environment within the current organization.
* Environments allow you to manage different stages of your application development lifecycle.
* Each environment has its own set of API keys and configurations.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function environmentsCreate(
client: NovuCore,
@@ -118,7 +120,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/environmentsDelete.ts b/libs/internal-sdk/src/funcs/environmentsDelete.ts
index 26c5f6459d7..7b75ce15f1a 100644
--- a/libs/internal-sdk/src/funcs/environmentsDelete.ts
+++ b/libs/internal-sdk/src/funcs/environmentsDelete.ts
@@ -2,28 +2,28 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Delete an environment
@@ -31,12 +31,14 @@ import { Result } from '../types/fp.js';
* @remarks
* Delete an environment by its unique identifier **environmentId**.
* This action is irreversible and will remove the environment and all its associated data.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function environmentsDelete(
client: NovuCore,
environmentId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.EnvironmentsControllerV1DeleteEnvironmentResponse | undefined,
@@ -52,14 +54,19 @@ export function environmentsDelete(
| SDKValidationError
>
> {
- return new APIPromise($do(client, environmentId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ environmentId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
environmentId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -85,48 +92,50 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.EnvironmentsControllerV1DeleteEnvironmentRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.EnvironmentsControllerV1DeleteEnvironmentRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- environmentId: encodeSimple('environmentId', payload.environmentId, {
+ environmentId: encodeSimple("environmentId", payload.environmentId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/environments/{environmentId}')(pathParams);
+ const path = pathToFunc("/v1/environments/{environmentId}")(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'EnvironmentsControllerV1_deleteEnvironment',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "EnvironmentsControllerV1_deleteEnvironment",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -134,53 +143,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'DELETE',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "DELETE",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -201,19 +207,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.nil(200, operations.EnvironmentsControllerV1DeleteEnvironmentResponse$inboundSchema.optional()),
+ M.nil(
+ 200,
+ operations.EnvironmentsControllerV1DeleteEnvironmentResponse$inboundSchema
+ .optional(),
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/environmentsDiff.ts b/libs/internal-sdk/src/funcs/environmentsDiff.ts
index 5c6ec597552..c4e2b387776 100644
--- a/libs/internal-sdk/src/funcs/environmentsDiff.ts
+++ b/libs/internal-sdk/src/funcs/environmentsDiff.ts
@@ -2,42 +2,44 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Compare resources between environments
*
* @remarks
* Compares workflows and other resources between the source and target environments, returning detailed diff information including additions, modifications, and deletions.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function environmentsDiff(
client: NovuCore,
diffEnvironmentRequestDto: components.DiffEnvironmentRequestDto,
targetEnvironmentId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.EnvironmentsControllerDiffEnvironmentResponse,
@@ -53,7 +55,13 @@ export function environmentsDiff(
| SDKValidationError
>
> {
- return new APIPromise($do(client, diffEnvironmentRequestDto, targetEnvironmentId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ diffEnvironmentRequestDto,
+ targetEnvironmentId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -61,7 +69,7 @@ async function $do(
diffEnvironmentRequestDto: components.DiffEnvironmentRequestDto,
targetEnvironmentId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -88,51 +96,56 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.EnvironmentsControllerDiffEnvironmentRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.EnvironmentsControllerDiffEnvironmentRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.DiffEnvironmentRequestDto, {
+ const body = encodeJSON("body", payload.DiffEnvironmentRequestDto, {
explode: true,
});
const pathParams = {
- targetEnvironmentId: encodeSimple('targetEnvironmentId', payload.targetEnvironmentId, {
- explode: false,
- charEncoding: 'percent',
- }),
+ targetEnvironmentId: encodeSimple(
+ "targetEnvironmentId",
+ payload.targetEnvironmentId,
+ { explode: false, charEncoding: "percent" },
+ ),
};
- const path = pathToFunc('/v2/environments/{targetEnvironmentId}/diff')(pathParams);
-
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v2/environments/{targetEnvironmentId}/diff")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'EnvironmentsController_diffEnvironment',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "EnvironmentsController_diffEnvironment",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -140,53 +153,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'POST',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "POST",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -207,19 +217,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.EnvironmentsControllerDiffEnvironmentResponse$inboundSchema, { hdrs: true, key: 'Result' }),
+ M.json(
+ 200,
+ operations.EnvironmentsControllerDiffEnvironmentResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/environmentsGetTags.ts b/libs/internal-sdk/src/funcs/environmentsGetTags.ts
index ee450cfdb2b..d0d7cf26f22 100644
--- a/libs/internal-sdk/src/funcs/environmentsGetTags.ts
+++ b/libs/internal-sdk/src/funcs/environmentsGetTags.ts
@@ -2,40 +2,42 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* List environment tags
*
* @remarks
* Retrieve all unique tags used in workflows within the specified environment. These tags can be used for filtering workflows.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function environmentsGetTags(
client: NovuCore,
environmentId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.EnvironmentsControllerGetEnvironmentTagsResponse,
@@ -51,14 +53,19 @@ export function environmentsGetTags(
| SDKValidationError
>
> {
- return new APIPromise($do(client, environmentId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ environmentId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
environmentId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -84,48 +91,50 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.EnvironmentsControllerGetEnvironmentTagsRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.EnvironmentsControllerGetEnvironmentTagsRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- environmentId: encodeSimple('environmentId', payload.environmentId, {
+ environmentId: encodeSimple("environmentId", payload.environmentId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/environments/{environmentId}/tags')(pathParams);
+ const path = pathToFunc("/v2/environments/{environmentId}/tags")(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'EnvironmentsController_getEnvironmentTags',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "EnvironmentsController_getEnvironmentTags",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -133,53 +142,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -200,22 +206,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.EnvironmentsControllerGetEnvironmentTagsResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations.EnvironmentsControllerGetEnvironmentTagsResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/environmentsList.ts b/libs/internal-sdk/src/funcs/environmentsList.ts
index c15b45277f4..decdf6ab3b1 100644
--- a/libs/internal-sdk/src/funcs/environmentsList.ts
+++ b/libs/internal-sdk/src/funcs/environmentsList.ts
@@ -31,6 +31,8 @@ import { Result } from "../types/fp.js";
* @remarks
* This API returns a list of environments for the current organization.
* Each environment contains its configuration, API keys (if user has access), and metadata.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function environmentsList(
client: NovuCore,
@@ -111,7 +113,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/environmentsPublish.ts b/libs/internal-sdk/src/funcs/environmentsPublish.ts
index ed797565d38..50de6417a88 100644
--- a/libs/internal-sdk/src/funcs/environmentsPublish.ts
+++ b/libs/internal-sdk/src/funcs/environmentsPublish.ts
@@ -2,42 +2,44 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Publish resources to target environment
*
* @remarks
* Publishes all workflows and resources from the source environment to the target environment. Optionally specify specific resources to publish or use dryRun mode to preview changes.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function environmentsPublish(
client: NovuCore,
publishEnvironmentRequestDto: components.PublishEnvironmentRequestDto,
targetEnvironmentId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.EnvironmentsControllerPublishEnvironmentResponse,
@@ -53,7 +55,13 @@ export function environmentsPublish(
| SDKValidationError
>
> {
- return new APIPromise($do(client, publishEnvironmentRequestDto, targetEnvironmentId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ publishEnvironmentRequestDto,
+ targetEnvironmentId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -61,7 +69,7 @@ async function $do(
publishEnvironmentRequestDto: components.PublishEnvironmentRequestDto,
targetEnvironmentId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -88,51 +96,56 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.EnvironmentsControllerPublishEnvironmentRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.EnvironmentsControllerPublishEnvironmentRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.PublishEnvironmentRequestDto, {
+ const body = encodeJSON("body", payload.PublishEnvironmentRequestDto, {
explode: true,
});
const pathParams = {
- targetEnvironmentId: encodeSimple('targetEnvironmentId', payload.targetEnvironmentId, {
- explode: false,
- charEncoding: 'percent',
- }),
+ targetEnvironmentId: encodeSimple(
+ "targetEnvironmentId",
+ payload.targetEnvironmentId,
+ { explode: false, charEncoding: "percent" },
+ ),
};
- const path = pathToFunc('/v2/environments/{targetEnvironmentId}/publish')(pathParams);
-
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v2/environments/{targetEnvironmentId}/publish")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'EnvironmentsController_publishEnvironment',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "EnvironmentsController_publishEnvironment",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -140,53 +153,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'POST',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "POST",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -207,22 +217,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.EnvironmentsControllerPublishEnvironmentResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations.EnvironmentsControllerPublishEnvironmentResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/environmentsUpdate.ts b/libs/internal-sdk/src/funcs/environmentsUpdate.ts
index 145ca6dad86..f544a38fc51 100644
--- a/libs/internal-sdk/src/funcs/environmentsUpdate.ts
+++ b/libs/internal-sdk/src/funcs/environmentsUpdate.ts
@@ -2,29 +2,29 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Update an environment
@@ -32,13 +32,15 @@ import { Result } from '../types/fp.js';
* @remarks
* Update an environment by its unique identifier **environmentId**.
* You can modify the environment name, identifier, color, and other configuration settings.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function environmentsUpdate(
client: NovuCore,
updateEnvironmentRequestDto: components.UpdateEnvironmentRequestDto,
environmentId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.EnvironmentsControllerV1UpdateMyEnvironmentResponse,
@@ -54,7 +56,13 @@ export function environmentsUpdate(
| SDKValidationError
>
> {
- return new APIPromise($do(client, updateEnvironmentRequestDto, environmentId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ updateEnvironmentRequestDto,
+ environmentId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -62,7 +70,7 @@ async function $do(
updateEnvironmentRequestDto: components.UpdateEnvironmentRequestDto,
environmentId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -89,51 +97,54 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.EnvironmentsControllerV1UpdateMyEnvironmentRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .EnvironmentsControllerV1UpdateMyEnvironmentRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.UpdateEnvironmentRequestDto, {
+ const body = encodeJSON("body", payload.UpdateEnvironmentRequestDto, {
explode: true,
});
const pathParams = {
- environmentId: encodeSimple('environmentId', payload.environmentId, {
+ environmentId: encodeSimple("environmentId", payload.environmentId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/environments/{environmentId}')(pathParams);
+ const path = pathToFunc("/v1/environments/{environmentId}")(pathParams);
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'EnvironmentsControllerV1_updateMyEnvironment',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "EnvironmentsControllerV1_updateMyEnvironment",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -141,53 +152,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PUT',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PUT",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -208,22 +216,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.EnvironmentsControllerV1UpdateMyEnvironmentResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .EnvironmentsControllerV1UpdateMyEnvironmentResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/integrationsCreate.ts b/libs/internal-sdk/src/funcs/integrationsCreate.ts
index 01cab1665c6..de126582a7b 100644
--- a/libs/internal-sdk/src/funcs/integrationsCreate.ts
+++ b/libs/internal-sdk/src/funcs/integrationsCreate.ts
@@ -32,6 +32,8 @@ import { Result } from "../types/fp.js";
* @remarks
* Create an integration for the current environment the user is based on the API key provided.
* Each provider supports different credentials, check the provider documentation for more details.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function integrationsCreate(
client: NovuCore,
@@ -117,7 +119,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/integrationsDelete.ts b/libs/internal-sdk/src/funcs/integrationsDelete.ts
index ad97ee31a5f..351e1e7dc90 100644
--- a/libs/internal-sdk/src/funcs/integrationsDelete.ts
+++ b/libs/internal-sdk/src/funcs/integrationsDelete.ts
@@ -2,28 +2,28 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Delete an integration
@@ -31,12 +31,14 @@ import { Result } from '../types/fp.js';
* @remarks
* Delete an integration by its unique key identifier **integrationId**.
* This action is irreversible.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function integrationsDelete(
client: NovuCore,
integrationId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.IntegrationsControllerRemoveIntegrationResponse,
@@ -52,14 +54,19 @@ export function integrationsDelete(
| SDKValidationError
>
> {
- return new APIPromise($do(client, integrationId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ integrationId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
integrationId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -85,48 +92,50 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.IntegrationsControllerRemoveIntegrationRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.IntegrationsControllerRemoveIntegrationRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- integrationId: encodeSimple('integrationId', payload.integrationId, {
+ integrationId: encodeSimple("integrationId", payload.integrationId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/integrations/{integrationId}')(pathParams);
+ const path = pathToFunc("/v1/integrations/{integrationId}")(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'IntegrationsController_removeIntegration',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "IntegrationsController_removeIntegration",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -134,53 +143,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'DELETE',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "DELETE",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -201,22 +207,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.IntegrationsControllerRemoveIntegrationResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations.IntegrationsControllerRemoveIntegrationResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/integrationsGenerateChatOAuthUrl.ts b/libs/internal-sdk/src/funcs/integrationsGenerateChatOAuthUrl.ts
index af466f90109..e3fb1ddef64 100644
--- a/libs/internal-sdk/src/funcs/integrationsGenerateChatOAuthUrl.ts
+++ b/libs/internal-sdk/src/funcs/integrationsGenerateChatOAuthUrl.ts
@@ -33,6 +33,8 @@ import { Result } from "../types/fp.js";
* Generate an OAuth URL for chat integrations like Slack and MS Teams.
* This URL allows subscribers to authorize the integration, enabling the system to send messages
* through their chat workspace. The generated URL expires after 5 minutes.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function integrationsGenerateChatOAuthUrl(
client: NovuCore,
@@ -118,7 +120,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/integrationsIntegrationsControllerAutoConfigureIntegration.ts b/libs/internal-sdk/src/funcs/integrationsIntegrationsControllerAutoConfigureIntegration.ts
index 45f51454fe9..f7d964097a4 100644
--- a/libs/internal-sdk/src/funcs/integrationsIntegrationsControllerAutoConfigureIntegration.ts
+++ b/libs/internal-sdk/src/funcs/integrationsIntegrationsControllerAutoConfigureIntegration.ts
@@ -2,28 +2,28 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Auto-configure an integration for inbound webhooks
@@ -31,12 +31,14 @@ import { Result } from '../types/fp.js';
* @remarks
* Auto-configure an integration by its unique key identifier **integrationId** for inbound webhook support.
* This will automatically generate required webhook signing keys and configure webhook endpoints.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function integrationsIntegrationsControllerAutoConfigureIntegration(
client: NovuCore,
integrationId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.IntegrationsControllerAutoConfigureIntegrationResponse,
@@ -52,14 +54,19 @@ export function integrationsIntegrationsControllerAutoConfigureIntegration(
| SDKValidationError
>
> {
- return new APIPromise($do(client, integrationId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ integrationId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
integrationId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -78,55 +85,61 @@ async function $do(
APICall,
]
> {
- const input: operations.IntegrationsControllerAutoConfigureIntegrationRequest = {
- integrationId: integrationId,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.IntegrationsControllerAutoConfigureIntegrationRequest = {
+ integrationId: integrationId,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.IntegrationsControllerAutoConfigureIntegrationRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .IntegrationsControllerAutoConfigureIntegrationRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- integrationId: encodeSimple('integrationId', payload.integrationId, {
+ integrationId: encodeSimple("integrationId", payload.integrationId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/integrations/{integrationId}/auto-configure')(pathParams);
-
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v1/integrations/{integrationId}/auto-configure")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'IntegrationsController_autoConfigureIntegration',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "IntegrationsController_autoConfigureIntegration",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -134,53 +147,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'POST',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "POST",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -201,22 +211,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.IntegrationsControllerAutoConfigureIntegrationResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .IntegrationsControllerAutoConfigureIntegrationResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail([404, 429]),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/integrationsList.ts b/libs/internal-sdk/src/funcs/integrationsList.ts
index 519625240c2..86c43268582 100644
--- a/libs/internal-sdk/src/funcs/integrationsList.ts
+++ b/libs/internal-sdk/src/funcs/integrationsList.ts
@@ -30,6 +30,8 @@ import { Result } from "../types/fp.js";
*
* @remarks
* List all the channels integrations created in the organization
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function integrationsList(
client: NovuCore,
@@ -108,7 +110,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/integrationsListActive.ts b/libs/internal-sdk/src/funcs/integrationsListActive.ts
index fb7bf3f24c4..67968f06e10 100644
--- a/libs/internal-sdk/src/funcs/integrationsListActive.ts
+++ b/libs/internal-sdk/src/funcs/integrationsListActive.ts
@@ -30,6 +30,8 @@ import { Result } from "../types/fp.js";
*
* @remarks
* List all the active integrations created in the organization
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function integrationsListActive(
client: NovuCore,
@@ -109,7 +111,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/integrationsSetAsPrimary.ts b/libs/internal-sdk/src/funcs/integrationsSetAsPrimary.ts
index 35bcf23556a..565697f01f8 100644
--- a/libs/internal-sdk/src/funcs/integrationsSetAsPrimary.ts
+++ b/libs/internal-sdk/src/funcs/integrationsSetAsPrimary.ts
@@ -2,28 +2,28 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Update integration as primary
@@ -32,12 +32,14 @@ import { Result } from '../types/fp.js';
* Update an integration as **primary** by its unique key identifier **integrationId**.
* This API will set the integration as primary for that channel in the current environment.
* Primary integration is used to deliver notification for sms and email channels in the workflow.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function integrationsSetAsPrimary(
client: NovuCore,
integrationId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.IntegrationsControllerSetIntegrationAsPrimaryResponse,
@@ -53,14 +55,19 @@ export function integrationsSetAsPrimary(
| SDKValidationError
>
> {
- return new APIPromise($do(client, integrationId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ integrationId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
integrationId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -79,55 +86,61 @@ async function $do(
APICall,
]
> {
- const input: operations.IntegrationsControllerSetIntegrationAsPrimaryRequest = {
- integrationId: integrationId,
- idempotencyKey: idempotencyKey,
- };
+ const input: operations.IntegrationsControllerSetIntegrationAsPrimaryRequest =
+ {
+ integrationId: integrationId,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.IntegrationsControllerSetIntegrationAsPrimaryRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .IntegrationsControllerSetIntegrationAsPrimaryRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- integrationId: encodeSimple('integrationId', payload.integrationId, {
+ integrationId: encodeSimple("integrationId", payload.integrationId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/integrations/{integrationId}/set-primary')(pathParams);
-
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v1/integrations/{integrationId}/set-primary")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'IntegrationsController_setIntegrationAsPrimary',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "IntegrationsController_setIntegrationAsPrimary",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -135,53 +148,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'POST',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "POST",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -202,22 +212,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.IntegrationsControllerSetIntegrationAsPrimaryResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .IntegrationsControllerSetIntegrationAsPrimaryResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail([404, 429]),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/integrationsUpdate.ts b/libs/internal-sdk/src/funcs/integrationsUpdate.ts
index fbefe641909..8445e9f4ecd 100644
--- a/libs/internal-sdk/src/funcs/integrationsUpdate.ts
+++ b/libs/internal-sdk/src/funcs/integrationsUpdate.ts
@@ -2,29 +2,29 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Update an integration
@@ -32,13 +32,15 @@ import { Result } from '../types/fp.js';
* @remarks
* Update an integration by its unique key identifier **integrationId**.
* Each provider supports different credentials, check the provider documentation for more details.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function integrationsUpdate(
client: NovuCore,
updateIntegrationRequestDto: components.UpdateIntegrationRequestDto,
integrationId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.IntegrationsControllerUpdateIntegrationByIdResponse,
@@ -54,7 +56,13 @@ export function integrationsUpdate(
| SDKValidationError
>
> {
- return new APIPromise($do(client, updateIntegrationRequestDto, integrationId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ updateIntegrationRequestDto,
+ integrationId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -62,7 +70,7 @@ async function $do(
updateIntegrationRequestDto: components.UpdateIntegrationRequestDto,
integrationId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -89,51 +97,54 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.IntegrationsControllerUpdateIntegrationByIdRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .IntegrationsControllerUpdateIntegrationByIdRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.UpdateIntegrationRequestDto, {
+ const body = encodeJSON("body", payload.UpdateIntegrationRequestDto, {
explode: true,
});
const pathParams = {
- integrationId: encodeSimple('integrationId', payload.integrationId, {
+ integrationId: encodeSimple("integrationId", payload.integrationId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/integrations/{integrationId}')(pathParams);
+ const path = pathToFunc("/v1/integrations/{integrationId}")(pathParams);
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'IntegrationsController_updateIntegrationById',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "IntegrationsController_updateIntegrationById",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -141,53 +152,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PUT',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PUT",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -208,22 +216,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.IntegrationsControllerUpdateIntegrationByIdResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .IntegrationsControllerUpdateIntegrationByIdResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail([404, 429]),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/layoutsCreate.ts b/libs/internal-sdk/src/funcs/layoutsCreate.ts
index 1e5bd1688f6..70f3ebc0795 100644
--- a/libs/internal-sdk/src/funcs/layoutsCreate.ts
+++ b/libs/internal-sdk/src/funcs/layoutsCreate.ts
@@ -31,6 +31,8 @@ import { Result } from "../types/fp.js";
*
* @remarks
* Creates a new layout in the Novu Cloud environment
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function layoutsCreate(
client: NovuCore,
@@ -113,7 +115,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/layoutsDelete.ts b/libs/internal-sdk/src/funcs/layoutsDelete.ts
index fad09326aba..fae7c07438e 100644
--- a/libs/internal-sdk/src/funcs/layoutsDelete.ts
+++ b/libs/internal-sdk/src/funcs/layoutsDelete.ts
@@ -2,40 +2,42 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Delete a layout
*
* @remarks
* Removes a specific layout by its unique identifier **layoutId**
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function layoutsDelete(
client: NovuCore,
layoutId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.LayoutsControllerDeleteResponse | undefined,
@@ -51,14 +53,19 @@ export function layoutsDelete(
| SDKValidationError
>
> {
- return new APIPromise($do(client, layoutId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ layoutId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
layoutId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -84,48 +91,49 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.LayoutsControllerDeleteRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.LayoutsControllerDeleteRequest$outboundSchema.parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- layoutId: encodeSimple('layoutId', payload.layoutId, {
+ layoutId: encodeSimple("layoutId", payload.layoutId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/layouts/{layoutId}')(pathParams);
+ const path = pathToFunc("/v2/layouts/{layoutId}")(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'LayoutsController_delete',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "LayoutsController_delete",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -133,53 +141,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'DELETE',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "DELETE",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -200,19 +205,26 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.nil(204, operations.LayoutsControllerDeleteResponse$inboundSchema.optional()),
+ M.nil(
+ 204,
+ operations.LayoutsControllerDeleteResponse$inboundSchema.optional(),
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/layoutsDuplicate.ts b/libs/internal-sdk/src/funcs/layoutsDuplicate.ts
index a17d86e6d80..8cee058d876 100644
--- a/libs/internal-sdk/src/funcs/layoutsDuplicate.ts
+++ b/libs/internal-sdk/src/funcs/layoutsDuplicate.ts
@@ -2,42 +2,44 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Duplicate a layout
*
* @remarks
* Duplicates a layout by its unique identifier **layoutId**. This will create a new layout with the content of the original layout.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function layoutsDuplicate(
client: NovuCore,
duplicateLayoutDto: components.DuplicateLayoutDto,
layoutId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.LayoutsControllerDuplicateResponse,
@@ -53,7 +55,13 @@ export function layoutsDuplicate(
| SDKValidationError
>
> {
- return new APIPromise($do(client, duplicateLayoutDto, layoutId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ duplicateLayoutDto,
+ layoutId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -61,7 +69,7 @@ async function $do(
duplicateLayoutDto: components.DuplicateLayoutDto,
layoutId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -88,51 +96,52 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.LayoutsControllerDuplicateRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.LayoutsControllerDuplicateRequest$outboundSchema.parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.DuplicateLayoutDto, {
+ const body = encodeJSON("body", payload.DuplicateLayoutDto, {
explode: true,
});
const pathParams = {
- layoutId: encodeSimple('layoutId', payload.layoutId, {
+ layoutId: encodeSimple("layoutId", payload.layoutId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/layouts/{layoutId}/duplicate')(pathParams);
+ const path = pathToFunc("/v2/layouts/{layoutId}/duplicate")(pathParams);
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'LayoutsController_duplicate',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "LayoutsController_duplicate",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -140,53 +149,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'POST',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "POST",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -209,20 +215,24 @@ async function $do(
>(
M.json(201, operations.LayoutsControllerDuplicateResponse$inboundSchema, {
hdrs: true,
- key: 'Result',
+ key: "Result",
}),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/layoutsGeneratePreview.ts b/libs/internal-sdk/src/funcs/layoutsGeneratePreview.ts
index 891bf85ef66..1bae0ce69e2 100644
--- a/libs/internal-sdk/src/funcs/layoutsGeneratePreview.ts
+++ b/libs/internal-sdk/src/funcs/layoutsGeneratePreview.ts
@@ -2,42 +2,44 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Generate layout preview
*
* @remarks
* Generates a preview for a layout by its unique identifier **layoutId**
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function layoutsGeneratePreview(
client: NovuCore,
layoutPreviewRequestDto: components.LayoutPreviewRequestDto,
layoutId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.LayoutsControllerGeneratePreviewResponse,
@@ -53,7 +55,13 @@ export function layoutsGeneratePreview(
| SDKValidationError
>
> {
- return new APIPromise($do(client, layoutPreviewRequestDto, layoutId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ layoutPreviewRequestDto,
+ layoutId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -61,7 +69,7 @@ async function $do(
layoutPreviewRequestDto: components.LayoutPreviewRequestDto,
layoutId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -88,51 +96,54 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.LayoutsControllerGeneratePreviewRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.LayoutsControllerGeneratePreviewRequest$outboundSchema.parse(
+ value,
+ ),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.LayoutPreviewRequestDto, {
+ const body = encodeJSON("body", payload.LayoutPreviewRequestDto, {
explode: true,
});
const pathParams = {
- layoutId: encodeSimple('layoutId', payload.layoutId, {
+ layoutId: encodeSimple("layoutId", payload.layoutId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/layouts/{layoutId}/preview')(pathParams);
+ const path = pathToFunc("/v2/layouts/{layoutId}/preview")(pathParams);
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'LayoutsController_generatePreview',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "LayoutsController_generatePreview",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -140,53 +151,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'POST',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "POST",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -207,19 +215,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(201, operations.LayoutsControllerGeneratePreviewResponse$inboundSchema, { hdrs: true, key: 'Result' }),
+ M.json(
+ 201,
+ operations.LayoutsControllerGeneratePreviewResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/layoutsList.ts b/libs/internal-sdk/src/funcs/layoutsList.ts
index 01f30d163e8..8af79c79dc9 100644
--- a/libs/internal-sdk/src/funcs/layoutsList.ts
+++ b/libs/internal-sdk/src/funcs/layoutsList.ts
@@ -30,6 +30,8 @@ import { Result } from "../types/fp.js";
*
* @remarks
* Retrieves a list of layouts with optional filtering and pagination
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function layoutsList(
client: NovuCore,
@@ -111,7 +113,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/layoutsRetrieve.ts b/libs/internal-sdk/src/funcs/layoutsRetrieve.ts
index f1f5c7599b8..781cfa116c6 100644
--- a/libs/internal-sdk/src/funcs/layoutsRetrieve.ts
+++ b/libs/internal-sdk/src/funcs/layoutsRetrieve.ts
@@ -2,40 +2,42 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Retrieve a layout
*
* @remarks
* Fetches details of a specific layout by its unique identifier **layoutId**
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function layoutsRetrieve(
client: NovuCore,
layoutId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.LayoutsControllerGetResponse,
@@ -51,14 +53,19 @@ export function layoutsRetrieve(
| SDKValidationError
>
> {
- return new APIPromise($do(client, layoutId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ layoutId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
layoutId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -84,48 +91,49 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.LayoutsControllerGetRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.LayoutsControllerGetRequest$outboundSchema.parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- layoutId: encodeSimple('layoutId', payload.layoutId, {
+ layoutId: encodeSimple("layoutId", payload.layoutId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/layouts/{layoutId}')(pathParams);
+ const path = pathToFunc("/v2/layouts/{layoutId}")(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'LayoutsController_get',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "LayoutsController_get",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -133,53 +141,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -202,20 +207,24 @@ async function $do(
>(
M.json(200, operations.LayoutsControllerGetResponse$inboundSchema, {
hdrs: true,
- key: 'Result',
+ key: "Result",
}),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/layoutsUpdate.ts b/libs/internal-sdk/src/funcs/layoutsUpdate.ts
index 2791734b418..6c3ef14ebde 100644
--- a/libs/internal-sdk/src/funcs/layoutsUpdate.ts
+++ b/libs/internal-sdk/src/funcs/layoutsUpdate.ts
@@ -2,42 +2,44 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Update a layout
*
* @remarks
* Updates the details of an existing layout, here **layoutId** is the identifier of the layout
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function layoutsUpdate(
client: NovuCore,
updateLayoutDto: components.UpdateLayoutDto,
layoutId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.LayoutsControllerUpdateResponse,
@@ -53,7 +55,13 @@ export function layoutsUpdate(
| SDKValidationError
>
> {
- return new APIPromise($do(client, updateLayoutDto, layoutId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ updateLayoutDto,
+ layoutId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -61,7 +69,7 @@ async function $do(
updateLayoutDto: components.UpdateLayoutDto,
layoutId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -88,49 +96,50 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.LayoutsControllerUpdateRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.LayoutsControllerUpdateRequest$outboundSchema.parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.UpdateLayoutDto, { explode: true });
+ const body = encodeJSON("body", payload.UpdateLayoutDto, { explode: true });
const pathParams = {
- layoutId: encodeSimple('layoutId', payload.layoutId, {
+ layoutId: encodeSimple("layoutId", payload.layoutId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/layouts/{layoutId}')(pathParams);
+ const path = pathToFunc("/v2/layouts/{layoutId}")(pathParams);
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'LayoutsController_update',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "LayoutsController_update",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -138,53 +147,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PUT',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PUT",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -207,20 +213,24 @@ async function $do(
>(
M.json(200, operations.LayoutsControllerUpdateResponse$inboundSchema, {
hdrs: true,
- key: 'Result',
+ key: "Result",
}),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/layoutsUsage.ts b/libs/internal-sdk/src/funcs/layoutsUsage.ts
index 7b6a4c32710..20d93b2c6aa 100644
--- a/libs/internal-sdk/src/funcs/layoutsUsage.ts
+++ b/libs/internal-sdk/src/funcs/layoutsUsage.ts
@@ -2,40 +2,42 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Get layout usage
*
* @remarks
* Retrieves information about workflows that use the specified layout by its unique identifier **layoutId**
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function layoutsUsage(
client: NovuCore,
layoutId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.LayoutsControllerGetUsageResponse,
@@ -51,14 +53,19 @@ export function layoutsUsage(
| SDKValidationError
>
> {
- return new APIPromise($do(client, layoutId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ layoutId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
layoutId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -84,48 +91,49 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.LayoutsControllerGetUsageRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.LayoutsControllerGetUsageRequest$outboundSchema.parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- layoutId: encodeSimple('layoutId', payload.layoutId, {
+ layoutId: encodeSimple("layoutId", payload.layoutId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/layouts/{layoutId}/usage')(pathParams);
+ const path = pathToFunc("/v2/layouts/{layoutId}/usage")(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'LayoutsController_getUsage',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "LayoutsController_getUsage",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -133,53 +141,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -202,20 +207,24 @@ async function $do(
>(
M.json(200, operations.LayoutsControllerGetUsageResponse$inboundSchema, {
hdrs: true,
- key: 'Result',
+ key: "Result",
}),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/messagesDelete.ts b/libs/internal-sdk/src/funcs/messagesDelete.ts
index de71ce5a80b..bb90540fc55 100644
--- a/libs/internal-sdk/src/funcs/messagesDelete.ts
+++ b/libs/internal-sdk/src/funcs/messagesDelete.ts
@@ -2,28 +2,28 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Delete a message
@@ -31,12 +31,14 @@ import { Result } from '../types/fp.js';
* @remarks
* Delete a message entity from the Novu platform by **messageId**.
* This action is irreversible. **messageId** is required and of mongodbId type.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function messagesDelete(
client: NovuCore,
messageId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.MessagesControllerDeleteMessageResponse,
@@ -52,14 +54,19 @@ export function messagesDelete(
| SDKValidationError
>
> {
- return new APIPromise($do(client, messageId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ messageId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
messageId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -85,48 +92,51 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.MessagesControllerDeleteMessageRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.MessagesControllerDeleteMessageRequest$outboundSchema.parse(
+ value,
+ ),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- messageId: encodeSimple('messageId', payload.messageId, {
+ messageId: encodeSimple("messageId", payload.messageId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/messages/{messageId}')(pathParams);
+ const path = pathToFunc("/v1/messages/{messageId}")(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'MessagesController_deleteMessage',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "MessagesController_deleteMessage",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -134,53 +144,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'DELETE',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "DELETE",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -201,19 +208,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.MessagesControllerDeleteMessageResponse$inboundSchema, { hdrs: true, key: 'Result' }),
+ M.json(
+ 200,
+ operations.MessagesControllerDeleteMessageResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/messagesDeleteByTransactionId.ts b/libs/internal-sdk/src/funcs/messagesDeleteByTransactionId.ts
index 17b46d7176e..a5d351a3af8 100644
--- a/libs/internal-sdk/src/funcs/messagesDeleteByTransactionId.ts
+++ b/libs/internal-sdk/src/funcs/messagesDeleteByTransactionId.ts
@@ -2,28 +2,28 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeFormQuery, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Delete messages by transactionId
@@ -31,16 +31,21 @@ import { Result } from '../types/fp.js';
* @remarks
* Delete multiple messages from the Novu platform using **transactionId** of triggered event.
* This API supports filtering by **channel** and delete all messages associated with the **transactionId**.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function messagesDeleteByTransactionId(
client: NovuCore,
transactionId: string,
- channel?: operations.MessagesControllerDeleteMessagesByTransactionIdQueryParamChannel | undefined,
+ channel?:
+ | operations.MessagesControllerDeleteMessagesByTransactionIdQueryParamChannel
+ | undefined,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
- operations.MessagesControllerDeleteMessagesByTransactionIdResponse | undefined,
+ | operations.MessagesControllerDeleteMessagesByTransactionIdResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -53,19 +58,28 @@ export function messagesDeleteByTransactionId(
| SDKValidationError
>
> {
- return new APIPromise($do(client, transactionId, channel, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ transactionId,
+ channel,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
transactionId: string,
- channel?: operations.MessagesControllerDeleteMessagesByTransactionIdQueryParamChannel | undefined,
+ channel?:
+ | operations.MessagesControllerDeleteMessagesByTransactionIdQueryParamChannel
+ | undefined,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
- operations.MessagesControllerDeleteMessagesByTransactionIdResponse | undefined,
+ | operations.MessagesControllerDeleteMessagesByTransactionIdResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -80,60 +94,66 @@ async function $do(
APICall,
]
> {
- const input: operations.MessagesControllerDeleteMessagesByTransactionIdRequest = {
- transactionId: transactionId,
- channel: channel,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.MessagesControllerDeleteMessagesByTransactionIdRequest = {
+ transactionId: transactionId,
+ channel: channel,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.MessagesControllerDeleteMessagesByTransactionIdRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .MessagesControllerDeleteMessagesByTransactionIdRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- transactionId: encodeSimple('transactionId', payload.transactionId, {
+ transactionId: encodeSimple("transactionId", payload.transactionId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/messages/transaction/{transactionId}')(pathParams);
+ const path = pathToFunc("/v1/messages/transaction/{transactionId}")(
+ pathParams,
+ );
const query = encodeFormQuery({
- channel: payload.channel,
+ "channel": payload.channel,
});
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'MessagesController_deleteMessagesByTransactionId',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "MessagesController_deleteMessagesByTransactionId",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -141,54 +161,51 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'DELETE',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- query: query,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "DELETE",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ query: query,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -197,7 +214,8 @@ async function $do(
};
const [result] = await M.match<
- operations.MessagesControllerDeleteMessagesByTransactionIdResponse | undefined,
+ | operations.MessagesControllerDeleteMessagesByTransactionIdResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -209,21 +227,29 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.nil(204, operations.MessagesControllerDeleteMessagesByTransactionIdResponse$inboundSchema.optional(), {
- hdrs: true,
- }),
+ M.nil(
+ 204,
+ operations
+ .MessagesControllerDeleteMessagesByTransactionIdResponse$inboundSchema
+ .optional(),
+ { hdrs: true },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/messagesRetrieve.ts b/libs/internal-sdk/src/funcs/messagesRetrieve.ts
index 74ee7ec2dc0..0617bb864e8 100644
--- a/libs/internal-sdk/src/funcs/messagesRetrieve.ts
+++ b/libs/internal-sdk/src/funcs/messagesRetrieve.ts
@@ -32,6 +32,8 @@ import { Result } from "../types/fp.js";
* List all messages for the current environment.
* This API supports filtering by **channel**, **subscriberId**, and **transactionId**.
* This API returns a paginated list of messages.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function messagesRetrieve(
client: NovuCore,
@@ -116,7 +118,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/notificationsList.ts b/libs/internal-sdk/src/funcs/notificationsList.ts
index 2afee6d13b5..a9fab5337a0 100644
--- a/libs/internal-sdk/src/funcs/notificationsList.ts
+++ b/libs/internal-sdk/src/funcs/notificationsList.ts
@@ -2,28 +2,28 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeFormQuery, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* List all events
@@ -33,11 +33,13 @@ import { Result } from '../types/fp.js';
* This API supports filtering by **channels**, **templates**, **emails**, **subscriberIds**, **transactionId**, **topicKey**, **severity**, **contextKeys**.
* Checkout all available filters in the query section.
* This API returns event triggers, to list each channel notifications, check messages APIs.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function notificationsList(
client: NovuCore,
request: operations.NotificationsControllerListNotificationsRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.NotificationsControllerListNotificationsResponse,
@@ -53,13 +55,17 @@ export function notificationsList(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.NotificationsControllerListNotificationsRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -80,59 +86,61 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.NotificationsControllerListNotificationsRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.NotificationsControllerListNotificationsRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
- const path = pathToFunc('/v1/notifications')();
+ const path = pathToFunc("/v1/notifications")();
const query = encodeFormQuery({
- after: payload.after,
- before: payload.before,
- channels: payload.channels,
- contextKeys: payload.contextKeys,
- emails: payload.emails,
- limit: payload.limit,
- page: payload.page,
- search: payload.search,
- severity: payload.severity,
- subscriberIds: payload.subscriberIds,
- subscriptionId: payload.subscriptionId,
- templates: payload.templates,
- topicKey: payload.topicKey,
- transactionId: payload.transactionId,
+ "after": payload.after,
+ "before": payload.before,
+ "channels": payload.channels,
+ "contextKeys": payload.contextKeys,
+ "emails": payload.emails,
+ "limit": payload.limit,
+ "page": payload.page,
+ "search": payload.search,
+ "severity": payload.severity,
+ "subscriberIds": payload.subscriberIds,
+ "subscriptionId": payload.subscriptionId,
+ "templates": payload.templates,
+ "topicKey": payload.topicKey,
+ "transactionId": payload.transactionId,
});
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'NotificationsController_listNotifications',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "NotificationsController_listNotifications",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -140,54 +148,51 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- query: query,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ query: query,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -208,22 +213,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.NotificationsControllerListNotificationsResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations.NotificationsControllerListNotificationsResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/notificationsRetrieve.ts b/libs/internal-sdk/src/funcs/notificationsRetrieve.ts
index 7dd0c62da8b..fad7f6f2323 100644
--- a/libs/internal-sdk/src/funcs/notificationsRetrieve.ts
+++ b/libs/internal-sdk/src/funcs/notificationsRetrieve.ts
@@ -2,28 +2,28 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Retrieve an event
@@ -32,12 +32,14 @@ import { Result } from '../types/fp.js';
* Retrieve an event by its unique key identifier **notificationId**.
* Here **notificationId** is of mongodbId type.
* This API returns the event details - execution logs, status, actual notification (message) generated by each workflow step.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function notificationsRetrieve(
client: NovuCore,
notificationId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.NotificationsControllerGetNotificationResponse,
@@ -53,14 +55,19 @@ export function notificationsRetrieve(
| SDKValidationError
>
> {
- return new APIPromise($do(client, notificationId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ notificationId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
notificationId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -86,48 +93,50 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.NotificationsControllerGetNotificationRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.NotificationsControllerGetNotificationRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- notificationId: encodeSimple('notificationId', payload.notificationId, {
+ notificationId: encodeSimple("notificationId", payload.notificationId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/notifications/{notificationId}')(pathParams);
+ const path = pathToFunc("/v1/notifications/{notificationId}")(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'NotificationsController_getNotification',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "NotificationsController_getNotification",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -135,53 +144,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -202,19 +208,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.NotificationsControllerGetNotificationResponse$inboundSchema, { hdrs: true, key: 'Result' }),
+ M.json(
+ 200,
+ operations.NotificationsControllerGetNotificationResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersCreate.ts b/libs/internal-sdk/src/funcs/subscribersCreate.ts
index 240d7c5383c..0546b2d9494 100644
--- a/libs/internal-sdk/src/funcs/subscribersCreate.ts
+++ b/libs/internal-sdk/src/funcs/subscribersCreate.ts
@@ -32,6 +32,8 @@ import { Result } from "../types/fp.js";
* @remarks
* Create a subscriber with the subscriber attributes.
* **subscriberId** is a required field, rest other fields are optional, if the subscriber already exists, it will be updated
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersCreate(
client: NovuCore,
@@ -127,7 +129,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/subscribersCreateBulk.ts b/libs/internal-sdk/src/funcs/subscribersCreateBulk.ts
index c646482be49..752cc044b18 100644
--- a/libs/internal-sdk/src/funcs/subscribersCreateBulk.ts
+++ b/libs/internal-sdk/src/funcs/subscribersCreateBulk.ts
@@ -32,6 +32,8 @@ import { Result } from "../types/fp.js";
* @remarks
*
* Using this endpoint multiple subscribers can be created at once. The bulk API is limited to 500 subscribers per request.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersCreateBulk(
client: NovuCore,
@@ -119,7 +121,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/subscribersCredentialsAppend.ts b/libs/internal-sdk/src/funcs/subscribersCredentialsAppend.ts
index 64e846a285a..8866ffefd49 100644
--- a/libs/internal-sdk/src/funcs/subscribersCredentialsAppend.ts
+++ b/libs/internal-sdk/src/funcs/subscribersCredentialsAppend.ts
@@ -2,29 +2,29 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Upsert provider credentials
@@ -32,13 +32,16 @@ import { Result } from '../types/fp.js';
* @remarks
* Upsert credentials for a provider such as **slack** and **FCM**.
* **providerId** is required field. This API creates **deviceTokens** or appends to the existing ones.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersCredentialsAppend(
client: NovuCore,
- updateSubscriberChannelRequestDto: components.UpdateSubscriberChannelRequestDto,
+ updateSubscriberChannelRequestDto:
+ components.UpdateSubscriberChannelRequestDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersV1ControllerModifySubscriberChannelResponse,
@@ -54,15 +57,22 @@ export function subscribersCredentialsAppend(
| SDKValidationError
>
> {
- return new APIPromise($do(client, updateSubscriberChannelRequestDto, subscriberId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ updateSubscriberChannelRequestDto,
+ subscriberId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
- updateSubscriberChannelRequestDto: components.UpdateSubscriberChannelRequestDto,
+ updateSubscriberChannelRequestDto:
+ components.UpdateSubscriberChannelRequestDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -81,59 +91,65 @@ async function $do(
APICall,
]
> {
- const input: operations.SubscribersV1ControllerModifySubscriberChannelRequest = {
- updateSubscriberChannelRequestDto: updateSubscriberChannelRequestDto,
- subscriberId: subscriberId,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.SubscribersV1ControllerModifySubscriberChannelRequest = {
+ updateSubscriberChannelRequestDto: updateSubscriberChannelRequestDto,
+ subscriberId: subscriberId,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.SubscribersV1ControllerModifySubscriberChannelRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .SubscribersV1ControllerModifySubscriberChannelRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.UpdateSubscriberChannelRequestDto, {
+ const body = encodeJSON("body", payload.UpdateSubscriberChannelRequestDto, {
explode: true,
});
const pathParams = {
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/subscribers/{subscriberId}/credentials')(pathParams);
-
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v1/subscribers/{subscriberId}/credentials")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersV1Controller_modifySubscriberChannel',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersV1Controller_modifySubscriberChannel",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -141,53 +157,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PATCH',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PATCH",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -208,22 +221,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.SubscribersV1ControllerModifySubscriberChannelResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .SubscribersV1ControllerModifySubscriberChannelResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersCredentialsDelete.ts b/libs/internal-sdk/src/funcs/subscribersCredentialsDelete.ts
index 8a6a053a404..1849b05cfa2 100644
--- a/libs/internal-sdk/src/funcs/subscribersCredentialsDelete.ts
+++ b/libs/internal-sdk/src/funcs/subscribersCredentialsDelete.ts
@@ -2,28 +2,28 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Delete provider credentials
@@ -31,16 +31,19 @@ import { Result } from '../types/fp.js';
* @remarks
* Delete subscriber credentials for a provider such as **slack** and **FCM** by **providerId**.
* This action is irreversible and will remove the credentials for the provider for particular **subscriberId**.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersCredentialsDelete(
client: NovuCore,
subscriberId: string,
providerId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
- operations.SubscribersV1ControllerDeleteSubscriberCredentialsResponse | undefined,
+ | operations.SubscribersV1ControllerDeleteSubscriberCredentialsResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -53,7 +56,13 @@ export function subscribersCredentialsDelete(
| SDKValidationError
>
> {
- return new APIPromise($do(client, subscriberId, providerId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ subscriberId,
+ providerId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -61,11 +70,12 @@ async function $do(
subscriberId: string,
providerId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
- operations.SubscribersV1ControllerDeleteSubscriberCredentialsResponse | undefined,
+ | operations.SubscribersV1ControllerDeleteSubscriberCredentialsResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -80,60 +90,66 @@ async function $do(
APICall,
]
> {
- const input: operations.SubscribersV1ControllerDeleteSubscriberCredentialsRequest = {
- subscriberId: subscriberId,
- providerId: providerId,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.SubscribersV1ControllerDeleteSubscriberCredentialsRequest = {
+ subscriberId: subscriberId,
+ providerId: providerId,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.SubscribersV1ControllerDeleteSubscriberCredentialsRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .SubscribersV1ControllerDeleteSubscriberCredentialsRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- providerId: encodeSimple('providerId', payload.providerId, {
+ providerId: encodeSimple("providerId", payload.providerId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/subscribers/{subscriberId}/credentials/{providerId}')(pathParams);
+ const path = pathToFunc(
+ "/v1/subscribers/{subscriberId}/credentials/{providerId}",
+ )(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersV1Controller_deleteSubscriberCredentials',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersV1Controller_deleteSubscriberCredentials",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -141,53 +157,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'DELETE',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "DELETE",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -196,7 +209,8 @@ async function $do(
};
const [result] = await M.match<
- operations.SubscribersV1ControllerDeleteSubscriberCredentialsResponse | undefined,
+ | operations.SubscribersV1ControllerDeleteSubscriberCredentialsResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -208,21 +222,29 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.nil(204, operations.SubscribersV1ControllerDeleteSubscriberCredentialsResponse$inboundSchema.optional(), {
- hdrs: true,
- }),
+ M.nil(
+ 204,
+ operations
+ .SubscribersV1ControllerDeleteSubscriberCredentialsResponse$inboundSchema
+ .optional(),
+ { hdrs: true },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersCredentialsUpdate.ts b/libs/internal-sdk/src/funcs/subscribersCredentialsUpdate.ts
index 9b350fd6b10..3e64db8320c 100644
--- a/libs/internal-sdk/src/funcs/subscribersCredentialsUpdate.ts
+++ b/libs/internal-sdk/src/funcs/subscribersCredentialsUpdate.ts
@@ -2,29 +2,29 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Update provider credentials
@@ -32,13 +32,16 @@ import { Result } from '../types/fp.js';
* @remarks
* Update credentials for a provider such as **slack** and **FCM**.
* **providerId** is required field. This API creates the **deviceTokens** or replaces the existing ones.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersCredentialsUpdate(
client: NovuCore,
- updateSubscriberChannelRequestDto: components.UpdateSubscriberChannelRequestDto,
+ updateSubscriberChannelRequestDto:
+ components.UpdateSubscriberChannelRequestDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersV1ControllerUpdateSubscriberChannelResponse,
@@ -54,15 +57,22 @@ export function subscribersCredentialsUpdate(
| SDKValidationError
>
> {
- return new APIPromise($do(client, updateSubscriberChannelRequestDto, subscriberId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ updateSubscriberChannelRequestDto,
+ subscriberId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
- updateSubscriberChannelRequestDto: components.UpdateSubscriberChannelRequestDto,
+ updateSubscriberChannelRequestDto:
+ components.UpdateSubscriberChannelRequestDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -81,59 +91,65 @@ async function $do(
APICall,
]
> {
- const input: operations.SubscribersV1ControllerUpdateSubscriberChannelRequest = {
- updateSubscriberChannelRequestDto: updateSubscriberChannelRequestDto,
- subscriberId: subscriberId,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.SubscribersV1ControllerUpdateSubscriberChannelRequest = {
+ updateSubscriberChannelRequestDto: updateSubscriberChannelRequestDto,
+ subscriberId: subscriberId,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.SubscribersV1ControllerUpdateSubscriberChannelRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .SubscribersV1ControllerUpdateSubscriberChannelRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.UpdateSubscriberChannelRequestDto, {
+ const body = encodeJSON("body", payload.UpdateSubscriberChannelRequestDto, {
explode: true,
});
const pathParams = {
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/subscribers/{subscriberId}/credentials')(pathParams);
-
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v1/subscribers/{subscriberId}/credentials")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersV1Controller_updateSubscriberChannel',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersV1Controller_updateSubscriberChannel",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -141,53 +157,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PUT',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PUT",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -208,22 +221,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.SubscribersV1ControllerUpdateSubscriberChannelResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .SubscribersV1ControllerUpdateSubscriberChannelResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersDelete.ts b/libs/internal-sdk/src/funcs/subscribersDelete.ts
index 3f1ed7aa528..a83632ff5ac 100644
--- a/libs/internal-sdk/src/funcs/subscribersDelete.ts
+++ b/libs/internal-sdk/src/funcs/subscribersDelete.ts
@@ -2,28 +2,28 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Delete a subscriber
@@ -31,12 +31,14 @@ import { Result } from '../types/fp.js';
* @remarks
* Deletes a subscriber entity from the Novu platform along with associated messages, preferences, and topic subscriptions.
* **subscriberId** is a required field.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersDelete(
client: NovuCore,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersControllerRemoveSubscriberResponse,
@@ -52,14 +54,19 @@ export function subscribersDelete(
| SDKValidationError
>
> {
- return new APIPromise($do(client, subscriberId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ subscriberId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -85,48 +92,50 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.SubscribersControllerRemoveSubscriberRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.SubscribersControllerRemoveSubscriberRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/subscribers/{subscriberId}')(pathParams);
+ const path = pathToFunc("/v2/subscribers/{subscriberId}")(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_removeSubscriber',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_removeSubscriber",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -134,53 +143,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'DELETE',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "DELETE",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -201,19 +207,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.SubscribersControllerRemoveSubscriberResponse$inboundSchema, { hdrs: true, key: 'Result' }),
+ M.json(
+ 200,
+ operations.SubscribersControllerRemoveSubscriberResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersMessagesMarkAll.ts b/libs/internal-sdk/src/funcs/subscribersMessagesMarkAll.ts
index 8253e828306..3942f4beb7f 100644
--- a/libs/internal-sdk/src/funcs/subscribersMessagesMarkAll.ts
+++ b/libs/internal-sdk/src/funcs/subscribersMessagesMarkAll.ts
@@ -2,42 +2,44 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Update all notifications state
*
* @remarks
* Update all subscriber in-app (inbox) notifications state such as read, unread, seen or unseen by **subscriberId**.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersMessagesMarkAll(
client: NovuCore,
markAllMessageAsRequestDto: components.MarkAllMessageAsRequestDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersV1ControllerMarkAllUnreadAsReadResponse,
@@ -53,7 +55,13 @@ export function subscribersMessagesMarkAll(
| SDKValidationError
>
> {
- return new APIPromise($do(client, markAllMessageAsRequestDto, subscriberId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ markAllMessageAsRequestDto,
+ subscriberId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -61,7 +69,7 @@ async function $do(
markAllMessageAsRequestDto: components.MarkAllMessageAsRequestDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -88,51 +96,57 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.SubscribersV1ControllerMarkAllUnreadAsReadRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .SubscribersV1ControllerMarkAllUnreadAsReadRequest$outboundSchema.parse(
+ value,
+ ),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.MarkAllMessageAsRequestDto, {
+ const body = encodeJSON("body", payload.MarkAllMessageAsRequestDto, {
explode: true,
});
const pathParams = {
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/subscribers/{subscriberId}/messages/mark-all')(pathParams);
-
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v1/subscribers/{subscriberId}/messages/mark-all")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersV1Controller_markAllUnreadAsRead',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersV1Controller_markAllUnreadAsRead",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -140,53 +154,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'POST',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "POST",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -207,22 +218,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(201, operations.SubscribersV1ControllerMarkAllUnreadAsReadResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 201,
+ operations
+ .SubscribersV1ControllerMarkAllUnreadAsReadResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersMessagesMarkAllAs.ts b/libs/internal-sdk/src/funcs/subscribersMessagesMarkAllAs.ts
index 6b7110df314..119e9e882f0 100644
--- a/libs/internal-sdk/src/funcs/subscribersMessagesMarkAllAs.ts
+++ b/libs/internal-sdk/src/funcs/subscribersMessagesMarkAllAs.ts
@@ -2,29 +2,29 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Update notifications state
@@ -32,13 +32,15 @@ import { Result } from '../types/fp.js';
* @remarks
* Update subscriber's multiple in-app (inbox) notifications state such as seen, read, unseen or unread by **subscriberId**.
* **messageId** is of type mongodbId of notifications
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersMessagesMarkAllAs(
client: NovuCore,
messageMarkAsRequestDto: components.MessageMarkAsRequestDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersV1ControllerMarkMessagesAsResponse,
@@ -54,7 +56,13 @@ export function subscribersMessagesMarkAllAs(
| SDKValidationError
>
> {
- return new APIPromise($do(client, messageMarkAsRequestDto, subscriberId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ messageMarkAsRequestDto,
+ subscriberId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -62,7 +70,7 @@ async function $do(
messageMarkAsRequestDto: components.MessageMarkAsRequestDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -89,51 +97,55 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.SubscribersV1ControllerMarkMessagesAsRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.SubscribersV1ControllerMarkMessagesAsRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.MessageMarkAsRequestDto, {
+ const body = encodeJSON("body", payload.MessageMarkAsRequestDto, {
explode: true,
});
const pathParams = {
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/subscribers/{subscriberId}/messages/mark-as')(pathParams);
-
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v1/subscribers/{subscriberId}/messages/mark-as")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersV1Controller_markMessagesAs',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersV1Controller_markMessagesAs",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -141,53 +153,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'POST',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "POST",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -208,19 +217,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(201, operations.SubscribersV1ControllerMarkMessagesAsResponse$inboundSchema, { hdrs: true, key: 'Result' }),
+ M.json(
+ 201,
+ operations.SubscribersV1ControllerMarkMessagesAsResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersMessagesUpdateAsSeen.ts b/libs/internal-sdk/src/funcs/subscribersMessagesUpdateAsSeen.ts
index 381887b2fb7..f6788898ed9 100644
--- a/libs/internal-sdk/src/funcs/subscribersMessagesUpdateAsSeen.ts
+++ b/libs/internal-sdk/src/funcs/subscribersMessagesUpdateAsSeen.ts
@@ -2,28 +2,28 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Update notification action status
@@ -31,11 +31,13 @@ import { Result } from '../types/fp.js';
* @remarks
* Update in-app (inbox) notification's action status by its unique key identifier **messageId** and type field **type**.
* **type** field can be **primary** or **secondary**
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersMessagesUpdateAsSeen(
client: NovuCore,
request: operations.SubscribersV1ControllerMarkActionAsSeenRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersV1ControllerMarkActionAsSeenResponse,
@@ -51,13 +53,17 @@ export function subscribersMessagesUpdateAsSeen(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.SubscribersV1ControllerMarkActionAsSeenRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -78,59 +84,63 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.SubscribersV1ControllerMarkActionAsSeenRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.SubscribersV1ControllerMarkActionAsSeenRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.MarkMessageActionAsSeenDto, {
+ const body = encodeJSON("body", payload.MarkMessageActionAsSeenDto, {
explode: true,
});
const pathParams = {
- messageId: encodeSimple('messageId', payload.messageId, {
+ messageId: encodeSimple("messageId", payload.messageId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- type: encodeSimple('type', payload.type, {
+ type: encodeSimple("type", payload.type, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/subscribers/{subscriberId}/messages/{messageId}/actions/{type}')(pathParams);
+ const path = pathToFunc(
+ "/v1/subscribers/{subscriberId}/messages/{messageId}/actions/{type}",
+ )(pathParams);
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersV1Controller_markActionAsSeen',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersV1Controller_markActionAsSeen",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -138,53 +148,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'POST',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "POST",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -205,22 +212,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(201, operations.SubscribersV1ControllerMarkActionAsSeenResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 201,
+ operations.SubscribersV1ControllerMarkActionAsSeenResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersNotificationsArchive.ts b/libs/internal-sdk/src/funcs/subscribersNotificationsArchive.ts
index 9f8f44d31c5..738981fb0f5 100644
--- a/libs/internal-sdk/src/funcs/subscribersNotificationsArchive.ts
+++ b/libs/internal-sdk/src/funcs/subscribersNotificationsArchive.ts
@@ -2,39 +2,41 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeFormQuery, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
- * Archive notification
+ * Archive a notification
*
* @remarks
- * Archive a specific notification by its unique identifier **notificationId**.
+ * Archive a specific in-app (inbox) notification by its unique identifier **notificationId**.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersNotificationsArchive(
client: NovuCore,
request: operations.SubscribersControllerArchiveNotificationRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersControllerArchiveNotificationResponse,
@@ -50,13 +52,17 @@ export function subscribersNotificationsArchive(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.SubscribersControllerArchiveNotificationRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -77,56 +83,60 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.SubscribersControllerArchiveNotificationRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.SubscribersControllerArchiveNotificationRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- notificationId: encodeSimple('notificationId', payload.notificationId, {
+ notificationId: encodeSimple("notificationId", payload.notificationId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/subscribers/{subscriberId}/notifications/{notificationId}/archive')(pathParams);
+ const path = pathToFunc(
+ "/v2/subscribers/{subscriberId}/notifications/{notificationId}/archive",
+ )(pathParams);
const query = encodeFormQuery({
- contextKeys: payload.contextKeys,
+ "contextKeys": payload.contextKeys,
});
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_archiveNotification',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_archiveNotification",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -134,54 +144,51 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PATCH',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- query: query,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PATCH",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ query: query,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -202,22 +209,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.SubscribersControllerArchiveNotificationResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations.SubscribersControllerArchiveNotificationResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersNotificationsArchiveAll.ts b/libs/internal-sdk/src/funcs/subscribersNotificationsArchiveAll.ts
index dd687d6074f..5d3586462d9 100644
--- a/libs/internal-sdk/src/funcs/subscribersNotificationsArchiveAll.ts
+++ b/libs/internal-sdk/src/funcs/subscribersNotificationsArchiveAll.ts
@@ -2,42 +2,45 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Archive all notifications
*
* @remarks
- * Archive all notifications matching the specified filters. Supports context-based filtering.
+ * Archive all in-app (inbox) notifications matching the specified filters. Supports context-based filtering.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersNotificationsArchiveAll(
client: NovuCore,
- updateAllSubscriberNotificationsDto: components.UpdateAllSubscriberNotificationsDto,
+ updateAllSubscriberNotificationsDto:
+ components.UpdateAllSubscriberNotificationsDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersControllerArchiveAllNotificationsResponse | undefined,
@@ -53,19 +56,27 @@ export function subscribersNotificationsArchiveAll(
| SDKValidationError
>
> {
- return new APIPromise($do(client, updateAllSubscriberNotificationsDto, subscriberId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ updateAllSubscriberNotificationsDto,
+ subscriberId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
- updateAllSubscriberNotificationsDto: components.UpdateAllSubscriberNotificationsDto,
+ updateAllSubscriberNotificationsDto:
+ components.UpdateAllSubscriberNotificationsDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
- operations.SubscribersControllerArchiveAllNotificationsResponse | undefined,
+ | operations.SubscribersControllerArchiveAllNotificationsResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -80,59 +91,65 @@ async function $do(
APICall,
]
> {
- const input: operations.SubscribersControllerArchiveAllNotificationsRequest = {
- updateAllSubscriberNotificationsDto: updateAllSubscriberNotificationsDto,
- subscriberId: subscriberId,
- idempotencyKey: idempotencyKey,
- };
+ const input: operations.SubscribersControllerArchiveAllNotificationsRequest =
+ {
+ updateAllSubscriberNotificationsDto: updateAllSubscriberNotificationsDto,
+ subscriberId: subscriberId,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.SubscribersControllerArchiveAllNotificationsRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .SubscribersControllerArchiveAllNotificationsRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.UpdateAllSubscriberNotificationsDto, {
+ const body = encodeJSON("body", payload.UpdateAllSubscriberNotificationsDto, {
explode: true,
});
const pathParams = {
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/subscribers/{subscriberId}/notifications/archive')(pathParams);
+ const path = pathToFunc(
+ "/v2/subscribers/{subscriberId}/notifications/archive",
+ )(pathParams);
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_archiveAllNotifications',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_archiveAllNotifications",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -140,53 +157,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'POST',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "POST",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -207,19 +221,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.nil(204, operations.SubscribersControllerArchiveAllNotificationsResponse$inboundSchema.optional()),
+ M.nil(
+ 204,
+ operations
+ .SubscribersControllerArchiveAllNotificationsResponse$inboundSchema
+ .optional(),
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersNotificationsArchiveAllRead.ts b/libs/internal-sdk/src/funcs/subscribersNotificationsArchiveAllRead.ts
index 01e0ae77194..891f3b4c7c5 100644
--- a/libs/internal-sdk/src/funcs/subscribersNotificationsArchiveAllRead.ts
+++ b/libs/internal-sdk/src/funcs/subscribersNotificationsArchiveAllRead.ts
@@ -2,45 +2,49 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Archive all read notifications
*
* @remarks
- * Archive all read notifications matching the specified filters. Supports context-based filtering.
+ * Archive all read in-app (inbox) notifications matching the specified filters. Supports context-based filtering.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersNotificationsArchiveAllRead(
client: NovuCore,
- updateAllSubscriberNotificationsDto: components.UpdateAllSubscriberNotificationsDto,
+ updateAllSubscriberNotificationsDto:
+ components.UpdateAllSubscriberNotificationsDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
- operations.SubscribersControllerArchiveAllReadNotificationsResponse | undefined,
+ | operations.SubscribersControllerArchiveAllReadNotificationsResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -53,19 +57,27 @@ export function subscribersNotificationsArchiveAllRead(
| SDKValidationError
>
> {
- return new APIPromise($do(client, updateAllSubscriberNotificationsDto, subscriberId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ updateAllSubscriberNotificationsDto,
+ subscriberId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
- updateAllSubscriberNotificationsDto: components.UpdateAllSubscriberNotificationsDto,
+ updateAllSubscriberNotificationsDto:
+ components.UpdateAllSubscriberNotificationsDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
- operations.SubscribersControllerArchiveAllReadNotificationsResponse | undefined,
+ | operations.SubscribersControllerArchiveAllReadNotificationsResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -80,59 +92,65 @@ async function $do(
APICall,
]
> {
- const input: operations.SubscribersControllerArchiveAllReadNotificationsRequest = {
- updateAllSubscriberNotificationsDto: updateAllSubscriberNotificationsDto,
- subscriberId: subscriberId,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.SubscribersControllerArchiveAllReadNotificationsRequest = {
+ updateAllSubscriberNotificationsDto: updateAllSubscriberNotificationsDto,
+ subscriberId: subscriberId,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.SubscribersControllerArchiveAllReadNotificationsRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .SubscribersControllerArchiveAllReadNotificationsRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.UpdateAllSubscriberNotificationsDto, {
+ const body = encodeJSON("body", payload.UpdateAllSubscriberNotificationsDto, {
explode: true,
});
const pathParams = {
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/subscribers/{subscriberId}/notifications/read-archive')(pathParams);
+ const path = pathToFunc(
+ "/v2/subscribers/{subscriberId}/notifications/read-archive",
+ )(pathParams);
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_archiveAllReadNotifications',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_archiveAllReadNotifications",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -140,53 +158,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'POST',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "POST",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -195,7 +210,8 @@ async function $do(
};
const [result] = await M.match<
- operations.SubscribersControllerArchiveAllReadNotificationsResponse | undefined,
+ | operations.SubscribersControllerArchiveAllReadNotificationsResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -207,19 +223,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.nil(204, operations.SubscribersControllerArchiveAllReadNotificationsResponse$inboundSchema.optional()),
+ M.nil(
+ 204,
+ operations
+ .SubscribersControllerArchiveAllReadNotificationsResponse$inboundSchema
+ .optional(),
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersNotificationsCompleteAction.ts b/libs/internal-sdk/src/funcs/subscribersNotificationsCompleteAction.ts
index 27797167cad..cb49d54a2ee 100644
--- a/libs/internal-sdk/src/funcs/subscribersNotificationsCompleteAction.ts
+++ b/libs/internal-sdk/src/funcs/subscribersNotificationsCompleteAction.ts
@@ -2,39 +2,41 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeFormQuery, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
- * Complete notification action
+ * Complete a notification action
*
* @remarks
- * Mark a notification action (primary or secondary) as completed by its unique identifier **notificationId** and action type.
+ * Mark a single in-app (inbox) notification's action (primary or secondary) as completed by its unique identifier **notificationId** and action type **actionType**.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersNotificationsCompleteAction(
client: NovuCore,
request: operations.SubscribersControllerCompleteNotificationActionRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersControllerCompleteNotificationActionResponse,
@@ -50,13 +52,17 @@ export function subscribersNotificationsCompleteAction(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.SubscribersControllerCompleteNotificationActionRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -77,62 +83,65 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.SubscribersControllerCompleteNotificationActionRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .SubscribersControllerCompleteNotificationActionRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- actionType: encodeSimple('actionType', payload.actionType, {
+ actionType: encodeSimple("actionType", payload.actionType, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- notificationId: encodeSimple('notificationId', payload.notificationId, {
+ notificationId: encodeSimple("notificationId", payload.notificationId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
const path = pathToFunc(
- '/v2/subscribers/{subscriberId}/notifications/{notificationId}/actions/{actionType}/complete'
+ "/v2/subscribers/{subscriberId}/notifications/{notificationId}/actions/{actionType}/complete",
)(pathParams);
const query = encodeFormQuery({
- contextKeys: payload.contextKeys,
+ "contextKeys": payload.contextKeys,
});
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_completeNotificationAction',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_completeNotificationAction",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -140,54 +149,51 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PATCH',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- query: query,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PATCH",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ query: query,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -208,22 +214,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.SubscribersControllerCompleteNotificationActionResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .SubscribersControllerCompleteNotificationActionResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersNotificationsCount.ts b/libs/internal-sdk/src/funcs/subscribersNotificationsCount.ts
index 6221c858e32..3ef94834b7a 100644
--- a/libs/internal-sdk/src/funcs/subscribersNotificationsCount.ts
+++ b/libs/internal-sdk/src/funcs/subscribersNotificationsCount.ts
@@ -2,42 +2,44 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeFormQuery, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Retrieve subscriber notifications count
*
* @remarks
- * Retrieve count of notifications for a subscriber by its unique key identifier **subscriberId**.
- * Supports multiple filters to count notifications by different criteria, including context keys.
+ * Retrieve count of in-app (inbox) notifications for a subscriber by its unique key identifier **subscriberId**.
+ * Supports multiple filters to count in-app (inbox) notifications by different criteria, including context keys.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersNotificationsCount(
client: NovuCore,
subscriberId: string,
filters: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersControllerGetSubscriberNotificationsCountResponse,
@@ -53,7 +55,13 @@ export function subscribersNotificationsCount(
| SDKValidationError
>
> {
- return new APIPromise($do(client, subscriberId, filters, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ subscriberId,
+ filters,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -61,7 +69,7 @@ async function $do(
subscriberId: string,
filters: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -80,60 +88,66 @@ async function $do(
APICall,
]
> {
- const input: operations.SubscribersControllerGetSubscriberNotificationsCountRequest = {
- subscriberId: subscriberId,
- filters: filters,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.SubscribersControllerGetSubscriberNotificationsCountRequest = {
+ subscriberId: subscriberId,
+ filters: filters,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.SubscribersControllerGetSubscriberNotificationsCountRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .SubscribersControllerGetSubscriberNotificationsCountRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/subscribers/{subscriberId}/notifications/count')(pathParams);
+ const path = pathToFunc("/v2/subscribers/{subscriberId}/notifications/count")(
+ pathParams,
+ );
const query = encodeFormQuery({
- filters: payload.filters,
+ "filters": payload.filters,
});
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_getSubscriberNotificationsCount',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_getSubscriberNotificationsCount",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -141,54 +155,51 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- query: query,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ query: query,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -209,22 +220,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.SubscribersControllerGetSubscriberNotificationsCountResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .SubscribersControllerGetSubscriberNotificationsCountResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersNotificationsDelete.ts b/libs/internal-sdk/src/funcs/subscribersNotificationsDelete.ts
index 5058c71cc12..a553aed9c5c 100644
--- a/libs/internal-sdk/src/funcs/subscribersNotificationsDelete.ts
+++ b/libs/internal-sdk/src/funcs/subscribersNotificationsDelete.ts
@@ -2,39 +2,41 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeFormQuery, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
- * Delete notification
+ * Delete a notification
*
* @remarks
- * Delete a specific notification by its unique identifier **notificationId**.
+ * Delete a specific in-app (inbox) notification permanently by its unique identifier **notificationId**.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersNotificationsDelete(
client: NovuCore,
request: operations.SubscribersControllerDeleteNotificationRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersControllerDeleteNotificationResponse | undefined,
@@ -50,13 +52,17 @@ export function subscribersNotificationsDelete(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.SubscribersControllerDeleteNotificationRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -77,56 +83,60 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.SubscribersControllerDeleteNotificationRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.SubscribersControllerDeleteNotificationRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- notificationId: encodeSimple('notificationId', payload.notificationId, {
+ notificationId: encodeSimple("notificationId", payload.notificationId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/subscribers/{subscriberId}/notifications/{notificationId}')(pathParams);
+ const path = pathToFunc(
+ "/v2/subscribers/{subscriberId}/notifications/{notificationId}",
+ )(pathParams);
const query = encodeFormQuery({
- contextKeys: payload.contextKeys,
+ "contextKeys": payload.contextKeys,
});
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_deleteNotification',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_deleteNotification",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -134,54 +144,51 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'DELETE',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- query: query,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "DELETE",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ query: query,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -202,19 +209,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.nil(204, operations.SubscribersControllerDeleteNotificationResponse$inboundSchema.optional()),
+ M.nil(
+ 204,
+ operations.SubscribersControllerDeleteNotificationResponse$inboundSchema
+ .optional(),
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersNotificationsDeleteAll.ts b/libs/internal-sdk/src/funcs/subscribersNotificationsDeleteAll.ts
index 1f3f399f949..435815e72f1 100644
--- a/libs/internal-sdk/src/funcs/subscribersNotificationsDeleteAll.ts
+++ b/libs/internal-sdk/src/funcs/subscribersNotificationsDeleteAll.ts
@@ -2,42 +2,45 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Delete all notifications
*
* @remarks
- * Delete all notifications matching the specified filters. Supports context-based filtering.
+ * Permanently delete all in-app (inbox) notifications matching the specified filters. Supports context-based filtering.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersNotificationsDeleteAll(
client: NovuCore,
- updateAllSubscriberNotificationsDto: components.UpdateAllSubscriberNotificationsDto,
+ updateAllSubscriberNotificationsDto:
+ components.UpdateAllSubscriberNotificationsDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersControllerDeleteAllNotificationsResponse | undefined,
@@ -53,19 +56,27 @@ export function subscribersNotificationsDeleteAll(
| SDKValidationError
>
> {
- return new APIPromise($do(client, updateAllSubscriberNotificationsDto, subscriberId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ updateAllSubscriberNotificationsDto,
+ subscriberId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
- updateAllSubscriberNotificationsDto: components.UpdateAllSubscriberNotificationsDto,
+ updateAllSubscriberNotificationsDto:
+ components.UpdateAllSubscriberNotificationsDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
- operations.SubscribersControllerDeleteAllNotificationsResponse | undefined,
+ | operations.SubscribersControllerDeleteAllNotificationsResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -88,51 +99,56 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.SubscribersControllerDeleteAllNotificationsRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .SubscribersControllerDeleteAllNotificationsRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.UpdateAllSubscriberNotificationsDto, {
+ const body = encodeJSON("body", payload.UpdateAllSubscriberNotificationsDto, {
explode: true,
});
const pathParams = {
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/subscribers/{subscriberId}/notifications/delete')(pathParams);
+ const path = pathToFunc(
+ "/v2/subscribers/{subscriberId}/notifications/delete",
+ )(pathParams);
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_deleteAllNotifications',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_deleteAllNotifications",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -140,53 +156,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'POST',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "POST",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -207,19 +220,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.nil(204, operations.SubscribersControllerDeleteAllNotificationsResponse$inboundSchema.optional()),
+ M.nil(
+ 204,
+ operations
+ .SubscribersControllerDeleteAllNotificationsResponse$inboundSchema
+ .optional(),
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersNotificationsFeed.ts b/libs/internal-sdk/src/funcs/subscribersNotificationsFeed.ts
index 2048deed5ac..162c78f5ead 100644
--- a/libs/internal-sdk/src/funcs/subscribersNotificationsFeed.ts
+++ b/libs/internal-sdk/src/funcs/subscribersNotificationsFeed.ts
@@ -2,39 +2,41 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeFormQuery, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Retrieve subscriber notifications
*
* @remarks
* Retrieve subscriber in-app (inbox) notifications by its unique key identifier **subscriberId**.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersNotificationsFeed(
client: NovuCore,
request: operations.SubscribersV1ControllerGetNotificationsFeedRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersV1ControllerGetNotificationsFeedResponse,
@@ -50,13 +52,17 @@ export function subscribersNotificationsFeed(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.SubscribersV1ControllerGetNotificationsFeedRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -77,56 +83,61 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.SubscribersV1ControllerGetNotificationsFeedRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .SubscribersV1ControllerGetNotificationsFeedRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/subscribers/{subscriberId}/notifications/feed')(pathParams);
+ const path = pathToFunc("/v1/subscribers/{subscriberId}/notifications/feed")(
+ pathParams,
+ );
const query = encodeFormQuery({
- limit: payload.limit,
- page: payload.page,
- payload: payload.payload,
- read: payload.read,
- seen: payload.seen,
+ "limit": payload.limit,
+ "page": payload.page,
+ "payload": payload.payload,
+ "read": payload.read,
+ "seen": payload.seen,
});
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersV1Controller_getNotificationsFeed',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersV1Controller_getNotificationsFeed",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -134,54 +145,51 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- query: query,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ query: query,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -202,22 +210,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.SubscribersV1ControllerGetNotificationsFeedResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .SubscribersV1ControllerGetNotificationsFeedResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersNotificationsList.ts b/libs/internal-sdk/src/funcs/subscribersNotificationsList.ts
index acc7d1a4979..724e497b84d 100644
--- a/libs/internal-sdk/src/funcs/subscribersNotificationsList.ts
+++ b/libs/internal-sdk/src/funcs/subscribersNotificationsList.ts
@@ -2,40 +2,42 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeFormQuery, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Retrieve subscriber notifications
*
* @remarks
- * Retrieve in-app notifications for a subscriber by its unique key identifier **subscriberId**.
+ * Retrieve in-app (inbox) notifications for a subscriber by its unique key identifier **subscriberId**.
* Supports filtering by tags, read/archived/snoozed/seen state, data attributes, severity, date range, and context keys.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersNotificationsList(
client: NovuCore,
request: operations.SubscribersControllerGetSubscriberNotificationsRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersControllerGetSubscriberNotificationsResponse,
@@ -51,13 +53,17 @@ export function subscribersNotificationsList(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.SubscribersControllerGetSubscriberNotificationsRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -78,64 +84,68 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.SubscribersControllerGetSubscriberNotificationsRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .SubscribersControllerGetSubscriberNotificationsRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/subscribers/{subscriberId}/notifications')(pathParams);
+ const path = pathToFunc("/v2/subscribers/{subscriberId}/notifications")(
+ pathParams,
+ );
const query = encodeFormQuery({
- after: payload.after,
- archived: payload.archived,
- contextKeys: payload.contextKeys,
- createdGte: payload.createdGte,
- createdLte: payload.createdLte,
- data: payload.data,
- limit: payload.limit,
- offset: payload.offset,
- read: payload.read,
- seen: payload.seen,
- severity: payload.severity,
- snoozed: payload.snoozed,
- tags: payload.tags,
+ "after": payload.after,
+ "archived": payload.archived,
+ "contextKeys": payload.contextKeys,
+ "createdGte": payload.createdGte,
+ "createdLte": payload.createdLte,
+ "data": payload.data,
+ "limit": payload.limit,
+ "offset": payload.offset,
+ "read": payload.read,
+ "seen": payload.seen,
+ "severity": payload.severity,
+ "snoozed": payload.snoozed,
});
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_getSubscriberNotifications',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_getSubscriberNotifications",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -143,54 +153,51 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- query: query,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ query: query,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -211,22 +218,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.SubscribersControllerGetSubscriberNotificationsResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .SubscribersControllerGetSubscriberNotificationsResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersNotificationsMarkAllAsRead.ts b/libs/internal-sdk/src/funcs/subscribersNotificationsMarkAllAsRead.ts
index f2f7fd7a81f..2474a388986 100644
--- a/libs/internal-sdk/src/funcs/subscribersNotificationsMarkAllAsRead.ts
+++ b/libs/internal-sdk/src/funcs/subscribersNotificationsMarkAllAsRead.ts
@@ -2,45 +2,49 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Mark all notifications as read
*
* @remarks
- * Mark all notifications matching the specified filters as read. Supports context-based filtering.
+ * Mark all in-app (inbox) notifications matching the specified filters as read. Supports context-based filtering.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersNotificationsMarkAllAsRead(
client: NovuCore,
- updateAllSubscriberNotificationsDto: components.UpdateAllSubscriberNotificationsDto,
+ updateAllSubscriberNotificationsDto:
+ components.UpdateAllSubscriberNotificationsDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
- operations.SubscribersControllerMarkAllNotificationsAsReadResponse | undefined,
+ | operations.SubscribersControllerMarkAllNotificationsAsReadResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -53,19 +57,27 @@ export function subscribersNotificationsMarkAllAsRead(
| SDKValidationError
>
> {
- return new APIPromise($do(client, updateAllSubscriberNotificationsDto, subscriberId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ updateAllSubscriberNotificationsDto,
+ subscriberId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
- updateAllSubscriberNotificationsDto: components.UpdateAllSubscriberNotificationsDto,
+ updateAllSubscriberNotificationsDto:
+ components.UpdateAllSubscriberNotificationsDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
- operations.SubscribersControllerMarkAllNotificationsAsReadResponse | undefined,
+ | operations.SubscribersControllerMarkAllNotificationsAsReadResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -80,59 +92,65 @@ async function $do(
APICall,
]
> {
- const input: operations.SubscribersControllerMarkAllNotificationsAsReadRequest = {
- updateAllSubscriberNotificationsDto: updateAllSubscriberNotificationsDto,
- subscriberId: subscriberId,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.SubscribersControllerMarkAllNotificationsAsReadRequest = {
+ updateAllSubscriberNotificationsDto: updateAllSubscriberNotificationsDto,
+ subscriberId: subscriberId,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.SubscribersControllerMarkAllNotificationsAsReadRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .SubscribersControllerMarkAllNotificationsAsReadRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.UpdateAllSubscriberNotificationsDto, {
+ const body = encodeJSON("body", payload.UpdateAllSubscriberNotificationsDto, {
explode: true,
});
const pathParams = {
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/subscribers/{subscriberId}/notifications/read')(pathParams);
-
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v2/subscribers/{subscriberId}/notifications/read")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_markAllNotificationsAsRead',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_markAllNotificationsAsRead",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -140,53 +158,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'POST',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "POST",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -195,7 +210,8 @@ async function $do(
};
const [result] = await M.match<
- operations.SubscribersControllerMarkAllNotificationsAsReadResponse | undefined,
+ | operations.SubscribersControllerMarkAllNotificationsAsReadResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -207,19 +223,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.nil(204, operations.SubscribersControllerMarkAllNotificationsAsReadResponse$inboundSchema.optional()),
+ M.nil(
+ 204,
+ operations
+ .SubscribersControllerMarkAllNotificationsAsReadResponse$inboundSchema
+ .optional(),
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersNotificationsMarkAsRead.ts b/libs/internal-sdk/src/funcs/subscribersNotificationsMarkAsRead.ts
index 9ae21021375..da41b93a4c9 100644
--- a/libs/internal-sdk/src/funcs/subscribersNotificationsMarkAsRead.ts
+++ b/libs/internal-sdk/src/funcs/subscribersNotificationsMarkAsRead.ts
@@ -2,39 +2,41 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeFormQuery, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
- * Mark notification as read
+ * Mark a notification as read
*
* @remarks
- * Mark a specific notification as read by its unique identifier **notificationId**.
+ * Mark a specific in-app (inbox) notification as read by its unique identifier **notificationId**.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersNotificationsMarkAsRead(
client: NovuCore,
request: operations.SubscribersControllerMarkNotificationAsReadRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersControllerMarkNotificationAsReadResponse,
@@ -50,13 +52,17 @@ export function subscribersNotificationsMarkAsRead(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.SubscribersControllerMarkNotificationAsReadRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -77,56 +83,61 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.SubscribersControllerMarkNotificationAsReadRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .SubscribersControllerMarkNotificationAsReadRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- notificationId: encodeSimple('notificationId', payload.notificationId, {
+ notificationId: encodeSimple("notificationId", payload.notificationId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/subscribers/{subscriberId}/notifications/{notificationId}/read')(pathParams);
+ const path = pathToFunc(
+ "/v2/subscribers/{subscriberId}/notifications/{notificationId}/read",
+ )(pathParams);
const query = encodeFormQuery({
- contextKeys: payload.contextKeys,
+ "contextKeys": payload.contextKeys,
});
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_markNotificationAsRead',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_markNotificationAsRead",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -134,54 +145,51 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PATCH',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- query: query,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PATCH",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ query: query,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -202,22 +210,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.SubscribersControllerMarkNotificationAsReadResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .SubscribersControllerMarkNotificationAsReadResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersNotificationsMarkAsSeen.ts b/libs/internal-sdk/src/funcs/subscribersNotificationsMarkAsSeen.ts
index 18758e2ce48..2490c048d32 100644
--- a/libs/internal-sdk/src/funcs/subscribersNotificationsMarkAsSeen.ts
+++ b/libs/internal-sdk/src/funcs/subscribersNotificationsMarkAsSeen.ts
@@ -2,42 +2,45 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Mark notifications as seen
*
* @remarks
- * Mark specific notifications or notifications matching filters as seen. Supports context-based filtering.
+ * Mark specific and multiple in-app (inbox) notifications as seen. Supports context-based filtering.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersNotificationsMarkAsSeen(
client: NovuCore,
- markSubscriberNotificationsAsSeenDto: components.MarkSubscriberNotificationsAsSeenDto,
+ markSubscriberNotificationsAsSeenDto:
+ components.MarkSubscriberNotificationsAsSeenDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersControllerMarkNotificationsAsSeenResponse | undefined,
@@ -53,19 +56,27 @@ export function subscribersNotificationsMarkAsSeen(
| SDKValidationError
>
> {
- return new APIPromise($do(client, markSubscriberNotificationsAsSeenDto, subscriberId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ markSubscriberNotificationsAsSeenDto,
+ subscriberId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
- markSubscriberNotificationsAsSeenDto: components.MarkSubscriberNotificationsAsSeenDto,
+ markSubscriberNotificationsAsSeenDto:
+ components.MarkSubscriberNotificationsAsSeenDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
- operations.SubscribersControllerMarkNotificationsAsSeenResponse | undefined,
+ | operations.SubscribersControllerMarkNotificationsAsSeenResponse
+ | undefined,
| errors.ErrorDto
| errors.ValidationErrorDto
| NovuError
@@ -80,57 +91,68 @@ async function $do(
APICall,
]
> {
- const input: operations.SubscribersControllerMarkNotificationsAsSeenRequest = {
- markSubscriberNotificationsAsSeenDto: markSubscriberNotificationsAsSeenDto,
- subscriberId: subscriberId,
- idempotencyKey: idempotencyKey,
- };
+ const input: operations.SubscribersControllerMarkNotificationsAsSeenRequest =
+ {
+ markSubscriberNotificationsAsSeenDto:
+ markSubscriberNotificationsAsSeenDto,
+ subscriberId: subscriberId,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.SubscribersControllerMarkNotificationsAsSeenRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .SubscribersControllerMarkNotificationsAsSeenRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.MarkSubscriberNotificationsAsSeenDto, { explode: true });
+ const body = encodeJSON(
+ "body",
+ payload.MarkSubscriberNotificationsAsSeenDto,
+ { explode: true },
+ );
const pathParams = {
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/subscribers/{subscriberId}/notifications/seen')(pathParams);
-
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v2/subscribers/{subscriberId}/notifications/seen")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_markNotificationsAsSeen',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_markNotificationsAsSeen",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -138,53 +160,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'POST',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "POST",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -205,19 +224,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.nil(204, operations.SubscribersControllerMarkNotificationsAsSeenResponse$inboundSchema.optional()),
+ M.nil(
+ 204,
+ operations
+ .SubscribersControllerMarkNotificationsAsSeenResponse$inboundSchema
+ .optional(),
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersNotificationsMarkAsUnread.ts b/libs/internal-sdk/src/funcs/subscribersNotificationsMarkAsUnread.ts
index 54386774b9e..179cd3cae8f 100644
--- a/libs/internal-sdk/src/funcs/subscribersNotificationsMarkAsUnread.ts
+++ b/libs/internal-sdk/src/funcs/subscribersNotificationsMarkAsUnread.ts
@@ -2,39 +2,41 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeFormQuery, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
- * Mark notification as unread
+ * Mark a notification as unread
*
* @remarks
- * Mark a specific notification as unread by its unique identifier **notificationId**.
+ * Mark a specific in-app (inbox) notification as unread by its unique identifier **notificationId**.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersNotificationsMarkAsUnread(
client: NovuCore,
request: operations.SubscribersControllerMarkNotificationAsUnreadRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersControllerMarkNotificationAsUnreadResponse,
@@ -50,13 +52,17 @@ export function subscribersNotificationsMarkAsUnread(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.SubscribersControllerMarkNotificationAsUnreadRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -77,56 +83,61 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.SubscribersControllerMarkNotificationAsUnreadRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .SubscribersControllerMarkNotificationAsUnreadRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- notificationId: encodeSimple('notificationId', payload.notificationId, {
+ notificationId: encodeSimple("notificationId", payload.notificationId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/subscribers/{subscriberId}/notifications/{notificationId}/unread')(pathParams);
+ const path = pathToFunc(
+ "/v2/subscribers/{subscriberId}/notifications/{notificationId}/unread",
+ )(pathParams);
const query = encodeFormQuery({
- contextKeys: payload.contextKeys,
+ "contextKeys": payload.contextKeys,
});
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_markNotificationAsUnread',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_markNotificationAsUnread",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -134,54 +145,51 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PATCH',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- query: query,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PATCH",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ query: query,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -202,22 +210,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.SubscribersControllerMarkNotificationAsUnreadResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .SubscribersControllerMarkNotificationAsUnreadResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersNotificationsRevertAction.ts b/libs/internal-sdk/src/funcs/subscribersNotificationsRevertAction.ts
index a9d22fcaeac..30ff266fc29 100644
--- a/libs/internal-sdk/src/funcs/subscribersNotificationsRevertAction.ts
+++ b/libs/internal-sdk/src/funcs/subscribersNotificationsRevertAction.ts
@@ -2,39 +2,41 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeFormQuery, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
- * Revert notification action
+ * Revert a notification action
*
* @remarks
- * Revert a notification action (primary or secondary) to pending state by its unique identifier **notificationId** and action type.
+ * Revert a single in-app (inbox) notification's action (primary or secondary) to pending state by its unique identifier **notificationId** and action type **actionType**.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersNotificationsRevertAction(
client: NovuCore,
request: operations.SubscribersControllerRevertNotificationActionRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersControllerRevertNotificationActionResponse,
@@ -50,13 +52,17 @@ export function subscribersNotificationsRevertAction(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.SubscribersControllerRevertNotificationActionRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -77,62 +83,65 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.SubscribersControllerRevertNotificationActionRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .SubscribersControllerRevertNotificationActionRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- actionType: encodeSimple('actionType', payload.actionType, {
+ actionType: encodeSimple("actionType", payload.actionType, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- notificationId: encodeSimple('notificationId', payload.notificationId, {
+ notificationId: encodeSimple("notificationId", payload.notificationId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/subscribers/{subscriberId}/notifications/{notificationId}/actions/{actionType}/revert')(
- pathParams
- );
+ const path = pathToFunc(
+ "/v2/subscribers/{subscriberId}/notifications/{notificationId}/actions/{actionType}/revert",
+ )(pathParams);
const query = encodeFormQuery({
- contextKeys: payload.contextKeys,
+ "contextKeys": payload.contextKeys,
});
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_revertNotificationAction',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_revertNotificationAction",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -140,54 +149,51 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PATCH',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- query: query,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PATCH",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ query: query,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -208,22 +214,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.SubscribersControllerRevertNotificationActionResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .SubscribersControllerRevertNotificationActionResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersNotificationsSnooze.ts b/libs/internal-sdk/src/funcs/subscribersNotificationsSnooze.ts
index dc4b83fa3dc..3a56fb7d5e4 100644
--- a/libs/internal-sdk/src/funcs/subscribersNotificationsSnooze.ts
+++ b/libs/internal-sdk/src/funcs/subscribersNotificationsSnooze.ts
@@ -2,39 +2,41 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeFormQuery, encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeFormQuery, encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
- * Snooze notification
+ * Snooze a notification
*
* @remarks
- * Snooze a specific notification by its unique identifier **notificationId** until a specified time.
+ * Snooze a specific in-app (inbox) notification by its unique identifier **notificationId** until a specified time.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersNotificationsSnooze(
client: NovuCore,
request: operations.SubscribersControllerSnoozeNotificationRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersControllerSnoozeNotificationResponse,
@@ -50,13 +52,17 @@ export function subscribersNotificationsSnooze(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.SubscribersControllerSnoozeNotificationRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -77,59 +83,63 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.SubscribersControllerSnoozeNotificationRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.SubscribersControllerSnoozeNotificationRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.SnoozeSubscriberNotificationDto, {
+ const body = encodeJSON("body", payload.SnoozeSubscriberNotificationDto, {
explode: true,
});
const pathParams = {
- notificationId: encodeSimple('notificationId', payload.notificationId, {
+ notificationId: encodeSimple("notificationId", payload.notificationId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/subscribers/{subscriberId}/notifications/{notificationId}/snooze')(pathParams);
+ const path = pathToFunc(
+ "/v2/subscribers/{subscriberId}/notifications/{notificationId}/snooze",
+ )(pathParams);
const query = encodeFormQuery({
- contextKeys: payload.contextKeys,
+ "contextKeys": payload.contextKeys,
});
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_snoozeNotification',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_snoozeNotification",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -137,54 +147,51 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PATCH',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- query: query,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PATCH",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ query: query,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -205,22 +212,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.SubscribersControllerSnoozeNotificationResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations.SubscribersControllerSnoozeNotificationResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersNotificationsUnarchive.ts b/libs/internal-sdk/src/funcs/subscribersNotificationsUnarchive.ts
index 8872a0b3a89..02185133c24 100644
--- a/libs/internal-sdk/src/funcs/subscribersNotificationsUnarchive.ts
+++ b/libs/internal-sdk/src/funcs/subscribersNotificationsUnarchive.ts
@@ -2,39 +2,41 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeFormQuery, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
- * Unarchive notification
+ * Unarchive a notification
*
* @remarks
- * Unarchive a specific notification by its unique identifier **notificationId**.
+ * Unarchive a specific in-app (inbox) notification by its unique identifier **notificationId**.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersNotificationsUnarchive(
client: NovuCore,
request: operations.SubscribersControllerUnarchiveNotificationRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersControllerUnarchiveNotificationResponse,
@@ -50,13 +52,17 @@ export function subscribersNotificationsUnarchive(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.SubscribersControllerUnarchiveNotificationRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -77,56 +83,62 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.SubscribersControllerUnarchiveNotificationRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .SubscribersControllerUnarchiveNotificationRequest$outboundSchema.parse(
+ value,
+ ),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- notificationId: encodeSimple('notificationId', payload.notificationId, {
+ notificationId: encodeSimple("notificationId", payload.notificationId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/subscribers/{subscriberId}/notifications/{notificationId}/unarchive')(pathParams);
+ const path = pathToFunc(
+ "/v2/subscribers/{subscriberId}/notifications/{notificationId}/unarchive",
+ )(pathParams);
const query = encodeFormQuery({
- contextKeys: payload.contextKeys,
+ "contextKeys": payload.contextKeys,
});
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_unarchiveNotification',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_unarchiveNotification",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -134,54 +146,51 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PATCH',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- query: query,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PATCH",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ query: query,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -202,22 +211,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.SubscribersControllerUnarchiveNotificationResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .SubscribersControllerUnarchiveNotificationResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersNotificationsUnseenCount.ts b/libs/internal-sdk/src/funcs/subscribersNotificationsUnseenCount.ts
index 66c199a8f42..60b774388ca 100644
--- a/libs/internal-sdk/src/funcs/subscribersNotificationsUnseenCount.ts
+++ b/libs/internal-sdk/src/funcs/subscribersNotificationsUnseenCount.ts
@@ -2,39 +2,41 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeFormQuery, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Retrieve unseen notifications count
*
* @remarks
* Retrieve unseen in-app (inbox) notifications count for a subscriber by its unique key identifier **subscriberId**.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersNotificationsUnseenCount(
client: NovuCore,
request: operations.SubscribersV1ControllerGetUnseenCountRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersV1ControllerGetUnseenCountResponse,
@@ -50,13 +52,17 @@ export function subscribersNotificationsUnseenCount(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.SubscribersV1ControllerGetUnseenCountRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -77,53 +83,57 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.SubscribersV1ControllerGetUnseenCountRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.SubscribersV1ControllerGetUnseenCountRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/subscribers/{subscriberId}/notifications/unseen')(pathParams);
+ const path = pathToFunc(
+ "/v1/subscribers/{subscriberId}/notifications/unseen",
+ )(pathParams);
const query = encodeFormQuery({
- limit: payload.limit,
- seen: payload.seen,
+ "limit": payload.limit,
+ "seen": payload.seen,
});
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersV1Controller_getUnseenCount',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersV1Controller_getUnseenCount",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -131,54 +141,51 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- query: query,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ query: query,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -199,19 +206,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.SubscribersV1ControllerGetUnseenCountResponse$inboundSchema, { hdrs: true, key: 'Result' }),
+ M.json(
+ 200,
+ operations.SubscribersV1ControllerGetUnseenCountResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersNotificationsUnsnooze.ts b/libs/internal-sdk/src/funcs/subscribersNotificationsUnsnooze.ts
index 777e98a5177..e9d06ee4803 100644
--- a/libs/internal-sdk/src/funcs/subscribersNotificationsUnsnooze.ts
+++ b/libs/internal-sdk/src/funcs/subscribersNotificationsUnsnooze.ts
@@ -2,39 +2,41 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeFormQuery, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
- * Unsnooze notification
+ * Unsnooze a notification
*
* @remarks
- * Unsnooze a specific notification by its unique identifier **notificationId**.
+ * Unsnooze a specific in-app (inbox) notification by its unique identifier **notificationId**.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersNotificationsUnsnooze(
client: NovuCore,
request: operations.SubscribersControllerUnsnoozeNotificationRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersControllerUnsnoozeNotificationResponse,
@@ -50,13 +52,17 @@ export function subscribersNotificationsUnsnooze(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.SubscribersControllerUnsnoozeNotificationRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -77,56 +83,60 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.SubscribersControllerUnsnoozeNotificationRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.SubscribersControllerUnsnoozeNotificationRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- notificationId: encodeSimple('notificationId', payload.notificationId, {
+ notificationId: encodeSimple("notificationId", payload.notificationId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/subscribers/{subscriberId}/notifications/{notificationId}/unsnooze')(pathParams);
+ const path = pathToFunc(
+ "/v2/subscribers/{subscriberId}/notifications/{notificationId}/unsnooze",
+ )(pathParams);
const query = encodeFormQuery({
- contextKeys: payload.contextKeys,
+ "contextKeys": payload.contextKeys,
});
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_unsnoozeNotification',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_unsnoozeNotification",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -134,54 +144,51 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PATCH',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- query: query,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PATCH",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ query: query,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -202,22 +209,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.SubscribersControllerUnsnoozeNotificationResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .SubscribersControllerUnsnoozeNotificationResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersPatch.ts b/libs/internal-sdk/src/funcs/subscribersPatch.ts
index 405ff486872..8568dc47c28 100644
--- a/libs/internal-sdk/src/funcs/subscribersPatch.ts
+++ b/libs/internal-sdk/src/funcs/subscribersPatch.ts
@@ -2,29 +2,29 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Update a subscriber
@@ -32,13 +32,15 @@ import { Result } from '../types/fp.js';
* @remarks
* Update a subscriber by its unique key identifier **subscriberId**.
* **subscriberId** is a required field, rest other fields are optional
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersPatch(
client: NovuCore,
patchSubscriberRequestDto: components.PatchSubscriberRequestDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersControllerPatchSubscriberResponse,
@@ -54,7 +56,13 @@ export function subscribersPatch(
| SDKValidationError
>
> {
- return new APIPromise($do(client, patchSubscriberRequestDto, subscriberId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ patchSubscriberRequestDto,
+ subscriberId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -62,7 +70,7 @@ async function $do(
patchSubscriberRequestDto: components.PatchSubscriberRequestDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -89,51 +97,53 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.SubscribersControllerPatchSubscriberRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.SubscribersControllerPatchSubscriberRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.PatchSubscriberRequestDto, {
+ const body = encodeJSON("body", payload.PatchSubscriberRequestDto, {
explode: true,
});
const pathParams = {
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/subscribers/{subscriberId}')(pathParams);
+ const path = pathToFunc("/v2/subscribers/{subscriberId}")(pathParams);
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_patchSubscriber',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_patchSubscriber",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -141,53 +151,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PATCH',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PATCH",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -208,19 +215,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.SubscribersControllerPatchSubscriberResponse$inboundSchema, { hdrs: true, key: 'Result' }),
+ M.json(
+ 200,
+ operations.SubscribersControllerPatchSubscriberResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersPreferencesBulkUpdate.ts b/libs/internal-sdk/src/funcs/subscribersPreferencesBulkUpdate.ts
index 35f4a2f0414..3a2e7381bd7 100644
--- a/libs/internal-sdk/src/funcs/subscribersPreferencesBulkUpdate.ts
+++ b/libs/internal-sdk/src/funcs/subscribersPreferencesBulkUpdate.ts
@@ -2,29 +2,29 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Bulk update subscriber preferences
@@ -32,13 +32,16 @@ import { Result } from '../types/fp.js';
* @remarks
* Bulk update subscriber preferences by its unique key identifier **subscriberId**.
* This API allows updating multiple workflow preferences in a single request.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersPreferencesBulkUpdate(
client: NovuCore,
- bulkUpdateSubscriberPreferencesDto: components.BulkUpdateSubscriberPreferencesDto,
+ bulkUpdateSubscriberPreferencesDto:
+ components.BulkUpdateSubscriberPreferencesDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersControllerBulkUpdateSubscriberPreferencesResponse,
@@ -54,15 +57,22 @@ export function subscribersPreferencesBulkUpdate(
| SDKValidationError
>
> {
- return new APIPromise($do(client, bulkUpdateSubscriberPreferencesDto, subscriberId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ bulkUpdateSubscriberPreferencesDto,
+ subscriberId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
- bulkUpdateSubscriberPreferencesDto: components.BulkUpdateSubscriberPreferencesDto,
+ bulkUpdateSubscriberPreferencesDto:
+ components.BulkUpdateSubscriberPreferencesDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -81,59 +91,65 @@ async function $do(
APICall,
]
> {
- const input: operations.SubscribersControllerBulkUpdateSubscriberPreferencesRequest = {
- bulkUpdateSubscriberPreferencesDto: bulkUpdateSubscriberPreferencesDto,
- subscriberId: subscriberId,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.SubscribersControllerBulkUpdateSubscriberPreferencesRequest = {
+ bulkUpdateSubscriberPreferencesDto: bulkUpdateSubscriberPreferencesDto,
+ subscriberId: subscriberId,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.SubscribersControllerBulkUpdateSubscriberPreferencesRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .SubscribersControllerBulkUpdateSubscriberPreferencesRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.BulkUpdateSubscriberPreferencesDto, {
+ const body = encodeJSON("body", payload.BulkUpdateSubscriberPreferencesDto, {
explode: true,
});
const pathParams = {
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/subscribers/{subscriberId}/preferences/bulk')(pathParams);
-
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v2/subscribers/{subscriberId}/preferences/bulk")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_bulkUpdateSubscriberPreferences',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_bulkUpdateSubscriberPreferences",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -141,53 +157,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PATCH',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PATCH",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -208,22 +221,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.SubscribersControllerBulkUpdateSubscriberPreferencesResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .SubscribersControllerBulkUpdateSubscriberPreferencesResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersPreferencesList.ts b/libs/internal-sdk/src/funcs/subscribersPreferencesList.ts
index cedf5078056..4aa0add269c 100644
--- a/libs/internal-sdk/src/funcs/subscribersPreferencesList.ts
+++ b/libs/internal-sdk/src/funcs/subscribersPreferencesList.ts
@@ -2,28 +2,28 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeFormQuery, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Retrieve subscriber preferences
@@ -31,11 +31,13 @@ import { Result } from '../types/fp.js';
* @remarks
* Retrieve subscriber channel preferences by its unique key identifier **subscriberId**.
* This API returns all five channels preferences for all workflows and global preferences.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersPreferencesList(
client: NovuCore,
request: operations.SubscribersControllerGetSubscriberPreferencesRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersControllerGetSubscriberPreferencesResponse,
@@ -51,13 +53,17 @@ export function subscribersPreferencesList(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.SubscribersControllerGetSubscriberPreferencesRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -78,53 +84,58 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.SubscribersControllerGetSubscriberPreferencesRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .SubscribersControllerGetSubscriberPreferencesRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/subscribers/{subscriberId}/preferences')(pathParams);
+ const path = pathToFunc("/v2/subscribers/{subscriberId}/preferences")(
+ pathParams,
+ );
const query = encodeFormQuery({
- contextKeys: payload.contextKeys,
- criticality: payload.criticality,
+ "contextKeys": payload.contextKeys,
+ "criticality": payload.criticality,
});
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_getSubscriberPreferences',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_getSubscriberPreferences",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -132,54 +143,51 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- query: query,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ query: query,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -200,22 +208,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.SubscribersControllerGetSubscriberPreferencesResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .SubscribersControllerGetSubscriberPreferencesResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersPreferencesUpdate.ts b/libs/internal-sdk/src/funcs/subscribersPreferencesUpdate.ts
index 0b552533afa..7931238b5d3 100644
--- a/libs/internal-sdk/src/funcs/subscribersPreferencesUpdate.ts
+++ b/libs/internal-sdk/src/funcs/subscribersPreferencesUpdate.ts
@@ -2,29 +2,29 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Update subscriber preferences
@@ -33,13 +33,15 @@ import { Result } from '../types/fp.js';
* Update subscriber preferences by its unique key identifier **subscriberId**.
* **workflowId** is optional field, if provided, this API will update that workflow preference,
* otherwise it will update global preferences
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersPreferencesUpdate(
client: NovuCore,
patchSubscriberPreferencesDto: components.PatchSubscriberPreferencesDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersControllerUpdateSubscriberPreferencesResponse,
@@ -55,7 +57,13 @@ export function subscribersPreferencesUpdate(
| SDKValidationError
>
> {
- return new APIPromise($do(client, patchSubscriberPreferencesDto, subscriberId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ patchSubscriberPreferencesDto,
+ subscriberId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -63,7 +71,7 @@ async function $do(
patchSubscriberPreferencesDto: components.PatchSubscriberPreferencesDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -82,59 +90,65 @@ async function $do(
APICall,
]
> {
- const input: operations.SubscribersControllerUpdateSubscriberPreferencesRequest = {
- patchSubscriberPreferencesDto: patchSubscriberPreferencesDto,
- subscriberId: subscriberId,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.SubscribersControllerUpdateSubscriberPreferencesRequest = {
+ patchSubscriberPreferencesDto: patchSubscriberPreferencesDto,
+ subscriberId: subscriberId,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.SubscribersControllerUpdateSubscriberPreferencesRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .SubscribersControllerUpdateSubscriberPreferencesRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.PatchSubscriberPreferencesDto, {
+ const body = encodeJSON("body", payload.PatchSubscriberPreferencesDto, {
explode: true,
});
const pathParams = {
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/subscribers/{subscriberId}/preferences')(pathParams);
-
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v2/subscribers/{subscriberId}/preferences")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_updateSubscriberPreferences',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_updateSubscriberPreferences",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -142,53 +156,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PATCH',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PATCH",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -209,22 +220,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.SubscribersControllerUpdateSubscriberPreferencesResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .SubscribersControllerUpdateSubscriberPreferencesResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersPropertiesUpdateOnlineFlag.ts b/libs/internal-sdk/src/funcs/subscribersPropertiesUpdateOnlineFlag.ts
index 5af69e23c24..2fd4f1f0054 100644
--- a/libs/internal-sdk/src/funcs/subscribersPropertiesUpdateOnlineFlag.ts
+++ b/libs/internal-sdk/src/funcs/subscribersPropertiesUpdateOnlineFlag.ts
@@ -2,42 +2,45 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Update subscriber online status
*
* @remarks
* Update the subscriber online status by its unique key identifier **subscriberId**
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersPropertiesUpdateOnlineFlag(
client: NovuCore,
- updateSubscriberOnlineFlagRequestDto: components.UpdateSubscriberOnlineFlagRequestDto,
+ updateSubscriberOnlineFlagRequestDto:
+ components.UpdateSubscriberOnlineFlagRequestDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersV1ControllerUpdateSubscriberOnlineFlagResponse,
@@ -53,15 +56,22 @@ export function subscribersPropertiesUpdateOnlineFlag(
| SDKValidationError
>
> {
- return new APIPromise($do(client, updateSubscriberOnlineFlagRequestDto, subscriberId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ updateSubscriberOnlineFlagRequestDto,
+ subscriberId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
- updateSubscriberOnlineFlagRequestDto: components.UpdateSubscriberOnlineFlagRequestDto,
+ updateSubscriberOnlineFlagRequestDto:
+ components.UpdateSubscriberOnlineFlagRequestDto,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -80,57 +90,68 @@ async function $do(
APICall,
]
> {
- const input: operations.SubscribersV1ControllerUpdateSubscriberOnlineFlagRequest = {
- updateSubscriberOnlineFlagRequestDto: updateSubscriberOnlineFlagRequestDto,
- subscriberId: subscriberId,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.SubscribersV1ControllerUpdateSubscriberOnlineFlagRequest = {
+ updateSubscriberOnlineFlagRequestDto:
+ updateSubscriberOnlineFlagRequestDto,
+ subscriberId: subscriberId,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.SubscribersV1ControllerUpdateSubscriberOnlineFlagRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .SubscribersV1ControllerUpdateSubscriberOnlineFlagRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.UpdateSubscriberOnlineFlagRequestDto, { explode: true });
+ const body = encodeJSON(
+ "body",
+ payload.UpdateSubscriberOnlineFlagRequestDto,
+ { explode: true },
+ );
const pathParams = {
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/subscribers/{subscriberId}/online-status')(pathParams);
-
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v1/subscribers/{subscriberId}/online-status")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersV1Controller_updateSubscriberOnlineFlag',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersV1Controller_updateSubscriberOnlineFlag",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -138,53 +159,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PATCH',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PATCH",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -205,22 +223,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.SubscribersV1ControllerUpdateSubscriberOnlineFlagResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .SubscribersV1ControllerUpdateSubscriberOnlineFlagResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersRetrieve.ts b/libs/internal-sdk/src/funcs/subscribersRetrieve.ts
index 2b56ac1e428..64d0a848b6b 100644
--- a/libs/internal-sdk/src/funcs/subscribersRetrieve.ts
+++ b/libs/internal-sdk/src/funcs/subscribersRetrieve.ts
@@ -2,28 +2,28 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Retrieve a subscriber
@@ -31,12 +31,14 @@ import { Result } from '../types/fp.js';
* @remarks
* Retrieve a subscriber by its unique key identifier **subscriberId**.
* **subscriberId** field is required.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersRetrieve(
client: NovuCore,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersControllerGetSubscriberResponse,
@@ -52,14 +54,19 @@ export function subscribersRetrieve(
| SDKValidationError
>
> {
- return new APIPromise($do(client, subscriberId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ subscriberId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
subscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -85,48 +92,51 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.SubscribersControllerGetSubscriberRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.SubscribersControllerGetSubscriberRequest$outboundSchema.parse(
+ value,
+ ),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/subscribers/{subscriberId}')(pathParams);
+ const path = pathToFunc("/v2/subscribers/{subscriberId}")(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_getSubscriber',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_getSubscriber",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -134,53 +144,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -201,19 +208,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.SubscribersControllerGetSubscriberResponse$inboundSchema, { hdrs: true, key: 'Result' }),
+ M.json(
+ 200,
+ operations.SubscribersControllerGetSubscriberResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/subscribersSearch.ts b/libs/internal-sdk/src/funcs/subscribersSearch.ts
index e790c2f8c0b..151969e2d70 100644
--- a/libs/internal-sdk/src/funcs/subscribersSearch.ts
+++ b/libs/internal-sdk/src/funcs/subscribersSearch.ts
@@ -31,6 +31,8 @@ import { Result } from "../types/fp.js";
* @remarks
* Search subscribers by their **email**, **phone**, **subscriberId** and **name**.
* The search is case sensitive and supports pagination.Checkout all available filters in the query section.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersSearch(
client: NovuCore,
@@ -118,7 +120,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/subscribersTopicsList.ts b/libs/internal-sdk/src/funcs/subscribersTopicsList.ts
index 953976df787..969274a50ce 100644
--- a/libs/internal-sdk/src/funcs/subscribersTopicsList.ts
+++ b/libs/internal-sdk/src/funcs/subscribersTopicsList.ts
@@ -2,28 +2,28 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeFormQuery, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Retrieve subscriber subscriptions
@@ -31,11 +31,13 @@ import { Result } from '../types/fp.js';
* @remarks
* Retrieve subscriber's topic subscriptions by its unique key identifier **subscriberId**.
* Checkout all available filters in the query section.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function subscribersTopicsList(
client: NovuCore,
request: operations.SubscribersControllerListSubscriberTopicsRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.SubscribersControllerListSubscriberTopicsResponse,
@@ -51,13 +53,17 @@ export function subscribersTopicsList(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.SubscribersControllerListSubscriberTopicsRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -78,59 +84,63 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.SubscribersControllerListSubscriberTopicsRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.SubscribersControllerListSubscriberTopicsRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- subscriberId: encodeSimple('subscriberId', payload.subscriberId, {
+ subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/subscribers/{subscriberId}/subscriptions')(pathParams);
+ const path = pathToFunc("/v2/subscribers/{subscriberId}/subscriptions")(
+ pathParams,
+ );
const query = encodeFormQuery({
- after: payload.after,
- before: payload.before,
- contextKeys: payload.contextKeys,
- includeCursor: payload.includeCursor,
- key: payload.key,
- limit: payload.limit,
- orderBy: payload.orderBy,
- orderDirection: payload.orderDirection,
+ "after": payload.after,
+ "before": payload.before,
+ "contextKeys": payload.contextKeys,
+ "includeCursor": payload.includeCursor,
+ "key": payload.key,
+ "limit": payload.limit,
+ "orderBy": payload.orderBy,
+ "orderDirection": payload.orderDirection,
});
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'SubscribersController_listSubscriberTopics',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "SubscribersController_listSubscriberTopics",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -138,54 +148,51 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- query: query,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ query: query,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -206,22 +213,28 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.SubscribersControllerListSubscriberTopicsResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations
+ .SubscribersControllerListSubscriberTopicsResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/topicsCreate.ts b/libs/internal-sdk/src/funcs/topicsCreate.ts
index 4a3616affbc..f85c70aa113 100644
--- a/libs/internal-sdk/src/funcs/topicsCreate.ts
+++ b/libs/internal-sdk/src/funcs/topicsCreate.ts
@@ -31,6 +31,8 @@ import { Result } from "../types/fp.js";
*
* @remarks
* Creates a new topic if it does not exist, or updates an existing topic if it already exists. Use ?failIfExists=true to prevent updates.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function topicsCreate(
client: NovuCore,
@@ -125,7 +127,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/topicsDelete.ts b/libs/internal-sdk/src/funcs/topicsDelete.ts
index ab378df6330..3aeae6b0b06 100644
--- a/libs/internal-sdk/src/funcs/topicsDelete.ts
+++ b/libs/internal-sdk/src/funcs/topicsDelete.ts
@@ -2,28 +2,28 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Delete a topic
@@ -31,12 +31,14 @@ import { Result } from '../types/fp.js';
* @remarks
* Delete a topic by its unique key identifier **topicKey**.
* This action is irreversible and will remove all subscriptions to the topic.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function topicsDelete(
client: NovuCore,
topicKey: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.TopicsControllerDeleteTopicResponse,
@@ -52,14 +54,19 @@ export function topicsDelete(
| SDKValidationError
>
> {
- return new APIPromise($do(client, topicKey, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ topicKey,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
topicKey: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -85,48 +92,49 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.TopicsControllerDeleteTopicRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.TopicsControllerDeleteTopicRequest$outboundSchema.parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- topicKey: encodeSimple('topicKey', payload.topicKey, {
+ topicKey: encodeSimple("topicKey", payload.topicKey, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/topics/{topicKey}')(pathParams);
+ const path = pathToFunc("/v2/topics/{topicKey}")(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'TopicsController_deleteTopic',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "TopicsController_deleteTopic",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -134,53 +142,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'DELETE',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "DELETE",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -203,20 +208,24 @@ async function $do(
>(
M.json(200, operations.TopicsControllerDeleteTopicResponse$inboundSchema, {
hdrs: true,
- key: 'Result',
+ key: "Result",
}),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/topicsGet.ts b/libs/internal-sdk/src/funcs/topicsGet.ts
index 8d19b56a6dd..030bcf87e88 100644
--- a/libs/internal-sdk/src/funcs/topicsGet.ts
+++ b/libs/internal-sdk/src/funcs/topicsGet.ts
@@ -2,40 +2,42 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Retrieve a topic
*
* @remarks
* Retrieve a topic by its unique key identifier **topicKey**
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function topicsGet(
client: NovuCore,
topicKey: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.TopicsControllerGetTopicResponse,
@@ -51,14 +53,19 @@ export function topicsGet(
| SDKValidationError
>
> {
- return new APIPromise($do(client, topicKey, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ topicKey,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
topicKey: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -84,48 +91,49 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.TopicsControllerGetTopicRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.TopicsControllerGetTopicRequest$outboundSchema.parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- topicKey: encodeSimple('topicKey', payload.topicKey, {
+ topicKey: encodeSimple("topicKey", payload.topicKey, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/topics/{topicKey}')(pathParams);
+ const path = pathToFunc("/v2/topics/{topicKey}")(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'TopicsController_getTopic',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "TopicsController_getTopic",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -133,53 +141,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -202,20 +207,24 @@ async function $do(
>(
M.json(200, operations.TopicsControllerGetTopicResponse$inboundSchema, {
hdrs: true,
- key: 'Result',
+ key: "Result",
}),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/topicsList.ts b/libs/internal-sdk/src/funcs/topicsList.ts
index b5268a22ab4..43f3adf8d01 100644
--- a/libs/internal-sdk/src/funcs/topicsList.ts
+++ b/libs/internal-sdk/src/funcs/topicsList.ts
@@ -32,6 +32,8 @@ import { Result } from "../types/fp.js";
* This api returns a paginated list of topics.
* Topics can be filtered by **key**, **name**, or **includeCursor** to paginate through the list.
* Checkout all available filters in the query section.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function topicsList(
client: NovuCore,
@@ -116,7 +118,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/topicsSubscribersRetrieve.ts b/libs/internal-sdk/src/funcs/topicsSubscribersRetrieve.ts
index 8d2a0caf18c..652a2f8d310 100644
--- a/libs/internal-sdk/src/funcs/topicsSubscribersRetrieve.ts
+++ b/libs/internal-sdk/src/funcs/topicsSubscribersRetrieve.ts
@@ -2,41 +2,43 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Check topic subscriber
*
* @remarks
* Check if a subscriber belongs to a certain topic
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function topicsSubscribersRetrieve(
client: NovuCore,
topicKey: string,
externalSubscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.TopicsV1ControllerGetTopicSubscriberResponse,
@@ -52,7 +54,13 @@ export function topicsSubscribersRetrieve(
| SDKValidationError
>
> {
- return new APIPromise($do(client, topicKey, externalSubscriberId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ topicKey,
+ externalSubscriberId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -60,7 +68,7 @@ async function $do(
topicKey: string,
externalSubscriberId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -87,52 +95,57 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.TopicsV1ControllerGetTopicSubscriberRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.TopicsV1ControllerGetTopicSubscriberRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- externalSubscriberId: encodeSimple('externalSubscriberId', payload.externalSubscriberId, {
- explode: false,
- charEncoding: 'percent',
- }),
- topicKey: encodeSimple('topicKey', payload.topicKey, {
+ externalSubscriberId: encodeSimple(
+ "externalSubscriberId",
+ payload.externalSubscriberId,
+ { explode: false, charEncoding: "percent" },
+ ),
+ topicKey: encodeSimple("topicKey", payload.topicKey, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v1/topics/{topicKey}/subscribers/{externalSubscriberId}')(pathParams);
+ const path = pathToFunc(
+ "/v1/topics/{topicKey}/subscribers/{externalSubscriberId}",
+ )(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'TopicsV1Controller_getTopicSubscriber',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "TopicsV1Controller_getTopicSubscriber",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -140,53 +153,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -207,19 +217,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.TopicsV1ControllerGetTopicSubscriberResponse$inboundSchema, { hdrs: true, key: 'Result' }),
+ M.json(
+ 200,
+ operations.TopicsV1ControllerGetTopicSubscriberResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/topicsSubscriptionsCreate.ts b/libs/internal-sdk/src/funcs/topicsSubscriptionsCreate.ts
index 309649fea2c..45a208116a9 100644
--- a/libs/internal-sdk/src/funcs/topicsSubscriptionsCreate.ts
+++ b/libs/internal-sdk/src/funcs/topicsSubscriptionsCreate.ts
@@ -2,29 +2,29 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Create topic subscriptions
@@ -32,13 +32,16 @@ import { Result } from '../types/fp.js';
* @remarks
* This api will create subscription for subscriberIds for a topic.
* Its like subscribing to a common interest group. if topic does not exist, it will be created.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function topicsSubscriptionsCreate(
client: NovuCore,
- createTopicSubscriptionsRequestDto: components.CreateTopicSubscriptionsRequestDto,
+ createTopicSubscriptionsRequestDto:
+ components.CreateTopicSubscriptionsRequestDto,
topicKey: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.TopicsControllerCreateTopicSubscriptionsResponse,
@@ -54,15 +57,22 @@ export function topicsSubscriptionsCreate(
| SDKValidationError
>
> {
- return new APIPromise($do(client, createTopicSubscriptionsRequestDto, topicKey, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ createTopicSubscriptionsRequestDto,
+ topicKey,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
- createTopicSubscriptionsRequestDto: components.CreateTopicSubscriptionsRequestDto,
+ createTopicSubscriptionsRequestDto:
+ components.CreateTopicSubscriptionsRequestDto,
topicKey: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -89,51 +99,53 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.TopicsControllerCreateTopicSubscriptionsRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.TopicsControllerCreateTopicSubscriptionsRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.CreateTopicSubscriptionsRequestDto, {
+ const body = encodeJSON("body", payload.CreateTopicSubscriptionsRequestDto, {
explode: true,
});
const pathParams = {
- topicKey: encodeSimple('topicKey', payload.topicKey, {
+ topicKey: encodeSimple("topicKey", payload.topicKey, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/topics/{topicKey}/subscriptions')(pathParams);
+ const path = pathToFunc("/v2/topics/{topicKey}/subscriptions")(pathParams);
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'TopicsController_createTopicSubscriptions',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "TopicsController_createTopicSubscriptions",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -141,53 +153,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'POST',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "POST",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -208,22 +217,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(201, operations.TopicsControllerCreateTopicSubscriptionsResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 201,
+ operations.TopicsControllerCreateTopicSubscriptionsResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/topicsSubscriptionsDelete.ts b/libs/internal-sdk/src/funcs/topicsSubscriptionsDelete.ts
index 188131a6791..a44140effc5 100644
--- a/libs/internal-sdk/src/funcs/topicsSubscriptionsDelete.ts
+++ b/libs/internal-sdk/src/funcs/topicsSubscriptionsDelete.ts
@@ -2,42 +2,45 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Delete topic subscriptions
*
* @remarks
* Delete subscriptions for subscriberIds for a topic.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function topicsSubscriptionsDelete(
client: NovuCore,
- deleteTopicSubscriptionsRequestDto: components.DeleteTopicSubscriptionsRequestDto,
+ deleteTopicSubscriptionsRequestDto:
+ components.DeleteTopicSubscriptionsRequestDto,
topicKey: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.TopicsControllerDeleteTopicSubscriptionsResponse,
@@ -53,15 +56,22 @@ export function topicsSubscriptionsDelete(
| SDKValidationError
>
> {
- return new APIPromise($do(client, deleteTopicSubscriptionsRequestDto, topicKey, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ deleteTopicSubscriptionsRequestDto,
+ topicKey,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
- deleteTopicSubscriptionsRequestDto: components.DeleteTopicSubscriptionsRequestDto,
+ deleteTopicSubscriptionsRequestDto:
+ components.DeleteTopicSubscriptionsRequestDto,
topicKey: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -88,51 +98,53 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.TopicsControllerDeleteTopicSubscriptionsRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.TopicsControllerDeleteTopicSubscriptionsRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.DeleteTopicSubscriptionsRequestDto, {
+ const body = encodeJSON("body", payload.DeleteTopicSubscriptionsRequestDto, {
explode: true,
});
const pathParams = {
- topicKey: encodeSimple('topicKey', payload.topicKey, {
+ topicKey: encodeSimple("topicKey", payload.topicKey, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/topics/{topicKey}/subscriptions')(pathParams);
+ const path = pathToFunc("/v2/topics/{topicKey}/subscriptions")(pathParams);
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'TopicsController_deleteTopicSubscriptions',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "TopicsController_deleteTopicSubscriptions",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -140,53 +152,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'DELETE',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "DELETE",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -207,22 +216,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.TopicsControllerDeleteTopicSubscriptionsResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations.TopicsControllerDeleteTopicSubscriptionsResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/topicsSubscriptionsGetSubscription.ts b/libs/internal-sdk/src/funcs/topicsSubscriptionsGetSubscription.ts
index bccd2375035..5055bfb3396 100644
--- a/libs/internal-sdk/src/funcs/topicsSubscriptionsGetSubscription.ts
+++ b/libs/internal-sdk/src/funcs/topicsSubscriptionsGetSubscription.ts
@@ -2,41 +2,43 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Retrieve a topic subscription
*
* @remarks
* Retrieve a subscription by its unique identifier for a topic.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function topicsSubscriptionsGetSubscription(
client: NovuCore,
topicKey: string,
identifier: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.TopicsControllerGetTopicSubscriptionResponse,
@@ -52,7 +54,13 @@ export function topicsSubscriptionsGetSubscription(
| SDKValidationError
>
> {
- return new APIPromise($do(client, topicKey, identifier, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ topicKey,
+ identifier,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -60,7 +68,7 @@ async function $do(
topicKey: string,
identifier: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -87,52 +95,56 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.TopicsControllerGetTopicSubscriptionRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.TopicsControllerGetTopicSubscriptionRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- identifier: encodeSimple('identifier', payload.identifier, {
+ identifier: encodeSimple("identifier", payload.identifier, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- topicKey: encodeSimple('topicKey', payload.topicKey, {
+ topicKey: encodeSimple("topicKey", payload.topicKey, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/topics/{topicKey}/subscriptions/{identifier}')(pathParams);
-
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v2/topics/{topicKey}/subscriptions/{identifier}")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'TopicsController_getTopicSubscription',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "TopicsController_getTopicSubscription",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -140,53 +152,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -207,19 +216,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.TopicsControllerGetTopicSubscriptionResponse$inboundSchema, { hdrs: true, key: 'Result' }),
+ M.json(
+ 200,
+ operations.TopicsControllerGetTopicSubscriptionResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/topicsSubscriptionsList.ts b/libs/internal-sdk/src/funcs/topicsSubscriptionsList.ts
index fc322ff5b55..e535956528e 100644
--- a/libs/internal-sdk/src/funcs/topicsSubscriptionsList.ts
+++ b/libs/internal-sdk/src/funcs/topicsSubscriptionsList.ts
@@ -2,28 +2,28 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeFormQuery, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* List topic subscriptions
@@ -31,11 +31,13 @@ import { Result } from '../types/fp.js';
* @remarks
* List all subscriptions of subscribers for a topic.
* Checkout all available filters in the query section.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function topicsSubscriptionsList(
client: NovuCore,
request: operations.TopicsControllerListTopicSubscriptionsRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.TopicsControllerListTopicSubscriptionsResponse,
@@ -51,13 +53,17 @@ export function topicsSubscriptionsList(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.TopicsControllerListTopicSubscriptionsRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -78,59 +84,61 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.TopicsControllerListTopicSubscriptionsRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.TopicsControllerListTopicSubscriptionsRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- topicKey: encodeSimple('topicKey', payload.topicKey, {
+ topicKey: encodeSimple("topicKey", payload.topicKey, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/topics/{topicKey}/subscriptions')(pathParams);
+ const path = pathToFunc("/v2/topics/{topicKey}/subscriptions")(pathParams);
const query = encodeFormQuery({
- after: payload.after,
- before: payload.before,
- contextKeys: payload.contextKeys,
- includeCursor: payload.includeCursor,
- limit: payload.limit,
- orderBy: payload.orderBy,
- orderDirection: payload.orderDirection,
- subscriberId: payload.subscriberId,
+ "after": payload.after,
+ "before": payload.before,
+ "contextKeys": payload.contextKeys,
+ "includeCursor": payload.includeCursor,
+ "limit": payload.limit,
+ "orderBy": payload.orderBy,
+ "orderDirection": payload.orderDirection,
+ "subscriberId": payload.subscriberId,
});
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'TopicsController_listTopicSubscriptions',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "TopicsController_listTopicSubscriptions",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -138,54 +146,51 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- query: query,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ query: query,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -206,19 +211,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.TopicsControllerListTopicSubscriptionsResponse$inboundSchema, { hdrs: true, key: 'Result' }),
+ M.json(
+ 200,
+ operations.TopicsControllerListTopicSubscriptionsResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/topicsSubscriptionsUpdate.ts b/libs/internal-sdk/src/funcs/topicsSubscriptionsUpdate.ts
index 485652672b2..e2ac0ba3673 100644
--- a/libs/internal-sdk/src/funcs/topicsSubscriptionsUpdate.ts
+++ b/libs/internal-sdk/src/funcs/topicsSubscriptionsUpdate.ts
@@ -2,39 +2,41 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Update a topic subscription
*
* @remarks
* Update a subscription by its unique identifier for a topic. You can update the preferences and name associated with the subscription.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function topicsSubscriptionsUpdate(
client: NovuCore,
request: operations.TopicsControllerUpdateTopicSubscriptionRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.TopicsControllerUpdateTopicSubscriptionResponse,
@@ -50,13 +52,17 @@ export function topicsSubscriptionsUpdate(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.TopicsControllerUpdateTopicSubscriptionRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -77,55 +83,59 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.TopicsControllerUpdateTopicSubscriptionRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.TopicsControllerUpdateTopicSubscriptionRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.UpdateTopicSubscriptionRequestDto, {
+ const body = encodeJSON("body", payload.UpdateTopicSubscriptionRequestDto, {
explode: true,
});
const pathParams = {
- identifier: encodeSimple('identifier', payload.identifier, {
+ identifier: encodeSimple("identifier", payload.identifier, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- topicKey: encodeSimple('topicKey', payload.topicKey, {
+ topicKey: encodeSimple("topicKey", payload.topicKey, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/topics/{topicKey}/subscriptions/{identifier}')(pathParams);
-
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v2/topics/{topicKey}/subscriptions/{identifier}")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'TopicsController_updateTopicSubscription',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "TopicsController_updateTopicSubscription",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -133,53 +143,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PATCH',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PATCH",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -200,22 +207,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.TopicsControllerUpdateTopicSubscriptionResponse$inboundSchema, {
- hdrs: true,
- key: 'Result',
- }),
+ M.json(
+ 200,
+ operations.TopicsControllerUpdateTopicSubscriptionResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/topicsUpdate.ts b/libs/internal-sdk/src/funcs/topicsUpdate.ts
index 15bd2284b92..e4d389e2434 100644
--- a/libs/internal-sdk/src/funcs/topicsUpdate.ts
+++ b/libs/internal-sdk/src/funcs/topicsUpdate.ts
@@ -2,42 +2,44 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Update a topic
*
* @remarks
* Update a topic name by its unique key identifier **topicKey**
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function topicsUpdate(
client: NovuCore,
updateTopicRequestDto: components.UpdateTopicRequestDto,
topicKey: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.TopicsControllerUpdateTopicResponse,
@@ -53,7 +55,13 @@ export function topicsUpdate(
| SDKValidationError
>
> {
- return new APIPromise($do(client, updateTopicRequestDto, topicKey, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ updateTopicRequestDto,
+ topicKey,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -61,7 +69,7 @@ async function $do(
updateTopicRequestDto: components.UpdateTopicRequestDto,
topicKey: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -88,51 +96,52 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.TopicsControllerUpdateTopicRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.TopicsControllerUpdateTopicRequest$outboundSchema.parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.UpdateTopicRequestDto, {
+ const body = encodeJSON("body", payload.UpdateTopicRequestDto, {
explode: true,
});
const pathParams = {
- topicKey: encodeSimple('topicKey', payload.topicKey, {
+ topicKey: encodeSimple("topicKey", payload.topicKey, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/topics/{topicKey}')(pathParams);
+ const path = pathToFunc("/v2/topics/{topicKey}")(pathParams);
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'TopicsController_updateTopic',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "TopicsController_updateTopic",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -140,53 +149,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PATCH',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PATCH",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -209,20 +215,24 @@ async function $do(
>(
M.json(200, operations.TopicsControllerUpdateTopicResponse$inboundSchema, {
hdrs: true,
- key: 'Result',
+ key: "Result",
}),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/translationsCreate.ts b/libs/internal-sdk/src/funcs/translationsCreate.ts
index ac051f9277e..ac87b986fd1 100644
--- a/libs/internal-sdk/src/funcs/translationsCreate.ts
+++ b/libs/internal-sdk/src/funcs/translationsCreate.ts
@@ -30,6 +30,8 @@ import { Result } from "../types/fp.js";
*
* @remarks
* Create a translation for a specific workflow and locale, if the translation already exists, it will be updated
+ *
+ * This operation requires one of {@link Security.secretKey}, {@link Security.bearerAuth}, or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function translationsCreate(
client: NovuCore,
@@ -113,7 +115,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0, 1]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/translationsDelete.ts b/libs/internal-sdk/src/funcs/translationsDelete.ts
index 369af1dae35..67bf240402d 100644
--- a/libs/internal-sdk/src/funcs/translationsDelete.ts
+++ b/libs/internal-sdk/src/funcs/translationsDelete.ts
@@ -2,39 +2,41 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as z from 'zod/v3';
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import * as z from "zod/v3";
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Delete a translation
*
* @remarks
* Delete a specific translation by resource type, resource ID and locale
+ *
+ * This operation requires one of {@link Security.secretKey}, {@link Security.bearerAuth}, or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function translationsDelete(
client: NovuCore,
request: operations.TranslationControllerDeleteTranslationEndpointRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
void,
@@ -48,13 +50,17 @@ export function translationsDelete(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.TranslationControllerDeleteTranslationEndpointRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -73,56 +79,61 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.TranslationControllerDeleteTranslationEndpointRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .TranslationControllerDeleteTranslationEndpointRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- locale: encodeSimple('locale', payload.locale, {
+ locale: encodeSimple("locale", payload.locale, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- resourceId: encodeSimple('resourceId', payload.resourceId, {
+ resourceId: encodeSimple("resourceId", payload.resourceId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- resourceType: encodeSimple('resourceType', payload.resourceType, {
+ resourceType: encodeSimple("resourceType", payload.resourceType, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/translations/{resourceType}/{resourceId}/{locale}')(pathParams);
+ const path = pathToFunc(
+ "/v2/translations/{resourceType}/{resourceId}/{locale}",
+ )(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: '*/*',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "*/*",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0, 1]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'TranslationController_deleteTranslationEndpoint',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "TranslationController_deleteTranslationEndpoint",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -130,37 +141,34 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'DELETE',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "DELETE",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
- errorCodes: ['404', '4XX', '5XX'],
+ errorCodes: ["404", "4XX", "5XX"],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -176,12 +184,12 @@ async function $do(
| SDKValidationError
>(
M.nil(204, z.void()),
- M.fail([404, '4XX']),
- M.fail('5XX')
+ M.fail([404, "4XX"]),
+ M.fail("5XX"),
)(response, req);
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/translationsGroupsDelete.ts b/libs/internal-sdk/src/funcs/translationsGroupsDelete.ts
index 47e6dba157e..fe515b3898a 100644
--- a/libs/internal-sdk/src/funcs/translationsGroupsDelete.ts
+++ b/libs/internal-sdk/src/funcs/translationsGroupsDelete.ts
@@ -2,41 +2,44 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as z from 'zod/v3';
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import * as z from "zod/v3";
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Delete a translation group
*
* @remarks
* Delete an entire translation group and all its translations
+ *
+ * This operation requires one of {@link Security.secretKey}, {@link Security.bearerAuth}, or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function translationsGroupsDelete(
client: NovuCore,
- resourceType: operations.TranslationControllerDeleteTranslationGroupEndpointPathParamResourceType,
+ resourceType:
+ operations.TranslationControllerDeleteTranslationGroupEndpointPathParamResourceType,
resourceId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
void,
@@ -50,15 +53,22 @@ export function translationsGroupsDelete(
| SDKValidationError
>
> {
- return new APIPromise($do(client, resourceType, resourceId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ resourceType,
+ resourceId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
- resourceType: operations.TranslationControllerDeleteTranslationGroupEndpointPathParamResourceType,
+ resourceType:
+ operations.TranslationControllerDeleteTranslationGroupEndpointPathParamResourceType,
resourceId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -75,60 +85,66 @@ async function $do(
APICall,
]
> {
- const input: operations.TranslationControllerDeleteTranslationGroupEndpointRequest = {
- resourceType: resourceType,
- resourceId: resourceId,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.TranslationControllerDeleteTranslationGroupEndpointRequest = {
+ resourceType: resourceType,
+ resourceId: resourceId,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.TranslationControllerDeleteTranslationGroupEndpointRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .TranslationControllerDeleteTranslationGroupEndpointRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- resourceId: encodeSimple('resourceId', payload.resourceId, {
+ resourceId: encodeSimple("resourceId", payload.resourceId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- resourceType: encodeSimple('resourceType', payload.resourceType, {
+ resourceType: encodeSimple("resourceType", payload.resourceType, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/translations/{resourceType}/{resourceId}')(pathParams);
-
- const headers = new Headers(
- compactMap({
- Accept: '*/*',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v2/translations/{resourceType}/{resourceId}")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ Accept: "*/*",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0, 1]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'TranslationController_deleteTranslationGroupEndpoint',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "TranslationController_deleteTranslationGroupEndpoint",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -136,37 +152,34 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'DELETE',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "DELETE",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
- errorCodes: ['404', '4XX', '5XX'],
+ errorCodes: ["404", "4XX", "5XX"],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -182,12 +195,12 @@ async function $do(
| SDKValidationError
>(
M.nil(204, z.void()),
- M.fail([404, '4XX']),
- M.fail('5XX')
+ M.fail([404, "4XX"]),
+ M.fail("5XX"),
)(response, req);
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/translationsGroupsRetrieve.ts b/libs/internal-sdk/src/funcs/translationsGroupsRetrieve.ts
index f0626637896..66cfe9d69bb 100644
--- a/libs/internal-sdk/src/funcs/translationsGroupsRetrieve.ts
+++ b/libs/internal-sdk/src/funcs/translationsGroupsRetrieve.ts
@@ -2,41 +2,44 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Retrieve a translation group
*
* @remarks
* Retrieves a single translation group by resource type (workflow, layout) and resource ID (workflowId, layoutId)
+ *
+ * This operation requires one of {@link Security.secretKey}, {@link Security.bearerAuth}, or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function translationsGroupsRetrieve(
client: NovuCore,
- resourceType: operations.TranslationControllerGetTranslationGroupEndpointPathParamResourceType,
+ resourceType:
+ operations.TranslationControllerGetTranslationGroupEndpointPathParamResourceType,
resourceId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
components.TranslationGroupDto,
@@ -50,15 +53,22 @@ export function translationsGroupsRetrieve(
| SDKValidationError
>
> {
- return new APIPromise($do(client, resourceType, resourceId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ resourceType,
+ resourceId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
- resourceType: operations.TranslationControllerGetTranslationGroupEndpointPathParamResourceType,
+ resourceType:
+ operations.TranslationControllerGetTranslationGroupEndpointPathParamResourceType,
resourceId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -75,60 +85,66 @@ async function $do(
APICall,
]
> {
- const input: operations.TranslationControllerGetTranslationGroupEndpointRequest = {
- resourceType: resourceType,
- resourceId: resourceId,
- idempotencyKey: idempotencyKey,
- };
+ const input:
+ operations.TranslationControllerGetTranslationGroupEndpointRequest = {
+ resourceType: resourceType,
+ resourceId: resourceId,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.TranslationControllerGetTranslationGroupEndpointRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .TranslationControllerGetTranslationGroupEndpointRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- resourceId: encodeSimple('resourceId', payload.resourceId, {
+ resourceId: encodeSimple("resourceId", payload.resourceId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- resourceType: encodeSimple('resourceType', payload.resourceType, {
+ resourceType: encodeSimple("resourceType", payload.resourceType, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/translations/group/{resourceType}/{resourceId}')(pathParams);
-
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v2/translations/group/{resourceType}/{resourceId}")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0, 1]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'TranslationController_getTranslationGroupEndpoint',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "TranslationController_getTranslationGroupEndpoint",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -136,37 +152,34 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
- errorCodes: ['404', '4XX', '5XX'],
+ errorCodes: ["404", "4XX", "5XX"],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -182,12 +195,12 @@ async function $do(
| SDKValidationError
>(
M.json(200, components.TranslationGroupDto$inboundSchema),
- M.fail([404, '4XX']),
- M.fail('5XX')
+ M.fail([404, "4XX"]),
+ M.fail("5XX"),
)(response, req);
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/translationsMasterImport.ts b/libs/internal-sdk/src/funcs/translationsMasterImport.ts
index b1160feeb8b..4c6aa2c9b55 100644
--- a/libs/internal-sdk/src/funcs/translationsMasterImport.ts
+++ b/libs/internal-sdk/src/funcs/translationsMasterImport.ts
@@ -30,6 +30,8 @@ import { Result } from "../types/fp.js";
*
* @remarks
* Import translations for multiple workflows from master JSON format for a specific locale
+ *
+ * This operation requires one of {@link Security.secretKey}, {@link Security.bearerAuth}, or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function translationsMasterImport(
client: NovuCore,
@@ -113,7 +115,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0, 1]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/translationsMasterRetrieve.ts b/libs/internal-sdk/src/funcs/translationsMasterRetrieve.ts
index a50cc3e9d71..a52583808dc 100644
--- a/libs/internal-sdk/src/funcs/translationsMasterRetrieve.ts
+++ b/libs/internal-sdk/src/funcs/translationsMasterRetrieve.ts
@@ -30,6 +30,8 @@ import { Result } from "../types/fp.js";
*
* @remarks
* Retrieve all translations for a locale in master JSON format organized by resourceId (workflowId)
+ *
+ * This operation requires one of {@link Security.secretKey}, {@link Security.bearerAuth}, or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function translationsMasterRetrieve(
client: NovuCore,
@@ -114,7 +116,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0, 1]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/translationsMasterUpload.ts b/libs/internal-sdk/src/funcs/translationsMasterUpload.ts
index 5a5ed2d72b9..6442e73a580 100644
--- a/libs/internal-sdk/src/funcs/translationsMasterUpload.ts
+++ b/libs/internal-sdk/src/funcs/translationsMasterUpload.ts
@@ -2,43 +2,50 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { appendForm, encodeSimple } from '../lib/encodings.js';
-import { bytesToBlob, getContentTypeFromFileName, readableStreamToArrayBuffer } from '../lib/files.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { appendForm, encodeSimple, normalizeBlob } from "../lib/encodings.js";
+import {
+ bytesToBlob,
+ getContentTypeFromFileName,
+ readableStreamToArrayBuffer,
+} from "../lib/files.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { isBlobLike } from '../types/blobs.js';
-import { Result } from '../types/fp.js';
-import { isReadableStream } from '../types/streams.js';
+} from "../models/errors/httpclienterrors.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { isBlobLike } from "../types/blobs.js";
+import { Result } from "../types/fp.js";
+import { isReadableStream } from "../types/streams.js";
/**
* Upload master translations JSON file
*
* @remarks
* Upload a master JSON file containing translations for multiple workflows. Locale is automatically detected from filename (e.g., en_US.json)
+ *
+ * This operation requires one of {@link Security.secretKey}, {@link Security.bearerAuth}, or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function translationsMasterUpload(
client: NovuCore,
- requestBody: operations.TranslationControllerUploadMasterJsonEndpointRequestBody,
+ requestBody:
+ operations.TranslationControllerUploadMasterJsonEndpointRequestBody,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
components.ImportMasterJsonResponseDto,
@@ -52,14 +59,20 @@ export function translationsMasterUpload(
| SDKValidationError
>
> {
- return new APIPromise($do(client, requestBody, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ requestBody,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
- requestBody: operations.TranslationControllerUploadMasterJsonEndpointRequestBody,
+ requestBody:
+ operations.TranslationControllerUploadMasterJsonEndpointRequestBody,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -76,67 +89,83 @@ async function $do(
APICall,
]
> {
- const input: operations.TranslationControllerUploadMasterJsonEndpointRequest = {
- requestBody: requestBody,
- idempotencyKey: idempotencyKey,
- };
+ const input: operations.TranslationControllerUploadMasterJsonEndpointRequest =
+ {
+ requestBody: requestBody,
+ idempotencyKey: idempotencyKey,
+ };
const parsed = safeParse(
input,
- (value) => operations.TranslationControllerUploadMasterJsonEndpointRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .TranslationControllerUploadMasterJsonEndpointRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = new FormData();
if (isBlobLike(payload.RequestBody.file)) {
- const blob = payload.RequestBody.file;
- const name = 'name' in blob ? (blob.name as string) : undefined;
- appendForm(body, 'file', blob, name);
+ const file = payload.RequestBody.file;
+ const blob = await normalizeBlob(file);
+ const name = "name" in file ? (file.name as string) : undefined;
+ appendForm(body, "file", blob, name);
} else if (isReadableStream(payload.RequestBody.file.content)) {
- const buffer = await readableStreamToArrayBuffer(payload.RequestBody.file.content);
- const contentType = getContentTypeFromFileName(payload.RequestBody.file.fileName) || 'application/octet-stream';
- appendForm(body, 'file', bytesToBlob(buffer, contentType), payload.RequestBody.file.fileName);
+ const buffer = await readableStreamToArrayBuffer(
+ payload.RequestBody.file.content,
+ );
+ const contentType =
+ getContentTypeFromFileName(payload.RequestBody.file.fileName)
+ || "application/octet-stream";
+ appendForm(
+ body,
+ "file",
+ bytesToBlob(buffer, contentType),
+ payload.RequestBody.file.fileName,
+ );
} else {
- const contentType = getContentTypeFromFileName(payload.RequestBody.file.fileName) || 'application/octet-stream';
+ const contentType =
+ getContentTypeFromFileName(payload.RequestBody.file.fileName)
+ || "application/octet-stream";
appendForm(
body,
- 'file',
+ "file",
bytesToBlob(payload.RequestBody.file.content, contentType),
- payload.RequestBody.file.fileName
+ payload.RequestBody.file.fileName,
);
}
- const path = pathToFunc('/v2/translations/master-json/upload')();
+ const path = pathToFunc("/v2/translations/master-json/upload")();
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0, 1]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'TranslationController_uploadMasterJsonEndpoint',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "TranslationController_uploadMasterJsonEndpoint",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -144,37 +173,34 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'POST',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "POST",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
- errorCodes: ['4XX', '5XX'],
+ errorCodes: ["4XX", "5XX"],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -190,12 +216,12 @@ async function $do(
| SDKValidationError
>(
M.json(200, components.ImportMasterJsonResponseDto$inboundSchema),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req);
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/translationsRetrieve.ts b/libs/internal-sdk/src/funcs/translationsRetrieve.ts
index dfd8126fe70..c40d5fbcba5 100644
--- a/libs/internal-sdk/src/funcs/translationsRetrieve.ts
+++ b/libs/internal-sdk/src/funcs/translationsRetrieve.ts
@@ -2,39 +2,41 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Retrieve a translation
*
* @remarks
* Retrieve a specific translation by resource type, resource ID and locale
+ *
+ * This operation requires one of {@link Security.secretKey}, {@link Security.bearerAuth}, or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function translationsRetrieve(
client: NovuCore,
request: operations.TranslationControllerGetSingleTranslationRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
components.TranslationResponseDto,
@@ -48,13 +50,17 @@ export function translationsRetrieve(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.TranslationControllerGetSingleTranslationRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -73,56 +79,60 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.TranslationControllerGetSingleTranslationRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.TranslationControllerGetSingleTranslationRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- locale: encodeSimple('locale', payload.locale, {
+ locale: encodeSimple("locale", payload.locale, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- resourceId: encodeSimple('resourceId', payload.resourceId, {
+ resourceId: encodeSimple("resourceId", payload.resourceId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- resourceType: encodeSimple('resourceType', payload.resourceType, {
+ resourceType: encodeSimple("resourceType", payload.resourceType, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/translations/{resourceType}/{resourceId}/{locale}')(pathParams);
+ const path = pathToFunc(
+ "/v2/translations/{resourceType}/{resourceId}/{locale}",
+ )(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0, 1]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'TranslationController_getSingleTranslation',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "TranslationController_getSingleTranslation",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -130,37 +140,34 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
- errorCodes: ['404', '4XX', '5XX'],
+ errorCodes: ["404", "4XX", "5XX"],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -176,12 +183,12 @@ async function $do(
| SDKValidationError
>(
M.json(200, components.TranslationResponseDto$inboundSchema),
- M.fail([404, '4XX']),
- M.fail('5XX')
+ M.fail([404, "4XX"]),
+ M.fail("5XX"),
)(response, req);
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/translationsUpload.ts b/libs/internal-sdk/src/funcs/translationsUpload.ts
index 4411079ddef..e299afa2b25 100644
--- a/libs/internal-sdk/src/funcs/translationsUpload.ts
+++ b/libs/internal-sdk/src/funcs/translationsUpload.ts
@@ -2,43 +2,50 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { appendForm, encodeSimple } from '../lib/encodings.js';
-import { bytesToBlob, getContentTypeFromFileName, readableStreamToArrayBuffer } from '../lib/files.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { appendForm, encodeSimple, normalizeBlob } from "../lib/encodings.js";
+import {
+ bytesToBlob,
+ getContentTypeFromFileName,
+ readableStreamToArrayBuffer,
+} from "../lib/files.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { isBlobLike } from '../types/blobs.js';
-import { Result } from '../types/fp.js';
-import { isReadableStream } from '../types/streams.js';
+} from "../models/errors/httpclienterrors.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { isBlobLike } from "../types/blobs.js";
+import { Result } from "../types/fp.js";
+import { isReadableStream } from "../types/streams.js";
/**
* Upload translation files
*
* @remarks
* Upload one or more JSON translation files for a specific workflow. Files name must match the locale, e.g. en_US.json. Supports both "files" and "files[]" field names for backwards compatibility.
+ *
+ * This operation requires one of {@link Security.secretKey}, {@link Security.bearerAuth}, or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function translationsUpload(
client: NovuCore,
- requestBody: operations.TranslationControllerUploadTranslationFilesRequestBody,
+ requestBody:
+ operations.TranslationControllerUploadTranslationFilesRequestBody,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
components.UploadTranslationsResponseDto,
@@ -52,14 +59,20 @@ export function translationsUpload(
| SDKValidationError
>
> {
- return new APIPromise($do(client, requestBody, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ requestBody,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
- requestBody: operations.TranslationControllerUploadTranslationFilesRequestBody,
+ requestBody:
+ operations.TranslationControllerUploadTranslationFilesRequestBody,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -83,59 +96,75 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.TranslationControllerUploadTranslationFilesRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations
+ .TranslationControllerUploadTranslationFilesRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = new FormData();
for (const fileItem of payload.RequestBody.files ?? []) {
if (isBlobLike(fileItem)) {
- const blob = fileItem;
- const name = 'name' in blob ? (blob.name as string) : undefined;
- appendForm(body, 'files', blob, name);
+ const file = fileItem;
+ const blob = await normalizeBlob(file);
+ const name = "name" in file ? (file.name as string) : undefined;
+ appendForm(body, "files", blob, name);
} else if (isReadableStream(fileItem.content)) {
const buffer = await readableStreamToArrayBuffer(fileItem.content);
- const contentType = getContentTypeFromFileName(fileItem.fileName) || 'application/octet-stream';
- appendForm(body, 'files', bytesToBlob(buffer, contentType), fileItem.fileName);
+ const contentType = getContentTypeFromFileName(fileItem.fileName)
+ || "application/octet-stream";
+ appendForm(
+ body,
+ "files",
+ bytesToBlob(buffer, contentType),
+ fileItem.fileName,
+ );
} else {
- const contentType = getContentTypeFromFileName(fileItem.fileName) || 'application/octet-stream';
- appendForm(body, 'files', bytesToBlob(fileItem.content, contentType), fileItem.fileName);
+ const contentType = getContentTypeFromFileName(fileItem.fileName)
+ || "application/octet-stream";
+ appendForm(
+ body,
+ "files",
+ bytesToBlob(fileItem.content, contentType),
+ fileItem.fileName,
+ );
}
}
- appendForm(body, 'resourceId', payload.RequestBody.resourceId);
- appendForm(body, 'resourceType', payload.RequestBody.resourceType);
+ appendForm(body, "resourceId", payload.RequestBody.resourceId);
+ appendForm(body, "resourceType", payload.RequestBody.resourceType);
- const path = pathToFunc('/v2/translations/upload')();
+ const path = pathToFunc("/v2/translations/upload")();
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0, 1]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'TranslationController_uploadTranslationFiles',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "TranslationController_uploadTranslationFiles",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -143,37 +172,34 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'POST',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "POST",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
- errorCodes: ['4XX', '5XX'],
+ errorCodes: ["4XX", "5XX"],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -189,12 +215,12 @@ async function $do(
| SDKValidationError
>(
M.json(200, components.UploadTranslationsResponseDto$inboundSchema),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req);
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/trigger.ts b/libs/internal-sdk/src/funcs/trigger.ts
index 6c5e599a877..eae19240dcb 100644
--- a/libs/internal-sdk/src/funcs/trigger.ts
+++ b/libs/internal-sdk/src/funcs/trigger.ts
@@ -33,6 +33,8 @@ import { Result } from "../types/fp.js";
*
* Trigger event is the main (and only) way to send notifications to subscribers. The trigger identifier is used to match the particular workflow associated with it. Maximum number of recipients can be 100. Additional information can be passed according the body interface below.
* To prevent duplicate triggers, you can optionally pass a **transactionId** in the request body. If the same **transactionId** is used again, the trigger will be ignored. The retention period depends on your billing tier.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function trigger(
client: NovuCore,
@@ -119,7 +121,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/triggerBroadcast.ts b/libs/internal-sdk/src/funcs/triggerBroadcast.ts
index ee1baf76f36..4e19bc915f8 100644
--- a/libs/internal-sdk/src/funcs/triggerBroadcast.ts
+++ b/libs/internal-sdk/src/funcs/triggerBroadcast.ts
@@ -32,6 +32,8 @@ import { Result } from "../types/fp.js";
* @remarks
* Trigger a broadcast event to all existing subscribers, could be used to send announcements, etc.
* In the future could be used to trigger events to a subset of subscribers based on defined filters.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function triggerBroadcast(
client: NovuCore,
@@ -119,7 +121,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/triggerBulk.ts b/libs/internal-sdk/src/funcs/triggerBulk.ts
index 061e2323ce8..fa8e2787548 100644
--- a/libs/internal-sdk/src/funcs/triggerBulk.ts
+++ b/libs/internal-sdk/src/funcs/triggerBulk.ts
@@ -33,6 +33,8 @@ import { Result } from "../types/fp.js";
*
* Using this endpoint you can trigger multiple events at once, to avoid multiple calls to the API.
* The bulk API is limited to 100 events per request.
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function triggerBulk(
client: NovuCore,
@@ -119,7 +121,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/workflowsCreate.ts b/libs/internal-sdk/src/funcs/workflowsCreate.ts
index ff243250658..8cf41e09681 100644
--- a/libs/internal-sdk/src/funcs/workflowsCreate.ts
+++ b/libs/internal-sdk/src/funcs/workflowsCreate.ts
@@ -31,6 +31,8 @@ import { Result } from "../types/fp.js";
*
* @remarks
* Creates a new workflow in the Novu Cloud environment
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function workflowsCreate(
client: NovuCore,
@@ -113,7 +115,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/workflowsDelete.ts b/libs/internal-sdk/src/funcs/workflowsDelete.ts
index 6ad30a80e61..bf8038a3d8b 100644
--- a/libs/internal-sdk/src/funcs/workflowsDelete.ts
+++ b/libs/internal-sdk/src/funcs/workflowsDelete.ts
@@ -2,40 +2,42 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Delete a workflow
*
* @remarks
* Removes a specific workflow by its unique identifier **workflowId**
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function workflowsDelete(
client: NovuCore,
workflowId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.WorkflowControllerRemoveWorkflowResponse | undefined,
@@ -51,14 +53,19 @@ export function workflowsDelete(
| SDKValidationError
>
> {
- return new APIPromise($do(client, workflowId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ workflowId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
client: NovuCore,
workflowId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -84,48 +91,51 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.WorkflowControllerRemoveWorkflowRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.WorkflowControllerRemoveWorkflowRequest$outboundSchema.parse(
+ value,
+ ),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- workflowId: encodeSimple('workflowId', payload.workflowId, {
+ workflowId: encodeSimple("workflowId", payload.workflowId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/workflows/{workflowId}')(pathParams);
+ const path = pathToFunc("/v2/workflows/{workflowId}")(pathParams);
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'WorkflowController_removeWorkflow',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "WorkflowController_removeWorkflow",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -133,53 +143,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'DELETE',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "DELETE",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -200,19 +207,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.nil(204, operations.WorkflowControllerRemoveWorkflowResponse$inboundSchema.optional()),
+ M.nil(
+ 204,
+ operations.WorkflowControllerRemoveWorkflowResponse$inboundSchema
+ .optional(),
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/workflowsDuplicate.ts b/libs/internal-sdk/src/funcs/workflowsDuplicate.ts
index 6590b9ba352..0ad1d87a3b5 100644
--- a/libs/internal-sdk/src/funcs/workflowsDuplicate.ts
+++ b/libs/internal-sdk/src/funcs/workflowsDuplicate.ts
@@ -2,42 +2,44 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Duplicate a workflow
*
* @remarks
* Duplicates a workflow by its unique identifier **workflowId**. This will create a new workflow with the same steps and settings.
+ *
+ * This operation requires {@link Security.bearerAuth} to be set on the `security` parameter when initializing the SDK.
*/
export function workflowsDuplicate(
client: NovuCore,
duplicateWorkflowDto: components.DuplicateWorkflowDto,
workflowId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.WorkflowControllerDuplicateWorkflowResponse,
@@ -53,7 +55,13 @@ export function workflowsDuplicate(
| SDKValidationError
>
> {
- return new APIPromise($do(client, duplicateWorkflowDto, workflowId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ duplicateWorkflowDto,
+ workflowId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -61,7 +69,7 @@ async function $do(
duplicateWorkflowDto: components.DuplicateWorkflowDto,
workflowId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -88,51 +96,53 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.WorkflowControllerDuplicateWorkflowRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.WorkflowControllerDuplicateWorkflowRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.DuplicateWorkflowDto, {
+ const body = encodeJSON("body", payload.DuplicateWorkflowDto, {
explode: true,
});
const pathParams = {
- workflowId: encodeSimple('workflowId', payload.workflowId, {
+ workflowId: encodeSimple("workflowId", payload.workflowId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/workflows/{workflowId}/duplicate')(pathParams);
+ const path = pathToFunc("/v2/workflows/{workflowId}/duplicate")(pathParams);
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'WorkflowController_duplicateWorkflow',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "WorkflowController_duplicateWorkflow",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -140,53 +150,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'POST',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "POST",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -207,19 +214,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(201, operations.WorkflowControllerDuplicateWorkflowResponse$inboundSchema, { hdrs: true, key: 'Result' }),
+ M.json(
+ 201,
+ operations.WorkflowControllerDuplicateWorkflowResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/workflowsGet.ts b/libs/internal-sdk/src/funcs/workflowsGet.ts
index ad41c949105..a7d11fe9f29 100644
--- a/libs/internal-sdk/src/funcs/workflowsGet.ts
+++ b/libs/internal-sdk/src/funcs/workflowsGet.ts
@@ -2,41 +2,43 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeFormQuery, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Retrieve a workflow
*
* @remarks
* Fetches details of a specific workflow by its unique identifier **workflowId**
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function workflowsGet(
client: NovuCore,
workflowId: string,
environmentId?: string | undefined,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.WorkflowControllerGetWorkflowResponse,
@@ -52,7 +54,13 @@ export function workflowsGet(
| SDKValidationError
>
> {
- return new APIPromise($do(client, workflowId, environmentId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ workflowId,
+ environmentId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -60,7 +68,7 @@ async function $do(
workflowId: string,
environmentId?: string | undefined,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -87,52 +95,55 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.WorkflowControllerGetWorkflowRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.WorkflowControllerGetWorkflowRequest$outboundSchema.parse(
+ value,
+ ),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- workflowId: encodeSimple('workflowId', payload.workflowId, {
+ workflowId: encodeSimple("workflowId", payload.workflowId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/workflows/{workflowId}')(pathParams);
+ const path = pathToFunc("/v2/workflows/{workflowId}")(pathParams);
const query = encodeFormQuery({
- environmentId: payload.environmentId,
+ "environmentId": payload.environmentId,
});
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'WorkflowController_getWorkflow',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "WorkflowController_getWorkflow",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -140,54 +151,51 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- query: query,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ query: query,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -208,19 +216,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.WorkflowControllerGetWorkflowResponse$inboundSchema, { hdrs: true, key: 'Result' }),
+ M.json(
+ 200,
+ operations.WorkflowControllerGetWorkflowResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/workflowsList.ts b/libs/internal-sdk/src/funcs/workflowsList.ts
index fee0acd8293..6bbab1dd622 100644
--- a/libs/internal-sdk/src/funcs/workflowsList.ts
+++ b/libs/internal-sdk/src/funcs/workflowsList.ts
@@ -30,6 +30,8 @@ import { Result } from "../types/fp.js";
*
* @remarks
* Retrieves a list of workflows with optional filtering and pagination
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function workflowsList(
client: NovuCore,
@@ -115,7 +117,7 @@ async function $do(
}));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
diff --git a/libs/internal-sdk/src/funcs/workflowsPatch.ts b/libs/internal-sdk/src/funcs/workflowsPatch.ts
index 320a27b91ca..fa50cf44859 100644
--- a/libs/internal-sdk/src/funcs/workflowsPatch.ts
+++ b/libs/internal-sdk/src/funcs/workflowsPatch.ts
@@ -2,42 +2,44 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Update a workflow
*
* @remarks
* Partially updates a workflow by its unique identifier **workflowId**
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function workflowsPatch(
client: NovuCore,
patchWorkflowDto: components.PatchWorkflowDto,
workflowId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.WorkflowControllerPatchWorkflowResponse,
@@ -53,7 +55,13 @@ export function workflowsPatch(
| SDKValidationError
>
> {
- return new APIPromise($do(client, patchWorkflowDto, workflowId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ patchWorkflowDto,
+ workflowId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -61,7 +69,7 @@ async function $do(
patchWorkflowDto: components.PatchWorkflowDto,
workflowId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -88,49 +96,52 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.WorkflowControllerPatchWorkflowRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.WorkflowControllerPatchWorkflowRequest$outboundSchema.parse(
+ value,
+ ),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.PatchWorkflowDto, { explode: true });
+ const body = encodeJSON("body", payload.PatchWorkflowDto, { explode: true });
const pathParams = {
- workflowId: encodeSimple('workflowId', payload.workflowId, {
+ workflowId: encodeSimple("workflowId", payload.workflowId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/workflows/{workflowId}')(pathParams);
+ const path = pathToFunc("/v2/workflows/{workflowId}")(pathParams);
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'WorkflowController_patchWorkflow',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "WorkflowController_patchWorkflow",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -138,53 +149,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PATCH',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PATCH",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -205,19 +213,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.WorkflowControllerPatchWorkflowResponse$inboundSchema, { hdrs: true, key: 'Result' }),
+ M.json(
+ 200,
+ operations.WorkflowControllerPatchWorkflowResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/workflowsStepsGeneratePreview.ts b/libs/internal-sdk/src/funcs/workflowsStepsGeneratePreview.ts
index a7b0b2438b9..aa6b5126558 100644
--- a/libs/internal-sdk/src/funcs/workflowsStepsGeneratePreview.ts
+++ b/libs/internal-sdk/src/funcs/workflowsStepsGeneratePreview.ts
@@ -2,39 +2,41 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
- * Generate step preview
+ * Generate a step preview
*
* @remarks
* Generates a preview for a specific workflow step by its unique identifier **stepId**
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function workflowsStepsGeneratePreview(
client: NovuCore,
request: operations.WorkflowControllerGeneratePreviewRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.WorkflowControllerGeneratePreviewResponse,
@@ -50,13 +52,17 @@ export function workflowsStepsGeneratePreview(
| SDKValidationError
>
> {
- return new APIPromise($do(client, request, options));
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
}
async function $do(
client: NovuCore,
request: operations.WorkflowControllerGeneratePreviewRequest,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -77,55 +83,60 @@ async function $do(
> {
const parsed = safeParse(
request,
- (value) => operations.WorkflowControllerGeneratePreviewRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.WorkflowControllerGeneratePreviewRequest$outboundSchema.parse(
+ value,
+ ),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.GeneratePreviewRequestDto, {
+ const body = encodeJSON("body", payload.GeneratePreviewRequestDto, {
explode: true,
});
const pathParams = {
- stepId: encodeSimple('stepId', payload.stepId, {
+ stepId: encodeSimple("stepId", payload.stepId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- workflowId: encodeSimple('workflowId', payload.workflowId, {
+ workflowId: encodeSimple("workflowId", payload.workflowId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/workflows/{workflowId}/step/{stepId}/preview')(pathParams);
-
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v2/workflows/{workflowId}/step/{stepId}/preview")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'WorkflowController_generatePreview',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "WorkflowController_generatePreview",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -133,53 +144,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'POST',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "POST",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -200,19 +208,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(201, operations.WorkflowControllerGeneratePreviewResponse$inboundSchema, { hdrs: true, key: 'Result' }),
+ M.json(
+ 201,
+ operations.WorkflowControllerGeneratePreviewResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/workflowsStepsRetrieve.ts b/libs/internal-sdk/src/funcs/workflowsStepsRetrieve.ts
index 0383b92e084..e0e4358bf5b 100644
--- a/libs/internal-sdk/src/funcs/workflowsStepsRetrieve.ts
+++ b/libs/internal-sdk/src/funcs/workflowsStepsRetrieve.ts
@@ -2,41 +2,43 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
+import { NovuCore } from "../core.js";
+import { encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Retrieve workflow step
*
* @remarks
* Retrieves data for a specific step in a workflow
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function workflowsStepsRetrieve(
client: NovuCore,
workflowId: string,
stepId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.WorkflowControllerGetWorkflowStepDataResponse,
@@ -52,7 +54,13 @@ export function workflowsStepsRetrieve(
| SDKValidationError
>
> {
- return new APIPromise($do(client, workflowId, stepId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ workflowId,
+ stepId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -60,7 +68,7 @@ async function $do(
workflowId: string,
stepId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -87,52 +95,56 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.WorkflowControllerGetWorkflowStepDataRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.WorkflowControllerGetWorkflowStepDataRequest$outboundSchema
+ .parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
- stepId: encodeSimple('stepId', payload.stepId, {
+ stepId: encodeSimple("stepId", payload.stepId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
- workflowId: encodeSimple('workflowId', payload.workflowId, {
+ workflowId: encodeSimple("workflowId", payload.workflowId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/workflows/{workflowId}/steps/{stepId}')(pathParams);
-
- const headers = new Headers(
- compactMap({
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
+ const path = pathToFunc("/v2/workflows/{workflowId}/steps/{stepId}")(
+ pathParams,
);
+ const headers = new Headers(compactMap({
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
+
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'WorkflowController_getWorkflowStepData',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "WorkflowController_getWorkflowStepData",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -140,53 +152,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'GET',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "GET",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -207,19 +216,27 @@ async function $do(
| UnexpectedClientError
| SDKValidationError
>(
- M.json(200, operations.WorkflowControllerGetWorkflowStepDataResponse$inboundSchema, { hdrs: true, key: 'Result' }),
+ M.json(
+ 200,
+ operations.WorkflowControllerGetWorkflowStepDataResponse$inboundSchema,
+ { hdrs: true, key: "Result" },
+ ),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/workflowsSync.ts b/libs/internal-sdk/src/funcs/workflowsSync.ts
index e94513d3960..956a94bdd37 100644
--- a/libs/internal-sdk/src/funcs/workflowsSync.ts
+++ b/libs/internal-sdk/src/funcs/workflowsSync.ts
@@ -2,42 +2,44 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Sync a workflow
*
* @remarks
* Synchronizes a workflow to the target environment
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function workflowsSync(
client: NovuCore,
syncWorkflowDto: components.SyncWorkflowDto,
workflowId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.WorkflowControllerSyncResponse,
@@ -53,7 +55,13 @@ export function workflowsSync(
| SDKValidationError
>
> {
- return new APIPromise($do(client, syncWorkflowDto, workflowId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ syncWorkflowDto,
+ workflowId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -61,7 +69,7 @@ async function $do(
syncWorkflowDto: components.SyncWorkflowDto,
workflowId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -88,49 +96,50 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.WorkflowControllerSyncRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.WorkflowControllerSyncRequest$outboundSchema.parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.SyncWorkflowDto, { explode: true });
+ const body = encodeJSON("body", payload.SyncWorkflowDto, { explode: true });
const pathParams = {
- workflowId: encodeSimple('workflowId', payload.workflowId, {
+ workflowId: encodeSimple("workflowId", payload.workflowId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/workflows/{workflowId}/sync')(pathParams);
+ const path = pathToFunc("/v2/workflows/{workflowId}/sync")(pathParams);
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'WorkflowController_sync',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "WorkflowController_sync",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -138,53 +147,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PUT',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PUT",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -207,20 +213,24 @@ async function $do(
>(
M.json(200, operations.WorkflowControllerSyncResponse$inboundSchema, {
hdrs: true,
- key: 'Result',
+ key: "Result",
}),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/funcs/workflowsUpdate.ts b/libs/internal-sdk/src/funcs/workflowsUpdate.ts
index f46fd696ebf..1b637828c2e 100644
--- a/libs/internal-sdk/src/funcs/workflowsUpdate.ts
+++ b/libs/internal-sdk/src/funcs/workflowsUpdate.ts
@@ -2,42 +2,44 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { NovuCore } from '../core.js';
-import { encodeJSON, encodeSimple } from '../lib/encodings.js';
-import * as M from '../lib/matchers.js';
-import { compactMap } from '../lib/primitives.js';
-import { safeParse } from '../lib/schemas.js';
-import { RequestOptions } from '../lib/sdks.js';
-import { extractSecurity, resolveGlobalSecurity } from '../lib/security.js';
-import { pathToFunc } from '../lib/url.js';
-import * as components from '../models/components/index.js';
+import { NovuCore } from "../core.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
+import * as M from "../lib/matchers.js";
+import { compactMap } from "../lib/primitives.js";
+import { safeParse } from "../lib/schemas.js";
+import { RequestOptions } from "../lib/sdks.js";
+import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
+import { pathToFunc } from "../lib/url.js";
+import * as components from "../models/components/index.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import * as errors from '../models/errors/index.js';
-import { NovuError } from '../models/errors/novuerror.js';
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
-import * as operations from '../models/operations/index.js';
-import { APICall, APIPromise } from '../types/async.js';
-import { Result } from '../types/fp.js';
+} from "../models/errors/httpclienterrors.js";
+import * as errors from "../models/errors/index.js";
+import { NovuError } from "../models/errors/novuerror.js";
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
+import * as operations from "../models/operations/index.js";
+import { APICall, APIPromise } from "../types/async.js";
+import { Result } from "../types/fp.js";
/**
* Update a workflow
*
* @remarks
* Updates the details of an existing workflow, here **workflowId** is the identifier of the workflow
+ *
+ * This operation requires either {@link Security.bearerAuth} or {@link Security.secretKey} to be set on the `security` parameter when initializing the SDK.
*/
export function workflowsUpdate(
client: NovuCore,
updateWorkflowDto: components.UpdateWorkflowDto,
workflowId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): APIPromise<
Result<
operations.WorkflowControllerUpdateResponse,
@@ -53,7 +55,13 @@ export function workflowsUpdate(
| SDKValidationError
>
> {
- return new APIPromise($do(client, updateWorkflowDto, workflowId, idempotencyKey, options));
+ return new APIPromise($do(
+ client,
+ updateWorkflowDto,
+ workflowId,
+ idempotencyKey,
+ options,
+ ));
}
async function $do(
@@ -61,7 +69,7 @@ async function $do(
updateWorkflowDto: components.UpdateWorkflowDto,
workflowId: string,
idempotencyKey?: string | undefined,
- options?: RequestOptions
+ options?: RequestOptions,
): Promise<
[
Result<
@@ -88,49 +96,50 @@ async function $do(
const parsed = safeParse(
input,
- (value) => operations.WorkflowControllerUpdateRequest$outboundSchema.parse(value),
- 'Input validation failed'
+ (value) =>
+ operations.WorkflowControllerUpdateRequest$outboundSchema.parse(value),
+ "Input validation failed",
);
if (!parsed.ok) {
- return [parsed, { status: 'invalid' }];
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = encodeJSON('body', payload.UpdateWorkflowDto, { explode: true });
+ const body = encodeJSON("body", payload.UpdateWorkflowDto, { explode: true });
const pathParams = {
- workflowId: encodeSimple('workflowId', payload.workflowId, {
+ workflowId: encodeSimple("workflowId", payload.workflowId, {
explode: false,
- charEncoding: 'percent',
+ charEncoding: "percent",
}),
};
- const path = pathToFunc('/v2/workflows/{workflowId}')(pathParams);
+ const path = pathToFunc("/v2/workflows/{workflowId}")(pathParams);
- const headers = new Headers(
- compactMap({
- 'Content-Type': 'application/json',
- Accept: 'application/json',
- 'idempotency-key': encodeSimple('idempotency-key', payload['idempotency-key'], {
- explode: false,
- charEncoding: 'none',
- }),
- })
- );
+ const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "idempotency-key": encodeSimple(
+ "idempotency-key",
+ payload["idempotency-key"],
+ { explode: false, charEncoding: "none" },
+ ),
+ }));
const securityInput = await extractSecurity(client._options.security);
- const requestSecurity = resolveGlobalSecurity(securityInput);
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1, 0]);
const context = {
options: client._options,
- baseURL: options?.serverURL ?? client._baseURL ?? '',
- operationID: 'WorkflowController_update',
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
+ operationID: "WorkflowController_update",
oAuth2Scopes: null,
resolvedSecurity: requestSecurity,
securitySource: client._options.security,
- retryConfig: options?.retries ||
- client._options.retryConfig || {
- strategy: 'backoff',
+ retryConfig: options?.retries
+ || client._options.retryConfig
+ || {
+ strategy: "backoff",
backoff: {
initialInterval: 1000,
maxInterval: 30000,
@@ -138,53 +147,50 @@ async function $do(
maxElapsedTime: 3600000,
},
retryConnectionErrors: true,
- } || { strategy: 'none' },
- retryCodes: options?.retryCodes || ['408', '409', '429', '5XX'],
+ }
+ || { strategy: "none" },
+ retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
};
- const requestRes = client._createRequest(
- context,
- {
- security: requestSecurity,
- method: 'PUT',
- baseURL: options?.serverURL,
- path: path,
- headers: headers,
- body: body,
- userAgent: client._options.userAgent,
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
- },
- options
- );
+ const requestRes = client._createRequest(context, {
+ security: requestSecurity,
+ method: "PUT",
+ baseURL: options?.serverURL,
+ path: path,
+ headers: headers,
+ body: body,
+ userAgent: client._options.userAgent,
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
+ }, options);
if (!requestRes.ok) {
- return [requestRes, { status: 'invalid' }];
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: [
- '400',
- '401',
- '403',
- '404',
- '405',
- '409',
- '413',
- '414',
- '415',
- '422',
- '429',
- '4XX',
- '500',
- '503',
- '5XX',
+ "400",
+ "401",
+ "403",
+ "404",
+ "405",
+ "409",
+ "413",
+ "414",
+ "415",
+ "422",
+ "429",
+ "4XX",
+ "500",
+ "503",
+ "5XX",
],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return [doResult, { status: 'request-error', request: req }];
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -207,20 +213,24 @@ async function $do(
>(
M.json(200, operations.WorkflowControllerUpdateResponse$inboundSchema, {
hdrs: true,
- key: 'Result',
+ key: "Result",
}),
M.jsonErr(414, errors.ErrorDto$inboundSchema),
- M.jsonErr([400, 401, 403, 404, 405, 409, 413, 415], errors.ErrorDto$inboundSchema, { hdrs: true }),
+ M.jsonErr(
+ [400, 401, 403, 404, 405, 409, 413, 415],
+ errors.ErrorDto$inboundSchema,
+ { hdrs: true },
+ ),
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
- M.fail('4XX'),
- M.fail('5XX')
+ M.fail("4XX"),
+ M.fail("5XX"),
)(response, req, { extraFields: responseFields });
if (!result.ok) {
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
- return [result, { status: 'complete', request: req, response }];
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/libs/internal-sdk/src/lib/config.ts b/libs/internal-sdk/src/lib/config.ts
index f8849fb7f30..b259faaf25f 100644
--- a/libs/internal-sdk/src/lib/config.ts
+++ b/libs/internal-sdk/src/lib/config.ts
@@ -2,22 +2,28 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as components from '../models/components/index.js';
-import { HTTPClient } from './http.js';
-import { Logger } from './logger.js';
-import { RetryConfig } from './retries.js';
-import { Params, pathToFunc } from './url.js';
+import * as components from "../models/components/index.js";
+import { HTTPClient } from "./http.js";
+import { Logger } from "./logger.js";
+import { RetryConfig } from "./retries.js";
+import { Params, pathToFunc } from "./url.js";
/**
* Contains the list of servers available to the SDK
*/
-export const ServerList = ['https://api.novu.co', 'https://eu.api.novu.co'] as const;
+export const ServerList = [
+ "https://api.novu.co",
+ "https://eu.api.novu.co",
+] as const;
export type SDKOptions = {
/**
* The security details required to authenticate the SDK
*/
- security?: components.Security | (() => Promise) | undefined;
+ security?:
+ | components.Security
+ | (() => Promise)
+ | undefined;
httpClient?: HTTPClient;
/**
@@ -50,7 +56,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
if (serverIdx < 0 || serverIdx >= ServerList.length) {
throw new Error(`Invalid server index ${serverIdx}`);
}
- serverURL = ServerList[serverIdx] || '';
+ serverURL = ServerList[serverIdx] || "";
}
const u = pathToFunc(serverURL)(params);
@@ -58,9 +64,9 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
}
export const SDK_METADATA = {
- language: 'typescript',
- openapiDocVersion: '3.14.0',
- sdkVersion: '0.1.21',
- genVersion: '2.869.25',
- userAgent: 'speakeasy-sdk/typescript 0.1.21 2.869.25 3.14.0 @novu/api',
+ language: "typescript",
+ openapiDocVersion: "3.14.0",
+ sdkVersion: "0.1.21",
+ genVersion: "2.879.10",
+ userAgent: "speakeasy-sdk/typescript 0.1.21 2.879.10 3.14.0 @novu/api",
} as const;
diff --git a/libs/internal-sdk/src/lib/encodings.ts b/libs/internal-sdk/src/lib/encodings.ts
index 7d2adbb24a1..2791d25bc4f 100644
--- a/libs/internal-sdk/src/lib/encodings.ts
+++ b/libs/internal-sdk/src/lib/encodings.ts
@@ -2,46 +2,48 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { bytesToBase64 } from './base64.js';
-import { isPlainObject } from './is-plain-object.js';
+import { bytesToBase64 } from "./base64.js";
+import { isPlainObject } from "./is-plain-object.js";
export class EncodingError extends Error {
constructor(message: string) {
super(message);
- this.name = 'EncodingError';
+ this.name = "EncodingError";
}
}
export function encodeMatrix(
key: string,
value: unknown,
- options?: { explode?: boolean; charEncoding?: 'percent' | 'none' }
+ options?: { explode?: boolean; charEncoding?: "percent" | "none" },
): string | undefined {
- let out = '';
- const pairs: [string, unknown][] = options?.explode ? explode(key, value) : [[key, value]];
+ let out = "";
+ const pairs: [string, unknown][] = options?.explode
+ ? explode(key, value)
+ : [[key, value]];
if (pairs.every(([_, v]) => v == null)) {
return;
}
const encodeString = (v: string) => {
- return options?.charEncoding === 'percent' ? encodeURIComponent(v) : v;
+ return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
};
const encodeValue = (v: unknown) => encodeString(serializeValue(v));
pairs.forEach(([pk, pv]) => {
- let tmp = '';
+ let tmp = "";
let encValue: string | null | undefined = null;
if (pv == null) {
return;
} else if (Array.isArray(pv)) {
- encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(',');
+ encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(",");
} else if (isPlainObject(pv)) {
const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => {
return `,${encodeString(k)},${encodeValue(v)}`;
});
- encValue = mapped?.join('').slice(1);
+ encValue = mapped?.join("").slice(1);
} else {
encValue = `${encodeValue(pv)}`;
}
@@ -71,38 +73,42 @@ export function encodeMatrix(
export function encodeLabel(
key: string,
value: unknown,
- options?: { explode?: boolean; charEncoding?: 'percent' | 'none' }
+ options?: { explode?: boolean; charEncoding?: "percent" | "none" },
): string | undefined {
- let out = '';
- const pairs: [string, unknown][] = options?.explode ? explode(key, value) : [[key, value]];
+ let out = "";
+ const pairs: [string, unknown][] = options?.explode
+ ? explode(key, value)
+ : [[key, value]];
if (pairs.every(([_, v]) => v == null)) {
return;
}
const encodeString = (v: string) => {
- return options?.charEncoding === 'percent' ? encodeURIComponent(v) : v;
+ return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
};
const encodeValue = (v: unknown) => encodeString(serializeValue(v));
pairs.forEach(([pk, pv]) => {
- let encValue: string | null | undefined = '';
+ let encValue: string | null | undefined = "";
if (pv == null) {
return;
} else if (Array.isArray(pv)) {
- encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join('.');
+ encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(".");
} else if (isPlainObject(pv)) {
const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => {
return `.${encodeString(k)}.${encodeValue(v)}`;
});
- encValue = mapped?.join('').slice(1);
+ encValue = mapped?.join("").slice(1);
} else {
- const k = options?.explode && isPlainObject(value) ? `${encodeString(pk)}=` : '';
+ const k = options?.explode && isPlainObject(value)
+ ? `${encodeString(pk)}=`
+ : "";
encValue = `${k}${encodeValue(pv)}`;
}
- out += encValue == null ? '' : `.${encValue}`;
+ out += encValue == null ? "" : `.${encValue}`;
});
return out;
@@ -111,20 +117,26 @@ export function encodeLabel(
type FormEncoder = (
key: string,
value: unknown,
- options?: { explode?: boolean; charEncoding?: 'percent' | 'none' }
+ options?: { explode?: boolean; charEncoding?: "percent" | "none" },
) => string | undefined;
function formEncoder(sep: string): FormEncoder {
- return (key: string, value: unknown, options?: { explode?: boolean; charEncoding?: 'percent' | 'none' }) => {
- let out = '';
- const pairs: [string, unknown][] = options?.explode ? explode(key, value) : [[key, value]];
+ return (
+ key: string,
+ value: unknown,
+ options?: { explode?: boolean; charEncoding?: "percent" | "none" },
+ ) => {
+ let out = "";
+ const pairs: [string, unknown][] = options?.explode
+ ? explode(key, value)
+ : [[key, value]];
if (pairs.every(([_, v]) => v == null)) {
return;
}
const encodeString = (v: string) => {
- return options?.charEncoding === 'percent' ? encodeURIComponent(v) : v;
+ return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
};
const encodeValue = (v: unknown) => encodeString(serializeValue(v));
@@ -132,7 +144,7 @@ function formEncoder(sep: string): FormEncoder {
const encodedSep = encodeString(sep);
pairs.forEach(([pk, pv]) => {
- let tmp = '';
+ let tmp = "";
let encValue: string | null | undefined = null;
if (pv == null) {
@@ -154,7 +166,7 @@ function formEncoder(sep: string): FormEncoder {
tmp = `${encodeString(pk)}=${encValue}`;
// If we end up with the nothing then skip forward
- if (!tmp || tmp === '=') {
+ if (!tmp || tmp === "=") {
return;
}
@@ -165,27 +177,29 @@ function formEncoder(sep: string): FormEncoder {
};
}
-export const encodeForm = formEncoder(',');
-export const encodeSpaceDelimited = formEncoder(' ');
-export const encodePipeDelimited = formEncoder('|');
+export const encodeForm = formEncoder(",");
+export const encodeSpaceDelimited = formEncoder(" ");
+export const encodePipeDelimited = formEncoder("|");
export function encodeBodyForm(
key: string,
value: unknown,
- options?: { explode?: boolean; charEncoding?: 'percent' | 'none' }
+ options?: { explode?: boolean; charEncoding?: "percent" | "none" },
): string {
- let out = '';
- const pairs: [string, unknown][] = options?.explode ? explode(key, value) : [[key, value]];
+ let out = "";
+ const pairs: [string, unknown][] = options?.explode
+ ? explode(key, value)
+ : [[key, value]];
const encodeString = (v: string) => {
- return options?.charEncoding === 'percent' ? encodeURIComponent(v) : v;
+ return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
};
const encodeValue = (v: unknown) => encodeString(serializeValue(v));
pairs.forEach(([pk, pv]) => {
- let tmp = '';
- let encValue = '';
+ let tmp = "";
+ let encValue = "";
if (pv == null) {
return;
@@ -200,7 +214,7 @@ export function encodeBodyForm(
tmp = `${encodeString(pk)}=${encValue}`;
// If we end up with the nothing then skip forward
- if (!tmp || tmp === '=') {
+ if (!tmp || tmp === "=") {
return;
}
@@ -213,14 +227,16 @@ export function encodeBodyForm(
export function encodeDeepObject(
key: string,
value: unknown,
- options?: { charEncoding?: 'percent' | 'none' }
+ options?: { charEncoding?: "percent" | "none" },
): string | undefined {
if (value == null) {
return;
}
if (!isPlainObject(value)) {
- throw new EncodingError(`Value of parameter '${key}' which uses deepObject encoding must be an object or null`);
+ throw new EncodingError(
+ `Value of parameter '${key}' which uses deepObject encoding must be an object or null`,
+ );
}
return encodeDeepObjectObject(key, value, options);
@@ -229,16 +245,16 @@ export function encodeDeepObject(
export function encodeDeepObjectObject(
key: string,
value: unknown,
- options?: { charEncoding?: 'percent' | 'none' }
+ options?: { charEncoding?: "percent" | "none" },
): string | undefined {
if (value == null) {
return;
}
- let out = '';
+ let out = "";
const encodeString = (v: string) => {
- return options?.charEncoding === 'percent' ? encodeURIComponent(v) : v;
+ return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
};
if (!isPlainObject(value)) {
@@ -255,7 +271,7 @@ export function encodeDeepObjectObject(
if (isPlainObject(cv)) {
const objOut = encodeDeepObjectObject(pk, cv, options);
- out += objOut == null ? '' : `&${objOut}`;
+ out += objOut == null ? "" : `&${objOut}`;
return;
}
@@ -263,9 +279,9 @@ export function encodeDeepObjectObject(
const pairs: unknown[] = Array.isArray(cv) ? cv : [cv];
const encoded = mapDefined(pairs, (v) => {
return `${encodeString(pk)}=${encodeString(serializeValue(v))}`;
- })?.join('&');
+ })?.join("&");
- out += encoded == null ? '' : `&${encoded}`;
+ out += encoded == null ? "" : `&${encoded}`;
});
return out.slice(1);
@@ -274,14 +290,14 @@ export function encodeDeepObjectObject(
export function encodeJSON(
key: string,
value: unknown,
- options?: { explode?: boolean; charEncoding?: 'percent' | 'none' }
+ options?: { explode?: boolean; charEncoding?: "percent" | "none" },
): string | undefined {
- if (typeof value === 'undefined') {
+ if (typeof value === "undefined") {
return;
}
const encodeString = (v: string) => {
- return options?.charEncoding === 'percent' ? encodeURIComponent(v) : v;
+ return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
};
const encVal = encodeString(JSON.stringify(value, jsonReplacer));
@@ -292,38 +308,40 @@ export function encodeJSON(
export const encodeSimple = (
key: string,
value: unknown,
- options?: { explode?: boolean; charEncoding?: 'percent' | 'none' }
+ options?: { explode?: boolean; charEncoding?: "percent" | "none" },
): string | undefined => {
- let out = '';
- const pairs: [string, unknown][] = options?.explode ? explode(key, value) : [[key, value]];
+ let out = "";
+ const pairs: [string, unknown][] = options?.explode
+ ? explode(key, value)
+ : [[key, value]];
if (pairs.every(([_, v]) => v == null)) {
return;
}
const encodeString = (v: string) => {
- return options?.charEncoding === 'percent' ? encodeURIComponent(v) : v;
+ return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
};
const encodeValue = (v: unknown) => encodeString(serializeValue(v));
pairs.forEach(([pk, pv]) => {
- let tmp: string | null | undefined = '';
+ let tmp: string | null | undefined = "";
if (pv == null) {
return;
} else if (Array.isArray(pv)) {
- tmp = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(',');
+ tmp = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(",");
} else if (isPlainObject(pv)) {
const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => {
return `,${encodeString(k)},${encodeValue(v)}`;
});
- tmp = mapped?.join('').slice(1);
+ tmp = mapped?.join("").slice(1);
} else {
- const k = options?.explode && isPlainObject(value) ? `${pk}=` : '';
+ const k = options?.explode && isPlainObject(value) ? `${pk}=` : "";
tmp = `${k}${encodeValue(pv)}`;
}
- out += tmp ? `,${tmp}` : '';
+ out += tmp ? `,${tmp}` : "";
});
return out.slice(1);
@@ -342,12 +360,12 @@ function explode(key: string, value: unknown): [string, unknown][] {
function serializeValue(value: unknown): string {
if (value == null) {
- return '';
+ return "";
} else if (value instanceof Date) {
return value.toISOString();
} else if (value instanceof Uint8Array) {
return bytesToBase64(value);
- } else if (typeof value === 'object') {
+ } else if (typeof value === "object") {
return JSON.stringify(value, jsonReplacer);
}
@@ -381,7 +399,10 @@ function mapDefined(inp: T[], mapper: (v: T) => R): R[] | null {
return res.length ? res : null;
}
-function mapDefinedEntries(inp: Iterable<[K, V]>, mapper: (v: [K, V]) => R): R[] | null {
+function mapDefinedEntries(
+ inp: Iterable<[K, V]>,
+ mapper: (v: [K, V]) => R,
+): R[] | null {
const acc: R[] = [];
for (const [k, v] of inp) {
if (v == null) {
@@ -400,32 +421,47 @@ function mapDefinedEntries(inp: Iterable<[K, V]>, mapper: (v: [K, V]) =
}
export function queryJoin(...args: (string | undefined)[]): string {
- return args.filter(Boolean).join('&');
+ return args.filter(Boolean).join("&");
}
type QueryEncoderOptions = {
explode?: boolean;
- charEncoding?: 'percent' | 'none';
+ charEncoding?: "percent" | "none";
allowEmptyValue?: string[];
};
-type QueryEncoder = (key: string, value: unknown, options?: QueryEncoderOptions) => string | undefined;
+type QueryEncoder = (
+ key: string,
+ value: unknown,
+ options?: QueryEncoderOptions,
+) => string | undefined;
-type BulkQueryEncoder = (values: Record, options?: QueryEncoderOptions) => string;
+type BulkQueryEncoder = (
+ values: Record,
+ options?: QueryEncoderOptions,
+) => string;
export function queryEncoder(f: QueryEncoder): BulkQueryEncoder {
- const bulkEncode = (values: Record, options?: QueryEncoderOptions): string => {
+ const bulkEncode = function(
+ values: Record,
+ options?: QueryEncoderOptions,
+ ): string {
const opts: QueryEncoderOptions = {
...options,
explode: options?.explode ?? true,
- charEncoding: options?.charEncoding ?? 'percent',
+ charEncoding: options?.charEncoding ?? "percent",
};
const allowEmptySet = new Set(options?.allowEmptyValue ?? []);
const encoded = Object.entries(values).map(([key, value]) => {
if (allowEmptySet.has(key)) {
- if (value === undefined || value === null || value === '' || (Array.isArray(value) && value.length === 0)) {
+ if (
+ value === undefined
+ || value === null
+ || value === ""
+ || (Array.isArray(value) && value.length === 0)
+ ) {
return `${encodeURIComponent(key)}=`;
}
}
@@ -448,19 +484,24 @@ function isBlobLike(val: unknown): val is Blob {
return true;
}
- if (typeof val !== 'object' || val == null || !(Symbol.toStringTag in val)) {
+ if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) {
return false;
}
const tag = val[Symbol.toStringTag];
- if (tag !== 'Blob' && tag !== 'File') {
+ if (tag !== "Blob" && tag !== "File") {
return false;
}
- return 'stream' in val && typeof val.stream === 'function';
+ return "stream" in val && typeof val.stream === "function";
}
-export function appendForm(fd: FormData, key: string, value: unknown, fileName?: string): void {
+export function appendForm(
+ fd: FormData,
+ key: string,
+ value: unknown,
+ fileName?: string,
+): void {
if (value == null) {
return;
} else if (isBlobLike(value)) {
@@ -473,3 +514,12 @@ export function appendForm(fd: FormData, key: string, value: unknown, fileName?:
fd.append(key, String(value));
}
}
+
+export async function normalizeBlob(
+ value: Pick,
+): Promise {
+ if (value instanceof Blob) {
+ return value;
+ }
+ return new Blob([await value.arrayBuffer()], { type: value.type });
+}
diff --git a/libs/internal-sdk/src/lib/files.ts b/libs/internal-sdk/src/lib/files.ts
index 9b419018cf1..6ca6b37d35a 100644
--- a/libs/internal-sdk/src/lib/files.ts
+++ b/libs/internal-sdk/src/lib/files.ts
@@ -8,7 +8,9 @@
* larger payload containing other fields, and we can't modify the underlying
* request structure.
*/
-export async function readableStreamToArrayBuffer(readable: ReadableStream): Promise {
+export async function readableStreamToArrayBuffer(
+ readable: ReadableStream,
+): Promise {
const reader = readable.getReader();
const chunks: Uint8Array[] = [];
@@ -44,36 +46,36 @@ export async function readableStreamToArrayBuffer(readable: ReadableStream = {
- json: 'application/json',
- xml: 'application/xml',
- html: 'text/html',
- htm: 'text/html',
- txt: 'text/plain',
- csv: 'text/csv',
- pdf: 'application/pdf',
- png: 'image/png',
- jpg: 'image/jpeg',
- jpeg: 'image/jpeg',
- gif: 'image/gif',
- svg: 'image/svg+xml',
- js: 'application/javascript',
- css: 'text/css',
- zip: 'application/zip',
- tar: 'application/x-tar',
- gz: 'application/gzip',
- mp4: 'video/mp4',
- mp3: 'audio/mpeg',
- wav: 'audio/wav',
- webp: 'image/webp',
- ico: 'image/x-icon',
- woff: 'font/woff',
- woff2: 'font/woff2',
- ttf: 'font/ttf',
- otf: 'font/otf',
+ json: "application/json",
+ xml: "application/xml",
+ html: "text/html",
+ htm: "text/html",
+ txt: "text/plain",
+ csv: "text/csv",
+ pdf: "application/pdf",
+ png: "image/png",
+ jpg: "image/jpeg",
+ jpeg: "image/jpeg",
+ gif: "image/gif",
+ svg: "image/svg+xml",
+ js: "application/javascript",
+ css: "text/css",
+ zip: "application/zip",
+ tar: "application/x-tar",
+ gz: "application/gzip",
+ mp4: "video/mp4",
+ mp3: "audio/mpeg",
+ wav: "audio/wav",
+ webp: "image/webp",
+ ico: "image/x-icon",
+ woff: "font/woff",
+ woff2: "font/woff2",
+ ttf: "font/ttf",
+ otf: "font/otf",
};
return mimeTypes[ext] || null;
@@ -93,7 +95,7 @@ export function getContentTypeFromFileName(fileName: string): string | null {
*/
export function bytesToBlob(
content: Uint8Array | ArrayBuffer | Blob | string,
- contentType: string
+ contentType: string,
): Blob {
if (content instanceof Uint8Array) {
return new Blob([new Uint8Array(content)], { type: contentType });
diff --git a/libs/internal-sdk/src/lib/matchers.ts b/libs/internal-sdk/src/lib/matchers.ts
index 2ee83f6418f..2d29989ff15 100644
--- a/libs/internal-sdk/src/lib/matchers.ts
+++ b/libs/internal-sdk/src/lib/matchers.ts
@@ -2,23 +2,31 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { ResponseValidationError } from '../models/errors/responsevalidationerror.js';
-import { SDKError } from '../models/errors/sdkerror.js';
-import { ERR, OK, Result } from '../types/fp.js';
-import { matchResponse, matchStatusCode, StatusCodePredicate } from './http.js';
-import { isPlainObject } from './is-plain-object.js';
+import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
+import { SDKError } from "../models/errors/sdkerror.js";
+import { ERR, OK, Result } from "../types/fp.js";
+import { matchResponse, matchStatusCode, StatusCodePredicate } from "./http.js";
+import { isPlainObject } from "./is-plain-object.js";
-export type Encoding = 'jsonl' | 'json' | 'text' | 'bytes' | 'stream' | 'sse' | 'nil' | 'fail';
+export type Encoding =
+ | "jsonl"
+ | "json"
+ | "text"
+ | "bytes"
+ | "stream"
+ | "sse"
+ | "nil"
+ | "fail";
const DEFAULT_CONTENT_TYPES: Record = {
- jsonl: 'application/jsonl',
- json: 'application/json',
- text: 'text/plain',
- bytes: 'application/octet-stream',
- stream: 'application/octet-stream',
- sse: 'text/event-stream',
- nil: '*',
- fail: '*',
+ jsonl: "application/jsonl",
+ json: "application/json",
+ text: "text/plain",
+ bytes: "application/octet-stream",
+ stream: "application/octet-stream",
+ sse: "text/event-stream",
+ nil: "*",
+ fail: "*",
};
type Schema = { parse(raw: unknown): T };
@@ -44,84 +52,150 @@ export type ErrorMatcher = MatchOptions & {
};
export type FailMatcher = {
- enc: 'fail';
+ enc: "fail";
codes: StatusCodePredicate;
};
export type Matcher = ValueMatcher | ErrorMatcher | FailMatcher;
-export function jsonErr(codes: StatusCodePredicate, schema: Schema, options?: MatchOptions): ErrorMatcher {
- return { ...options, err: true, enc: 'json', codes, schema };
+export function jsonErr(
+ codes: StatusCodePredicate,
+ schema: Schema,
+ options?: MatchOptions,
+): ErrorMatcher {
+ return { ...options, err: true, enc: "json", codes, schema };
}
-export function json(codes: StatusCodePredicate, schema: Schema, options?: MatchOptions): ValueMatcher {
- return { ...options, enc: 'json', codes, schema };
+export function json(
+ codes: StatusCodePredicate,
+ schema: Schema,
+ options?: MatchOptions,
+): ValueMatcher {
+ return { ...options, enc: "json", codes, schema };
}
-export function jsonl(codes: StatusCodePredicate, schema: Schema, options?: MatchOptions): ValueMatcher {
- return { ...options, enc: 'jsonl', codes, schema };
+export function jsonl(
+ codes: StatusCodePredicate,
+ schema: Schema,
+ options?: MatchOptions,
+): ValueMatcher {
+ return { ...options, enc: "jsonl", codes, schema };
}
-export function jsonlErr(codes: StatusCodePredicate, schema: Schema, options?: MatchOptions): ErrorMatcher {
- return { ...options, err: true, enc: 'jsonl', codes, schema };
+export function jsonlErr(
+ codes: StatusCodePredicate,
+ schema: Schema,
+ options?: MatchOptions,
+): ErrorMatcher {
+ return { ...options, err: true, enc: "jsonl", codes, schema };
}
-export function textErr(codes: StatusCodePredicate, schema: Schema, options?: MatchOptions): ErrorMatcher {
- return { ...options, err: true, enc: 'text', codes, schema };
+export function textErr(
+ codes: StatusCodePredicate,
+ schema: Schema,
+ options?: MatchOptions,
+): ErrorMatcher {
+ return { ...options, err: true, enc: "text", codes, schema };
}
-export function text(codes: StatusCodePredicate, schema: Schema, options?: MatchOptions): ValueMatcher {
- return { ...options, enc: 'text', codes, schema };
+export function text(
+ codes: StatusCodePredicate,
+ schema: Schema,
+ options?: MatchOptions,
+): ValueMatcher {
+ return { ...options, enc: "text", codes, schema };
}
-export function bytesErr(codes: StatusCodePredicate, schema: Schema, options?: MatchOptions): ErrorMatcher {
- return { ...options, err: true, enc: 'bytes', codes, schema };
+export function bytesErr(
+ codes: StatusCodePredicate,
+ schema: Schema,
+ options?: MatchOptions,
+): ErrorMatcher {
+ return { ...options, err: true, enc: "bytes", codes, schema };
}
-export function bytes(codes: StatusCodePredicate, schema: Schema, options?: MatchOptions): ValueMatcher {
- return { ...options, enc: 'bytes', codes, schema };
+export function bytes(
+ codes: StatusCodePredicate,
+ schema: Schema,
+ options?: MatchOptions,
+): ValueMatcher {
+ return { ...options, enc: "bytes", codes, schema };
}
-export function streamErr(codes: StatusCodePredicate, schema: Schema, options?: MatchOptions): ErrorMatcher {
- return { ...options, err: true, enc: 'stream', codes, schema };
+export function streamErr(
+ codes: StatusCodePredicate,
+ schema: Schema,
+ options?: MatchOptions,
+): ErrorMatcher {
+ return { ...options, err: true, enc: "stream", codes, schema };
}
-export function stream(codes: StatusCodePredicate, schema: Schema, options?: MatchOptions): ValueMatcher {
- return { ...options, enc: 'stream', codes, schema };
+export function stream(
+ codes: StatusCodePredicate,
+ schema: Schema,
+ options?: MatchOptions,
+): ValueMatcher {
+ return { ...options, enc: "stream", codes, schema };
}
-export function sseErr(codes: StatusCodePredicate, schema: Schema, options?: MatchOptions): ErrorMatcher {
- return { ...options, err: true, enc: 'sse', codes, schema };
+export function sseErr(
+ codes: StatusCodePredicate,
+ schema: Schema,
+ options?: MatchOptions,
+): ErrorMatcher {
+ return { ...options, err: true, enc: "sse", codes, schema };
}
-export function sse(codes: StatusCodePredicate, schema: Schema, options?: MatchOptions): ValueMatcher {
- return { ...options, enc: 'sse', codes, schema };
+export function sse(
+ codes: StatusCodePredicate,
+ schema: Schema,
+ options?: MatchOptions,
+): ValueMatcher {
+ return { ...options, enc: "sse", codes, schema };
}
-export function nilErr(codes: StatusCodePredicate, schema: Schema, options?: MatchOptions): ErrorMatcher {
- return { ...options, err: true, enc: 'nil', codes, schema };
+export function nilErr(
+ codes: StatusCodePredicate,
+ schema: Schema,
+ options?: MatchOptions,
+): ErrorMatcher {
+ return { ...options, err: true, enc: "nil", codes, schema };
}
-export function nil(codes: StatusCodePredicate, schema: Schema, options?: MatchOptions): ValueMatcher {
- return { ...options, enc: 'nil', codes, schema };
+export function nil(
+ codes: StatusCodePredicate,
+ schema: Schema,
+ options?: MatchOptions,
+): ValueMatcher {
+ return { ...options, enc: "nil", codes, schema };
}
export function fail(codes: StatusCodePredicate): FailMatcher {
- return { enc: 'fail', codes };
+ return { enc: "fail", codes };
}
-export type MatchedValue = Matchers extends Matcher[] ? T : never;
-export type MatchedError = Matchers extends Matcher[] ? E : never;
+export type MatchedValue = Matchers extends Matcher[]
+ ? T
+ : never;
+export type MatchedError = Matchers extends Matcher[]
+ ? E
+ : never;
export type MatchFunc = (
response: Response,
request: Request,
- options?: { resultKey?: string; extraFields?: Record }
+ options?: { resultKey?: string; extraFields?: Record },
) => Promise<[result: Result, raw: unknown]>;
-export function match(...matchers: Array>): MatchFunc {
+export function match(
+ ...matchers: Array>
+): MatchFunc {
return async function matchFunc(
response: Response,
request: Request,
- options?: { resultKey?: string; extraFields?: Record }
- ): Promise<[result: Result, raw: unknown]> {
+ options?: { resultKey?: string; extraFields?: Record },
+ ): Promise<
+ [result: Result, raw: unknown]
+ > {
let raw: unknown;
let matcher: Matcher | undefined;
for (const match of matchers) {
const { codes } = match;
- const ctpattern = 'ctype' in match ? match.ctype : DEFAULT_CONTENT_TYPES[match.enc];
+ const ctpattern = "ctype" in match
+ ? match.ctype
+ : DEFAULT_CONTENT_TYPES[match.enc];
if (ctpattern && matchResponse(response, codes, ctpattern)) {
matcher = match;
break;
@@ -132,68 +206,64 @@ export function match(...matchers: Array>): MatchFunc ''),
- }),
- },
- raw,
- ];
+ return [{
+ ok: false,
+ error: new SDKError("Unexpected Status or Content-Type", {
+ response,
+ request,
+ body: await response.text().catch(() => ""),
+ }),
+ }, raw];
}
const encoding = matcher.enc;
- let body = '';
+ let body = "";
switch (encoding) {
- case 'json':
+ case "json":
body = await response.text();
raw = JSON.parse(body);
break;
- case 'jsonl':
+ case "jsonl":
raw = response.body;
break;
- case 'bytes':
+ case "bytes":
raw = new Uint8Array(await response.arrayBuffer());
break;
- case 'stream':
+ case "stream":
raw = response.body;
break;
- case 'text':
+ case "text":
body = await response.text();
raw = body;
break;
- case 'sse':
+ case "sse":
raw = response.body;
break;
- case 'nil':
+ case "nil":
body = await response.text();
raw = undefined;
break;
- case 'fail':
+ case "fail":
body = await response.text();
raw = body;
break;
default:
- throw new Error(`Unsupported response type: ${encoding satisfies never}`);
+ throw new Error(
+ `Unsupported response type: ${encoding satisfies never}`,
+ );
}
- if (matcher.enc === 'fail') {
- return [
- {
- ok: false,
- error: new SDKError('API error occurred', { request, response, body }),
- },
- raw,
- ];
+ if (matcher.enc === "fail") {
+ return [{
+ ok: false,
+ error: new SDKError("API error occurred", { request, response, body }),
+ }, raw];
}
const resultKey = matcher.key || options?.resultKey;
let data: unknown;
- if ('err' in matcher) {
+ if ("err" in matcher) {
data = {
...options?.extraFields,
...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null),
@@ -218,20 +288,22 @@ export function match(...matchers: Array>): MatchFunc matcher.schema.parse(v), 'Response validation failed', {
- request,
- response,
- body,
- });
+ if ("err" in matcher) {
+ const result = safeParseResponse(
+ data,
+ (v: unknown) => matcher.schema.parse(v),
+ "Response validation failed",
+ { request, response, body },
+ );
return [result.ok ? { ok: false, error: result.value } : result, raw];
} else {
return [
- safeParseResponse(data, (v: unknown) => matcher.schema.parse(v), 'Response validation failed', {
- request,
- response,
- body,
- }),
+ safeParseResponse(
+ data,
+ (v: unknown) => matcher.schema.parse(v),
+ "Response validation failed",
+ { request, response, body },
+ ),
raw,
];
}
@@ -257,7 +329,7 @@ function safeParseResponse(
rawValue: Inp,
fn: (value: Inp) => Out,
errorMessage: string,
- httpMeta: { response: Response; request: Request; body: string }
+ httpMeta: { response: Response; request: Request; body: string },
): Result {
try {
return OK(fn(rawValue));
@@ -268,7 +340,7 @@ function safeParseResponse(
rawValue,
rawMessage: errorMessage,
...httpMeta,
- })
+ }),
);
}
}
diff --git a/libs/internal-sdk/src/lib/sdks.ts b/libs/internal-sdk/src/lib/sdks.ts
index 3b3170ba98e..52a2bf0ac3d 100644
--- a/libs/internal-sdk/src/lib/sdks.ts
+++ b/libs/internal-sdk/src/lib/sdks.ts
@@ -2,19 +2,19 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import { SDKHooks } from '../hooks/hooks.js';
-import { HookContext } from '../hooks/types.js';
+import { SDKHooks } from "../hooks/hooks.js";
+import { HookContext } from "../hooks/types.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
-} from '../models/errors/httpclienterrors.js';
-import { ERR, OK, Result } from '../types/fp.js';
-import { stringToBase64 } from './base64.js';
-import { SDK_METADATA, SDKOptions, serverURLFromOptions } from './config.js';
-import { encodeForm } from './encodings.js';
+} from "../models/errors/httpclienterrors.js";
+import { ERR, OK, Result } from "../types/fp.js";
+import { stringToBase64 } from "./base64.js";
+import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "./config.js";
+import { encodeForm } from "./encodings.js";
import {
HTTPClient,
isAbortError,
@@ -22,10 +22,10 @@ import {
isTimeoutError,
matchContentType,
matchStatusCode,
-} from './http.js';
-import { Logger } from './logger.js';
-import { RetryConfig, retry } from './retries.js';
-import { SecurityState } from './security.js';
+} from "./http.js";
+import { Logger } from "./logger.js";
+import { retry, RetryConfig } from "./retries.js";
+import { SecurityState } from "./security.js";
export type RequestOptions = {
/**
@@ -52,15 +52,15 @@ export type RequestOptions = {
*
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options|Request}
*/
- fetchOptions?: Omit;
-} & Omit;
+ fetchOptions?: Omit;
+} & Omit;
type RequestConfig = {
method: string;
path: string;
baseURL?: string | URL | undefined;
query?: string;
- body?: RequestInit['body'];
+ body?: RequestInit["body"];
headers?: HeadersInit;
security?: SecurityState | null;
uaHeader?: string;
@@ -68,13 +68,14 @@ type RequestConfig = {
timeoutMs?: number;
};
-const gt: unknown = typeof globalThis === 'undefined' ? null : globalThis;
-const webWorkerLike =
- typeof gt === 'object' && gt != null && 'importScripts' in gt && typeof gt['importScripts'] === 'function';
-const isBrowserLike =
- webWorkerLike ||
- (typeof navigator !== 'undefined' && 'serviceWorker' in navigator) ||
- (typeof window === 'object' && typeof window.document !== 'undefined');
+const gt: unknown = typeof globalThis === "undefined" ? null : globalThis;
+const webWorkerLike = typeof gt === "object"
+ && gt != null
+ && "importScripts" in gt
+ && typeof gt["importScripts"] === "function";
+const isBrowserLike = webWorkerLike
+ || (typeof navigator !== "undefined" && "serviceWorker" in navigator)
+ || (typeof window === "object" && typeof window.document !== "undefined");
export class ClientSDK {
readonly #httpClient: HTTPClient;
@@ -85,7 +86,12 @@ export class ClientSDK {
constructor(options: SDKOptions = {}) {
const opt = options as unknown;
- if (typeof opt === 'object' && opt != null && 'hooks' in opt && opt.hooks instanceof SDKHooks) {
+ if (
+ typeof opt === "object"
+ && opt != null
+ && "hooks" in opt
+ && opt.hooks instanceof SDKHooks
+ ) {
this.#hooks = opt.hooks;
} else {
this.#hooks = new SDKHooks();
@@ -96,7 +102,7 @@ export class ClientSDK {
const url = serverURLFromOptions(options);
if (url) {
- url.pathname = url.pathname.replace(/\/+$/, '') + '/';
+ url.pathname = url.pathname.replace(/\/+$/, "") + "/";
}
this._baseURL = url;
this.#httpClient = options.httpClient || defaultHttpClient;
@@ -109,39 +115,39 @@ export class ClientSDK {
public _createRequest(
context: HookContext,
conf: RequestConfig,
- options?: RequestOptions
+ options?: RequestOptions,
): Result {
const { method, path, query, headers: opHeaders, security } = conf;
const base = conf.baseURL ?? this._baseURL;
if (!base) {
- return ERR(new InvalidRequestError('No base URL provided for operation'));
+ return ERR(new InvalidRequestError("No base URL provided for operation"));
}
const baseURL = new URL(base);
let reqURL: URL;
if (path) {
- baseURL.pathname = baseURL.pathname.replace(/\/+$/, '') + '/';
+ baseURL.pathname = baseURL.pathname.replace(/\/+$/, "") + "/";
reqURL = new URL(path, baseURL);
} else {
reqURL = baseURL;
}
- reqURL.hash = '';
+ reqURL.hash = "";
- let finalQuery = query || '';
+ let finalQuery = query || "";
const secQuery: string[] = [];
for (const [k, v] of Object.entries(security?.queryParams || {})) {
- const q = encodeForm(k, v, { charEncoding: 'percent' });
- if (typeof q !== 'undefined') {
+ const q = encodeForm(k, v, { charEncoding: "percent" });
+ if (typeof q !== "undefined") {
secQuery.push(q);
}
}
if (secQuery.length) {
- finalQuery += `&${secQuery.join('&')}`;
+ finalQuery += `&${secQuery.join("&")}`;
}
if (finalQuery) {
- const q = finalQuery.startsWith('&') ? finalQuery.slice(1) : finalQuery;
+ const q = finalQuery.startsWith("&") ? finalQuery.slice(1) : finalQuery;
reqURL.search = `?${q}`;
}
@@ -150,8 +156,10 @@ export class ClientSDK {
const username = security?.basic.username;
const password = security?.basic.password;
if (username != null || password != null) {
- const encoded = stringToBase64([username || '', password || ''].join(':'));
- headers.set('Authorization', `Basic ${encoded}`);
+ const encoded = stringToBase64(
+ [username || "", password || ""].join(":"),
+ );
+ headers.set("Authorization", `Basic ${encoded}`);
}
const securityHeaders = new Headers(security?.headers || {});
@@ -159,14 +167,16 @@ export class ClientSDK {
headers.set(k, v);
}
- let cookie = headers.get('cookie') || '';
+ let cookie = headers.get("cookie") || "";
for (const [k, v] of Object.entries(security?.cookies || {})) {
cookie += `; ${k}=${v}`;
}
- cookie = cookie.startsWith('; ') ? cookie.slice(2) : cookie;
- headers.set('cookie', cookie);
+ cookie = cookie.startsWith("; ") ? cookie.slice(2) : cookie;
+ headers.set("cookie", cookie);
- const userHeaders = new Headers(options?.headers ?? options?.fetchOptions?.headers);
+ const userHeaders = new Headers(
+ options?.headers ?? options?.fetchOptions?.headers,
+ );
for (const [k, v] of userHeaders) {
headers.set(k, v);
}
@@ -174,10 +184,13 @@ export class ClientSDK {
// Only set user agent header in non-browser-like environments since CORS
// policy disallows setting it in browsers e.g. Chrome throws an error.
if (!isBrowserLike) {
- headers.set(conf.uaHeader ?? 'user-agent', conf.userAgent ?? SDK_METADATA.userAgent);
+ headers.set(
+ conf.uaHeader ?? "user-agent",
+ conf.userAgent ?? SDK_METADATA.userAgent,
+ );
}
- const fetchOptions: Omit = {
+ const fetchOptions: Omit = {
...options?.fetchOptions,
...options,
};
@@ -187,7 +200,7 @@ export class ClientSDK {
}
if (conf.body instanceof ReadableStream) {
- Object.assign(fetchOptions, { duplex: 'half' });
+ Object.assign(fetchOptions, { duplex: "half" });
}
let input;
@@ -203,9 +216,9 @@ export class ClientSDK {
});
} catch (err: unknown) {
return ERR(
- new UnexpectedClientError('Create request hook failed to execute', {
+ new UnexpectedClientError("Create request hook failed to execute", {
cause: err,
- })
+ }),
);
}
@@ -219,20 +232,34 @@ export class ClientSDK {
errorCodes: number | string | (number | string)[];
retryConfig: RetryConfig;
retryCodes: string[];
- }
- ): Promise> {
+ },
+ ): Promise<
+ Result<
+ Response,
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ | UnexpectedClientError
+ >
+ > {
const { context, errorCodes } = options;
return retry(
async () => {
const req = await this.#hooks.beforeRequest(context, request.clone());
- await logRequest(this.#logger, req).catch((e) => this.#logger?.log('Failed to log request:', e));
+ await logRequest(this.#logger, req).catch((e) =>
+ this.#logger?.log("Failed to log request:", e)
+ );
let response = await this.#httpClient.request(req);
try {
if (matchStatusCode(response, errorCodes)) {
- const result = await this.#hooks.afterError(context, response, null);
+ const result = await this.#hooks.afterError(
+ context,
+ response,
+ null,
+ );
if (result.error) {
throw result.error;
}
@@ -241,68 +268,74 @@ export class ClientSDK {
response = await this.#hooks.afterSuccess(context, response);
}
} finally {
- await logResponse(this.#logger, response, req).catch((e) => this.#logger?.log('Failed to log response:', e));
+ await logResponse(this.#logger, response, req)
+ .catch(e => this.#logger?.log("Failed to log response:", e));
}
return response;
},
- { config: options.retryConfig, statusCodes: options.retryCodes }
+ { config: options.retryConfig, statusCodes: options.retryCodes },
).then(
(r) => OK(r),
(err) => {
switch (true) {
case isAbortError(err):
return ERR(
- new RequestAbortedError('Request aborted by client', {
+ new RequestAbortedError("Request aborted by client", {
cause: err,
- })
+ }),
);
case isTimeoutError(err):
- return ERR(new RequestTimeoutError('Request timed out', { cause: err }));
+ return ERR(
+ new RequestTimeoutError("Request timed out", { cause: err }),
+ );
case isConnectionError(err):
- return ERR(new ConnectionError('Unable to make request', { cause: err }));
+ return ERR(
+ new ConnectionError("Unable to make request", { cause: err }),
+ );
default:
return ERR(
- new UnexpectedClientError('Unexpected HTTP client error', {
+ new UnexpectedClientError("Unexpected HTTP client error", {
cause: err,
- })
+ }),
);
}
- }
+ },
);
}
}
const jsonLikeContentTypeRE = /^(application|text)\/([^+]+\+)*json.*/;
-const jsonlLikeContentTypeRE = /^(application|text)\/([^+]+\+)*(jsonl|x-ndjson)\b.*/;
+const jsonlLikeContentTypeRE =
+ /^(application|text)\/([^+]+\+)*(jsonl|x-ndjson)\b.*/;
async function logRequest(logger: Logger | undefined, req: Request) {
if (!logger) {
return;
}
- const contentType = req.headers.get('content-type');
- const ct = contentType?.split(';')[0] || '';
+ const contentType = req.headers.get("content-type");
+ const ct = contentType?.split(";")[0] || "";
logger.group(`> Request: ${req.method} ${req.url}`);
- logger.group('Headers:');
+ logger.group("Headers:");
for (const [k, v] of req.headers.entries()) {
logger.log(`${k}: ${v}`);
}
logger.groupEnd();
- logger.group('Body:');
+ logger.group("Body:");
switch (true) {
case jsonLikeContentTypeRE.test(ct):
logger.log(await req.clone().json());
break;
- case ct.startsWith('text/'):
+ case ct.startsWith("text/"):
logger.log(await req.clone().text());
break;
- case ct === 'multipart/form-data': {
+ case ct === "multipart/form-data": {
const body = await req.clone().formData();
for (const [k, v] of body) {
- const vlabel = v instanceof Blob ? '' : v;
+ const vlabel = v instanceof Blob ? "" : v;
logger.log(`${k}: ${vlabel}`);
}
break;
@@ -316,42 +349,47 @@ async function logRequest(logger: Logger | undefined, req: Request) {
logger.groupEnd();
}
-async function logResponse(logger: Logger | undefined, res: Response, req: Request) {
+async function logResponse(
+ logger: Logger | undefined,
+ res: Response,
+ req: Request,
+) {
if (!logger) {
return;
}
- const contentType = res.headers.get('content-type');
- const ct = contentType?.split(';')[0] || '';
+ const contentType = res.headers.get("content-type");
+ const ct = contentType?.split(";")[0] || "";
logger.group(`< Response: ${req.method} ${req.url}`);
- logger.log('Status Code:', res.status, res.statusText);
+ logger.log("Status Code:", res.status, res.statusText);
- logger.group('Headers:');
+ logger.group("Headers:");
for (const [k, v] of res.headers.entries()) {
logger.log(`${k}: ${v}`);
}
logger.groupEnd();
- logger.group('Body:');
+ logger.group("Body:");
switch (true) {
- case matchContentType(res, 'application/json') ||
- (jsonLikeContentTypeRE.test(ct) && !jsonlLikeContentTypeRE.test(ct)):
+ case matchContentType(res, "application/json")
+ || jsonLikeContentTypeRE.test(ct) && !jsonlLikeContentTypeRE.test(ct):
logger.log(await res.clone().json());
break;
- case matchContentType(res, 'application/jsonl') || jsonlLikeContentTypeRE.test(ct):
+ case matchContentType(res, "application/jsonl")
+ || jsonlLikeContentTypeRE.test(ct):
logger.log(await res.clone().text());
break;
- case matchContentType(res, 'text/event-stream'):
+ case matchContentType(res, "text/event-stream"):
logger.log(`<${contentType}>`);
break;
- case matchContentType(res, 'text/*'):
+ case matchContentType(res, "text/*"):
logger.log(await res.clone().text());
break;
- case matchContentType(res, 'multipart/form-data'): {
+ case matchContentType(res, "multipart/form-data"): {
const body = await res.clone().formData();
for (const [k, v] of body) {
- const vlabel = v instanceof Blob ? '' : v;
+ const vlabel = v instanceof Blob ? "" : v;
logger.log(`${k}: ${vlabel}`);
}
break;
diff --git a/libs/internal-sdk/src/lib/security.ts b/libs/internal-sdk/src/lib/security.ts
index f420eb18aca..623bd47d298 100644
--- a/libs/internal-sdk/src/lib/security.ts
+++ b/libs/internal-sdk/src/lib/security.ts
@@ -2,7 +2,7 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as components from '../models/components/index.js';
+import * as components from "../models/components/index.js";
type OAuth2PasswordFlow = {
username: string;
@@ -13,27 +13,30 @@ type OAuth2PasswordFlow = {
};
export enum SecurityErrorCode {
- Incomplete = 'incomplete',
- UnrecognisedSecurityType = 'unrecognized_security_type',
+ Incomplete = "incomplete",
+ UnrecognisedSecurityType = "unrecognized_security_type",
}
export class SecurityError extends Error {
constructor(
public code: SecurityErrorCode,
- message: string
+ message: string,
) {
super(message);
- this.name = 'SecurityError';
+ this.name = "SecurityError";
}
static incomplete(): SecurityError {
return new SecurityError(
SecurityErrorCode.Incomplete,
- 'Security requirements not met in order to perform the operation'
+ "Security requirements not met in order to perform the operation",
);
}
static unrecognizedType(type: string): SecurityError {
- return new SecurityError(SecurityErrorCode.UnrecognisedSecurityType, `Unrecognised security type: ${type}`);
+ return new SecurityError(
+ SecurityErrorCode.UnrecognisedSecurityType,
+ `Unrecognised security type: ${type}`,
+ );
}
}
@@ -42,45 +45,48 @@ export type SecurityState = {
headers: Record;
queryParams: Record;
cookies: Record;
- oauth2: ({ type: 'password' } & OAuth2PasswordFlow) | { type: 'none' };
+ oauth2: ({ type: "password" } & OAuth2PasswordFlow) | { type: "none" };
};
type SecurityInputBasic = {
- type: 'http:basic';
- value: { username?: string | undefined; password?: string | undefined } | null | undefined;
+ type: "http:basic";
+ value:
+ | { username?: string | undefined; password?: string | undefined }
+ | null
+ | undefined;
};
type SecurityInputBearer = {
- type: 'http:bearer';
+ type: "http:bearer";
value: string | null | undefined;
fieldName: string;
};
type SecurityInputAPIKey = {
- type: 'apiKey:header' | 'apiKey:query' | 'apiKey:cookie';
+ type: "apiKey:header" | "apiKey:query" | "apiKey:cookie";
value: string | null | undefined;
fieldName: string;
};
type SecurityInputOIDC = {
- type: 'openIdConnect';
+ type: "openIdConnect";
value: string | null | undefined;
fieldName: string;
};
type SecurityInputOAuth2 = {
- type: 'oauth2';
+ type: "oauth2";
value: string | null | undefined;
fieldName: string;
};
type SecurityInputOAuth2ClientCredentials = {
- type: 'oauth2:client_credentials';
+ type: "oauth2:client_credentials";
value:
| {
- clientID?: string | undefined;
- clientSecret?: string | undefined;
- }
+ clientID?: string | undefined;
+ clientSecret?: string | undefined;
+ }
| null
| string
| undefined;
@@ -88,13 +94,16 @@ type SecurityInputOAuth2ClientCredentials = {
};
type SecurityInputOAuth2PasswordCredentials = {
- type: 'oauth2:password';
- value: string | null | undefined;
+ type: "oauth2:password";
+ value:
+ | string
+ | null
+ | undefined;
fieldName?: string;
};
type SecurityInputCustom = {
- type: 'http:custom';
+ type: "http:custom";
value: any | null | undefined;
fieldName?: string;
};
@@ -109,34 +118,41 @@ export type SecurityInput =
| SecurityInputOIDC
| SecurityInputCustom;
-export function resolveSecurity(...options: SecurityInput[][]): SecurityState | null {
+export function resolveSecurity(
+ ...options: SecurityInput[][]
+): SecurityState | null {
const state: SecurityState = {
basic: {},
headers: {},
queryParams: {},
cookies: {},
- oauth2: { type: 'none' },
+ oauth2: { type: "none" },
};
const option = options.find((opts) => {
return opts.every((o) => {
if (o.value == null) {
return false;
- } else if (o.type === 'http:basic') {
+ } else if (o.type === "http:basic") {
return o.value.username != null || o.value.password != null;
- } else if (o.type === 'http:custom') {
+ } else if (o.type === "http:custom") {
return null;
- } else if (o.type === 'oauth2:password') {
- return typeof o.value === 'string' && !!o.value;
- } else if (o.type === 'oauth2:client_credentials') {
- if (typeof o.value == 'string') {
+ } else if (o.type === "oauth2:password") {
+ return (
+ typeof o.value === "string" && !!o.value
+ );
+ } else if (o.type === "oauth2:client_credentials") {
+ if (typeof o.value == "string") {
return !!o.value;
}
return o.value.clientID != null || o.value.clientSecret != null;
- } else if (typeof o.value === 'string') {
+ } else if (typeof o.value === "string") {
return !!o.value;
} else {
- throw new Error(`Unrecognized security type: ${o.type} (value type: ${typeof o.value})`);
+ throw new Error(
+ `Unrecognized security type: ${o.type} (value type: ${typeof o
+ .value})`,
+ );
}
});
});
@@ -152,32 +168,32 @@ export function resolveSecurity(...options: SecurityInput[][]): SecurityState |
const { type } = spec;
switch (type) {
- case 'apiKey:header':
+ case "apiKey:header":
state.headers[spec.fieldName] = spec.value;
break;
- case 'apiKey:query':
+ case "apiKey:query":
state.queryParams[spec.fieldName] = spec.value;
break;
- case 'apiKey:cookie':
+ case "apiKey:cookie":
state.cookies[spec.fieldName] = spec.value;
break;
- case 'http:basic':
+ case "http:basic":
applyBasic(state, spec);
break;
- case 'http:custom':
+ case "http:custom":
break;
- case 'http:bearer':
+ case "http:bearer":
applyBearer(state, spec);
break;
- case 'oauth2':
+ case "oauth2":
applyBearer(state, spec);
break;
- case 'oauth2:password':
+ case "oauth2:password":
applyBearer(state, spec);
break;
- case 'oauth2:client_credentials':
+ case "oauth2:client_credentials":
break;
- case 'openIdConnect':
+ case "openIdConnect":
applyBearer(state, spec);
break;
default:
@@ -188,7 +204,10 @@ export function resolveSecurity(...options: SecurityInput[][]): SecurityState |
return state;
}
-function applyBasic(state: SecurityState, spec: SecurityInputBasic) {
+function applyBasic(
+ state: SecurityState,
+ spec: SecurityInputBasic,
+) {
if (spec.value == null) {
return;
}
@@ -198,14 +217,18 @@ function applyBasic(state: SecurityState, spec: SecurityInputBasic) {
function applyBearer(
state: SecurityState,
- spec: SecurityInputBearer | SecurityInputOAuth2 | SecurityInputOIDC | SecurityInputOAuth2PasswordCredentials
+ spec:
+ | SecurityInputBearer
+ | SecurityInputOAuth2
+ | SecurityInputOIDC
+ | SecurityInputOAuth2PasswordCredentials,
) {
- if (typeof spec.value !== 'string' || !spec.value) {
+ if (typeof spec.value !== "string" || !spec.value) {
return;
}
let value = spec.value;
- if (value.slice(0, 7).toLowerCase() !== 'bearer ') {
+ if (value.slice(0, 7).toLowerCase() !== "bearer ") {
value = `Bearer ${value}`;
}
@@ -214,31 +237,45 @@ function applyBearer(
}
}
-export function resolveGlobalSecurity(security: Partial | null | undefined): SecurityState | null {
- return resolveSecurity(
+export function resolveGlobalSecurity(
+ security: Partial | null | undefined,
+ allowedFields?: number[],
+): SecurityState | null {
+ let inputs: SecurityInput[][] = [
[
{
- fieldName: 'Authorization',
- type: 'apiKey:header',
+ fieldName: "Authorization",
+ type: "apiKey:header",
value: security?.secretKey,
},
],
[
{
- fieldName: 'Authorization',
- type: 'http:bearer',
+ fieldName: "Authorization",
+ type: "http:bearer",
value: security?.bearerAuth,
},
- ]
- );
+ ],
+ ];
+
+ if (allowedFields) {
+ inputs = allowedFields.map((i) => {
+ if (i < 0 || i >= inputs.length) {
+ throw new RangeError(`invalid allowedFields index ${i}`);
+ }
+ return inputs[i]!;
+ });
+ }
+
+ return resolveSecurity(...inputs);
}
-export async function extractSecurity>(
- sec: T | (() => Promise) | undefined
-): Promise {
+export async function extractSecurity<
+ T extends string | Record,
+>(sec: T | (() => Promise) | undefined): Promise {
if (sec == null) {
return;
}
- return typeof sec === 'function' ? sec() : sec;
+ return typeof sec === "function" ? sec() : sec;
}
diff --git a/libs/internal-sdk/src/lib/url.ts b/libs/internal-sdk/src/lib/url.ts
index d6275a5b261..79e7ce660b3 100644
--- a/libs/internal-sdk/src/lib/url.ts
+++ b/libs/internal-sdk/src/lib/url.ts
@@ -8,24 +8,28 @@ export type Params = Partial>;
export function pathToFunc(
pathPattern: string,
- options?: { charEncoding?: 'percent' | 'none' }
+ options?: { charEncoding?: "percent" | "none" },
): (params?: Params) => string {
const paramRE = /\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g;
return function buildURLPath(params: Record = {}): string {
return pathPattern
- .replace(paramRE, (_, placeholder) => {
+ .replace(paramRE, function (_, placeholder) {
if (!hasOwn.call(params, placeholder)) {
throw new Error(`Parameter '${placeholder}' is required`);
}
const value = params[placeholder];
- if (typeof value !== 'string' && typeof value !== 'number') {
- throw new Error(`Parameter '${placeholder}' must be a string or number`);
+ if (typeof value !== "string" && typeof value !== "number") {
+ throw new Error(
+ `Parameter '${placeholder}' must be a string or number`,
+ );
}
- return options?.charEncoding === 'percent' ? encodeURIComponent(`${value}`) : `${value}`;
+ return options?.charEncoding === "percent"
+ ? encodeURIComponent(`${value}`)
+ : `${value}`;
})
- .replace(/^\/+/, '');
+ .replace(/^\/+/, "");
};
}
diff --git a/libs/internal-sdk/src/models/components/actiondto.ts b/libs/internal-sdk/src/models/components/actiondto.ts
index ba33c0d4969..6efc53ed6ee 100644
--- a/libs/internal-sdk/src/models/components/actiondto.ts
+++ b/libs/internal-sdk/src/models/components/actiondto.ts
@@ -2,16 +2,16 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as z from 'zod/v3';
-import { safeParse } from '../../lib/schemas.js';
-import { Result as SafeParseResult } from '../../types/fp.js';
-import { SDKValidationError } from '../errors/sdkvalidationerror.js';
+import * as z from "zod/v3";
+import { safeParse } from "../../lib/schemas.js";
+import { Result as SafeParseResult } from "../../types/fp.js";
+import { SDKValidationError } from "../errors/sdkvalidationerror.js";
import {
RedirectDto,
RedirectDto$inboundSchema,
RedirectDto$Outbound,
RedirectDto$outboundSchema,
-} from './redirectdto.js';
+} from "./redirectdto.js";
export type ActionDto = {
/**
@@ -25,7 +25,11 @@ export type ActionDto = {
};
/** @internal */
-export const ActionDto$inboundSchema: z.ZodType = z.object({
+export const ActionDto$inboundSchema: z.ZodType<
+ ActionDto,
+ z.ZodTypeDef,
+ unknown
+> = z.object({
label: z.string().optional(),
redirect: RedirectDto$inboundSchema.optional(),
});
@@ -36,7 +40,11 @@ export type ActionDto$Outbound = {
};
/** @internal */
-export const ActionDto$outboundSchema: z.ZodType = z.object({
+export const ActionDto$outboundSchema: z.ZodType<
+ ActionDto$Outbound,
+ z.ZodTypeDef,
+ ActionDto
+> = z.object({
label: z.string().optional(),
redirect: RedirectDto$outboundSchema.optional(),
});
@@ -44,10 +52,12 @@ export const ActionDto$outboundSchema: z.ZodType {
+export function actionDtoFromJSON(
+ jsonString: string,
+): SafeParseResult {
return safeParse(
jsonString,
(x) => ActionDto$inboundSchema.parse(JSON.parse(x)),
- `Failed to parse 'ActionDto' from JSON`
+ `Failed to parse 'ActionDto' from JSON`,
);
}
diff --git a/libs/internal-sdk/src/models/components/activitynotificationjobresponsedto.ts b/libs/internal-sdk/src/models/components/activitynotificationjobresponsedto.ts
index aab362ac943..9f3cb8c4540 100644
--- a/libs/internal-sdk/src/models/components/activitynotificationjobresponsedto.ts
+++ b/libs/internal-sdk/src/models/components/activitynotificationjobresponsedto.ts
@@ -2,43 +2,51 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as z from 'zod/v3';
-import { remap as remap$ } from '../../lib/primitives.js';
-import { safeParse } from '../../lib/schemas.js';
-import { ClosedEnum } from '../../types/enums.js';
-import { Result as SafeParseResult } from '../../types/fp.js';
-import { SDKValidationError } from '../errors/sdkvalidationerror.js';
+import * as z from "zod/v3";
+import { remap as remap$ } from "../../lib/primitives.js";
+import { safeParse } from "../../lib/schemas.js";
+import { ClosedEnum } from "../../types/enums.js";
+import { Result as SafeParseResult } from "../../types/fp.js";
+import { SDKValidationError } from "../errors/sdkvalidationerror.js";
import {
ActivityNotificationExecutionDetailResponseDto,
ActivityNotificationExecutionDetailResponseDto$inboundSchema,
-} from './activitynotificationexecutiondetailresponsedto.js';
+} from "./activitynotificationexecutiondetailresponsedto.js";
import {
ActivityNotificationStepResponseDto,
ActivityNotificationStepResponseDto$inboundSchema,
-} from './activitynotificationstepresponsedto.js';
-import { DigestMetadataDto, DigestMetadataDto$inboundSchema } from './digestmetadatadto.js';
-import { ProvidersIdEnum, ProvidersIdEnum$inboundSchema } from './providersidenum.js';
+} from "./activitynotificationstepresponsedto.js";
+import {
+ DigestMetadataDto,
+ DigestMetadataDto$inboundSchema,
+} from "./digestmetadatadto.js";
+import {
+ ProvidersIdEnum,
+ ProvidersIdEnum$inboundSchema,
+} from "./providersidenum.js";
/**
* Type of the job
*/
export const ActivityNotificationJobResponseDtoType = {
- InApp: 'in_app',
- Email: 'email',
- Sms: 'sms',
- Chat: 'chat',
- Push: 'push',
- Digest: 'digest',
- Trigger: 'trigger',
- Delay: 'delay',
- Throttle: 'throttle',
- Custom: 'custom',
- HttpRequest: 'http_request',
+ InApp: "in_app",
+ Email: "email",
+ Sms: "sms",
+ Chat: "chat",
+ Push: "push",
+ Digest: "digest",
+ Trigger: "trigger",
+ Delay: "delay",
+ Throttle: "throttle",
+ Custom: "custom",
+ HttpRequest: "http_request",
} as const;
/**
* Type of the job
*/
-export type ActivityNotificationJobResponseDtoType = ClosedEnum;
+export type ActivityNotificationJobResponseDtoType = ClosedEnum<
+ typeof ActivityNotificationJobResponseDtoType
+>;
/**
* Optional payload for the job
@@ -93,9 +101,10 @@ export type ActivityNotificationJobResponseDto = {
};
/** @internal */
-export const ActivityNotificationJobResponseDtoType$inboundSchema: z.ZodNativeEnum<
- typeof ActivityNotificationJobResponseDtoType
-> = z.nativeEnum(ActivityNotificationJobResponseDtoType);
+export const ActivityNotificationJobResponseDtoType$inboundSchema:
+ z.ZodNativeEnum = z.nativeEnum(
+ ActivityNotificationJobResponseDtoType,
+ );
/** @internal */
export const ActivityNotificationJobResponseDtoPayload$inboundSchema: z.ZodType<
@@ -105,12 +114,18 @@ export const ActivityNotificationJobResponseDtoPayload$inboundSchema: z.ZodType<
> = z.object({});
export function activityNotificationJobResponseDtoPayloadFromJSON(
- jsonString: string
-): SafeParseResult {
+ jsonString: string,
+): SafeParseResult<
+ ActivityNotificationJobResponseDtoPayload,
+ SDKValidationError
+> {
return safeParse(
jsonString,
- (x) => ActivityNotificationJobResponseDtoPayload$inboundSchema.parse(JSON.parse(x)),
- `Failed to parse 'ActivityNotificationJobResponseDtoPayload' from JSON`
+ (x) =>
+ ActivityNotificationJobResponseDtoPayload$inboundSchema.parse(
+ JSON.parse(x),
+ ),
+ `Failed to parse 'ActivityNotificationJobResponseDtoPayload' from JSON`,
);
}
@@ -119,32 +134,34 @@ export const ActivityNotificationJobResponseDto$inboundSchema: z.ZodType<
ActivityNotificationJobResponseDto,
z.ZodTypeDef,
unknown
-> = z
- .object({
- _id: z.string(),
- type: ActivityNotificationJobResponseDtoType$inboundSchema,
- digest: DigestMetadataDto$inboundSchema.optional(),
- executionDetails: z.array(ActivityNotificationExecutionDetailResponseDto$inboundSchema),
- step: ActivityNotificationStepResponseDto$inboundSchema,
- overrides: z.record(z.any()).optional(),
- payload: z.lazy(() => ActivityNotificationJobResponseDtoPayload$inboundSchema).optional(),
- providerId: ProvidersIdEnum$inboundSchema,
- status: z.string(),
- updatedAt: z.string().optional(),
- scheduleExtensionsCount: z.number().optional(),
- })
- .transform((v) => {
- return remap$(v, {
- _id: 'id',
- });
+> = z.object({
+ _id: z.string(),
+ type: ActivityNotificationJobResponseDtoType$inboundSchema,
+ digest: DigestMetadataDto$inboundSchema.optional(),
+ executionDetails: z.array(
+ ActivityNotificationExecutionDetailResponseDto$inboundSchema,
+ ),
+ step: ActivityNotificationStepResponseDto$inboundSchema,
+ overrides: z.record(z.any()).optional(),
+ payload: z.lazy(() => ActivityNotificationJobResponseDtoPayload$inboundSchema)
+ .optional(),
+ providerId: ProvidersIdEnum$inboundSchema,
+ status: z.string(),
+ updatedAt: z.string().optional(),
+ scheduleExtensionsCount: z.number().optional(),
+}).transform((v) => {
+ return remap$(v, {
+ "_id": "id",
});
+});
export function activityNotificationJobResponseDtoFromJSON(
- jsonString: string
+ jsonString: string,
): SafeParseResult {
return safeParse(
jsonString,
- (x) => ActivityNotificationJobResponseDto$inboundSchema.parse(JSON.parse(x)),
- `Failed to parse 'ActivityNotificationJobResponseDto' from JSON`
+ (x) =>
+ ActivityNotificationJobResponseDto$inboundSchema.parse(JSON.parse(x)),
+ `Failed to parse 'ActivityNotificationJobResponseDto' from JSON`,
);
}
diff --git a/libs/internal-sdk/src/models/components/actortypeenum.ts b/libs/internal-sdk/src/models/components/actortypeenum.ts
index 5d9992cfe45..b557b7d006f 100644
--- a/libs/internal-sdk/src/models/components/actortypeenum.ts
+++ b/libs/internal-sdk/src/models/components/actortypeenum.ts
@@ -2,17 +2,17 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as z from 'zod/v3';
-import { ClosedEnum } from '../../types/enums.js';
+import * as z from "zod/v3";
+import { ClosedEnum } from "../../types/enums.js";
/**
* The type of the actor, indicating the role in the notification process.
*/
export const ActorTypeEnum = {
- None: 'none',
- User: 'user',
- SystemIcon: 'system_icon',
- SystemCustom: 'system_custom',
+ None: "none",
+ User: "user",
+ SystemIcon: "system_icon",
+ SystemCustom: "system_custom",
} as const;
/**
* The type of the actor, indicating the role in the notification process.
@@ -20,4 +20,6 @@ export const ActorTypeEnum = {
export type ActorTypeEnum = ClosedEnum;
/** @internal */
-export const ActorTypeEnum$inboundSchema: z.ZodNativeEnum = z.nativeEnum(ActorTypeEnum);
+export const ActorTypeEnum$inboundSchema: z.ZodNativeEnum<
+ typeof ActorTypeEnum
+> = z.nativeEnum(ActorTypeEnum);
diff --git a/libs/internal-sdk/src/models/components/builderfieldtypeenum.ts b/libs/internal-sdk/src/models/components/builderfieldtypeenum.ts
index 63589ce4a0b..84b927d39f9 100644
--- a/libs/internal-sdk/src/models/components/builderfieldtypeenum.ts
+++ b/libs/internal-sdk/src/models/components/builderfieldtypeenum.ts
@@ -2,24 +2,26 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as z from 'zod/v3';
-import { ClosedEnum } from '../../types/enums.js';
+import * as z from "zod/v3";
+import { ClosedEnum } from "../../types/enums.js";
export const BuilderFieldTypeEnum = {
- Boolean: 'BOOLEAN',
- Text: 'TEXT',
- Date: 'DATE',
- Number: 'NUMBER',
- Statement: 'STATEMENT',
- List: 'LIST',
- MultiList: 'MULTI_LIST',
- Group: 'GROUP',
+ Boolean: "BOOLEAN",
+ Text: "TEXT",
+ Date: "DATE",
+ Number: "NUMBER",
+ Statement: "STATEMENT",
+ List: "LIST",
+ MultiList: "MULTI_LIST",
+ Group: "GROUP",
} as const;
export type BuilderFieldTypeEnum = ClosedEnum;
/** @internal */
-export const BuilderFieldTypeEnum$inboundSchema: z.ZodNativeEnum =
- z.nativeEnum(BuilderFieldTypeEnum);
+export const BuilderFieldTypeEnum$inboundSchema: z.ZodNativeEnum<
+ typeof BuilderFieldTypeEnum
+> = z.nativeEnum(BuilderFieldTypeEnum);
/** @internal */
-export const BuilderFieldTypeEnum$outboundSchema: z.ZodNativeEnum =
- BuilderFieldTypeEnum$inboundSchema;
+export const BuilderFieldTypeEnum$outboundSchema: z.ZodNativeEnum<
+ typeof BuilderFieldTypeEnum
+> = BuilderFieldTypeEnum$inboundSchema;
diff --git a/libs/internal-sdk/src/models/components/bulkupdatesubscriberpreferencesdto.ts b/libs/internal-sdk/src/models/components/bulkupdatesubscriberpreferencesdto.ts
index 09a318b3bf3..16d95ebc508 100644
--- a/libs/internal-sdk/src/models/components/bulkupdatesubscriberpreferencesdto.ts
+++ b/libs/internal-sdk/src/models/components/bulkupdatesubscriberpreferencesdto.ts
@@ -2,12 +2,12 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as z from 'zod/v3';
+import * as z from "zod/v3";
import {
BulkUpdateSubscriberPreferenceItemDto,
BulkUpdateSubscriberPreferenceItemDto$Outbound,
BulkUpdateSubscriberPreferenceItemDto$outboundSchema,
-} from './bulkupdatesubscriberpreferenceitemdto.js';
+} from "./bulkupdatesubscriberpreferenceitemdto.js";
/**
* Rich context object with id and optional data
@@ -37,7 +37,11 @@ export type Context2$Outbound = {
};
/** @internal */
-export const Context2$outboundSchema: z.ZodType = z.object({
+export const Context2$outboundSchema: z.ZodType<
+ Context2$Outbound,
+ z.ZodTypeDef,
+ Context2
+> = z.object({
id: z.string(),
data: z.record(z.any()).optional(),
});
@@ -47,20 +51,26 @@ export function context2ToJSON(context2: Context2): string {
}
/** @internal */
-export type BulkUpdateSubscriberPreferencesDtoContext$Outbound = Context2$Outbound | string;
+export type BulkUpdateSubscriberPreferencesDtoContext$Outbound =
+ | Context2$Outbound
+ | string;
/** @internal */
-export const BulkUpdateSubscriberPreferencesDtoContext$outboundSchema: z.ZodType<
- BulkUpdateSubscriberPreferencesDtoContext$Outbound,
- z.ZodTypeDef,
- BulkUpdateSubscriberPreferencesDtoContext
-> = z.union([z.lazy(() => Context2$outboundSchema), z.string()]);
+export const BulkUpdateSubscriberPreferencesDtoContext$outboundSchema:
+ z.ZodType<
+ BulkUpdateSubscriberPreferencesDtoContext$Outbound,
+ z.ZodTypeDef,
+ BulkUpdateSubscriberPreferencesDtoContext
+ > = z.union([z.lazy(() => Context2$outboundSchema), z.string()]);
export function bulkUpdateSubscriberPreferencesDtoContextToJSON(
- bulkUpdateSubscriberPreferencesDtoContext: BulkUpdateSubscriberPreferencesDtoContext
+ bulkUpdateSubscriberPreferencesDtoContext:
+ BulkUpdateSubscriberPreferencesDtoContext,
): string {
return JSON.stringify(
- BulkUpdateSubscriberPreferencesDtoContext$outboundSchema.parse(bulkUpdateSubscriberPreferencesDtoContext)
+ BulkUpdateSubscriberPreferencesDtoContext$outboundSchema.parse(
+ bulkUpdateSubscriberPreferencesDtoContext,
+ ),
);
}
@@ -77,11 +87,17 @@ export const BulkUpdateSubscriberPreferencesDto$outboundSchema: z.ZodType<
BulkUpdateSubscriberPreferencesDto
> = z.object({
preferences: z.array(BulkUpdateSubscriberPreferenceItemDto$outboundSchema),
- context: z.record(z.union([z.lazy(() => Context2$outboundSchema), z.string()])).optional(),
+ context: z.record(
+ z.union([z.lazy(() => Context2$outboundSchema), z.string()]),
+ ).optional(),
});
export function bulkUpdateSubscriberPreferencesDtoToJSON(
- bulkUpdateSubscriberPreferencesDto: BulkUpdateSubscriberPreferencesDto
+ bulkUpdateSubscriberPreferencesDto: BulkUpdateSubscriberPreferencesDto,
): string {
- return JSON.stringify(BulkUpdateSubscriberPreferencesDto$outboundSchema.parse(bulkUpdateSubscriberPreferencesDto));
+ return JSON.stringify(
+ BulkUpdateSubscriberPreferencesDto$outboundSchema.parse(
+ bulkUpdateSubscriberPreferencesDto,
+ ),
+ );
}
diff --git a/libs/internal-sdk/src/models/components/buttontypeenum.ts b/libs/internal-sdk/src/models/components/buttontypeenum.ts
index 9ae988fb802..fe8048ccaca 100644
--- a/libs/internal-sdk/src/models/components/buttontypeenum.ts
+++ b/libs/internal-sdk/src/models/components/buttontypeenum.ts
@@ -2,15 +2,15 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as z from 'zod/v3';
-import { ClosedEnum } from '../../types/enums.js';
+import * as z from "zod/v3";
+import { ClosedEnum } from "../../types/enums.js";
/**
* Type of button for the action result
*/
export const ButtonTypeEnum = {
- Primary: 'primary',
- Secondary: 'secondary',
+ Primary: "primary",
+ Secondary: "secondary",
} as const;
/**
* Type of button for the action result
@@ -18,4 +18,6 @@ export const ButtonTypeEnum = {
export type ButtonTypeEnum = ClosedEnum;
/** @internal */
-export const ButtonTypeEnum$inboundSchema: z.ZodNativeEnum = z.nativeEnum(ButtonTypeEnum);
+export const ButtonTypeEnum$inboundSchema: z.ZodNativeEnum<
+ typeof ButtonTypeEnum
+> = z.nativeEnum(ButtonTypeEnum);
diff --git a/libs/internal-sdk/src/models/components/channelsettingsdto.ts b/libs/internal-sdk/src/models/components/channelsettingsdto.ts
index 3cb317d290d..d53a6fc2b3b 100644
--- a/libs/internal-sdk/src/models/components/channelsettingsdto.ts
+++ b/libs/internal-sdk/src/models/components/channelsettingsdto.ts
@@ -2,22 +2,22 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as z from 'zod/v3';
-import { remap as remap$ } from '../../lib/primitives.js';
-import { safeParse } from '../../lib/schemas.js';
-import { Result as SafeParseResult } from '../../types/fp.js';
-import { SDKValidationError } from '../errors/sdkvalidationerror.js';
+import * as z from "zod/v3";
+import { remap as remap$ } from "../../lib/primitives.js";
+import { safeParse } from "../../lib/schemas.js";
+import { Result as SafeParseResult } from "../../types/fp.js";
+import { SDKValidationError } from "../errors/sdkvalidationerror.js";
import {
ChannelCredentials,
ChannelCredentials$inboundSchema,
ChannelCredentials$Outbound,
ChannelCredentials$outboundSchema,
-} from './channelcredentials.js';
+} from "./channelcredentials.js";
import {
ChatOrPushProviderEnum,
ChatOrPushProviderEnum$inboundSchema,
ChatOrPushProviderEnum$outboundSchema,
-} from './chatorpushproviderenum.js';
+} from "./chatorpushproviderenum.js";
export type ChannelSettingsDto = {
/**
@@ -39,18 +39,20 @@ export type ChannelSettingsDto = {
};
/** @internal */
-export const ChannelSettingsDto$inboundSchema: z.ZodType = z
- .object({
- providerId: ChatOrPushProviderEnum$inboundSchema,
- integrationIdentifier: z.string().optional(),
- credentials: ChannelCredentials$inboundSchema,
- _integrationId: z.string(),
- })
- .transform((v) => {
- return remap$(v, {
- _integrationId: 'integrationId',
- });
+export const ChannelSettingsDto$inboundSchema: z.ZodType<
+ ChannelSettingsDto,
+ z.ZodTypeDef,
+ unknown
+> = z.object({
+ providerId: ChatOrPushProviderEnum$inboundSchema,
+ integrationIdentifier: z.string().optional(),
+ credentials: ChannelCredentials$inboundSchema,
+ _integrationId: z.string(),
+}).transform((v) => {
+ return remap$(v, {
+ "_integrationId": "integrationId",
});
+});
/** @internal */
export type ChannelSettingsDto$Outbound = {
providerId: string;
@@ -64,28 +66,30 @@ export const ChannelSettingsDto$outboundSchema: z.ZodType<
ChannelSettingsDto$Outbound,
z.ZodTypeDef,
ChannelSettingsDto
-> = z
- .object({
- providerId: ChatOrPushProviderEnum$outboundSchema,
- integrationIdentifier: z.string().optional(),
- credentials: ChannelCredentials$outboundSchema,
- integrationId: z.string(),
- })
- .transform((v) => {
- return remap$(v, {
- integrationId: '_integrationId',
- });
+> = z.object({
+ providerId: ChatOrPushProviderEnum$outboundSchema,
+ integrationIdentifier: z.string().optional(),
+ credentials: ChannelCredentials$outboundSchema,
+ integrationId: z.string(),
+}).transform((v) => {
+ return remap$(v, {
+ integrationId: "_integrationId",
});
+});
-export function channelSettingsDtoToJSON(channelSettingsDto: ChannelSettingsDto): string {
- return JSON.stringify(ChannelSettingsDto$outboundSchema.parse(channelSettingsDto));
+export function channelSettingsDtoToJSON(
+ channelSettingsDto: ChannelSettingsDto,
+): string {
+ return JSON.stringify(
+ ChannelSettingsDto$outboundSchema.parse(channelSettingsDto),
+ );
}
export function channelSettingsDtoFromJSON(
- jsonString: string
+ jsonString: string,
): SafeParseResult {
return safeParse(
jsonString,
(x) => ChannelSettingsDto$inboundSchema.parse(JSON.parse(x)),
- `Failed to parse 'ChannelSettingsDto' from JSON`
+ `Failed to parse 'ChannelSettingsDto' from JSON`,
);
}
diff --git a/libs/internal-sdk/src/models/components/channeltypeenum.ts b/libs/internal-sdk/src/models/components/channeltypeenum.ts
index 025d447d2be..13baf40b84e 100644
--- a/libs/internal-sdk/src/models/components/channeltypeenum.ts
+++ b/libs/internal-sdk/src/models/components/channeltypeenum.ts
@@ -2,18 +2,18 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as z from 'zod/v3';
-import { ClosedEnum } from '../../types/enums.js';
+import * as z from "zod/v3";
+import { ClosedEnum } from "../../types/enums.js";
/**
* Channel type through which the message is sent
*/
export const ChannelTypeEnum = {
- InApp: 'in_app',
- Email: 'email',
- Sms: 'sms',
- Chat: 'chat',
- Push: 'push',
+ InApp: "in_app",
+ Email: "email",
+ Sms: "sms",
+ Chat: "chat",
+ Push: "push",
} as const;
/**
* Channel type through which the message is sent
@@ -21,6 +21,10 @@ export const ChannelTypeEnum = {
export type ChannelTypeEnum = ClosedEnum;
/** @internal */
-export const ChannelTypeEnum$inboundSchema: z.ZodNativeEnum = z.nativeEnum(ChannelTypeEnum);
+export const ChannelTypeEnum$inboundSchema: z.ZodNativeEnum<
+ typeof ChannelTypeEnum
+> = z.nativeEnum(ChannelTypeEnum);
/** @internal */
-export const ChannelTypeEnum$outboundSchema: z.ZodNativeEnum = ChannelTypeEnum$inboundSchema;
+export const ChannelTypeEnum$outboundSchema: z.ZodNativeEnum<
+ typeof ChannelTypeEnum
+> = ChannelTypeEnum$inboundSchema;
diff --git a/libs/internal-sdk/src/models/components/chatorpushproviderenum.ts b/libs/internal-sdk/src/models/components/chatorpushproviderenum.ts
index 4889dab0424..7348a943d0d 100644
--- a/libs/internal-sdk/src/models/components/chatorpushproviderenum.ts
+++ b/libs/internal-sdk/src/models/components/chatorpushproviderenum.ts
@@ -2,33 +2,33 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as z from 'zod/v3';
-import { ClosedEnum } from '../../types/enums.js';
+import * as z from "zod/v3";
+import { ClosedEnum } from "../../types/enums.js";
/**
* The provider identifier for the credentials
*/
export const ChatOrPushProviderEnum = {
- Slack: 'slack',
- Discord: 'discord',
- Msteams: 'msteams',
- Mattermost: 'mattermost',
- Ryver: 'ryver',
- Zulip: 'zulip',
- GrafanaOnCall: 'grafana-on-call',
- Getstream: 'getstream',
- RocketChat: 'rocket-chat',
- WhatsappBusiness: 'whatsapp-business',
- ChatWebhook: 'chat-webhook',
- NovuSlack: 'novu-slack',
- Fcm: 'fcm',
- Apns: 'apns',
- Expo: 'expo',
- OneSignal: 'one-signal',
- Pushpad: 'pushpad',
- PushWebhook: 'push-webhook',
- PusherBeams: 'pusher-beams',
- Appio: 'appio',
+ Slack: "slack",
+ Discord: "discord",
+ Msteams: "msteams",
+ Mattermost: "mattermost",
+ Ryver: "ryver",
+ Zulip: "zulip",
+ GrafanaOnCall: "grafana-on-call",
+ Getstream: "getstream",
+ RocketChat: "rocket-chat",
+ WhatsappBusiness: "whatsapp-business",
+ ChatWebhook: "chat-webhook",
+ NovuSlack: "novu-slack",
+ Fcm: "fcm",
+ Apns: "apns",
+ Expo: "expo",
+ OneSignal: "one-signal",
+ Pushpad: "pushpad",
+ PushWebhook: "push-webhook",
+ PusherBeams: "pusher-beams",
+ Appio: "appio",
} as const;
/**
* The provider identifier for the credentials
@@ -36,8 +36,10 @@ export const ChatOrPushProviderEnum = {
export type ChatOrPushProviderEnum = ClosedEnum;
/** @internal */
-export const ChatOrPushProviderEnum$inboundSchema: z.ZodNativeEnum =
- z.nativeEnum(ChatOrPushProviderEnum);
+export const ChatOrPushProviderEnum$inboundSchema: z.ZodNativeEnum<
+ typeof ChatOrPushProviderEnum
+> = z.nativeEnum(ChatOrPushProviderEnum);
/** @internal */
-export const ChatOrPushProviderEnum$outboundSchema: z.ZodNativeEnum =
- ChatOrPushProviderEnum$inboundSchema;
+export const ChatOrPushProviderEnum$outboundSchema: z.ZodNativeEnum<
+ typeof ChatOrPushProviderEnum
+> = ChatOrPushProviderEnum$inboundSchema;
diff --git a/libs/internal-sdk/src/models/components/chatstepresponsedto.ts b/libs/internal-sdk/src/models/components/chatstepresponsedto.ts
index eb9d389327b..45085b01839 100644
--- a/libs/internal-sdk/src/models/components/chatstepresponsedto.ts
+++ b/libs/internal-sdk/src/models/components/chatstepresponsedto.ts
@@ -2,17 +2,23 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as z from 'zod/v3';
-import { remap as remap$ } from '../../lib/primitives.js';
-import { collectExtraKeys as collectExtraKeys$, safeParse } from '../../lib/schemas.js';
-import { Result as SafeParseResult } from '../../types/fp.js';
-import { SDKValidationError } from '../errors/sdkvalidationerror.js';
+import * as z from "zod/v3";
+import { remap as remap$ } from "../../lib/primitives.js";
+import {
+ collectExtraKeys as collectExtraKeys$,
+ safeParse,
+} from "../../lib/schemas.js";
+import { Result as SafeParseResult } from "../../types/fp.js";
+import { SDKValidationError } from "../errors/sdkvalidationerror.js";
import {
ChatControlsMetadataResponseDto,
ChatControlsMetadataResponseDto$inboundSchema,
-} from './chatcontrolsmetadataresponsedto.js';
-import { ResourceOriginEnum, ResourceOriginEnum$inboundSchema } from './resourceoriginenum.js';
-import { StepIssuesDto, StepIssuesDto$inboundSchema } from './stepissuesdto.js';
+} from "./chatcontrolsmetadataresponsedto.js";
+import {
+ ResourceOriginEnum,
+ ResourceOriginEnum$inboundSchema,
+} from "./resourceoriginenum.js";
+import { StepIssuesDto, StepIssuesDto$inboundSchema } from "./stepissuesdto.js";
/**
* Control values for the chat step
@@ -61,7 +67,7 @@ export type ChatStepResponseDto = {
/**
* Type of the step
*/
- type: 'chat';
+ type: "chat";
/**
* Origin of the layout
*/
@@ -90,55 +96,56 @@ export const ChatStepResponseDtoControlValues$inboundSchema: z.ZodType<
z.ZodTypeDef,
unknown
> = collectExtraKeys$(
- z
- .object({
- skip: z.record(z.any()).optional(),
- body: z.string().optional(),
- })
- .catchall(z.any()),
- 'additionalProperties',
- true
+ z.object({
+ skip: z.record(z.any()).optional(),
+ body: z.string().optional(),
+ }).catchall(z.any()),
+ "additionalProperties",
+ true,
);
export function chatStepResponseDtoControlValuesFromJSON(
- jsonString: string
+ jsonString: string,
): SafeParseResult {
return safeParse(
jsonString,
(x) => ChatStepResponseDtoControlValues$inboundSchema.parse(JSON.parse(x)),
- `Failed to parse 'ChatStepResponseDtoControlValues' from JSON`
+ `Failed to parse 'ChatStepResponseDtoControlValues' from JSON`,
);
}
/** @internal */
-export const ChatStepResponseDto$inboundSchema: z.ZodType = z
- .object({
- controls: ChatControlsMetadataResponseDto$inboundSchema,
- controlValues: z.lazy(() => ChatStepResponseDtoControlValues$inboundSchema).optional(),
- variables: z.record(z.any()),
- stepId: z.string(),
- _id: z.string(),
- name: z.string(),
- slug: z.string(),
- type: z.literal('chat'),
- origin: ResourceOriginEnum$inboundSchema,
- workflowId: z.string(),
- workflowDatabaseId: z.string(),
- issues: StepIssuesDto$inboundSchema.optional(),
- stepResolverHash: z.string().optional(),
- })
- .transform((v) => {
- return remap$(v, {
- _id: 'id',
- });
+export const ChatStepResponseDto$inboundSchema: z.ZodType<
+ ChatStepResponseDto,
+ z.ZodTypeDef,
+ unknown
+> = z.object({
+ controls: ChatControlsMetadataResponseDto$inboundSchema,
+ controlValues: z.lazy(() => ChatStepResponseDtoControlValues$inboundSchema)
+ .optional(),
+ variables: z.record(z.any()),
+ stepId: z.string(),
+ _id: z.string(),
+ name: z.string(),
+ slug: z.string(),
+ type: z.literal("chat"),
+ origin: ResourceOriginEnum$inboundSchema,
+ workflowId: z.string(),
+ workflowDatabaseId: z.string(),
+ issues: StepIssuesDto$inboundSchema.optional(),
+ stepResolverHash: z.string().optional(),
+}).transform((v) => {
+ return remap$(v, {
+ "_id": "id",
});
+});
export function chatStepResponseDtoFromJSON(
- jsonString: string
+ jsonString: string,
): SafeParseResult {
return safeParse(
jsonString,
(x) => ChatStepResponseDto$inboundSchema.parse(JSON.parse(x)),
- `Failed to parse 'ChatStepResponseDto' from JSON`
+ `Failed to parse 'ChatStepResponseDto' from JSON`,
);
}
diff --git a/libs/internal-sdk/src/models/components/contentissueenum.ts b/libs/internal-sdk/src/models/components/contentissueenum.ts
index 70256de3bdf..5b89a1d63ce 100644
--- a/libs/internal-sdk/src/models/components/contentissueenum.ts
+++ b/libs/internal-sdk/src/models/components/contentissueenum.ts
@@ -2,18 +2,18 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as z from 'zod/v3';
-import { ClosedEnum } from '../../types/enums.js';
+import * as z from "zod/v3";
+import { ClosedEnum } from "../../types/enums.js";
/**
* Type of step content issue
*/
export const ContentIssueEnum = {
- IllegalVariableInControlValue: 'ILLEGAL_VARIABLE_IN_CONTROL_VALUE',
- InvalidFilterArgInVariable: 'INVALID_FILTER_ARG_IN_VARIABLE',
- InvalidUrl: 'INVALID_URL',
- MissingValue: 'MISSING_VALUE',
- TierLimitExceeded: 'TIER_LIMIT_EXCEEDED',
+ IllegalVariableInControlValue: "ILLEGAL_VARIABLE_IN_CONTROL_VALUE",
+ InvalidFilterArgInVariable: "INVALID_FILTER_ARG_IN_VARIABLE",
+ InvalidUrl: "INVALID_URL",
+ MissingValue: "MISSING_VALUE",
+ TierLimitExceeded: "TIER_LIMIT_EXCEEDED",
} as const;
/**
* Type of step content issue
@@ -21,4 +21,6 @@ export const ContentIssueEnum = {
export type ContentIssueEnum = ClosedEnum;
/** @internal */
-export const ContentIssueEnum$inboundSchema: z.ZodNativeEnum = z.nativeEnum(ContentIssueEnum);
+export const ContentIssueEnum$inboundSchema: z.ZodNativeEnum<
+ typeof ContentIssueEnum
+> = z.nativeEnum(ContentIssueEnum);
diff --git a/libs/internal-sdk/src/models/components/createchannelconnectionrequestdto.ts b/libs/internal-sdk/src/models/components/createchannelconnectionrequestdto.ts
index 51873c61c6f..453e7a656a0 100644
--- a/libs/internal-sdk/src/models/components/createchannelconnectionrequestdto.ts
+++ b/libs/internal-sdk/src/models/components/createchannelconnectionrequestdto.ts
@@ -2,9 +2,17 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as z from 'zod/v3';
-import { AuthDto, AuthDto$Outbound, AuthDto$outboundSchema } from './authdto.js';
-import { WorkspaceDto, WorkspaceDto$Outbound, WorkspaceDto$outboundSchema } from './workspacedto.js';
+import * as z from "zod/v3";
+import {
+ AuthDto,
+ AuthDto$Outbound,
+ AuthDto$outboundSchema,
+} from "./authdto.js";
+import {
+ WorkspaceDto,
+ WorkspaceDto$Outbound,
+ WorkspaceDto$outboundSchema,
+} from "./workspacedto.js";
/**
* Rich context object with id and optional data
@@ -17,7 +25,9 @@ export type CreateChannelConnectionRequestDtoContext2 = {
data?: { [k: string]: any } | undefined;
};
-export type CreateChannelConnectionRequestDtoContext = CreateChannelConnectionRequestDtoContext2 | string;
+export type CreateChannelConnectionRequestDtoContext =
+ | CreateChannelConnectionRequestDtoContext2
+ | string;
export type CreateChannelConnectionRequestDto = {
/**
@@ -28,7 +38,9 @@ export type CreateChannelConnectionRequestDto = {
* The subscriber ID to link the channel connection to
*/
subscriberId?: string | undefined;
- context?: { [k: string]: CreateChannelConnectionRequestDtoContext2 | string } | undefined;
+ context?:
+ | { [k: string]: CreateChannelConnectionRequestDtoContext2 | string }
+ | undefined;
/**
* The identifier of the integration to use for this channel connection.
*/
@@ -44,20 +56,24 @@ export type CreateChannelConnectionRequestDtoContext2$Outbound = {
};
/** @internal */
-export const CreateChannelConnectionRequestDtoContext2$outboundSchema: z.ZodType<
- CreateChannelConnectionRequestDtoContext2$Outbound,
- z.ZodTypeDef,
- CreateChannelConnectionRequestDtoContext2
-> = z.object({
- id: z.string(),
- data: z.record(z.any()).optional(),
-});
+export const CreateChannelConnectionRequestDtoContext2$outboundSchema:
+ z.ZodType<
+ CreateChannelConnectionRequestDtoContext2$Outbound,
+ z.ZodTypeDef,
+ CreateChannelConnectionRequestDtoContext2
+ > = z.object({
+ id: z.string(),
+ data: z.record(z.any()).optional(),
+ });
export function createChannelConnectionRequestDtoContext2ToJSON(
- createChannelConnectionRequestDtoContext2: CreateChannelConnectionRequestDtoContext2
+ createChannelConnectionRequestDtoContext2:
+ CreateChannelConnectionRequestDtoContext2,
): string {
return JSON.stringify(
- CreateChannelConnectionRequestDtoContext2$outboundSchema.parse(createChannelConnectionRequestDtoContext2)
+ CreateChannelConnectionRequestDtoContext2$outboundSchema.parse(
+ createChannelConnectionRequestDtoContext2,
+ ),
);
}
@@ -71,13 +87,19 @@ export const CreateChannelConnectionRequestDtoContext$outboundSchema: z.ZodType<
CreateChannelConnectionRequestDtoContext$Outbound,
z.ZodTypeDef,
CreateChannelConnectionRequestDtoContext
-> = z.union([z.lazy(() => CreateChannelConnectionRequestDtoContext2$outboundSchema), z.string()]);
+> = z.union([
+ z.lazy(() => CreateChannelConnectionRequestDtoContext2$outboundSchema),
+ z.string(),
+]);
export function createChannelConnectionRequestDtoContextToJSON(
- createChannelConnectionRequestDtoContext: CreateChannelConnectionRequestDtoContext
+ createChannelConnectionRequestDtoContext:
+ CreateChannelConnectionRequestDtoContext,
): string {
return JSON.stringify(
- CreateChannelConnectionRequestDtoContext$outboundSchema.parse(createChannelConnectionRequestDtoContext)
+ CreateChannelConnectionRequestDtoContext$outboundSchema.parse(
+ createChannelConnectionRequestDtoContext,
+ ),
);
}
@@ -85,11 +107,9 @@ export function createChannelConnectionRequestDtoContextToJSON(
export type CreateChannelConnectionRequestDto$Outbound = {
identifier?: string | undefined;
subscriberId?: string | undefined;
- context?:
- | {
- [k: string]: CreateChannelConnectionRequestDtoContext2$Outbound | string;
- }
- | undefined;
+ context?: {
+ [k: string]: CreateChannelConnectionRequestDtoContext2$Outbound | string;
+ } | undefined;
integrationIdentifier: string;
workspace: WorkspaceDto$Outbound;
auth: AuthDto$Outbound;
@@ -103,16 +123,23 @@ export const CreateChannelConnectionRequestDto$outboundSchema: z.ZodType<
> = z.object({
identifier: z.string().optional(),
subscriberId: z.string().optional(),
- context: z
- .record(z.union([z.lazy(() => CreateChannelConnectionRequestDtoContext2$outboundSchema), z.string()]))
- .optional(),
+ context: z.record(
+ z.union([
+ z.lazy(() => CreateChannelConnectionRequestDtoContext2$outboundSchema),
+ z.string(),
+ ]),
+ ).optional(),
integrationIdentifier: z.string(),
workspace: WorkspaceDto$outboundSchema,
auth: AuthDto$outboundSchema,
});
export function createChannelConnectionRequestDtoToJSON(
- createChannelConnectionRequestDto: CreateChannelConnectionRequestDto
+ createChannelConnectionRequestDto: CreateChannelConnectionRequestDto,
): string {
- return JSON.stringify(CreateChannelConnectionRequestDto$outboundSchema.parse(createChannelConnectionRequestDto));
+ return JSON.stringify(
+ CreateChannelConnectionRequestDto$outboundSchema.parse(
+ createChannelConnectionRequestDto,
+ ),
+ );
}
diff --git a/libs/internal-sdk/src/models/components/createenvironmentvariablerequestdto.ts b/libs/internal-sdk/src/models/components/createenvironmentvariablerequestdto.ts
index 165abaa1b12..9d789b175d4 100644
--- a/libs/internal-sdk/src/models/components/createenvironmentvariablerequestdto.ts
+++ b/libs/internal-sdk/src/models/components/createenvironmentvariablerequestdto.ts
@@ -2,24 +2,26 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as z from 'zod/v3';
-import { ClosedEnum } from '../../types/enums.js';
+import * as z from "zod/v3";
+import { ClosedEnum } from "../../types/enums.js";
import {
EnvironmentVariableValueDto,
EnvironmentVariableValueDto$Outbound,
EnvironmentVariableValueDto$outboundSchema,
-} from './environmentvariablevaluedto.js';
+} from "./environmentvariablevaluedto.js";
/**
* The type of the variable
*/
export const CreateEnvironmentVariableRequestDtoType = {
- String: 'string',
+ String: "string",
} as const;
/**
* The type of the variable
*/
-export type CreateEnvironmentVariableRequestDtoType = ClosedEnum;
+export type CreateEnvironmentVariableRequestDtoType = ClosedEnum<
+ typeof CreateEnvironmentVariableRequestDtoType
+>;
export type CreateEnvironmentVariableRequestDto = {
/**
@@ -38,9 +40,9 @@ export type CreateEnvironmentVariableRequestDto = {
};
/** @internal */
-export const CreateEnvironmentVariableRequestDtoType$outboundSchema: z.ZodNativeEnum<
- typeof CreateEnvironmentVariableRequestDtoType
-> = z.nativeEnum(CreateEnvironmentVariableRequestDtoType);
+export const CreateEnvironmentVariableRequestDtoType$outboundSchema:
+ z.ZodNativeEnum = z
+ .nativeEnum(CreateEnvironmentVariableRequestDtoType);
/** @internal */
export type CreateEnvironmentVariableRequestDto$Outbound = {
@@ -63,7 +65,11 @@ export const CreateEnvironmentVariableRequestDto$outboundSchema: z.ZodType<
});
export function createEnvironmentVariableRequestDtoToJSON(
- createEnvironmentVariableRequestDto: CreateEnvironmentVariableRequestDto
+ createEnvironmentVariableRequestDto: CreateEnvironmentVariableRequestDto,
): string {
- return JSON.stringify(CreateEnvironmentVariableRequestDto$outboundSchema.parse(createEnvironmentVariableRequestDto));
+ return JSON.stringify(
+ CreateEnvironmentVariableRequestDto$outboundSchema.parse(
+ createEnvironmentVariableRequestDto,
+ ),
+ );
}
diff --git a/libs/internal-sdk/src/models/components/createtopicsubscriptionsrequestdto.ts b/libs/internal-sdk/src/models/components/createtopicsubscriptionsrequestdto.ts
index f1b1bd1c182..0314a38838e 100644
--- a/libs/internal-sdk/src/models/components/createtopicsubscriptionsrequestdto.ts
+++ b/libs/internal-sdk/src/models/components/createtopicsubscriptionsrequestdto.ts
@@ -2,22 +2,22 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as z from 'zod/v3';
+import * as z from "zod/v3";
import {
GroupPreferenceFilterDto,
GroupPreferenceFilterDto$Outbound,
GroupPreferenceFilterDto$outboundSchema,
-} from './grouppreferencefilterdto.js';
+} from "./grouppreferencefilterdto.js";
import {
TopicSubscriberIdentifierDto,
TopicSubscriberIdentifierDto$Outbound,
TopicSubscriberIdentifierDto$outboundSchema,
-} from './topicsubscriberidentifierdto.js';
+} from "./topicsubscriberidentifierdto.js";
import {
WorkflowPreferenceRequestDto,
WorkflowPreferenceRequestDto$Outbound,
WorkflowPreferenceRequestDto$outboundSchema,
-} from './workflowpreferencerequestdto.js';
+} from "./workflowpreferencerequestdto.js";
export type Subscriptions = TopicSubscriberIdentifierDto | string;
@@ -32,9 +32,14 @@ export type CreateTopicSubscriptionsRequestDtoContext2 = {
data?: { [k: string]: any } | undefined;
};
-export type CreateTopicSubscriptionsRequestDtoContext = CreateTopicSubscriptionsRequestDtoContext2 | string;
+export type CreateTopicSubscriptionsRequestDtoContext =
+ | CreateTopicSubscriptionsRequestDtoContext2
+ | string;
-export type Preferences = WorkflowPreferenceRequestDto | GroupPreferenceFilterDto | string;
+export type Preferences =
+ | WorkflowPreferenceRequestDto
+ | GroupPreferenceFilterDto
+ | string;
export type CreateTopicSubscriptionsRequestDto = {
/**
@@ -51,21 +56,28 @@ export type CreateTopicSubscriptionsRequestDto = {
* The name of the topic
*/
name?: string | undefined;
- context?: { [k: string]: CreateTopicSubscriptionsRequestDtoContext2 | string } | undefined;
+ context?:
+ | { [k: string]: CreateTopicSubscriptionsRequestDtoContext2 | string }
+ | undefined;
/**
* The preferences of the topic. Can be a simple workflow ID string, workflow preference object, or group filter object
*/
- preferences?: Array | undefined;
+ preferences?:
+ | Array
+ | undefined;
};
/** @internal */
-export type Subscriptions$Outbound = TopicSubscriberIdentifierDto$Outbound | string;
+export type Subscriptions$Outbound =
+ | TopicSubscriberIdentifierDto$Outbound
+ | string;
/** @internal */
-export const Subscriptions$outboundSchema: z.ZodType = z.union([
- TopicSubscriberIdentifierDto$outboundSchema,
- z.string(),
-]);
+export const Subscriptions$outboundSchema: z.ZodType<
+ Subscriptions$Outbound,
+ z.ZodTypeDef,
+ Subscriptions
+> = z.union([TopicSubscriberIdentifierDto$outboundSchema, z.string()]);
export function subscriptionsToJSON(subscriptions: Subscriptions): string {
return JSON.stringify(Subscriptions$outboundSchema.parse(subscriptions));
@@ -78,20 +90,24 @@ export type CreateTopicSubscriptionsRequestDtoContext2$Outbound = {
};
/** @internal */
-export const CreateTopicSubscriptionsRequestDtoContext2$outboundSchema: z.ZodType<
- CreateTopicSubscriptionsRequestDtoContext2$Outbound,
- z.ZodTypeDef,
- CreateTopicSubscriptionsRequestDtoContext2
-> = z.object({
- id: z.string(),
- data: z.record(z.any()).optional(),
-});
+export const CreateTopicSubscriptionsRequestDtoContext2$outboundSchema:
+ z.ZodType<
+ CreateTopicSubscriptionsRequestDtoContext2$Outbound,
+ z.ZodTypeDef,
+ CreateTopicSubscriptionsRequestDtoContext2
+ > = z.object({
+ id: z.string(),
+ data: z.record(z.any()).optional(),
+ });
export function createTopicSubscriptionsRequestDtoContext2ToJSON(
- createTopicSubscriptionsRequestDtoContext2: CreateTopicSubscriptionsRequestDtoContext2
+ createTopicSubscriptionsRequestDtoContext2:
+ CreateTopicSubscriptionsRequestDtoContext2,
): string {
return JSON.stringify(
- CreateTopicSubscriptionsRequestDtoContext2$outboundSchema.parse(createTopicSubscriptionsRequestDtoContext2)
+ CreateTopicSubscriptionsRequestDtoContext2$outboundSchema.parse(
+ createTopicSubscriptionsRequestDtoContext2,
+ ),
);
}
@@ -101,25 +117,39 @@ export type CreateTopicSubscriptionsRequestDtoContext$Outbound =
| string;
/** @internal */
-export const CreateTopicSubscriptionsRequestDtoContext$outboundSchema: z.ZodType<
- CreateTopicSubscriptionsRequestDtoContext$Outbound,
- z.ZodTypeDef,
- CreateTopicSubscriptionsRequestDtoContext
-> = z.union([z.lazy(() => CreateTopicSubscriptionsRequestDtoContext2$outboundSchema), z.string()]);
+export const CreateTopicSubscriptionsRequestDtoContext$outboundSchema:
+ z.ZodType<
+ CreateTopicSubscriptionsRequestDtoContext$Outbound,
+ z.ZodTypeDef,
+ CreateTopicSubscriptionsRequestDtoContext
+ > = z.union([
+ z.lazy(() => CreateTopicSubscriptionsRequestDtoContext2$outboundSchema),
+ z.string(),
+ ]);
export function createTopicSubscriptionsRequestDtoContextToJSON(
- createTopicSubscriptionsRequestDtoContext: CreateTopicSubscriptionsRequestDtoContext
+ createTopicSubscriptionsRequestDtoContext:
+ CreateTopicSubscriptionsRequestDtoContext,
): string {
return JSON.stringify(
- CreateTopicSubscriptionsRequestDtoContext$outboundSchema.parse(createTopicSubscriptionsRequestDtoContext)
+ CreateTopicSubscriptionsRequestDtoContext$outboundSchema.parse(
+ createTopicSubscriptionsRequestDtoContext,
+ ),
);
}
/** @internal */
-export type Preferences$Outbound = WorkflowPreferenceRequestDto$Outbound | GroupPreferenceFilterDto$Outbound | string;
+export type Preferences$Outbound =
+ | WorkflowPreferenceRequestDto$Outbound
+ | GroupPreferenceFilterDto$Outbound
+ | string;
/** @internal */
-export const Preferences$outboundSchema: z.ZodType = z.union([
+export const Preferences$outboundSchema: z.ZodType<
+ Preferences$Outbound,
+ z.ZodTypeDef,
+ Preferences
+> = z.union([
WorkflowPreferenceRequestDto$outboundSchema,
GroupPreferenceFilterDto$outboundSchema,
z.string(),
@@ -132,14 +162,20 @@ export function preferencesToJSON(preferences: Preferences): string {
/** @internal */
export type CreateTopicSubscriptionsRequestDto$Outbound = {
subscriberIds?: Array | undefined;
- subscriptions?: Array | undefined;
+ subscriptions?:
+ | Array
+ | undefined;
name?: string | undefined;
- context?:
- | {
- [k: string]: CreateTopicSubscriptionsRequestDtoContext2$Outbound | string;
- }
+ context?: {
+ [k: string]: CreateTopicSubscriptionsRequestDtoContext2$Outbound | string;
+ } | undefined;
+ preferences?:
+ | Array<
+ | WorkflowPreferenceRequestDto$Outbound
+ | GroupPreferenceFilterDto$Outbound
+ | string
+ >
| undefined;
- preferences?: Array | undefined;
};
/** @internal */
@@ -149,18 +185,31 @@ export const CreateTopicSubscriptionsRequestDto$outboundSchema: z.ZodType<
CreateTopicSubscriptionsRequestDto
> = z.object({
subscriberIds: z.array(z.string()).optional(),
- subscriptions: z.array(z.union([TopicSubscriberIdentifierDto$outboundSchema, z.string()])).optional(),
+ subscriptions: z.array(
+ z.union([TopicSubscriberIdentifierDto$outboundSchema, z.string()]),
+ ).optional(),
name: z.string().optional(),
- context: z
- .record(z.union([z.lazy(() => CreateTopicSubscriptionsRequestDtoContext2$outboundSchema), z.string()]))
- .optional(),
- preferences: z
- .array(z.union([WorkflowPreferenceRequestDto$outboundSchema, GroupPreferenceFilterDto$outboundSchema, z.string()]))
- .optional(),
+ context: z.record(
+ z.union([
+ z.lazy(() => CreateTopicSubscriptionsRequestDtoContext2$outboundSchema),
+ z.string(),
+ ]),
+ ).optional(),
+ preferences: z.array(
+ z.union([
+ WorkflowPreferenceRequestDto$outboundSchema,
+ GroupPreferenceFilterDto$outboundSchema,
+ z.string(),
+ ]),
+ ).optional(),
});
export function createTopicSubscriptionsRequestDtoToJSON(
- createTopicSubscriptionsRequestDto: CreateTopicSubscriptionsRequestDto
+ createTopicSubscriptionsRequestDto: CreateTopicSubscriptionsRequestDto,
): string {
- return JSON.stringify(CreateTopicSubscriptionsRequestDto$outboundSchema.parse(createTopicSubscriptionsRequestDto));
+ return JSON.stringify(
+ CreateTopicSubscriptionsRequestDto$outboundSchema.parse(
+ createTopicSubscriptionsRequestDto,
+ ),
+ );
}
diff --git a/libs/internal-sdk/src/models/components/createworkflowdto.ts b/libs/internal-sdk/src/models/components/createworkflowdto.ts
index 7d9ca15d181..c8efe22517c 100644
--- a/libs/internal-sdk/src/models/components/createworkflowdto.ts
+++ b/libs/internal-sdk/src/models/components/createworkflowdto.ts
@@ -2,61 +2,71 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as z from 'zod/v3';
-import { remap as remap$ } from '../../lib/primitives.js';
+import * as z from "zod/v3";
+import { remap as remap$ } from "../../lib/primitives.js";
import {
ChatStepUpsertDto,
ChatStepUpsertDto$Outbound,
ChatStepUpsertDto$outboundSchema,
-} from './chatstepupsertdto.js';
+} from "./chatstepupsertdto.js";
import {
CustomStepUpsertDto,
CustomStepUpsertDto$Outbound,
CustomStepUpsertDto$outboundSchema,
-} from './customstepupsertdto.js';
+} from "./customstepupsertdto.js";
import {
DelayStepUpsertDto,
DelayStepUpsertDto$Outbound,
DelayStepUpsertDto$outboundSchema,
-} from './delaystepupsertdto.js';
+} from "./delaystepupsertdto.js";
import {
DigestStepUpsertDto,
DigestStepUpsertDto$Outbound,
DigestStepUpsertDto$outboundSchema,
-} from './digeststepupsertdto.js';
+} from "./digeststepupsertdto.js";
import {
EmailStepUpsertDto,
EmailStepUpsertDto$Outbound,
EmailStepUpsertDto$outboundSchema,
-} from './emailstepupsertdto.js';
+} from "./emailstepupsertdto.js";
import {
HttpRequestStepUpsertDto,
HttpRequestStepUpsertDto$Outbound,
HttpRequestStepUpsertDto$outboundSchema,
-} from './httprequeststepupsertdto.js';
+} from "./httprequeststepupsertdto.js";
import {
InAppStepUpsertDto,
InAppStepUpsertDto$Outbound,
InAppStepUpsertDto$outboundSchema,
-} from './inappstepupsertdto.js';
+} from "./inappstepupsertdto.js";
import {
PreferencesRequestDto,
PreferencesRequestDto$Outbound,
PreferencesRequestDto$outboundSchema,
-} from './preferencesrequestdto.js';
+} from "./preferencesrequestdto.js";
import {
PushStepUpsertDto,
PushStepUpsertDto$Outbound,
PushStepUpsertDto$outboundSchema,
-} from './pushstepupsertdto.js';
-import { SeverityLevelEnum, SeverityLevelEnum$outboundSchema } from './severitylevelenum.js';
-import { SmsStepUpsertDto, SmsStepUpsertDto$Outbound, SmsStepUpsertDto$outboundSchema } from './smsstepupsertdto.js';
+} from "./pushstepupsertdto.js";
+import {
+ SeverityLevelEnum,
+ SeverityLevelEnum$outboundSchema,
+} from "./severitylevelenum.js";
+import {
+ SmsStepUpsertDto,
+ SmsStepUpsertDto$Outbound,
+ SmsStepUpsertDto$outboundSchema,
+} from "./smsstepupsertdto.js";
import {
ThrottleStepUpsertDto,
ThrottleStepUpsertDto$Outbound,
ThrottleStepUpsertDto$outboundSchema,
-} from './throttlestepupsertdto.js';
-import { WorkflowCreationSourceEnum, WorkflowCreationSourceEnum$outboundSchema } from './workflowcreationsourceenum.js';
+} from "./throttlestepupsertdto.js";
+import {
+ WorkflowCreationSourceEnum,
+ WorkflowCreationSourceEnum$outboundSchema,
+} from "./workflowcreationsourceenum.js";
export type Steps =
| InAppStepUpsertDto
@@ -146,7 +156,11 @@ export type Steps$Outbound =
| HttpRequestStepUpsertDto$Outbound;
/** @internal */
-export const Steps$outboundSchema: z.ZodType = z.union([
+export const Steps$outboundSchema: z.ZodType<
+ Steps$Outbound,
+ z.ZodTypeDef,
+ Steps
+> = z.union([
InAppStepUpsertDto$outboundSchema,
EmailStepUpsertDto$outboundSchema,
SmsStepUpsertDto$outboundSchema,
@@ -191,41 +205,46 @@ export type CreateWorkflowDto$Outbound = {
};
/** @internal */
-export const CreateWorkflowDto$outboundSchema: z.ZodType =
- z
- .object({
- name: z.string(),
- description: z.string().optional(),
- tags: z.array(z.string()).optional(),
- active: z.boolean().default(false),
- validatePayload: z.boolean().optional(),
- payloadSchema: z.nullable(z.record(z.any())).optional(),
- isTranslationEnabled: z.boolean().default(false),
- workflowId: z.string(),
- steps: z.array(
- z.union([
- InAppStepUpsertDto$outboundSchema,
- EmailStepUpsertDto$outboundSchema,
- SmsStepUpsertDto$outboundSchema,
- PushStepUpsertDto$outboundSchema,
- ChatStepUpsertDto$outboundSchema,
- DelayStepUpsertDto$outboundSchema,
- DigestStepUpsertDto$outboundSchema,
- ThrottleStepUpsertDto$outboundSchema,
- CustomStepUpsertDto$outboundSchema,
- HttpRequestStepUpsertDto$outboundSchema,
- ])
- ),
- source: WorkflowCreationSourceEnum$outboundSchema.default('editor'),
- preferences: PreferencesRequestDto$outboundSchema.optional(),
- severity: SeverityLevelEnum$outboundSchema.optional(),
- })
- .transform((v) => {
- return remap$(v, {
- source: '__source',
- });
- });
+export const CreateWorkflowDto$outboundSchema: z.ZodType<
+ CreateWorkflowDto$Outbound,
+ z.ZodTypeDef,
+ CreateWorkflowDto
+> = z.object({
+ name: z.string(),
+ description: z.string().optional(),
+ tags: z.array(z.string()).optional(),
+ active: z.boolean().default(false),
+ validatePayload: z.boolean().optional(),
+ payloadSchema: z.nullable(z.record(z.any())).optional(),
+ isTranslationEnabled: z.boolean().default(false),
+ workflowId: z.string(),
+ steps: z.array(
+ z.union([
+ InAppStepUpsertDto$outboundSchema,
+ EmailStepUpsertDto$outboundSchema,
+ SmsStepUpsertDto$outboundSchema,
+ PushStepUpsertDto$outboundSchema,
+ ChatStepUpsertDto$outboundSchema,
+ DelayStepUpsertDto$outboundSchema,
+ DigestStepUpsertDto$outboundSchema,
+ ThrottleStepUpsertDto$outboundSchema,
+ CustomStepUpsertDto$outboundSchema,
+ HttpRequestStepUpsertDto$outboundSchema,
+ ]),
+ ),
+ source: WorkflowCreationSourceEnum$outboundSchema.default("editor"),
+ preferences: PreferencesRequestDto$outboundSchema.optional(),
+ severity: SeverityLevelEnum$outboundSchema.optional(),
+}).transform((v) => {
+ return remap$(v, {
+ source: "__source",
+ });
+});
-export function createWorkflowDtoToJSON(createWorkflowDto: CreateWorkflowDto): string {
- return JSON.stringify(CreateWorkflowDto$outboundSchema.parse(createWorkflowDto));
+export function createWorkflowDtoToJSON(
+ createWorkflowDto: CreateWorkflowDto,
+): string {
+ return JSON.stringify(
+ CreateWorkflowDto$outboundSchema.parse(createWorkflowDto),
+ );
}
diff --git a/libs/internal-sdk/src/models/components/customstepresponsedto.ts b/libs/internal-sdk/src/models/components/customstepresponsedto.ts
index 020dc654ab4..59cdbf966e6 100644
--- a/libs/internal-sdk/src/models/components/customstepresponsedto.ts
+++ b/libs/internal-sdk/src/models/components/customstepresponsedto.ts
@@ -2,17 +2,23 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as z from 'zod/v3';
-import { remap as remap$ } from '../../lib/primitives.js';
-import { collectExtraKeys as collectExtraKeys$, safeParse } from '../../lib/schemas.js';
-import { Result as SafeParseResult } from '../../types/fp.js';
-import { SDKValidationError } from '../errors/sdkvalidationerror.js';
+import * as z from "zod/v3";
+import { remap as remap$ } from "../../lib/primitives.js";
+import {
+ collectExtraKeys as collectExtraKeys$,
+ safeParse,
+} from "../../lib/schemas.js";
+import { Result as SafeParseResult } from "../../types/fp.js";
+import { SDKValidationError } from "../errors/sdkvalidationerror.js";
import {
CustomControlsMetadataResponseDto,
CustomControlsMetadataResponseDto$inboundSchema,
-} from './customcontrolsmetadataresponsedto.js';
-import { ResourceOriginEnum, ResourceOriginEnum$inboundSchema } from './resourceoriginenum.js';
-import { StepIssuesDto, StepIssuesDto$inboundSchema } from './stepissuesdto.js';
+} from "./customcontrolsmetadataresponsedto.js";
+import {
+ ResourceOriginEnum,
+ ResourceOriginEnum$inboundSchema,
+} from "./resourceoriginenum.js";
+import { StepIssuesDto, StepIssuesDto$inboundSchema } from "./stepissuesdto.js";
/**
* Control values for the custom step
@@ -57,7 +63,7 @@ export type CustomStepResponseDto = {
/**
* Type of the step
*/
- type: 'custom';
+ type: "custom";
/**
* Origin of the layout
*/
@@ -86,54 +92,56 @@ export const CustomStepResponseDtoControlValues$inboundSchema: z.ZodType<
z.ZodTypeDef,
unknown
> = collectExtraKeys$(
- z
- .object({
- custom: z.record(z.any()).optional(),
- })
- .catchall(z.any()),
- 'additionalProperties',
- true
+ z.object({
+ custom: z.record(z.any()).optional(),
+ }).catchall(z.any()),
+ "additionalProperties",
+ true,
);
export function customStepResponseDtoControlValuesFromJSON(
- jsonString: string
+ jsonString: string,
): SafeParseResult {
return safeParse(
jsonString,
- (x) => CustomStepResponseDtoControlValues$inboundSchema.parse(JSON.parse(x)),
- `Failed to parse 'CustomStepResponseDtoControlValues' from JSON`
+ (x) =>
+ CustomStepResponseDtoControlValues$inboundSchema.parse(JSON.parse(x)),
+ `Failed to parse 'CustomStepResponseDtoControlValues' from JSON`,
);
}
/** @internal */
-export const CustomStepResponseDto$inboundSchema: z.ZodType = z
- .object({
- controls: CustomControlsMetadataResponseDto$inboundSchema,
- controlValues: z.lazy(() => CustomStepResponseDtoControlValues$inboundSchema).optional(),
- variables: z.record(z.any()),
- stepId: z.string(),
- _id: z.string(),
- name: z.string(),
- slug: z.string(),
- type: z.literal('custom'),
- origin: ResourceOriginEnum$inboundSchema,
- workflowId: z.string(),
- workflowDatabaseId: z.string(),
- issues: StepIssuesDto$inboundSchema.optional(),
- stepResolverHash: z.string().optional(),
- })
- .transform((v) => {
- return remap$(v, {
- _id: 'id',
- });
+export const CustomStepResponseDto$inboundSchema: z.ZodType<
+ CustomStepResponseDto,
+ z.ZodTypeDef,
+ unknown
+> = z.object({
+ controls: CustomControlsMetadataResponseDto$inboundSchema,
+ controlValues: z.lazy(() => CustomStepResponseDtoControlValues$inboundSchema)
+ .optional(),
+ variables: z.record(z.any()),
+ stepId: z.string(),
+ _id: z.string(),
+ name: z.string(),
+ slug: z.string(),
+ type: z.literal("custom"),
+ origin: ResourceOriginEnum$inboundSchema,
+ workflowId: z.string(),
+ workflowDatabaseId: z.string(),
+ issues: StepIssuesDto$inboundSchema.optional(),
+ stepResolverHash: z.string().optional(),
+}).transform((v) => {
+ return remap$(v, {
+ "_id": "id",
});
+});
export function customStepResponseDtoFromJSON(
- jsonString: string
+ jsonString: string,
): SafeParseResult {
return safeParse(
jsonString,
(x) => CustomStepResponseDto$inboundSchema.parse(JSON.parse(x)),
- `Failed to parse 'CustomStepResponseDto' from JSON`
+ `Failed to parse 'CustomStepResponseDto' from JSON`,
);
}
diff --git a/libs/internal-sdk/src/models/components/delaycontroldto.ts b/libs/internal-sdk/src/models/components/delaycontroldto.ts
index bc441de5453..1383a6d9e85 100644
--- a/libs/internal-sdk/src/models/components/delaycontroldto.ts
+++ b/libs/internal-sdk/src/models/components/delaycontroldto.ts
@@ -2,18 +2,18 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as z from 'zod/v3';
-import { safeParse } from '../../lib/schemas.js';
-import { ClosedEnum } from '../../types/enums.js';
-import { Result as SafeParseResult } from '../../types/fp.js';
-import { SDKValidationError } from '../errors/sdkvalidationerror.js';
+import * as z from "zod/v3";
+import { safeParse } from "../../lib/schemas.js";
+import { ClosedEnum } from "../../types/enums.js";
+import { Result as SafeParseResult } from "../../types/fp.js";
+import { SDKValidationError } from "../errors/sdkvalidationerror.js";
/**
* Type of the delay. Currently only 'regular' is supported by the schema.
*/
export const Type = {
- Regular: 'regular',
- Timed: 'timed',
+ Regular: "regular",
+ Timed: "timed",
} as const;
/**
* Type of the delay. Currently only 'regular' is supported by the schema.
@@ -24,12 +24,12 @@ export type Type = ClosedEnum;
* Unit of time for the delay amount.
*/
export const Unit = {
- Seconds: 'seconds',
- Minutes: 'minutes',
- Hours: 'hours',
- Days: 'days',
- Weeks: 'weeks',
- Months: 'months',
+ Seconds: "seconds",
+ Minutes: "minutes",
+ Hours: "hours",
+ Days: "days",
+ Weeks: "weeks",
+ Months: "months",
} as const;
/**
* Unit of time for the delay amount.
@@ -60,19 +60,29 @@ export type DelayControlDto = {
};
/** @internal */
-export const Type$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Type);
+export const Type$inboundSchema: z.ZodNativeEnum = z.nativeEnum(
+ Type,
+);
/** @internal */
-export const Type$outboundSchema: z.ZodNativeEnum = Type$inboundSchema;
+export const Type$outboundSchema: z.ZodNativeEnum =
+ Type$inboundSchema;
/** @internal */
-export const Unit$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Unit);
+export const Unit$inboundSchema: z.ZodNativeEnum = z.nativeEnum(
+ Unit,
+);
/** @internal */
-export const Unit$outboundSchema: z.ZodNativeEnum = Unit$inboundSchema;
+export const Unit$outboundSchema: z.ZodNativeEnum =
+ Unit$inboundSchema;
/** @internal */
-export const DelayControlDto$inboundSchema: z.ZodType = z.object({
+export const DelayControlDto$inboundSchema: z.ZodType<
+ DelayControlDto,
+ z.ZodTypeDef,
+ unknown
+> = z.object({
skip: z.record(z.any()).optional(),
- type: Type$inboundSchema.default('regular'),
+ type: Type$inboundSchema.default("regular"),
amount: z.number().optional(),
unit: Unit$inboundSchema.optional(),
cron: z.string().optional(),
@@ -87,22 +97,29 @@ export type DelayControlDto$Outbound = {
};
/** @internal */
-export const DelayControlDto$outboundSchema: z.ZodType =
- z.object({
- skip: z.record(z.any()).optional(),
- type: Type$outboundSchema.default('regular'),
- amount: z.number().optional(),
- unit: Unit$outboundSchema.optional(),
- cron: z.string().optional(),
- });
+export const DelayControlDto$outboundSchema: z.ZodType<
+ DelayControlDto$Outbound,
+ z.ZodTypeDef,
+ DelayControlDto
+> = z.object({
+ skip: z.record(z.any()).optional(),
+ type: Type$outboundSchema.default("regular"),
+ amount: z.number().optional(),
+ unit: Unit$outboundSchema.optional(),
+ cron: z.string().optional(),
+});
-export function delayControlDtoToJSON(delayControlDto: DelayControlDto): string {
+export function delayControlDtoToJSON(
+ delayControlDto: DelayControlDto,
+): string {
return JSON.stringify(DelayControlDto$outboundSchema.parse(delayControlDto));
}
-export function delayControlDtoFromJSON(jsonString: string): SafeParseResult {
+export function delayControlDtoFromJSON(
+ jsonString: string,
+): SafeParseResult {
return safeParse(
jsonString,
(x) => DelayControlDto$inboundSchema.parse(JSON.parse(x)),
- `Failed to parse 'DelayControlDto' from JSON`
+ `Failed to parse 'DelayControlDto' from JSON`,
);
}
diff --git a/libs/internal-sdk/src/models/components/delayregularmetadata.ts b/libs/internal-sdk/src/models/components/delayregularmetadata.ts
index f2bea48f05d..ec728d1ef7e 100644
--- a/libs/internal-sdk/src/models/components/delayregularmetadata.ts
+++ b/libs/internal-sdk/src/models/components/delayregularmetadata.ts
@@ -2,26 +2,30 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as z from 'zod/v3';
-import { safeParse } from '../../lib/schemas.js';
-import { ClosedEnum } from '../../types/enums.js';
-import { Result as SafeParseResult } from '../../types/fp.js';
-import { SDKValidationError } from '../errors/sdkvalidationerror.js';
+import * as z from "zod/v3";
+import { safeParse } from "../../lib/schemas.js";
+import { ClosedEnum } from "../../types/enums.js";
+import { Result as SafeParseResult } from "../../types/fp.js";
+import { SDKValidationError } from "../errors/sdkvalidationerror.js";
export const DelayRegularMetadataUnit = {
- Seconds: 'seconds',
- Minutes: 'minutes',
- Hours: 'hours',
- Days: 'days',
- Weeks: 'weeks',
- Months: 'months',
+ Seconds: "seconds",
+ Minutes: "minutes",
+ Hours: "hours",
+ Days: "days",
+ Weeks: "weeks",
+ Months: "months",
} as const;
-export type DelayRegularMetadataUnit = ClosedEnum;
+export type DelayRegularMetadataUnit = ClosedEnum<
+ typeof DelayRegularMetadataUnit
+>;
export const DelayRegularMetadataType = {
- Regular: 'regular',
+ Regular: "regular",
} as const;
-export type DelayRegularMetadataType = ClosedEnum;
+export type DelayRegularMetadataType = ClosedEnum<
+ typeof DelayRegularMetadataType
+>;
export type DelayRegularMetadata = {
amount?: number | undefined;
@@ -30,26 +34,32 @@ export type DelayRegularMetadata = {
};
/** @internal */
-export const DelayRegularMetadataUnit$inboundSchema: z.ZodNativeEnum =
- z.nativeEnum(DelayRegularMetadataUnit);
+export const DelayRegularMetadataUnit$inboundSchema: z.ZodNativeEnum<
+ typeof DelayRegularMetadataUnit
+> = z.nativeEnum(DelayRegularMetadataUnit);
/** @internal */
-export const DelayRegularMetadataType$inboundSchema: z.ZodNativeEnum =
- z.nativeEnum(DelayRegularMetadataType);
+export const DelayRegularMetadataType$inboundSchema: z.ZodNativeEnum<
+ typeof DelayRegularMetadataType
+> = z.nativeEnum(DelayRegularMetadataType);
/** @internal */
-export const DelayRegularMetadata$inboundSchema: z.ZodType = z.object({
+export const DelayRegularMetadata$inboundSchema: z.ZodType<
+ DelayRegularMetadata,
+ z.ZodTypeDef,
+ unknown
+> = z.object({
amount: z.number().optional(),
unit: DelayRegularMetadataUnit$inboundSchema.optional(),
type: DelayRegularMetadataType$inboundSchema,
});
export function delayRegularMetadataFromJSON(
- jsonString: string
+ jsonString: string,
): SafeParseResult {
return safeParse(
jsonString,
(x) => DelayRegularMetadata$inboundSchema.parse(JSON.parse(x)),
- `Failed to parse 'DelayRegularMetadata' from JSON`
+ `Failed to parse 'DelayRegularMetadata' from JSON`,
);
}
diff --git a/libs/internal-sdk/src/models/components/delaystepresponsedto.ts b/libs/internal-sdk/src/models/components/delaystepresponsedto.ts
index 8ae3d2e7aa6..404a19a9ada 100644
--- a/libs/internal-sdk/src/models/components/delaystepresponsedto.ts
+++ b/libs/internal-sdk/src/models/components/delaystepresponsedto.ts
@@ -2,46 +2,56 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
-import * as z from 'zod/v3';
-import { remap as remap$ } from '../../lib/primitives.js';
-import { collectExtraKeys as collectExtraKeys$, safeParse } from '../../lib/schemas.js';
-import { ClosedEnum } from '../../types/enums.js';
-import { Result as SafeParseResult } from '../../types/fp.js';
-import { SDKValidationError } from '../errors/sdkvalidationerror.js';
+import * as z from "zod/v3";
+import { remap as remap$ } from "../../lib/primitives.js";
+import {
+ collectExtraKeys as collectExtraKeys$,
+ safeParse,
+} from "../../lib/schemas.js";
+import { ClosedEnum } from "../../types/enums.js";
+import { Result as SafeParseResult } from "../../types/fp.js";
+import { SDKValidationError } from "../errors/sdkvalidationerror.js";
import {
DelayControlsMetadataResponseDto,
DelayControlsMetadataResponseDto$inboundSchema,
-} from './delaycontrolsmetadataresponsedto.js';
-import { ResourceOriginEnum, ResourceOriginEnum$inboundSchema } from './resourceoriginenum.js';
-import { StepIssuesDto, StepIssuesDto$inboundSchema } from './stepissuesdto.js';
+} from "./delaycontrolsmetadataresponsedto.js";
+import {
+ ResourceOriginEnum,
+ ResourceOriginEnum$inboundSchema,
+} from "./resourceoriginenum.js";
+import { StepIssuesDto, StepIssuesDto$inboundSchema } from "./stepissuesdto.js";
/**
* Type of the delay. Currently only 'regular' is supported by the schema.
*/
export const DelayStepResponseDtoType = {
- Regular: 'regular',
- Timed: 'timed',
+ Regular: "regular",
+ Timed: "timed",
} as const;
/**
* Type of the delay. Currently only 'regular' is supported by the schema.
*/
-export type DelayStepResponseDtoType = ClosedEnum;
+export type DelayStepResponseDtoType = ClosedEnum<
+ typeof DelayStepResponseDtoType
+>;
/**
* Unit of time for the delay amount.
*/
export const DelayStepResponseDtoUnit = {
- Seconds: 'seconds',
- Minutes: 'minutes',
- Hours: 'hours',
- Days: 'days',
- Weeks: 'weeks',
- Months: 'months',
+ Seconds: "seconds",
+ Minutes: "minutes",
+ Hours: "hours",
+ Days: "days",
+ Weeks: "weeks",
+ Months: "months",
} as const;
/**
* Unit of time for the delay amount.
*/
-export type DelayStepResponseDtoUnit = ClosedEnum;
+export type DelayStepResponseDtoUnit = ClosedEnum<
+ typeof DelayStepResponseDtoUnit
+>;
/**
* Control values for the delay step
@@ -102,7 +112,7 @@ export type DelayStepResponseDto = {
/**
* Type of the step
*/
- type: 'delay';
+ type: "delay";
/**
* Origin of the layout
*/
@@ -126,12 +136,14 @@ export type DelayStepResponseDto = {
};
/** @internal */
-export const DelayStepResponseDtoType$inboundSchema: z.ZodNativeEnum =
- z.nativeEnum(DelayStepResponseDtoType);
+export const DelayStepResponseDtoType$inboundSchema: z.ZodNativeEnum<
+ typeof DelayStepResponseDtoType
+> = z.nativeEnum(DelayStepResponseDtoType);
/** @internal */
-export const DelayStepResponseDtoUnit$inboundSchema: z.ZodNativeEnum =
- z.nativeEnum(DelayStepResponseDtoUnit);
+export const DelayStepResponseDtoUnit$inboundSchema: z.ZodNativeEnum<
+ typeof DelayStepResponseDtoUnit
+> = z.nativeEnum(DelayStepResponseDtoUnit);
/** @internal */
export const DelayStepResponseDtoControlValues$inboundSchema: z.ZodType<
@@ -139,58 +151,59 @@ export const DelayStepResponseDtoControlValues$inboundSchema: z.ZodType<
z.ZodTypeDef,
unknown
> = collectExtraKeys$(
- z
- .object({
- skip: z.record(z.any()).optional(),
- type: DelayStepResponseDtoType$inboundSchema.default('regular'),
- amount: z.number().optional(),
- unit: DelayStepResponseDtoUnit$inboundSchema.optional(),
- cron: z.string().optional(),
- })
- .catchall(z.any()),
- 'additionalProperties',
- true
+ z.object({
+ skip: z.record(z.any()).optional(),
+ type: DelayStepResponseDtoType$inboundSchema.default("regular"),
+ amount: z.number().optional(),
+ unit: DelayStepResponseDtoUnit$inboundSchema.optional(),
+ cron: z.string().optional(),
+ }).catchall(z.any()),
+ "additionalProperties",
+ true,
);
export function delayStepResponseDtoControlValuesFromJSON(
- jsonString: string
+ jsonString: string,
): SafeParseResult