Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
876 changes: 438 additions & 438 deletions www/apps/resources/generated/edit-dates.mjs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"

This documentation provides a reference to the ApiKey data model. It belongs to the API Key Module.

<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/modules/api-key/src/models/api-key.ts#L3" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/da5d0e3a1430979ab9cda7f239ea7066ded1f7ab/packages/modules/api-key/src/models/api-key.ts#L3" />

<TypeList types={[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"token","type":"`TextProperty`","description":"The token of the API key","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"salt","type":"`TextProperty`","description":"Salt used to create the API key token.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"redacted","type":"`TextProperty`","description":"The redacted form of the api key's token. this is useful when showing portion of the token.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`TextProperty`","description":"The title of the API key","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"EnumProperty&#60;[\"publishable\", \"secret\"]&#62;","description":"The type of the API key. Can be `secret` or `publishable`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`TextProperty`","description":"The ID of the user that created the API key","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_used_at","type":"`DateTimeProperty`","description":"The date the API key was last used.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"revoked_by","type":"`TextProperty`","description":"The ID of the user that revoked the API key","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"revoked_at","type":"`DateTimeProperty`","description":"The date the API key was revoked.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="ApiKey"/>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"

This documentation provides a reference to the AuthIdentity data model. It belongs to the Auth Module.

<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/modules/auth/src/models/auth-identity.ts#L4" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/da5d0e3a1430979ab9cda7f239ea7066ded1f7ab/packages/modules/auth/src/models/auth-identity.ts#L4" />

<TypeList types={[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the auth identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_identities","type":"HasMany&#60;[ProviderIdentity](../auth_models.ProviderIdentity/page.mdx)&#62;","description":"The associated `ProviderIdentity` records.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the provider identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"entity_id","type":"`TextProperty`","description":"The entity ID of the provider identity","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider","type":"`TextProperty`","description":"The ID of the provider that created this identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"auth_identity","type":"BelongsTo&#60;[AuthIdentity](./page.mdx)&#62;","description":"The associated `AuthIdentity`.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the auth identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_identities","type":"HasMany&#60;[ProviderIdentity](../auth_models.ProviderIdentity/page.mdx)&#62;","description":"The associated `ProviderIdentity` records.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"app_metadata","type":"`JSONProperty`","description":"The app metadata of the auth identity","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"user_metadata","type":"`JSONProperty`","description":"The user metadata of the provider identity.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`JSONProperty`","description":"The provider metadata of the provider identity.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"app_metadata","type":"`JSONProperty`","description":"The app metadata of the auth identity","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="AuthIdentity"/>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"

This documentation provides a reference to the ProviderIdentity data model. It belongs to the Auth Module.

<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/modules/auth/src/models/provider-identity.ts#L4" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/da5d0e3a1430979ab9cda7f239ea7066ded1f7ab/packages/modules/auth/src/models/provider-identity.ts#L4" />

<TypeList types={[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the provider identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"entity_id","type":"`TextProperty`","description":"The entity ID of the provider identity","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider","type":"`TextProperty`","description":"The ID of the provider that created this identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"auth_identity","type":"BelongsTo&#60;[AuthIdentity](../auth_models.AuthIdentity/page.mdx)&#62;","description":"The associated `AuthIdentity`.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the auth identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_identities","type":"HasMany&#60;[ProviderIdentity](./page.mdx)&#62;","description":"The associated `ProviderIdentity` records.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the provider identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"entity_id","type":"`TextProperty`","description":"The entity ID of the provider identity","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider","type":"`TextProperty`","description":"The ID of the provider that created this identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"auth_identity","type":"BelongsTo&#60;[AuthIdentity](../auth_models.AuthIdentity/page.mdx)&#62;","description":"The associated `AuthIdentity`.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"user_metadata","type":"`JSONProperty`","description":"The user metadata of the provider identity.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`JSONProperty`","description":"The provider metadata of the provider identity.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"app_metadata","type":"`JSONProperty`","description":"The app metadata of the auth identity","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"user_metadata","type":"`JSONProperty`","description":"The user metadata of the provider identity.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`JSONProperty`","description":"The provider metadata of the provider identity.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="ProviderIdentity"/>
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ class MyAuthProviderService extends AbstractAuthModuleProvider {
// authentication is successful, retrieve the identity
const authIdentity = await authIdentityProviderService.retrieve({
entity_id: data.body.email, // email or some ID
provider: this.provider
})

return {
Expand Down Expand Up @@ -215,6 +214,16 @@ class MyAuthProviderService extends AbstractAuthModuleProvider {
}
}

// optional, useful for third-party providers that require a redirect URL
// to continue the authentication flow
// const stateKey = crypto.randomBytes(32).toString("hex")
// const state = {
// callback_url: body?.callback_url ?? this.config_.callbackUrl,
// }

// verify this later in the `validateCallback` method
// await authIdentityService.setState(stateKey, state)

return {
success: true,
location: "some-url.com"
Expand Down Expand Up @@ -385,6 +394,16 @@ class MyAuthProviderService extends AbstractAuthModuleProvider {
authIdentityProviderService: AuthIdentityProviderService
): Promise<AuthenticationResponse> {
const isAuthenticated = false

// optional, useful for third-party providers that require a redirect URL
// to continue the authentication flow
// const stateKey = data.query?.state as string
// const state = await authIdentityService.getState(stateKey)
// if (!state) {
// return { success: false, error: "No state provided, or session expired" }
// }
// // use callback URL with the third-party service
// const callbackUrl = state.callback_url
// TODO perform custom logic to authenticate the user
// ...

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Items that were set with `options.autoInvalidate: false` are only cleared when y
To invalidate cache by key:

```ts
await cacheModuleService.clear({
await cachingModuleService.clear({
key: "products" // this key would typically be a hash
})
```
Expand All @@ -76,7 +76,7 @@ This example will clear the item with the key `products` regardless of its `opti
To invalidate cache by tags:

```ts
await cacheModuleService.clear({
await cachingModuleService.clear({
tags: ["Product:list:*"]
})
```
Expand All @@ -86,7 +86,7 @@ This example will clear all items with the tag `Product:list:*` regardless of th
To invalidate only the cache data that were set to automatically invalidate:

```ts
await cacheModuleService.clear({
await cachingModuleService.clear({
tags: ["Product:list:*"],
options: { autoInvalidate: true }
})
Expand All @@ -105,7 +105,7 @@ To clear items that were set with `options.autoInvalidate: false`, you must call
To invalidate cache from specific providers:

```ts
await cacheModuleService.clear({
await cachingModuleService.clear({
key: "products",
providers: ["caching-redis", "caching-memcached"]
})
Expand All @@ -130,7 +130,7 @@ This method computes a cache key based on the input object. It's useful to gener
### Example

```ts
const key = await cacheModuleService.computeKey({
const key = await cachingModuleService.computeKey({
id: "prod_123",
title: "Product 123"
})
Expand All @@ -154,7 +154,7 @@ This method computes cache tags based on the input object. It's useful to genera
### Example

```ts
const tags = await cacheModuleService.computeTags({
const tags = await cachingModuleService.computeTags({
products: [{ id: "prod_123" }, { id: "prod_456" }],
}, {
operation: "updated"
Expand All @@ -181,23 +181,23 @@ This method retrieves data from the cache. If neither `key` nor `tags` are provi
To retrieve by key:

```ts
const data = await cacheModuleService.get({
const data = await cachingModuleService.get({
key: "products", // this key would typically be a hash
}) as { id: string; title: string; }
```

To retrieve by tags:

```ts
const data = await cacheModuleService.get({
const data = await cachingModuleService.get({
tags: ["Product:list:*"],
}) as { id: string; title: string; }[]
```

To retrieve by key from specific providers:

```ts
const data = await cacheModuleService.get({
const data = await cachingModuleService.get({
key: "products", // this key would typically be a hash
providers: ["caching-redis", "caching-memcached"]
}) as { id: string; title: string; }
Expand Down Expand Up @@ -226,8 +226,8 @@ To store with key:

```ts
const data = { id: "prod_123", title: "Product 123" }
const key = await cacheModuleService.computeKey(data)
await cacheModuleService.set({
const key = await cachingModuleService.computeKey(data)
await cachingModuleService.set({
key,
data
})
Expand All @@ -243,8 +243,8 @@ Tags should follow [conventions](https://docs.medusajs.com/infrastructure-module

```ts
const data = [{ id: "prod_123", title: "Product 123" }]
const key = await cacheModuleService.computeKey(data)
await cacheModuleService.set({
const key = await cachingModuleService.computeKey(data)
await cachingModuleService.set({
key,
data,
tags: [`Product:${data[0].id}`, "Product:list:*"]
Expand All @@ -255,8 +255,8 @@ To disable auto-invalidation for the item:

```ts
const data = [{ id: "prod_123", title: "Product 123" }]
const key = await cacheModuleService.computeKey(data)
await cacheModuleService.set({
const key = await cachingModuleService.computeKey(data)
await cachingModuleService.set({
key,
data,
options: { autoInvalidate: false }
Expand All @@ -269,8 +269,8 @@ To store with specific providers:

```ts
const data = { id: "prod_123", title: "Product 123" }
const key = await cacheModuleService.computeKey(data)
await cacheModuleService.set({
const key = await cachingModuleService.computeKey(data)
await cachingModuleService.set({
key,
data,
providers: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"

This documentation provides a reference to the Address data model. It belongs to the Cart Module.

<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/modules/cart/src/models/address.ts#L3" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/da5d0e3a1430979ab9cda7f239ea7066ded1f7ab/packages/modules/cart/src/models/address.ts#L3" />

<TypeList types={[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`TextProperty`","description":"The ID of the customer that the address belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`TextProperty`","description":"The company of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`TextProperty`","description":"The first name of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`TextProperty`","description":"The last name of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`TextProperty`","description":"The first line of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`TextProperty`","description":"The second line of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`TextProperty`","description":"The city of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`TextProperty`","description":"The ISO 2 country code of the address. For example, `us`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`TextProperty`","description":"The province of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`TextProperty`","description":"The postal code of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`TextProperty`","description":"The phone of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`JSONProperty`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="Address"/>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading
Loading