@trycourier/cli 2.7.1 → 3.1.4
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/bin/.gitkeep +0 -0
- package/install.js +115 -0
- package/package.json +22 -87
- package/LICENSE +0 -21
- package/README.md +0 -105
- package/dist/bulk.d.ts +0 -15
- package/dist/bulk.js +0 -53
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js +0 -24
- package/dist/commands/AudienceSearch.d.ts +0 -3
- package/dist/commands/AudienceSearch.js +0 -113
- package/dist/commands/AutomationInvokeBulk.d.ts +0 -3
- package/dist/commands/AutomationInvokeBulk.js +0 -139
- package/dist/commands/Config.d.ts +0 -4
- package/dist/commands/Config.js +0 -45
- package/dist/commands/DigestFlush.d.ts +0 -5
- package/dist/commands/DigestFlush.js +0 -28
- package/dist/commands/Help.d.ts +0 -16
- package/dist/commands/Help.js +0 -38
- package/dist/commands/Inbox/ArchiveAll.d.ts +0 -8
- package/dist/commands/Inbox/ArchiveAll.js +0 -180
- package/dist/commands/Inbox/ArchiveAllBulk.d.ts +0 -5
- package/dist/commands/Inbox/ArchiveAllBulk.js +0 -99
- package/dist/commands/Inbox/MarkAllRead.d.ts +0 -5
- package/dist/commands/Inbox/MarkAllRead.js +0 -110
- package/dist/commands/MessagesSearch.d.ts +0 -3
- package/dist/commands/MessagesSearch.js +0 -120
- package/dist/commands/NotYetImplemented.d.ts +0 -3
- package/dist/commands/NotYetImplemented.js +0 -5
- package/dist/commands/Send.d.ts +0 -5
- package/dist/commands/Send.js +0 -144
- package/dist/commands/Templates/List.d.ts +0 -3
- package/dist/commands/Templates/List.js +0 -114
- package/dist/commands/TenantsBulk.d.ts +0 -3
- package/dist/commands/TenantsBulk.js +0 -171
- package/dist/commands/TenantsGetMembership.d.ts +0 -3
- package/dist/commands/TenantsGetMembership.js +0 -127
- package/dist/commands/TenantsMembershipBulk.d.ts +0 -3
- package/dist/commands/TenantsMembershipBulk.js +0 -203
- package/dist/commands/Track.d.ts +0 -5
- package/dist/commands/Track.js +0 -40
- package/dist/commands/TrackBulk.d.ts +0 -3
- package/dist/commands/TrackBulk.js +0 -89
- package/dist/commands/TranslationsDownload.d.ts +0 -10
- package/dist/commands/TranslationsDownload.js +0 -30
- package/dist/commands/TranslationsUpload.d.ts +0 -9
- package/dist/commands/TranslationsUpload.js +0 -37
- package/dist/commands/Upgrade.d.ts +0 -3
- package/dist/commands/Upgrade.js +0 -38
- package/dist/commands/UserToken.d.ts +0 -3
- package/dist/commands/UserToken.js +0 -78
- package/dist/commands/UsersBulk.d.ts +0 -3
- package/dist/commands/UsersBulk.js +0 -205
- package/dist/commands/UsersGet.d.ts +0 -5
- package/dist/commands/UsersGet.js +0 -37
- package/dist/commands/UsersPreferences.d.ts +0 -3
- package/dist/commands/UsersPreferences.js +0 -73
- package/dist/commands/UsersSet.d.ts +0 -5
- package/dist/commands/UsersSet.js +0 -34
- package/dist/commands/UsersTokensBulk.d.ts +0 -3
- package/dist/commands/UsersTokensBulk.js +0 -215
- package/dist/commands/WhoAmI.d.ts +0 -3
- package/dist/commands/WhoAmI.js +0 -27
- package/dist/components/Context.d.ts +0 -55
- package/dist/components/Context.js +0 -94
- package/dist/components/Elemental.d.ts +0 -13
- package/dist/components/Elemental.js +0 -23
- package/dist/components/KVP.d.ts +0 -11
- package/dist/components/KVP.js +0 -12
- package/dist/components/Request.d.ts +0 -23
- package/dist/components/Request.js +0 -17
- package/dist/components/Response.d.ts +0 -16
- package/dist/components/Response.js +0 -29
- package/dist/components/Router.d.ts +0 -4
- package/dist/components/Router.js +0 -60
- package/dist/components/SdkResponse.d.ts +0 -9
- package/dist/components/SdkResponse.js +0 -21
- package/dist/components/Spinner.d.ts +0 -6
- package/dist/components/Spinner.js +0 -41
- package/dist/components/Table.d.ts +0 -19
- package/dist/components/Table.js +0 -62
- package/dist/components/UhOh.d.ts +0 -5
- package/dist/components/UhOh.js +0 -10
- package/dist/components/Version.d.ts +0 -3
- package/dist/components/Version.js +0 -53
- package/dist/constants.d.ts +0 -8
- package/dist/constants.js +0 -8
- package/dist/lib/api.d.ts +0 -17
- package/dist/lib/api.js +0 -39
- package/dist/lib/args.d.ts +0 -2
- package/dist/lib/args.js +0 -13
- package/dist/lib/courier.d.ts +0 -3
- package/dist/lib/courier.js +0 -7
- package/dist/lib/delay.d.ts +0 -2
- package/dist/lib/delay.js +0 -7
- package/dist/lib/load-env.d.ts +0 -2
- package/dist/lib/load-env.js +0 -16
- package/dist/lib/uuid.d.ts +0 -2
- package/dist/lib/uuid.js +0 -4
- package/dist/mappings.d.ts +0 -6
- package/dist/mappings.js +0 -559
- package/dist/version.d.ts +0 -2
- package/dist/version.js +0 -2
package/dist/lib/api.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
interface IRequest {
|
|
2
|
-
url: string;
|
|
3
|
-
method: string;
|
|
4
|
-
body?: object | string;
|
|
5
|
-
headers?: {
|
|
6
|
-
[key: string]: string;
|
|
7
|
-
};
|
|
8
|
-
options?: RequestInit;
|
|
9
|
-
}
|
|
10
|
-
interface IResponse {
|
|
11
|
-
res: Response;
|
|
12
|
-
json?: any;
|
|
13
|
-
text?: string;
|
|
14
|
-
err?: Error;
|
|
15
|
-
}
|
|
16
|
-
declare const _default: (request: IRequest, baseUrl: string, apikey: string) => Promise<IResponse>;
|
|
17
|
-
export default _default;
|
package/dist/lib/api.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import VERSION from "../version.js";
|
|
2
|
-
const isString = (s) => {
|
|
3
|
-
return typeof s === 'string' || s instanceof String;
|
|
4
|
-
};
|
|
5
|
-
export default async (request, baseUrl, apikey) => {
|
|
6
|
-
const req = {
|
|
7
|
-
method: request.method,
|
|
8
|
-
headers: {
|
|
9
|
-
Authorization: `Bearer ${apikey}`,
|
|
10
|
-
'Content-Type': 'application/json',
|
|
11
|
-
'User-Agent': `courier-cli/${VERSION}`,
|
|
12
|
-
'X-Courier-CLI-Version': VERSION,
|
|
13
|
-
...request.headers,
|
|
14
|
-
},
|
|
15
|
-
body: request.body && !isString(request.body)
|
|
16
|
-
? JSON.stringify(request.body)
|
|
17
|
-
: request.body?.toString(),
|
|
18
|
-
...request.options,
|
|
19
|
-
};
|
|
20
|
-
return fetch(`${baseUrl}${request.url}`, req).then(res => {
|
|
21
|
-
if (res.status > 400) {
|
|
22
|
-
return {
|
|
23
|
-
res,
|
|
24
|
-
err: new Error(`${res.status}: ${res.statusText}`),
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
else if (res.status === 204) {
|
|
28
|
-
return { res };
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
if (res.headers.get('Content-Type')?.includes('application/json')) {
|
|
32
|
-
return res.json().then(json => ({ res, json }));
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
return res.text().then(text => ({ res, text }));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
};
|
package/dist/lib/args.d.ts
DELETED
package/dist/lib/args.js
DELETED
package/dist/lib/courier.d.ts
DELETED
package/dist/lib/courier.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CourierClient } from "@trycourier/courier";
|
|
2
|
-
const getClient = (environment = 'production') => {
|
|
3
|
-
return new CourierClient({
|
|
4
|
-
authorizationToken: environment ? process.env['COURIER_AUTH_TOKEN'] : process.env['COURIER_AUTH_TOKEN_TEST'],
|
|
5
|
-
});
|
|
6
|
-
};
|
|
7
|
-
export default getClient;
|
package/dist/lib/delay.d.ts
DELETED
package/dist/lib/delay.js
DELETED
package/dist/lib/load-env.d.ts
DELETED
package/dist/lib/load-env.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import os from 'os';
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
import dotenv from 'dotenv';
|
|
4
|
-
export default async () => {
|
|
5
|
-
const paths = [
|
|
6
|
-
`${process.cwd()}/.courier`, // current working directory
|
|
7
|
-
`${os.homedir()}/.courier`, // user home directory
|
|
8
|
-
];
|
|
9
|
-
for (const path of paths) {
|
|
10
|
-
if (fs.existsSync(path)) {
|
|
11
|
-
dotenv.config({ path });
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return false;
|
|
16
|
-
};
|
package/dist/lib/uuid.d.ts
DELETED
package/dist/lib/uuid.js
DELETED