@contractspec/lib.files 1.44.1 → 1.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contracts/index.d.ts +291 -291
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js +13 -13
- package/dist/contracts/index.js.map +1 -1
- package/dist/entities/index.d.ts +133 -133
- package/dist/events.d.ts +118 -118
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +9 -9
- package/dist/events.js.map +1 -1
- package/dist/files.feature.js +24 -24
- package/dist/files.feature.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/contracts/index.ts"],"sourcesContent":[],"mappings":";;;;cAOa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/contracts/index.ts"],"sourcesContent":[],"mappings":";;;;cAOa,uCAAS;;UAwBpB,2BAAA,CAAA;;EAxBW,CAAA;EAwBX,IAAA,EAAA;;;;;;;;;;;;;;;;;;;EAxBoB,CAAA;EA0BT,QAAA,EAAA;IAcX,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;;EAd2B,OAAA,EAAA;IAgBhB,IAAA,uCAoBX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;cApCW,8CAAgB;;UAc3B,2BAAA,CAAA;;;EAE0B,MAAA,EAAA;IAsBf,IAAA,uCAUX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;IAV4B,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IA+LjB,UAAA,EAAA,KAgCX;EAAA,CAAA;;;;;;;;;EAhC6B,OAAA,EAAA;;;;;;;;;;;;;cArNlB,6CAAe;;UAoB1B,2BAAA,CAAA;;;;+CAiM6B,CAAA,MAAA,EA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A1BgC,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+BrB,mDAAmB,0CAAA;;UA0B9B,2BAAA,CAAA;;;;;;;;;;;;;;;cA1B8B,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+BnB,kDAAkB,0CAAA;;UAgC7B,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAhC6B,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAqClB,kDAAkB,0CAAA;;UA0B7B,2BAAA,CAAA;;;;;UA1B6B,2BAAA,CAAA;;;;;;;cA+BlB,uDAAuB,0CAAA;;UAkBlC,2BAAA,CAAA;;;;;;;;;;;;;;;cAlBkC,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuBvB,0DAA0B,0CAAA;;UAgCrC,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;UAhCqC,2BAAA,CAAA"}
|
package/dist/contracts/index.js
CHANGED
|
@@ -86,7 +86,7 @@ const FileVersionModel = defineSchemaModel({
|
|
|
86
86
|
isOptional: false
|
|
87
87
|
},
|
|
88
88
|
version: {
|
|
89
|
-
type: ScalarTypeEnum.
|
|
89
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
90
90
|
isOptional: false
|
|
91
91
|
},
|
|
92
92
|
size: {
|
|
@@ -508,7 +508,7 @@ const SuccessOutput = defineSchemaModel({
|
|
|
508
508
|
const UploadFileContract = defineCommand({
|
|
509
509
|
meta: {
|
|
510
510
|
key: "file.upload",
|
|
511
|
-
version: 1,
|
|
511
|
+
version: "1.0.0",
|
|
512
512
|
stability: "stable",
|
|
513
513
|
owners: [...OWNERS],
|
|
514
514
|
tags: ["files", "upload"],
|
|
@@ -542,7 +542,7 @@ const UploadFileContract = defineCommand({
|
|
|
542
542
|
const UpdateFileContract = defineCommand({
|
|
543
543
|
meta: {
|
|
544
544
|
key: "file.update",
|
|
545
|
-
version: 1,
|
|
545
|
+
version: "1.0.0",
|
|
546
546
|
stability: "stable",
|
|
547
547
|
owners: [...OWNERS],
|
|
548
548
|
tags: ["files", "update"],
|
|
@@ -568,7 +568,7 @@ const UpdateFileContract = defineCommand({
|
|
|
568
568
|
const DeleteFileContract = defineCommand({
|
|
569
569
|
meta: {
|
|
570
570
|
key: "file.delete",
|
|
571
|
-
version: 1,
|
|
571
|
+
version: "1.0.0",
|
|
572
572
|
stability: "stable",
|
|
573
573
|
owners: [...OWNERS],
|
|
574
574
|
tags: ["files", "delete"],
|
|
@@ -594,7 +594,7 @@ const DeleteFileContract = defineCommand({
|
|
|
594
594
|
const GetFileContract = defineQuery({
|
|
595
595
|
meta: {
|
|
596
596
|
key: "file.get",
|
|
597
|
-
version: 1,
|
|
597
|
+
version: "1.0.0",
|
|
598
598
|
stability: "stable",
|
|
599
599
|
owners: [...OWNERS],
|
|
600
600
|
tags: ["files", "get"],
|
|
@@ -620,7 +620,7 @@ const GetFileContract = defineQuery({
|
|
|
620
620
|
const ListFilesContract = defineQuery({
|
|
621
621
|
meta: {
|
|
622
622
|
key: "file.list",
|
|
623
|
-
version: 1,
|
|
623
|
+
version: "1.0.0",
|
|
624
624
|
stability: "stable",
|
|
625
625
|
owners: [...OWNERS],
|
|
626
626
|
tags: ["files", "list"],
|
|
@@ -640,7 +640,7 @@ const ListFilesContract = defineQuery({
|
|
|
640
640
|
const GetDownloadUrlContract = defineQuery({
|
|
641
641
|
meta: {
|
|
642
642
|
key: "file.downloadUrl",
|
|
643
|
-
version: 1,
|
|
643
|
+
version: "1.0.0",
|
|
644
644
|
stability: "stable",
|
|
645
645
|
owners: [...OWNERS],
|
|
646
646
|
tags: ["files", "download"],
|
|
@@ -666,7 +666,7 @@ const GetDownloadUrlContract = defineQuery({
|
|
|
666
666
|
const CreateVersionContract = defineCommand({
|
|
667
667
|
meta: {
|
|
668
668
|
key: "file.version.create",
|
|
669
|
-
version: 1,
|
|
669
|
+
version: "1.0.0",
|
|
670
670
|
stability: "stable",
|
|
671
671
|
owners: [...OWNERS],
|
|
672
672
|
tags: [
|
|
@@ -696,7 +696,7 @@ const CreateVersionContract = defineCommand({
|
|
|
696
696
|
const GetVersionsContract = defineQuery({
|
|
697
697
|
meta: {
|
|
698
698
|
key: "file.version.list",
|
|
699
|
-
version: 1,
|
|
699
|
+
version: "1.0.0",
|
|
700
700
|
stability: "stable",
|
|
701
701
|
owners: [...OWNERS],
|
|
702
702
|
tags: [
|
|
@@ -726,7 +726,7 @@ const GetVersionsContract = defineQuery({
|
|
|
726
726
|
const AttachFileContract = defineCommand({
|
|
727
727
|
meta: {
|
|
728
728
|
key: "attachment.attach",
|
|
729
|
-
version: 1,
|
|
729
|
+
version: "1.0.0",
|
|
730
730
|
stability: "stable",
|
|
731
731
|
owners: [...OWNERS],
|
|
732
732
|
tags: [
|
|
@@ -764,7 +764,7 @@ const AttachFileContract = defineCommand({
|
|
|
764
764
|
const DetachFileContract = defineCommand({
|
|
765
765
|
meta: {
|
|
766
766
|
key: "attachment.detach",
|
|
767
|
-
version: 1,
|
|
767
|
+
version: "1.0.0",
|
|
768
768
|
stability: "stable",
|
|
769
769
|
owners: [...OWNERS],
|
|
770
770
|
tags: [
|
|
@@ -794,7 +794,7 @@ const DetachFileContract = defineCommand({
|
|
|
794
794
|
const ListAttachmentsContract = defineQuery({
|
|
795
795
|
meta: {
|
|
796
796
|
key: "attachment.list",
|
|
797
|
-
version: 1,
|
|
797
|
+
version: "1.0.0",
|
|
798
798
|
stability: "stable",
|
|
799
799
|
owners: [...OWNERS],
|
|
800
800
|
tags: [
|
|
@@ -818,7 +818,7 @@ const ListAttachmentsContract = defineQuery({
|
|
|
818
818
|
const CreatePresignedUrlContract = defineCommand({
|
|
819
819
|
meta: {
|
|
820
820
|
key: "file.presignedUrl.create",
|
|
821
|
-
version: 1,
|
|
821
|
+
version: "1.0.0",
|
|
822
822
|
stability: "stable",
|
|
823
823
|
owners: [...OWNERS],
|
|
824
824
|
tags: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/contracts/index.ts"],"sourcesContent":["import { ScalarTypeEnum, defineSchemaModel } from '@contractspec/lib.schema';\nimport { defineCommand, defineQuery } from '@contractspec/lib.contracts';\n\nconst OWNERS = ['platform.files'] as const;\n\n// ============ Schema Models ============\n\nexport const FileModel = defineSchemaModel({\n name: 'File',\n description: 'Represents an uploaded file',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n mimeType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n size: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n storageProvider: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n storagePath: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n checksum: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n isPublic: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n metadata: { type: ScalarTypeEnum.JSON(), isOptional: true },\n width: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n height: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const FileVersionModel = defineSchemaModel({\n name: 'FileVersion',\n description: 'Represents a file version',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n version: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n size: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n storagePath: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n checksum: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n comment: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n createdBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const AttachmentModel = defineSchemaModel({\n name: 'Attachment',\n description: 'Represents an attachment',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n entityType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n entityId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n attachmentType: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n order: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n metadata: { type: ScalarTypeEnum.JSON(), isOptional: true },\n createdBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n file: { type: FileModel, isOptional: true },\n },\n});\n\nexport const PresignedUrlModel = defineSchemaModel({\n name: 'PresignedUrl',\n description: 'A presigned URL for file operations',\n fields: {\n url: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n fields: { type: ScalarTypeEnum.JSON(), isOptional: true },\n expiresAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n sessionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\n// ============ Input/Output Models ============\n\nconst UploadFileInput = defineSchemaModel({\n name: 'UploadFileInput',\n description: 'Input for uploading a file',\n fields: {\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n mimeType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n size: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n content: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }, // Base64 encoded\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n isPublic: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n metadata: { type: ScalarTypeEnum.JSON(), isOptional: true },\n tags: { type: ScalarTypeEnum.JSON(), isOptional: true },\n },\n});\n\nconst UpdateFileInput = defineSchemaModel({\n name: 'UpdateFileInput',\n description: 'Input for updating a file',\n fields: {\n fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n isPublic: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n metadata: { type: ScalarTypeEnum.JSON(), isOptional: true },\n tags: { type: ScalarTypeEnum.JSON(), isOptional: true },\n },\n});\n\nconst DeleteFileInput = defineSchemaModel({\n name: 'DeleteFileInput',\n description: 'Input for deleting a file',\n fields: {\n fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nconst GetFileInput = defineSchemaModel({\n name: 'GetFileInput',\n description: 'Input for getting a file',\n fields: {\n fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nconst ListFilesInput = defineSchemaModel({\n name: 'ListFilesInput',\n description: 'Input for listing files',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n mimeType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n status: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n tags: { type: ScalarTypeEnum.JSON(), isOptional: true },\n limit: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n offset: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n },\n});\n\nconst ListFilesOutput = defineSchemaModel({\n name: 'ListFilesOutput',\n description: 'Output for listing files',\n fields: {\n files: { type: FileModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n});\n\nconst GetDownloadUrlInput = defineSchemaModel({\n name: 'GetDownloadUrlInput',\n description: 'Input for getting a download URL',\n fields: {\n fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n expiresInSeconds: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n },\n});\n\nconst CreateVersionInput = defineSchemaModel({\n name: 'CreateVersionInput',\n description: 'Input for creating a file version',\n fields: {\n fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n content: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }, // Base64 encoded\n comment: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\nconst GetVersionsInput = defineSchemaModel({\n name: 'GetVersionsInput',\n description: 'Input for getting file versions',\n fields: {\n fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n limit: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n offset: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n },\n});\n\nconst GetVersionsOutput = defineSchemaModel({\n name: 'GetVersionsOutput',\n description: 'Output for getting file versions',\n fields: {\n versions: { type: FileVersionModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n});\n\nconst AttachFileInput = defineSchemaModel({\n name: 'AttachFileInput',\n description: 'Input for attaching a file to an entity',\n fields: {\n fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n entityType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n entityId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n attachmentType: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n order: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n metadata: { type: ScalarTypeEnum.JSON(), isOptional: true },\n },\n});\n\nconst DetachFileInput = defineSchemaModel({\n name: 'DetachFileInput',\n description: 'Input for detaching a file',\n fields: {\n attachmentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nconst ListAttachmentsInput = defineSchemaModel({\n name: 'ListAttachmentsInput',\n description: 'Input for listing attachments',\n fields: {\n entityType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n entityId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n attachmentType: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n },\n});\n\nconst ListAttachmentsOutput = defineSchemaModel({\n name: 'ListAttachmentsOutput',\n description: 'Output for listing attachments',\n fields: {\n attachments: { type: AttachmentModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n});\n\nconst CreatePresignedUrlInput = defineSchemaModel({\n name: 'CreatePresignedUrlInput',\n description: 'Input for creating a presigned upload URL',\n fields: {\n fileName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n mimeType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n size: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n expiresInSeconds: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n },\n});\n\nconst SuccessOutput = defineSchemaModel({\n name: 'SuccessOutput',\n description: 'Generic success output',\n fields: {\n success: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n});\n\n// ============ Contracts ============\n\n/**\n * Upload a file.\n */\nexport const UploadFileContract = defineCommand({\n meta: {\n key: 'file.upload',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'upload'],\n description: 'Upload a new file.',\n goal: 'Store a file and create a file record.',\n context: 'Called when uploading files directly.',\n },\n io: {\n input: UploadFileInput,\n output: FileModel,\n errors: {\n FILE_TOO_LARGE: {\n description: 'File exceeds size limit',\n http: 413,\n gqlCode: 'FILE_TOO_LARGE',\n when: 'File size exceeds configured limit',\n },\n INVALID_MIME_TYPE: {\n description: 'MIME type not allowed',\n http: 415,\n gqlCode: 'INVALID_MIME_TYPE',\n when: 'File type is not in allowed list',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Update a file.\n */\nexport const UpdateFileContract = defineCommand({\n meta: {\n key: 'file.update',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'update'],\n description: 'Update file metadata.',\n goal: 'Modify file properties without replacing content.',\n context: 'Called when renaming or updating file metadata.',\n },\n io: {\n input: UpdateFileInput,\n output: FileModel,\n errors: {\n FILE_NOT_FOUND: {\n description: 'File does not exist',\n http: 404,\n gqlCode: 'FILE_NOT_FOUND',\n when: 'File ID is invalid',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Delete a file.\n */\nexport const DeleteFileContract = defineCommand({\n meta: {\n key: 'file.delete',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'delete'],\n description: 'Delete a file.',\n goal: 'Remove a file and all its versions and attachments.',\n context: 'Called when removing a file permanently.',\n },\n io: {\n input: DeleteFileInput,\n output: SuccessOutput,\n errors: {\n FILE_NOT_FOUND: {\n description: 'File does not exist',\n http: 404,\n gqlCode: 'FILE_NOT_FOUND',\n when: 'File ID is invalid',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Get a file by ID.\n */\nexport const GetFileContract = defineQuery({\n meta: {\n key: 'file.get',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'get'],\n description: 'Get a file by ID.',\n goal: 'Retrieve file metadata.',\n context: 'Called to inspect file details.',\n },\n io: {\n input: GetFileInput,\n output: FileModel,\n errors: {\n FILE_NOT_FOUND: {\n description: 'File does not exist',\n http: 404,\n gqlCode: 'FILE_NOT_FOUND',\n when: 'File ID is invalid',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * List files.\n */\nexport const ListFilesContract = defineQuery({\n meta: {\n key: 'file.list',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'list'],\n description: 'List files with filtering.',\n goal: 'Browse uploaded files.',\n context: 'Called to browse file library.',\n },\n io: {\n input: ListFilesInput,\n output: ListFilesOutput,\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Get download URL.\n */\nexport const GetDownloadUrlContract = defineQuery({\n meta: {\n key: 'file.downloadUrl',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'download'],\n description: 'Get a presigned download URL.',\n goal: 'Generate a temporary URL for downloading.',\n context: 'Called when user wants to download a file.',\n },\n io: {\n input: GetDownloadUrlInput,\n output: PresignedUrlModel,\n errors: {\n FILE_NOT_FOUND: {\n description: 'File does not exist',\n http: 404,\n gqlCode: 'FILE_NOT_FOUND',\n when: 'File ID is invalid',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Create a file version.\n */\nexport const CreateVersionContract = defineCommand({\n meta: {\n key: 'file.version.create',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'version', 'create'],\n description: 'Create a new version of a file.',\n goal: 'Upload a new version while preserving history.',\n context: 'Called when updating a document.',\n },\n io: {\n input: CreateVersionInput,\n output: FileVersionModel,\n errors: {\n FILE_NOT_FOUND: {\n description: 'File does not exist',\n http: 404,\n gqlCode: 'FILE_NOT_FOUND',\n when: 'File ID is invalid',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Get file versions.\n */\nexport const GetVersionsContract = defineQuery({\n meta: {\n key: 'file.version.list',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'version', 'list'],\n description: 'Get file version history.',\n goal: 'View all versions of a file.',\n context: 'Called to browse file history.',\n },\n io: {\n input: GetVersionsInput,\n output: GetVersionsOutput,\n errors: {\n FILE_NOT_FOUND: {\n description: 'File does not exist',\n http: 404,\n gqlCode: 'FILE_NOT_FOUND',\n when: 'File ID is invalid',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Attach a file to an entity.\n */\nexport const AttachFileContract = defineCommand({\n meta: {\n key: 'attachment.attach',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'attachment', 'attach'],\n description: 'Attach a file to an entity.',\n goal: 'Link a file to a business entity.',\n context: 'Called when associating files with entities.',\n },\n io: {\n input: AttachFileInput,\n output: AttachmentModel,\n errors: {\n FILE_NOT_FOUND: {\n description: 'File does not exist',\n http: 404,\n gqlCode: 'FILE_NOT_FOUND',\n when: 'File ID is invalid',\n },\n ATTACHMENT_EXISTS: {\n description: 'Attachment already exists',\n http: 409,\n gqlCode: 'ATTACHMENT_EXISTS',\n when: 'File is already attached to this entity',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Detach a file from an entity.\n */\nexport const DetachFileContract = defineCommand({\n meta: {\n key: 'attachment.detach',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'attachment', 'detach'],\n description: 'Detach a file from an entity.',\n goal: 'Remove a file association.',\n context: 'Called when removing file from entity.',\n },\n io: {\n input: DetachFileInput,\n output: SuccessOutput,\n errors: {\n ATTACHMENT_NOT_FOUND: {\n description: 'Attachment does not exist',\n http: 404,\n gqlCode: 'ATTACHMENT_NOT_FOUND',\n when: 'Attachment ID is invalid',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * List attachments for an entity.\n */\nexport const ListAttachmentsContract = defineQuery({\n meta: {\n key: 'attachment.list',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'attachment', 'list'],\n description: 'List attachments for an entity.',\n goal: 'Get all files attached to an entity.',\n context: 'Called to display attached files.',\n },\n io: {\n input: ListAttachmentsInput,\n output: ListAttachmentsOutput,\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Create a presigned upload URL.\n */\nexport const CreatePresignedUrlContract = defineCommand({\n meta: {\n key: 'file.presignedUrl.create',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'presigned', 'upload'],\n description: 'Create a presigned URL for direct upload.',\n goal: 'Enable direct-to-storage uploads.',\n context: 'Called for large file uploads.',\n },\n io: {\n input: CreatePresignedUrlInput,\n output: PresignedUrlModel,\n errors: {\n FILE_TOO_LARGE: {\n description: 'File exceeds size limit',\n http: 413,\n gqlCode: 'FILE_TOO_LARGE',\n when: 'Requested file size exceeds limit',\n },\n INVALID_MIME_TYPE: {\n description: 'MIME type not allowed',\n http: 415,\n gqlCode: 'INVALID_MIME_TYPE',\n when: 'File type is not in allowed list',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n});\n"],"mappings":";;;;AAGA,MAAM,SAAS,CAAC,iBAAiB;AAIjC,MAAa,YAAY,kBAAkB;CACzC,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE,MAAM;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EAChE,iBAAiB;GACf,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC1E,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACtE,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,UAAU;GAAE,MAAM,eAAe,SAAS;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W;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAS;GAAc;GAAO;EACrC,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACT;CACD,QAAQ,EACN,MAAM,QACP;CACF,CAAC;;;;AAKF,MAAa,6BAA6B,cAAc;CACtD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAS;GAAa;GAAS;EACtC,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACR,QAAQ;GACN,gBAAgB;IACd,aAAa;IACb,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACD,mBAAmB;IACjB,aAAa;IACb,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACF;EACF;CACD,QAAQ,EACN,MAAM,QACP;CACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/contracts/index.ts"],"sourcesContent":["import { ScalarTypeEnum, defineSchemaModel } from '@contractspec/lib.schema';\nimport { defineCommand, defineQuery } from '@contractspec/lib.contracts';\n\nconst OWNERS = ['platform.files'] as const;\n\n// ============ Schema Models ============\n\nexport const FileModel = defineSchemaModel({\n name: 'File',\n description: 'Represents an uploaded file',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n mimeType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n size: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n storageProvider: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n storagePath: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n checksum: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n isPublic: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n metadata: { type: ScalarTypeEnum.JSON(), isOptional: true },\n width: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n height: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const FileVersionModel = defineSchemaModel({\n name: 'FileVersion',\n description: 'Represents a file version',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n version: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n size: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n storagePath: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n checksum: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n comment: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n createdBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const AttachmentModel = defineSchemaModel({\n name: 'Attachment',\n description: 'Represents an attachment',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n entityType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n entityId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n attachmentType: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n order: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n metadata: { type: ScalarTypeEnum.JSON(), isOptional: true },\n createdBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n file: { type: FileModel, isOptional: true },\n },\n});\n\nexport const PresignedUrlModel = defineSchemaModel({\n name: 'PresignedUrl',\n description: 'A presigned URL for file operations',\n fields: {\n url: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n fields: { type: ScalarTypeEnum.JSON(), isOptional: true },\n expiresAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n sessionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\n// ============ Input/Output Models ============\n\nconst UploadFileInput = defineSchemaModel({\n name: 'UploadFileInput',\n description: 'Input for uploading a file',\n fields: {\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n mimeType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n size: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n content: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }, // Base64 encoded\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n isPublic: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n metadata: { type: ScalarTypeEnum.JSON(), isOptional: true },\n tags: { type: ScalarTypeEnum.JSON(), isOptional: true },\n },\n});\n\nconst UpdateFileInput = defineSchemaModel({\n name: 'UpdateFileInput',\n description: 'Input for updating a file',\n fields: {\n fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n isPublic: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n metadata: { type: ScalarTypeEnum.JSON(), isOptional: true },\n tags: { type: ScalarTypeEnum.JSON(), isOptional: true },\n },\n});\n\nconst DeleteFileInput = defineSchemaModel({\n name: 'DeleteFileInput',\n description: 'Input for deleting a file',\n fields: {\n fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nconst GetFileInput = defineSchemaModel({\n name: 'GetFileInput',\n description: 'Input for getting a file',\n fields: {\n fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nconst ListFilesInput = defineSchemaModel({\n name: 'ListFilesInput',\n description: 'Input for listing files',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n mimeType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n status: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n tags: { type: ScalarTypeEnum.JSON(), isOptional: true },\n limit: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n offset: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n },\n});\n\nconst ListFilesOutput = defineSchemaModel({\n name: 'ListFilesOutput',\n description: 'Output for listing files',\n fields: {\n files: { type: FileModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n});\n\nconst GetDownloadUrlInput = defineSchemaModel({\n name: 'GetDownloadUrlInput',\n description: 'Input for getting a download URL',\n fields: {\n fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n expiresInSeconds: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n },\n});\n\nconst CreateVersionInput = defineSchemaModel({\n name: 'CreateVersionInput',\n description: 'Input for creating a file version',\n fields: {\n fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n content: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }, // Base64 encoded\n comment: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\nconst GetVersionsInput = defineSchemaModel({\n name: 'GetVersionsInput',\n description: 'Input for getting file versions',\n fields: {\n fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n limit: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n offset: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n },\n});\n\nconst GetVersionsOutput = defineSchemaModel({\n name: 'GetVersionsOutput',\n description: 'Output for getting file versions',\n fields: {\n versions: { type: FileVersionModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n});\n\nconst AttachFileInput = defineSchemaModel({\n name: 'AttachFileInput',\n description: 'Input for attaching a file to an entity',\n fields: {\n fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n entityType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n entityId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n attachmentType: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n order: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n metadata: { type: ScalarTypeEnum.JSON(), isOptional: true },\n },\n});\n\nconst DetachFileInput = defineSchemaModel({\n name: 'DetachFileInput',\n description: 'Input for detaching a file',\n fields: {\n attachmentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nconst ListAttachmentsInput = defineSchemaModel({\n name: 'ListAttachmentsInput',\n description: 'Input for listing attachments',\n fields: {\n entityType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n entityId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n attachmentType: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n },\n});\n\nconst ListAttachmentsOutput = defineSchemaModel({\n name: 'ListAttachmentsOutput',\n description: 'Output for listing attachments',\n fields: {\n attachments: { type: AttachmentModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n});\n\nconst CreatePresignedUrlInput = defineSchemaModel({\n name: 'CreatePresignedUrlInput',\n description: 'Input for creating a presigned upload URL',\n fields: {\n fileName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n mimeType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n size: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n expiresInSeconds: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n },\n});\n\nconst SuccessOutput = defineSchemaModel({\n name: 'SuccessOutput',\n description: 'Generic success output',\n fields: {\n success: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n});\n\n// ============ Contracts ============\n\n/**\n * Upload a file.\n */\nexport const UploadFileContract = defineCommand({\n meta: {\n key: 'file.upload',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'upload'],\n description: 'Upload a new file.',\n goal: 'Store a file and create a file record.',\n context: 'Called when uploading files directly.',\n },\n io: {\n input: UploadFileInput,\n output: FileModel,\n errors: {\n FILE_TOO_LARGE: {\n description: 'File exceeds size limit',\n http: 413,\n gqlCode: 'FILE_TOO_LARGE',\n when: 'File size exceeds configured limit',\n },\n INVALID_MIME_TYPE: {\n description: 'MIME type not allowed',\n http: 415,\n gqlCode: 'INVALID_MIME_TYPE',\n when: 'File type is not in allowed list',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Update a file.\n */\nexport const UpdateFileContract = defineCommand({\n meta: {\n key: 'file.update',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'update'],\n description: 'Update file metadata.',\n goal: 'Modify file properties without replacing content.',\n context: 'Called when renaming or updating file metadata.',\n },\n io: {\n input: UpdateFileInput,\n output: FileModel,\n errors: {\n FILE_NOT_FOUND: {\n description: 'File does not exist',\n http: 404,\n gqlCode: 'FILE_NOT_FOUND',\n when: 'File ID is invalid',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Delete a file.\n */\nexport const DeleteFileContract = defineCommand({\n meta: {\n key: 'file.delete',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'delete'],\n description: 'Delete a file.',\n goal: 'Remove a file and all its versions and attachments.',\n context: 'Called when removing a file permanently.',\n },\n io: {\n input: DeleteFileInput,\n output: SuccessOutput,\n errors: {\n FILE_NOT_FOUND: {\n description: 'File does not exist',\n http: 404,\n gqlCode: 'FILE_NOT_FOUND',\n when: 'File ID is invalid',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Get a file by ID.\n */\nexport const GetFileContract = defineQuery({\n meta: {\n key: 'file.get',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'get'],\n description: 'Get a file by ID.',\n goal: 'Retrieve file metadata.',\n context: 'Called to inspect file details.',\n },\n io: {\n input: GetFileInput,\n output: FileModel,\n errors: {\n FILE_NOT_FOUND: {\n description: 'File does not exist',\n http: 404,\n gqlCode: 'FILE_NOT_FOUND',\n when: 'File ID is invalid',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * List files.\n */\nexport const ListFilesContract = defineQuery({\n meta: {\n key: 'file.list',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'list'],\n description: 'List files with filtering.',\n goal: 'Browse uploaded files.',\n context: 'Called to browse file library.',\n },\n io: {\n input: ListFilesInput,\n output: ListFilesOutput,\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Get download URL.\n */\nexport const GetDownloadUrlContract = defineQuery({\n meta: {\n key: 'file.downloadUrl',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'download'],\n description: 'Get a presigned download URL.',\n goal: 'Generate a temporary URL for downloading.',\n context: 'Called when user wants to download a file.',\n },\n io: {\n input: GetDownloadUrlInput,\n output: PresignedUrlModel,\n errors: {\n FILE_NOT_FOUND: {\n description: 'File does not exist',\n http: 404,\n gqlCode: 'FILE_NOT_FOUND',\n when: 'File ID is invalid',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Create a file version.\n */\nexport const CreateVersionContract = defineCommand({\n meta: {\n key: 'file.version.create',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'version', 'create'],\n description: 'Create a new version of a file.',\n goal: 'Upload a new version while preserving history.',\n context: 'Called when updating a document.',\n },\n io: {\n input: CreateVersionInput,\n output: FileVersionModel,\n errors: {\n FILE_NOT_FOUND: {\n description: 'File does not exist',\n http: 404,\n gqlCode: 'FILE_NOT_FOUND',\n when: 'File ID is invalid',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Get file versions.\n */\nexport const GetVersionsContract = defineQuery({\n meta: {\n key: 'file.version.list',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'version', 'list'],\n description: 'Get file version history.',\n goal: 'View all versions of a file.',\n context: 'Called to browse file history.',\n },\n io: {\n input: GetVersionsInput,\n output: GetVersionsOutput,\n errors: {\n FILE_NOT_FOUND: {\n description: 'File does not exist',\n http: 404,\n gqlCode: 'FILE_NOT_FOUND',\n when: 'File ID is invalid',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Attach a file to an entity.\n */\nexport const AttachFileContract = defineCommand({\n meta: {\n key: 'attachment.attach',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'attachment', 'attach'],\n description: 'Attach a file to an entity.',\n goal: 'Link a file to a business entity.',\n context: 'Called when associating files with entities.',\n },\n io: {\n input: AttachFileInput,\n output: AttachmentModel,\n errors: {\n FILE_NOT_FOUND: {\n description: 'File does not exist',\n http: 404,\n gqlCode: 'FILE_NOT_FOUND',\n when: 'File ID is invalid',\n },\n ATTACHMENT_EXISTS: {\n description: 'Attachment already exists',\n http: 409,\n gqlCode: 'ATTACHMENT_EXISTS',\n when: 'File is already attached to this entity',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Detach a file from an entity.\n */\nexport const DetachFileContract = defineCommand({\n meta: {\n key: 'attachment.detach',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'attachment', 'detach'],\n description: 'Detach a file from an entity.',\n goal: 'Remove a file association.',\n context: 'Called when removing file from entity.',\n },\n io: {\n input: DetachFileInput,\n output: SuccessOutput,\n errors: {\n ATTACHMENT_NOT_FOUND: {\n description: 'Attachment does not exist',\n http: 404,\n gqlCode: 'ATTACHMENT_NOT_FOUND',\n when: 'Attachment ID is invalid',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * List attachments for an entity.\n */\nexport const ListAttachmentsContract = defineQuery({\n meta: {\n key: 'attachment.list',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'attachment', 'list'],\n description: 'List attachments for an entity.',\n goal: 'Get all files attached to an entity.',\n context: 'Called to display attached files.',\n },\n io: {\n input: ListAttachmentsInput,\n output: ListAttachmentsOutput,\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Create a presigned upload URL.\n */\nexport const CreatePresignedUrlContract = defineCommand({\n meta: {\n key: 'file.presignedUrl.create',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['files', 'presigned', 'upload'],\n description: 'Create a presigned URL for direct upload.',\n goal: 'Enable direct-to-storage uploads.',\n context: 'Called for large file uploads.',\n },\n io: {\n input: CreatePresignedUrlInput,\n output: PresignedUrlModel,\n errors: {\n FILE_TOO_LARGE: {\n description: 'File exceeds size limit',\n http: 413,\n gqlCode: 'FILE_TOO_LARGE',\n when: 'Requested file size exceeds limit',\n },\n INVALID_MIME_TYPE: {\n description: 'MIME type not allowed',\n http: 415,\n gqlCode: 'INVALID_MIME_TYPE',\n when: 'File type is not in allowed list',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n});\n"],"mappings":";;;;AAGA,MAAM,SAAS,CAAC,iBAAiB;AAIjC,MAAa,YAAY,kBAAkB;CACzC,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;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;CAC9C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAS;GAAc;GAAS;EACvC,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACR,QAAQ,EACN,sBAAsB;GACpB,aAAa;GACb,MAAM;GACN,SAAS;GACT,MAAM;GACP,EACF;EACF;CACD,QAAQ,EACN,MAAM,QACP;CACF,CAAC;;;;AAKF,MAAa,0BAA0B,YAAY;CACjD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAS;GAAc;GAAO;EACrC,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACT;CACD,QAAQ,EACN,MAAM,QACP;CACF,CAAC;;;;AAKF,MAAa,6BAA6B,cAAc;CACtD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAS;GAAa;GAAS;EACtC,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACR,QAAQ;GACN,gBAAgB;IACd,aAAa;IACb,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACD,mBAAmB;IACjB,aAAa;IACb,MAAM;IACN,SAAS;IACT,MAAM;IACP;GACF;EACF;CACD,QAAQ,EACN,MAAM,QACP;CACF,CAAC"}
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -1,164 +1,164 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _contractspec_lib_schema404 from "@contractspec/lib.schema";
|
|
2
2
|
import { ModuleSchemaContribution } from "@contractspec/lib.schema";
|
|
3
3
|
|
|
4
4
|
//#region src/entities/index.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Storage provider enum.
|
|
7
7
|
*/
|
|
8
|
-
declare const StorageProviderEnum:
|
|
8
|
+
declare const StorageProviderEnum: _contractspec_lib_schema404.EntityEnumDef;
|
|
9
9
|
/**
|
|
10
10
|
* File status enum.
|
|
11
11
|
*/
|
|
12
|
-
declare const FileStatusEnum:
|
|
12
|
+
declare const FileStatusEnum: _contractspec_lib_schema404.EntityEnumDef;
|
|
13
13
|
/**
|
|
14
14
|
* File entity - represents an uploaded file.
|
|
15
15
|
*/
|
|
16
|
-
declare const FileEntity:
|
|
17
|
-
id:
|
|
18
|
-
name:
|
|
19
|
-
mimeType:
|
|
20
|
-
size:
|
|
21
|
-
storageProvider:
|
|
22
|
-
storagePath:
|
|
23
|
-
storageKey:
|
|
24
|
-
checksum:
|
|
25
|
-
etag:
|
|
26
|
-
status:
|
|
27
|
-
isPublic:
|
|
28
|
-
expiresAt:
|
|
29
|
-
ownerId:
|
|
30
|
-
orgId:
|
|
31
|
-
metadata:
|
|
32
|
-
tags:
|
|
33
|
-
width:
|
|
34
|
-
height:
|
|
35
|
-
createdAt:
|
|
36
|
-
updatedAt:
|
|
37
|
-
versions:
|
|
38
|
-
attachments:
|
|
16
|
+
declare const FileEntity: _contractspec_lib_schema404.EntitySpec<{
|
|
17
|
+
id: _contractspec_lib_schema404.EntityScalarField;
|
|
18
|
+
name: _contractspec_lib_schema404.EntityScalarField;
|
|
19
|
+
mimeType: _contractspec_lib_schema404.EntityScalarField;
|
|
20
|
+
size: _contractspec_lib_schema404.EntityScalarField;
|
|
21
|
+
storageProvider: _contractspec_lib_schema404.EntityEnumField;
|
|
22
|
+
storagePath: _contractspec_lib_schema404.EntityScalarField;
|
|
23
|
+
storageKey: _contractspec_lib_schema404.EntityScalarField;
|
|
24
|
+
checksum: _contractspec_lib_schema404.EntityScalarField;
|
|
25
|
+
etag: _contractspec_lib_schema404.EntityScalarField;
|
|
26
|
+
status: _contractspec_lib_schema404.EntityEnumField;
|
|
27
|
+
isPublic: _contractspec_lib_schema404.EntityScalarField;
|
|
28
|
+
expiresAt: _contractspec_lib_schema404.EntityScalarField;
|
|
29
|
+
ownerId: _contractspec_lib_schema404.EntityScalarField;
|
|
30
|
+
orgId: _contractspec_lib_schema404.EntityScalarField;
|
|
31
|
+
metadata: _contractspec_lib_schema404.EntityScalarField;
|
|
32
|
+
tags: _contractspec_lib_schema404.EntityScalarField;
|
|
33
|
+
width: _contractspec_lib_schema404.EntityScalarField;
|
|
34
|
+
height: _contractspec_lib_schema404.EntityScalarField;
|
|
35
|
+
createdAt: _contractspec_lib_schema404.EntityScalarField;
|
|
36
|
+
updatedAt: _contractspec_lib_schema404.EntityScalarField;
|
|
37
|
+
versions: _contractspec_lib_schema404.EntityRelationField;
|
|
38
|
+
attachments: _contractspec_lib_schema404.EntityRelationField;
|
|
39
39
|
}>;
|
|
40
40
|
/**
|
|
41
41
|
* FileVersion entity - version history for files.
|
|
42
42
|
*/
|
|
43
|
-
declare const FileVersionEntity:
|
|
44
|
-
id:
|
|
45
|
-
fileId:
|
|
46
|
-
version:
|
|
47
|
-
size:
|
|
48
|
-
storagePath:
|
|
49
|
-
checksum:
|
|
50
|
-
comment:
|
|
51
|
-
changes:
|
|
52
|
-
createdBy:
|
|
53
|
-
createdAt:
|
|
54
|
-
file:
|
|
43
|
+
declare const FileVersionEntity: _contractspec_lib_schema404.EntitySpec<{
|
|
44
|
+
id: _contractspec_lib_schema404.EntityScalarField;
|
|
45
|
+
fileId: _contractspec_lib_schema404.EntityScalarField;
|
|
46
|
+
version: _contractspec_lib_schema404.EntityScalarField;
|
|
47
|
+
size: _contractspec_lib_schema404.EntityScalarField;
|
|
48
|
+
storagePath: _contractspec_lib_schema404.EntityScalarField;
|
|
49
|
+
checksum: _contractspec_lib_schema404.EntityScalarField;
|
|
50
|
+
comment: _contractspec_lib_schema404.EntityScalarField;
|
|
51
|
+
changes: _contractspec_lib_schema404.EntityScalarField;
|
|
52
|
+
createdBy: _contractspec_lib_schema404.EntityScalarField;
|
|
53
|
+
createdAt: _contractspec_lib_schema404.EntityScalarField;
|
|
54
|
+
file: _contractspec_lib_schema404.EntityRelationField;
|
|
55
55
|
}>;
|
|
56
56
|
/**
|
|
57
57
|
* Attachment entity - polymorphic link between files and entities.
|
|
58
58
|
*/
|
|
59
|
-
declare const AttachmentEntity:
|
|
60
|
-
id:
|
|
61
|
-
fileId:
|
|
62
|
-
entityType:
|
|
63
|
-
entityId:
|
|
64
|
-
attachmentType:
|
|
65
|
-
name:
|
|
66
|
-
description:
|
|
67
|
-
order:
|
|
68
|
-
metadata:
|
|
69
|
-
createdBy:
|
|
70
|
-
createdAt:
|
|
71
|
-
updatedAt:
|
|
72
|
-
file:
|
|
59
|
+
declare const AttachmentEntity: _contractspec_lib_schema404.EntitySpec<{
|
|
60
|
+
id: _contractspec_lib_schema404.EntityScalarField;
|
|
61
|
+
fileId: _contractspec_lib_schema404.EntityScalarField;
|
|
62
|
+
entityType: _contractspec_lib_schema404.EntityScalarField;
|
|
63
|
+
entityId: _contractspec_lib_schema404.EntityScalarField;
|
|
64
|
+
attachmentType: _contractspec_lib_schema404.EntityScalarField;
|
|
65
|
+
name: _contractspec_lib_schema404.EntityScalarField;
|
|
66
|
+
description: _contractspec_lib_schema404.EntityScalarField;
|
|
67
|
+
order: _contractspec_lib_schema404.EntityScalarField;
|
|
68
|
+
metadata: _contractspec_lib_schema404.EntityScalarField;
|
|
69
|
+
createdBy: _contractspec_lib_schema404.EntityScalarField;
|
|
70
|
+
createdAt: _contractspec_lib_schema404.EntityScalarField;
|
|
71
|
+
updatedAt: _contractspec_lib_schema404.EntityScalarField;
|
|
72
|
+
file: _contractspec_lib_schema404.EntityRelationField;
|
|
73
73
|
}>;
|
|
74
74
|
/**
|
|
75
75
|
* UploadSession entity - tracks multipart uploads.
|
|
76
76
|
*/
|
|
77
|
-
declare const UploadSessionEntity:
|
|
78
|
-
id:
|
|
79
|
-
fileName:
|
|
80
|
-
mimeType:
|
|
81
|
-
totalSize:
|
|
82
|
-
uploadId:
|
|
83
|
-
uploadedBytes:
|
|
84
|
-
uploadedParts:
|
|
85
|
-
status:
|
|
86
|
-
error:
|
|
87
|
-
fileId:
|
|
88
|
-
ownerId:
|
|
89
|
-
orgId:
|
|
90
|
-
expiresAt:
|
|
91
|
-
createdAt:
|
|
92
|
-
updatedAt:
|
|
77
|
+
declare const UploadSessionEntity: _contractspec_lib_schema404.EntitySpec<{
|
|
78
|
+
id: _contractspec_lib_schema404.EntityScalarField;
|
|
79
|
+
fileName: _contractspec_lib_schema404.EntityScalarField;
|
|
80
|
+
mimeType: _contractspec_lib_schema404.EntityScalarField;
|
|
81
|
+
totalSize: _contractspec_lib_schema404.EntityScalarField;
|
|
82
|
+
uploadId: _contractspec_lib_schema404.EntityScalarField;
|
|
83
|
+
uploadedBytes: _contractspec_lib_schema404.EntityScalarField;
|
|
84
|
+
uploadedParts: _contractspec_lib_schema404.EntityScalarField;
|
|
85
|
+
status: _contractspec_lib_schema404.EntityScalarField;
|
|
86
|
+
error: _contractspec_lib_schema404.EntityScalarField;
|
|
87
|
+
fileId: _contractspec_lib_schema404.EntityScalarField;
|
|
88
|
+
ownerId: _contractspec_lib_schema404.EntityScalarField;
|
|
89
|
+
orgId: _contractspec_lib_schema404.EntityScalarField;
|
|
90
|
+
expiresAt: _contractspec_lib_schema404.EntityScalarField;
|
|
91
|
+
createdAt: _contractspec_lib_schema404.EntityScalarField;
|
|
92
|
+
updatedAt: _contractspec_lib_schema404.EntityScalarField;
|
|
93
93
|
}>;
|
|
94
94
|
/**
|
|
95
95
|
* All file entities for schema composition.
|
|
96
96
|
*/
|
|
97
|
-
declare const fileEntities: (
|
|
98
|
-
id:
|
|
99
|
-
name:
|
|
100
|
-
mimeType:
|
|
101
|
-
size:
|
|
102
|
-
storageProvider:
|
|
103
|
-
storagePath:
|
|
104
|
-
storageKey:
|
|
105
|
-
checksum:
|
|
106
|
-
etag:
|
|
107
|
-
status:
|
|
108
|
-
isPublic:
|
|
109
|
-
expiresAt:
|
|
110
|
-
ownerId:
|
|
111
|
-
orgId:
|
|
112
|
-
metadata:
|
|
113
|
-
tags:
|
|
114
|
-
width:
|
|
115
|
-
height:
|
|
116
|
-
createdAt:
|
|
117
|
-
updatedAt:
|
|
118
|
-
versions:
|
|
119
|
-
attachments:
|
|
120
|
-
}> |
|
|
121
|
-
id:
|
|
122
|
-
fileId:
|
|
123
|
-
version:
|
|
124
|
-
size:
|
|
125
|
-
storagePath:
|
|
126
|
-
checksum:
|
|
127
|
-
comment:
|
|
128
|
-
changes:
|
|
129
|
-
createdBy:
|
|
130
|
-
createdAt:
|
|
131
|
-
file:
|
|
132
|
-
}> |
|
|
133
|
-
id:
|
|
134
|
-
fileId:
|
|
135
|
-
entityType:
|
|
136
|
-
entityId:
|
|
137
|
-
attachmentType:
|
|
138
|
-
name:
|
|
139
|
-
description:
|
|
140
|
-
order:
|
|
141
|
-
metadata:
|
|
142
|
-
createdBy:
|
|
143
|
-
createdAt:
|
|
144
|
-
updatedAt:
|
|
145
|
-
file:
|
|
146
|
-
}> |
|
|
147
|
-
id:
|
|
148
|
-
fileName:
|
|
149
|
-
mimeType:
|
|
150
|
-
totalSize:
|
|
151
|
-
uploadId:
|
|
152
|
-
uploadedBytes:
|
|
153
|
-
uploadedParts:
|
|
154
|
-
status:
|
|
155
|
-
error:
|
|
156
|
-
fileId:
|
|
157
|
-
ownerId:
|
|
158
|
-
orgId:
|
|
159
|
-
expiresAt:
|
|
160
|
-
createdAt:
|
|
161
|
-
updatedAt:
|
|
97
|
+
declare const fileEntities: (_contractspec_lib_schema404.EntitySpec<{
|
|
98
|
+
id: _contractspec_lib_schema404.EntityScalarField;
|
|
99
|
+
name: _contractspec_lib_schema404.EntityScalarField;
|
|
100
|
+
mimeType: _contractspec_lib_schema404.EntityScalarField;
|
|
101
|
+
size: _contractspec_lib_schema404.EntityScalarField;
|
|
102
|
+
storageProvider: _contractspec_lib_schema404.EntityEnumField;
|
|
103
|
+
storagePath: _contractspec_lib_schema404.EntityScalarField;
|
|
104
|
+
storageKey: _contractspec_lib_schema404.EntityScalarField;
|
|
105
|
+
checksum: _contractspec_lib_schema404.EntityScalarField;
|
|
106
|
+
etag: _contractspec_lib_schema404.EntityScalarField;
|
|
107
|
+
status: _contractspec_lib_schema404.EntityEnumField;
|
|
108
|
+
isPublic: _contractspec_lib_schema404.EntityScalarField;
|
|
109
|
+
expiresAt: _contractspec_lib_schema404.EntityScalarField;
|
|
110
|
+
ownerId: _contractspec_lib_schema404.EntityScalarField;
|
|
111
|
+
orgId: _contractspec_lib_schema404.EntityScalarField;
|
|
112
|
+
metadata: _contractspec_lib_schema404.EntityScalarField;
|
|
113
|
+
tags: _contractspec_lib_schema404.EntityScalarField;
|
|
114
|
+
width: _contractspec_lib_schema404.EntityScalarField;
|
|
115
|
+
height: _contractspec_lib_schema404.EntityScalarField;
|
|
116
|
+
createdAt: _contractspec_lib_schema404.EntityScalarField;
|
|
117
|
+
updatedAt: _contractspec_lib_schema404.EntityScalarField;
|
|
118
|
+
versions: _contractspec_lib_schema404.EntityRelationField;
|
|
119
|
+
attachments: _contractspec_lib_schema404.EntityRelationField;
|
|
120
|
+
}> | _contractspec_lib_schema404.EntitySpec<{
|
|
121
|
+
id: _contractspec_lib_schema404.EntityScalarField;
|
|
122
|
+
fileId: _contractspec_lib_schema404.EntityScalarField;
|
|
123
|
+
version: _contractspec_lib_schema404.EntityScalarField;
|
|
124
|
+
size: _contractspec_lib_schema404.EntityScalarField;
|
|
125
|
+
storagePath: _contractspec_lib_schema404.EntityScalarField;
|
|
126
|
+
checksum: _contractspec_lib_schema404.EntityScalarField;
|
|
127
|
+
comment: _contractspec_lib_schema404.EntityScalarField;
|
|
128
|
+
changes: _contractspec_lib_schema404.EntityScalarField;
|
|
129
|
+
createdBy: _contractspec_lib_schema404.EntityScalarField;
|
|
130
|
+
createdAt: _contractspec_lib_schema404.EntityScalarField;
|
|
131
|
+
file: _contractspec_lib_schema404.EntityRelationField;
|
|
132
|
+
}> | _contractspec_lib_schema404.EntitySpec<{
|
|
133
|
+
id: _contractspec_lib_schema404.EntityScalarField;
|
|
134
|
+
fileId: _contractspec_lib_schema404.EntityScalarField;
|
|
135
|
+
entityType: _contractspec_lib_schema404.EntityScalarField;
|
|
136
|
+
entityId: _contractspec_lib_schema404.EntityScalarField;
|
|
137
|
+
attachmentType: _contractspec_lib_schema404.EntityScalarField;
|
|
138
|
+
name: _contractspec_lib_schema404.EntityScalarField;
|
|
139
|
+
description: _contractspec_lib_schema404.EntityScalarField;
|
|
140
|
+
order: _contractspec_lib_schema404.EntityScalarField;
|
|
141
|
+
metadata: _contractspec_lib_schema404.EntityScalarField;
|
|
142
|
+
createdBy: _contractspec_lib_schema404.EntityScalarField;
|
|
143
|
+
createdAt: _contractspec_lib_schema404.EntityScalarField;
|
|
144
|
+
updatedAt: _contractspec_lib_schema404.EntityScalarField;
|
|
145
|
+
file: _contractspec_lib_schema404.EntityRelationField;
|
|
146
|
+
}> | _contractspec_lib_schema404.EntitySpec<{
|
|
147
|
+
id: _contractspec_lib_schema404.EntityScalarField;
|
|
148
|
+
fileName: _contractspec_lib_schema404.EntityScalarField;
|
|
149
|
+
mimeType: _contractspec_lib_schema404.EntityScalarField;
|
|
150
|
+
totalSize: _contractspec_lib_schema404.EntityScalarField;
|
|
151
|
+
uploadId: _contractspec_lib_schema404.EntityScalarField;
|
|
152
|
+
uploadedBytes: _contractspec_lib_schema404.EntityScalarField;
|
|
153
|
+
uploadedParts: _contractspec_lib_schema404.EntityScalarField;
|
|
154
|
+
status: _contractspec_lib_schema404.EntityScalarField;
|
|
155
|
+
error: _contractspec_lib_schema404.EntityScalarField;
|
|
156
|
+
fileId: _contractspec_lib_schema404.EntityScalarField;
|
|
157
|
+
ownerId: _contractspec_lib_schema404.EntityScalarField;
|
|
158
|
+
orgId: _contractspec_lib_schema404.EntityScalarField;
|
|
159
|
+
expiresAt: _contractspec_lib_schema404.EntityScalarField;
|
|
160
|
+
createdAt: _contractspec_lib_schema404.EntityScalarField;
|
|
161
|
+
updatedAt: _contractspec_lib_schema404.EntityScalarField;
|
|
162
162
|
}>)[];
|
|
163
163
|
/**
|
|
164
164
|
* Module schema contribution for files.
|