@marcoappio/marco-config 4.0.9 → 4.0.11
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 +1215 -1017
- package/dist/appwrite/appwrite.d.ts.map +1 -1
- package/dist/appwrite/appwrite.js +11 -375
- package/dist/appwrite/appwrite.test.js +75 -1
- package/dist/appwrite/commands.d.ts +167 -124
- package/dist/appwrite/commands.d.ts.map +1 -1
- package/dist/appwrite/commands.js +70 -68
- package/dist/appwrite/commands.test.js +30 -17
- package/dist/appwrite/functions.d.ts +122 -122
- package/dist/appwrite/index.d.ts +2 -2
- package/dist/appwrite/index.d.ts.map +1 -1
- package/dist/appwrite/index.js +2 -2
- package/dist/appwrite/tableContract/identity.d.ts +442 -0
- package/dist/appwrite/tableContract/identity.d.ts.map +1 -0
- package/dist/appwrite/tableContract/identity.js +158 -0
- package/dist/appwrite/tableContract/index.d.ts +2194 -0
- package/dist/appwrite/tableContract/index.d.ts.map +1 -0
- package/dist/appwrite/tableContract/index.js +77 -0
- package/dist/appwrite/tableContract/index.test.d.ts +2 -0
- package/dist/appwrite/tableContract/index.test.d.ts.map +1 -0
- package/dist/appwrite/tableContract/index.test.js +48 -0
- package/dist/appwrite/tableContract/mailbox.d.ts +622 -0
- package/dist/appwrite/tableContract/mailbox.d.ts.map +1 -0
- package/dist/appwrite/tableContract/mailbox.js +191 -0
- package/dist/appwrite/tableContract/operational.d.ts +522 -0
- package/dist/appwrite/tableContract/operational.d.ts.map +1 -0
- package/dist/appwrite/tableContract/operational.js +191 -0
- package/dist/appwrite/tableContract/shared.d.ts +145 -0
- package/dist/appwrite/tableContract/shared.d.ts.map +1 -0
- package/dist/appwrite/tableContract/shared.js +89 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -44,39 +44,41 @@ const commandKinds = {
|
|
|
44
44
|
threadSpamSet: 'thread.spam.set',
|
|
45
45
|
threadTrashSet: 'thread.trash.set',
|
|
46
46
|
};
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
commandKinds.
|
|
67
|
-
commandKinds.
|
|
68
|
-
commandKinds.
|
|
69
|
-
commandKinds.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
47
|
+
export const appwriteCommandGroups = {
|
|
48
|
+
account: [
|
|
49
|
+
commandKinds.accountDelete,
|
|
50
|
+
commandKinds.accountSettingsSet,
|
|
51
|
+
commandKinds.aliasCreate,
|
|
52
|
+
commandKinds.aliasDelete,
|
|
53
|
+
commandKinds.aliasNameSet,
|
|
54
|
+
commandKinds.aliasPrimarySet,
|
|
55
|
+
commandKinds.aliasSignatureSet,
|
|
56
|
+
],
|
|
57
|
+
draft: [
|
|
58
|
+
commandKinds.draftAttachmentDelete,
|
|
59
|
+
commandKinds.draftAttachmentLink,
|
|
60
|
+
commandKinds.draftContentSet,
|
|
61
|
+
commandKinds.draftCreate,
|
|
62
|
+
commandKinds.draftDelete,
|
|
63
|
+
commandKinds.draftEnvelopeSet,
|
|
64
|
+
commandKinds.draftFromSet,
|
|
65
|
+
],
|
|
66
|
+
draftSend: [commandKinds.draftSend, commandKinds.draftSendCancel, commandKinds.draftSendSchedule],
|
|
67
|
+
label: [commandKinds.labelCreate, commandKinds.labelDelete, commandKinds.labelRename],
|
|
68
|
+
profileAvatar: [commandKinds.profileAvatarSet],
|
|
69
|
+
profileSettings: [commandKinds.profileSettingsSet],
|
|
70
|
+
thread: [
|
|
71
|
+
commandKinds.threadArchiveSet,
|
|
72
|
+
commandKinds.threadDelete,
|
|
73
|
+
commandKinds.threadFlaggedSet,
|
|
74
|
+
commandKinds.threadLabelAdd,
|
|
75
|
+
commandKinds.threadLabelRemove,
|
|
76
|
+
commandKinds.threadSeenSet,
|
|
77
|
+
commandKinds.threadSnoozeSet,
|
|
78
|
+
commandKinds.threadSpamSet,
|
|
79
|
+
commandKinds.threadTrashSet,
|
|
80
|
+
],
|
|
81
|
+
};
|
|
80
82
|
const commandStates = ['ACCEPTED', 'RUNNING', 'SUCCEEDED', 'FAILED'];
|
|
81
83
|
const commandErrorCodes = [
|
|
82
84
|
'AUTHENTICATION_FAILED',
|
|
@@ -176,39 +178,39 @@ const draftAttachmentDeletePayloadSchema = v.strictObject({
|
|
|
176
178
|
const draftSendPayloadSchema = v.strictObject({ draftId: id.draftId.required() });
|
|
177
179
|
const draftSendCancelPayloadSchema = v.strictObject({ draftId: id.draftId.required() });
|
|
178
180
|
const draftSendSchedulePayloadSchema = v.strictObject({ draftId: id.draftId.required(), scheduledAt: timestampSchema });
|
|
179
|
-
const commandRequestSchemas =
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
183
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
184
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
185
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
186
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
187
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
188
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
189
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
190
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
191
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
192
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
193
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
194
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
195
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
196
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
197
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
198
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
199
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
203
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
204
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
205
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
206
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
207
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
208
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
209
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
210
|
-
createAccountCommandRequestSchema(commandKinds.
|
|
211
|
-
|
|
181
|
+
const commandRequestSchemas = {
|
|
182
|
+
[commandKinds.accountDelete]: createAccountCommandRequestSchema(commandKinds.accountDelete, accountDeletePayloadSchema),
|
|
183
|
+
[commandKinds.accountSettingsSet]: createAccountCommandRequestSchema(commandKinds.accountSettingsSet, accountSettingsSetPayloadSchema),
|
|
184
|
+
[commandKinds.aliasCreate]: createAccountCommandRequestSchema(commandKinds.aliasCreate, aliasCreatePayloadSchema),
|
|
185
|
+
[commandKinds.aliasDelete]: createAccountCommandRequestSchema(commandKinds.aliasDelete, aliasDeletePayloadSchema),
|
|
186
|
+
[commandKinds.aliasNameSet]: createAccountCommandRequestSchema(commandKinds.aliasNameSet, aliasNameSetPayloadSchema),
|
|
187
|
+
[commandKinds.aliasPrimarySet]: createAccountCommandRequestSchema(commandKinds.aliasPrimarySet, aliasPrimarySetPayloadSchema),
|
|
188
|
+
[commandKinds.aliasSignatureSet]: createAccountCommandRequestSchema(commandKinds.aliasSignatureSet, aliasSignatureSetPayloadSchema),
|
|
189
|
+
[commandKinds.draftAttachmentDelete]: createAccountCommandRequestSchema(commandKinds.draftAttachmentDelete, draftAttachmentDeletePayloadSchema),
|
|
190
|
+
[commandKinds.draftAttachmentLink]: createAccountCommandRequestSchema(commandKinds.draftAttachmentLink, draftAttachmentLinkPayloadSchema),
|
|
191
|
+
[commandKinds.draftContentSet]: createAccountCommandRequestSchema(commandKinds.draftContentSet, draftContentSetPayloadSchema),
|
|
192
|
+
[commandKinds.draftCreate]: createAccountCommandRequestSchema(commandKinds.draftCreate, draftCreatePayloadSchema),
|
|
193
|
+
[commandKinds.draftDelete]: createAccountCommandRequestSchema(commandKinds.draftDelete, draftDeletePayloadSchema),
|
|
194
|
+
[commandKinds.draftEnvelopeSet]: createAccountCommandRequestSchema(commandKinds.draftEnvelopeSet, draftEnvelopeSetPayloadSchema),
|
|
195
|
+
[commandKinds.draftFromSet]: createAccountCommandRequestSchema(commandKinds.draftFromSet, draftFromSetPayloadSchema),
|
|
196
|
+
[commandKinds.draftSend]: createAccountCommandRequestSchema(commandKinds.draftSend, draftSendPayloadSchema),
|
|
197
|
+
[commandKinds.draftSendCancel]: createAccountCommandRequestSchema(commandKinds.draftSendCancel, draftSendCancelPayloadSchema),
|
|
198
|
+
[commandKinds.draftSendSchedule]: createAccountCommandRequestSchema(commandKinds.draftSendSchedule, draftSendSchedulePayloadSchema),
|
|
199
|
+
[commandKinds.labelCreate]: createAccountCommandRequestSchema(commandKinds.labelCreate, labelCreatePayloadSchema),
|
|
200
|
+
[commandKinds.labelDelete]: createAccountCommandRequestSchema(commandKinds.labelDelete, labelDeletePayloadSchema),
|
|
201
|
+
[commandKinds.labelRename]: createAccountCommandRequestSchema(commandKinds.labelRename, labelRenamePayloadSchema),
|
|
202
|
+
[commandKinds.profileAvatarSet]: createCommandRequestSchema(commandKinds.profileAvatarSet, profileAvatarSetPayloadSchema, v.nullable(accountIdSchema)),
|
|
203
|
+
[commandKinds.profileSettingsSet]: createCommandRequestSchema(commandKinds.profileSettingsSet, profileSettingsSetPayloadSchema, v.nullable(accountIdSchema)),
|
|
204
|
+
[commandKinds.threadArchiveSet]: createAccountCommandRequestSchema(commandKinds.threadArchiveSet, threadArchiveSetPayloadSchema),
|
|
205
|
+
[commandKinds.threadDelete]: createAccountCommandRequestSchema(commandKinds.threadDelete, threadDeletePayloadSchema),
|
|
206
|
+
[commandKinds.threadFlaggedSet]: createAccountCommandRequestSchema(commandKinds.threadFlaggedSet, threadFlaggedSetPayloadSchema),
|
|
207
|
+
[commandKinds.threadLabelAdd]: createAccountCommandRequestSchema(commandKinds.threadLabelAdd, threadLabelAddPayloadSchema),
|
|
208
|
+
[commandKinds.threadLabelRemove]: createAccountCommandRequestSchema(commandKinds.threadLabelRemove, threadLabelRemovePayloadSchema),
|
|
209
|
+
[commandKinds.threadSeenSet]: createAccountCommandRequestSchema(commandKinds.threadSeenSet, threadSeenSetPayloadSchema),
|
|
210
|
+
[commandKinds.threadSnoozeSet]: createAccountCommandRequestSchema(commandKinds.threadSnoozeSet, threadSnoozeSetPayloadSchema),
|
|
211
|
+
[commandKinds.threadSpamSet]: createAccountCommandRequestSchema(commandKinds.threadSpamSet, threadSpamSetPayloadSchema),
|
|
212
|
+
[commandKinds.threadTrashSet]: createAccountCommandRequestSchema(commandKinds.threadTrashSet, threadTrashSetPayloadSchema),
|
|
213
|
+
};
|
|
212
214
|
const commandErrorSchema = v.strictObject({
|
|
213
215
|
code: v.picklist(commandErrorCodes),
|
|
214
216
|
retryable: v.boolean(),
|
|
@@ -243,8 +245,8 @@ export const appwriteCommands = {
|
|
|
243
245
|
errorCodes: commandErrorCodes,
|
|
244
246
|
errorSchema: commandErrorSchema,
|
|
245
247
|
idSchema: commandIdSchema,
|
|
246
|
-
kinds:
|
|
247
|
-
requestSchema: v.variant('kind', commandRequestSchemas),
|
|
248
|
+
kinds: Object.values(appwriteCommandGroups).flat(),
|
|
249
|
+
requestSchema: v.variant('kind', Object.values(commandRequestSchemas)),
|
|
248
250
|
responseSchema: v.variant('state', commandResponseSchemas),
|
|
249
251
|
states: commandStates,
|
|
250
252
|
threadCommandBatchSize: appwriteThreadCommandBatchSize,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { describe, expect, it } from 'bun:test';
|
|
2
2
|
import * as v from 'valibot';
|
|
3
|
-
import {
|
|
3
|
+
import { appwriteCommandGroups as rootCommandGroups } from '../index';
|
|
4
|
+
import { appwriteAvatar, appwriteCommandGroups, appwriteCommands } from './commands';
|
|
5
|
+
import { appwriteCommandGroups as appwriteIndexCommandGroups } from './index';
|
|
4
6
|
const commandMetadata = {
|
|
5
7
|
id: '0197f3d4-1b22-7abc-8def-123456789abc',
|
|
6
8
|
submittedAt: '2026-07-15T00:00:00.000Z',
|
|
@@ -246,37 +248,37 @@ describe('appwriteCommands', () => {
|
|
|
246
248
|
it('publishes the complete version-one command and status manifest', () => {
|
|
247
249
|
expect(appwriteCommands.version).toBe(1);
|
|
248
250
|
expect(appwriteCommands.kinds).toEqual([
|
|
249
|
-
'profile.settings.set',
|
|
250
|
-
'profile.avatar.set',
|
|
251
|
-
'account.settings.set',
|
|
252
251
|
'account.delete',
|
|
252
|
+
'account.settings.set',
|
|
253
253
|
'alias.create',
|
|
254
254
|
'alias.delete',
|
|
255
255
|
'alias.name.set',
|
|
256
256
|
'alias.primary.set',
|
|
257
257
|
'alias.signature.set',
|
|
258
|
+
'draft.attachment.delete',
|
|
259
|
+
'draft.attachment.link',
|
|
260
|
+
'draft.content.set',
|
|
261
|
+
'draft.create',
|
|
262
|
+
'draft.delete',
|
|
263
|
+
'draft.envelope.set',
|
|
264
|
+
'draft.from.set',
|
|
265
|
+
'draft.send',
|
|
266
|
+
'draft.send.cancel',
|
|
267
|
+
'draft.send.schedule',
|
|
258
268
|
'label.create',
|
|
259
269
|
'label.delete',
|
|
260
270
|
'label.rename',
|
|
261
|
-
'
|
|
262
|
-
'
|
|
271
|
+
'profile.avatar.set',
|
|
272
|
+
'profile.settings.set',
|
|
263
273
|
'thread.archive.set',
|
|
274
|
+
'thread.delete',
|
|
264
275
|
'thread.flagged.set',
|
|
276
|
+
'thread.label.add',
|
|
277
|
+
'thread.label.remove',
|
|
265
278
|
'thread.seen.set',
|
|
266
279
|
'thread.snooze.set',
|
|
267
280
|
'thread.spam.set',
|
|
268
281
|
'thread.trash.set',
|
|
269
|
-
'thread.delete',
|
|
270
|
-
'draft.create',
|
|
271
|
-
'draft.content.set',
|
|
272
|
-
'draft.envelope.set',
|
|
273
|
-
'draft.from.set',
|
|
274
|
-
'draft.delete',
|
|
275
|
-
'draft.attachment.link',
|
|
276
|
-
'draft.attachment.delete',
|
|
277
|
-
'draft.send',
|
|
278
|
-
'draft.send.cancel',
|
|
279
|
-
'draft.send.schedule',
|
|
280
282
|
]);
|
|
281
283
|
expect(appwriteCommands.states).toEqual(['ACCEPTED', 'RUNNING', 'SUCCEEDED', 'FAILED']);
|
|
282
284
|
expect(appwriteCommands.errorCodes).toEqual([
|
|
@@ -290,6 +292,17 @@ describe('appwriteCommands', () => {
|
|
|
290
292
|
'INTERNAL_ERROR',
|
|
291
293
|
]);
|
|
292
294
|
});
|
|
295
|
+
it('publishes exhaustive command groups and exports them from both package entrypoints', () => {
|
|
296
|
+
const groupedKinds = Object.values(appwriteCommandGroups).flat();
|
|
297
|
+
const fixtureKinds = commandFixtures.map(({ command }) => command.kind);
|
|
298
|
+
expect(Object.keys(appwriteCommandGroups)).toEqual(['account', 'draft', 'draftSend', 'label', 'profileAvatar', 'profileSettings', 'thread']);
|
|
299
|
+
expect(groupedKinds).toHaveLength(31);
|
|
300
|
+
expect(new Set(groupedKinds).size).toBe(31);
|
|
301
|
+
expect(groupedKinds).toEqual([...appwriteCommands.kinds]);
|
|
302
|
+
expect(Array.from(new Set(fixtureKinds)).sort()).toEqual(Array.from(new Set(appwriteCommands.kinds)).sort());
|
|
303
|
+
expect(appwriteIndexCommandGroups).toBe(appwriteCommandGroups);
|
|
304
|
+
expect(rootCommandGroups).toBe(appwriteCommandGroups);
|
|
305
|
+
});
|
|
293
306
|
it('derives a command-scoped avatar file ID within Appwrite limits', () => {
|
|
294
307
|
expect(appwriteAvatar.createFileId(commandMetadata.id)).toBe(commandMetadata.id);
|
|
295
308
|
expect(appwriteAvatar.createFileId('0197f3d4-1b22-7abc-8def-123456789abd')).not.toBe(appwriteAvatar.createFileId(commandMetadata.id));
|