@fourier-labs/harbour-contracts 0.95.0 → 0.96.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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "schema": "harbour.contract-release/1.0",
3
- "repositoryVersion": "0.95.0.0",
4
- "publishVersion": "0.95.0",
5
- "publishTag": "v0.95.0",
6
- "schemasDigest": "sha256:b1e4bf6cb073156c1e04bda0c9bbfa64b3469793fe76dd74f4aa7d85c6a8a9ac",
3
+ "repositoryVersion": "0.96.0.0",
4
+ "publishVersion": "0.96.0",
5
+ "publishTag": "v0.96.0",
6
+ "schemasDigest": "sha256:0baae0630687f4345db30f36b86d1821c4769728187b825db6d63c63c8dc229b",
7
7
  "aiFixturesDigest": "sha256:edac31c92e146ca1c40130f2fb5649db82e24b8cd1ac758153b90612052fddb6",
8
- "generatedGoDigest": "sha256:ed380cb87f47db9a9b090d819e0e35d647f1bc653da2c42e5f2382c5240f6245",
9
- "generatedTypeScriptDigest": "sha256:cc27d7e7a3915755581478ac4ec04fb70bf7e6e044eb42d14f3babccaa1ae0c6",
8
+ "generatedGoDigest": "sha256:725161b06837cacb79c92fd28ed00ef96b132a86ac5d5531ee1b3c3ce0fbb905",
9
+ "generatedTypeScriptDigest": "sha256:b6116203eda0c74ae1cb5ebe2ad9c54f0d73759d7eca1b571dd7aab13ee9c3a6",
10
10
  "generatedExclusions": {
11
11
  "gen-go/contract_release.go": "contains the generated aggregate digests (self-reference)",
12
12
  "gen-ts/contract-release.ts": "contains the generated aggregate digests (self-reference)"
@@ -42,7 +42,7 @@
42
42
  "schema/data-source.schema.json": "sha256:f32b2b4312bc06e023f4e1da60eed52ddfade59b74c1a1cc8e4b740a6f9c930b",
43
43
  "schema/deploy-request.schema.json": "sha256:c978406c273fa430db262888f0a8646b14e3057f64b0633780fcd6cfa646bc67",
44
44
  "schema/deploy-response.schema.json": "sha256:09064948abdbba7022738285d802ed44648a16ddc2a5b8c2eeb170ae19a66aeb",
45
- "schema/deployment-app-registration.schema.json": "sha256:bc74524a011db6e67e45fa1154eac38e5662308d4a71e199638287a109e52115",
45
+ "schema/deployment-app-registration.schema.json": "sha256:ffc45a08a547a3c447ff33d6274232c69853998ff78b283abd568b79ee30ce6b",
46
46
  "schema/deployment-continuation.schema.json": "sha256:55b6945439f2c91cd851dfe4bc9484e67a64091b7763b2d8267354b4a8bfae8c",
47
47
  "schema/deployment-environment.schema.json": "sha256:35b26cae07da9ee375a842b5e87c4570c8eca06775e9fd6dd46eb9eb8aa0df6c",
48
48
  "schema/deployment-preview-retirement.schema.json": "sha256:ccf6b971b7853ca98530272f280fe62cd3aab5425b10b81ae6b717cc949e014f",
@@ -54,6 +54,7 @@
54
54
  "schema/error-category.enum.json": "sha256:d6d83000c3357805b13138d717c411248c14f1c0fde1c02e82a25691de85d68d",
55
55
  "schema/error-envelope.schema.json": "sha256:75dccda7dd16fdf8435deda53fc7dbcdc109b65114617a17f11763010c656f90",
56
56
  "schema/external-sign-in.schema.json": "sha256:82d2cc5130a12a19554c85d4a78368939f417a80e795b2be060156294296ac70",
57
+ "schema/file-arrival.schema.json": "sha256:e756bdb1140fe7551977603144f4807bb3e1a53215933898c022cc8bd061e7d7",
57
58
  "schema/identity-context.schema.json": "sha256:a0be3d3499b70f1641887ec66ab5b21ca5ab71063e9209290905738943a36e59",
58
59
  "schema/integration-connect-result.schema.json": "sha256:3f254b67ef739dc1fa395bdc8c4dc93359b16d481dba2a2d777aa5b6f34b7af8",
59
60
  "schema/integration-error-details.schema.json": "sha256:5a290584b1542b2b8cdd4966869126180ce29c1f0dd250dca7fb68c05e76b8e9",
@@ -117,7 +118,7 @@
117
118
  "gen-go/integration_execute_input_rules_test.go": "sha256:6db850bbdfc31f60ac7ce6ec5cade4f5260b1836e56b2727efbfeee56db7a706",
118
119
  "gen-go/integration_operations.go": "sha256:1ba7ea4e118a2c4c8dd735b460b18d8658fbd7fd74e601ae372aff2844322f35",
119
120
  "gen-go/schema_documents.go": "sha256:c19c0d540f602ee997a84b90e20702d9bc63ed7d27aec267e76c04655fc182e0",
120
- "gen-go/types.go": "sha256:d060cf1349a6e3298db96eef946ccde7429ef495fb8326463598d0d4cb9ba592",
121
+ "gen-go/types.go": "sha256:22927bdcc31e32f39b1543e57ad8fc9a36ca0b7af94b9900c22ef215065b1ce6",
121
122
  "gen-go/version_state.go": "sha256:4ef8abb126414c0025cf2c59bc9c79a74ef4a2ff89e8f316cbf05acc872371c1"
122
123
  },
