Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ export default defineConfig({
},
})
},
experimentalMemoryManagement: true,
},
})
38 changes: 31 additions & 7 deletions cypress/e2e/broken-links.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ const IGNORED_URLS = [
'https://portal.azure.com',
]

const rootBaseUrl = Cypress.config('baseUrl')

const isInternalUrl = (url: string) => {
// check against the base url
// and check if the url does not contain a file extension
return url.startsWith(rootBaseUrl) && !url.includes('.')
}

const isExternalUrl = (url: string) => {
return !url.includes('localhost')
}
Expand Down Expand Up @@ -67,14 +75,11 @@ describe('Broken links test suite', () => {

links
.filter((_i, link) => {
const href = link.getAttribute('href')
const src = link.getAttribute('src')

return !IGNORED_URLS.some(
(l) =>
//@ts-ignore
(link.getAttribute('href') &&
link.getAttribute('href')?.includes(l)) ||
//@ts-ignore
(link.getAttribute('src') &&
link.getAttribute('src').includes(l)),
(l) => href?.includes(l) || src?.includes(l),
)
})
.each((link) => {
Expand All @@ -87,6 +92,25 @@ describe('Broken links test suite', () => {
cy.log(`link already checked`)
expect(VISITED_SUCCESSFUL_LINKS[url]).to.be.true
} else {
// if the link is internal then check the link against the pages fixture (sitemap)
if (isInternalUrl(url)) {
// clean the url by removing the base url and query params
const rootBaseUrlRegex = new RegExp(`^${rootBaseUrl}`)
let cleanUrl = url.replace(rootBaseUrlRegex, '')
const queryIndex = cleanUrl.indexOf('?')
cleanUrl =
queryIndex !== -1 ? cleanUrl.slice(0, queryIndex) : cleanUrl

cy.log(`checking internal link: ${cleanUrl}`)
if (!pages.includes(cleanUrl)) {
assert.fail(`${cleanUrl} is not part of the pages fixture`)
} else {
VISITED_SUCCESSFUL_LINKS[url] = true
}

return
}

cy.wait(25)

req(url).then((res: Cypress.Response<any>) => {
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/api/api-all.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Register a single handler fo

# Dart - api.all()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about APIs
in Nitric start with the [API docs](/apis).
</Note>

Register a single handler for all HTTP Methods (GET, POST, PUT, DELETE, PATCH) on a route.

<Note>
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/api/api-delete.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Register an API route and se

# Dart - api.delete()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about APIs
in Nitric start with the [API docs](/apis).
</Note>

Register an API route and set a specific HTTP DELETE handler on that route.

<Note>
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/api/api-get.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Register an API route and se

# Dart - api.get()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about APIs
in Nitric start with the [API docs](/apis).
</Note>

Register an API route and set a specific HTTP GET handler on that route.

<Note>
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/api/api-patch.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Register an API route and se

# Dart - api.patch()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about APIs
in Nitric start with the [API docs](/apis).
</Note>

Register an API route and set a specific HTTP PATCH handler on that route.

<Note>
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/api/api-post.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Register an API route and se

# Dart - api.post()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about APIs
in Nitric start with the [API docs](/apis).
</Note>

Register an API route and set a specific HTTP POST handler on that route.

<Note>
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/api/api-put.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Register an API route and se

# Dart - api.put()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about APIs
in Nitric start with the [API docs](/apis).
</Note>

Register an API route and set a specific HTTP PUT handler on that route.

<Note>
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/api/api-route-all.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Register a single handler fo

# Dart - api.route.all()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about APIs
in Nitric start with the [API docs](/apis).
</Note>

Register a single handler for all HTTP Methods (GET, POST, PUT, DELETE, PATCH) on the route.

```dart
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/api/api-route-delete.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Register a handler for HTTP

# Dart - api.route.delete()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about APIs
in Nitric start with the [API docs](/apis).
</Note>

Register a handler for HTTP DELETE requests to the route.

```dart
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/api/api-route-get.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Register a handler for HTTP

# Dart - api.route.get()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about APIs
in Nitric start with the [API docs](/apis).
</Note>

Register a handler for HTTP GET requests to the route.

```dart
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/api/api-route-patch.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Register a handler for HTTP

# Dart - api.route.patch()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about APIs
in Nitric start with the [API docs](/apis).
</Note>

Register a handler for HTTP PATCH requests to the route.

```dart
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/api/api-route-post.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Register a handler for HTTP

# Dart - api.route.post()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about APIs
in Nitric start with the [API docs](/apis).
</Note>

Register a handler for HTTP POST requests to the route.

```dart
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/api/api-route-put.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Register a handler for HTTP

# Dart - api.route.put()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about APIs
in Nitric start with the [API docs](/apis).
</Note>

Register a handler for HTTP PUT requests to the route.

```dart
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/api/api-route.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Creates a new route (path) w

# Dart - api.route()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about APIs
in Nitric start with the [API docs](/apis).
</Note>

Creates a new route (path) within an API.

```dart
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/api/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Create APIs with the Nitric

# Dart - api()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about APIs
in Nitric start with the [API docs](/apis).
</Note>

Creates a new HTTP API.

```dart
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/batch/job-handler.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Register a job handler to wi

# Dart - job.handler()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about Batch
Services in Nitric start with the [Batch docs](/batch).
</Note>

Job handlers are the code that is run when a job request is submitted. These handlers should be written in a separate file to your services.

```dart
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/batch/job-submit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Submit a batch job request w

# Dart - job.submit()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about Batch
Services in Nitric start with the [Batch docs](/batch).
</Note>

Jobs may be submitted from Nitric `services` or other `batches` using the `submit` method on the job reference. When submitting a job you can provide a payload that will be passed to the job handler function.

```dart
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/batch/job.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Create Batch Jobs with the N

# Dart - job()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about Batch
Services in Nitric start with the [Batch docs](/batch).
</Note>

Creates a new Batch Job.

```dart
Expand Down
6 changes: 6 additions & 0 deletions docs/reference/dart/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ This SDK reference provides documentation for the services and methods in Nitric

The library provides the ability to define and interact with cloud resources, as well as build application services.

<Note>
This is reference documentation for the Nitric Dart SDK. If you're just
learning Nitric, we recommend starting with the
[Quickstart](/get-started/quickstart) guide.
</Note>

## Installation

If you used a Nitric starter template for Dart to scaffold your project, then `nitric_sdk` will already be included in the dependencies in your `pubspec.yaml` file. Using starter templates is the recommended installation option since it ensures the other files and configuration needed are also set up.
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/keyvalue/keyvalue-delete.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Delete key from a key value

# Dart - kv.delete()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about
Key/Value Stores in Nitric start with the [Key/Value Store docs](/keyvalue).
</Note>

Delete key from a key value store.

```dart
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/keyvalue/keyvalue-get.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Get a value from a key value

# Dart - kv.get()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about
Key/Value Stores in Nitric start with the [Key/Value Store docs](/keyvalue).
</Note>

Get a value from a key value store.

```dart
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/keyvalue/keyvalue-keys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Retrieve all or some of the

# Dart - kv.keys()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about
Key/Value Stores in Nitric start with the [Key/Value Store docs](/keyvalue).
</Note>

Return an async iterable of keys in the store.

```dart
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/keyvalue/keyvalue-set.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Store a key value pair in a

# Dart - kv.set()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about
Key/Value Stores in Nitric start with the [Key/Value Store docs](/keyvalue).
</Note>

Store a key value pair in a key value store.

```dart
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/keyvalue/keyvalue.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Creates a new key value stor

# Dart - kv()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about
Key/Value Stores in Nitric start with the [Key/Value Store docs](/keyvalue).
</Note>

Creates a new key value store to get, set, and delete key value pairs.

```dart
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/queues/queue-dequeue.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Dequeue messages."

# Dart - queue.dequeue()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about Queues
in Nitric start with the [Async Messaging docs](/messaging#queues).
</Note>

Dequeue messages.

```dart
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/queues/queue-enqueue.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Send messages to a queue."

# Dart - queue.enqueue()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about Queues
in Nitric start with the [Async Messaging docs](/messaging#queues).
</Note>

Send messages to a queue.

```dart
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/queues/queue.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Creates a new Queue to proce

# Dart - queue()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about Queues
in Nitric start with the [Async Messaging docs](/messaging#queues).
</Note>

Creates a new Queue to process asynchronous messages.

```dart
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/dart/schedule/schedule-cron.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description: "Reference for Nitric's Dart library - Sets the cron expression and

# Dart - schedule.cron()

<Note>
This is reference documentation for the Nitric Dart SDK. To learn about
Schedules in Nitric start with the [Schedule docs](/schedules).
</Note>

Sets the cron expressions that determines when the schedule triggers and a callback to be triggered.

```dart
Expand Down
Loading
Loading