@trycourier/courier 7.3.0 → 7.7.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/CHANGELOG.md +115 -0
- package/LICENSE +1 -1
- package/README.md +34 -345
- package/client.d.mts +50 -8
- package/client.d.mts.map +1 -1
- package/client.d.ts +50 -8
- package/client.d.ts.map +1 -1
- package/client.js +17 -4
- package/client.js.map +1 -1
- package/client.mjs +18 -5
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/utils/query.d.mts +2 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +10 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +6 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +1 -1
- package/resources/audiences.d.mts +11 -33
- package/resources/audiences.d.mts.map +1 -1
- package/resources/audiences.d.ts +11 -33
- package/resources/audiences.d.ts.map +1 -1
- package/resources/automations/automations.d.mts +54 -1
- package/resources/automations/automations.d.mts.map +1 -1
- package/resources/automations/automations.d.ts +54 -1
- package/resources/automations/automations.d.ts.map +1 -1
- package/resources/automations/automations.js +12 -0
- package/resources/automations/automations.js.map +1 -1
- package/resources/automations/automations.mjs +12 -0
- package/resources/automations/automations.mjs.map +1 -1
- package/resources/automations/index.d.mts +1 -1
- package/resources/automations/index.d.mts.map +1 -1
- package/resources/automations/index.d.ts +1 -1
- package/resources/automations/index.d.ts.map +1 -1
- package/resources/automations/index.js.map +1 -1
- package/resources/automations/index.mjs +1 -1
- package/resources/automations/index.mjs.map +1 -1
- package/resources/bulk.d.mts +80 -39
- package/resources/bulk.d.mts.map +1 -1
- package/resources/bulk.d.ts +80 -39
- package/resources/bulk.d.ts.map +1 -1
- package/resources/bulk.js +12 -2
- package/resources/bulk.js.map +1 -1
- package/resources/bulk.mjs +12 -2
- package/resources/bulk.mjs.map +1 -1
- package/resources/inbound.d.mts +1 -1
- package/resources/inbound.d.ts +1 -1
- package/resources/index.d.mts +3 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/lists/subscriptions.d.mts +1 -1
- package/resources/lists/subscriptions.d.ts +1 -1
- package/resources/notifications/checks.d.mts +2 -2
- package/resources/notifications/checks.d.ts +2 -2
- package/resources/send.d.mts +8 -2
- package/resources/send.d.mts.map +1 -1
- package/resources/send.d.ts +8 -2
- package/resources/send.d.ts.map +1 -1
- package/resources/send.js +1 -1
- package/resources/send.mjs +1 -1
- package/resources/shared.d.mts +290 -52
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +290 -52
- package/resources/shared.d.ts.map +1 -1
- package/resources/tenants/index.d.mts +2 -2
- package/resources/tenants/index.d.mts.map +1 -1
- package/resources/tenants/index.d.ts +2 -2
- package/resources/tenants/index.d.ts.map +1 -1
- package/resources/tenants/index.js +2 -2
- package/resources/tenants/index.js.map +1 -1
- package/resources/tenants/index.mjs +1 -1
- package/resources/tenants/index.mjs.map +1 -1
- package/resources/tenants/preferences/items.d.mts +2 -2
- package/resources/tenants/preferences/items.d.ts +2 -2
- package/resources/tenants/templates/index.d.mts +3 -0
- package/resources/tenants/templates/index.d.mts.map +1 -0
- package/resources/tenants/templates/index.d.ts +3 -0
- package/resources/tenants/templates/index.d.ts.map +1 -0
- package/resources/tenants/templates/index.js +9 -0
- package/resources/tenants/templates/index.js.map +1 -0
- package/resources/tenants/templates/index.mjs +4 -0
- package/resources/tenants/templates/index.mjs.map +1 -0
- package/resources/tenants/templates/templates.d.mts +159 -0
- package/resources/tenants/templates/templates.d.mts.map +1 -0
- package/resources/tenants/templates/templates.d.ts +159 -0
- package/resources/tenants/templates/templates.d.ts.map +1 -0
- package/resources/tenants/templates/templates.js +91 -0
- package/resources/tenants/templates/templates.js.map +1 -0
- package/resources/tenants/templates/templates.mjs +86 -0
- package/resources/tenants/templates/templates.mjs.map +1 -0
- package/resources/tenants/templates/versions.d.mts +39 -0
- package/resources/tenants/templates/versions.d.mts.map +1 -0
- package/resources/tenants/templates/versions.d.ts +39 -0
- package/resources/tenants/templates/versions.d.ts.map +1 -0
- package/resources/tenants/templates/versions.js +32 -0
- package/resources/tenants/templates/versions.js.map +1 -0
- package/resources/tenants/templates/versions.mjs +28 -0
- package/resources/tenants/templates/versions.mjs.map +1 -0
- package/resources/tenants/templates.d.mts +1 -90
- package/resources/tenants/templates.d.mts.map +1 -1
- package/resources/tenants/templates.d.ts +1 -90
- package/resources/tenants/templates.d.ts.map +1 -1
- package/resources/tenants/templates.js +2 -34
- package/resources/tenants/templates.js.map +1 -1
- package/resources/tenants/templates.mjs +1 -32
- package/resources/tenants/templates.mjs.map +1 -1
- package/resources/tenants/tenants.d.mts +147 -5
- package/resources/tenants/tenants.d.mts.map +1 -1
- package/resources/tenants/tenants.d.ts +147 -5
- package/resources/tenants/tenants.d.ts.map +1 -1
- package/resources/tenants/tenants.js +2 -2
- package/resources/tenants/tenants.js.map +1 -1
- package/resources/tenants/tenants.mjs +2 -2
- package/resources/tenants/tenants.mjs.map +1 -1
- package/resources/translations.d.mts +1 -1
- package/resources/translations.d.ts +1 -1
- package/resources/users/preferences.d.mts +1 -1
- package/resources/users/preferences.d.ts +1 -1
- package/resources/users/tenants.d.mts +1 -1
- package/resources/users/tenants.d.ts +1 -1
- package/resources/users/tokens.d.mts +3 -8
- package/resources/users/tokens.d.mts.map +1 -1
- package/resources/users/tokens.d.ts +3 -8
- package/resources/users/tokens.d.ts.map +1 -1
- package/resources/users/tokens.js +2 -3
- package/resources/users/tokens.js.map +1 -1
- package/resources/users/tokens.mjs +2 -3
- package/resources/users/tokens.mjs.map +1 -1
- package/src/client.ts +88 -14
- package/src/internal/parse.ts +6 -0
- package/src/internal/utils/query.ts +7 -0
- package/src/internal/utils.ts +1 -0
- package/src/resources/audiences.ts +11 -69
- package/src/resources/automations/automations.ts +74 -1
- package/src/resources/automations/index.ts +7 -1
- package/src/resources/bulk.ts +71 -32
- package/src/resources/inbound.ts +1 -1
- package/src/resources/index.ts +12 -3
- package/src/resources/lists/subscriptions.ts +1 -1
- package/src/resources/notifications/checks.ts +2 -2
- package/src/resources/send.ts +28 -2
- package/src/resources/shared.ts +391 -49
- package/src/resources/tenants/index.ts +8 -1
- package/src/resources/tenants/preferences/items.ts +2 -2
- package/src/resources/tenants/templates/index.ts +11 -0
- package/src/resources/tenants/templates/templates.ts +222 -0
- package/src/resources/tenants/templates/versions.ts +55 -0
- package/src/resources/tenants/templates.ts +1 -122
- package/src/resources/tenants/tenants.ts +179 -3
- package/src/resources/translations.ts +1 -1
- package/src/resources/users/preferences.ts +1 -1
- package/src/resources/users/tenants.ts +1 -1
- package/src/resources/users/tokens.ts +4 -10
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import * as Shared from "../../shared.mjs";
|
|
3
|
+
import * as TenantsAPI from "../tenants.mjs";
|
|
4
|
+
import * as VersionsAPI from "./versions.mjs";
|
|
5
|
+
import { VersionRetrieveParams, Versions } from "./versions.mjs";
|
|
6
|
+
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
7
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
8
|
+
export declare class Templates extends APIResource {
|
|
9
|
+
versions: VersionsAPI.Versions;
|
|
10
|
+
/**
|
|
11
|
+
* Get a Template in Tenant
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const baseTemplateTenantAssociation =
|
|
16
|
+
* await client.tenants.templates.retrieve('template_id', {
|
|
17
|
+
* tenant_id: 'tenant_id',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
retrieve(templateID: string, params: TemplateRetrieveParams, options?: RequestOptions): APIPromise<TenantsAPI.BaseTemplateTenantAssociation>;
|
|
22
|
+
/**
|
|
23
|
+
* List Templates in Tenant
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const templates = await client.tenants.templates.list(
|
|
28
|
+
* 'tenant_id',
|
|
29
|
+
* );
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
list(tenantID: string, query?: TemplateListParams | null | undefined, options?: RequestOptions): APIPromise<TemplateListResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Publishes a specific version of a notification template for a tenant.
|
|
35
|
+
*
|
|
36
|
+
* The template must already exist in the tenant's notification map. If no version
|
|
37
|
+
* is specified, defaults to publishing the "latest" version.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const postTenantTemplatePublishResponse =
|
|
42
|
+
* await client.tenants.templates.publish('template_id', {
|
|
43
|
+
* tenant_id: 'tenant_id',
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
publish(templateID: string, params: TemplatePublishParams, options?: RequestOptions): APIPromise<TenantsAPI.PostTenantTemplatePublishResponse>;
|
|
48
|
+
/**
|
|
49
|
+
* Creates or updates a notification template for a tenant.
|
|
50
|
+
*
|
|
51
|
+
* If the template already exists for the tenant, it will be updated (200).
|
|
52
|
+
* Otherwise, a new template is created (201).
|
|
53
|
+
*
|
|
54
|
+
* Optionally publishes the template immediately if the `published` flag is set to
|
|
55
|
+
* true.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* const putTenantTemplateResponse =
|
|
60
|
+
* await client.tenants.templates.replace('template_id', {
|
|
61
|
+
* tenant_id: 'tenant_id',
|
|
62
|
+
* template: {
|
|
63
|
+
* content: { elements: [{}], version: 'version' },
|
|
64
|
+
* },
|
|
65
|
+
* });
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
replace(templateID: string, params: TemplateReplaceParams, options?: RequestOptions): APIPromise<TenantsAPI.PutTenantTemplateResponse>;
|
|
69
|
+
}
|
|
70
|
+
export interface TemplateListResponse {
|
|
71
|
+
/**
|
|
72
|
+
* Set to true when there are more pages that can be retrieved.
|
|
73
|
+
*/
|
|
74
|
+
has_more: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Always set to `list`. Represents the type of this object.
|
|
77
|
+
*/
|
|
78
|
+
type: 'list';
|
|
79
|
+
/**
|
|
80
|
+
* A url that may be used to generate these results.
|
|
81
|
+
*/
|
|
82
|
+
url: string;
|
|
83
|
+
/**
|
|
84
|
+
* A pointer to the next page of results. Defined only when `has_more` is set to
|
|
85
|
+
* true
|
|
86
|
+
*/
|
|
87
|
+
cursor?: string | null;
|
|
88
|
+
items?: Array<TemplateListResponse.Item> | null;
|
|
89
|
+
/**
|
|
90
|
+
* A url that may be used to generate fetch the next set of results. Defined only
|
|
91
|
+
* when `has_more` is set to true
|
|
92
|
+
*/
|
|
93
|
+
next_url?: string | null;
|
|
94
|
+
}
|
|
95
|
+
export declare namespace TemplateListResponse {
|
|
96
|
+
interface Item extends TenantsAPI.BaseTemplateTenantAssociation {
|
|
97
|
+
/**
|
|
98
|
+
* The template's data containing it's routing configs
|
|
99
|
+
*/
|
|
100
|
+
data: Item.Data;
|
|
101
|
+
}
|
|
102
|
+
namespace Item {
|
|
103
|
+
/**
|
|
104
|
+
* The template's data containing it's routing configs
|
|
105
|
+
*/
|
|
106
|
+
interface Data {
|
|
107
|
+
routing: Shared.MessageRouting;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
export interface TemplateRetrieveParams {
|
|
112
|
+
/**
|
|
113
|
+
* Id of the tenant for which to retrieve the template.
|
|
114
|
+
*/
|
|
115
|
+
tenant_id: string;
|
|
116
|
+
}
|
|
117
|
+
export interface TemplateListParams {
|
|
118
|
+
/**
|
|
119
|
+
* Continue the pagination with the next cursor
|
|
120
|
+
*/
|
|
121
|
+
cursor?: string | null;
|
|
122
|
+
/**
|
|
123
|
+
* The number of templates to return (defaults to 20, maximum value of 100)
|
|
124
|
+
*/
|
|
125
|
+
limit?: number | null;
|
|
126
|
+
}
|
|
127
|
+
export interface TemplatePublishParams {
|
|
128
|
+
/**
|
|
129
|
+
* Path param: Id of the tenant that owns the template.
|
|
130
|
+
*/
|
|
131
|
+
tenant_id: string;
|
|
132
|
+
/**
|
|
133
|
+
* Body param: The version of the template to publish (e.g., "v1", "v2", "latest").
|
|
134
|
+
* If not provided, defaults to "latest".
|
|
135
|
+
*/
|
|
136
|
+
version?: string;
|
|
137
|
+
}
|
|
138
|
+
export interface TemplateReplaceParams {
|
|
139
|
+
/**
|
|
140
|
+
* Path param: Id of the tenant for which to create or update the template.
|
|
141
|
+
*/
|
|
142
|
+
tenant_id: string;
|
|
143
|
+
/**
|
|
144
|
+
* Body param: Template configuration for creating or updating a tenant
|
|
145
|
+
* notification template
|
|
146
|
+
*/
|
|
147
|
+
template: TenantsAPI.TenantTemplateInput;
|
|
148
|
+
/**
|
|
149
|
+
* Body param: Whether to publish the template immediately after saving. When true,
|
|
150
|
+
* the template becomes the active/published version. When false (default), the
|
|
151
|
+
* template is saved as a draft.
|
|
152
|
+
*/
|
|
153
|
+
published?: boolean;
|
|
154
|
+
}
|
|
155
|
+
export declare namespace Templates {
|
|
156
|
+
export { type TemplateListResponse as TemplateListResponse, type TemplateRetrieveParams as TemplateRetrieveParams, type TemplateListParams as TemplateListParams, type TemplatePublishParams as TemplatePublishParams, type TemplateReplaceParams as TemplateReplaceParams, };
|
|
157
|
+
export { Versions as Versions, type VersionRetrieveParams as VersionRetrieveParams };
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=templates.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.mts","sourceRoot":"","sources":["../../../src/resources/tenants/templates/templates.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import * as Shared from "../../shared.js";
|
|
3
|
+
import * as TenantsAPI from "../tenants.js";
|
|
4
|
+
import * as VersionsAPI from "./versions.js";
|
|
5
|
+
import { VersionRetrieveParams, Versions } from "./versions.js";
|
|
6
|
+
import { APIPromise } from "../../../core/api-promise.js";
|
|
7
|
+
import { RequestOptions } from "../../../internal/request-options.js";
|
|
8
|
+
export declare class Templates extends APIResource {
|
|
9
|
+
versions: VersionsAPI.Versions;
|
|
10
|
+
/**
|
|
11
|
+
* Get a Template in Tenant
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const baseTemplateTenantAssociation =
|
|
16
|
+
* await client.tenants.templates.retrieve('template_id', {
|
|
17
|
+
* tenant_id: 'tenant_id',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
retrieve(templateID: string, params: TemplateRetrieveParams, options?: RequestOptions): APIPromise<TenantsAPI.BaseTemplateTenantAssociation>;
|
|
22
|
+
/**
|
|
23
|
+
* List Templates in Tenant
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const templates = await client.tenants.templates.list(
|
|
28
|
+
* 'tenant_id',
|
|
29
|
+
* );
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
list(tenantID: string, query?: TemplateListParams | null | undefined, options?: RequestOptions): APIPromise<TemplateListResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Publishes a specific version of a notification template for a tenant.
|
|
35
|
+
*
|
|
36
|
+
* The template must already exist in the tenant's notification map. If no version
|
|
37
|
+
* is specified, defaults to publishing the "latest" version.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const postTenantTemplatePublishResponse =
|
|
42
|
+
* await client.tenants.templates.publish('template_id', {
|
|
43
|
+
* tenant_id: 'tenant_id',
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
publish(templateID: string, params: TemplatePublishParams, options?: RequestOptions): APIPromise<TenantsAPI.PostTenantTemplatePublishResponse>;
|
|
48
|
+
/**
|
|
49
|
+
* Creates or updates a notification template for a tenant.
|
|
50
|
+
*
|
|
51
|
+
* If the template already exists for the tenant, it will be updated (200).
|
|
52
|
+
* Otherwise, a new template is created (201).
|
|
53
|
+
*
|
|
54
|
+
* Optionally publishes the template immediately if the `published` flag is set to
|
|
55
|
+
* true.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* const putTenantTemplateResponse =
|
|
60
|
+
* await client.tenants.templates.replace('template_id', {
|
|
61
|
+
* tenant_id: 'tenant_id',
|
|
62
|
+
* template: {
|
|
63
|
+
* content: { elements: [{}], version: 'version' },
|
|
64
|
+
* },
|
|
65
|
+
* });
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
replace(templateID: string, params: TemplateReplaceParams, options?: RequestOptions): APIPromise<TenantsAPI.PutTenantTemplateResponse>;
|
|
69
|
+
}
|
|
70
|
+
export interface TemplateListResponse {
|
|
71
|
+
/**
|
|
72
|
+
* Set to true when there are more pages that can be retrieved.
|
|
73
|
+
*/
|
|
74
|
+
has_more: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Always set to `list`. Represents the type of this object.
|
|
77
|
+
*/
|
|
78
|
+
type: 'list';
|
|
79
|
+
/**
|
|
80
|
+
* A url that may be used to generate these results.
|
|
81
|
+
*/
|
|
82
|
+
url: string;
|
|
83
|
+
/**
|
|
84
|
+
* A pointer to the next page of results. Defined only when `has_more` is set to
|
|
85
|
+
* true
|
|
86
|
+
*/
|
|
87
|
+
cursor?: string | null;
|
|
88
|
+
items?: Array<TemplateListResponse.Item> | null;
|
|
89
|
+
/**
|
|
90
|
+
* A url that may be used to generate fetch the next set of results. Defined only
|
|
91
|
+
* when `has_more` is set to true
|
|
92
|
+
*/
|
|
93
|
+
next_url?: string | null;
|
|
94
|
+
}
|
|
95
|
+
export declare namespace TemplateListResponse {
|
|
96
|
+
interface Item extends TenantsAPI.BaseTemplateTenantAssociation {
|
|
97
|
+
/**
|
|
98
|
+
* The template's data containing it's routing configs
|
|
99
|
+
*/
|
|
100
|
+
data: Item.Data;
|
|
101
|
+
}
|
|
102
|
+
namespace Item {
|
|
103
|
+
/**
|
|
104
|
+
* The template's data containing it's routing configs
|
|
105
|
+
*/
|
|
106
|
+
interface Data {
|
|
107
|
+
routing: Shared.MessageRouting;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
export interface TemplateRetrieveParams {
|
|
112
|
+
/**
|
|
113
|
+
* Id of the tenant for which to retrieve the template.
|
|
114
|
+
*/
|
|
115
|
+
tenant_id: string;
|
|
116
|
+
}
|
|
117
|
+
export interface TemplateListParams {
|
|
118
|
+
/**
|
|
119
|
+
* Continue the pagination with the next cursor
|
|
120
|
+
*/
|
|
121
|
+
cursor?: string | null;
|
|
122
|
+
/**
|
|
123
|
+
* The number of templates to return (defaults to 20, maximum value of 100)
|
|
124
|
+
*/
|
|
125
|
+
limit?: number | null;
|
|
126
|
+
}
|
|
127
|
+
export interface TemplatePublishParams {
|
|
128
|
+
/**
|
|
129
|
+
* Path param: Id of the tenant that owns the template.
|
|
130
|
+
*/
|
|
131
|
+
tenant_id: string;
|
|
132
|
+
/**
|
|
133
|
+
* Body param: The version of the template to publish (e.g., "v1", "v2", "latest").
|
|
134
|
+
* If not provided, defaults to "latest".
|
|
135
|
+
*/
|
|
136
|
+
version?: string;
|
|
137
|
+
}
|
|
138
|
+
export interface TemplateReplaceParams {
|
|
139
|
+
/**
|
|
140
|
+
* Path param: Id of the tenant for which to create or update the template.
|
|
141
|
+
*/
|
|
142
|
+
tenant_id: string;
|
|
143
|
+
/**
|
|
144
|
+
* Body param: Template configuration for creating or updating a tenant
|
|
145
|
+
* notification template
|
|
146
|
+
*/
|
|
147
|
+
template: TenantsAPI.TenantTemplateInput;
|
|
148
|
+
/**
|
|
149
|
+
* Body param: Whether to publish the template immediately after saving. When true,
|
|
150
|
+
* the template becomes the active/published version. When false (default), the
|
|
151
|
+
* template is saved as a draft.
|
|
152
|
+
*/
|
|
153
|
+
published?: boolean;
|
|
154
|
+
}
|
|
155
|
+
export declare namespace Templates {
|
|
156
|
+
export { type TemplateListResponse as TemplateListResponse, type TemplateRetrieveParams as TemplateRetrieveParams, type TemplateListParams as TemplateListParams, type TemplatePublishParams as TemplatePublishParams, type TemplateReplaceParams as TemplateReplaceParams, };
|
|
157
|
+
export { Versions as Versions, type VersionRetrieveParams as VersionRetrieveParams };
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/resources/tenants/templates/templates.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Templates = void 0;
|
|
5
|
+
const tslib_1 = require("../../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../../core/resource.js");
|
|
7
|
+
const VersionsAPI = tslib_1.__importStar(require("./versions.js"));
|
|
8
|
+
const versions_1 = require("./versions.js");
|
|
9
|
+
const path_1 = require("../../../internal/utils/path.js");
|
|
10
|
+
class Templates extends resource_1.APIResource {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.versions = new VersionsAPI.Versions(this._client);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get a Template in Tenant
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const baseTemplateTenantAssociation =
|
|
21
|
+
* await client.tenants.templates.retrieve('template_id', {
|
|
22
|
+
* tenant_id: 'tenant_id',
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
retrieve(templateID, params, options) {
|
|
27
|
+
const { tenant_id } = params;
|
|
28
|
+
return this._client.get((0, path_1.path) `/tenants/${tenant_id}/templates/${templateID}`, options);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* List Templates in Tenant
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const templates = await client.tenants.templates.list(
|
|
36
|
+
* 'tenant_id',
|
|
37
|
+
* );
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
list(tenantID, query = {}, options) {
|
|
41
|
+
return this._client.get((0, path_1.path) `/tenants/${tenantID}/templates`, { query, ...options });
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Publishes a specific version of a notification template for a tenant.
|
|
45
|
+
*
|
|
46
|
+
* The template must already exist in the tenant's notification map. If no version
|
|
47
|
+
* is specified, defaults to publishing the "latest" version.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const postTenantTemplatePublishResponse =
|
|
52
|
+
* await client.tenants.templates.publish('template_id', {
|
|
53
|
+
* tenant_id: 'tenant_id',
|
|
54
|
+
* });
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
publish(templateID, params, options) {
|
|
58
|
+
const { tenant_id, ...body } = params;
|
|
59
|
+
return this._client.post((0, path_1.path) `/tenants/${tenant_id}/templates/${templateID}/publish`, {
|
|
60
|
+
body,
|
|
61
|
+
...options,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Creates or updates a notification template for a tenant.
|
|
66
|
+
*
|
|
67
|
+
* If the template already exists for the tenant, it will be updated (200).
|
|
68
|
+
* Otherwise, a new template is created (201).
|
|
69
|
+
*
|
|
70
|
+
* Optionally publishes the template immediately if the `published` flag is set to
|
|
71
|
+
* true.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* const putTenantTemplateResponse =
|
|
76
|
+
* await client.tenants.templates.replace('template_id', {
|
|
77
|
+
* tenant_id: 'tenant_id',
|
|
78
|
+
* template: {
|
|
79
|
+
* content: { elements: [{}], version: 'version' },
|
|
80
|
+
* },
|
|
81
|
+
* });
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
replace(templateID, params, options) {
|
|
85
|
+
const { tenant_id, ...body } = params;
|
|
86
|
+
return this._client.put((0, path_1.path) `/tenants/${tenant_id}/templates/${templateID}`, { body, ...options });
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.Templates = Templates;
|
|
90
|
+
Templates.Versions = versions_1.Versions;
|
|
91
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/resources/tenants/templates/templates.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AAGrD,mEAA0C;AAC1C,4CAA6D;AAG7D,0DAAoD;AAEpD,MAAa,SAAU,SAAQ,sBAAW;IAA1C;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA8F1E,CAAC;IA5FC;;;;;;;;;;OAUG;IACH,QAAQ,CACN,UAAkB,EAClB,MAA8B,EAC9B,OAAwB;QAExB,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,YAAY,SAAS,cAAc,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;IACxF,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,CACF,QAAgB,EAChB,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,YAAY,QAAQ,YAAY,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvF,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,OAAO,CACL,UAAkB,EAClB,MAA6B,EAC7B,OAAwB;QAExB,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,YAAY,SAAS,cAAc,UAAU,UAAU,EAAE;YACpF,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CACL,UAAkB,EAClB,MAA6B,EAC7B,OAAwB;QAExB,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,YAAY,SAAS,cAAc,UAAU,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrG,CAAC;CACF;AA/FD,8BA+FC;AAuGD,SAAS,CAAC,QAAQ,GAAG,mBAAQ,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import * as VersionsAPI from "./versions.mjs";
|
|
4
|
+
import { Versions } from "./versions.mjs";
|
|
5
|
+
import { path } from "../../../internal/utils/path.mjs";
|
|
6
|
+
export class Templates extends APIResource {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.versions = new VersionsAPI.Versions(this._client);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Get a Template in Tenant
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const baseTemplateTenantAssociation =
|
|
17
|
+
* await client.tenants.templates.retrieve('template_id', {
|
|
18
|
+
* tenant_id: 'tenant_id',
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
retrieve(templateID, params, options) {
|
|
23
|
+
const { tenant_id } = params;
|
|
24
|
+
return this._client.get(path `/tenants/${tenant_id}/templates/${templateID}`, options);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* List Templates in Tenant
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const templates = await client.tenants.templates.list(
|
|
32
|
+
* 'tenant_id',
|
|
33
|
+
* );
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
list(tenantID, query = {}, options) {
|
|
37
|
+
return this._client.get(path `/tenants/${tenantID}/templates`, { query, ...options });
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Publishes a specific version of a notification template for a tenant.
|
|
41
|
+
*
|
|
42
|
+
* The template must already exist in the tenant's notification map. If no version
|
|
43
|
+
* is specified, defaults to publishing the "latest" version.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const postTenantTemplatePublishResponse =
|
|
48
|
+
* await client.tenants.templates.publish('template_id', {
|
|
49
|
+
* tenant_id: 'tenant_id',
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
publish(templateID, params, options) {
|
|
54
|
+
const { tenant_id, ...body } = params;
|
|
55
|
+
return this._client.post(path `/tenants/${tenant_id}/templates/${templateID}/publish`, {
|
|
56
|
+
body,
|
|
57
|
+
...options,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Creates or updates a notification template for a tenant.
|
|
62
|
+
*
|
|
63
|
+
* If the template already exists for the tenant, it will be updated (200).
|
|
64
|
+
* Otherwise, a new template is created (201).
|
|
65
|
+
*
|
|
66
|
+
* Optionally publishes the template immediately if the `published` flag is set to
|
|
67
|
+
* true.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const putTenantTemplateResponse =
|
|
72
|
+
* await client.tenants.templates.replace('template_id', {
|
|
73
|
+
* tenant_id: 'tenant_id',
|
|
74
|
+
* template: {
|
|
75
|
+
* content: { elements: [{}], version: 'version' },
|
|
76
|
+
* },
|
|
77
|
+
* });
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
replace(templateID, params, options) {
|
|
81
|
+
const { tenant_id, ...body } = params;
|
|
82
|
+
return this._client.put(path `/tenants/${tenant_id}/templates/${templateID}`, { body, ...options });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
Templates.Versions = Versions;
|
|
86
|
+
//# sourceMappingURL=templates.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.mjs","sourceRoot":"","sources":["../../../src/resources/tenants/templates/templates.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,KAAK,WAAW;OAChB,EAAyB,QAAQ,EAAE;OAGnC,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,SAAU,SAAQ,WAAW;IAA1C;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA8F1E,CAAC;IA5FC;;;;;;;;;;OAUG;IACH,QAAQ,CACN,UAAkB,EAClB,MAA8B,EAC9B,OAAwB;QAExB,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,YAAY,SAAS,cAAc,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;IACxF,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,CACF,QAAgB,EAChB,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,YAAY,QAAQ,YAAY,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvF,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,OAAO,CACL,UAAkB,EAClB,MAA6B,EAC7B,OAAwB;QAExB,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,YAAY,SAAS,cAAc,UAAU,UAAU,EAAE;YACpF,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CACL,UAAkB,EAClB,MAA6B,EAC7B,OAAwB;QAExB,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,YAAY,SAAS,cAAc,UAAU,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrG,CAAC;CACF;AAuGD,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import * as TenantsAPI from "../tenants.mjs";
|
|
3
|
+
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
4
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
5
|
+
export declare class Versions extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Fetches a specific version of a tenant template.
|
|
8
|
+
*
|
|
9
|
+
* Supports the following version formats:
|
|
10
|
+
*
|
|
11
|
+
* - `latest` - The most recent version of the template
|
|
12
|
+
* - `published` - The currently published version
|
|
13
|
+
* - `v{version}` - A specific version (e.g., "v1", "v2", "v1.0.0")
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const baseTemplateTenantAssociation =
|
|
18
|
+
* await client.tenants.templates.versions.retrieve(
|
|
19
|
+
* 'version',
|
|
20
|
+
* { tenant_id: 'tenant_id', template_id: 'template_id' },
|
|
21
|
+
* );
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
retrieve(version: string, params: VersionRetrieveParams, options?: RequestOptions): APIPromise<TenantsAPI.BaseTemplateTenantAssociation>;
|
|
25
|
+
}
|
|
26
|
+
export interface VersionRetrieveParams {
|
|
27
|
+
/**
|
|
28
|
+
* Id of the tenant for which to retrieve the template.
|
|
29
|
+
*/
|
|
30
|
+
tenant_id: string;
|
|
31
|
+
/**
|
|
32
|
+
* Id of the template to be retrieved.
|
|
33
|
+
*/
|
|
34
|
+
template_id: string;
|
|
35
|
+
}
|
|
36
|
+
export declare namespace Versions {
|
|
37
|
+
export { type VersionRetrieveParams as VersionRetrieveParams };
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=versions.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versions.d.mts","sourceRoot":"","sources":["../../../src/resources/tenants/templates/versions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CACN,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,qBAAqB,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,UAAU,CAAC,6BAA6B,CAAC;CAOxD;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,qBAAqB,IAAI,qBAAqB,EAAE,CAAC;CAChE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import * as TenantsAPI from "../tenants.js";
|
|
3
|
+
import { APIPromise } from "../../../core/api-promise.js";
|
|
4
|
+
import { RequestOptions } from "../../../internal/request-options.js";
|
|
5
|
+
export declare class Versions extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Fetches a specific version of a tenant template.
|
|
8
|
+
*
|
|
9
|
+
* Supports the following version formats:
|
|
10
|
+
*
|
|
11
|
+
* - `latest` - The most recent version of the template
|
|
12
|
+
* - `published` - The currently published version
|
|
13
|
+
* - `v{version}` - A specific version (e.g., "v1", "v2", "v1.0.0")
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const baseTemplateTenantAssociation =
|
|
18
|
+
* await client.tenants.templates.versions.retrieve(
|
|
19
|
+
* 'version',
|
|
20
|
+
* { tenant_id: 'tenant_id', template_id: 'template_id' },
|
|
21
|
+
* );
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
retrieve(version: string, params: VersionRetrieveParams, options?: RequestOptions): APIPromise<TenantsAPI.BaseTemplateTenantAssociation>;
|
|
25
|
+
}
|
|
26
|
+
export interface VersionRetrieveParams {
|
|
27
|
+
/**
|
|
28
|
+
* Id of the tenant for which to retrieve the template.
|
|
29
|
+
*/
|
|
30
|
+
tenant_id: string;
|
|
31
|
+
/**
|
|
32
|
+
* Id of the template to be retrieved.
|
|
33
|
+
*/
|
|
34
|
+
template_id: string;
|
|
35
|
+
}
|
|
36
|
+
export declare namespace Versions {
|
|
37
|
+
export { type VersionRetrieveParams as VersionRetrieveParams };
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=versions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../src/resources/tenants/templates/versions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CACN,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,qBAAqB,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,UAAU,CAAC,6BAA6B,CAAC;CAOxD;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,qBAAqB,IAAI,qBAAqB,EAAE,CAAC;CAChE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Versions = void 0;
|
|
5
|
+
const resource_1 = require("../../../core/resource.js");
|
|
6
|
+
const path_1 = require("../../../internal/utils/path.js");
|
|
7
|
+
class Versions extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Fetches a specific version of a tenant template.
|
|
10
|
+
*
|
|
11
|
+
* Supports the following version formats:
|
|
12
|
+
*
|
|
13
|
+
* - `latest` - The most recent version of the template
|
|
14
|
+
* - `published` - The currently published version
|
|
15
|
+
* - `v{version}` - A specific version (e.g., "v1", "v2", "v1.0.0")
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const baseTemplateTenantAssociation =
|
|
20
|
+
* await client.tenants.templates.versions.retrieve(
|
|
21
|
+
* 'version',
|
|
22
|
+
* { tenant_id: 'tenant_id', template_id: 'template_id' },
|
|
23
|
+
* );
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
retrieve(version, params, options) {
|
|
27
|
+
const { tenant_id, template_id } = params;
|
|
28
|
+
return this._client.get((0, path_1.path) `/tenants/${tenant_id}/templates/${template_id}/versions/${version}`, options);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.Versions = Versions;
|
|
32
|
+
//# sourceMappingURL=versions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../src/resources/tenants/templates/versions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAIrD,0DAAoD;AAEpD,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CACN,OAAe,EACf,MAA6B,EAC7B,OAAwB;QAExB,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;QAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CACrB,IAAA,WAAI,EAAA,YAAY,SAAS,cAAc,WAAW,aAAa,OAAO,EAAE,EACxE,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AA9BD,4BA8BC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import { path } from "../../../internal/utils/path.mjs";
|
|
4
|
+
export class Versions extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Fetches a specific version of a tenant template.
|
|
7
|
+
*
|
|
8
|
+
* Supports the following version formats:
|
|
9
|
+
*
|
|
10
|
+
* - `latest` - The most recent version of the template
|
|
11
|
+
* - `published` - The currently published version
|
|
12
|
+
* - `v{version}` - A specific version (e.g., "v1", "v2", "v1.0.0")
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const baseTemplateTenantAssociation =
|
|
17
|
+
* await client.tenants.templates.versions.retrieve(
|
|
18
|
+
* 'version',
|
|
19
|
+
* { tenant_id: 'tenant_id', template_id: 'template_id' },
|
|
20
|
+
* );
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
retrieve(version, params, options) {
|
|
24
|
+
const { tenant_id, template_id } = params;
|
|
25
|
+
return this._client.get(path `/tenants/${tenant_id}/templates/${template_id}/versions/${version}`, options);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=versions.mjs.map
|