123
124
  "generatedTypeScript": {
@@ -154,7 +155,7 @@
154
155
  "gen-ts/data-source.ts": "sha256:2566f0d5c72e44278869f55211cf3d433aeb3552e57ae0ace0ff0b85e769dde6",
155
156
  "gen-ts/deploy-request.ts": "sha256:913245577a95354849d3a8cb43fbaedbf895efe7b653c8502d25edfa22b7a864",
156
157
  "gen-ts/deploy-response.ts": "sha256:364d9f1acf32e491498237cdd3f402d5f8e102f208db7748034f4ec68c6a6137",
157
- "gen-ts/deployment-app-registration.ts": "sha256:15244505907451b5f31e7e872ff8f741aa577ac104b1447e22b35b40f3d4ca1b",
158
+ "gen-ts/deployment-app-registration.ts": "sha256:cd497c679fd6f496aeb8d532ab641e75821add901dfdcff9e8e150b155ea9f55",
158
159
  "gen-ts/deployment-continuation.ts": "sha256:cc9f63af4d0da5086a79103789e4f043783b75b4ed11c6512f044439a551a79c",
159
160
  "gen-ts/deployment-environment.ts": "sha256:fc08cabe2e52ebb93cfe84d2019994260f71734c33d0e50e7c63e40ef5b17cef",
160
161
  "gen-ts/deployment-preview-retirement.ts": "sha256:309421d08daf0ade163b6457ed0e5410ec6573c40a59423a6cce14780d9c38db",
@@ -167,8 +168,9 @@
167
168
  "gen-ts/error-category.ts": "sha256:9bda89180c3b740c9aa8be466216592e8ca9d0d368c274333edf6ea5c45afd8e",
168
169
  "gen-ts/error-envelope.ts": "sha256:4457309be794f9d4fc0cf62530cc2d442c007bac9ae84aff66df099cc9e40310",
169
170
  "gen-ts/external-sign-in.ts": "sha256:393ef74d72e37d33e374e3226f34ab3e854fdb0c1129a367997cbb690bf253a6",
171
+ "gen-ts/file-arrival.ts": "sha256:42615d390767a07f983f78411f22c15e69b0719d96c6f9056261fff5c9983fc4",
170
172
  "gen-ts/identity-context.ts": "sha256:4b8151a321e224229250d214ef3e17f2ac986bb54ff0aadbb4509481724f6883",
171
- "gen-ts/index.ts": "sha256:258bdcaa0d8d26dd2bb996d3ddb0b4bf4533db83d1b7f0d35a2a2af85c728117",
173
+ "gen-ts/index.ts": "sha256:5e903bb40fbf6599dc0d65171eaef7bc62b52d4cea090124a0c51ef876ad2909",
172
174
  "gen-ts/integration-connect-result.ts": "sha256:4b10f169b6e1af364e9b418de21caa9fadbfb77b43cbff77d741cfae0b52180c",
173
175
  "gen-ts/integration-error-details.ts": "sha256:e73cb5942373ef88b2d8e03a1de56d5a69e71069ecd14e68396f7edba1f60780",
174
176
  "gen-ts/integration-execute-input-rules.ts": "sha256:d5be09ea12c01c164b69ccdd7c313385e8e7d494c117afd8a559fb80fafc1726",
@@ -1,7 +1,7 @@
1
- export declare const ContractRepositoryVersion: "0.95.0.0";
2
- export declare const ContractPublishVersion: "0.95.0";
3
- export declare const ContractPublishTag: "v0.95.0";
4
- export declare const ContractSchemasDigest: "sha256:b1e4bf6cb073156c1e04bda0c9bbfa64b3469793fe76dd74f4aa7d85c6a8a9ac";
1
+ export declare const ContractRepositoryVersion: "0.96.0.0";
2
+ export declare const ContractPublishVersion: "0.96.0";
3
+ export declare const ContractPublishTag: "v0.96.0";
4
+ export declare const ContractSchemasDigest: "sha256:0baae0630687f4345db30f36b86d1821c4769728187b825db6d63c63c8dc229b";
5
5
  export declare const ContractAiFixturesDigest: "sha256:edac31c92e146ca1c40130f2fb5649db82e24b8cd1ac758153b90612052fddb6";
6
- export declare const ContractGeneratedGoDigest: "sha256:ed380cb87f47db9a9b090d819e0e35d647f1bc653da2c42e5f2382c5240f6245";
7
- export declare const ContractGeneratedTypeScriptDigest: "sha256:cc27d7e7a3915755581478ac4ec04fb70bf7e6e044eb42d14f3babccaa1ae0c6";
6
+ export declare const ContractGeneratedGoDigest: "sha256:725161b06837cacb79c92fd28ed00ef96b132a86ac5d5531ee1b3c3ce0fbb905";
7
+ export declare const ContractGeneratedTypeScriptDigest: "sha256:b6116203eda0c74ae1cb5ebe2ad9c54f0d73759d7eca1b571dd7aab13ee9c3a6";
@@ -1,9 +1,9 @@
1
1
  /* eslint-disable */
2
2
  // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
- export const ContractRepositoryVersion = "0.95.0.0";
4
- export const ContractPublishVersion = "0.95.0";
5
- export const ContractPublishTag = "v0.95.0";
6
- export const ContractSchemasDigest = "sha256:b1e4bf6cb073156c1e04bda0c9bbfa64b3469793fe76dd74f4aa7d85c6a8a9ac";
3
+ export const ContractRepositoryVersion = "0.96.0.0";
4
+ export const ContractPublishVersion = "0.96.0";
5
+ export const ContractPublishTag = "v0.96.0";
6
+ export const ContractSchemasDigest = "sha256:0baae0630687f4345db30f36b86d1821c4769728187b825db6d63c63c8dc229b";
7
7
  export const ContractAiFixturesDigest = "sha256:edac31c92e146ca1c40130f2fb5649db82e24b8cd1ac758153b90612052fddb6";
8
- export const ContractGeneratedGoDigest = "sha256:ed380cb87f47db9a9b090d819e0e35d647f1bc653da2c42e5f2382c5240f6245";
9
- export const ContractGeneratedTypeScriptDigest = "sha256:cc27d7e7a3915755581478ac4ec04fb70bf7e6e044eb42d14f3babccaa1ae0c6";
8
+ export const ContractGeneratedGoDigest = "sha256:725161b06837cacb79c92fd28ed00ef96b132a86ac5d5531ee1b3c3ce0fbb905";
9
+ export const ContractGeneratedTypeScriptDigest = "sha256:b6116203eda0c74ae1cb5ebe2ad9c54f0d73759d7eca1b571dd7aab13ee9c3a6";
@@ -21,6 +21,9 @@ export type DeploymentAppRegistration = {
21
21
  * @maxItems 1
22
22
  */
23
23
  signInMethods?: ('phone' | 'email')[];
24
+ /**
25
+ * Temporary rolling-release input for email targets; writers use eventTarget. Remove after old deployments are migrated.
26
+ */
24
27
  mailArrivalTarget?: {
25
28
  functionArn: string;
26
29
  versionId: string;
@@ -30,6 +33,15 @@ export type DeploymentAppRegistration = {
30
33
  jobs: MailArrivalJobs;
31
34
  gatewayUrl: string;
32
35
  };
36
+ eventTarget?: {
37
+ functionArn: string;
38
+ versionId: string;
39
+ jobs: EventJobs;
40
+ } | {
41
+ versionId: string;
42
+ jobs: EventJobs;
43
+ gatewayUrl: string;
44
+ };
33
45
  };
34
46
  /**
35
47
  * @minItems 1
@@ -37,13 +49,33 @@ export type DeploymentAppRegistration = {
37
49
  */
38
50
  export type MailArrivalJobs = {
39
51
  name: string;
40
- trigger: {
41
- type: 'email.arrived';
52
+ trigger: EmailArrivalTrigger;
53
+ }[];
54
+ /**
55
+ * @minItems 1
56
+ * @maxItems 100
57
+ */
58
+ export type EventJobs = {
59
+ name: string;
60
+ trigger: EmailArrivalTrigger | {
61
+ type: 'file.created';
42
62
  connection: string;
43
- resource: 'inbox';
44
- filter?: {
45
- from?: string;
46
- subjectContains?: string;
47
- };
63
+ resource: string;
64
+ folderId: string;
65
+ driveId?: string;
66
+ /**
67
+ * @minItems 1
68
+ * @maxItems 2
69
+ */
70
+ mimeTypes?: ('application/pdf' | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')[];
48
71
  };
49
72
  }[];
73
+ export interface EmailArrivalTrigger {
74
+ type: 'email.arrived';
75
+ connection: string;
76
+ resource: 'inbox';
77
+ filter?: {
78
+ from?: string;
79
+ subjectContains?: string;
80
+ };
81
+ }
@@ -0,0 +1,13 @@
1
+ export type FileArrival = {
2
+ type: 'file.created';
3
+ provider: 'drive' | 'sharepoint';
4
+ sourceId: string;
5
+ fileId: string;
6
+ folderId: string;
7
+ driveId?: string;
8
+ name: string;
9
+ mimeType: 'application/pdf' | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
10
+ size: number;
11
+ createdAt: string;
12
+ observedAt: string;
13
+ };
@@ -0,0 +1,3 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+ export {};
@@ -45,6 +45,7 @@ export * from './error-category-registry.js';
45
45
  export * from './error-category.js';
46
46
  export * from './error-envelope.js';
47
47
  export * from './external-sign-in.js';
48
+ export * from './file-arrival.js';
48
49
  export * from './identity-context.js';
49
50
  export * from './integration-connect-result.js';
50
51
  export * from './integration-error-details.js';
@@ -47,6 +47,7 @@ export * from './error-category-registry.js';
47
47
  export * from './error-category.js';
48
48
  export * from './error-envelope.js';
49
49
  export * from './external-sign-in.js';
50
+ export * from './file-arrival.js';
50
51
  export * from './identity-context.js';
51
52
  export * from './integration-connect-result.js';
52
53
  export * from './integration-error-details.js';
@@ -1,10 +1,10 @@
1
1
  /* eslint-disable */
2
2
  // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
3
 
4
- export const ContractRepositoryVersion = "0.95.0.0" as const;
5
- export const ContractPublishVersion = "0.95.0" as const;
6
- export const ContractPublishTag = "v0.95.0" as const;
7
- export const ContractSchemasDigest = "sha256:b1e4bf6cb073156c1e04bda0c9bbfa64b3469793fe76dd74f4aa7d85c6a8a9ac" as const;
4
+ export const ContractRepositoryVersion = "0.96.0.0" as const;
5
+ export const ContractPublishVersion = "0.96.0" as const;
6
+ export const ContractPublishTag = "v0.96.0" as const;
7
+ export const ContractSchemasDigest = "sha256:0baae0630687f4345db30f36b86d1821c4769728187b825db6d63c63c8dc229b" as const;
8
8
  export const ContractAiFixturesDigest = "sha256:edac31c92e146ca1c40130f2fb5649db82e24b8cd1ac758153b90612052fddb6" as const;
9
- export const ContractGeneratedGoDigest = "sha256:ed380cb87f47db9a9b090d819e0e35d647f1bc653da2c42e5f2382c5240f6245" as const;
10
- export const ContractGeneratedTypeScriptDigest = "sha256:cc27d7e7a3915755581478ac4ec04fb70bf7e6e044eb42d14f3babccaa1ae0c6" as const;
9
+ export const ContractGeneratedGoDigest = "sha256:725161b06837cacb79c92fd28ed00ef96b132a86ac5d5531ee1b3c3ce0fbb905" as const;
10
+ export const ContractGeneratedTypeScriptDigest = "sha256:b6116203eda0c74ae1cb5ebe2ad9c54f0d73759d7eca1b571dd7aab13ee9c3a6" as const;
@@ -24,6 +24,9 @@ export type DeploymentAppRegistration = {
24
24
  * @maxItems 1
25
25
  */
26
26
  signInMethods?: ('phone' | 'email')[];
27
+ /**
28
+ * Temporary rolling-release input for email targets; writers use eventTarget. Remove after old deployments are migrated.
29
+ */
27
30
  mailArrivalTarget?:
28
31
  | {
29
32
  functionArn: string;
@@ -35,6 +38,17 @@ export type DeploymentAppRegistration = {
35
38
  jobs: MailArrivalJobs;
36
39
  gatewayUrl: string;
37
40
  };
41
+ eventTarget?:
42
+ | {
43
+ functionArn: string;
44
+ versionId: string;
45
+ jobs: EventJobs;
46
+ }
47
+ | {
48
+ versionId: string;
49
+ jobs: EventJobs;
50
+ gatewayUrl: string;
51
+ };
38
52
  };
39
53
  /**
40
54
  * @minItems 1
@@ -42,13 +56,36 @@ export type DeploymentAppRegistration = {
42
56
  */
43
57
  export type MailArrivalJobs = {
44
58
  name: string;
45
- trigger: {
46
- type: 'email.arrived';
47
- connection: string;
48
- resource: 'inbox';
49
- filter?: {
50
- from?: string;
51
- subjectContains?: string;
52
- };
53
- };
59
+ trigger: EmailArrivalTrigger;
54
60
  }[];
61
+ /**
62
+ * @minItems 1
63
+ * @maxItems 100
64
+ */
65
+ export type EventJobs = {
66
+ name: string;
67
+ trigger:
68
+ | EmailArrivalTrigger
69
+ | {
70
+ type: 'file.created';
71
+ connection: string;
72
+ resource: string;
73
+ folderId: string;
74
+ driveId?: string;
75
+ /**
76
+ * @minItems 1
77
+ * @maxItems 2
78
+ */
79
+ mimeTypes?: ('application/pdf' | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')[];
80
+ };
81
+ }[];
82
+
83
+ export interface EmailArrivalTrigger {
84
+ type: 'email.arrived';
85
+ connection: string;
86
+ resource: 'inbox';
87
+ filter?: {
88
+ from?: string;
89
+ subjectContains?: string;
90
+ };
91
+ }
@@ -0,0 +1,16 @@
1
+ /* eslint-disable */
2
+ // Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
3
+
4
+ export type FileArrival = {
5
+ type: 'file.created';
6
+ provider: 'drive' | 'sharepoint';
7
+ sourceId: string;
8
+ fileId: string;
9
+ folderId: string;
10
+ driveId?: string;
11
+ name: string;
12
+ mimeType: 'application/pdf' | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
13
+ size: number;
14
+ createdAt: string;
15
+ observedAt: string;
16
+ };
package/gen-ts/index.ts CHANGED
@@ -48,6 +48,7 @@ export * from './error-category-registry.js';
48
48
  export * from './error-category.js';
49
49
  export * from './error-envelope.js';
50
50
  export * from './external-sign-in.js';
51
+ export * from './file-arrival.js';
51
52
  export * from './identity-context.js';
52
53
  export * from './integration-connect-result.js';
53
54
  export * from './integration-error-details.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fourier-labs/harbour-contracts",
3
- "version": "0.95.0",
3
+ "version": "0.96.0",
4
4
  "description": "Single source of truth for every data shape that crosses a boundary between Isomorph components.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -145,6 +145,56 @@
145
145
  }
146
146
  }
147
147
  }
148
+ ],
149
+ "description": "Temporary rolling-release input for email targets; writers use eventTarget. Remove after old deployments are migrated."
150
+ },
151
+ "eventTarget": {
152
+ "oneOf": [
153
+ {
154
+ "type": "object",
155
+ "additionalProperties": false,
156
+ "required": [
157
+ "versionId",
158
+ "jobs",
159
+ "functionArn"
160
+ ],
161
+ "properties": {
162
+ "functionArn": {
163
+ "type": "string",
164
+ "pattern": "^arn:aws:lambda:[a-z0-9-]+:[0-9]{12}:function:[A-Za-z0-9-_]+$"
165
+ },
166
+ "versionId": {
167
+ "type": "string",
168
+ "minLength": 1
169
+ },
170
+ "jobs": {
171
+ "$ref": "#/definitions/eventJobs"
172
+ }
173
+ }
174
+ },
175
+ {
176
+ "type": "object",
177
+ "additionalProperties": false,
178
+ "required": [
179
+ "versionId",
180
+ "jobs",
181
+ "gatewayUrl"
182
+ ],
183
+ "properties": {
184
+ "versionId": {
185
+ "type": "string",
186
+ "minLength": 1
187
+ },
188
+ "jobs": {
189
+ "$ref": "#/definitions/eventJobs"
190
+ },
191
+ "gatewayUrl": {
192
+ "type": "string",
193
+ "format": "uri",
194
+ "pattern": "^https://[^/]+/_harbour/internal/mail-arrival$"
195
+ }
196
+ }
197
+ }
148
198
  ]
149
199
  }
150
200
  },
