diff --git a/spec/SOURCE.md b/spec/SOURCE.md index 8ea86fe..07d7c2e 100644 --- a/spec/SOURCE.md +++ b/spec/SOURCE.md @@ -7,13 +7,13 @@ it via `pnpm generate`. Do not hand-edit either file. | Field | Value | | ----------- | ------------------------------------ | | Source repo | https://github.com/lunogram/platform | -| Pinned tag | `v0.1.0-rc.1` | +| Pinned tag | `v0.1.0-rc.2` | | Spec asset | `client.yaml` | Release asset URL to re-fetch the spec: ``` -https://github.com/lunogram/platform/releases/download/v0.1.0-rc.1/client.yaml +https://github.com/lunogram/platform/releases/download/v0.1.0-rc.2/client.yaml ``` ## About the pin diff --git a/spec/client.yaml b/spec/client.yaml index 5bdf2ca..30dcd5d 100644 --- a/spec/client.yaml +++ b/spec/client.yaml @@ -1646,6 +1646,12 @@ components: required: - name properties: + id: + type: string + format: uuid + nullable: true + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + description: The id of the schedule assignment. Omit to create a new assignment (multiple assignments may share the same name per user); supply an existing id to update that assignment in place. The id is returned in the response. name: type: string example: "renewal_date" @@ -1685,6 +1691,12 @@ components: - name - identifier properties: + id: + type: string + format: uuid + nullable: true + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + description: The id of the schedule assignment. Omit to create a new assignment (multiple assignments may share the same name per organization); supply an existing id to update that assignment in place. The id is returned in the response. name: type: string example: "contract_renewal" @@ -1721,12 +1733,19 @@ components: DeleteUserScheduledRequest: type: object required: - - name + - identifier properties: + id: + type: string + format: uuid + nullable: true + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + description: The id of a specific schedule assignment to delete. When provided, only that instance is removed. Either id or name is required. name: type: string + nullable: true example: "renewal_date" - description: The name of the scheduled resource to delete + description: The name of the scheduled resource to delete. When provided (and id is omitted), every assignment with this name for the user is removed. Either id or name is required. identifier: $ref: "#/components/schemas/UserIdentifier" @@ -1761,13 +1780,19 @@ components: DeleteOrganizationScheduledRequest: type: object required: - - name - identifier properties: + id: + type: string + format: uuid + nullable: true + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + description: The id of a specific schedule assignment to delete. When provided, only that instance is removed. Either id or name is required. name: type: string + nullable: true example: "contract_renewal" - description: The name of the scheduled resource to delete + description: The name of the scheduled resource to delete. When provided (and id is omitted), every assignment with this name for the organization is removed. Either id or name is required. identifier: $ref: "#/components/schemas/OrganizationIdentifier" diff --git a/src/gen/schema.ts b/src/gen/schema.ts index 8dc39b9..18c241b 100644 --- a/src/gen/schema.ts +++ b/src/gen/schema.ts @@ -982,6 +982,12 @@ export interface components { } | null; }; UpsertUserScheduledRequest: { + /** + * Format: uuid + * @description The id of the schedule assignment. Omit to create a new assignment (multiple assignments may share the same name per user); supply an existing id to update that assignment in place. The id is returned in the response. + * @example a1b2c3d4-e5f6-7890-abcd-ef1234567890 + */ + id?: string | null; /** * @description The name of the scheduled resource * @example renewal_date @@ -1017,6 +1023,12 @@ export interface components { } | null; }; UpsertOrganizationScheduledRequest: { + /** + * Format: uuid + * @description The id of the schedule assignment. Omit to create a new assignment (multiple assignments may share the same name per organization); supply an existing id to update that assignment in place. The id is returned in the response. + * @example a1b2c3d4-e5f6-7890-abcd-ef1234567890 + */ + id?: string | null; /** * @description The name of the scheduled resource * @example contract_renewal @@ -1053,11 +1065,17 @@ export interface components { }; DeleteUserScheduledRequest: { /** - * @description The name of the scheduled resource to delete + * Format: uuid + * @description The id of a specific schedule assignment to delete. When provided, only that instance is removed. Either id or name is required. + * @example a1b2c3d4-e5f6-7890-abcd-ef1234567890 + */ + id?: string | null; + /** + * @description The name of the scheduled resource to delete. When provided (and id is omitted), every assignment with this name for the user is removed. Either id or name is required. * @example renewal_date */ - name: string; - identifier?: components["schemas"]["UserIdentifier"]; + name?: string | null; + identifier: components["schemas"]["UserIdentifier"]; }; ScheduledAccepted: { /** @@ -1084,10 +1102,16 @@ export interface components { }; DeleteOrganizationScheduledRequest: { /** - * @description The name of the scheduled resource to delete + * Format: uuid + * @description The id of a specific schedule assignment to delete. When provided, only that instance is removed. Either id or name is required. + * @example a1b2c3d4-e5f6-7890-abcd-ef1234567890 + */ + id?: string | null; + /** + * @description The name of the scheduled resource to delete. When provided (and id is omitted), every assignment with this name for the organization is removed. Either id or name is required. * @example contract_renewal */ - name: string; + name?: string | null; identifier: components["schemas"]["OrganizationIdentifier"]; }; }; diff --git a/src/types/scheduled.ts b/src/types/scheduled.ts index 3c02990..205aef7 100644 --- a/src/types/scheduled.ts +++ b/src/types/scheduled.ts @@ -3,6 +3,10 @@ import { UserIdentifier, OrganizationIdentifier } from './request' /** Request to create or update a scheduled resource for a user */ export interface UpsertUserScheduledRequest { + /** Id of an existing assignment to update in place. Omit to create a new + * assignment; the same name may be scheduled multiple times. Returned in the + * response. */ + id?: string name: string identifier?: UserIdentifier scheduledAt?: string | null @@ -11,10 +15,12 @@ export interface UpsertUserScheduledRequest { data?: Record | null } -/** Request to delete a user scheduled resource */ +/** Request to delete a user scheduled resource. Provide `id` to delete a single + * assignment, or `name` to delete every assignment with that name. */ export interface DeleteUserScheduledRequest { - name: string - identifier?: UserIdentifier + id?: string + name?: string + identifier: UserIdentifier } /** Response when a scheduled resource is accepted */ @@ -27,6 +33,10 @@ export interface ScheduledAcceptedResponse { /** Request to create or update a scheduled resource for an organization */ export interface UpsertOrganizationScheduledRequest { + /** Id of an existing assignment to update in place. Omit to create a new + * assignment; the same name may be scheduled multiple times. Returned in the + * response. */ + id?: string name: string identifier: OrganizationIdentifier scheduledAt?: string | null @@ -35,8 +45,10 @@ export interface UpsertOrganizationScheduledRequest { data?: Record | null } -/** Request to delete an organization scheduled resource */ +/** Request to delete an organization scheduled resource. Provide `id` to delete a + * single assignment, or `name` to delete every assignment with that name. */ export interface DeleteOrganizationScheduledRequest { - name: string + id?: string + name?: string identifier: OrganizationIdentifier }