box-node-sdk 3.8.0 → 3.8.2
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/README.md +89 -69
- package/config/package.schema.json +42 -42
- package/lib/api-request-manager.d.ts +0 -2
- package/lib/api-request-manager.js.map +1 -1
- package/lib/api-request.d.ts +0 -3
- package/lib/api-request.js.map +1 -1
- package/lib/box-client.d.ts +7 -7
- package/lib/box-client.js +6 -3
- package/lib/box-client.js.map +1 -1
- package/lib/box-node-sdk.d.ts +1 -3
- package/lib/box-node-sdk.js +26 -10
- package/lib/box-node-sdk.js.map +1 -1
- package/lib/chunked-uploader.d.ts +0 -5
- package/lib/chunked-uploader.js.map +1 -1
- package/lib/enterprise-event-stream.d.ts +0 -1
- package/lib/enterprise-event-stream.js +3 -3
- package/lib/enterprise-event-stream.js.map +1 -1
- package/lib/event-stream.d.ts +0 -2
- package/lib/event-stream.js.map +1 -1
- package/lib/managers/ai.generated.js.map +1 -1
- package/lib/managers/collaboration-allowlist.js.map +1 -1
- package/lib/managers/collaborations.d.ts +3 -3
- package/lib/managers/collaborations.js +23 -23
- package/lib/managers/collaborations.js.map +1 -1
- package/lib/managers/collections.js.map +1 -1
- package/lib/managers/comments.js.map +1 -1
- package/lib/managers/device-pins.js.map +1 -1
- package/lib/managers/enterprise.js.map +1 -1
- package/lib/managers/events.d.ts +0 -1
- package/lib/managers/events.js +3 -1
- package/lib/managers/events.js.map +1 -1
- package/lib/managers/file-requests-manager.d.ts +2 -2
- package/lib/managers/file-requests-manager.js +1 -1
- package/lib/managers/file-requests-manager.js.map +1 -1
- package/lib/managers/files.d.ts +1 -4
- package/lib/managers/files.js +6 -2
- package/lib/managers/files.js.map +1 -1
- package/lib/managers/folders.d.ts +1 -1
- package/lib/managers/folders.js +3 -1
- package/lib/managers/folders.js.map +1 -1
- package/lib/managers/groups.js +2 -2
- package/lib/managers/groups.js.map +1 -1
- package/lib/managers/integration-mappings.js.map +1 -1
- package/lib/managers/legal-hold-policies.js.map +1 -1
- package/lib/managers/metadata.js.map +1 -1
- package/lib/managers/recent-items.js.map +1 -1
- package/lib/managers/retention-policies.d.ts +1 -1
- package/lib/managers/retention-policies.js.map +1 -1
- package/lib/managers/search.d.ts +1 -1
- package/lib/managers/search.js.map +1 -1
- package/lib/managers/shared-items.js.map +1 -1
- package/lib/managers/shield-information-barrier-reports.generated.js.map +1 -1
- package/lib/managers/shield-information-barrier-segment-members.generated.js.map +1 -1
- package/lib/managers/shield-information-barrier-segment-restrictions.generated.js.map +1 -1
- package/lib/managers/shield-information-barrier-segments.generated.js.map +1 -1
- package/lib/managers/shield-information-barriers.generated.js.map +1 -1
- package/lib/managers/sign-requests.generated.js.map +1 -1
- package/lib/managers/sign-templates.generated.js.map +1 -1
- package/lib/managers/storage-policies.js.map +1 -1
- package/lib/managers/tasks.js.map +1 -1
- package/lib/managers/terms-of-service.js.map +1 -1
- package/lib/managers/trash.js.map +1 -1
- package/lib/managers/users.d.ts +0 -3
- package/lib/managers/users.js +1 -1
- package/lib/managers/users.js.map +1 -1
- package/lib/managers/web-links.js +3 -1
- package/lib/managers/web-links.js.map +1 -1
- package/lib/managers/webhooks.d.ts +11 -11
- package/lib/managers/webhooks.js +24 -14
- package/lib/managers/webhooks.js.map +1 -1
- package/lib/schemas/collaboration-update.d.ts +1 -1
- package/lib/schemas/collaboration.d.ts +3 -3
- package/lib/schemas/collaborations.d.ts +1 -1
- package/lib/schemas/file-request.d.ts +2 -2
- package/lib/sessions/app-auth-session.js.map +1 -1
- package/lib/sessions/basic-session.d.ts +0 -1
- package/lib/sessions/basic-session.js.map +1 -1
- package/lib/sessions/ccg-session.js.map +1 -1
- package/lib/sessions/persistent-session.js.map +1 -1
- package/lib/token-manager.js +4 -2
- package/lib/token-manager.js.map +1 -1
- package/lib/util/config.d.ts +0 -2
- package/lib/util/config.js +18 -8
- package/lib/util/config.js.map +1 -1
- package/lib/util/errors.js +17 -7
- package/lib/util/errors.js.map +1 -1
- package/lib/util/exponential-backoff.js.map +1 -1
- package/lib/util/paging-iterator.js +17 -7
- package/lib/util/paging-iterator.js.map +1 -1
- package/lib/util/serializable.js.map +1 -1
- package/lib/util/url-path.js.map +1 -1
- package/lib-esm/api-request-manager.d.ts +36 -0
- package/lib-esm/api-request-manager.js +78 -0
- package/lib-esm/api-request-manager.js.map +1 -0
- package/lib-esm/api-request.d.ts +135 -0
- package/lib-esm/api-request.js +282 -0
- package/lib-esm/api-request.js.map +1 -0
- package/lib-esm/box-client.d.ts +274 -0
- package/lib-esm/box-client.js +594 -0
- package/lib-esm/box-client.js.map +1 -0
- package/lib-esm/box-node-sdk.d.ts +227 -0
- package/lib-esm/box-node-sdk.js +373 -0
- package/lib-esm/box-node-sdk.js.map +1 -0
- package/lib-esm/chunked-uploader.d.ts +128 -0
- package/lib-esm/chunked-uploader.js +276 -0
- package/lib-esm/chunked-uploader.js.map +1 -0
- package/lib-esm/enterprise-event-stream.d.ts +82 -0
- package/lib-esm/enterprise-event-stream.js +205 -0
- package/lib-esm/enterprise-event-stream.js.map +1 -0
- package/lib-esm/event-stream.d.ts +91 -0
- package/lib-esm/event-stream.js +277 -0
- package/lib-esm/event-stream.js.map +1 -0
- package/lib-esm/managers/ai.generated.d.ts +58 -0
- package/lib-esm/managers/ai.generated.js +66 -0
- package/lib-esm/managers/ai.generated.js.map +1 -0
- package/lib-esm/managers/collaboration-allowlist.d.ts +133 -0
- package/lib-esm/managers/collaboration-allowlist.js +194 -0
- package/lib-esm/managers/collaboration-allowlist.js.map +1 -0
- package/lib-esm/managers/collaborations.d.ts +173 -0
- package/lib-esm/managers/collaborations.js +252 -0
- package/lib-esm/managers/collaborations.js.map +1 -0
- package/lib-esm/managers/collections.d.ts +42 -0
- package/lib-esm/managers/collections.js +62 -0
- package/lib-esm/managers/collections.js.map +1 -0
- package/lib-esm/managers/comments.d.ts +103 -0
- package/lib-esm/managers/comments.js +175 -0
- package/lib-esm/managers/comments.js.map +1 -0
- package/lib-esm/managers/device-pins.d.ts +52 -0
- package/lib-esm/managers/device-pins.js +91 -0
- package/lib-esm/managers/device-pins.js.map +1 -0
- package/lib-esm/managers/enterprise.d.ts +164 -0
- package/lib-esm/managers/enterprise.js +193 -0
- package/lib-esm/managers/enterprise.js.map +1 -0
- package/lib-esm/managers/events.d.ts +222 -0
- package/lib-esm/managers/events.js +295 -0
- package/lib-esm/managers/events.js.map +1 -0
- package/lib-esm/managers/file-requests-manager.d.ts +56 -0
- package/lib-esm/managers/file-requests-manager.js +81 -0
- package/lib-esm/managers/file-requests-manager.js.map +1 -0
- package/lib-esm/managers/files.d.ts +817 -0
- package/lib-esm/managers/files.js +1408 -0
- package/lib-esm/managers/files.js.map +1 -0
- package/lib-esm/managers/folders.d.ts +396 -0
- package/lib-esm/managers/folders.js +570 -0
- package/lib-esm/managers/folders.js.map +1 -0
- package/lib-esm/managers/groups.d.ts +213 -0
- package/lib-esm/managers/groups.js +289 -0
- package/lib-esm/managers/groups.js.map +1 -0
- package/lib-esm/managers/integration-mappings.d.ts +116 -0
- package/lib-esm/managers/integration-mappings.js +101 -0
- package/lib-esm/managers/integration-mappings.js.map +1 -0
- package/lib-esm/managers/legal-hold-policies.d.ts +190 -0
- package/lib-esm/managers/legal-hold-policies.js +254 -0
- package/lib-esm/managers/legal-hold-policies.js.map +1 -0
- package/lib-esm/managers/metadata.d.ts +232 -0
- package/lib-esm/managers/metadata.js +288 -0
- package/lib-esm/managers/metadata.js.map +1 -0
- package/lib-esm/managers/recent-items.d.ts +38 -0
- package/lib-esm/managers/recent-items.js +49 -0
- package/lib-esm/managers/recent-items.js.map +1 -0
- package/lib-esm/managers/retention-policies.d.ts +308 -0
- package/lib-esm/managers/retention-policies.js +374 -0
- package/lib-esm/managers/retention-policies.js.map +1 -0
- package/lib-esm/managers/search.d.ts +82 -0
- package/lib-esm/managers/search.js +90 -0
- package/lib-esm/managers/search.js.map +1 -0
- package/lib-esm/managers/shared-items.d.ts +33 -0
- package/lib-esm/managers/shared-items.js +74 -0
- package/lib-esm/managers/shared-items.js.map +1 -0
- package/lib-esm/managers/shield-information-barrier-reports.generated.d.ts +65 -0
- package/lib-esm/managers/shield-information-barrier-reports.generated.js +65 -0
- package/lib-esm/managers/shield-information-barrier-reports.generated.js.map +1 -0
- package/lib-esm/managers/shield-information-barrier-segment-members.generated.d.ts +83 -0
- package/lib-esm/managers/shield-information-barrier-segment-members.generated.js +83 -0
- package/lib-esm/managers/shield-information-barrier-segment-members.generated.js.map +1 -0
- package/lib-esm/managers/shield-information-barrier-segment-restrictions.generated.d.ts +84 -0
- package/lib-esm/managers/shield-information-barrier-segment-restrictions.generated.js +84 -0
- package/lib-esm/managers/shield-information-barrier-segment-restrictions.generated.js.map +1 -0
- package/lib-esm/managers/shield-information-barrier-segments.generated.d.ts +98 -0
- package/lib-esm/managers/shield-information-barrier-segments.generated.js +99 -0
- package/lib-esm/managers/shield-information-barrier-segments.generated.js.map +1 -0
- package/lib-esm/managers/shield-information-barriers.generated.d.ts +79 -0
- package/lib-esm/managers/shield-information-barriers.generated.js +83 -0
- package/lib-esm/managers/shield-information-barriers.generated.js.map +1 -0
- package/lib-esm/managers/sign-requests.generated.d.ts +93 -0
- package/lib-esm/managers/sign-requests.generated.js +97 -0
- package/lib-esm/managers/sign-requests.generated.js.map +1 -0
- package/lib-esm/managers/sign-templates.generated.d.ts +51 -0
- package/lib-esm/managers/sign-templates.generated.js +49 -0
- package/lib-esm/managers/sign-templates.generated.js.map +1 -0
- package/lib-esm/managers/storage-policies.d.ts +86 -0
- package/lib-esm/managers/storage-policies.js +174 -0
- package/lib-esm/managers/storage-policies.js.map +1 -0
- package/lib-esm/managers/tasks.d.ts +161 -0
- package/lib-esm/managers/tasks.js +243 -0
- package/lib-esm/managers/tasks.js.map +1 -0
- package/lib-esm/managers/terms-of-service.d.ts +161 -0
- package/lib-esm/managers/terms-of-service.js +283 -0
- package/lib-esm/managers/terms-of-service.js.map +1 -0
- package/lib-esm/managers/trash.d.ts +30 -0
- package/lib-esm/managers/trash.js +47 -0
- package/lib-esm/managers/trash.js.map +1 -0
- package/lib-esm/managers/users.d.ts +171 -0
- package/lib-esm/managers/users.js +230 -0
- package/lib-esm/managers/users.js.map +1 -0
- package/lib-esm/managers/web-links.d.ts +127 -0
- package/lib-esm/managers/web-links.js +200 -0
- package/lib-esm/managers/web-links.js.map +1 -0
- package/lib-esm/managers/webhooks.d.ts +169 -0
- package/lib-esm/managers/webhooks.js +398 -0
- package/lib-esm/managers/webhooks.js.map +1 -0
- package/lib-esm/schemas/ai-agent-ask.generated.d.ts +17 -0
- package/lib-esm/schemas/ai-agent-ask.generated.js +3 -0
- package/lib-esm/schemas/ai-agent-ask.generated.js.map +1 -0
- package/lib-esm/schemas/ai-agent-basic-gen-tool.generated.d.ts +14 -0
- package/lib-esm/schemas/ai-agent-basic-gen-tool.generated.js +3 -0
- package/lib-esm/schemas/ai-agent-basic-gen-tool.generated.js.map +1 -0
- package/lib-esm/schemas/ai-agent-basic-text-tool-ask.generated.d.ts +34 -0
- package/lib-esm/schemas/ai-agent-basic-text-tool-ask.generated.js +3 -0
- package/lib-esm/schemas/ai-agent-basic-text-tool-ask.generated.js.map +1 -0
- package/lib-esm/schemas/ai-agent-basic-text-tool-text-gen.generated.d.ts +36 -0
- package/lib-esm/schemas/ai-agent-basic-text-tool-text-gen.generated.js +3 -0
- package/lib-esm/schemas/ai-agent-basic-text-tool-text-gen.generated.js.map +1 -0
- package/lib-esm/schemas/ai-agent-long-text-tool.generated.d.ts +9 -0
- package/lib-esm/schemas/ai-agent-long-text-tool.generated.js +3 -0
- package/lib-esm/schemas/ai-agent-long-text-tool.generated.js.map +1 -0
- package/lib-esm/schemas/ai-agent-text-gen.generated.d.ts +14 -0
- package/lib-esm/schemas/ai-agent-text-gen.generated.js +3 -0
- package/lib-esm/schemas/ai-agent-text-gen.generated.js.map +1 -0
- package/lib-esm/schemas/ai-ask.generated.d.ts +40 -0
- package/lib-esm/schemas/ai-ask.generated.js +3 -0
- package/lib-esm/schemas/ai-ask.generated.js.map +1 -0
- package/lib-esm/schemas/ai-citation.generated.d.ts +27 -0
- package/lib-esm/schemas/ai-citation.generated.js +3 -0
- package/lib-esm/schemas/ai-citation.generated.js.map +1 -0
- package/lib-esm/schemas/ai-dialogue-history.generated.d.ts +22 -0
- package/lib-esm/schemas/ai-dialogue-history.generated.js +3 -0
- package/lib-esm/schemas/ai-dialogue-history.generated.js.map +1 -0
- package/lib-esm/schemas/ai-llm-endpoint-params-google.generated.d.ts +31 -0
- package/lib-esm/schemas/ai-llm-endpoint-params-google.generated.js +3 -0
- package/lib-esm/schemas/ai-llm-endpoint-params-google.generated.js.map +1 -0
- package/lib-esm/schemas/ai-llm-endpoint-params-open-ai.generated.d.ts +43 -0
- package/lib-esm/schemas/ai-llm-endpoint-params-open-ai.generated.js +3 -0
- package/lib-esm/schemas/ai-llm-endpoint-params-open-ai.generated.js.map +1 -0
- package/lib-esm/schemas/ai-response-full.generated.d.ts +12 -0
- package/lib-esm/schemas/ai-response-full.generated.js +3 -0
- package/lib-esm/schemas/ai-response-full.generated.js.map +1 -0
- package/lib-esm/schemas/ai-response.generated.d.ts +22 -0
- package/lib-esm/schemas/ai-response.generated.js +3 -0
- package/lib-esm/schemas/ai-response.generated.js.map +1 -0
- package/lib-esm/schemas/ai-text-gen.generated.d.ts +30 -0
- package/lib-esm/schemas/ai-text-gen.generated.js +3 -0
- package/lib-esm/schemas/ai-text-gen.generated.js.map +1 -0
- package/lib-esm/schemas/collaboration-create.d.ts +5 -0
- package/lib-esm/schemas/collaboration-create.js +3 -0
- package/lib-esm/schemas/collaboration-create.js.map +1 -0
- package/lib-esm/schemas/collaboration-update.d.ts +7 -0
- package/lib-esm/schemas/collaboration-update.js +3 -0
- package/lib-esm/schemas/collaboration-update.js.map +1 -0
- package/lib-esm/schemas/collaboration.d.ts +108 -0
- package/lib-esm/schemas/collaboration.js +3 -0
- package/lib-esm/schemas/collaboration.js.map +1 -0
- package/lib-esm/schemas/collaborations.d.ts +13 -0
- package/lib-esm/schemas/collaborations.js +3 -0
- package/lib-esm/schemas/collaborations.js.map +1 -0
- package/lib-esm/schemas/enterprise-base.generated.d.ts +18 -0
- package/lib-esm/schemas/enterprise-base.generated.js +3 -0
- package/lib-esm/schemas/enterprise-base.generated.js.map +1 -0
- package/lib-esm/schemas/file-base.generated.d.ts +32 -0
- package/lib-esm/schemas/file-base.generated.js +3 -0
- package/lib-esm/schemas/file-base.generated.js.map +1 -0
- package/lib-esm/schemas/file-mini.generated.d.ts +41 -0
- package/lib-esm/schemas/file-mini.generated.js +3 -0
- package/lib-esm/schemas/file-mini.generated.js.map +1 -0
- package/lib-esm/schemas/file-request.d.ts +41 -0
- package/lib-esm/schemas/file-request.js +3 -0
- package/lib-esm/schemas/file-request.js.map +1 -0
- package/lib-esm/schemas/file-version-base.generated.d.ts +19 -0
- package/lib-esm/schemas/file-version-base.generated.js +3 -0
- package/lib-esm/schemas/file-version-base.generated.js.map +1 -0
- package/lib-esm/schemas/file-version-mini.generated.d.ts +14 -0
- package/lib-esm/schemas/file-version-mini.generated.js +3 -0
- package/lib-esm/schemas/file-version-mini.generated.js.map +1 -0
- package/lib-esm/schemas/folder-base.generated.d.ts +32 -0
- package/lib-esm/schemas/folder-base.generated.js +3 -0
- package/lib-esm/schemas/folder-base.generated.js.map +1 -0
- package/lib-esm/schemas/folder-mini.generated.d.ts +31 -0
- package/lib-esm/schemas/folder-mini.generated.js +3 -0
- package/lib-esm/schemas/folder-mini.generated.js.map +1 -0
- package/lib-esm/schemas/index.d.ts +15 -0
- package/lib-esm/schemas/index.generated.d.ts +52 -0
- package/lib-esm/schemas/index.generated.js +69 -0
- package/lib-esm/schemas/index.generated.js.map +1 -0
- package/lib-esm/schemas/index.js +32 -0
- package/lib-esm/schemas/index.js.map +1 -0
- package/lib-esm/schemas/integration-mapping-base.d.ts +23 -0
- package/lib-esm/schemas/integration-mapping-base.js +3 -0
- package/lib-esm/schemas/integration-mapping-base.js.map +1 -0
- package/lib-esm/schemas/integration-mapping-box-item-slack.d.ts +17 -0
- package/lib-esm/schemas/integration-mapping-box-item-slack.js +3 -0
- package/lib-esm/schemas/integration-mapping-box-item-slack.js.map +1 -0
- package/lib-esm/schemas/integration-mapping-partner-item-slack.d.ts +27 -0
- package/lib-esm/schemas/integration-mapping-partner-item-slack.js +3 -0
- package/lib-esm/schemas/integration-mapping-partner-item-slack.js.map +1 -0
- package/lib-esm/schemas/integration-mapping-slack-create-request.d.ts +12 -0
- package/lib-esm/schemas/integration-mapping-slack-create-request.js +3 -0
- package/lib-esm/schemas/integration-mapping-slack-create-request.js.map +1 -0
- package/lib-esm/schemas/integration-mapping-slack-options.d.ts +16 -0
- package/lib-esm/schemas/integration-mapping-slack-options.js +3 -0
- package/lib-esm/schemas/integration-mapping-slack-options.js.map +1 -0
- package/lib-esm/schemas/integration-mapping.d.ts +55 -0
- package/lib-esm/schemas/integration-mapping.js +3 -0
- package/lib-esm/schemas/integration-mapping.js.map +1 -0
- package/lib-esm/schemas/integration-mappings.d.ts +27 -0
- package/lib-esm/schemas/integration-mappings.js +3 -0
- package/lib-esm/schemas/integration-mappings.js.map +1 -0
- package/lib-esm/schemas/shield-information-barrier-base.generated.d.ts +18 -0
- package/lib-esm/schemas/shield-information-barrier-base.generated.js +3 -0
- package/lib-esm/schemas/shield-information-barrier-base.generated.js.map +1 -0
- package/lib-esm/schemas/shield-information-barrier-reference.generated.d.ts +9 -0
- package/lib-esm/schemas/shield-information-barrier-reference.generated.js +3 -0
- package/lib-esm/schemas/shield-information-barrier-reference.generated.js.map +1 -0
- package/lib-esm/schemas/shield-information-barrier-report-base.generated.d.ts +18 -0
- package/lib-esm/schemas/shield-information-barrier-report-base.generated.js +3 -0
- package/lib-esm/schemas/shield-information-barrier-report-base.generated.js.map +1 -0
- package/lib-esm/schemas/shield-information-barrier-report-details.generated.d.ts +9 -0
- package/lib-esm/schemas/shield-information-barrier-report-details.generated.js +3 -0
- package/lib-esm/schemas/shield-information-barrier-report-details.generated.js.map +1 -0
- package/lib-esm/schemas/shield-information-barrier-report.generated.d.ts +32 -0
- package/lib-esm/schemas/shield-information-barrier-report.generated.js +3 -0
- package/lib-esm/schemas/shield-information-barrier-report.generated.js.map +1 -0
- package/lib-esm/schemas/shield-information-barrier-reports.generated.d.ts +26 -0
- package/lib-esm/schemas/shield-information-barrier-reports.generated.js +3 -0
- package/lib-esm/schemas/shield-information-barrier-reports.generated.js.map +1 -0
- package/lib-esm/schemas/shield-information-barrier-segment-member-base.generated.d.ts +19 -0
- package/lib-esm/schemas/shield-information-barrier-segment-member-base.generated.js +3 -0
- package/lib-esm/schemas/shield-information-barrier-segment-member-base.generated.js.map +1 -0
- package/lib-esm/schemas/shield-information-barrier-segment-member-mini.generated.d.ts +13 -0
- package/lib-esm/schemas/shield-information-barrier-segment-member-mini.generated.js +3 -0
- package/lib-esm/schemas/shield-information-barrier-segment-member-mini.generated.js.map +1 -0
- package/lib-esm/schemas/shield-information-barrier-segment-member.generated.d.ts +39 -0
- package/lib-esm/schemas/shield-information-barrier-segment-member.generated.js +3 -0
- package/lib-esm/schemas/shield-information-barrier-segment-member.generated.js.map +1 -0
- package/lib-esm/schemas/shield-information-barrier-segment-members.generated.d.ts +26 -0
- package/lib-esm/schemas/shield-information-barrier-segment-members.generated.js +3 -0
- package/lib-esm/schemas/shield-information-barrier-segment-members.generated.js.map +1 -0
- package/lib-esm/schemas/shield-information-barrier-segment-restriction-base.generated.d.ts +20 -0
- package/lib-esm/schemas/shield-information-barrier-segment-restriction-base.generated.js +3 -0
- package/lib-esm/schemas/shield-information-barrier-segment-restriction-base.generated.js.map +1 -0
- package/lib-esm/schemas/shield-information-barrier-segment-restriction-mini.generated.d.ts +20 -0
- package/lib-esm/schemas/shield-information-barrier-segment-restriction-mini.generated.js +3 -0
- package/lib-esm/schemas/shield-information-barrier-segment-restriction-mini.generated.js.map +1 -0
- package/lib-esm/schemas/shield-information-barrier-segment-restriction.generated.d.ts +33 -0
- package/lib-esm/schemas/shield-information-barrier-segment-restriction.generated.js +3 -0
- package/lib-esm/schemas/shield-information-barrier-segment-restriction.generated.js.map +1 -0
- package/lib-esm/schemas/shield-information-barrier-segment-restrictions.generated.d.ts +26 -0
- package/lib-esm/schemas/shield-information-barrier-segment-restrictions.generated.js +3 -0
- package/lib-esm/schemas/shield-information-barrier-segment-restrictions.generated.js.map +1 -0
- package/lib-esm/schemas/shield-information-barrier-segment.generated.d.ts +50 -0
- package/lib-esm/schemas/shield-information-barrier-segment.generated.js +3 -0
- package/lib-esm/schemas/shield-information-barrier-segment.generated.js.map +1 -0
- package/lib-esm/schemas/shield-information-barrier-segments.generated.d.ts +26 -0
- package/lib-esm/schemas/shield-information-barrier-segments.generated.js +3 -0
- package/lib-esm/schemas/shield-information-barrier-segments.generated.js.map +1 -0
- package/lib-esm/schemas/shield-information-barrier.generated.d.ts +56 -0
- package/lib-esm/schemas/shield-information-barrier.generated.js +3 -0
- package/lib-esm/schemas/shield-information-barrier.generated.js.map +1 -0
- package/lib-esm/schemas/shield-information-barriers.generated.d.ts +25 -0
- package/lib-esm/schemas/shield-information-barriers.generated.js +3 -0
- package/lib-esm/schemas/shield-information-barriers.generated.js.map +1 -0
- package/lib-esm/schemas/sign-request-base.generated.d.ts +78 -0
- package/lib-esm/schemas/sign-request-base.generated.js +3 -0
- package/lib-esm/schemas/sign-request-base.generated.js.map +1 -0
- package/lib-esm/schemas/sign-request-create-request.generated.d.ts +39 -0
- package/lib-esm/schemas/sign-request-create-request.generated.js +3 -0
- package/lib-esm/schemas/sign-request-create-request.generated.js.map +1 -0
- package/lib-esm/schemas/sign-request-create-signer.generated.d.ts +95 -0
- package/lib-esm/schemas/sign-request-create-signer.generated.js +3 -0
- package/lib-esm/schemas/sign-request-create-signer.generated.js.map +1 -0
- package/lib-esm/schemas/sign-request-prefill-tag.generated.d.ts +28 -0
- package/lib-esm/schemas/sign-request-prefill-tag.generated.js +3 -0
- package/lib-esm/schemas/sign-request-prefill-tag.generated.js.map +1 -0
- package/lib-esm/schemas/sign-request-signer-input.generated.d.ts +28 -0
- package/lib-esm/schemas/sign-request-signer-input.generated.js +3 -0
- package/lib-esm/schemas/sign-request-signer-input.generated.js.map +1 -0
- package/lib-esm/schemas/sign-request-signer.generated.d.ts +34 -0
- package/lib-esm/schemas/sign-request-signer.generated.js +3 -0
- package/lib-esm/schemas/sign-request-signer.generated.js.map +1 -0
- package/lib-esm/schemas/sign-request.generated.d.ts +72 -0
- package/lib-esm/schemas/sign-request.generated.js +3 -0
- package/lib-esm/schemas/sign-request.generated.js.map +1 -0
- package/lib-esm/schemas/sign-requests.generated.d.ts +25 -0
- package/lib-esm/schemas/sign-requests.generated.js +3 -0
- package/lib-esm/schemas/sign-requests.generated.js.map +1 -0
- package/lib-esm/schemas/sign-template.generated.d.ts +94 -0
- package/lib-esm/schemas/sign-template.generated.js +3 -0
- package/lib-esm/schemas/sign-template.generated.js.map +1 -0
- package/lib-esm/schemas/sign-templates.generated.d.ts +30 -0
- package/lib-esm/schemas/sign-templates.generated.js +3 -0
- package/lib-esm/schemas/sign-templates.generated.js.map +1 -0
- package/lib-esm/schemas/template-signer-input.generated.d.ts +61 -0
- package/lib-esm/schemas/template-signer-input.generated.js +3 -0
- package/lib-esm/schemas/template-signer-input.generated.js.map +1 -0
- package/lib-esm/schemas/template-signer.generated.d.ts +43 -0
- package/lib-esm/schemas/template-signer.generated.js +3 -0
- package/lib-esm/schemas/template-signer.generated.js.map +1 -0
- package/lib-esm/schemas/user-base.generated.d.ts +18 -0
- package/lib-esm/schemas/user-base.generated.js +3 -0
- package/lib-esm/schemas/user-base.generated.js.map +1 -0
- package/lib-esm/schemas/user-integration-mappings.d.ts +19 -0
- package/lib-esm/schemas/user-integration-mappings.js +3 -0
- package/lib-esm/schemas/user-integration-mappings.js.map +1 -0
- package/lib-esm/schemas/user-mini.d.ts +6 -0
- package/lib-esm/schemas/user-mini.js +3 -0
- package/lib-esm/schemas/user-mini.js.map +1 -0
- package/lib-esm/sessions/app-auth-session.d.ts +92 -0
- package/lib-esm/sessions/app-auth-session.js +176 -0
- package/lib-esm/sessions/app-auth-session.js.map +1 -0
- package/lib-esm/sessions/basic-session.d.ts +55 -0
- package/lib-esm/sessions/basic-session.js +62 -0
- package/lib-esm/sessions/basic-session.js.map +1 -0
- package/lib-esm/sessions/ccg-session.d.ts +72 -0
- package/lib-esm/sessions/ccg-session.js +111 -0
- package/lib-esm/sessions/ccg-session.js.map +1 -0
- package/lib-esm/sessions/persistent-session.d.ts +96 -0
- package/lib-esm/sessions/persistent-session.js +234 -0
- package/lib-esm/sessions/persistent-session.js.map +1 -0
- package/lib-esm/token-manager.d.ts +191 -0
- package/lib-esm/token-manager.js +453 -0
- package/lib-esm/token-manager.js.map +1 -0
- package/lib-esm/util/config.d.ts +85 -0
- package/lib-esm/util/config.js +212 -0
- package/lib-esm/util/config.js.map +1 -0
- package/lib-esm/util/errors.d.ts +50 -0
- package/lib-esm/util/errors.js +176 -0
- package/lib-esm/util/errors.js.map +1 -0
- package/lib-esm/util/exponential-backoff.d.ts +11 -0
- package/lib-esm/util/exponential-backoff.js +17 -0
- package/lib-esm/util/exponential-backoff.js.map +1 -0
- package/lib-esm/util/paging-iterator.d.ts +53 -0
- package/lib-esm/util/paging-iterator.js +247 -0
- package/lib-esm/util/paging-iterator.js.map +1 -0
- package/lib-esm/util/serializable.d.ts +10 -0
- package/lib-esm/util/serializable.js +17 -0
- package/lib-esm/util/serializable.js.map +1 -0
- package/lib-esm/util/url-path.d.ts +16 -0
- package/lib-esm/util/url-path.js +36 -0
- package/lib-esm/util/url-path.js.map +1 -0
- package/package.json +33 -28
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Manager for the Box Collaboration Resource
|
|
4
|
+
*/
|
|
5
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
+
};
|
|
8
|
+
const url_path_1 = __importDefault(require("../util/url-path"));
|
|
9
|
+
// ------------------------------------------------------------------------------
|
|
10
|
+
// Private
|
|
11
|
+
// ------------------------------------------------------------------------------
|
|
12
|
+
const BASE_PATH = '/collaborations';
|
|
13
|
+
// ------------------------------------------------------------------------------
|
|
14
|
+
// Public
|
|
15
|
+
// ------------------------------------------------------------------------------
|
|
16
|
+
/**
|
|
17
|
+
* Simple manager for interacting with all 'Collaboration' endpoints and actions.
|
|
18
|
+
*
|
|
19
|
+
* @constructor
|
|
20
|
+
* @param {BoxClient} client - The Box API Client that is responsible for making calls to the API
|
|
21
|
+
* @returns {void}
|
|
22
|
+
*/
|
|
23
|
+
class Collaborations {
|
|
24
|
+
constructor(client) {
|
|
25
|
+
this.client = client;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Requests a collaboration object with a given ID.
|
|
29
|
+
*
|
|
30
|
+
* API Endpoint: '/collaborations/:collaborationID'
|
|
31
|
+
* Method: GET
|
|
32
|
+
*
|
|
33
|
+
* @param {string} collaborationID - Box ID of the collaboration being requested
|
|
34
|
+
* @param {Object} [options] - Additional options for the request. Can be left null in most cases.
|
|
35
|
+
* @param {Function} [callback] - Passed the collaboration information if it was acquired successfully
|
|
36
|
+
* @returns {Promise<Collaboration>} A promise resolving to the collaboration object
|
|
37
|
+
*/
|
|
38
|
+
get(collaborationID, options, callback) {
|
|
39
|
+
const params = {
|
|
40
|
+
qs: options,
|
|
41
|
+
};
|
|
42
|
+
const apiPath = (0, url_path_1.default)(BASE_PATH, collaborationID);
|
|
43
|
+
return this.client.wrapWithDefaultHandler(this.client.get)(apiPath, params, callback);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Gets a user's pending collaborations
|
|
47
|
+
*
|
|
48
|
+
* API Endpoint: '/collaborations'
|
|
49
|
+
* Method: GET
|
|
50
|
+
*
|
|
51
|
+
* @param {Function} [callback] - Called with a collection of pending collaborations if successful
|
|
52
|
+
* @returns {Promise<Collaborations>} A promise resolving to the collection of pending collaborations
|
|
53
|
+
*/
|
|
54
|
+
getPending(callback) {
|
|
55
|
+
const params = {
|
|
56
|
+
qs: {
|
|
57
|
+
status: 'pending',
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
return this.client.wrapWithDefaultHandler(this.client.get)(BASE_PATH, params, callback);
|
|
61
|
+
}
|
|
62
|
+
updateInternal(collaborationID, updates, callback) {
|
|
63
|
+
const params = {
|
|
64
|
+
body: updates,
|
|
65
|
+
};
|
|
66
|
+
const apiPath = (0, url_path_1.default)(BASE_PATH, collaborationID);
|
|
67
|
+
return this.client.wrapWithDefaultHandler(this.client.put)(apiPath, params, callback);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Update some information about a given collaboration.
|
|
71
|
+
*
|
|
72
|
+
* API Endpoint: '/collaborations/:collaborationID'
|
|
73
|
+
* Method: PUT
|
|
74
|
+
*
|
|
75
|
+
* @param {string} collaborationID - Box ID of the collaboration being requested
|
|
76
|
+
* @param {CollaborationUpdate} updates - Fields of the collaboration to be updated
|
|
77
|
+
* @param {Function} [callback] - Passed the updated collaboration information if it was acquired successfully
|
|
78
|
+
* @returns {Promise<Collaboration>} A promise resolving to the updated collaboration object
|
|
79
|
+
*/
|
|
80
|
+
update(collaborationID, updates, callback) {
|
|
81
|
+
return this.updateInternal(collaborationID, updates, callback);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Update the status of a pending collaboration.
|
|
85
|
+
*
|
|
86
|
+
* API Endpoint: '/collaborations/:collaborationID'
|
|
87
|
+
* Method: PUT
|
|
88
|
+
*
|
|
89
|
+
* @param {string} collaborationID - Box ID of the collaboration being requested
|
|
90
|
+
* @param {CollaborationStatus} newStatus - The new collaboration status ('accepted'/'rejected')
|
|
91
|
+
* @param {Function} [callback] - Passed the updated collaboration information if it was acquired successfully
|
|
92
|
+
* @returns {Promise<Collaboration>} A promise resolving to the accepted collaboration object
|
|
93
|
+
*/
|
|
94
|
+
respondToPending(collaborationID, newStatus, callback) {
|
|
95
|
+
return this.updateInternal(collaborationID, {
|
|
96
|
+
status: newStatus,
|
|
97
|
+
}, callback);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Invite a collaborator to a folder. You'll have to create the 'accessible_by' input object
|
|
101
|
+
* yourself, but the method allows for multiple types of collaborator invites. See
|
|
102
|
+
* {@link http://developers.box.com/docs/#collaborations-add-a-collaboration} for formatting
|
|
103
|
+
* help.
|
|
104
|
+
*
|
|
105
|
+
* API Endpoint: '/collaborations
|
|
106
|
+
* Method: POST
|
|
107
|
+
*
|
|
108
|
+
* @param {CollaborationAccesibleBy} accessibleBy - The accessible_by object expected by the API
|
|
109
|
+
* @param {string} itemID - Box ID of the item to which the user should be invited
|
|
110
|
+
* @param {CollaborationRole} role - The role which the invited collaborator should have
|
|
111
|
+
* @param {Object} [options] - Optional parameters for the collaboration
|
|
112
|
+
* @param {ItemType} [options.type=folder] - Type of object to be collaborated
|
|
113
|
+
* @param {boolean} [options.notify] - Determines if the user or group will receive email notifications
|
|
114
|
+
* @param {boolean} [options.can_view_path] - Whether view path collaboration feature is enabled or not
|
|
115
|
+
* @param {boolean} [options.is_access_only] - WARN: Feature not yet available.
|
|
116
|
+
* Do not display collaborated items on collaborator's All Files Pages
|
|
117
|
+
* and suppress notifications sent to collaborators regarding access-only content.
|
|
118
|
+
* This feature is going to be released in Q4. Watch our
|
|
119
|
+
* [announcements](https://developer.box.com/changelog/) to learn about its availability.
|
|
120
|
+
* @param {Function} [callback] - Called with the new collaboration if successful
|
|
121
|
+
* @returns {Promise<Collaboration>} A promise resolving to the created collaboration object
|
|
122
|
+
*/
|
|
123
|
+
create(accessibleBy, itemID, role, options, callback) {
|
|
124
|
+
const defaultOptions = {
|
|
125
|
+
type: 'folder',
|
|
126
|
+
};
|
|
127
|
+
if (typeof options === 'function') {
|
|
128
|
+
callback = options;
|
|
129
|
+
options = {};
|
|
130
|
+
}
|
|
131
|
+
options = Object.assign({}, defaultOptions, options);
|
|
132
|
+
const params = {
|
|
133
|
+
body: {
|
|
134
|
+
item: {
|
|
135
|
+
type: options.type,
|
|
136
|
+
id: itemID,
|
|
137
|
+
},
|
|
138
|
+
accessible_by: accessibleBy,
|
|
139
|
+
role,
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
if (typeof options.can_view_path === 'boolean') {
|
|
143
|
+
params.body.can_view_path = options.can_view_path;
|
|
144
|
+
}
|
|
145
|
+
if (typeof options.notify === 'boolean') {
|
|
146
|
+
params.qs = {
|
|
147
|
+
notify: options.notify,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
if (typeof options.is_access_only === 'boolean') {
|
|
151
|
+
params.body.is_access_only = options.is_access_only;
|
|
152
|
+
}
|
|
153
|
+
return this.client.wrapWithDefaultHandler(this.client.post)(BASE_PATH, params, callback);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Invite a user to collaborate on an item via their user ID.
|
|
157
|
+
*
|
|
158
|
+
* API Endpoint: '/collaborations
|
|
159
|
+
* Method: POST
|
|
160
|
+
*
|
|
161
|
+
* @param {int | string} userID - The ID of the user you'll invite as a collaborator
|
|
162
|
+
* @param {string} itemID - Box ID of the item to which the user should be invited
|
|
163
|
+
* @param {CollaborationRole} role - The role which the invited collaborator should have
|
|
164
|
+
* @param {Object} [options] - Optional parameters for the collaboration
|
|
165
|
+
* @param {ItemType} [options.type=folder] - Type of object to be collaborated
|
|
166
|
+
* @param {boolean} [options.notify] - Determines if the user will receive email notifications
|
|
167
|
+
* @param {boolean} [options.can_view_path] - Whether view path collaboration feature is enabled or not
|
|
168
|
+
* @param {Function} [callback] - Called with the new collaboration if successful
|
|
169
|
+
* @returns {Promise<Collaboration>} A promise resolving to the created collaboration object
|
|
170
|
+
*/
|
|
171
|
+
createWithUserID(userID, itemID, role, options, callback) {
|
|
172
|
+
if (typeof options === 'function') {
|
|
173
|
+
callback = options;
|
|
174
|
+
options = {};
|
|
175
|
+
}
|
|
176
|
+
const accessibleBy = {
|
|
177
|
+
type: 'user',
|
|
178
|
+
id: `${userID}`,
|
|
179
|
+
};
|
|
180
|
+
return this.create(accessibleBy, itemID, role, options, callback);
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Invite a user to collaborate on an item via their user login email address.
|
|
184
|
+
*
|
|
185
|
+
* API Endpoint: '/collaborations
|
|
186
|
+
* Method: POST
|
|
187
|
+
*
|
|
188
|
+
* @param {string} email - The collaborator's email address
|
|
189
|
+
* @param {string} itemID - Box ID of the item to which the user should be invited
|
|
190
|
+
* @param {CollaborationRole} role - The role which the invited collaborator should have
|
|
191
|
+
* @param {Object} [options] - Optional parameters for the collaboration
|
|
192
|
+
* @param {ItemType} [options.type=folder] - Type of object to be collaborated
|
|
193
|
+
* @param {boolean} [options.notify] - Determines if the user will receive email notifications
|
|
194
|
+
* @param {boolean} [options.can_view_path] - Whether view path collaboration feature is enabled or not
|
|
195
|
+
* @param {Function} [callback] - Called with the new collaboration if successful
|
|
196
|
+
* @returns {Promise<Collaboration>} A promise resolving to the created collaboration object
|
|
197
|
+
*/
|
|
198
|
+
createWithUserEmail(email, itemID, role, options, callback) {
|
|
199
|
+
if (typeof options === 'function') {
|
|
200
|
+
callback = options;
|
|
201
|
+
options = {};
|
|
202
|
+
}
|
|
203
|
+
const accessibleBy = {
|
|
204
|
+
type: 'user',
|
|
205
|
+
login: email,
|
|
206
|
+
};
|
|
207
|
+
return this.create(accessibleBy, itemID, role, options, callback);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Invite a group to collaborate on an item via their group ID.
|
|
211
|
+
*
|
|
212
|
+
* API Endpoint: '/collaborations
|
|
213
|
+
* Method: POST
|
|
214
|
+
*
|
|
215
|
+
* @param {int | string} groupID - The ID of the group you'll invite as a collaborator
|
|
216
|
+
* @param {string} itemID - Box ID of the item to which the group should be invited
|
|
217
|
+
* @param {CollaborationRole} role - The role which the invited collaborator should have
|
|
218
|
+
* @param {Object} [options] - Optional parameters for the collaboration
|
|
219
|
+
* @param {ItemType} [options.type=folder] - Type of object to be collaborated
|
|
220
|
+
* @param {boolean} [options.notify] - Determines if the group will receive email notifications
|
|
221
|
+
* @param {boolean} [options.can_view_path] - Whether view path collaboration feature is enabled or not
|
|
222
|
+
* @param {Function} [callback] - Called with the new collaboration if successful
|
|
223
|
+
* @returns {Promise<Collaboration>} A promise resolving to the created collaboration object
|
|
224
|
+
*/
|
|
225
|
+
createWithGroupID(groupID, itemID, role, options, callback) {
|
|
226
|
+
if (typeof options === 'function') {
|
|
227
|
+
callback = options;
|
|
228
|
+
options = {};
|
|
229
|
+
}
|
|
230
|
+
const accessibleBy = {
|
|
231
|
+
type: 'group',
|
|
232
|
+
id: `${groupID}`,
|
|
233
|
+
};
|
|
234
|
+
return this.create(accessibleBy, itemID, role, options, callback);
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Delete a given collaboration.
|
|
238
|
+
*
|
|
239
|
+
* API Endpoint: '/collaborations/:collaborationID'
|
|
240
|
+
* Method: DELETE
|
|
241
|
+
*
|
|
242
|
+
* @param {string} collaborationID - Box ID of the collaboration being requested
|
|
243
|
+
* @param {Function} [callback] - Empty response body passed if successful.
|
|
244
|
+
* @returns {Promise<void>} A promise resolving to nothing
|
|
245
|
+
*/
|
|
246
|
+
delete(collaborationID, callback) {
|
|
247
|
+
const apiPath = (0, url_path_1.default)(BASE_PATH, collaborationID);
|
|
248
|
+
return this.client.wrapWithDefaultHandler(this.client.del)(apiPath, null, callback);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
module.exports = Collaborations;
|
|
252
|
+
//# sourceMappingURL=collaborations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collaborations.js","sourceRoot":"","sources":["../../src/managers/collaborations.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAOH,gEAAuC;AAevC,iFAAiF;AACjF,UAAU;AACV,iFAAiF;AACjF,MAAM,SAAS,GAAG,iBAAiB,CAAC;AAE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EAAE,OAAO;YACb,EAAE,EAAE,GAAG,OAAO,EAAE;SACjB,CAAC;QACF,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,eAAuB,EAAE,QAAmB;QACjD,MAAM,OAAO,GAAG,IAAA,kBAAO,EAAC,SAAS,EAAE,eAAe,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CACxD,OAAO,EACP,IAAI,EACJ,QAAQ,CACT,CAAC;IACJ,CAAC;CACF;AAMD,iBAAS,cAAc,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Manager for the Box Collection Resource
|
|
3
|
+
*/
|
|
4
|
+
import BoxClient from '../box-client';
|
|
5
|
+
/**
|
|
6
|
+
* Simple manager for interacting with all 'Collection' endpoints and actions.
|
|
7
|
+
*
|
|
8
|
+
* @constructor
|
|
9
|
+
* @param {BoxClient} client - The Box API Client that is responsible for making calls to the API
|
|
10
|
+
* @returns {void}
|
|
11
|
+
*/
|
|
12
|
+
declare class Collections {
|
|
13
|
+
client: BoxClient;
|
|
14
|
+
constructor(client: BoxClient);
|
|
15
|
+
/**
|
|
16
|
+
* Requests all of a user's collection objects.
|
|
17
|
+
*
|
|
18
|
+
* API Endpoint: '/collections'
|
|
19
|
+
* Method: GET
|
|
20
|
+
*
|
|
21
|
+
* @param {Function} [callback] - Called with a collection of collections if successful
|
|
22
|
+
* @returns {Promise<Object>} A promise resolving to the collection of collections
|
|
23
|
+
*/
|
|
24
|
+
getAll(callback?: Function): any;
|
|
25
|
+
/**
|
|
26
|
+
* Requests the items in the collection object with a given ID.
|
|
27
|
+
*
|
|
28
|
+
* API Endpoint: '/collections/:collectionID/items'
|
|
29
|
+
* Method: GET
|
|
30
|
+
*
|
|
31
|
+
* @param {string} collectionID - Box ID of the collection with items being requested
|
|
32
|
+
* @param {Object} [options] - Additional options for the request. Can be left null in most cases.
|
|
33
|
+
* @param {Function} [callback] - Passed the items information if they were acquired successfully
|
|
34
|
+
* @returns {Promise<Object>} A promise resolving to the collection of items in the collection
|
|
35
|
+
*/
|
|
36
|
+
getItems(collectionID: string, options?: Record<string, any>, callback?: Function): any;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @module box-node-sdk/lib/managers/collections
|
|
40
|
+
* @see {@Link Collections}
|
|
41
|
+
*/
|
|
42
|
+
export = Collections;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Manager for the Box Collection Resource
|
|
4
|
+
*/
|
|
5
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
+
};
|
|
8
|
+
const url_path_1 = __importDefault(require("../util/url-path"));
|
|
9
|
+
// -----------------------------------------------------------------------------
|
|
10
|
+
// Typedefs
|
|
11
|
+
// -----------------------------------------------------------------------------
|
|
12
|
+
// ------------------------------------------------------------------------------
|
|
13
|
+
// Private
|
|
14
|
+
// ------------------------------------------------------------------------------
|
|
15
|
+
const BASE_PATH = '/collections';
|
|
16
|
+
// ------------------------------------------------------------------------------
|
|
17
|
+
// Public
|
|
18
|
+
// ------------------------------------------------------------------------------
|
|
19
|
+
/**
|
|
20
|
+
* Simple manager for interacting with all 'Collection' endpoints and actions.
|
|
21
|
+
*
|
|
22
|
+
* @constructor
|
|
23
|
+
* @param {BoxClient} client - The Box API Client that is responsible for making calls to the API
|
|
24
|
+
* @returns {void}
|
|
25
|
+
*/
|
|
26
|
+
class Collections {
|
|
27
|
+
constructor(client) {
|
|
28
|
+
this.client = client;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Requests all of a user's collection objects.
|
|
32
|
+
*
|
|
33
|
+
* API Endpoint: '/collections'
|
|
34
|
+
* Method: GET
|
|
35
|
+
*
|
|
36
|
+
* @param {Function} [callback] - Called with a collection of collections if successful
|
|
37
|
+
* @returns {Promise<Object>} A promise resolving to the collection of collections
|
|
38
|
+
*/
|
|
39
|
+
getAll(callback) {
|
|
40
|
+
return this.client.wrapWithDefaultHandler(this.client.get)(BASE_PATH, {}, callback);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Requests the items in the collection object with a given ID.
|
|
44
|
+
*
|
|
45
|
+
* API Endpoint: '/collections/:collectionID/items'
|
|
46
|
+
* Method: GET
|
|
47
|
+
*
|
|
48
|
+
* @param {string} collectionID - Box ID of the collection with items being requested
|
|
49
|
+
* @param {Object} [options] - Additional options for the request. Can be left null in most cases.
|
|
50
|
+
* @param {Function} [callback] - Passed the items information if they were acquired successfully
|
|
51
|
+
* @returns {Promise<Object>} A promise resolving to the collection of items in the collection
|
|
52
|
+
*/
|
|
53
|
+
getItems(collectionID, options, callback) {
|
|
54
|
+
var params = {
|
|
55
|
+
qs: options,
|
|
56
|
+
};
|
|
57
|
+
var apiPath = (0, url_path_1.default)(BASE_PATH, collectionID, 'items');
|
|
58
|
+
return this.client.wrapWithDefaultHandler(this.client.get)(apiPath, params, callback);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
module.exports = Collections;
|
|
62
|
+
//# sourceMappingURL=collections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.js","sourceRoot":"","sources":["../../src/managers/collections.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAOH,gEAAuC;AAEvC,gFAAgF;AAChF,WAAW;AACX,gFAAgF;AAEhF,iFAAiF;AACjF,UAAU;AACV,iFAAiF;AAEjF,MAAM,SAAS,GAAG,cAAc,CAAC;AAEjC,iFAAiF;AACjF,SAAS;AACT,iFAAiF;AAEjF;;;;;;GAMG;AACH,MAAM,WAAW;IAGf,YAAY,MAAiB;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,QAAmB;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CACxD,SAAS,EACT,EAAE,EACF,QAAQ,CACT,CAAC;IACJ,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CACN,YAAoB,EACpB,OAA6B,EAC7B,QAAmB;QAEnB,IAAI,MAAM,GAAG;YACX,EAAE,EAAE,OAAO;SACZ,CAAC;QACF,IAAI,OAAO,GAAG,IAAA,kBAAO,EAAC,SAAS,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CACxD,OAAO,EACP,MAAM,EACN,QAAQ,CACT,CAAC;IACJ,CAAC;CACF;AAMD,iBAAS,WAAW,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Manager for the Box Comments Resource
|
|
3
|
+
*/
|
|
4
|
+
import BoxClient from '../box-client';
|
|
5
|
+
/**
|
|
6
|
+
* Simple manager for interacting with all 'Comment' endpoints and actions.
|
|
7
|
+
*
|
|
8
|
+
* @constructor
|
|
9
|
+
* @param {BoxClient} client - The Box API Client that is responsible for making calls to the API
|
|
10
|
+
* @returns {void}
|
|
11
|
+
*/
|
|
12
|
+
declare class Comments {
|
|
13
|
+
client: BoxClient;
|
|
14
|
+
constructor(client: BoxClient);
|
|
15
|
+
/**
|
|
16
|
+
* Requests a comment object with the given ID.
|
|
17
|
+
*
|
|
18
|
+
* API Endpoint: '/comments/:commentID'
|
|
19
|
+
* Method: GET
|
|
20
|
+
*
|
|
21
|
+
* @param {string} commentID - Box ID of the comment being requested
|
|
22
|
+
* @param {Object} [options] - Additional options for the request. Can be left null in most cases.
|
|
23
|
+
* @param {Function} [callback] - Passed the comment information if it was acquired successfully
|
|
24
|
+
* @returns {Promise<Object>} A promise resolving to the comment object
|
|
25
|
+
*/
|
|
26
|
+
get(commentID: string, options?: Record<string, any>, callback?: Function): any;
|
|
27
|
+
/**
|
|
28
|
+
* Posts a new comment on a file.
|
|
29
|
+
*
|
|
30
|
+
* API Endpoint: '/comments
|
|
31
|
+
* Method: POST
|
|
32
|
+
*
|
|
33
|
+
* @param {string} fileID - Box file id of the file to comment on
|
|
34
|
+
* @param {string} commentBody - text of the comment
|
|
35
|
+
* @param {Function} [callback] - passed the new comment data if it was posted successfully
|
|
36
|
+
* @returns {Promise<Object>} A promise resolving to the new comment object
|
|
37
|
+
*/
|
|
38
|
+
create(fileID: string, commentBody: string, callback?: Function): any;
|
|
39
|
+
/**
|
|
40
|
+
* Posts a new tagged comment on a file.
|
|
41
|
+
*
|
|
42
|
+
* API Endpoint: '/comments
|
|
43
|
+
* Method: POST
|
|
44
|
+
*
|
|
45
|
+
* @param {string} fileID - Box file id of the file to comment on
|
|
46
|
+
* @param {string} commentBody - text of the tagged comment
|
|
47
|
+
* @param {Function} [callback] - passed the new tagged comment data if it was posted successfully
|
|
48
|
+
* @returns {Promise<Object>} A promise resolving to the new comment object
|
|
49
|
+
*/
|
|
50
|
+
createTaggedComment(fileID: string, commentBody: string, callback?: Function): any;
|
|
51
|
+
/**
|
|
52
|
+
* Posts a new comment as a reply to another comment.
|
|
53
|
+
*
|
|
54
|
+
* API Endpoint: '/comments
|
|
55
|
+
* Method: POST
|
|
56
|
+
*
|
|
57
|
+
* @param {string} commentID - Comment ID of the comment to reply to
|
|
58
|
+
* @param {string} commentBody - text of the comment
|
|
59
|
+
* @param {Function} [callback] - passed the new comment data if it was posted successfully
|
|
60
|
+
* @returns {Promise<Object>} A promise resolving to the new comment object
|
|
61
|
+
*/
|
|
62
|
+
reply(commentID: string, commentBody: string, callback?: Function): any;
|
|
63
|
+
/**
|
|
64
|
+
* Posts a new tagged comment as a reply to another comment.
|
|
65
|
+
*
|
|
66
|
+
* API Endpoint: '/comments
|
|
67
|
+
* Method: POST
|
|
68
|
+
*
|
|
69
|
+
* @param {string} commentID - Comment ID of the comment to reply to
|
|
70
|
+
* @param {string} commentBody - text of the tagged comment
|
|
71
|
+
* @param {Function} [callback] - passed the new tagged comment data if it was posted successfully
|
|
72
|
+
* @returns {Promise<Object>} A promise resolving to the new comment object
|
|
73
|
+
*/
|
|
74
|
+
createTaggedReply(commentID: string, commentBody: string, callback?: Function): any;
|
|
75
|
+
/**
|
|
76
|
+
* Update some information about a given comment.
|
|
77
|
+
*
|
|
78
|
+
* API Endpoint: '/comments/:commentID'
|
|
79
|
+
* Method: PUT
|
|
80
|
+
*
|
|
81
|
+
* @param {string} commentID - Box ID of the comment being requested
|
|
82
|
+
* @param {Object} updates - Fields to update on the comment
|
|
83
|
+
* @param {Function} [callback] - Passed the updated comment information if it was acquired successfully
|
|
84
|
+
* @returns {Promise<Object>} A promise resolving to the updated comment object
|
|
85
|
+
*/
|
|
86
|
+
update(commentID: string, updates: Record<string, any>, callback?: Function): any;
|
|
87
|
+
/**
|
|
88
|
+
* Delete a given comment.
|
|
89
|
+
*
|
|
90
|
+
* API Endpoint: '/comments/:commentID'
|
|
91
|
+
* Method: DELETE
|
|
92
|
+
*
|
|
93
|
+
* @param {string} commentID - Box ID of the comment being requested
|
|
94
|
+
* @param {Function} [callback] - Empty response body passed if successful.
|
|
95
|
+
* @returns {Promise<void>} A promise resolving to nothing
|
|
96
|
+
*/
|
|
97
|
+
delete(commentID: string, callback?: Function): any;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* @module box-node-sdk/lib/managers/comments
|
|
101
|
+
* @see {@Link Comments}
|
|
102
|
+
*/
|
|
103
|
+
export = Comments;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Manager for the Box Comments Resource
|
|
4
|
+
*/
|
|
5
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
+
};
|
|
8
|
+
const url_path_1 = __importDefault(require("../util/url-path"));
|
|
9
|
+
// -----------------------------------------------------------------------------
|
|
10
|
+
// Typedefs
|
|
11
|
+
// -----------------------------------------------------------------------------
|
|
12
|
+
// ------------------------------------------------------------------------------
|
|
13
|
+
// Private
|
|
14
|
+
// ------------------------------------------------------------------------------
|
|
15
|
+
const BASE_PATH = '/comments';
|
|
16
|
+
// ------------------------------------------------------------------------------
|
|
17
|
+
// Public
|
|
18
|
+
// ------------------------------------------------------------------------------
|
|
19
|
+
/**
|
|
20
|
+
* Simple manager for interacting with all 'Comment' endpoints and actions.
|
|
21
|
+
*
|
|
22
|
+
* @constructor
|
|
23
|
+
* @param {BoxClient} client - The Box API Client that is responsible for making calls to the API
|
|
24
|
+
* @returns {void}
|
|
25
|
+
*/
|
|
26
|
+
class Comments {
|
|
27
|
+
constructor(client) {
|
|
28
|
+
this.client = client;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Requests a comment object with the given ID.
|
|
32
|
+
*
|
|
33
|
+
* API Endpoint: '/comments/:commentID'
|
|
34
|
+
* Method: GET
|
|
35
|
+
*
|
|
36
|
+
* @param {string} commentID - Box ID of the comment being requested
|
|
37
|
+
* @param {Object} [options] - Additional options for the request. Can be left null in most cases.
|
|
38
|
+
* @param {Function} [callback] - Passed the comment information if it was acquired successfully
|
|
39
|
+
* @returns {Promise<Object>} A promise resolving to the comment object
|
|
40
|
+
*/
|
|
41
|
+
get(commentID, options, callback) {
|
|
42
|
+
var params = {
|
|
43
|
+
qs: options,
|
|
44
|
+
};
|
|
45
|
+
var apiPath = (0, url_path_1.default)(BASE_PATH, commentID);
|
|
46
|
+
return this.client.wrapWithDefaultHandler(this.client.get)(apiPath, params, callback);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Posts a new comment on a file.
|
|
50
|
+
*
|
|
51
|
+
* API Endpoint: '/comments
|
|
52
|
+
* Method: POST
|
|
53
|
+
*
|
|
54
|
+
* @param {string} fileID - Box file id of the file to comment on
|
|
55
|
+
* @param {string} commentBody - text of the comment
|
|
56
|
+
* @param {Function} [callback] - passed the new comment data if it was posted successfully
|
|
57
|
+
* @returns {Promise<Object>} A promise resolving to the new comment object
|
|
58
|
+
*/
|
|
59
|
+
create(fileID, commentBody, callback) {
|
|
60
|
+
// @TODO(bemerick) 2013-10-29: Don't hardcode this 'item'. Abstract to all commentable types...
|
|
61
|
+
var params = {
|
|
62
|
+
body: {
|
|
63
|
+
item: {
|
|
64
|
+
type: 'file',
|
|
65
|
+
id: fileID,
|
|
66
|
+
},
|
|
67
|
+
message: commentBody,
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
return this.client.wrapWithDefaultHandler(this.client.post)(BASE_PATH, params, callback);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Posts a new tagged comment on a file.
|
|
74
|
+
*
|
|
75
|
+
* API Endpoint: '/comments
|
|
76
|
+
* Method: POST
|
|
77
|
+
*
|
|
78
|
+
* @param {string} fileID - Box file id of the file to comment on
|
|
79
|
+
* @param {string} commentBody - text of the tagged comment
|
|
80
|
+
* @param {Function} [callback] - passed the new tagged comment data if it was posted successfully
|
|
81
|
+
* @returns {Promise<Object>} A promise resolving to the new comment object
|
|
82
|
+
*/
|
|
83
|
+
createTaggedComment(fileID, commentBody, callback) {
|
|
84
|
+
var params = {
|
|
85
|
+
body: {
|
|
86
|
+
item: {
|
|
87
|
+
type: 'file',
|
|
88
|
+
id: fileID,
|
|
89
|
+
},
|
|
90
|
+
tagged_message: commentBody,
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
return this.client.wrapWithDefaultHandler(this.client.post)(BASE_PATH, params, callback);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Posts a new comment as a reply to another comment.
|
|
97
|
+
*
|
|
98
|
+
* API Endpoint: '/comments
|
|
99
|
+
* Method: POST
|
|
100
|
+
*
|
|
101
|
+
* @param {string} commentID - Comment ID of the comment to reply to
|
|
102
|
+
* @param {string} commentBody - text of the comment
|
|
103
|
+
* @param {Function} [callback] - passed the new comment data if it was posted successfully
|
|
104
|
+
* @returns {Promise<Object>} A promise resolving to the new comment object
|
|
105
|
+
*/
|
|
106
|
+
reply(commentID, commentBody, callback) {
|
|
107
|
+
var params = {
|
|
108
|
+
body: {
|
|
109
|
+
item: {
|
|
110
|
+
type: 'comment',
|
|
111
|
+
id: commentID,
|
|
112
|
+
},
|
|
113
|
+
message: commentBody,
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
return this.client.wrapWithDefaultHandler(this.client.post)(BASE_PATH, params, callback);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Posts a new tagged comment as a reply to another comment.
|
|
120
|
+
*
|
|
121
|
+
* API Endpoint: '/comments
|
|
122
|
+
* Method: POST
|
|
123
|
+
*
|
|
124
|
+
* @param {string} commentID - Comment ID of the comment to reply to
|
|
125
|
+
* @param {string} commentBody - text of the tagged comment
|
|
126
|
+
* @param {Function} [callback] - passed the new tagged comment data if it was posted successfully
|
|
127
|
+
* @returns {Promise<Object>} A promise resolving to the new comment object
|
|
128
|
+
*/
|
|
129
|
+
createTaggedReply(commentID, commentBody, callback) {
|
|
130
|
+
var params = {
|
|
131
|
+
body: {
|
|
132
|
+
item: {
|
|
133
|
+
type: 'comment',
|
|
134
|
+
id: commentID,
|
|
135
|
+
},
|
|
136
|
+
tagged_message: commentBody,
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
return this.client.wrapWithDefaultHandler(this.client.post)(BASE_PATH, params, callback);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Update some information about a given comment.
|
|
143
|
+
*
|
|
144
|
+
* API Endpoint: '/comments/:commentID'
|
|
145
|
+
* Method: PUT
|
|
146
|
+
*
|
|
147
|
+
* @param {string} commentID - Box ID of the comment being requested
|
|
148
|
+
* @param {Object} updates - Fields to update on the comment
|
|
149
|
+
* @param {Function} [callback] - Passed the updated comment information if it was acquired successfully
|
|
150
|
+
* @returns {Promise<Object>} A promise resolving to the updated comment object
|
|
151
|
+
*/
|
|
152
|
+
update(commentID, updates, callback) {
|
|
153
|
+
var params = {
|
|
154
|
+
body: updates,
|
|
155
|
+
};
|
|
156
|
+
var apiPath = (0, url_path_1.default)(BASE_PATH, commentID);
|
|
157
|
+
return this.client.wrapWithDefaultHandler(this.client.put)(apiPath, params, callback);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Delete a given comment.
|
|
161
|
+
*
|
|
162
|
+
* API Endpoint: '/comments/:commentID'
|
|
163
|
+
* Method: DELETE
|
|
164
|
+
*
|
|
165
|
+
* @param {string} commentID - Box ID of the comment being requested
|
|
166
|
+
* @param {Function} [callback] - Empty response body passed if successful.
|
|
167
|
+
* @returns {Promise<void>} A promise resolving to nothing
|
|
168
|
+
*/
|
|
169
|
+
delete(commentID, callback) {
|
|
170
|
+
var apiPath = (0, url_path_1.default)(BASE_PATH, commentID);
|
|
171
|
+
return this.client.wrapWithDefaultHandler(this.client.del)(apiPath, null, callback);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
module.exports = Comments;
|
|
175
|
+
//# sourceMappingURL=comments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comments.js","sourceRoot":"","sources":["../../src/managers/comments.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAOH,gEAAuC;AAEvC,gFAAgF;AAChF,WAAW;AACX,gFAAgF;AAEhF,iFAAiF;AACjF,UAAU;AACV,iFAAiF;AAEjF,MAAM,SAAS,GAAG,WAAW,CAAC;AAE9B,iFAAiF;AACjF,SAAS;AACT,iFAAiF;AAEjF;;;;;;GAMG;AACH,MAAM,QAAQ;IAGZ,YAAY,MAAiB;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,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