ampscript-data 0.2.0 → 1.1.0
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 +50 -0
- package/package.json +1 -1
- package/src/index.js +2609 -576
package/README.md
CHANGED
|
@@ -28,6 +28,9 @@ import {
|
|
|
28
28
|
FUNCTION_CANONICAL_MAP,
|
|
29
29
|
deprecatedFunctionLookup,
|
|
30
30
|
isEmailExcluded,
|
|
31
|
+
isMcnSupported,
|
|
32
|
+
getMcnApiVersion,
|
|
33
|
+
getMcnNotes,
|
|
31
34
|
} from 'ampscript-data';
|
|
32
35
|
```
|
|
33
36
|
|
|
@@ -50,6 +53,8 @@ for (const fn of FUNCTIONS) {
|
|
|
50
53
|
console.log(fn.example); // usage example (where available)
|
|
51
54
|
console.log(fn.docUrl); // URL to official Salesforce developer docs
|
|
52
55
|
console.log(fn.guideUrl); // URL to ampscript.guide reference page
|
|
56
|
+
console.log(fn.mcnSince); // API version when MCN support was added (null = MCE only)
|
|
57
|
+
console.log(fn.mcnNotes); // behavioral differences on MCN (null = none)
|
|
53
58
|
}
|
|
54
59
|
```
|
|
55
60
|
|
|
@@ -117,6 +122,51 @@ import { isEmailExcluded } from 'ampscript-data';
|
|
|
117
122
|
isEmailExcluded('HTTPGet'); // true — not available in email
|
|
118
123
|
```
|
|
119
124
|
|
|
125
|
+
## Marketing Cloud Next (MCN) compatibility
|
|
126
|
+
|
|
127
|
+
Each `FunctionEntry` has two MCN fields:
|
|
128
|
+
|
|
129
|
+
| Field | Type | Description |
|
|
130
|
+
|---|---|---|
|
|
131
|
+
| `mcnSince` | `number \| null` | API version when MCN support was added (e.g. `67`); `null` means MCE only |
|
|
132
|
+
| `mcnNotes` | `string \| null` | Behavioral differences on MCN vs MCE; `null` means no known differences |
|
|
133
|
+
|
|
134
|
+
Three helper functions are exported for programmatic MCN checks:
|
|
135
|
+
|
|
136
|
+
### `isMcnSupported`
|
|
137
|
+
|
|
138
|
+
Returns `true` when the function is available on Marketing Cloud Next:
|
|
139
|
+
|
|
140
|
+
```js
|
|
141
|
+
import { isMcnSupported } from 'ampscript-data';
|
|
142
|
+
|
|
143
|
+
isMcnSupported('Lookup'); // true
|
|
144
|
+
isMcnSupported('HTTPGet'); // false
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### `getMcnApiVersion`
|
|
148
|
+
|
|
149
|
+
Returns the API version number (e.g. `67`) when MCN support was added, or `null` for MCE-only functions:
|
|
150
|
+
|
|
151
|
+
```js
|
|
152
|
+
import { getMcnApiVersion } from 'ampscript-data';
|
|
153
|
+
|
|
154
|
+
getMcnApiVersion('Lookup'); // 67
|
|
155
|
+
getMcnApiVersion('HTTPGet'); // null
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### `getMcnNotes`
|
|
159
|
+
|
|
160
|
+
Returns a string describing behavioral differences on MCN, or `null` when the function behaves identically across platforms:
|
|
161
|
+
|
|
162
|
+
```js
|
|
163
|
+
import { getMcnNotes } from 'ampscript-data';
|
|
164
|
+
|
|
165
|
+
getMcnNotes('FormatDate'); // "In Marketing Cloud Next, this function uses ..."
|
|
166
|
+
getMcnNotes('Lookup'); // "In Marketing Cloud Next, an odd number of search ..."
|
|
167
|
+
getMcnNotes('ProperCase'); // null
|
|
168
|
+
```
|
|
169
|
+
|
|
120
170
|
### `AMPSCRIPT_KEYWORDS`
|
|
121
171
|
|
|
122
172
|
An array of AMPscript language keywords (`IF`, `FOR`, `SET`, etc.):
|