@@ -178,6 +228,27 @@
178
228
  "workloadPrincipalArn"
179
229
  ]
180
230
  }
231
+ },
232
+ {
233
+ "if": {
234
+ "required": [
235
+ "eventTarget"
236
+ ]
237
+ },
238
+ "then": {
239
+ "required": [
240
+ "environment",
241
+ "workloadPrincipalArn"
242
+ ]
243
+ }
244
+ },
245
+ {
246
+ "not": {
247
+ "required": [
248
+ "eventTarget",
249
+ "mailArrivalTarget"
250
+ ]
251
+ }
181
252
  }
182
253
  ],
183
254
  "definitions": {
@@ -198,40 +269,113 @@
198
269
  "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
199
270
  },
200
271
  "trigger": {
201
- "type": "object",
202
- "additionalProperties": false,
203
- "required": [
204
- "type",
205
- "connection",
206
- "resource"
207
- ],
208
- "properties": {
209
- "type": {
210
- "const": "email.arrived"
211
- },
212
- "connection": {
213
- "type": "string",
214
- "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
215
- },
216
- "resource": {
217
- "const": "inbox"
272
+ "$ref": "#/definitions/emailArrivalTrigger"
273
+ }
274
+ }
275
+ }
276
+ },
277
+ "eventJobs": {
278
+ "type": "array",
279
+ "minItems": 1,
280
+ "maxItems": 100,
281
+ "items": {
282
+ "type": "object",
283
+ "additionalProperties": false,
284
+ "required": [
285
+ "name",
286
+ "trigger"
287
+ ],
288
+ "properties": {
289
+ "name": {
290
+ "type": "string",
291
+ "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
292
+ },
293
+ "trigger": {
294
+ "oneOf": [
295
+ {
296
+ "$ref": "#/definitions/emailArrivalTrigger"
218
297
  },
219
- "filter": {
298
+ {
220
299
  "type": "object",
221
300
  "additionalProperties": false,
301
+ "required": [
302
+ "type",
303
+ "connection",
304
+ "resource",
305
+ "folderId"
306
+ ],
222
307
  "properties": {
223
- "from": {
308
+ "type": {
309
+ "const": "file.created"
310
+ },
311
+ "connection": {
224
312
  "type": "string",
225
- "minLength": 1,
226
- "maxLength": 320
313
+ "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
227
314
  },
228
- "subjectContains": {
315
+ "resource": {
229
316
  "type": "string",
230
317
  "minLength": 1,
231
318
  "maxLength": 320
319
+ },
320
+ "folderId": {
321
+ "type": "string",
322
+ "pattern": "^[A-Za-z0-9!._,=-]{1,256}$"
323
+ },
324
+ "driveId": {
325
+ "type": "string",
326
+ "pattern": "^[A-Za-z0-9!._,=-]{1,256}$"
327
+ },
328
+ "mimeTypes": {
329
+ "type": "array",
330
+ "minItems": 1,
331
+ "maxItems": 2,
332
+ "uniqueItems": true,
333
+ "items": {
334
+ "enum": [
335
+ "application/pdf",
336
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
337
+ ]
338
+ }
232
339
  }
233
340
  }
234
341
  }
342
+ ]
343
+ }
344
+ }
345
+ }
346
+ },
347
+ "emailArrivalTrigger": {
348
+ "type": "object",
349
+ "additionalProperties": false,
350
+ "required": [
351
+ "type",
352
+ "connection",
353
+ "resource"
354
+ ],
355
+ "properties": {
356
+ "type": {
357
+ "const": "email.arrived"
358
+ },
359
+ "connection": {
360
+ "type": "string",
361
+ "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
362
+ },
363
+ "resource": {
364
+ "const": "inbox"
365
+ },
366
+ "filter": {
367
+ "type": "object",
368
+ "additionalProperties": false,
369
+ "properties": {
370
+ "from": {
371
+ "type": "string",
372
+ "minLength": 1,
373
+ "maxLength": 320
374
+ },
375
+ "subjectContains": {
376
+ "type": "string",
377
+ "minLength": 1,
378
+ "maxLength": 320
235
379
  }
236
380
  }
237
381
  }
@@ -0,0 +1,86 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://harbour.dev/schema/file-arrival.schema.json",
4
+ "title": "FileArrival",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "type",
9
+ "provider",
10
+ "sourceId",
11
+ "fileId",
12
+ "folderId",
13
+ "name",
14
+ "mimeType",
15
+ "size",
16
+ "createdAt",
17
+ "observedAt"
18
+ ],
19
+ "properties": {
20
+ "type": {
21
+ "const": "file.created"
22
+ },
23
+ "provider": {
24
+ "enum": [
25
+ "drive",
26
+ "sharepoint"
27
+ ]
28
+ },
29
+ "sourceId": {
30
+ "type": "string",
31
+ "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
32
+ },
33
+ "fileId": {
34
+ "type": "string",
35
+ "pattern": "^[A-Za-z0-9!._,=-]{1,256}$"
36
+ },
37
+ "folderId": {
38
+ "type": "string",
39
+ "pattern": "^[A-Za-z0-9!._,=-]{1,256}$"
40
+ },
41
+ "driveId": {
42
+ "type": "string",
43
+ "pattern": "^[A-Za-z0-9!._,=-]{1,256}$"
44
+ },
45
+ "name": {
46
+ "type": "string",
47
+ "minLength": 1,
48
+ "maxLength": 1024
49
+ },
50
+ "mimeType": {
51
+ "enum": [
52
+ "application/pdf",
53
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
54
+ ]
55
+ },
56
+ "size": {
57
+ "type": "integer",
58
+ "minimum": 0,
59
+ "maximum": 9007199254740991
60
+ },
61
+ "createdAt": {
62
+ "type": "string",
63
+ "format": "date-time"
64
+ },
65
+ "observedAt": {
66
+ "type": "string",
67
+ "format": "date-time"
68
+ }
69
+ },
70
+ "allOf": [
71
+ {
72
+ "if": {
73
+ "properties": {
74
+ "provider": {
75
+ "const": "sharepoint"
76
+ }
77
+ }
78
+ },
79
+ "then": {
80
+ "required": [
81
+ "driveId"
82
+ ]
83
+ }
84
+ }
85
+ ]
86
+ }