-
Notifications
You must be signed in to change notification settings - Fork 1
Add P0 missing protocols: Notification, Document, Change Management, External Lookup #392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| --- | ||
| title: Connector | ||
| description: Connector protocol schemas | ||
| --- | ||
|
|
||
| # Connector | ||
|
|
||
| <Callout type="info"> | ||
| **Source:** `packages/spec/src/data/connector.zod.ts` | ||
| </Callout> | ||
|
|
||
| ## TypeScript Usage | ||
|
|
||
| ```typescript | ||
| import { FieldMappingSchema } from '@objectstack/spec/data'; | ||
| import type { FieldMapping } from '@objectstack/spec/data'; | ||
|
|
||
| // Validate data | ||
| const result = FieldMappingSchema.parse(data); | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## FieldMapping | ||
|
|
||
| ### Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **externalField** | `string` | ✅ | External field name | | ||
| | **localField** | `string` | ✅ | Local field name | | ||
| | **type** | `string` | ✅ | Field type | | ||
| | **readonly** | `boolean` | optional | Read-only field | | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| --- | ||
| title: Document | ||
| description: Document protocol schemas | ||
| --- | ||
|
|
||
| # Document | ||
|
|
||
| <Callout type="info"> | ||
| **Source:** `packages/spec/src/data/document.zod.ts` | ||
| </Callout> | ||
|
|
||
| ## TypeScript Usage | ||
|
|
||
| ```typescript | ||
| import { DocumentSchema, DocumentTemplateSchema, DocumentVersionSchema, ESignatureConfigSchema } from '@objectstack/spec/data'; | ||
| import type { Document, DocumentTemplate, DocumentVersion, ESignatureConfig } from '@objectstack/spec/data'; | ||
|
|
||
| // Validate data | ||
| const result = DocumentSchema.parse(data); | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Document | ||
|
|
||
| ### Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **id** | `string` | ✅ | Document ID | | ||
| | **name** | `string` | ✅ | Document name | | ||
| | **description** | `string` | optional | Document description | | ||
| | **fileType** | `string` | ✅ | File MIME type | | ||
| | **fileSize** | `number` | ✅ | File size in bytes | | ||
| | **category** | `string` | optional | Document category | | ||
| | **tags** | `string[]` | optional | Document tags | | ||
| | **versioning** | `object` | optional | Version control | | ||
| | **template** | `object` | optional | Document template | | ||
| | **eSignature** | `object` | optional | E-signature config | | ||
| | **access** | `object` | optional | Access control | | ||
| | **metadata** | `Record<string, any>` | optional | Custom metadata | | ||
|
|
||
| --- | ||
|
|
||
| ## DocumentTemplate | ||
|
|
||
| ### Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **id** | `string` | ✅ | Template ID | | ||
| | **name** | `string` | ✅ | Template name | | ||
| | **description** | `string` | optional | Template description | | ||
| | **fileUrl** | `string` | ✅ | Template file URL | | ||
| | **fileType** | `string` | ✅ | File MIME type | | ||
| | **placeholders** | `object[]` | ✅ | Template placeholders | | ||
|
|
||
| --- | ||
|
|
||
| ## DocumentVersion | ||
|
|
||
| ### Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **versionNumber** | `number` | ✅ | Version number | | ||
| | **createdAt** | `number` | ✅ | Creation timestamp | | ||
| | **createdBy** | `string` | ✅ | Creator user ID | | ||
| | **size** | `number` | ✅ | File size in bytes | | ||
| | **checksum** | `string` | ✅ | File checksum | | ||
| | **downloadUrl** | `string` | ✅ | Download URL | | ||
| | **isLatest** | `boolean` | optional | Is latest version | | ||
|
|
||
| --- | ||
|
|
||
| ## ESignatureConfig | ||
|
|
||
| ### Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **provider** | `Enum<'docusign' \| 'adobe-sign' \| 'hellosign' \| 'custom'>` | ✅ | E-signature provider | | ||
| | **enabled** | `boolean` | optional | E-signature enabled | | ||
| | **signers** | `object[]` | ✅ | Document signers | | ||
| | **expirationDays** | `number` | optional | Expiration days | | ||
| | **reminderDays** | `number` | optional | Reminder interval days | | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| --- | ||
| title: External Lookup | ||
| description: External Lookup protocol schemas | ||
| --- | ||
|
|
||
| # External Lookup | ||
|
|
||
| <Callout type="info"> | ||
| **Source:** `packages/spec/src/data/external-lookup.zod.ts` | ||
| </Callout> | ||
|
|
||
| ## TypeScript Usage | ||
|
|
||
| ```typescript | ||
| import { ExternalDataSourceSchema, ExternalLookupSchema } from '@objectstack/spec/data'; | ||
| import type { ExternalDataSource, ExternalLookup } from '@objectstack/spec/data'; | ||
|
|
||
| // Validate data | ||
| const result = ExternalDataSourceSchema.parse(data); | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## ExternalDataSource | ||
|
|
||
| ### Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **id** | `string` | ✅ | Data source ID | | ||
| | **name** | `string` | ✅ | Data source name | | ||
| | **type** | `Enum<'odata' \| 'rest-api' \| 'graphql' \| 'custom'>` | ✅ | Protocol type | | ||
| | **endpoint** | `string` | ✅ | API endpoint URL | | ||
| | **authentication** | `object` | ✅ | Authentication | | ||
|
|
||
| --- | ||
|
|
||
| ## ExternalLookup | ||
|
|
||
| ### Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **fieldName** | `string` | ✅ | Field name | | ||
| | **dataSource** | `object` | ✅ | External data source | | ||
| | **query** | `object` | ✅ | Query configuration | | ||
| | **fieldMappings** | `object[]` | ✅ | Field mappings | | ||
| | **caching** | `object` | optional | Caching configuration | | ||
| | **fallback** | `object` | optional | Fallback configuration | | ||
| | **rateLimit** | `object` | optional | Rate limiting | | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| --- | ||
| title: Change Management | ||
| description: Change Management protocol schemas | ||
| --- | ||
|
|
||
| # Change Management | ||
|
|
||
| <Callout type="info"> | ||
| **Source:** `packages/spec/src/system/change-management.zod.ts` | ||
| </Callout> | ||
|
|
||
| ## TypeScript Usage | ||
|
|
||
| ```typescript | ||
| import { ChangeImpactSchema, ChangePrioritySchema, ChangeRequestSchema, ChangeStatusSchema, ChangeTypeSchema, RollbackPlanSchema } from '@objectstack/spec/system'; | ||
| import type { ChangeImpact, ChangePriority, ChangeRequest, ChangeStatus, ChangeType, RollbackPlan } from '@objectstack/spec/system'; | ||
|
|
||
| // Validate data | ||
| const result = ChangeImpactSchema.parse(data); | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## ChangeImpact | ||
|
|
||
| ### Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **level** | `Enum<'low' \| 'medium' \| 'high' \| 'critical'>` | ✅ | Impact level | | ||
| | **affectedSystems** | `string[]` | ✅ | Affected systems | | ||
| | **affectedUsers** | `number` | optional | Affected user count | | ||
| | **downtime** | `object` | optional | Downtime information | | ||
|
|
||
| --- | ||
|
|
||
| ## ChangePriority | ||
|
|
||
| ### Allowed Values | ||
|
|
||
| * `critical` | ||
| * `high` | ||
| * `medium` | ||
| * `low` | ||
|
|
||
| --- | ||
|
|
||
| ## ChangeRequest | ||
|
|
||
| ### Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **id** | `string` | ✅ | Change request ID | | ||
| | **title** | `string` | ✅ | Change title | | ||
| | **description** | `string` | ✅ | Change description | | ||
| | **type** | `Enum<'standard' \| 'normal' \| 'emergency' \| 'major'>` | ✅ | Change type | | ||
| | **priority** | `Enum<'critical' \| 'high' \| 'medium' \| 'low'>` | ✅ | Change priority | | ||
| | **status** | `Enum<'draft' \| 'submitted' \| 'in-review' \| 'approved' \| 'scheduled' \| 'in-progress' \| 'completed' \| 'failed' \| 'rolled-back' \| 'cancelled'>` | ✅ | Change status | | ||
| | **requestedBy** | `string` | ✅ | Requester user ID | | ||
| | **requestedAt** | `number` | ✅ | Request timestamp | | ||
| | **impact** | `object` | ✅ | Impact assessment | | ||
| | **implementation** | `object` | ✅ | Implementation plan | | ||
| | **rollbackPlan** | `object` | ✅ | Rollback plan | | ||
| | **schedule** | `object` | optional | Schedule | | ||
| | **approval** | `object` | optional | Approval workflow | | ||
| | **attachments** | `object[]` | optional | Attachments | | ||
|
|
||
| --- | ||
|
|
||
| ## ChangeStatus | ||
|
|
||
| ### Allowed Values | ||
|
|
||
| * `draft` | ||
| * `submitted` | ||
| * `in-review` | ||
| * `approved` | ||
| * `scheduled` | ||
| * `in-progress` | ||
| * `completed` | ||
| * `failed` | ||
| * `rolled-back` | ||
| * `cancelled` | ||
|
|
||
| --- | ||
|
|
||
| ## ChangeType | ||
|
|
||
| ### Allowed Values | ||
|
|
||
| * `standard` | ||
| * `normal` | ||
| * `emergency` | ||
| * `major` | ||
|
|
||
| --- | ||
|
|
||
| ## RollbackPlan | ||
|
|
||
| ### Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **description** | `string` | ✅ | Rollback description | | ||
| | **steps** | `object[]` | ✅ | Rollback steps | | ||
| | **testProcedure** | `string` | optional | Test procedure | | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This documentation file appears to be incorrect. There is no
packages/spec/src/data/connector.zod.tsfile in the codebase. TheFieldMappingSchemais actually exported frompackages/spec/src/data/external-lookup.zod.ts, not from a connector module.Additionally, there is a naming collision:
FieldMappingSchemais defined in both:packages/spec/src/data/external-lookup.zod.ts(newly added in this PR)packages/spec/src/data/mapping.zod.ts(existing)The schema in
external-lookup.zod.tsshould be renamed to avoid this conflict, perhaps toExternalFieldMappingSchema, and this documentation file should either be removed or updated to reference the correct schema location.