Skip to content

Commit

Permalink
Converted to Context instead of Connection
Browse files Browse the repository at this point in the history
  • Loading branch information
PlagueHO committed Feb 23, 2018
1 parent c92108c commit 5d4ae23
Show file tree
Hide file tree
Showing 86 changed files with 2,449 additions and 837 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,11 @@
# Change Log

## Unreleased

- Converted all `connection` function names and parameter names
over to `context`. Aliases were implemented for old `connection`
function and parameter names to reduce possibility of breakage.

## 2.0.1.173

- Added support for CosmosDB Emulator.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Daniel Scott-Raynsford
Copyright (c) 2018 Daniel Scott-Raynsford

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
109 changes: 56 additions & 53 deletions README.md

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions RELEASENOTES.md
@@ -1,5 +1,13 @@
# Release Notes

## What is New in CosmosDB Unreleased

February 24, 2018

- Converted all `connection` function names and parameter names
over to `context`. Aliases were implemented for old `connection`
function and parameter names to reduce possibility of breakage.

## What is New in CosmosDB 2.0.1

January 27, 2018
Expand Down
23 changes: 15 additions & 8 deletions appveyor.yml
Expand Up @@ -22,14 +22,14 @@ install:
build_script:
- ps: |
# Update AppVeyor Build Version by pulling from Manifest
$ManifestPath = Join-Path -Path $ENV:APPVEYOR_BUILD_FOLDER -ChildPath 'src/CosmosDB.psd1'
$ManifestContent = Get-Content -Path $ManifestPath -Raw
$Regex = '(?<=ModuleVersion\s+=\s+'')(?<ModuleVersion>.*)(?='')'
$Matches = @([regex]::matches($ManifestContent, $Regex, 'IgnoreCase'))
$manifestPath = Join-Path -Path $ENV:APPVEYOR_BUILD_FOLDER -ChildPath 'src/CosmosDB.psd1'
$manifestContent = Get-Content -Path $manifestPath -Raw
$regex = '(?<=ModuleVersion\s+=\s+'')(?<ModuleVersion>.*)(?='')'
$matches = @([regex]::matches($manifestContent, $regex, 'IgnoreCase'))
$version = $null
if ($Matches)
if ($matches)
{
$version = $Matches[0].Value
$version = $matches[0].Value
}
# Determine the new version number
Expand All @@ -48,15 +48,22 @@ build_script:
Update-AppveyorBuild -Version $newVersion
# Set the new version number in the Module Manifest
$manifestContent = $ManifestContent -replace '(?<=ModuleVersion\s+=\s+'')(?<ModuleVersion>.*)(?='')', $newVersion
Set-Content -Path $ManifestPath -Value $ManifestContent -NoNewLine
$manifestContent = $manifestContent -replace '(?<=ModuleVersion\s+=\s+'')(?<ModuleVersion>.*)(?='')', $newVersion
$manifestContent = $manifestContent -replace '## What is New in CosmosDB Unreleased', "## What is New in CosmosDB $newVersion"
Set-Content -Path $manifestPath -Value $manifestContent -NoNewLine
# Set the new version number in the CHANGELOG.md
$changeLogPath = Join-Path -Path $ENV:APPVEYOR_BUILD_FOLDER -ChildPath 'CHANGELOG.md'
$changeLogContent = Get-Content -Path $changeLogPath -Raw
$changeLogContent = $changeLogContent -replace '# Unreleased', "# $newVersion"
Set-Content -Path $changeLogPath -Value $changeLogContent -NoNewLine
# Set the new version number in the RELEASENOTES.md
$releaseNotesPath = Join-Path -Path $ENV:APPVEYOR_BUILD_FOLDER -ChildPath 'RELEASENOTES.md'
$releaseNotesContent = Get-Content -Path $releaseNotesPath -Raw
$releaseNotesContent = $releaseNotesContent -replace '## What is New in CosmosDB Unreleased', "## What is New in CosmosDB $newVersion"
Set-Content -Path $releaseNotesPath -Value $releaseNotesContent -NoNewLine
#---------------------------------#
# test configuration #
#---------------------------------#
Expand Down
5 changes: 3 additions & 2 deletions docs/ConvertTo-CosmosDbTokenDateString.md
Expand Up @@ -24,7 +24,7 @@ by the Authorization Token and in the request header.
## EXAMPLES

### Example 1
```
```powershell
PS C:\> {{ Add example code here }}
```

Expand All @@ -48,7 +48,8 @@ Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

Expand Down
179 changes: 179 additions & 0 deletions docs/Get-CosmosDbAttachment.md
@@ -0,0 +1,179 @@
---
external help file: CosmosDB-help.xml
Module Name: CosmosDB
online version:
schema: 2.0.0
---

# Get-CosmosDbAttachment

## SYNOPSIS
Return the attachments for a CosmosDB document.

## SYNTAX

### Context (Default)
```
Get-CosmosDbAttachment -Context <Context> [-Key <SecureString>] [-KeyType <String>] [-Database <String>]
-CollectionId <String> -DocumentId <String> [-Id <String>] [<CommonParameters>]
```

### Account
```
Get-CosmosDbAttachment -Account <String> [-Key <SecureString>] [-KeyType <String>] [-Database <String>]
-CollectionId <String> -DocumentId <String> [-Id <String>] [<CommonParameters>]
```

## DESCRIPTION
This cmdlet will return the attachments for a specified document
in a CosmosDB database.
If an Id is specified then only the
specified permission will be returned.

## EXAMPLES

### Example 1
```powershell
PS C:\> {{ Add example code here }}
```

{{ Add example description here }}

## PARAMETERS

### -Context
This is an object containing the context information of
the CosmosDB database that will be accessed.
It should be created
by \`New-CosmosDbContext\`.

```yaml
Type: Context
Parameter Sets: Context
Aliases: Connection

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Account
The account name of the CosmosDB to access.

```yaml
Type: String
Parameter Sets: Account
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Key
The key to be used to access this CosmosDB.

```yaml
Type: SecureString
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -KeyType
The type of key that will be used to access ths CosmosDB.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: Master
Accept pipeline input: False
Accept wildcard characters: False
```

### -Database
The name of the database to access in the CosmosDB account.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -CollectionId
This is the Id of the collection to get the attachments for.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -DocumentId
This is the Id of the document to get the attachments for.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Id
This is the Id of the attachment to retrieve.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

### System.Object

## NOTES

## RELATED LINKS
107 changes: 107 additions & 0 deletions docs/Get-CosmosDbAttachmentResourcePath.md
@@ -0,0 +1,107 @@
---
external help file: CosmosDB-help.xml
Module Name: CosmosDB
online version:
schema: 2.0.0
---

# Get-CosmosDbAttachmentResourcePath

## SYNOPSIS
Return the resource path for an attachment object.

## SYNTAX

```
Get-CosmosDbAttachmentResourcePath [-Database] <String> [-CollectionId] <String> [-DocumentId] <String>
[-Id] <String> [<CommonParameters>]
```

## DESCRIPTION
This cmdlet returns the resource identifier for an
attachment object.

## EXAMPLES

### Example 1
```powershell
PS C:\> {{ Add example code here }}
```

{{ Add example description here }}

## PARAMETERS

### -Database
This is the database containing the attachment.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -CollectionId
This is the Id of the collection containing the attachment.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -DocumentId
This is the Id of the document containing the attachment.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Id
This is the Id of the attachment.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

### System.String

## NOTES

## RELATED LINKS

0 comments on commit 5d4ae23

Please sign in to comment.