@marcoappio/marco-config 4.0.26 → 5.0.1
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/constants/api.d.ts +9 -0
- package/dist/constants/api.d.ts.map +1 -0
- package/dist/constants/api.js +8 -0
- package/dist/constants/emailAccounts.d.ts.map +1 -1
- package/dist/constants/emailAccounts.js +14 -1
- package/dist/constants/emailProvider.js +1 -1
- package/dist/constants/index.d.ts +11 -3
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +7 -5
- package/dist/constants/messages.d.ts.map +1 -1
- package/dist/constants/oauth.d.ts +2 -2
- package/dist/constants/oauth.d.ts.map +1 -1
- package/dist/constants/oauth.js +5 -1
- package/dist/constants/user.d.ts +1 -1
- package/dist/constants/user.d.ts.map +1 -1
- package/dist/constants/user.js +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -5
- package/dist/marcoPublicConfig.d.ts +48 -0
- package/dist/marcoPublicConfig.d.ts.map +1 -0
- package/dist/marcoPublicConfig.js +132 -0
- package/dist/schemas/app.d.ts +2 -2
- package/dist/schemas/app.d.ts.map +1 -1
- package/dist/schemas/app.js +3 -3
- package/dist/schemas/auth.d.ts +1 -1
- package/dist/schemas/auth.d.ts.map +1 -1
- package/dist/schemas/auth.js +2 -2
- package/dist/schemas/boolean.d.ts +5 -0
- package/dist/schemas/boolean.d.ts.map +1 -0
- package/dist/schemas/boolean.js +4 -0
- package/dist/schemas/emailAccount.d.ts +10 -10
- package/dist/schemas/emailAccount.d.ts.map +1 -1
- package/dist/schemas/emailAccount.js +13 -13
- package/dist/schemas/id.d.ts +1 -6
- package/dist/schemas/id.d.ts.map +1 -1
- package/dist/schemas/id.js +1 -2
- package/dist/schemas/index.d.ts +512 -60
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +23 -9
- package/dist/schemas/labels.d.ts +5 -0
- package/dist/schemas/labels.d.ts.map +1 -0
- package/dist/schemas/labels.js +5 -0
- package/dist/schemas/models/account.d.ts +3 -3
- package/dist/schemas/models/account.d.ts.map +1 -1
- package/dist/schemas/models/account.js +8 -8
- package/dist/schemas/models/contact.d.ts +2 -2
- package/dist/schemas/models/contact.d.ts.map +1 -1
- package/dist/schemas/models/contact.js +4 -4
- package/dist/schemas/models/draft.d.ts +9 -9
- package/dist/schemas/models/draft.d.ts.map +1 -1
- package/dist/schemas/models/draft.js +9 -9
- package/dist/schemas/models/index.d.ts +5 -5
- package/dist/schemas/models/index.d.ts.map +1 -1
- package/dist/schemas/models/index.js +5 -5
- package/dist/schemas/models/thread.d.ts +46 -28
- package/dist/schemas/models/thread.d.ts.map +1 -1
- package/dist/schemas/models/thread.js +12 -11
- package/dist/schemas/models/user.d.ts +71 -3
- package/dist/schemas/models/user.d.ts.map +1 -1
- package/dist/schemas/models/user.js +24 -5
- package/dist/schemas/mutators/index.d.ts +2 -0
- package/dist/schemas/mutators/index.d.ts.map +1 -0
- package/dist/schemas/mutators/index.js +1 -0
- package/dist/schemas/mutators/mutatorSchemas.d.ts +314 -0
- package/dist/schemas/mutators/mutatorSchemas.d.ts.map +1 -0
- package/dist/schemas/mutators/mutatorSchemas.js +229 -0
- package/dist/schemas/mutators/mutatorSchemas.test.d.ts +2 -0
- package/dist/schemas/mutators/mutatorSchemas.test.d.ts.map +1 -0
- package/dist/schemas/mutators/mutatorSchemas.test.js +39 -0
- package/dist/schemas/number.d.ts +5 -3
- package/dist/schemas/number.d.ts.map +1 -1
- package/dist/schemas/number.js +5 -4
- package/dist/schemas/oauth.d.ts +2 -2
- package/dist/schemas/oauth.d.ts.map +1 -1
- package/dist/schemas/oauth.js +3 -3
- package/dist/schemas/paginatedResponse.d.ts +10 -0
- package/dist/schemas/paginatedResponse.d.ts.map +1 -0
- package/dist/schemas/paginatedResponse.js +5 -0
- package/dist/schemas/pushNotifications.d.ts +3 -3
- package/dist/schemas/pushNotifications.d.ts.map +1 -1
- package/dist/schemas/pushNotifications.js +4 -3
- package/dist/schemas/string.d.ts +4 -2
- package/dist/schemas/string.d.ts.map +1 -1
- package/dist/schemas/string.js +5 -4
- package/dist/schemas/stripe.d.ts +43 -0
- package/dist/schemas/stripe.d.ts.map +1 -0
- package/dist/schemas/stripe.js +48 -0
- package/dist/schemas/websocket.d.ts +14 -0
- package/dist/schemas/websocket.d.ts.map +1 -0
- package/dist/schemas/websocket.js +10 -0
- package/dist/sdk/endpoints/createEndpointConfig.d.ts +12 -0
- package/dist/sdk/endpoints/createEndpointConfig.d.ts.map +1 -0
- package/dist/sdk/endpoints/createEndpointConfig.js +21 -0
- package/dist/sdk/endpoints/index.d.ts +308 -0
- package/dist/sdk/endpoints/index.d.ts.map +1 -0
- package/dist/sdk/endpoints/index.js +6 -0
- package/dist/sdk/endpoints/private/draftAttachment/index.d.ts +31 -0
- package/dist/sdk/endpoints/private/draftAttachment/index.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/draftAttachment/index.js +4 -0
- package/dist/sdk/endpoints/private/draftAttachment/uploadDraftAttachment.d.ts +30 -0
- package/dist/sdk/endpoints/private/draftAttachment/uploadDraftAttachment.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/draftAttachment/uploadDraftAttachment.js +18 -0
- package/dist/sdk/endpoints/private/emailMessage/getEmailMessageAttachment.d.ts +21 -0
- package/dist/sdk/endpoints/private/emailMessage/getEmailMessageAttachment.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/emailMessage/getEmailMessageAttachment.js +16 -0
- package/dist/sdk/endpoints/private/emailMessage/index.d.ts +22 -0
- package/dist/sdk/endpoints/private/emailMessage/index.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/emailMessage/index.js +4 -0
- package/dist/sdk/endpoints/private/index.d.ts +156 -0
- package/dist/sdk/endpoints/private/index.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/index.js +12 -0
- package/dist/sdk/endpoints/private/models/account/getAccounts.d.ts +70 -0
- package/dist/sdk/endpoints/private/models/account/getAccounts.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/models/account/getAccounts.js +26 -0
- package/dist/sdk/endpoints/private/models/account/index.d.ts +2 -0
- package/dist/sdk/endpoints/private/models/account/index.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/models/account/index.js +1 -0
- package/dist/sdk/endpoints/private/models/contact/getContacts.d.ts +41 -0
- package/dist/sdk/endpoints/private/models/contact/getContacts.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/models/contact/getContacts.js +26 -0
- package/dist/sdk/endpoints/private/models/contact/index.d.ts +2 -0
- package/dist/sdk/endpoints/private/models/contact/index.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/models/contact/index.js +1 -0
- package/dist/sdk/endpoints/private/models/draft/getDrafts.d.ts +62 -0
- package/dist/sdk/endpoints/private/models/draft/getDrafts.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/models/draft/getDrafts.js +25 -0
- package/dist/sdk/endpoints/private/models/draft/index.d.ts +2 -0
- package/dist/sdk/endpoints/private/models/draft/index.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/models/draft/index.js +1 -0
- package/dist/sdk/endpoints/private/models/index.d.ts +13 -0
- package/dist/sdk/endpoints/private/models/index.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/models/index.js +12 -0
- package/dist/sdk/endpoints/private/models/thread/getThread.d.ts +63 -0
- package/dist/sdk/endpoints/private/models/thread/getThread.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/models/thread/getThread.js +17 -0
- package/dist/sdk/endpoints/private/models/thread/getThreadByMessageId.d.ts +63 -0
- package/dist/sdk/endpoints/private/models/thread/getThreadByMessageId.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/models/thread/getThreadByMessageId.js +17 -0
- package/dist/sdk/endpoints/private/models/thread/getThreadList.d.ts +79 -0
- package/dist/sdk/endpoints/private/models/thread/getThreadList.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/models/thread/getThreadList.js +47 -0
- package/dist/sdk/endpoints/private/models/thread/getThreads.d.ts +83 -0
- package/dist/sdk/endpoints/private/models/thread/getThreads.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/models/thread/getThreads.js +36 -0
- package/dist/sdk/endpoints/private/models/thread/index.d.ts +5 -0
- package/dist/sdk/endpoints/private/models/thread/index.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/models/thread/index.js +4 -0
- package/dist/sdk/endpoints/private/models/user/getUser.d.ts +75 -0
- package/dist/sdk/endpoints/private/models/user/getUser.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/models/user/getUser.js +16 -0
- package/dist/sdk/endpoints/private/models/user/index.d.ts +2 -0
- package/dist/sdk/endpoints/private/models/user/index.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/models/user/index.js +1 -0
- package/dist/sdk/endpoints/private/mutations/account/createAccount.d.ts +35 -0
- package/dist/sdk/endpoints/private/mutations/account/createAccount.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/account/createAccount.js +18 -0
- package/dist/sdk/endpoints/private/mutations/account/createAlias.d.ts +42 -0
- package/dist/sdk/endpoints/private/mutations/account/createAlias.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/account/createAlias.js +19 -0
- package/dist/sdk/endpoints/private/mutations/account/createLabel.d.ts +44 -0
- package/dist/sdk/endpoints/private/mutations/account/createLabel.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/account/createLabel.js +20 -0
- package/dist/sdk/endpoints/private/mutations/account/deleteAccount.d.ts +27 -0
- package/dist/sdk/endpoints/private/mutations/account/deleteAccount.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/account/deleteAccount.js +18 -0
- package/dist/sdk/endpoints/private/mutations/account/deleteAlias.d.ts +33 -0
- package/dist/sdk/endpoints/private/mutations/account/deleteAlias.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/account/deleteAlias.js +19 -0
- package/dist/sdk/endpoints/private/mutations/account/deleteLabel.d.ts +43 -0
- package/dist/sdk/endpoints/private/mutations/account/deleteLabel.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/account/deleteLabel.js +20 -0
- package/dist/sdk/endpoints/private/mutations/account/index.d.ts +14 -0
- package/dist/sdk/endpoints/private/mutations/account/index.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/account/index.js +13 -0
- package/dist/sdk/endpoints/private/mutations/account/renameLabel.d.ts +49 -0
- package/dist/sdk/endpoints/private/mutations/account/renameLabel.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/account/renameLabel.js +21 -0
- package/dist/sdk/endpoints/private/mutations/account/setAliasName.d.ts +44 -0
- package/dist/sdk/endpoints/private/mutations/account/setAliasName.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/account/setAliasName.js +20 -0
- package/dist/sdk/endpoints/private/mutations/account/setAliasPrimary.d.ts +33 -0
- package/dist/sdk/endpoints/private/mutations/account/setAliasPrimary.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/account/setAliasPrimary.js +19 -0
- package/dist/sdk/endpoints/private/mutations/account/setAliasSignature.d.ts +44 -0
- package/dist/sdk/endpoints/private/mutations/account/setAliasSignature.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/account/setAliasSignature.js +20 -0
- package/dist/sdk/endpoints/private/mutations/account/setConnectionConfigImap.d.ts +49 -0
- package/dist/sdk/endpoints/private/mutations/account/setConnectionConfigImap.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/account/setConnectionConfigImap.js +19 -0
- package/dist/sdk/endpoints/private/mutations/account/setConnectionConfigOauth.d.ts +42 -0
- package/dist/sdk/endpoints/private/mutations/account/setConnectionConfigOauth.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/account/setConnectionConfigOauth.js +19 -0
- package/dist/sdk/endpoints/private/mutations/account/setSettings.d.ts +39 -0
- package/dist/sdk/endpoints/private/mutations/account/setSettings.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/account/setSettings.js +19 -0
- package/dist/sdk/endpoints/private/mutations/draft/cancelSend.d.ts +28 -0
- package/dist/sdk/endpoints/private/mutations/draft/cancelSend.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/draft/cancelSend.js +18 -0
- package/dist/sdk/endpoints/private/mutations/draft/createAttachment.d.ts +45 -0
- package/dist/sdk/endpoints/private/mutations/draft/createAttachment.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/draft/createAttachment.js +19 -0
- package/dist/sdk/endpoints/private/mutations/draft/createDraft.d.ts +60 -0
- package/dist/sdk/endpoints/private/mutations/draft/createDraft.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/draft/createDraft.js +19 -0
- package/dist/sdk/endpoints/private/mutations/draft/deleteAttachment.d.ts +34 -0
- package/dist/sdk/endpoints/private/mutations/draft/deleteAttachment.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/draft/deleteAttachment.js +19 -0
- package/dist/sdk/endpoints/private/mutations/draft/deleteDraft.d.ts +27 -0
- package/dist/sdk/endpoints/private/mutations/draft/deleteDraft.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/draft/deleteDraft.js +18 -0
- package/dist/sdk/endpoints/private/mutations/draft/index.d.ts +10 -0
- package/dist/sdk/endpoints/private/mutations/draft/index.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/draft/index.js +9 -0
- package/dist/sdk/endpoints/private/mutations/draft/replaceContent.d.ts +39 -0
- package/dist/sdk/endpoints/private/mutations/draft/replaceContent.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/draft/replaceContent.js +19 -0
- package/dist/sdk/endpoints/private/mutations/draft/scheduleSend.d.ts +45 -0
- package/dist/sdk/endpoints/private/mutations/draft/scheduleSend.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/draft/scheduleSend.js +19 -0
- package/dist/sdk/endpoints/private/mutations/draft/setEnvelope.d.ts +85 -0
- package/dist/sdk/endpoints/private/mutations/draft/setEnvelope.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/draft/setEnvelope.js +19 -0
- package/dist/sdk/endpoints/private/mutations/draft/setFrom.d.ts +47 -0
- package/dist/sdk/endpoints/private/mutations/draft/setFrom.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/draft/setFrom.js +20 -0
- package/dist/sdk/endpoints/private/mutations/index.d.ts +11 -0
- package/dist/sdk/endpoints/private/mutations/index.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/index.js +10 -0
- package/dist/sdk/endpoints/private/mutations/thread/addLabel.d.ts +40 -0
- package/dist/sdk/endpoints/private/mutations/thread/addLabel.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/thread/addLabel.js +19 -0
- package/dist/sdk/endpoints/private/mutations/thread/deleteThreads.d.ts +34 -0
- package/dist/sdk/endpoints/private/mutations/thread/deleteThreads.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/thread/deleteThreads.js +18 -0
- package/dist/sdk/endpoints/private/mutations/thread/index.d.ts +11 -0
- package/dist/sdk/endpoints/private/mutations/thread/index.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/thread/index.js +10 -0
- package/dist/sdk/endpoints/private/mutations/thread/removeLabel.d.ts +40 -0
- package/dist/sdk/endpoints/private/mutations/thread/removeLabel.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/thread/removeLabel.js +19 -0
- package/dist/sdk/endpoints/private/mutations/thread/setArchive.d.ts +34 -0
- package/dist/sdk/endpoints/private/mutations/thread/setArchive.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/thread/setArchive.js +18 -0
- package/dist/sdk/endpoints/private/mutations/thread/setFlagged.d.ts +35 -0
- package/dist/sdk/endpoints/private/mutations/thread/setFlagged.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/thread/setFlagged.js +18 -0
- package/dist/sdk/endpoints/private/mutations/thread/setInbox.d.ts +34 -0
- package/dist/sdk/endpoints/private/mutations/thread/setInbox.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/thread/setInbox.js +18 -0
- package/dist/sdk/endpoints/private/mutations/thread/setSeen.d.ts +35 -0
- package/dist/sdk/endpoints/private/mutations/thread/setSeen.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/thread/setSeen.js +18 -0
- package/dist/sdk/endpoints/private/mutations/thread/setSnooze.d.ts +35 -0
- package/dist/sdk/endpoints/private/mutations/thread/setSnooze.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/thread/setSnooze.js +18 -0
- package/dist/sdk/endpoints/private/mutations/thread/setSpam.d.ts +34 -0
- package/dist/sdk/endpoints/private/mutations/thread/setSpam.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/thread/setSpam.js +18 -0
- package/dist/sdk/endpoints/private/mutations/thread/setTrash.d.ts +34 -0
- package/dist/sdk/endpoints/private/mutations/thread/setTrash.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/thread/setTrash.js +18 -0
- package/dist/sdk/endpoints/private/mutations/user/createFeedback.d.ts +34 -0
- package/dist/sdk/endpoints/private/mutations/user/createFeedback.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/user/createFeedback.js +18 -0
- package/dist/sdk/endpoints/private/mutations/user/createView.d.ts +38 -0
- package/dist/sdk/endpoints/private/mutations/user/createView.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/user/createView.js +18 -0
- package/dist/sdk/endpoints/private/mutations/user/deletePushToken.d.ts +23 -0
- package/dist/sdk/endpoints/private/mutations/user/deletePushToken.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/user/deletePushToken.js +17 -0
- package/dist/sdk/endpoints/private/mutations/user/deleteView.d.ts +28 -0
- package/dist/sdk/endpoints/private/mutations/user/deleteView.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/user/deleteView.js +18 -0
- package/dist/sdk/endpoints/private/mutations/user/index.d.ts +9 -0
- package/dist/sdk/endpoints/private/mutations/user/index.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/user/index.js +8 -0
- package/dist/sdk/endpoints/private/mutations/user/setFeedbackModalShown.d.ts +32 -0
- package/dist/sdk/endpoints/private/mutations/user/setFeedbackModalShown.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/user/setFeedbackModalShown.js +18 -0
- package/dist/sdk/endpoints/private/mutations/user/setPushToken.d.ts +37 -0
- package/dist/sdk/endpoints/private/mutations/user/setPushToken.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/user/setPushToken.js +18 -0
- package/dist/sdk/endpoints/private/mutations/user/setSettingsName.d.ts +33 -0
- package/dist/sdk/endpoints/private/mutations/user/setSettingsName.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/user/setSettingsName.js +18 -0
- package/dist/sdk/endpoints/private/mutations/user/updateView.d.ts +43 -0
- package/dist/sdk/endpoints/private/mutations/user/updateView.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/mutations/user/updateView.js +19 -0
- package/dist/sdk/endpoints/private/user/createBillingPortalSession.d.ts +30 -0
- package/dist/sdk/endpoints/private/user/createBillingPortalSession.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/user/createBillingPortalSession.js +19 -0
- package/dist/sdk/endpoints/private/user/createCheckoutSession.d.ts +27 -0
- package/dist/sdk/endpoints/private/user/createCheckoutSession.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/user/createCheckoutSession.js +20 -0
- package/dist/sdk/endpoints/private/user/deleteUser.d.ts +10 -0
- package/dist/sdk/endpoints/private/user/deleteUser.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/user/deleteUser.js +13 -0
- package/dist/sdk/endpoints/private/user/index.d.ts +90 -0
- package/dist/sdk/endpoints/private/user/index.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/user/index.js +10 -0
- package/dist/sdk/endpoints/private/user/uploadProfilePicture.d.ts +28 -0
- package/dist/sdk/endpoints/private/user/uploadProfilePicture.d.ts.map +1 -0
- package/dist/sdk/endpoints/private/user/uploadProfilePicture.js +19 -0
- package/dist/sdk/endpoints/public/auth/index.d.ts +133 -0
- package/dist/sdk/endpoints/public/auth/index.d.ts.map +1 -0
- package/dist/sdk/endpoints/public/auth/index.js +8 -0
- package/dist/sdk/endpoints/public/auth/refreshAuth.d.ts +41 -0
- package/dist/sdk/endpoints/public/auth/refreshAuth.d.ts.map +1 -0
- package/dist/sdk/endpoints/public/auth/refreshAuth.js +33 -0
- package/dist/sdk/endpoints/public/auth/sendAuthCode.d.ts +27 -0
- package/dist/sdk/endpoints/public/auth/sendAuthCode.d.ts.map +1 -0
- package/dist/sdk/endpoints/public/auth/sendAuthCode.js +19 -0
- package/dist/sdk/endpoints/public/auth/verifyAuthCode.d.ts +68 -0
- package/dist/sdk/endpoints/public/auth/verifyAuthCode.d.ts.map +1 -0
- package/dist/sdk/endpoints/public/auth/verifyAuthCode.js +36 -0
- package/dist/sdk/endpoints/public/config/index.d.ts +10 -0
- package/dist/sdk/endpoints/public/config/index.d.ts.map +1 -0
- package/dist/sdk/endpoints/public/config/index.js +15 -0
- package/dist/sdk/endpoints/public/healthcheck/index.d.ts +8 -0
- package/dist/sdk/endpoints/public/healthcheck/index.d.ts.map +1 -0
- package/dist/sdk/endpoints/public/healthcheck/index.js +10 -0
- package/dist/sdk/endpoints/public/index.d.ts +149 -0
- package/dist/sdk/endpoints/public/index.d.ts.map +1 -0
- package/dist/sdk/endpoints/public/index.js +8 -0
- package/dist/sdk/index.d.ts +485 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/sdk/index.js +6 -0
- package/dist/sdk/validation/errors.d.ts +338 -0
- package/dist/sdk/validation/errors.d.ts.map +1 -0
- package/dist/sdk/validation/errors.js +145 -0
- package/dist/sdk/validation/index.d.ts +178 -0
- package/dist/sdk/validation/index.d.ts.map +1 -0
- package/dist/sdk/validation/index.js +3 -0
- package/dist/sdk/validation/utils/flattenRequirements/flattenRequirements.d.ts +11 -0
- package/dist/sdk/validation/utils/flattenRequirements/flattenRequirements.d.ts.map +1 -0
- package/dist/sdk/validation/utils/flattenRequirements/flattenRequirements.js +22 -0
- package/dist/sdk/validation/utils/flattenRequirements/index.d.ts +2 -0
- package/dist/sdk/validation/utils/flattenRequirements/index.d.ts.map +1 -0
- package/dist/sdk/validation/utils/flattenRequirements/index.js +1 -0
- package/dist/sdk/validation/utils/index.d.ts +7 -0
- package/dist/sdk/validation/utils/index.d.ts.map +1 -0
- package/dist/sdk/validation/utils/index.js +4 -0
- package/dist/types/AuthData.d.ts +4 -0
- package/dist/types/AuthData.d.ts.map +1 -0
- package/dist/types/AuthData.js +1 -0
- package/dist/types/DraftAttachmentUploadStatus.d.ts +1 -1
- package/dist/types/DraftAttachmentUploadStatus.d.ts.map +1 -1
- package/dist/types/DraftStatus.d.ts +1 -1
- package/dist/types/DraftStatus.d.ts.map +1 -1
- package/dist/types/DraftType.d.ts +1 -1
- package/dist/types/DraftType.d.ts.map +1 -1
- package/dist/types/Endpoint.d.ts +25 -0
- package/dist/types/Endpoint.d.ts.map +1 -0
- package/dist/types/Endpoint.js +1 -0
- package/dist/types/IMAPConnectionStatus.d.ts +1 -1
- package/dist/types/IMAPConnectionStatus.d.ts.map +1 -1
- package/dist/types/IMAPSourceLocation.d.ts +1 -1
- package/dist/types/LabelSpecialUse.d.ts +1 -1
- package/dist/types/LabelSpecialUse.d.ts.map +1 -1
- package/dist/types/MarcoPlatform.d.ts +1 -1
- package/dist/types/MarcoPlatform.d.ts.map +1 -1
- package/dist/types/MessageRecipientType.d.ts +1 -1
- package/dist/types/MessageRecipientType.d.ts.map +1 -1
- package/dist/types/OAuthProvider.d.ts +1 -1
- package/dist/types/OAuthProvider.d.ts.map +1 -1
- package/dist/types/PokeEvent.d.ts +6 -0
- package/dist/types/PokeEvent.d.ts.map +1 -0
- package/dist/types/PokeEvent.js +1 -0
- package/dist/types/SDKError.d.ts +4 -0
- package/dist/types/SDKError.d.ts.map +1 -0
- package/dist/types/SDKError.js +1 -0
- package/dist/types/StripeSubscriptionStatus.d.ts +3 -0
- package/dist/types/StripeSubscriptionStatus.d.ts.map +1 -0
- package/dist/types/StripeSubscriptionStatus.js +10 -0
- package/dist/types/SubscriptionTier.d.ts +3 -0
- package/dist/types/SubscriptionTier.d.ts.map +1 -0
- package/dist/types/SubscriptionTier.js +1 -0
- package/dist/types/UserSettings.d.ts +15 -16
- package/dist/types/UserSettings.d.ts.map +1 -1
- package/dist/types/UserSettings.js +29 -15
- package/dist/types/index.d.ts +17 -11
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +17 -11
- package/dist/utils/accounts/generateAccountColor.d.ts.map +1 -1
- package/dist/utils/accounts/generateAccountColor.js +15 -10
- package/dist/utils/accounts/index.d.ts +3 -1
- package/dist/utils/accounts/index.d.ts.map +1 -1
- package/dist/utils/accounts/index.js +4 -1
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +3 -3
- package/dist/utils/labels/index.d.ts +3 -2
- package/dist/utils/labels/index.d.ts.map +1 -1
- package/dist/utils/labels/index.js +4 -1
- package/dist/utils/threads/index.d.ts +4 -2
- package/dist/utils/threads/index.d.ts.map +1 -1
- package/dist/utils/threads/index.js +6 -2
- package/dist/utils/threads/parseLabelIdList/index.d.ts +2 -0
- package/dist/utils/threads/parseLabelIdList/index.d.ts.map +1 -0
- package/dist/utils/threads/parseLabelIdList/index.js +1 -0
- package/dist/utils/threads/parseLabelIdList/parseLabelIdList.test.js +1 -1
- package/dist/utils/threads/processSearchTerm/index.d.ts +2 -0
- package/dist/utils/threads/processSearchTerm/index.d.ts.map +1 -0
- package/dist/utils/threads/processSearchTerm/index.js +1 -0
- package/dist/utils/threads/processSearchTerm/processSearchTerm.test.js +1 -1
- package/package.json +13 -28
- package/dist/appwrite/appwrite.d.ts +0 -77
- package/dist/appwrite/appwrite.d.ts.map +0 -1
- package/dist/appwrite/appwrite.js +0 -61
- package/dist/appwrite/appwrite.test.d.ts +0 -2
- package/dist/appwrite/appwrite.test.d.ts.map +0 -1
- package/dist/appwrite/appwrite.test.js +0 -901
- package/dist/appwrite/commands.d.ts +0 -5093
- package/dist/appwrite/commands.d.ts.map +0 -1
- package/dist/appwrite/commands.js +0 -208
- package/dist/appwrite/commands.test.d.ts +0 -2
- package/dist/appwrite/commands.test.d.ts.map +0 -1
- package/dist/appwrite/commands.test.js +0 -425
- package/dist/appwrite/decodedSchemas.d.ts +0 -35
- package/dist/appwrite/decodedSchemas.d.ts.map +0 -1
- package/dist/appwrite/decodedSchemas.js +0 -18
- package/dist/appwrite/functions.d.ts +0 -2806
- package/dist/appwrite/functions.d.ts.map +0 -1
- package/dist/appwrite/functions.js +0 -192
- package/dist/appwrite/functions.test.d.ts +0 -2
- package/dist/appwrite/functions.test.d.ts.map +0 -1
- package/dist/appwrite/functions.test.js +0 -370
- package/dist/appwrite/index.d.ts +0 -8
- package/dist/appwrite/index.d.ts.map +0 -1
- package/dist/appwrite/index.js +0 -5
- package/dist/appwrite/queryContracts/queryContracts.d.ts +0 -392
- package/dist/appwrite/queryContracts/queryContracts.d.ts.map +0 -1
- package/dist/appwrite/queryContracts/queryContracts.js +0 -299
- package/dist/appwrite/queryContracts/queryContracts.test.d.ts +0 -2
- package/dist/appwrite/queryContracts/queryContracts.test.d.ts.map +0 -1
- package/dist/appwrite/queryContracts/queryContracts.test.js +0 -39
- package/dist/appwrite/tableContract/identity.d.ts +0 -207
- package/dist/appwrite/tableContract/identity.d.ts.map +0 -1
- package/dist/appwrite/tableContract/identity.js +0 -169
- package/dist/appwrite/tableContract/index.d.ts +0 -3125
- package/dist/appwrite/tableContract/index.d.ts.map +0 -1
- package/dist/appwrite/tableContract/index.js +0 -94
- package/dist/appwrite/tableContract/index.test.d.ts +0 -2
- package/dist/appwrite/tableContract/index.test.d.ts.map +0 -1
- package/dist/appwrite/tableContract/index.test.js +0 -150
- package/dist/appwrite/tableContract/mailbox.d.ts +0 -276
- package/dist/appwrite/tableContract/mailbox.d.ts.map +0 -1
- package/dist/appwrite/tableContract/mailbox.js +0 -261
- package/dist/appwrite/tableContract/operational.d.ts +0 -247
- package/dist/appwrite/tableContract/operational.d.ts.map +0 -1
- package/dist/appwrite/tableContract/operational.js +0 -167
- package/dist/appwrite/tableContract/shared.d.ts +0 -145
- package/dist/appwrite/tableContract/shared.d.ts.map +0 -1
- package/dist/appwrite/tableContract/shared.js +0 -83
- package/dist/index.test.d.ts +0 -2
- package/dist/index.test.d.ts.map +0 -1
- package/dist/index.test.js +0 -106
- package/dist/schemas/models/mailboxAddress.test.d.ts +0 -2
- package/dist/schemas/models/mailboxAddress.test.d.ts.map +0 -1
- package/dist/schemas/models/mailboxAddress.test.js +0 -31
- package/dist/schemas/models/numericSemantics.test.d.ts +0 -2
- package/dist/schemas/models/numericSemantics.test.d.ts.map +0 -1
- package/dist/schemas/models/numericSemantics.test.js +0 -24
- package/dist/schemas/models/user.test.d.ts +0 -2
- package/dist/schemas/models/user.test.d.ts.map +0 -1
- package/dist/schemas/models/user.test.js +0 -18
- package/dist/schemas/scalars.d.ts +0 -13
- package/dist/schemas/scalars.d.ts.map +0 -1
- package/dist/schemas/scalars.js +0 -15
- package/dist/schemas/scalars.test.d.ts +0 -2
- package/dist/schemas/scalars.test.d.ts.map +0 -1
- package/dist/schemas/scalars.test.js +0 -44
- package/dist/schemas/schemaValues.test.d.ts +0 -2
- package/dist/schemas/schemaValues.test.d.ts.map +0 -1
- package/dist/schemas/schemaValues.test.js +0 -21
- package/dist/utils/valibot/index.d.ts +0 -3
- package/dist/utils/valibot/index.d.ts.map +0 -1
- package/dist/utils/valibot/index.js +0 -2
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../src/appwrite/functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,6BAA6B,CAAA;AAU/C,KAAK,uBAAuB,GAAG,eAAe,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAA;AAgMlF,eAAO,MAAM,iBAAiB;aAC5B,GAAG;iBACD,EAAE;iBACF,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAER,UAAU;aACV,WAAW;;;;aACX,MAAM;iBACJ,EAAE;iBACF,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEA,CAAA;AAEV,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,iBAAiB,CAAC,WAAW,CAAC,CAAA;AACvF,YAAY,EAAE,uBAAuB,EAAE,CAAA;AACvC,MAAM,MAAM,oBAAoB,GAAG,KAAK,GAAG,QAAQ,CAAA;AACnD,MAAM,MAAM,yBAAyB,CAAC,SAAS,SAAS,oBAAoB,IAAI,SAAS,SAAS,oBAAoB,GAClH,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,GACrD,KAAK,CAAA;AACT,MAAM,MAAM,qBAAqB,CAAC,SAAS,SAAS,oBAAoB,EAAE,MAAM,SAAS,yBAAyB,CAAC,SAAS,CAAC,IAAI,SAAS,SAAS,oBAAoB,GACnK,MAAM,SAAS,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,GAClE,CAAC,OAAO,iBAAiB,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GACvD,KAAK,GACP,KAAK,CAAA;AACT,MAAM,MAAM,uBAAuB,CAAC,SAAS,SAAS,oBAAoB,EAAE,MAAM,SAAS,yBAAyB,CAAC,SAAS,CAAC,IAC7H,qBAAqB,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS;IAAE,aAAa,EAAE,MAAM,OAAO,SAAS,CAAC,CAAC,aAAa,CAAA;CAAE,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,KAAK,CAAA;AAC5I,MAAM,MAAM,wBAAwB,CAAC,SAAS,SAAS,oBAAoB,EAAE,MAAM,SAAS,yBAAyB,CAAC,SAAS,CAAC,IAC9H,qBAAqB,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS;IAAE,cAAc,EAAE,MAAM,OAAO,SAAS,CAAC,CAAC,aAAa,CAAA;CAAE,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,KAAK,CAAA"}
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { v } from '../utils/valibot/index.js';
|
|
2
|
-
import { oauth } from '../constants/oauth.js';
|
|
3
|
-
import { id } from '../schemas/id.js';
|
|
4
|
-
import { string } from '../schemas/string.js';
|
|
5
|
-
import { appwrite } from './appwrite.js';
|
|
6
|
-
import { appwriteCommands } from './commands.js';
|
|
7
|
-
import { accountStates, appwriteRowIdSchema, canonicalTimestampSchema, portSchema, socketTypes, webEmailSchema } from './tableContract/index.js';
|
|
8
|
-
const functionErrorCodes = [
|
|
9
|
-
'AUTHENTICATION_FAILED',
|
|
10
|
-
'AUTHORIZATION_FAILED',
|
|
11
|
-
'CONFLICT',
|
|
12
|
-
'INVALID_REQUEST',
|
|
13
|
-
'NOT_FOUND',
|
|
14
|
-
'PROVIDER_REJECTED',
|
|
15
|
-
'TRANSIENT_FAILURE',
|
|
16
|
-
'INTERNAL_ERROR',
|
|
17
|
-
];
|
|
18
|
-
const functionErrorSchema = v.strictObject({
|
|
19
|
-
code: v.picklist(functionErrorCodes),
|
|
20
|
-
retryable: v.boolean(),
|
|
21
|
-
});
|
|
22
|
-
const providerCredentialSchema = v.strictObject({
|
|
23
|
-
host: string.required(4096),
|
|
24
|
-
password: string.required(4096),
|
|
25
|
-
port: portSchema,
|
|
26
|
-
socketType: v.picklist(socketTypes),
|
|
27
|
-
user: string.required(4096),
|
|
28
|
-
});
|
|
29
|
-
const connectionSchema = v.variant('kind', [
|
|
30
|
-
v.strictObject({
|
|
31
|
-
email: webEmailSchema,
|
|
32
|
-
kind: v.literal('OAUTH'),
|
|
33
|
-
provider: v.picklist(['GMAIL', 'OUTLOOK']),
|
|
34
|
-
returnUri: appwrite.oauth.returnUriSchema,
|
|
35
|
-
}),
|
|
36
|
-
v.strictObject({
|
|
37
|
-
imap: providerCredentialSchema,
|
|
38
|
-
kind: v.literal('IMAP'),
|
|
39
|
-
smtp: providerCredentialSchema,
|
|
40
|
-
}),
|
|
41
|
-
]);
|
|
42
|
-
const connectionResultSchema = v.strictObject({
|
|
43
|
-
accountId: id.accountId.required(),
|
|
44
|
-
authorizationUrl: v.optional(v.pipe(v.string(), v.url())),
|
|
45
|
-
state: v.picklist(accountStates),
|
|
46
|
-
});
|
|
47
|
-
const completedSchema = v.strictObject({ state: v.literal('COMPLETED') });
|
|
48
|
-
const emptySchema = v.strictObject({});
|
|
49
|
-
const authUserIdSchema = appwriteRowIdSchema;
|
|
50
|
-
const authSendCodeRequestSchema = v.strictObject({
|
|
51
|
-
email: string.email(),
|
|
52
|
-
userId: authUserIdSchema,
|
|
53
|
-
});
|
|
54
|
-
const authSendCodeResponseSchema = v.strictObject({ userId: authUserIdSchema });
|
|
55
|
-
const authVerifyCodeRequestSchema = v.strictObject({
|
|
56
|
-
code: v.pipe(v.string(), v.regex(/^\d{6}$/)),
|
|
57
|
-
email: string.email(),
|
|
58
|
-
userId: authUserIdSchema,
|
|
59
|
-
});
|
|
60
|
-
const authVerifyCodeResponseSchema = v.strictObject({
|
|
61
|
-
secret: string.required(4096),
|
|
62
|
-
userId: authUserIdSchema,
|
|
63
|
-
});
|
|
64
|
-
const createRoute = (route) => ({
|
|
65
|
-
...route,
|
|
66
|
-
errorSchema: functionErrorSchema,
|
|
67
|
-
});
|
|
68
|
-
const apiRoutes = {
|
|
69
|
-
accountConnection: createRoute({
|
|
70
|
-
context: 'authenticated',
|
|
71
|
-
method: 'PUT',
|
|
72
|
-
path: '/accounts/connection',
|
|
73
|
-
requestSchema: v.strictObject({
|
|
74
|
-
accountId: id.accountId.required(),
|
|
75
|
-
connection: connectionSchema,
|
|
76
|
-
}),
|
|
77
|
-
responseSchema: connectionResultSchema,
|
|
78
|
-
}),
|
|
79
|
-
accountDelete: createRoute({
|
|
80
|
-
context: 'authenticated',
|
|
81
|
-
method: 'DELETE',
|
|
82
|
-
path: '/account/delete',
|
|
83
|
-
requestSchema: emptySchema,
|
|
84
|
-
responseSchema: v.strictObject({ state: v.literal('ACCEPTED') }),
|
|
85
|
-
}),
|
|
86
|
-
accountsConnect: createRoute({
|
|
87
|
-
context: 'authenticated',
|
|
88
|
-
method: 'POST',
|
|
89
|
-
path: '/accounts/connect',
|
|
90
|
-
requestSchema: v.strictObject({ connection: connectionSchema }),
|
|
91
|
-
responseSchema: connectionResultSchema,
|
|
92
|
-
}),
|
|
93
|
-
accountsPoll: createRoute({
|
|
94
|
-
context: 'authenticated',
|
|
95
|
-
method: 'POST',
|
|
96
|
-
path: '/accounts/poll',
|
|
97
|
-
requestSchema: emptySchema,
|
|
98
|
-
responseSchema: v.strictObject({
|
|
99
|
-
commands: v.array(v.strictObject({
|
|
100
|
-
accountId: id.accountId.required(),
|
|
101
|
-
commandId: appwriteRowIdSchema,
|
|
102
|
-
})),
|
|
103
|
-
failedAccountIds: v.array(id.accountId.required()),
|
|
104
|
-
}),
|
|
105
|
-
}),
|
|
106
|
-
authSendCode: createRoute({
|
|
107
|
-
context: 'public',
|
|
108
|
-
method: 'POST',
|
|
109
|
-
path: '/auth/send-code',
|
|
110
|
-
requestSchema: authSendCodeRequestSchema,
|
|
111
|
-
responseSchema: authSendCodeResponseSchema,
|
|
112
|
-
}),
|
|
113
|
-
authVerifyCode: createRoute({
|
|
114
|
-
context: 'public',
|
|
115
|
-
method: 'POST',
|
|
116
|
-
path: '/auth/verify-code',
|
|
117
|
-
requestSchema: authVerifyCodeRequestSchema,
|
|
118
|
-
responseSchema: authVerifyCodeResponseSchema,
|
|
119
|
-
}),
|
|
120
|
-
commands: createRoute({
|
|
121
|
-
context: 'authenticated',
|
|
122
|
-
method: 'POST',
|
|
123
|
-
path: '/commands',
|
|
124
|
-
requestSchema: appwriteCommands.requestSchema,
|
|
125
|
-
responseSchema: appwriteCommands.responseSchema,
|
|
126
|
-
}),
|
|
127
|
-
oauthWebhook: createRoute({
|
|
128
|
-
context: 'webhook',
|
|
129
|
-
method: 'GET',
|
|
130
|
-
path: oauth.redirectPath,
|
|
131
|
-
requestSchema: v.object({
|
|
132
|
-
code: string.required(4096),
|
|
133
|
-
state: string.required(4096),
|
|
134
|
-
}),
|
|
135
|
-
responseSchema: completedSchema,
|
|
136
|
-
}),
|
|
137
|
-
pollsRun: createRoute({
|
|
138
|
-
context: 'internal',
|
|
139
|
-
method: 'POST',
|
|
140
|
-
path: '/polls/run',
|
|
141
|
-
requestSchema: v.strictObject({
|
|
142
|
-
scheduledFor: canonicalTimestampSchema,
|
|
143
|
-
shardId: appwriteRowIdSchema,
|
|
144
|
-
}),
|
|
145
|
-
responseSchema: completedSchema,
|
|
146
|
-
}),
|
|
147
|
-
profileEnsure: createRoute({
|
|
148
|
-
context: 'authenticated',
|
|
149
|
-
method: 'POST',
|
|
150
|
-
path: '/profile/ensure',
|
|
151
|
-
requestSchema: emptySchema,
|
|
152
|
-
responseSchema: v.strictObject({ created: v.boolean() }),
|
|
153
|
-
}),
|
|
154
|
-
pushTokens: createRoute({
|
|
155
|
-
context: 'authenticated',
|
|
156
|
-
method: 'POST',
|
|
157
|
-
path: '/push-tokens',
|
|
158
|
-
requestSchema: v.strictObject({
|
|
159
|
-
operation: v.picklist(['REGISTER', 'REMOVE']),
|
|
160
|
-
token: string.required(4096),
|
|
161
|
-
}),
|
|
162
|
-
responseSchema: v.strictObject({ registered: v.boolean() }),
|
|
163
|
-
}),
|
|
164
|
-
};
|
|
165
|
-
const workerRoutes = {
|
|
166
|
-
jobsRun: createRoute({
|
|
167
|
-
context: 'internal',
|
|
168
|
-
method: 'POST',
|
|
169
|
-
path: '/jobs/run',
|
|
170
|
-
requestSchema: v.strictObject({ jobId: id.jobId.required() }),
|
|
171
|
-
responseSchema: completedSchema,
|
|
172
|
-
}),
|
|
173
|
-
supervisor: createRoute({
|
|
174
|
-
context: 'internal',
|
|
175
|
-
method: 'POST',
|
|
176
|
-
path: '/',
|
|
177
|
-
requestSchema: emptySchema,
|
|
178
|
-
responseSchema: completedSchema,
|
|
179
|
-
}),
|
|
180
|
-
};
|
|
181
|
-
export const appwriteFunctions = {
|
|
182
|
-
api: {
|
|
183
|
-
id: appwrite.ids.functions.api,
|
|
184
|
-
routes: apiRoutes,
|
|
185
|
-
},
|
|
186
|
-
errorCodes: functionErrorCodes,
|
|
187
|
-
errorSchema: functionErrorSchema,
|
|
188
|
-
worker: {
|
|
189
|
-
id: appwrite.ids.functions.worker,
|
|
190
|
-
routes: workerRoutes,
|
|
191
|
-
},
|
|
192
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"functions.test.d.ts","sourceRoot":"","sources":["../../src/appwrite/functions.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,370 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'bun:test';
|
|
2
|
-
import { v } from '../utils/valibot/index.js';
|
|
3
|
-
import { appwriteFunctions } from './functions.js';
|
|
4
|
-
const command = {
|
|
5
|
-
accountId: null,
|
|
6
|
-
id: '0197f3d4-1b22-7abc-8def-123456789abc',
|
|
7
|
-
kind: 'profile.settings.set',
|
|
8
|
-
payload: { name: 'Isaac' },
|
|
9
|
-
submittedAt: '2026-07-15T00:00:00.000Z',
|
|
10
|
-
version: 1,
|
|
11
|
-
};
|
|
12
|
-
const routeFixtures = [
|
|
13
|
-
{
|
|
14
|
-
name: 'profile ensure',
|
|
15
|
-
request: {},
|
|
16
|
-
response: { created: true },
|
|
17
|
-
route: () => appwriteFunctions.api.routes.profileEnsure,
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: 'commands',
|
|
21
|
-
request: command,
|
|
22
|
-
response: { canonicalRevision: null, error: null, id: command.id, state: 'ACCEPTED' },
|
|
23
|
-
route: () => appwriteFunctions.api.routes.commands,
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
name: 'account connection',
|
|
27
|
-
request: {
|
|
28
|
-
accountId: 'account_1',
|
|
29
|
-
connection: {
|
|
30
|
-
imap: {
|
|
31
|
-
host: 'imap.example.com',
|
|
32
|
-
password: 'password',
|
|
33
|
-
port: 993,
|
|
34
|
-
socketType: 'SSL',
|
|
35
|
-
user: 'marco@example.com',
|
|
36
|
-
},
|
|
37
|
-
kind: 'IMAP',
|
|
38
|
-
smtp: {
|
|
39
|
-
host: 'smtp.example.com',
|
|
40
|
-
password: 'password',
|
|
41
|
-
port: 465,
|
|
42
|
-
socketType: 'SSL',
|
|
43
|
-
user: 'marco@example.com',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
response: { accountId: 'account_1', state: 'CONNECTED' },
|
|
48
|
-
route: () => appwriteFunctions.api.routes.accountConnection,
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
name: 'account connect',
|
|
52
|
-
request: {
|
|
53
|
-
connection: {
|
|
54
|
-
email: 'test-user@example.com',
|
|
55
|
-
kind: 'OAUTH',
|
|
56
|
-
provider: 'GMAIL',
|
|
57
|
-
returnUri: 'https://app.marcoapp.io/onboarding/loading',
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
response: {
|
|
61
|
-
accountId: 'account_1',
|
|
62
|
-
authorizationUrl: 'https://accounts.google.com/o/oauth2/auth',
|
|
63
|
-
state: 'AWAITING_CONNECTION',
|
|
64
|
-
},
|
|
65
|
-
route: () => appwriteFunctions.api.routes.accountsConnect,
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
name: 'account poll',
|
|
69
|
-
request: {},
|
|
70
|
-
response: {
|
|
71
|
-
commands: [{ accountId: 'test-account-id-1', commandId: 'sync_0123456789abcdef0123456789ab' }],
|
|
72
|
-
failedAccountIds: ['test-account-id-2'],
|
|
73
|
-
},
|
|
74
|
-
route: () => appwriteFunctions.api.routes.accountsPoll,
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: 'push tokens',
|
|
78
|
-
request: { operation: 'REGISTER', token: 'ExponentPushToken[example]' },
|
|
79
|
-
response: { registered: true },
|
|
80
|
-
route: () => appwriteFunctions.api.routes.pushTokens,
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
name: 'account deletion',
|
|
84
|
-
request: {},
|
|
85
|
-
response: { state: 'ACCEPTED' },
|
|
86
|
-
route: () => appwriteFunctions.api.routes.accountDelete,
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
name: 'OAuth webhook',
|
|
90
|
-
request: { code: 'authorisation-code', state: 'state' },
|
|
91
|
-
response: { state: 'COMPLETED' },
|
|
92
|
-
route: () => appwriteFunctions.api.routes.oauthWebhook,
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
name: 'worker supervisor',
|
|
96
|
-
request: {},
|
|
97
|
-
response: { state: 'COMPLETED' },
|
|
98
|
-
route: () => appwriteFunctions.worker.routes.supervisor,
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
name: 'job runner',
|
|
102
|
-
request: { jobId: 'job_1' },
|
|
103
|
-
response: { state: 'COMPLETED' },
|
|
104
|
-
route: () => appwriteFunctions.worker.routes.jobsRun,
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
name: 'poll runner',
|
|
108
|
-
request: { scheduledFor: '2026-07-23T12:00:30.000Z', shardId: 'test-poll-shard-id-1' },
|
|
109
|
-
response: { state: 'COMPLETED' },
|
|
110
|
-
route: () => appwriteFunctions.api.routes.pollsRun,
|
|
111
|
-
},
|
|
112
|
-
];
|
|
113
|
-
describe('appwriteFunctions', () => {
|
|
114
|
-
it('publishes the complete Appwrite Function route manifest', () => {
|
|
115
|
-
expect([
|
|
116
|
-
{ functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.profileEnsure },
|
|
117
|
-
{ functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.authSendCode },
|
|
118
|
-
{ functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.authVerifyCode },
|
|
119
|
-
{ functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.commands },
|
|
120
|
-
{ functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.accountsConnect },
|
|
121
|
-
{ functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.accountsPoll },
|
|
122
|
-
{ functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.accountConnection },
|
|
123
|
-
{ functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.pushTokens },
|
|
124
|
-
{ functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.accountDelete },
|
|
125
|
-
{ functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.oauthWebhook },
|
|
126
|
-
{ functionId: appwriteFunctions.api.id, route: appwriteFunctions.api.routes.pollsRun },
|
|
127
|
-
{ functionId: appwriteFunctions.worker.id, route: appwriteFunctions.worker.routes.supervisor },
|
|
128
|
-
{ functionId: appwriteFunctions.worker.id, route: appwriteFunctions.worker.routes.jobsRun },
|
|
129
|
-
].map(({ functionId, route }) => ({
|
|
130
|
-
context: route.context,
|
|
131
|
-
functionId,
|
|
132
|
-
method: route.method,
|
|
133
|
-
path: route.path,
|
|
134
|
-
}))).toEqual([
|
|
135
|
-
{ context: 'authenticated', functionId: 'marco-api', method: 'POST', path: '/profile/ensure' },
|
|
136
|
-
{ context: 'public', functionId: 'marco-api', method: 'POST', path: '/auth/send-code' },
|
|
137
|
-
{ context: 'public', functionId: 'marco-api', method: 'POST', path: '/auth/verify-code' },
|
|
138
|
-
{ context: 'authenticated', functionId: 'marco-api', method: 'POST', path: '/commands' },
|
|
139
|
-
{ context: 'authenticated', functionId: 'marco-api', method: 'POST', path: '/accounts/connect' },
|
|
140
|
-
{ context: 'authenticated', functionId: 'marco-api', method: 'POST', path: '/accounts/poll' },
|
|
141
|
-
{ context: 'authenticated', functionId: 'marco-api', method: 'PUT', path: '/accounts/connection' },
|
|
142
|
-
{ context: 'authenticated', functionId: 'marco-api', method: 'POST', path: '/push-tokens' },
|
|
143
|
-
{ context: 'authenticated', functionId: 'marco-api', method: 'DELETE', path: '/account/delete' },
|
|
144
|
-
{ context: 'webhook', functionId: 'marco-api', method: 'GET', path: '/v1/wh/oauth/callback' },
|
|
145
|
-
{ context: 'internal', functionId: 'marco-api', method: 'POST', path: '/polls/run' },
|
|
146
|
-
{ context: 'internal', functionId: 'marco-worker', method: 'POST', path: '/' },
|
|
147
|
-
{ context: 'internal', functionId: 'marco-worker', method: 'POST', path: '/jobs/run' },
|
|
148
|
-
]);
|
|
149
|
-
});
|
|
150
|
-
const authRoutes = [
|
|
151
|
-
{
|
|
152
|
-
request: { email: 'test-user-email-1@example.com', userId: 'test-appwrite-user-id-1' },
|
|
153
|
-
response: { userId: 'test-appwrite-user-id-1' },
|
|
154
|
-
route: () => appwriteFunctions.api.routes.authSendCode,
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
request: { code: '123456', email: 'test-user-email-1@example.com', userId: 'test-appwrite-user-id-1' },
|
|
158
|
-
response: { secret: 'test-appwrite-secret-1', userId: 'test-appwrite-user-id-1' },
|
|
159
|
-
route: () => appwriteFunctions.api.routes.authVerifyCode,
|
|
160
|
-
},
|
|
161
|
-
];
|
|
162
|
-
for (const { request, response, route } of authRoutes) {
|
|
163
|
-
it(`accepts the public ${route().path} contract`, () => {
|
|
164
|
-
expect(v.safeParse(route().requestSchema, request).success).toBe(true);
|
|
165
|
-
expect(v.safeParse(route().responseSchema, response).success).toBe(true);
|
|
166
|
-
});
|
|
167
|
-
it(`rejects unknown fields in the public ${route().path} contract`, () => {
|
|
168
|
-
expect(v.safeParse(route().requestSchema, { ...request, unexpected: true }).success).toBe(false);
|
|
169
|
-
expect(v.safeParse(route().responseSchema, { ...response, unexpected: true }).success).toBe(false);
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
for (const { description, request, route } of [
|
|
173
|
-
{
|
|
174
|
-
description: 'malformed email',
|
|
175
|
-
request: { email: 'not-an-email', userId: 'test-appwrite-user-id-1' },
|
|
176
|
-
route: () => appwriteFunctions.api.routes.authSendCode,
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
description: 'malformed code',
|
|
180
|
-
request: { code: '12345', email: 'test-user-email-1@example.com', userId: 'test-appwrite-user-id-1' },
|
|
181
|
-
route: () => appwriteFunctions.api.routes.authVerifyCode,
|
|
182
|
-
},
|
|
183
|
-
]) {
|
|
184
|
-
it(`rejects a public auth request with a ${description}`, () => {
|
|
185
|
-
expect(v.safeParse(route().requestSchema, request).success).toBe(false);
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
for (const { name, request, response, route } of routeFixtures) {
|
|
189
|
-
it(`accepts the ${name} request and response`, () => {
|
|
190
|
-
expect(v.safeParse(route().requestSchema, request).success).toBe(true);
|
|
191
|
-
expect(v.safeParse(route().responseSchema, response).success).toBe(true);
|
|
192
|
-
});
|
|
193
|
-
if (name !== 'OAuth webhook') {
|
|
194
|
-
it(`rejects caller ownership in the ${name} request and response`, () => {
|
|
195
|
-
expect(v.safeParse(route().requestSchema, { ...request, userId: 'another-user' }).success).toBe(false);
|
|
196
|
-
expect(v.safeParse(route().responseSchema, { ...response, userId: 'another-user' }).success).toBe(false);
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
it('accepts provider-owned OAuth callback parameters without passing them to the handler', () => {
|
|
201
|
-
const result = v.safeParse(appwriteFunctions.api.routes.oauthWebhook.requestSchema, {
|
|
202
|
-
authuser: '0',
|
|
203
|
-
code: 'test-authorisation-code-1',
|
|
204
|
-
iss: 'https://accounts.google.com',
|
|
205
|
-
scope: 'openid email profile',
|
|
206
|
-
state: 'test-state-1',
|
|
207
|
-
});
|
|
208
|
-
expect(result.success).toBe(true);
|
|
209
|
-
if (result.success) {
|
|
210
|
-
expect(result.output).toEqual({ code: 'test-authorisation-code-1', state: 'test-state-1' });
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
for (const { description, request } of [
|
|
214
|
-
{ description: 'missing code', request: { state: 'test-state-1' } },
|
|
215
|
-
{ description: 'empty code', request: { code: '', state: 'test-state-1' } },
|
|
216
|
-
{ description: 'oversized code', request: { code: 'a'.repeat(4097), state: 'test-state-1' } },
|
|
217
|
-
{ description: 'missing state', request: { code: 'test-authorisation-code-1' } },
|
|
218
|
-
{ description: 'empty state', request: { code: 'test-authorisation-code-1', state: '' } },
|
|
219
|
-
{ description: 'oversized state', request: { code: 'test-authorisation-code-1', state: 'a'.repeat(4097) } },
|
|
220
|
-
]) {
|
|
221
|
-
it(`rejects an OAuth callback with ${description}`, () => {
|
|
222
|
-
expect(v.safeParse(appwriteFunctions.api.routes.oauthWebhook.requestSchema, request).success).toBe(false);
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
it('rejects caller-selected accounts for manual polling', () => {
|
|
226
|
-
const requestSchema = appwriteFunctions.api.routes.accountsPoll.requestSchema;
|
|
227
|
-
expect(v.safeParse(requestSchema, { accountId: 'account_1' }).success).toBe(false);
|
|
228
|
-
expect(v.safeParse(requestSchema, { accountIds: ['account_1'] }).success).toBe(false);
|
|
229
|
-
});
|
|
230
|
-
for (const { description, value } of [
|
|
231
|
-
{ description: 'empty', value: '' },
|
|
232
|
-
{ description: 'overlong', value: 'a'.repeat(37) },
|
|
233
|
-
{ description: 'illegal', value: 'test/command/id/1' },
|
|
234
|
-
]) {
|
|
235
|
-
it(`rejects an ${description} manual-poll command ID`, () => {
|
|
236
|
-
expect(v.safeParse(appwriteFunctions.api.routes.accountsPoll.responseSchema, {
|
|
237
|
-
commands: [{ accountId: 'test-account-id-1', commandId: value }],
|
|
238
|
-
failedAccountIds: [],
|
|
239
|
-
}).success).toBe(false);
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
const shardRoutes = [
|
|
243
|
-
{
|
|
244
|
-
description: 'poll',
|
|
245
|
-
request: { scheduledFor: '2026-07-23T12:00:30.000Z', shardId: 'test invalid shard id' },
|
|
246
|
-
requestSchema: appwriteFunctions.api.routes.pollsRun.requestSchema,
|
|
247
|
-
},
|
|
248
|
-
];
|
|
249
|
-
for (const { description, request, requestSchema } of shardRoutes) {
|
|
250
|
-
it(`rejects a malformed ${description} shard ID`, () => {
|
|
251
|
-
expect(v.safeParse(requestSchema, request).success).toBe(false);
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
for (const { description, request } of [
|
|
255
|
-
{ description: 'a missing scheduled slot', request: { shardId: 'test-poll-shard-id-1' } },
|
|
256
|
-
{
|
|
257
|
-
description: 'a malformed scheduled slot',
|
|
258
|
-
request: { scheduledFor: '2026-07-23 12:00:30', shardId: 'test-poll-shard-id-1' },
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
description: 'a calendar-impossible scheduled slot',
|
|
262
|
-
request: { scheduledFor: '2026-06-31T12:00:30.000Z', shardId: 'test-poll-shard-id-1' },
|
|
263
|
-
},
|
|
264
|
-
{
|
|
265
|
-
description: 'a non-canonical scheduled slot',
|
|
266
|
-
request: { scheduledFor: '2026-07-23T12:00:30.000+00:00', shardId: 'test-poll-shard-id-1' },
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
description: 'an extra field',
|
|
270
|
-
request: {
|
|
271
|
-
scheduledFor: '2026-07-23T12:00:30.000Z',
|
|
272
|
-
shardId: 'test-poll-shard-id-1',
|
|
273
|
-
unexpected: true,
|
|
274
|
-
},
|
|
275
|
-
},
|
|
276
|
-
]) {
|
|
277
|
-
it(`rejects a poll request with ${description}`, () => {
|
|
278
|
-
expect(v.safeParse(appwriteFunctions.api.routes.pollsRun.requestSchema, request).success).toBe(false);
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
it('redacts credentials from connection responses and compact errors', () => {
|
|
282
|
-
expect(v.safeParse(appwriteFunctions.api.routes.accountsConnect.responseSchema, {
|
|
283
|
-
accountId: 'account_1',
|
|
284
|
-
credentials: { password: 'secret' },
|
|
285
|
-
state: 'CONNECTED',
|
|
286
|
-
}).success).toBe(false);
|
|
287
|
-
expect(v.safeParse(appwriteFunctions.errorSchema, {
|
|
288
|
-
code: 'AUTHENTICATION_FAILED',
|
|
289
|
-
retryable: false,
|
|
290
|
-
}).success).toBe(true);
|
|
291
|
-
expect(v.safeParse(appwriteFunctions.errorSchema, {
|
|
292
|
-
code: 'AUTHENTICATION_FAILED',
|
|
293
|
-
credentials: 'secret',
|
|
294
|
-
retryable: false,
|
|
295
|
-
}).success).toBe(false);
|
|
296
|
-
});
|
|
297
|
-
const invalidOAuthConnections = [
|
|
298
|
-
{
|
|
299
|
-
connection: {
|
|
300
|
-
kind: 'OAUTH',
|
|
301
|
-
provider: 'GMAIL',
|
|
302
|
-
returnUri: 'https://app.marcoapp.io/onboarding/provider-selection',
|
|
303
|
-
},
|
|
304
|
-
description: 'a missing mailbox email',
|
|
305
|
-
expected: false,
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
connection: {
|
|
309
|
-
email: 'not-an-email',
|
|
310
|
-
kind: 'OAUTH',
|
|
311
|
-
provider: 'GMAIL',
|
|
312
|
-
returnUri: 'https://app.marcoapp.io/onboarding/provider-selection',
|
|
313
|
-
},
|
|
314
|
-
description: 'a malformed mailbox email',
|
|
315
|
-
expected: false,
|
|
316
|
-
},
|
|
317
|
-
];
|
|
318
|
-
const forbiddenOAuthReturnUris = [
|
|
319
|
-
{ description: 'provider-selection', returnUri: 'https://app.marcoapp.io/onboarding/provider-selection' },
|
|
320
|
-
{ description: 'staging loading', returnUri: 'https://app.staging.marcoapp.io/onboarding/loading' },
|
|
321
|
-
{ description: 'arbitrary origin', returnUri: 'https://attacker.example/onboarding/loading' },
|
|
322
|
-
{ description: 'arbitrary path', returnUri: 'https://app.marcoapp.io/onboarding/loading/unexpected' },
|
|
323
|
-
];
|
|
324
|
-
const oauthConnectionRoutes = [
|
|
325
|
-
{
|
|
326
|
-
description: 'connect',
|
|
327
|
-
includesAccountId: false,
|
|
328
|
-
requestSchema: appwriteFunctions.api.routes.accountsConnect.requestSchema,
|
|
329
|
-
},
|
|
330
|
-
{
|
|
331
|
-
description: 'replacement',
|
|
332
|
-
includesAccountId: true,
|
|
333
|
-
requestSchema: appwriteFunctions.api.routes.accountConnection.requestSchema,
|
|
334
|
-
},
|
|
335
|
-
];
|
|
336
|
-
for (const { description, includesAccountId, requestSchema } of oauthConnectionRoutes) {
|
|
337
|
-
it(`accepts ${description} OAuth connection completing at production loading`, () => {
|
|
338
|
-
const connection = {
|
|
339
|
-
email: 'test-user@example.com',
|
|
340
|
-
kind: 'OAUTH',
|
|
341
|
-
provider: 'GMAIL',
|
|
342
|
-
returnUri: 'https://app.marcoapp.io/onboarding/loading',
|
|
343
|
-
};
|
|
344
|
-
const request = includesAccountId ? { accountId: 'account_1', connection } : { connection };
|
|
345
|
-
expect(v.safeParse(requestSchema, request).success).toBe(true);
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
|
-
for (const { connection, description, expected } of invalidOAuthConnections) {
|
|
349
|
-
for (const { description: routeDescription, includesAccountId, requestSchema } of oauthConnectionRoutes) {
|
|
350
|
-
it(`rejects ${routeDescription} OAuth connection with ${description}`, () => {
|
|
351
|
-
const request = includesAccountId ? { accountId: 'account_1', connection } : { connection };
|
|
352
|
-
expect(v.safeParse(requestSchema, request).success).toBe(expected);
|
|
353
|
-
});
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
for (const { description, returnUri } of forbiddenOAuthReturnUris) {
|
|
357
|
-
for (const { description: routeDescription, includesAccountId, requestSchema } of oauthConnectionRoutes) {
|
|
358
|
-
it(`rejects ${routeDescription} OAuth connection with ${description} return URI`, () => {
|
|
359
|
-
const connection = {
|
|
360
|
-
email: 'test-user@example.com',
|
|
361
|
-
kind: 'OAUTH',
|
|
362
|
-
provider: 'GMAIL',
|
|
363
|
-
returnUri,
|
|
364
|
-
};
|
|
365
|
-
const request = includesAccountId ? { accountId: 'account_1', connection } : { connection };
|
|
366
|
-
expect(v.safeParse(requestSchema, request).success).toBe(false);
|
|
367
|
-
});
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
});
|
package/dist/appwrite/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './appwrite.js';
|
|
2
|
-
export * from './commands.js';
|
|
3
|
-
export type { AppwriteDraftAttachment, AppwriteDraftEnvelope } from './decodedSchemas.js';
|
|
4
|
-
export * from './functions.js';
|
|
5
|
-
export type { AppwriteQueryConsumer, AppwriteQueryContract, AppwriteQueryContractName, AppwriteQueryIndexKind, AppwriteQueryIndexRequirement, AppwriteQueryIndexRequirementName, } from './queryContracts/queryContracts.js';
|
|
6
|
-
export { appwriteQueryContractNames, appwriteQueryContracts, appwriteQueryIndexRequirementNames, appwriteQueryIndexRequirements, validateAppwriteQueryContracts, } from './queryContracts/queryContracts.js';
|
|
7
|
-
export { type AppwriteColumnDefinition, type AppwriteColumnSchema, type AppwriteColumnType, type AppwriteDataRow, type AppwriteIndexDefinition, type AppwriteIndexType, type AppwriteMailboxSyncLane, type AppwriteMailboxSyncLaneState, type AppwriteMailboxSyncState, type AppwritePollShardState, type AppwriteRelationshipDefinition, type AppwriteRelationshipOnDelete, type AppwriteRelationshipSchema, type AppwriteRelationshipType, type AppwriteRow, type AppwriteRowTable, type AppwriteTableDefinition, type AppwriteTableIndexAttributeKey, type AppwriteTableId, type AppwriteTableInput, type AppwriteTableKey, accountProviders, accountStates, appwriteDataSchemas, appwriteRelationshipIdSchema, appwriteRowSchemas, appwriteTableContract, appwriteTableIdSchema, appwriteTableIds, appwriteTables, commandStates, defineAppwriteTables, draftStates, draftTypes, jobStates, labelSpecialUses, mailboxSyncLaneStates, mailboxSyncLanes, mailboxSyncProvisionedStates, mailboxSyncStates, oauthOperations, oauthProviders, oauthReturnUriSchema, oauthReturnUris, pollShardStates, } from './tableContract/index.js';
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/appwrite/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,YAAY,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AACtF,cAAc,aAAa,CAAA;AAC3B,YAAY,EACV,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC7B,iCAAiC,GAClC,MAAM,iCAAiC,CAAA;AACxC,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,kCAAkC,EAClC,8BAA8B,EAC9B,8BAA8B,GAC/B,MAAM,iCAAiC,CAAA;AACxC,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,8BAA8B,EACnC,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,4BAA4B,EAC5B,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,WAAW,EACX,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,4BAA4B,EAC5B,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,eAAe,GAChB,MAAM,iBAAiB,CAAA"}
|
package/dist/appwrite/index.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export * from './appwrite.js';
|
|
2
|
-
export * from './commands.js';
|
|
3
|
-
export * from './functions.js';
|
|
4
|
-
export { appwriteQueryContractNames, appwriteQueryContracts, appwriteQueryIndexRequirementNames, appwriteQueryIndexRequirements, validateAppwriteQueryContracts, } from './queryContracts/queryContracts.js';
|
|
5
|
-
export { accountProviders, accountStates, appwriteDataSchemas, appwriteRelationshipIdSchema, appwriteRowSchemas, appwriteTableContract, appwriteTableIdSchema, appwriteTableIds, appwriteTables, commandStates, defineAppwriteTables, draftStates, draftTypes, jobStates, labelSpecialUses, mailboxSyncLaneStates, mailboxSyncLanes, mailboxSyncProvisionedStates, mailboxSyncStates, oauthOperations, oauthProviders, oauthReturnUriSchema, oauthReturnUris, pollShardStates, } from './tableContract/index.js';
|