@marcoappio/marco-config 4.0.13 → 4.0.15
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/appwrite/appwrite.d.ts +5 -18
- package/dist/appwrite/appwrite.d.ts.map +1 -1
- package/dist/appwrite/appwrite.js +3 -15
- package/dist/appwrite/appwrite.test.js +24 -0
- package/dist/appwrite/commands.d.ts +4964 -274
- package/dist/appwrite/commands.d.ts.map +1 -1
- package/dist/appwrite/commands.js +76 -120
- package/dist/appwrite/commands.test.js +68 -1
- package/dist/appwrite/decodedSchemas.d.ts +35 -0
- package/dist/appwrite/decodedSchemas.d.ts.map +1 -0
- package/dist/appwrite/decodedSchemas.js +18 -0
- package/dist/appwrite/functions.d.ts +2434 -233
- package/dist/appwrite/functions.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
import type { ReadonlyDeep } from 'type-fest';
|
|
2
2
|
import * as v from 'valibot';
|
|
3
3
|
export { appwriteRowIdSchema, appwriteTableIdSchema, appwriteTableIds, type AppwriteDataRow, type AppwriteRow, type AppwriteRowTable } from './tableContract';
|
|
4
|
+
export type { AppwriteDraftAttachment, AppwriteDraftEnvelope } from './decodedSchemas';
|
|
4
5
|
export type { AppwriteMailboxSyncLane, AppwriteMailboxSyncLaneState, AppwriteMailboxSyncState, AppwritePollShardState, AppwriteTableId } from './tableContract';
|
|
5
6
|
export { type AppwriteColumnDefinition, type AppwriteColumnSchema, type AppwriteColumnType, type AppwriteIndexDefinition, type AppwriteIndexType, type AppwriteRelationshipDefinition, type AppwriteRelationshipOnDelete, type AppwriteRelationshipSchema, type AppwriteRelationshipType, type AppwriteTableDefinition, type AppwriteTableInput, type AppwriteTableKey, appwriteDataSchemas, appwriteRowSchemas, appwriteTableContract, appwriteTables, defineAppwriteTables, } from './tableContract';
|
|
6
7
|
export { accountProviders, accountStates, appwriteRelationshipIdSchema, commandStates, draftStates, draftTypes, jobStates, labelSpecialUses, mailboxSyncLaneStates, mailboxSyncLanes, mailboxSyncProvisionedStates, mailboxSyncStates, oauthOperations, oauthProviders, oauthReturnUris, oauthReturnUriSchema, pollShardStates, } from './tableContract';
|
|
7
|
-
declare const draftAttachmentSchema: v.StrictObjectSchema<{
|
|
8
|
-
readonly fileId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>;
|
|
9
|
-
readonly fileName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
10
|
-
readonly mimeType: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 3, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
11
|
-
readonly size: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
12
|
-
}, undefined>;
|
|
13
|
-
declare const draftEnvelopeSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.ParseJsonAction<string, undefined, undefined>, v.StrictObjectSchema<{
|
|
14
|
-
readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
15
|
-
readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
16
|
-
readonly subject: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
17
|
-
readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, v.MaxLengthAction<string, 320, undefined>]>, undefined>, undefined>;
|
|
18
|
-
}, undefined>]>;
|
|
19
8
|
declare const messageAttachmentSchema: v.LooseObjectSchema<{
|
|
20
9
|
readonly fileId: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, undefined>]>, undefined>, undefined>;
|
|
21
10
|
readonly isAttachment: v.BooleanSchema<undefined>;
|
|
@@ -29,8 +18,6 @@ declare const messageRecipientSchema: v.StrictObjectSchema<{
|
|
|
29
18
|
readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
|
|
30
19
|
readonly type: v.PicklistSchema<readonly ["bcc", "cc", "to", "replyTo"], undefined>;
|
|
31
20
|
}, undefined>;
|
|
32
|
-
export type AppwriteDraftAttachment = ReadonlyDeep<v.InferOutput<typeof draftAttachmentSchema>>;
|
|
33
|
-
export type AppwriteDraftEnvelope = ReadonlyDeep<v.InferOutput<typeof draftEnvelopeSchema>>;
|
|
34
21
|
export type AppwriteMessageAttachment = ReadonlyDeep<v.InferOutput<typeof messageAttachmentSchema>>;
|
|
35
22
|
export type AppwriteMessageRecipient = ReadonlyDeep<v.InferOutput<typeof messageRecipientSchema>>;
|
|
36
23
|
declare const appwriteEnvironments: readonly ['development', 'production', 'staging'];
|
|
@@ -597,10 +584,10 @@ export declare const appwrite: {
|
|
|
597
584
|
readonly size: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
598
585
|
}, undefined>, undefined>]>;
|
|
599
586
|
readonly draftEnvelope: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.ParseJsonAction<string, undefined, undefined>, v.StrictObjectSchema<{
|
|
600
|
-
readonly bcc: v.ArraySchema<v.
|
|
601
|
-
readonly cc: v.ArraySchema<v.
|
|
602
|
-
readonly subject: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
603
|
-
readonly to: v.ArraySchema<v.
|
|
587
|
+
readonly bcc: v.ArraySchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
588
|
+
readonly cc: v.ArraySchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
589
|
+
readonly subject: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 998, undefined>]>, undefined>;
|
|
590
|
+
readonly to: v.ArraySchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, v.MaxLengthAction<string, 320, undefined>]>, undefined>;
|
|
604
591
|
}, undefined>]>;
|
|
605
592
|
readonly jobPayload: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.ParseJsonAction<string, undefined, undefined>, v.CheckAction<unknown, undefined>, v.LooseObjectSchema<{}, undefined>]>;
|
|
606
593
|
readonly messageAttachments: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.ParseJsonAction<string, undefined, undefined>, v.ArraySchema<v.LooseObjectSchema<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appwrite.d.ts","sourceRoot":"","sources":["../../src/appwrite/appwrite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"appwrite.d.ts","sourceRoot":"","sources":["../../src/appwrite/appwrite.ts"],"names":[],"mappings":"AA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDT,CAAA"}
|
|
@@ -1,23 +1,11 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
2
|
import { string } from '../schemas/string';
|
|
3
3
|
import { MESSAGE_RECIPIENT_TYPES } from '../types';
|
|
4
|
+
import { persistedDraftAttachmentsSchema, persistedDraftEnvelopeSchema } from './decodedSchemas';
|
|
4
5
|
import { appwriteDataSchemas, appwriteIds, appwriteRowSchemas as generatedRowSchemas, appwriteRowIdSchema, appwriteTables, mailboxSyncLaneStates, mailboxSyncLanes, mailboxSyncStates, oauthOperations, oauthProviders, oauthReturnUris, oauthReturnUriSchema, pollShardStates, jsonObjectTextSchema, nonNegativeIntegerSchema, identifierSchema, } from './tableContract';
|
|
5
6
|
export { appwriteRowIdSchema, appwriteTableIdSchema, appwriteTableIds } from './tableContract';
|
|
6
7
|
export { appwriteDataSchemas, appwriteRowSchemas, appwriteTableContract, appwriteTables, defineAppwriteTables, } from './tableContract';
|
|
7
8
|
export { accountProviders, accountStates, appwriteRelationshipIdSchema, commandStates, draftStates, draftTypes, jobStates, labelSpecialUses, mailboxSyncLaneStates, mailboxSyncLanes, mailboxSyncProvisionedStates, mailboxSyncStates, oauthOperations, oauthProviders, oauthReturnUris, oauthReturnUriSchema, pollShardStates, } from './tableContract';
|
|
8
|
-
const draftAttachmentSchema = v.strictObject({
|
|
9
|
-
fileId: appwriteRowIdSchema,
|
|
10
|
-
fileName: v.pipe(v.string(), v.minLength(1), v.maxLength(255)),
|
|
11
|
-
mimeType: v.pipe(v.string(), v.minLength(3), v.maxLength(255)),
|
|
12
|
-
size: nonNegativeIntegerSchema,
|
|
13
|
-
});
|
|
14
|
-
const draftAttachmentsSchema = v.pipe(v.string(), v.parseJson(), v.array(draftAttachmentSchema));
|
|
15
|
-
const draftEnvelopeSchema = v.pipe(v.string(), v.parseJson(), v.strictObject({
|
|
16
|
-
bcc: v.array(string.mailboxAddress()),
|
|
17
|
-
cc: v.array(string.mailboxAddress()),
|
|
18
|
-
subject: v.nullable(v.string()),
|
|
19
|
-
to: v.array(string.mailboxAddress()),
|
|
20
|
-
}));
|
|
21
9
|
const messageAttachmentSchema = v.looseObject({
|
|
22
10
|
fileId: v.optional(v.nullable(appwriteRowIdSchema)),
|
|
23
11
|
isAttachment: v.boolean(),
|
|
@@ -67,8 +55,8 @@ export const appwrite = {
|
|
|
67
55
|
dataSchemas: appwriteDataSchemas,
|
|
68
56
|
decodedSchemas: {
|
|
69
57
|
commandPayload: jsonObjectTextSchema,
|
|
70
|
-
draftAttachments:
|
|
71
|
-
draftEnvelope:
|
|
58
|
+
draftAttachments: persistedDraftAttachmentsSchema,
|
|
59
|
+
draftEnvelope: persistedDraftEnvelopeSchema,
|
|
72
60
|
jobPayload: jsonObjectTextSchema,
|
|
73
61
|
messageAttachments: messageAttachmentsSchema,
|
|
74
62
|
messageRecipients: messageRecipientsSchema,
|
|
@@ -1106,4 +1106,28 @@ describe('appwrite', () => {
|
|
|
1106
1106
|
expect(v.safeParse(testCase.schema, '{').success).toBe(false);
|
|
1107
1107
|
});
|
|
1108
1108
|
}
|
|
1109
|
+
it('keeps persisted draft envelope constraints strict and bounded', () => {
|
|
1110
|
+
const envelope = { bcc: ['sender@example'], cc: [], subject: 'a'.repeat(998), to: ['recipient@example.com'] };
|
|
1111
|
+
expect(v.safeParse(appwrite.decodedSchemas.draftEnvelope, JSON.stringify(envelope)).success).toBe(true);
|
|
1112
|
+
for (const invalidEnvelope of [
|
|
1113
|
+
{ ...envelope, subject: 'a'.repeat(999) },
|
|
1114
|
+
{ ...envelope, to: ['not-an-address'] },
|
|
1115
|
+
{ ...envelope, unexpected: true },
|
|
1116
|
+
]) {
|
|
1117
|
+
expect(v.safeParse(appwrite.decodedSchemas.draftEnvelope, JSON.stringify(invalidEnvelope)).success).toBe(false);
|
|
1118
|
+
}
|
|
1119
|
+
});
|
|
1120
|
+
it('keeps persisted draft attachment constraints strict and bounded', () => {
|
|
1121
|
+
const attachment = { fileId: 'test-file-id-1', fileName: 'proposal.pdf', mimeType: 'application/pdf', size: 0 };
|
|
1122
|
+
expect(v.safeParse(appwrite.decodedSchemas.draftAttachments, JSON.stringify([attachment])).success).toBe(true);
|
|
1123
|
+
for (const invalidAttachment of [
|
|
1124
|
+
{ ...attachment, fileId: '-invalid' },
|
|
1125
|
+
{ ...attachment, fileName: 'a'.repeat(256) },
|
|
1126
|
+
{ ...attachment, mimeType: 'x' },
|
|
1127
|
+
{ ...attachment, size: -1 },
|
|
1128
|
+
{ ...attachment, unexpected: true },
|
|
1129
|
+
]) {
|
|
1130
|
+
expect(v.safeParse(appwrite.decodedSchemas.draftAttachments, JSON.stringify([invalidAttachment])).success).toBe(false);
|
|
1131
|
+
}
|
|
1132
|
+
});
|
|
1109
1133
|
});
|